]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Prevent crashes on MS-Windows when w32-downcase-file-names is non-nil.
[gnu-emacs] / src / ChangeLog
1 2012-11-18 Eli Zaretskii <eliz@gnu.org>
2
3 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
5 dostounix_filename. Prevents crashes down the road, because
6 dostounix_filename assumes it gets a unibyte string. Reported by
7 Michel de Ruiter <michel@sentient.nl>, see
8 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
9
10 2012-11-17 Eli Zaretskii <eliz@gnu.org>
11
12 * w32select.c: Include w32common.h before w32term.h, so that
13 windows.h gets included before w32term.h uses some of its
14 features, see below.
15
16 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
17 typedefs.
18 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
19 prototypes.
20 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
21
22 2012-11-17 Jan Djärv <jan.h.d@swipnet.se>
23
24 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
25 (ns_select): Return at once if events are held (Bug#12834).
26
27 2012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
28
29 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
30 Needed following 2012-10-20 change. (Bug#12902)
31
32 2012-11-16 Glenn Morris <rgm@gnu.org>
33
34 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
35
36 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
37
38 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
39
40 2012-11-14 Eli Zaretskii <eliz@gnu.org>
41
42 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
43 use the same value of thread handle.
44 (start_timer_thread): If the timer thread exited (due to error),
45 clean up by closing the two handles it used. Duplicate the caller
46 thread's handle here, so it gets duplicated only once, when
47 launching the timer thread. Set priority of the timer thread, not
48 the caller thread.
49 (getitimer): Don't duplicate the caller thread's handle here.
50 (Bug#12832)
51
52 2012-11-13 Jan Djärv <jan.h.d@swipnet.se>
53
54 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
55 called (Bug#12834).
56
57 2012-11-12 Eli Zaretskii <eliz@gnu.org>
58
59 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
60 passed to pint2str and pint2hrstr to be at most the size of the
61 frame's decode_mode_spec_buffer. This avoids crashes with very
62 large values of FIELD_WIDTH argument to decode_mode_spec.
63 (Bug#12867)
64
65 2012-11-07 Martin Rudalics <rudalics@gmx.at>
66
67 * window.c (Fsplit_window_internal): Set combination limit of
68 new parent window to t iff Vwindow_combination_limit is t;
69 fixing a regression introduced with the change from 2012-09-22.
70 (Fwindow_combination_limit, Fset_window_combination_limit):
71 Fix doc-strings.
72
73 2012-11-06 Eli Zaretskii <eliz@gnu.org>
74
75 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
76 amount when the scroll margins are too large. When scrolling
77 backwards in the buffer, give up if cannot reach point or the
78 scroll margin within a reasonable number of screen lines.
79 Fixes point position in window under scroll-up/down-aggressively when
80 point is positioned many lines beyond the window top/bottom.
81 (Bug#12811)
82
83 2012-11-05 Eli Zaretskii <eliz@gnu.org>
84
85 * ralloc.c (relinquish): If real_morecore fails to return memory
86 to the system, don't crash; instead, leave the last heap
87 unchanged and return. (Bug#12774)
88
89 2012-11-03 Eli Zaretskii <eliz@gnu.org>
90
91 * lisp.mk: Adjust comments to the fact that term/internal is now
92 loaded from loadup.el.
93
94 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
95 (msdos_fatal_signal): New function.
96 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
97 its argument list.
98
99 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
100 for GCC versions before 4.
101 (emacs_raise): Define to call msdos_fatal_signal.
102
103 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
104 iterator when starting in the middle of a display or overlay
105 string. (Bug#12745)
106
107 2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
108
109 * widget.c (resize_cb): New function.
110 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
111 (EmacsFrameResize): Check if all is up to date before changing frame
112 size.
113
114 2012-11-01 Eli Zaretskii <eliz@gnu.org>
115
116 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
117
118 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
119
120 Fix crash when using Emacs as commit editor for git (Bug#12697).
121 * callproc.c (setpgrp): Remove macro, as we now use setpgid
122 and it is configured in conf_post.h.
123 (Fcall_process): Don't invoke both setsid and setpgid; the former
124 is enough, if it exists.
125 * callproc.c (Fcall_process, child_setup):
126 * process.c (create_process): Use setpgid.
127 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
128 for the real thing.
129 * dispnew.c (init_display): Initialize the foreground group
130 if we are running a tty display.
131 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
132 * lisp.h (init_foreground_group): New decl.
133 * sysdep.c (inherited_pgroup): New static var.
134 (init_foreground_group, tcsetpgrp_without_stopping)
135 (narrow_foreground_group, widen_foreground_group): New functions.
136 (init_sys_modes): Narrow foreground group.
137 (reset_sys_modes): Widen foreground group.
138
139 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
140
141 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
142
143 2012-10-31 Martin Rudalics <rudalics@gmx.at>
144
145 * minibuf.c (read_minibuf): Restore current buffer since
146 choose_minibuf_frame calling Fset_frame_selected_window may
147 change it (Bug#12766).
148
149 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
150
151 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
152
153 2012-10-30 Kenichi Handa <handa@gnu.org>
154
155 * font.c (Ffont_at): If WINDOW is specified and it is not
156 displaying the current buffer, signal an error.
157
158 2012-10-29 Daniel Colascione <dancol@dancol.org>
159
160 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
161 In preparation for fixing bug#12739, move these functions from
162 here...
163
164 * coding.h, coding.c: ... to here, and compile them only when
165 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
166 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
167
168 2012-10-28 Eli Zaretskii <eliz@gnu.org>
169
170 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
171 (timer_loop, getitimer, setitimer): Use it instead of
172 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
173 'clock'.
174 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
175 literal 10000.
176
177 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
178
179 * nsterm.m (NO_APPDEFINED_DATA): New define.
180 (last_appdefined_event_data): New variable
181 (last_appdefined_event): Remove.
182 (ns_select): Initialize t from last_appdefined_event_data instead
183 of [last_appdefined_event data1].
184 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
185 remove last_appdefined_event (Bug#12698).
186
187 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
188
189 * frame.c (x_set_font): Catch internal error.
190
191 2012-10-27 Eli Zaretskii <eliz@gnu.org>
192
193 Avoid overflow in w32 implementation of interval timers.
194 When possible, for ITIMER_PROF count only times the main thread
195 actually executes.
196 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
197 'volatile ULONGLONG' types. All the other data which was
198 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
199 (GetThreadTimes_Proc): New typedef.
200 (w32_get_timer_time): New function, returns a suitable time value
201 for the timer.
202 (timer_loop): Enter critical section when accessing ULONGLONG
203 values of the itimer_data struct, as these accesses are no longer
204 atomic. Call 'w32_get_timer_time' instead of 'clock'.
205 Remove unused variable.
206 (init_timers): Initialize s_pfn_Get_Thread_Times.
207 (start_timer_thread): Don't assign itimer->caller_thread here.
208 (getitimer): Assign itimer->caller_thread here.
209 (setitimer): Always call getitimer to get the value of ticks_now.
210 (sys_spawnve): Avoid compiler warning about format mismatch.
211
212 2012-10-26 Eli Zaretskii <eliz@gnu.org>
213
214 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
215 mouse movement events if the menu bar is active. This avoids
216 producing a busy "hour-glass" cursor by Windows if the mouse
217 pointer is positioned over a tooltip shown for some menu item.
218
219 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
220
221 Don't assume process IDs fit in int.
222 * emacs.c (shut_down_emacs) [!DOS_NT]:
223 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
224 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
225 Use pid_t, not int, to store process IDs, as 'int'
226 is not wide enough on a few platforms (e.g., AIX and IRIX).
227
228 2012-10-23 Kenichi Handa <handa@gnu.org>
229
230 The following change is to make face-font-rescale-alist work
231 correctly for non-ASCII fonts.
232
233 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
234 (font_open_for_lface): Handle Vface_font_rescale_alist.
235
236 2012-10-23 Chong Yidong <cyd@gnu.org>
237
238 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
239
240 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
241
242 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
243 for screen font.
244 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
245
246 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
247 event (Bug#12681).
248
249 2012-10-21 Glenn Morris <rgm@gnu.org>
250
251 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
252
253 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
254
255 Port to OpenBSD 5.1.
256 * frame.c (Fmouse_position, Fmouse_pixel_position):
257 * xdisp.c (produce_stretch_glyph):
258 Declare local vars only when they're needed.
259 This is clearer and avoids a warning on OpenBSD about unused vars.
260 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
261 This is safer, and avoids OpenBSD warnings about unused vars.
262 * keyboard.c (record_menu_key): Remove unnecessary decl.
263 (poll_timer): Define only if POLL_FOR_INPUT is defined.
264 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
265 as our definition clashes with OpenBSD's.
266 * xfaces.c (load_face_colors, check_lface_attrs)
267 (get_lface_attributes_no_remap, get_lface_attributes)
268 (lface_fully_specified_p, x_supports_face_attributes_p)
269 (tty_supports_face_attributes_p, face_fontset, realize_face)
270 (realize_x_face, realize_tty_face):
271 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
272 merely Lisp_Object *. This is more informative and avoids
273 a warning on OpenBSD about accessing beyond an object's size.
274
275 2012-10-20 Chong Yidong <cyd@gnu.org>
276
277 * lread.c (Fload): Doc fix (Bug#12592).
278
279 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
280
281 * font.c (Ffont_at): Fix previous change.
282
283 2012-10-19 Eli Zaretskii <eliz@gnu.org>
284
285 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
286 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
287 for the reasons.
288
289 * alloc.c (NSTATICS): Decrease to 0x800.
290
291 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
292
293 * fns.c (Fnreverse): Include the problem element when signalling an
294 error (bug#12677).
295
296 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
297
298 * nsterm.m (ns_select): Check writefds before call to
299 FD_ISSET (Bug#12668).
300
301 2012-10-18 Daniel Colascione <dancol@dancol.org>
302
303 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
304 (staticpro): If we run out of staticpro slots, die with an
305 informative error instead of just calling emacs_abort.
306
307 2012-10-18 Martin Rudalics <rudalics@gmx.at>
308
309 Fix two flaws reported by Dmitry Antipov.
310 * window.c (Ftemp_output_buffer_show): Remove.
311 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
312 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
313
314 2012-10-17 Eli Zaretskii <eliz@gnu.org>
315
316 * makefile.w32-in ($(BLD)/w32.$(O)):
317 ($(BLD)/vm-limit.$(O)):
318 ($(BLD)/term.$(O)):
319 ($(BLD)/unexw32.$(O)):
320 ($(BLD)/fileio.$(O)):
321 ($(BLD)/dispnew.$(O)): Update dependencies.
322
323 * w32term.h (w32_initialize_display_info, initialize_w32_display):
324 Add prototypes.
325
326 * w32proc.c: Include ctype.h.
327
328 * w32.h (init_environment, check_windows_init_file)
329 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
330 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
331 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
332 (sys_link): Add prototypes.
333
334 * w32.c: Include w32select.h.
335 (sys_access, e_malloc, sys_select): Add prototypes.
336 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
337
338 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
339
340 * unexw32.c: Include lisp.h and w32.h.
341
342 * term.c [WINDOWSNT]: Include w32term.h.
343
344 * process.c [WINDOWSNT]: Add prototype of sys_select.
345
346 * fileio.c [WINDOWSNT]: Include w32.h.
347
348 * dispnew.c [WINDOWSNT]: Include w32.h.
349
350 * cygw32.c (Fcygwin_convert_path_to_windows)
351 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
352 Lisp_Object values. (Bug#12661)
353
354 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
355 to Lisp_Object. (Bug#12661)
356
357 2012-10-17 Kenichi Handa <handa@gnu.org>
358
359 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
360 invalidate.
361
362 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
363
364 * buffer.c (Fkill_buffer): When unchaining the marker,
365 reset its buffer pointer to NULL (Bug#12652).
366
367 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
368
369 Do not verify indirection counters of killed buffers (Bug#12579).
370 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
371 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
372
373 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
374
375 * alloc.c (Fmake_byte_code): Fix typo in comment.
376 * print.c (print_interval): Define as static to match prototype.
377 * indent.c (disptab_matches_widthtab, recompute_width_table):
378 Convert to eassert.
379
380 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
381
382 * editfns.c (get_system_name): Remove.
383 * lisp.h (get_system_name): Remove prototype.
384 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
385 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
386
387 2012-10-15 Daniel Colascione <dancol@dancol.org>
388
389 * dbusbind.c: Add comment explaining reason for previous change.
390
391 2012-10-15 Martin Rudalics <rudalics@gmx.at>
392
393 * window.c (Fwindow_end): Rewrite check whether cached position
394 can be used (Bug#12600).
395 (resize_frame_windows, grow_mini_window, shrink_mini_window):
396 Set windows_or_buffers_changed.
397
398 2012-10-15 Daniel Colascione <dancol@dancol.org>
399
400 * dbusbind.c: Fix cygw32 build break when compiling with dbus
401 enabled by undefining the symbol "interface", which the platform
402 headers define to something incompatible.
403
404 2012-10-14 Daniel Colascione <dancol@dancol.org>
405
406 * image.c (init_tiff_functions, init_imagemagick_functions)
407 (init_svg_functions): Fix cygw32 build break by using these
408 functions only when WINDOWSNT _and_ HAVE_NTGUI.
409
410 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
411
412 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
413
414 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
415
416 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
417
418 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
419
420 * coding.c (detect_coding): Set coding->id before calling
421 this->detector.
422
423 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
424
425 * fileio.c: Formatting fixes.
426
427 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
428
429 Fix some stat-related races.
430 * fileio.c (Fwrite_region): Avoid race condition if a file is
431 removed or renamed by some other process immediately after Emacs
432 writes it but before Emacs stats it. Do not assume that stat (or
433 fstat) succeeds.
434 * image.c (slurp_file): Resolve the file name with fopen + fstat
435 rather than stat + fopen.
436 (pbm_read_file) [0]: Remove unused code with stat race.
437 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
438 Remove ineffective code with stat race.
439
440 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
441
442 * doc.c (get_doc_string): Don't signal an error if the file is missing.
443
444 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
445
446 * nsterm.m (hold_event_q): New static variable.
447 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
448 ! q_event_ptr.
449 (hold_event): New function.
450 (ns_read_socket): If hold_event_q have events, store them and
451 return (Bug#12384).
452 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
453 is zero (Bug#12384).
454
455 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
456
457 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
458
459 2012-10-12 Eli Zaretskii <eliz@gnu.org>
460
461 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
462
463 * fileio.c (check_existing): New function.
464 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
465 instead of calling 'stat', when what's needed is to check whether
466 a file exists. This avoids expensive system calls on MS-Windows.
467 (Bug#12587)
468
469 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
470
471 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
472 determine whether a file exists and is not a directory.
473
474 * lisp.h (check_existing): Add prototype.
475
476 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
477
478 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
479
480 2012-10-12 Glenn Morris <rgm@gnu.org>
481
482 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
483
484 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
485
486 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
487
488 * eval.c (Fautoload): Remember previous autoload status in load-history.
489
490 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
491
492 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
493 * lread.c (load_each_byte, new_backquote_flag, readchar)
494 (read_filtered_event, lisp_file_lexically_bound_p)
495 (safe_to_load_version, Fload, complete_filename_p, openp)
496 (build_load_history, readevalloop, read_escape, read1)
497 (string_to_number, read_vector, read_list):
498 * macros.c (Fstart_kbd_macro):
499 * marker.c (CONSIDER):
500 * menu.c (parse_single_submenu, digest_single_submenu)
501 (find_and_return_menu_selection, Fx_popup_menu):
502 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
503 (Ftry_completion):
504 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
505 (ns_menu_show):
506 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
507 (xmenu_show, xdialog_show):
508 Use bool for booleans.
509 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
510 as it's not a predicate. All uses changed. Omit unnecessary
511 buffer termination.
512
513 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
514
515 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
516 (save_excursion_restore): Do not restore mark if it was not saved.
517
518 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
519
520 * marker.c (cached_modiff): EMACS_INT, not int.
521
522 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
523 instead of having a wrong decl.
524 * nsmenu.m (waiting_for_input): Remove wrong decl.
525
526 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
527
528 keyboard.c, keymap.c: Use bool for booleans.
529 * dispnew.c (sit_for): Distinguish between 3-way display_option
530 and boolean do_display.
531 * keyboard.c (single_kboard, this_command_key_count_reset)
532 (waiting_for_input, echoing, immediate_quit, input_pending)
533 (interrupt_input, interrupts_deferred, pop_kboard)
534 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
535 (command_loop_1, adjust_point_for_property)
536 (safe_run_hooks_error, input_polling_used, read_char):
537 (help_char_p, readable_events, kbd_buffer_events_waiting)
538 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
539 (lucid_event_type_list_p, get_input_pending):
540 (gobble_input, menu_separator_name_p, menu_bar_item)
541 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
542 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
543 (keyremap_step, test_undefined, read_key_sequence)
544 (detect_input_pending, detect_input_pending_ignore_squeezables)
545 (detect_input_pending_run_timers, requeued_events_pending_p)
546 (quit_throw_to_read_char, Fset_input_interrupt_mode):
547 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
548 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
549 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
550 (accessible_keymaps_1, Fkey_description, push_key_description):
551 (shadow_lookup, struct where_is_internal_data)
552 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
553 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
554 (describe_map, describe_vector):
555 * menu.c (single_menu_item):
556 * nsmenu.m (ns_update_menubar):
557 * process.c (wait_reading_process_output):
558 * search.c (scan_buffer, scan_newline):
559 Use bool for boolean.
560 * keyboard.c (timers_run, swallow_events)
561 (detect_input_pending_run_timers):
562 * process.c (wait_reading_process_output):
563 Use unsigned for counter where wraparound-on-overflow is desired,
564 since unsigned is guaranteed to have that behavior and signed is not.
565 (read_char): Use ptrdiff_t for string length.
566 (get_input_pending): Remove first argument, since it was always
567 the same pointer-to-int (now pointer-to-boolean) &input_pending,
568 and behave as if it had that value. Return new value of
569 input_pending. All callers changed.
570 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
571 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
572 a string length.
573 * keymap.c (push_key_description): Omit last arg, which was always 1.
574 All callers changed.
575
576 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
577
578 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
579
580 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
581 ($(BLD)/term.$(O)): Update dependencies.
582
583 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
584
585 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
586 * lisp.h (enum pvec_type): Adjust comments and omit explicit
587 initializer for PVEC_NORMAL_VECTOR.
588
589 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
590
591 Clean out old termopts cruft.
592 * termopts.h (flow_control, meta_key): Remove unused decls.
593 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
594 Don't include termopts.h.
595
596 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
597
598 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
599
600 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
601
602 * commands.h (immediate_quit): Remove duplicate decl.
603
604 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
605
606 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
607 caching.
608 (nsfont_open): Remove setting of Vfonts_in_cache.
609 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
610
611 2012-10-09 Eli Zaretskii <eliz@gnu.org>
612
613 * w32fns.c (w32_last_error): Change the return value to DWORD, to
614 match what GetLastError returns. Explain why the function is
615 needed.
616
617 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
618 'is_tooltip_frame', to avoid confusion with its global namesake.
619
620 2012-10-08 Daniel Colascione <dancol@dancol.org>
621
622 * xdisp.c (start_hourglass): Call w32_note_current_window when
623 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
624 build that caused Emacs to display the hourglass cursor forever.
625
626 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
627 which is broken under remote desktop, calculate the number of
628 colors available for a display based on the display's number of
629 planes and number of bits per pixel per plane. (bug#10397).
630
631 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
632
633 * nsfont.m (Vfonts_in_cache): New variable.
634 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
635 are used. Add cached fonts to Vfonts_in_cache.
636 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
637
638 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
639
640 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
641 in nt/config.nt.
642 (FONT_H): Define after FRAME_H.
643 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
644 Update dependencies.
645
646 * w32term.c: Remove leftover declaration of keyboard_codepage.
647
648 2012-10-08 Eli Zaretskii <eliz@gnu.org>
649
650 * makefile.w32-in (FONT_H): Add $(FRAME_H).
651 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
652 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
653 (GLOBAL_SOURCES): Add cygw32.c.
654 ($(BLD)/unexw32.$(O)):
655 ($(BLD)/w32.$(O)):
656 ($(BLD)/w32console.$(O)):
657 ($(BLD)/w32fns.$(O)):
658 ($(BLD)/w32heap.$(O)):
659 ($(BLD)/w32menu.$(O)):
660 ($(BLD)/w32proc.$(O)): Add w32common.h.
661
662 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
663 'const char *'.
664 (x_to_w32_color): Don't modify the argument, modify a copy instead.
665
666 2012-10-08 Daniel Colascione <dancol@dancol.org>
667
668 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
669 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
670 accidental message numbering hole. Change other messages to
671 match.
672
673 * w32select.h (HAVE_W32SELECT): Remove.
674
675 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
676 w32common.h instead of w32heap.h.
677
678 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
679 (get_allocation_unit, get_processor_type, get_w32_major_version)
680 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
681 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
682 (OS_NT, os_subtype, cache_system_info): Move declarations to
683 w32common.
684
685 * w32heap.c: Include w32common.h.
686 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
687 (w32_minor_version, w32_build_number, w32_subtype):
688 Remove duplicate definitions.
689
690 * w32fns.c: Include w32common.h; include w32heap.h only in
691 WINDOWSNT.
692
693 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
694 Use `report_file_error' instead of `error' in order to better
695 inform users of what went wrong. Increase NTGUI_UNICODE file
696 dialog box file name length to 32k, the maximum allowed by the NT
697 kernel.
698
699 * w32common.h: New file.
700 (ROUND_UP, ROUND_DOWN, get_page_size)
701 (get_allocation_unit, get_processor_type, get_w32_major_version)
702 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
703 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
704 (OS_NT, os_subtype, cache_system_info): Move here.
705
706 * unexw32.c, unexcw.c: Include w32common.h.
707
708 * emacs.c (main): Use (defined (WINDOWSNT) || defined
709 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
710 to call syms_of_w32select.
711
712 * cygw32.h: Remove obsolete EXFUN declarations.
713
714 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
715
716 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
717 of w32inevt.o from SOME_MACHINE_OBJECTS.
718
719 2012-10-08 Daniel Colascione <dancol@dancol.org>
720
721 * image.c: Permanent fix for JPEG compilation issue --- limit
722 jpeglib `boolean' redefinition to Cygwin builds.
723
724 2012-10-08 Eli Zaretskii <eliz@gnu.org>
725
726 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
727
728 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
729 Cygwin.
730
731 2012-10-08 Daniel Colascione <dancol@dancol.org>
732
733 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
734 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
735 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
736 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
737 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
738 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
739 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
740 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
741 now a supported configuration.
742
743 * Makefile.in: consolidate image variables into LIBIMAGE; add
744 W32_OBJ and W32_LIBS. Compile new files.
745
746 * conf_post.h:
747 (_DebPrint) declare tracing facility for W32 debugging. We need
748 to unify tracing later.
749
750 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
751 unconditional use of W32 Unicode functions. Cygwin runs only on
752 100% Unicode operating systems.
753
754 * cygw32.c: New file. Define Cygwin-specific facilities.
755 (Fcygwin_convert_path_to_windows)
756 (Fcygwin_convert_path_from_windows): New user functions for
757 accessing Cygwin path-munging routines.
758
759 * cygw32.h: New file.
760 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
761 UTF-16LE strings temporarily inside non-Lisp-visible string
762 objects.
763
764 (w32_strerror): Just what it says on the tin.
765
766 * emacs.c: Make the NS fork-then-exec code for daemon-launching
767 also run for Cygwin; both systems have the same problem with using
768 GUI facilities in a forked child. Also call syms_of_cygw32,
769 syms_of_w32select in correct places.
770
771 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
772 needs fork-then-exec for daemon launching.
773
774 * font.h: Include frame.h.
775
776 * image.c: Use the image library cache machinery only when we're
777 compiling for native WINDOWSNT; Cygwin can use shared libraries
778 like any other Unixlike system.
779
780 * keyboard.c: Clarify a comment regarding the input loop.
781
782 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
783 functions directly instead of trying to detect at runtime that our
784 host operating system supports them. We make this change for two
785 reasons: Cygwin lacks support for the multibyte character
786 conversion functions used by the legacy menu code, and Cygwin
787 never needs to rely on non-Unicode APIs.
788
789 * unexw32.c (hinst): Declare extern.
790
791 * w32.c: Change header order;
792 (w32_strerror): Move to w32fns.c because we need it for
793 non-WINDOWSNT builds.
794
795 * w32.h: Add #error macro to make sure we don't include w32.h for
796 Cygwin builds. Remove w32select declarations.
797
798 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
799 w32fns.c. w32console.c is WINDOWSNT-only.
800
801 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
802 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
803 POSIXy alternative.
804 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
805 (w32_major_version, w32_minor_version, w32_build_number)
806 (os_subtype, sound_type): Define here
807 (w32_defined_color): Make color parameter const for consistency
808 with other _defined_color functions.
809 (w32_createwindow): Unconditionally call w32_init_class instead of
810 doing so only when hprevinst is non-NULL. Plumbing hprevinst
811 through the code is complex and unnecessary because class
812 registration is practically free.
813 (w32_name_of_message): New EMACSDEBUG-only function.
814 (Fset_message_beep): Move here
815 (Fx_open_connection): Require that the display name for Windows be
816 "w32" for consistency, emacsclient disambiguation, and maybe, one
817 day, multi-window-system support.
818 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
819 Cygwin files for W32 GUI facilities, since these clearly don't
820 expect Cygwin names.
821 (_DebPrint): Define.
822 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
823 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
824 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
825 (w32_last_error): Remove.
826
827 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
828
829 * w32heap.c (syspage_mask): Declare here.
830 (cache_system_info): Remove.
831
832 * w32inevt.c (faked_key): Define globally, not statically.
833 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
834 (w32_console_toggle_lock_key): Move to w32fns.c.
835
836 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
837
838 * w32proc.c (_DebPrint): Move to w32fns.c.
839 * w32select.c: Include string.h, stdio.h for Cygwin.
840 * w32select.h: New File.
841
842 * w32term.c: Include io.h for non-CYGWIN builds; needed for
843 get_osfhandle.
844 (w32_message_fd): New variable. Under Cygwin, holds the file
845 descriptor the system used to tell us about pending thread
846 messages.
847
848 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
849 that prevented compilation under non-WINDOWSNT systems.
850
851 (w32_initialize): Open /dev/windows and assign it to
852 w32_message_fd. Provide w32 feature.
853
854 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
855 (WM_EMACS_INPUT_READY): add.
856 (prepend_msg, w32_message_fd): Declare globally.
857
858 * w32xfns.c:
859 (keyboard_handle): Use only when WINDOWSNT.
860 (notify_msg_ready): New function. Posts a message to the main
861 thread's message queue under CYGWIN, which wakes up the main
862 thread from select(2) by making the /dev/windows file descriptor
863 ready. Under WINDOWSNT, it sets an event the same way the old
864 code did.
865
866 (post, prepend_msg): Actually call notify_msg_ready instead of
867 setting the input event directly.
868
869 2012-10-07 Eli Zaretskii <eliz@gnu.org>
870
871 * ralloc.c (relinquish): If a heap is ready to be relinquished,
872 but it still has blocs in it, don't return it to the system,
873 instead of aborting. (Bug#12402)
874
875 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
876
877 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
878
879 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
880 MAC_OS_X_VERSION_10_6.
881 (syms_of_nsterm): Remove comment about Panther and above for
882 ns-antialias-text.
883 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
884 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
885 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
886
887 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
888 MAC_OS_X_VERSION_10_4.
889
890 * nsmenu.m (fillWithWidgetValue:): Remove code for <
891 MAC_OS_X_VERSION_10_2.
892
893 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
894
895 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
896 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
897
898 * nsterm.m (ns_in_resize): Remove (Bug#12479).
899 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
900 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
901 Remove ns_in_resize check.
902 (ns_clear_frame_area): Remove resize handle code.
903
904 * nsfns.m (ns_in_resize): Remove.
905 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
906 Remove ns_in_resize check.
907
908 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
909
910 Improve sys_siglist detection.
911 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
912 defined as a macro, as is done in Solaris.
913 (sys_siglist_entries): New macro.
914 (save_strsignal): Use it.
915 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
916 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
917
918 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
919
920 * nsfns.m (Fx_create_frame): Call x_default_parameter with
921 fullscreen/Fullscreen.
922
923 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
924 tobar_height is new.
925
926 * nsterm.m (x_make_frame_visible): Check for fullscreen.
927 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
928 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
929 (windowDidResize:): Check for correct window if old style fullscreen.
930 Capitalize word in comment. Remove incorrect comment.
931 (initFrameFromEmacs:): tbar_height renamed tibar_height.
932 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
933 error in drawing background.
934 (toggleFullScreen:): Remove comment. Rearrange calls.
935 Set toolbar values to zero, save old height in tobar_height.
936 Restore tool bar height when leaving fullscreen.
937 (canBecomeMainWindow): New function.
938
939 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
940
941 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
942
943 2012-10-05 Eli Zaretskii <eliz@gnu.org>
944
945 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
946
947 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
948 that time stamps of directories could also be changed.
949 Don't request the too broad GENERIC_WRITE, only the more restrictive
950 FILE_WRITE_ATTRIBUTES access rights.
951
952 * fileio.c (Fset_file_times): Special-case ignoring errors for
953 directories only on MSDOS, not on MS-Windows.
954
955 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
956
957 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
958
959 2012-10-04 Eli Zaretskii <eliz@gnu.org>
960
961 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
962 see whether CreateFile failed.
963
964 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
965
966 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
967 to avoid similar races.
968 * keyboard.c (pending_signals): Now bool, not int.
969
970 Port timers to OpenBSD, plus check for timer failures.
971 OpenBSD problem reported by Han Boetes.
972 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
973 and/or setitimer.
974 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
975 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
976 like OpenBSD, which has timer_settime but does not declare it.
977 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
978 whether to use itimerspec-related primitives. All uses of
979 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
980
981 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
982
983 * profiler.c (handle_profiler_signal): Fix a malloc race
984 that caused Emacs to hang on Fedora 17 when profiling Lisp.
985
986 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
987
988 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
989
990 2012-10-02 Eli Zaretskii <eliz@gnu.org>
991
992 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
993 consistent with the change in return value of 'safe_strsignal'.
994
995 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
996
997 Prefer plain 'static' to 'static inline' (Bug#12541).
998 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
999 (bidi_set_sor_type, bidi_push_embedding_level)
1000 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1001 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1002 (bidi_cache_search, bidi_cache_ensure_space)
1003 (bidi_cache_iterator_state, bidi_cache_find)
1004 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1005 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1006 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1007 Now 'static', not 'static inline'.
1008
1009 Count overruns when profiling; change units to ns.
1010 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1011 Give extra weight to samples after overruns, to attempt to count
1012 the time more accurately.
1013 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1014 the underlying primitives nominally do ns.
1015 (Fprofiler_cpu_start): Document the change. Mention that
1016 the sampling intervals are only approximate.
1017
1018 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1019
1020 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1021
1022 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1023 case for the special 0 coding-system.
1024
1025 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1026 (Fmake_overlay): Remove redundant tests.
1027 (fix_start_end_in_overlays): Remove redundant recentering.
1028
1029 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1030
1031 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1032 Update dependencies.
1033
1034 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1035
1036 Fix a malloc race condition involving strsignal.
1037 A signal can arrive in the middle of a malloc, and Emacs's signal
1038 handler can invoke strsignal, which can invoke malloc, which is
1039 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1040 Fix it by altering the signal handler so that it does not invoke
1041 strsignal.
1042 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1043 * process.c (status_message): Use const pointer, in case strsignal
1044 is #defined to safe_strsignal.
1045 * sysdep.c (sys_siglist, init_signals): Always define and
1046 initialize a substitute sys_siglist if the system does not define
1047 one, even if HAVE_STRSIGNAL.
1048 (safe_strsignal): Rename from strsignal. Always define,
1049 using sys_siglist. Return a const pointer.
1050 * syssignal.h (safe_strsignal): New decl.
1051 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1052
1053 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1054
1055 * w32proc.c (timer_loop): Fix code that waits for timer
1056 expiration, to avoid high CPU usage.
1057
1058 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1059
1060 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1061 (sweep_weak_table): Remove redundant prototypes.
1062
1063 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1064
1065 * emacs.c: Move the inclusion of TERM_HEADER after including
1066 windows.h on WINDOWSNT. This avoids compilation problems with
1067 MSVC.
1068
1069 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1070
1071 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1072 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1073 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1074 as the previous version used 'void *'.
1075
1076 * ralloc.c (ROUNDUP): Fix last change.
1077 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1078 'size_t'.
1079
1080 * w32proc.c <disable_itimers>: New static flag.
1081 (init_timers): Initialize it to zero, after creating the critical
1082 sections used by the timer threads.
1083 (term_timers): Set to 1 before deleting the critical sections.
1084 (getitimer, setitimer): If disable_itimers is non-zero, return an
1085 error indication without doing anything. Reported by Fabrice
1086 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1087 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1088 return results.
1089 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1090 support timers.
1091
1092 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1093 term_ntproc after all the other bookkeeping, to get timers working
1094 as long as possible.
1095
1096 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1097
1098 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1099 Suggested by Juri Linkov in
1100 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1101
1102 Prefer plain 'static' to 'static inline' (Bug#12541).
1103 With static functions, modern compilers inline pretty well by
1104 themselves; advice from programmers often hurts as much as it helps.
1105 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1106 this change shrinks the text size of the Emacs executable by 1.1%
1107 without affecting CPU significantly in my benchmark.
1108 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1109 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1110 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1111 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1112 (bset_auto_fill_function, bset_auto_save_file_format)
1113 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1114 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1115 (bset_cache_long_line_scans, bset_case_fold_search)
1116 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1117 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1118 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1119 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1120 (bset_header_line_format, bset_indicate_buffer_boundaries)
1121 (bset_indicate_empty_lines, bset_invisibility_spec)
1122 (bset_left_fringe_width, bset_major_mode, bset_mark)
1123 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1124 (bset_name, bset_overwrite_mode, bset_pt_marker)
1125 (bset_right_fringe_width, bset_save_length)
1126 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1127 (bset_scroll_up_aggressively, bset_selective_display)
1128 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1129 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1130 (set_buffer_overlays_after):
1131 * category.c (bset_category_table):
1132 * charset.c (read_hex):
1133 * coding.c (produce_composition, produce_charset)
1134 (handle_composition_annotation, handle_charset_annotation)
1135 (char_encodable_p):
1136 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1137 (assign_row, set_frame_matrix_frame, make_current)
1138 (add_row_entry):
1139 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1140 * fns.c (maybe_resize_hash_table):
1141 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1142 * gmalloc.c (register_heapinfo):
1143 * image.c (lookup_image_type):
1144 * intervals.c (set_interval_object, set_interval_left)
1145 (set_interval_right, copy_interval_parent, rotate_right)
1146 (rotate_left, balance_possible_root_interval):
1147 * keyboard.c (kset_echo_string, kset_kbd_queue)
1148 (kset_keyboard_translate_table, kset_last_prefix_arg)
1149 (kset_last_repeatable_command, kset_local_function_key_map)
1150 (kset_overriding_terminal_local_map, kset_real_last_command)
1151 (kset_system_key_syms, clear_event, set_prop):
1152 * lread.c (digit_to_number):
1153 * marker.c (attach_marker, live_buffer, set_marker_internal):
1154 * nsterm.m (ns_compute_glyph_string_overhangs):
1155 * process.c (pset_buffer, pset_command)
1156 (pset_decode_coding_system, pset_decoding_buf)
1157 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1158 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1159 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1160 * syntax.c (bset_syntax_table, dec_bytepos):
1161 * terminal.c (tset_param_alist):
1162 * textprop.c (interval_has_some_properties)
1163 (interval_has_some_properties_list):
1164 * window.c (wset_combination_limit, wset_dedicated)
1165 (wset_display_table, wset_hchild, wset_left_fringe_width)
1166 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1167 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1168 (wset_right_fringe_width, wset_right_margin_cols)
1169 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1170 (wset_vertical_scroll_bar_type, wset_window_parameters):
1171 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1172 (wset_column_number_displayed, wset_region_showing)
1173 (window_box_edges, run_window_scroll_functions)
1174 (append_glyph_string_lists, prepend_glyph_string_lists)
1175 (append_glyph_string, set_glyph_string_background_width)
1176 (append_glyph, append_composite_glyph)
1177 (take_vertical_position_into_account):
1178 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1179 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1180 (lface_hash, lface_same_font_attributes_p, lookup_face):
1181 * xml.c (libxml2_loaded_p):
1182 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1183 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1184 Now 'static', not 'static inline'.
1185
1186 * bidi.c: Tune.
1187 (bidi_copy_it): Do the whole copy with a single memcpy.
1188 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1189
1190 Revert the FOLLOW-SYMLINKS change for file-attributes.
1191 Doing it right would require several changes to Tramp, and there's
1192 not enough time to get that tested before the freeze today.
1193 * dired.c (directory_files_internal, Ffile_attributes):
1194 Undo last change.
1195
1196 * frame.c (x_report_frame_params): Port better to wider ints.
1197 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1198 or that pointers can be printed in 15 decimal digits.
1199 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1200
1201 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1202
1203 Support x64 build on MS-Windows.
1204 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1205 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1206 compatibility with x64.
1207 (x_get_focus_frame): Add prototype.
1208
1209 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1210 defining an XRectangle structure.
1211
1212 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1213 arithmetics for compatibility with x64.
1214
1215 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1216 compatibility with x64.
1217
1218 * w32heap.h: Adjust prototypes and declarations.
1219
1220 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1221 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1222 DWORD, long, and unsigned long, for compatibility with x64.
1223 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1224 (sbrk): Argument is now of type ptrdiff_t.
1225
1226 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1227 less than 0x0500.
1228 (w32_msg_pump): Use WPARAM type for 'result'.
1229
1230 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1231 architecture.
1232 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1233 compatibility with x64.
1234
1235 * vm-limit.c (lim_data): Now size_t.
1236 (check_memory_limits): Adjust prototypes of real_morecore and
1237 __morecore to receive argument of type ptrdiff_t. Use size_t for
1238 five_percent and data_size.
1239
1240 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1241 variables, for compatibility with x64.
1242 (rva_to_section, offset_to_section, relocate_offset)
1243 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1244 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1245 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1246 for compatibility with x64.
1247
1248 * sysdep.c (STDERR_FILENO): Define if not already defined.
1249
1250 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1251 (__morecore): Argument type is now ptrdiff_t.
1252 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1253 (relinquish): Use ptrdiff_t type for 'excess'.
1254 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1255
1256 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1257 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1258 instead of a literal number.
1259
1260 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1261 (min): Define only if not already defined.
1262
1263 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1264 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1265 hosts.
1266
1267 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1268 'bitmaps' is a pointer.
1269
1270 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1271
1272 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1273
1274 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1275
1276 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1277 * dired.c (directory_files_internal, Ffile_attributes):
1278 New arg follow_symlinks. All uses changed.
1279
1280 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1281
1282 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1283
1284 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1285
1286 Support atimers and CPU profiler via profile.c on MS-Windows.
1287 * w32proc.c (sig_mask, crit_sig): New static variables.
1288 (sys_signal): Support SIGALRM and SIGPROF.
1289 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1290 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1291 sigfillset, and sigprocmask are no longer no-ops.
1292 (sigismember): New function.
1293 (struct itimer_data): New definition.
1294 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1295 (crit_prof): New static variables.
1296 (MAX_SINGLE_SLEEP): New definition.
1297 (timer_loop, stop_timer_thread, term_timers, init_timers)
1298 (start_timer_thread, getitimer, setitimer): New functions.
1299 (alarm): No longer a no-op, calls setitimer.
1300
1301 * w32.c (term_ntproc): Call term_timers.
1302 (init_ntproc): Make sure all signals are unblocked at startup, to
1303 erase any traces of dumping. Call init_timers.
1304
1305 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1306 Windows-specific code to display the hourglass mouse pointer is no
1307 longer used.
1308 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1309 to hourglass timer expiration.
1310 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1311 Remove, no longer used.
1312 (w32_note_current_window, show_hourglass, hide_hourglass):
1313 New functions, in support of hourglass cursor display similar to other
1314 window systems.
1315 (syms_of_w32fns): Don't initialize hourglass_timer.
1316
1317 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1318 WINDOWSNT as well.
1319 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1320
1321 * w32.h (init_timers, term_timers): Add prototypes.
1322
1323 2012-09-30 Kenichi Handa <handa@gnu.org>
1324
1325 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1326 to the buffer relocation which may be caused by ccl_driver.
1327
1328 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1329
1330 * xfns.c (Fx_file_dialog): Update comment.
1331
1332 * w32fns.c (Fx_file_dialog): Update comment.
1333
1334 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1335 Initialize panel name field if OSX >= 10.6.
1336
1337 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1338
1339 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1340
1341 * nsterm.m (NEW_STYLE_FS): New define.
1342 (ns_fullscreen_hook, windowWillEnterFullScreen)
1343 (windowDidEnterFullScreen, windowWillExitFullScreen)
1344 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1345 (setFSValue): New functions.
1346 (EmacsFSWindow): New implementation.
1347 (canBecomeKeyWindow): New function for EmacsFSWindow.
1348 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1349 (dealloc): Release nonfs_window if in fullscreen.
1350 (updateFrameSize:): Call windowDidMove to update top/left.
1351 (windowWillResize:toSize:): Check if frame is still maximized.
1352 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1353 next_maximized, maximized_width, maximized_height and nonfs_window.
1354 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1355 tbar_height.
1356 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1357 fullscreen. Set maximized_width/height. Act on next_maximized.
1358
1359 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1360 (EmacsView): Add variables for fullscreen.
1361 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1362 (EmacsFSWindow): New interface for fullscreen.
1363
1364 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1365
1366 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1367
1368 2012-09-30 Chong Yidong <cyd@gnu.org>
1369
1370 * fns.c (Frandom): Doc fix.
1371
1372 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1373
1374 * window.c (Vwindow_combination_limit): New default value.
1375 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1376
1377 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1378
1379 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1380 Suggested by Eli Zaretskii in
1381 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1382
1383 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1384
1385 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1386 HAVE_TIMER_SETTIME is defined.
1387
1388 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1389
1390 Profiler improvements: more-accurate timers, overflow checks.
1391 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1392 signal.h, setjmp.h. Include systime.h instead.
1393 (saturated_add): New function.
1394 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1395 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1396 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1397 New static vars.
1398 (enum profiler_cpu_running): New enum.
1399 (profiler_cpu_running): Now of that enum type, not bool.
1400 All uses changed to store the new value.
1401 (handle_profiler_signal): Rename from sigprof_handler_1,
1402 for consistency with other handlers. Do not check whether
1403 cpu_log is a hash-table if garbage collecting, since it
1404 doesn't matter in that case.
1405 (deliver_profiler_signal): Rename from sigprof_handler,
1406 for consistency with other handlers.
1407 (setup_cpu_timer): New function, with much of what used to be in
1408 Fprofiler_cpu_start. Check for out-of-range argument.
1409 Prefer timer_settime if available, and prefer
1410 thread cputime clocks, then process cputime clocks, then
1411 monotonic clocks, to the old realtime clock. Use make_timeval
1412 to round more-correctly when falling back to setitimer.
1413 (Fprofiler_cpu_start): Use it.
1414 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1415 Don't assume that passing NULL as the 2nd argument of setitimer
1416 is the same as passing a pointer to all-zero storage.
1417 Ignore SIGPROF afterwards.
1418 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1419 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1420 non-fatal signal handlers. Ignore SIGPROF on startup.
1421 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1422 in profiler.c, since sysdep.c now uses it.
1423
1424 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1425 Suggested by Eli Zaretskii in
1426 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1427
1428 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1429
1430 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1431
1432 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1433
1434 * lisp.h (struct backtrace): Remove indirection for `function' field.
1435 * xdisp.c (redisplay_internal):
1436 * profiler.c (record_backtrace, sigprof_handler_1):
1437 * alloc.c (Fgarbage_collect):
1438 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1439 (Fbacktrace_frame): Adjust accordingly.
1440
1441 2012-09-28 Glenn Morris <rgm@gnu.org>
1442
1443 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1444 (Frun_hook_with_args_until_failure): Doc fixes.
1445
1446 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1447
1448 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1449 Qautomatic_redisplay and change the symbol name. All users changed.
1450
1451 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1452
1453 * profiler.c (sigprof_handler): Fix race condition.
1454
1455 2012-09-28 Glenn Morris <rgm@gnu.org>
1456
1457 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1458
1459 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1460
1461 Check more robustly for timer_settime.
1462 * Makefile.in (LIB_TIMER_TIME): New macro.
1463 (LIBES): Add it.
1464 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1465 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1466 call timer_settime.
1467
1468 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1469
1470 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1471
1472 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1473
1474 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1475
1476 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1477
1478 * character.h (MAYBE_UNIFY_CHAR): Remove.
1479 * charset.c, charset.h (maybe_unify_char): Now static.
1480 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1481 Since this stuff is now private to charset.c, there's no need for
1482 a public macro and no need to inline by hand.
1483
1484 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1485 Stefan Monnier <monnier@iro.umontreal.ca>
1486 Juanma Barranquero <lekktu@gmail.com>
1487
1488 * profiler.c: New file.
1489 * Makefile.in (base_obj): Add profiler.o.
1490 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1491 ($(BLD)/profiler.$(O)): New target.
1492 * emacs.c (main): Call syms_of_profiler.
1493 * alloc.c (Qautomatic_gc): New constant.
1494 (MALLOC_PROBE): New macro.
1495 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1496 (total_bytes_of_live_objects): New function.
1497 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1498 Call malloc_probe for the memory profiler.
1499 (syms_of_alloc): Define Qautomatic_gc.
1500 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1501 race condition.
1502 (struct backtrace): Move definition...
1503 * lisp.h (struct backtrace): ..here.
1504 (Qautomatic_gc, profiler_memory_running): Declare vars.
1505 (malloc_probe, syms_of_profiler): Declare functions.
1506 * xdisp.c (Qautomatic_redisplay): New constant.
1507 (redisplay_internal): Record itself in backtrace_list.
1508 (syms_of_xdisp): Define Qautomatic_redisplay.
1509
1510 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1511 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1512
1513 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1514
1515 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1516
1517 Prefer POSIX timers if available.
1518 They avoid a race if the timer is too close to the current time.
1519 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1520 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1521 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1522
1523 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1524
1525 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1526 CHAR_STRING_ADVANCE.
1527 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1528 STRING_CHAR_ADVANCE.
1529
1530 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1531
1532 Move Vlibrary_cache to emacs.c and reset before dumping.
1533
1534 * lisp.h (reset_image_types): Declare.
1535 [WINDOWSNT] (Vlibrary_cache): Declare.
1536
1537 * image.c (reset_image_types): New function.
1538
1539 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1540 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1541 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1542
1543 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1544 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1545
1546 * w32.h (Vlibrary_cache): Do not declare.
1547
1548 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1549
1550 * w32proc.c (sys_signal): Handle all signals defined by the
1551 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1552 handlers for signals supported by Windows. Don't override
1553 term_ntproc as the handler for SIGABRT.
1554 (sigaction): Rewrite to call sys_signal instead of duplicating its
1555 code.
1556 (sys_kill): Improve commentary.
1557
1558 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1559 consistency with a signature of a signal handler. All callers
1560 changed.
1561 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1562 install term_ntproc as a signal handler for SIGABRT, as that
1563 should be done by the dumped Emacs.
1564
1565 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1566
1567 * w32select.c (term_w32select): Protect against repeated
1568 invocation by setting clipboard_owner to NULL after calling
1569 DestroyWindow.
1570
1571 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1572 and term_ntproc to their modified signatures.
1573
1574 * character.c (char_string, string_char): Remove calls to
1575 MAYBE_UNIFY_CHAR. See the discussion starting at
1576 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1577 for the details.
1578
1579 2012-09-25 Chong Yidong <cyd@gnu.org>
1580
1581 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1582
1583 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1584
1585 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1586 when encountering an unknown bytecode.
1587
1588 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1589
1590 image.c, indent.c: Use bool for booleans.
1591 * dispextern.h (struct image_type): Members valid_p, load, init
1592 now return bool, not int. All uses changed.
1593 * image.c: Omit unnecessary static decls.
1594 (x_create_bitmap_mask, x_build_heuristic_mask):
1595 Return void, not int, since callers don't care about the return value.
1596 (x_create_bitmap_mask, define_image_type, valid_image_p)
1597 (struct image_keyword, parse_image_spec, image_spec_value)
1598 (check_image_size, image_background)
1599 (image_background_transparent, x_clear_image_1)
1600 (postprocess_image, lookup_image, x_check_image_size)
1601 (x_create_x_image_and_pixmap, xbm_image_p)
1602 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1603 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1604 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1605 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1606 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1607 (png_image_p, init_png_functions, png_load_body, png_load)
1608 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1609 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1610 (init_gif_functions, gif_load, imagemagick_image_p)
1611 (imagemagick_load_image, imagemagick_load, svg_image_p)
1612 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1613 (gs_load):
1614 * nsimage.m (ns_load_image):
1615 * nsterm.m (ns_defined_color):
1616 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1617 * xfns.c (x_defined_color):
1618 * xterm.c (x_alloc_lighter_color_for_widget)
1619 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1620 (x_alloc_lighter_color):
1621 * indent.c (disptab_matches_widthtab, current_column)
1622 (scan_for_column, string_display_width, indented_beyond_p)
1623 (compute_motion, vmotion, Fvertical_motion):
1624 Use bool for booleans.
1625
1626 2012-09-24 Chong Yidong <cyd@gnu.org>
1627
1628 * chartab.c (Fset_char_table_default): Obsolete function removed.
1629
1630 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1631
1632 Move pid_t related decls out of lisp.h.
1633 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1634 (interruptible_wait_for_termination):
1635 Move these decls from lisp.h to syswait.h, since they use pid_t.
1636 Needed on FreeBSD; see Herbert J. Skuhra in
1637 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1638 * callproc.c: Include syswait.h.
1639
1640 gnutls.c, gtkutil.c: Use bool for boolean.
1641 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1642 (emacs_gnutls_handle_error):
1643 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1644 (xg_hide_tooltip, xg_create_frame_widgets)
1645 (create_dialog, xg_uses_old_file_dialog)
1646 (xg_get_file_with_chooser, xg_get_file_with_selection)
1647 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1648 (xg_item_label_same_p, xg_update_menubar)
1649 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1650 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1651 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1652 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1653 (update_frame_tool_bar, free_frame_tool_bar):
1654 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1655 * nsmenu.m (ns_update_menubar):
1656 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1657 * xfns.c (Fx_show_tip) [USE_GTK]:
1658 Use bool for boolean.
1659 * gtkutil.c (xg_update_frame_menubar):
1660 * xmenu.c (update_frame_menubar):
1661 Return void, not int, since caller ignores return value.
1662 * gtkutil.c (xg_change_toolbar_position):
1663 Return void, not 1.
1664
1665 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1666
1667 * makefile.w32-in (BLOCKINPUT_H): Remove.
1668 (SYSSIGNAL_H): New macro.
1669 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1670 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1671 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1672 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1673 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1674 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1675 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1676 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1677 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1678 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1679 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1680 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1681 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1682 ($(BLD)/w32xfns.$(O)): Update dependencies.
1683
1684 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1685
1686 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1687 fatal_error_backtrace.
1688
1689 * w32proc.c (sys_kill): Undo last change: don't do anything when
1690 invoked to deliver SIGABRT to our own process. This is now
1691 handled by emacs_raise.
1692
1693 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1694
1695 * w32term.c (w32_read_socket): Remove leftover reference to
1696 interrupt_input_pending.
1697
1698 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1699
1700 Do not use SA_NODEFER.
1701 Problem reported by Dani Moncayo in
1702 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1703 * alloc.c (die):
1704 * sysdep.c (emacs_abort): Do not reset signal handler.
1705 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1706 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1707 wanted even on POSIXish hosts, and it doesn't work on Windows.
1708
1709 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1710
1711 * xterm.c (x_term_init): Call fixup_locale before and after calling
1712 gtk_init (Bug#12392).
1713
1714 2012-09-23 Chong Yidong <cyd@gnu.org>
1715
1716 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1717 Vdynamic_library_alist.
1718
1719 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1720 (Fgnutls_available_p): Caller changed.
1721
1722 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1723 (Flibxml_parse_xml_region): Likewise.
1724
1725 * dispextern.h (struct image_type): Remove arg from init function.
1726
1727 * image.c (Finit_image_library, lookup_image_type)
1728 (define_image_type): Remove now-unneeded second arg.
1729 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1730 (init_tiff_functions, init_gif_functions, init_svg_functions):
1731 Arglist and w32_delayed_load calling convention changed.
1732 (gs_type): Remove init_gs_functions; there is no such function.
1733 (valid_image_p, make_image): Fix caller to lookup_image_type.
1734
1735 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1736
1737 Simplify and avoid signal-handling races (Bug#12471).
1738 * alloc.c (die):
1739 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1740 Avoid recursive loop if there's a fatal error in the function itself.
1741 * atimer.c (pending_atimers):
1742 * blockinput.h: Don't include "atimer.h"; no longer needed.
1743 (interrupt_input_pending): Remove. All uses removed.
1744 pending_signals now counts both atimers and ordinary interrupts.
1745 This is less racy than having three separate pending-signal flags.
1746 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1747 (input_blocked_p):
1748 Rename from their upper-case counterparts BLOCK_INPUT,
1749 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1750 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1751 This makes it easier to access volatile variables more accurately.
1752 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1753 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1754 that's more reliable if the code is buggy and sets
1755 interrupt_input_blocked to a negative value. All uses changed.
1756 * atimer.c (deliver_alarm_signal):
1757 Remove. No need to deliver this to the parent; any thread can
1758 handle this signal now. All uses replaced by underlying handler.
1759 * atimer.c (turn_on_atimers):
1760 * dispnew.c (handle_window_change_signal):
1761 * emacs.c (handle_danger_signal):
1762 * keyboard.c (kbd_buffer_get_event):
1763 Don't reestablish signal handler; not needed with sigaction.
1764 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1765 (UNBLOCK_INPUT_TO):
1766 Rework to avoid unnecessary accesses to volatile variables.
1767 (UNBLOCK_INPUT_TO): Now a function.
1768 (totally_unblock_input, unblock_input): New decls.
1769 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1770 (init_data): Remove. Necessary stuff now done in init_signal.
1771 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1772 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1773 (fatal_error_code): Remove; no longer needed.
1774 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1775 it doesn't always backtrace. All uses changed. No need to reset
1776 signal to default, since sigaction and/or die does that for us now.
1777 Use emacs_raise (FOO), not kill (getpid (), FOO).
1778 (main): Check more-accurately whether we're dumping.
1779 Move fatal-error setup to sysdep.c
1780 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1781 * gtkutil.c (xg_get_file_name, xg_get_font):
1782 Remove no-longer-needed signal-mask manipulation.
1783 * keyboard.c, process.c (POLL_FOR_INPUT):
1784 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1785 * keyboard.c (read_avail_input): Remove.
1786 All uses replaced by gobble_input.
1787 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1788 (kbd_buffer_store_event_hold, gobble_input):
1789 (record_asynch_buffer_change) [USABLE_SIGIO]:
1790 (store_user_signal_events):
1791 No need to mess with signal mask.
1792 (gobble_input): If blocking input and there are terminals, simply
1793 set pending_signals to 1 and return. All hooks changed to not
1794 worry about whether input is blocked.
1795 (process_pending_signals): Clear pending_signals before processing
1796 them, in case a signal comes in while we're processing.
1797 By convention callers now test pending_signals before calling us.
1798 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1799 New functions, to support changes to blockinput.h.
1800 (handle_input_available_signal): Now extern.
1801 (reinvoke_input_signal): Remove. All uses replaced by
1802 handle_async_input.
1803 (quit_count): Now volatile, since a signal handler uses it.
1804 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1805 All callers changed. Block SIGINT only if not already blocked.
1806 Clear sigmask reliably, even if Fsignal returns, which it can.
1807 Omit unnecessary accesses to volatile var.
1808 (quit_throw_to_read_char): No need to restore sigmask.
1809 * keyboard.c (gobble_input, handle_user_signal):
1810 * process.c (wait_reading_process_output):
1811 Call signal-handling code rather than killing ourselves.
1812 * lisp.h: Include <float.h>, for...
1813 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1814 (pending_signals): Now volatile.
1815 (syms_of_data): Now const if IEEE floating point.
1816 (handle_input_available_signal) [USABLE_SIGIO]:
1817 (terminate_due_to_signal, record_child_status_change): New decls.
1818 * process.c (create_process): Avoid disaster if memory is exhausted
1819 while we're processing a vfork, by tightening the critical section
1820 around the vfork.
1821 (send_process_frame, process_sent_to, handle_pipe_signal)
1822 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1823 ignores SIGPIPE.
1824 (send_process): No need for setjmp/longjmp any more, since the
1825 SIGPIPE stuff is now gone. Instead, report an error if errno
1826 is EPIPE.
1827 (record_child_status_change): Now extern. PID and W are now args.
1828 Return void, not bool. All callers changed.
1829 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1830 Remove. All uses removed. This bug should be fixed now in a
1831 different way.
1832 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1833 and record the child status change directly. This avoids the
1834 need to futz with the signal mask.
1835 (process_fatal_action): Move here from emacs.c.
1836 (emacs_sigaction_flags): New function, containing
1837 much of what used to be in emacs_sigaction_init.
1838 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1839 caught by emacs, to make races less likely.
1840 (deliver_process_signal): Rename from handle_on_main_thread.
1841 All uses changed.
1842 (BACKTRACE_LIMIT_MAX): Now at top level.
1843 (thread_backtrace_buffer, threadback_backtrace_pointers):
1844 New static vars.
1845 (deliver_thread_signal, deliver_fatal_thread_signal):
1846 New functions, for more-accurate delivery of thread-specific signals.
1847 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1848 (deliver_arith_signal): Handle in this thread, not
1849 in the main thread, since it's triggered by this thread.
1850 (maybe_fatal_sig): New function.
1851 (init_signals): New arg DUMPING so that we can be more accurate
1852 about whether we're dumping. Caller changed.
1853 Treat thread-specific signals differently from process-general signals.
1854 Block all signals while handling fatal error; that's safer.
1855 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1856 on IEEE hosts.
1857 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1858 Ignore SIGPIPE unless batch.
1859 (emacs_backtrace): Output backtrace for the appropriate thread,
1860 which is not necessarily the main thread.
1861 * syssignal.h: Include <stdbool.h>.
1862 (emacs_raise): New macro.
1863 * xterm.c (x_connection_signal): Remove; no longer needed
1864 now that we use sigaction.
1865 (x_connection_closed): No need to mess with sigmask now.
1866 (x_initialize): No need to reset SIGPIPE handler here, since
1867 init_signals does this for us now.
1868
1869 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1870
1871 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1872 background rect may be larger (Bug#12245).
1873
1874 2012-09-23 Chong Yidong <cyd@gnu.org>
1875
1876 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1877
1878 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1879
1880 * .gdbinit: Just stop at fatal_error_backtrace.
1881 See Stefan Monnier's request in
1882 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1883 Remove no-longer-used query of system type.
1884
1885 2012-09-22 Chong Yidong <cyd@gnu.org>
1886
1887 * search.c (Freplace_match): Doc fix (Bug#12325).
1888
1889 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1890
1891 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1892 (Fline_end_position): Doc fix.
1893
1894 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1895
1896 2012-09-22 Chong Yidong <cyd@gnu.org>
1897
1898 * dispextern.h (struct image_type): Add new slot, storing a type
1899 initialization function.
1900
1901 * image.c (define_image_type): Call the image initializer function
1902 if it is defined. Arguments and return value changed.
1903 (valid_image_p, make_image): Callers changed.
1904 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1905 (gif_type, imagemagick_type, svg_type, gs_type):
1906 Add initialization functions.
1907 (Finit_image_library): Call lookup_image_type.
1908 (CHECK_LIB_AVAILABLE): Macro deleted.
1909 (lookup_image_type): Call define_image_type here, rather than via
1910 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1911 (syms_of_image): Move define_image_type calls for xbm_type and
1912 pbm_type to lookup_image_type.
1913
1914 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1915
1916 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1917 'idle_timers' from here ...
1918 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1919 lists, to avoid infloops when the timer does something stupid,
1920 like reinvoke itself with the same or smaller time-out.
1921 (Bug#12447)
1922
1923 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1924
1925 * window.c (Fsplit_window_internal): Handle only Qt value of
1926 Vwindow_combination_limit separately.
1927 (Qtemp_buffer_resize): New symbol.
1928 (Vwindow_combination_limit): New default value.
1929 Rewrite doc-string.
1930
1931 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1932
1933 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1934 the new overlay string. (Bug#10159)
1935
1936 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1937
1938 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1939 or that fprintf is async-signal-safe. POSIX doesn't require
1940 either assumption.
1941
1942 2012-09-22 Chong Yidong <cyd@gnu.org>
1943
1944 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1945 (Bug#8207).
1946
1947 2012-09-22 Kenichi Handa <handa@gnu.org>
1948
1949 * composite.c (composition_reseat_it): Handle the case that a
1950 grapheme cluster is not covered by a single font (Bug#12352).
1951
1952 2012-09-21 Chong Yidong <cyd@gnu.org>
1953
1954 * image.c (define_image_type): Avoid adding duplicate types to
1955 image_types (Bug#12463). Suggested by Jörg Walter.
1956
1957 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1958
1959 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1960 (print_load_command_name): Add case LC_DATA_IN_CODE.
1961 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1962
1963 2012-09-21 Glenn Morris <rgm@gnu.org>
1964
1965 * eval.c (Frun_hook_with_args_until_success)
1966 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1967
1968 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1969
1970 * fileio.c (Ffile_selinux_context): Only call freecon when
1971 lgetfilecon succeeded.
1972 (Fset_file_selinux_context): Likewise. (Bug#12444)
1973
1974 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1975
1976 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1977 reordering, locate the cursor by calling set_cursor_from_row; if
1978 that fails, clear the desired glyph matrix before returning a
1979 failure indication to the caller. Fixes leaving garbled display
1980 when fast scrolling with a down-key. (Bug#12403)
1981 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1982 scrolling through multibyte text.
1983
1984 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1985
1986 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1987 calling mark_vectorlike since that's the one that marks the window.
1988 (mark_discard_killed_buffers): Mark the final cdr.
1989 * window.h (struct window): Move prev/next_buffers to the
1990 non-standard fields.
1991 * window.c (make_window): Initialize prev/next_buffers manually.
1992
1993 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1994
1995 Omit unused arg EXPECTED from socket hooks.
1996 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1997 * nsterm.m (ns_term_init):
1998 * termhooks.h (struct terminal.read_socket_hook):
1999 * w32inevt.c (w32_console_read_socket):
2000 * w32term.c (w32_read_socket):
2001 * xterm.c (XTread_socket):
2002 Omit unused arg EXPECTED. All callers changed.
2003 (store_user_signal_events): Return void, not int, since callers no
2004 longer care about the return value. All uses changed.
2005
2006 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2007
2008 * w32gui.h (XParseGeometry): Do not declare.
2009
2010 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2011
2012 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2013 Ignore 'expected'. See Eli Zaretskii in
2014 <http://bugs.gnu.org/12471#8> (last line).
2015
2016 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2017 (XParseGeometry): Now static. Substitute extremal values for
2018 values that are out of range.
2019
2020 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2021
2022 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2023
2024 * nsfns.m (XParseGeometry): Remove.
2025 (Fx_create_frame): Call x_set_offset to correctly interpret
2026 top_pos in geometry.
2027
2028 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2029 (Fx_parse_geometry): If there is a space in string, call
2030 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2031
2032 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2033
2034 * search.c (scan_buffer): Use character positions in calls to
2035 region_cache_forward and region_cache_backward, not byte
2036 positions. (Bug#12196)
2037
2038 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2039 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2040
2041 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2042 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2043 emacs_blocked_malloc, now deleted.
2044
2045 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2046
2047 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2048 The workaround was for improving performance on Solaris 2.4, but
2049 is getting in the way now. Emacs will still work if someone is
2050 still running Solaris 2.4 in a museum somewhere; Sun dropped
2051 support for Solaris 2.4 in 2003.
2052 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2053 * process.c (create_process) [HAVE_WORKING_VFORK]:
2054 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2055 since Emacs no longer uses vfork on that platform.
2056
2057 2012-09-17 Glenn Morris <rgm@gnu.org>
2058
2059 * emacs.c: Use COPYRIGHT.
2060
2061 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2062
2063 Remove configure's --without-sync-input option (Bug#12450).
2064 When auditing signal-handling in preparation for cleaning it up,
2065 I found that SYNC_INPUT has race conditions and would be a real
2066 pain to fix. Since it's an undocumented and deprecated
2067 configure-time option, now seems like a good time to remove it.
2068 Also see <http://bugs.gnu.org/11080#16>.
2069 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2070 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2071 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2072 (malloc_hysteresis):
2073 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2074 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2075 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2076 (dont_register_blocks, bytes_used_when_reconsidered)
2077 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2078 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2079 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2080 Remove. All uses removed.
2081 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2082 implementation, one that depends on whether the new macro
2083 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2084 is defined.
2085 * atimer.c (run_timers, handle_alarm_signal):
2086 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2087 (handle_async_input, process_pending_signals)
2088 (handle_input_available_signal, init_keyboard):
2089 * nsterm.m (ns_read_socket):
2090 * process.c (wait_reading_process_output):
2091 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2092 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2093 (emacs_write):
2094 * xterm.c (XTread_socket):
2095 Assume SYNC_INPUT.
2096 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2097 * eval.c (handling_signal): Remove. All uses removed.
2098 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2099 All uses replaced with the SYNC_INPUT version.
2100 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2101 Remove decls.
2102 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2103 Now static.
2104
2105 * font.c (Ffont_shape_gstring): Remove unused local.
2106
2107 2012-09-16 Glenn Morris <rgm@gnu.org>
2108
2109 * Makefile.in (clean): No longer run nextstep's clean.
2110
2111 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2112 (ns_frag): Remove.
2113 (ns-app): Move here from ns.mk, and simplify.
2114 (clean): Simplify nextstep entry.
2115 * ns.mk: Remove file.
2116
2117 2012-09-17 Kenichi Handa <handa@gnu.org>
2118
2119 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2120 not covert the last few charactes.
2121
2122 2012-09-16 Kenichi Handa <handa@gnu.org>
2123
2124 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2125 here, but just check the validity of glyphs in the glyph-string.
2126
2127 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2128
2129 * window.c (Fwindow_parameter, Fset_window_parameter):
2130 Accept any window as argument (Bug#12452).
2131
2132 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2133
2134 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2135 to ns_term_init to avoid memory leak.
2136
2137 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2138 explicit retain/release.
2139 (ns_term_init): Only allow one display. Initialize outerpool and
2140 ns_*_types.
2141
2142 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2143
2144 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2145 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2146 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2147 the Microsoft problem in a different way, by altering ../nt/config.nt.
2148
2149 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2150
2151 * w32xfns.c:
2152 * w32uniscribe.c:
2153 * w32term.c:
2154 * w32select.c:
2155 * w32reg.c:
2156 * w32proc.c:
2157 * w32menu.c:
2158 * w32inevt.c:
2159 * w32heap.c:
2160 * w32font.c:
2161 * w32fns.c:
2162 * w32console.c:
2163 * w32.c:
2164 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2165 by lisp.h. This completes removal of setjmp.h inclusion
2166 erroneously announced in the previous commit. (Bug#12446)
2167
2168 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2169 more accurate.
2170
2171 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2172 not defined as a macro. The latter happens on MS-Windows.
2173 (Bug#12446)
2174
2175 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2176
2177 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2178 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2179 Some instances of '#include <setjmp.h>' removed, if the
2180 only reason for the instance was because "lisp.h" was included.
2181 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2182 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2183 and _longjmp with the new symbols. Emacs already uses _setjmp if
2184 available, so this change affects only POSIXish hosts that have
2185 sigsetjmp but not _setjmp, such as some versions of Solaris and
2186 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2187 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2188 (png_load_body) [HAVE_PNG]:
2189 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2190 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2191 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2192 since PNG requires jmp_buf. This is the only exception to the
2193 general rule that we now use sys_setjmp and sys_longjmp.
2194 This exception is OK since this code does not change the signal
2195 mask or longjmp out of a signal handler.
2196
2197 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2198
2199 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2200 Include "syssignal.h", for 'main_thread'.
2201
2202 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2203
2204 Avoid out-of-range marker position (Bug#12426).
2205 * insdel.c (replace_range, replace_range_2):
2206 Adjust markers before overlays, as suggested by comments.
2207 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2208 Remove redundant check before calling offset_intervals.
2209
2210 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2211
2212 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2213 current buffer (Bug#12387).
2214
2215 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2216
2217 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2218
2219 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2220
2221 Use a more backwards-compatible timer format (Bug#12430).
2222 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2223 vector element, not from the 4th, since PSECS is now at the end.
2224 (Fcurrent_idle_time): Doc fix.
2225
2226 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2227
2228 Function to mark objects and remove killed buffers at once.
2229 * alloc.c (discard_killed_buffers): Rename to ...
2230 (mark_discard_killed buffers) ... new name. Add marking
2231 of remaining objects. Fix comment. Adjust users.
2232 (mark_object): Do not touch frame buffer lists here.
2233 * frame.c (delete_frame): Reset frame buffer lists here.
2234
2235 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2236
2237 Better workaround for GNOME bug when --enable-gcc-warnings.
2238 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2239 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2240 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2241
2242 Simplify SIGIO usage (Bug#12408).
2243 The code that dealt with SIGIO was crufty and confusing, e.g., it
2244 played tricks like "#undef SIGIO" but these tricks were not used
2245 consistently. Simplify mostly by not #undeffing standard symbols,
2246 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2247 or not as we please) rather than "defined SIGIO" (standard symbol
2248 that we probably shouldn't #undef).
2249 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2250 Modules that need it can include it.
2251 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2252 * dispextern.h (ignore_sigio): New decl.
2253 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2254 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2255 * emacs.c (shut_down_emacs):
2256 * keyboard.c (kbd_buffer_store_event_hold):
2257 Use ignore_sigio rather than invoking 'signal' directly.
2258 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2259 for FIONREAD.
2260 (FIONREAD, SIGIO): Do not #undef.
2261 (tty_read_avail_input): Use #error rather than a syntax error.
2262 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2263 for I_PIPE, used by SETUP_SLAVE_PTY.
2264 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2265 * sysdep.c (croak): Remove; no longer needed. This bit of
2266 temporary code, with Fred N. Fish's comment that it's temporary,
2267 has been in Emacs since at least 1992!
2268 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2269 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2270 * syssignal.h (croak): Remove decl.
2271 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2272 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2273 now that we're termios-only.
2274 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2275 * term.c (dissociate_if_controlling_tty): Use #error rather than
2276 a run-time error.
2277
2278 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2279 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2280 to work around GNOME bug 683906.
2281 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2282 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2283 This works around GCC bug 54561.
2284
2285 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2286
2287 More fixes for 'volatile' and setjmp/longjmp.
2288 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2289 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2290 (png_load_body) [HAVE_PNG]:
2291 (jpeg_load_body) [HAVE_JPEG]:
2292 New function, with most of the old parent function's body.
2293 (png_load) [HAVE_PNG]:
2294 (jpeg_load) [HAVE_JPEG]:
2295 Invoke the new function, to avoid longjmp munging our locals.
2296 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2297 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2298 longjmp is passed 2, as the C standard doesn't guarantee this.
2299 Instead, store the failure code into mgr->failure_code.
2300
2301 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2302
2303 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2304 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2305 (syms_of_keyboard): Remove support for unread-command-char.
2306
2307 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2308
2309 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2310 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2311 violation. (Bug#12426)
2312
2313 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2314
2315 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2316
2317 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2318
2319 * eval.c: Add `inhibit-debugger'.
2320 (Qinhibit_debugger): New symbol.
2321 (call_debugger): Bind it instead of Qdebug_on_error.
2322 (maybe_call_debugger): Test Vinhibit_debugger.
2323 (syms_of_eval): Define inhibit-debugger.
2324 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2325 (syms_of_xdisp): Remove inhibit-debug-on-message.
2326
2327 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2328
2329 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2330 If a nonvolatile local variable is written before a _longjmp to
2331 the frame containing the variable, and is read after the _longjmp,
2332 the value read is indeterminate. Some local variables of type
2333 'struct handler' and 'struct catchtag' are used in this way, so
2334 mark each of their slots as volatile if the slot can be set before
2335 _longjmp and read afterwards.
2336 * lisp.h (struct handler): var and chosen_clause are now volatile.
2337 (struct catchtag): val, next, and pdlcount are now volatile.
2338
2339 * bidi.c (bidi_push_it, bidi_pop_it):
2340 * fns.c (copy_hash_table):
2341 * image.c (define_image_type):
2342 * keyboard.c (kbd_buffer_store_event_hold):
2343 * process.c (Fprocess_send_eof):
2344 * xfaces.c (x_create_gc) [HAVE_NS]:
2345 * xgselect.c (xg_select):
2346 Prefer assignment to memcpy when either will do.
2347
2348 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2349 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2350 time an item is removed. No need to mark this function 'inline';
2351 the compiler knows better than we do.
2352
2353 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2354
2355 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2356 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2357 to change_frame_size (Bug#12388).
2358 (windowDidResize:): Pass YES to updateFrameSize.
2359
2360 * nsterm.h: Add delay parameter to updateFrameSize.
2361
2362 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2363
2364 Discard killed buffers from deleted window and frame objects.
2365 This reduces an amount of references to killed buffers and
2366 helps GC to reclaim them faster.
2367 * alloc.c (discard_killed_buffers): New function.
2368 (mark_object): Use it for deleted windows and frames.
2369 (mark_object): If symbol's value is set up for a killed buffer
2370 or deleted frame, restore its global binding.
2371 * data.c (swap_in_global_binding): Add GC notice.
2372 (swap_in_symval_forwarding): Use convenient set_blv_where.
2373 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2374 * window.h: ... to here.
2375
2376 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2377
2378 Convenient macro to check whether the buffer is live.
2379 * buffer.h (BUFFER_LIVE_P): New macro.
2380 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2381 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2382
2383 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2384
2385 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2386 composition cases (Bug#12364).
2387
2388 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2389 overhang of succeeding glyphs overlapping box cursor.
2390
2391 * w32term.c (x_draw_glyph_string): Likewise.
2392
2393 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2394
2395 Simplify, document, and port floating-point (Bug#12381).
2396 The porting part of this patch fixes bugs on non-IEEE platforms
2397 with frexp, ldexp, logb.
2398 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2399 Now static.
2400 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2401 support, by removing commented-out code and briefly listing the
2402 C89 functions excluded. The commented-out stuff was confusing
2403 maintenance, e.g., we thought we needed cbrt but it was commented out.
2404 (logb): Remove decl; no longer needed.
2405 (isfinite): New macro, if not already supplied.
2406 (isnan): Don't replace any existing macro.
2407 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2408 are present on all C89 platforms.
2409 (Ffrexp): Do not special-case zero, as frexp does the right thing
2410 for that case.
2411 (Flogb): Do not use logb, as it doesn't have the desired meaning
2412 on hosts that use non-base-2 floating point. Instead, stick with
2413 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2414 frexp, to avoid getting an unspecified result.
2415
2416 * xdisp.c (Qinhibit_debug_on_message): Now static.
2417
2418 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2419
2420 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2421 NSBezierPath (Bug#12131).
2422
2423 2012-09-10 Chong Yidong <cyd@gnu.org>
2424
2425 * fns.c (Fdelq, Fdelete): Doc fix.
2426
2427 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2428
2429 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2430 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2431
2432 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2433
2434 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2435 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2436 Use it.
2437
2438 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2439
2440 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2441 left fringe if the window has a left margin. This avoids leaving
2442 traces of the cursor because its leftmost pixel is not drawn over.
2443
2444 * dispnew.c (update_window_line): When the left margin area of a
2445 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2446 that screen line. (Bug#12277)
2447
2448 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2449
2450 Assume C89 or later for math functions (Bug#12381).
2451 This simplifies the code, and makes it a bit smaller and faster,
2452 and (most important) makes it easier to clean up signal handling
2453 since we can stop worring about floating-point exceptions in
2454 library code. That was a problem before C89, but the problem
2455 went away many years ago on all practical Emacs targets.
2456 * data.c, image.c, lread.c, print.c:
2457 Don't include <math.h>; no longer needed.
2458 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2459 might be autoconfigured, as that never happens.
2460 * data.c (fmod):
2461 * doprnt.c (DBL_MAX_10_EXP):
2462 * print.c (DBL_DIG):
2463 Remove. C89 or later always defines these.
2464 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2465 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2466 (arith_error, domain_error, domain_error2):
2467 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2468 no longer needed -- we simply return what C returns. All uses removed.
2469 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2470 the wrapped code.
2471 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2472 Remove. All uses expanded, as these macros are no longer used
2473 more than once and are now more trouble than they're worth.
2474 (Ftan): Use tan, not sin / cos.
2475 (Flogb): Assume C89 frexp.
2476 (fmod_float): Assume C89 fmod.
2477 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2478 (init_floatfns): Remove. All uses removed.
2479
2480 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2481
2482 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2483 compositeToPoint for OSX < 10.6 (Bug#12390).
2484
2485 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2486
2487 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2488 This produces more-accurate results.
2489
2490 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2491
2492 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2493 changes (Bug#12088).
2494
2495 2012-09-08 Chong Yidong <cyd@gnu.org>
2496
2497 * syntax.c (Fstring_to_syntax): Doc fix.
2498
2499 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2500
2501 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2502 in the internal border.
2503 (x_set_window_size): Remove static variables and their usage.
2504 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2505 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2506 Remove fringe/internal border adjustment (Bug#11052).
2507 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2508 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2509 (ns_fix_rect_ibw): Remove.
2510 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2511 (ns_dumpglyphs_box_or_relief): Ditto.
2512 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2513 adjustment.
2514 (ns_dumpglyphs_image): Ditto.
2515 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2516 border adjustment.
2517 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2518 their usage. Add fringe_extended_p and its use as in other terms.
2519 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2520 scroll bar was removed.
2521 (updateFrameSize): New function.
2522 (windowDidResize): Move code to updateFrameSize and call it.
2523
2524 * nsterm.h (EmacsView): Add updateFrameSize.
2525
2526 2012-09-07 Chong Yidong <cyd@gnu.org>
2527
2528 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2529
2530 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2531
2532 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2533
2534 More signal-handler cleanup (Bug#12327).
2535 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2536 Problem introduced when merging patches. Noted by Eli Zaretskii in
2537 <http://bugs.gnu.org/12327#67>.
2538 * floatfns.c: Comment fix.
2539 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2540 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2541 and anyway the declaration is harmless even if SIGDANGER is not defined.
2542 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2543 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2544 source files not surprisingly expected syssignal.h to define, or
2545 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2546 Include <sys/ioctl.h>, for FIONREAD.
2547 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2548 This eliminates a problem whereby other files mysteriously had
2549 to include "syssignal.h" before including "systty.h" if they
2550 wanted to use "#ifdef SIGIO".
2551
2552 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2553
2554 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2555
2556 * w32.c (sigemptyset): Empty the set.
2557 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2558
2559 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2560
2561 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2562
2563 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2564 (mark_object): Likewise for frame objects.
2565
2566 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2567
2568 * syssignal.h (handle_on_main_thread): Always declare,
2569 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2570 This ports to platforms without HAVE_PTHREAD.
2571
2572 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2573
2574 Signal-handler cleanup (Bug#12327).
2575 Emacs's signal handlers were written in the old 4.2BSD style with
2576 sigblock and sigmask and so forth, and this led to some
2577 inefficiencies and confusion. Rewrite these to use
2578 pthread_sigmask etc. without copying signal sets around. Also,
2579 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2580 'signal', and instead use functions that do not attempt to take
2581 over the system name space. This patch causes Emacs's text
2582 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2583 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2584 Do not include <signal.h> or "syssignal.h", as these
2585 modules do not use signals.
2586 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2587 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2588 Do not include <signal.h>, as "syssignal.h" does that for us now.
2589 * atimer.c (sigmask_atimers): New function.
2590 (block_atimers, unblock_atimers): New functions,
2591 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2592 All uses replaced.
2593 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2594 no longer needed here.
2595 * emacs.c (main): Inspect existing signal handler with sigaction,
2596 so that there's no need to block and unblock SIGHUP.
2597 * sysdep.c (struct save_signal): New member 'action', replacing
2598 old member 'handler'.
2599 (save_signal_handlers, restore_signal_handlers):
2600 Use sigaction instead of 'signal' to save and restore.
2601 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2602 New function. All users of 'signal' modified to use set_sighandler
2603 if they're writeonly, and to use sys_signal if they're read+write.
2604 (emacs_sigaction_init, forwarded_signal): New functions.
2605 (sys_signal): Remove. All uses replaced by calls to sigaction
2606 and emacs_sigaction_init, or by direct calls to 'signal'.
2607 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2608 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2609 all uses replaced by pthread_sigmask etc. calls.
2610 * syssignal.h: Include <signal.h>.
2611 (emacs_sigaction_init, forwarded_signal): New decls.
2612 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2613 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2614 (sigmask, sys_sigmask): Remove; no longer needed.
2615 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2616 (sigblock, sigunblock, sigfree):
2617 (sigsetmask) [!defined sigsetmask]:
2618 Remove. All uses replaced by pthread_sigmask.
2619 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2620 no longer need to be replaced, and its typical old uses
2621 are now done via emacs_sigaction_init and sigaction.
2622 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2623 (sys_sigdel): Remove; unused.
2624 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2625
2626 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2627
2628 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2629 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2630
2631 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2632
2633 Explicitly mark buffer_defaults and buffer_local_symbols.
2634 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2635 mark_local_symbols here.
2636 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2637 since special buffers aren't marked here any more.
2638 (allocate_buffer): Chain new buffer with all_buffers here...
2639 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2640 not here.
2641 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2642 (syms_of_buffer): Remove staticpro of the above.
2643 (init_buffer_once): Set names for buffer_defaults and
2644 buffer_local_symbols.
2645
2646 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2647
2648 Use bool for booleans in font-related modules.
2649 * font.c (font_intern_prop, font_style_to_value)
2650 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2651 (generate_otf_features, font_check_otf_features, font_check_otf)
2652 (font_match_p, font_list_entities, font_at):
2653 * fontset.c (fontset_id_valid_p, reorder_font_vector
2654 (fontset_find_font, Fset_fontset_font)
2655 (face_suitable_for_char_p) [0]:
2656 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2657 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2658 (m17n_flt_initialized, ftfont_shape_by_flt):
2659 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2660 * nsfont.m (nsfont_draw):
2661 * w32font.c (w32font_draw):
2662 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2663 Use bool for booleans.
2664 * font.h: Adjust to above API changes.
2665 (struct font, struct font_driver, struct font_driver_list):
2666 Use bool for booleans.
2667 (struct font): Remove useless member encoding_type.
2668 All users removed.
2669 * fontset.c, xftfont.c: Omit unnecessary static decls.
2670
2671 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2672
2673 * alloc.c (mark_object): Revert window marking code
2674 since it's unsafe for the Fset_window_configuration.
2675
2676 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2677
2678 Fix race conditions with signal handlers and errno (Bug#12327).
2679 Be more systematic about preserving errno whenever a signal
2680 handler returns, even if it's not in the main thread. Do this by
2681 renaming signal handlers to distinguish between signal delivery
2682 and signal handling. All uses changed.
2683 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2684 * data.c (deliver_arith_signal): Rename from arith_error.
2685 * dispnew.c (deliver_window_change_signal): Rename from
2686 window_change_signal.
2687 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2688 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2689 * keyboard.c (deliver_input_available_signal): Rename from
2690 input_available_signal.
2691 (deliver_user_signal): Rename from handle_user_signal.
2692 (deliver_interrupt_signal): Rename from interrupt_signal.
2693 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2694 (deliver_child_signal): Rename from sigchld_handler.
2695 * atimer.c (handle_alarm_signal):
2696 * data.c (handle_arith_signal):
2697 * dispnew.c (handle_window_change_signal):
2698 * emacs.c (handle_fatal_signal, handle_danger_signal):
2699 * keyboard.c (handle_input_available_signal):
2700 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2701 * process.c (handle_pipe_signal, handle_child_signal):
2702 New functions, with the actual signal-handling code taken from the
2703 original respective signal handlers, sans the sporadic attempts to
2704 preserve errno, since that's now done by handle_on_main_thread.
2705 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2706 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2707 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2708 Move to sysdep.c.
2709 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2710 Move initialization of main_thread to sysdep.c's init_signals.
2711 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2712 our usage, and simplifies the mainline code.
2713 (record_child_status_change): New static function, as a helper
2714 for handle_child_signal, and with most of the old child handler's
2715 contents.
2716 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2717 (handle_child_signal): Use the above.
2718 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2719 Moved here from emacs.c.
2720 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2721 code moved here from emacs.c's main function.
2722 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2723 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2724 This lets callers save and restore errno properly.
2725
2726 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2727
2728 Remove redundant or unused things here and there.
2729 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2730 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2731 * editfns.c (Fcompare_buffer_substrings): Likewise.
2732 * frame.h (struct terminal, struct font_driver_list):
2733 Remove redundant declarations.
2734 * window.h (Qleft, Qright): Likewise.
2735
2736 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2737
2738 Do not mark objects from deleted buffers, windows and frames.
2739 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2740 (mark_object): Likewise for windows and frames.
2741
2742 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2743
2744 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2745 buffer_defaults and buffer_local_symbols as valid objects.
2746 Return special value to denote them.
2747
2748 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2749
2750 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2751 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2752 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2753 (file_name_absolute_p, Fsubstitute_in_file_name):
2754 (check_executable, check_writable, Ffile_accessible_directory_p)
2755 (Fset_file_selinux_context, Fdefault_file_modes)
2756 (Finsert_file_contents, choose_write_coding_system)
2757 (Fwrite_region, build_annotations, a_write, e_write)
2758 (Fdo_auto_save):
2759 * filelock.c (boot_time_initialized, get_boot_time)
2760 (get_boot_time_1, lock_file_1, within_one_second):
2761 * floatfns.c (in_float):
2762 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2763 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2764 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2765 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2766 * window.c (compare_window_configurations):
2767 Use bool for booleans.
2768 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2769 (Fdefault_file_modes): Now mode_t, not int, for modes.
2770 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2771 (internal_delete_file): Now returns void, not a (boolean) int,
2772 since nobody was looking at the return value.
2773 * lisp.h, window.h: Adjust to above API changes.
2774
2775 * xdisp.c (set_message): Simplify and reindent last change.
2776
2777 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2778
2779 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2780
2781 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2782
2783 * eval.c (call_debugger): Make the function non-static so that we
2784 can call it from set_message.
2785
2786 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2787 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2788
2789 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2790
2791 Give more-useful info on a fatal error (Bug#12328).
2792 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2793 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2794 of doing the work ourselves.
2795 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2796 do most of the work.
2797 (fatal_error_backtrace): New function, taken from the guts
2798 of the old fatal_error_signal, but with a new option to output
2799 a backtrace.
2800 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2801 info about the signal than just its number.
2802 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2803 * sysdep.c: Include <execinfo.h>
2804 (emacs_backtrace): New function, taken partly from the previous
2805 code of the 'die' function.
2806 (emacs_abort): Call fatal_error_backtrace rather than abort.
2807
2808 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2809
2810 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2811 eager (load-time) macro-expansion.
2812 * lisp.mk (lisp): Add macroexp.
2813
2814 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2815
2816 Simplify redefinition of 'abort' (Bug#12316).
2817 Do not try to redefine the 'abort' function. Instead, redo
2818 the code so that it calls 'emacs_abort' rather than 'abort'.
2819 This removes the need for the NO_ABORT configure-time macro
2820 and makes it easier to change the abort code to do a backtrace.
2821 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2822 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2823 Remove; sysdep.c's emacs_abort now takes its place.
2824 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2825 'abort' changed to use 'emacs_abort'.
2826 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2827 (abort) [!defined abort]: Rename to ...
2828 (emacs_abort): ... new name.
2829 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2830 the place of the old 'abort' in emacs.c.
2831 * w32.c, w32fns.c (abort): Do not #undef.
2832 * w32.c (emacs_abort): Rename from w32_abort.
2833
2834 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2835
2836 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2837 offsets[j].dv, since the y axis of the screen coordinates points
2838 down, while the y axis of the font definition coordinates points
2839 up. This fixes display of Arabic diacritics such as KASRA and
2840 KASRATAN. (Bug#11860)
2841
2842 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2843
2844 Be more systematic about _setjmp vs setjmp.
2845 * alloc.c (test_setjmp, mark_stack):
2846 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2847 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2848 (png_load, my_error_exit, jpeg_load):
2849 * process.c (send_process_trap, send_process):
2850 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2851 The underscored versions are up to 30x faster on some hosts.
2852 Formerly, the code used setjmp+longjmp sometimes and
2853 _setjmp+_longjmp at other times, with no particular reason to
2854 prefer setjmp+longjmp.
2855
2856 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2857
2858 Fix minor problem found by static checking.
2859 * buffer.c (Fdelete_all_overlays): Return nil.
2860
2861 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2862
2863 * buffer.c (Fdelete_all_overlays): New function.
2864
2865 2012-09-03 Chong Yidong <cyd@gnu.org>
2866
2867 * gtkutil.c: Add extern decl for Qxft.
2868
2869 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2870
2871 * emacs.c, eval.c: Use bool for boolean.
2872 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2873 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2874 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2875 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2876 (main, decode_env_path, Fdaemon_initialized):
2877 * eval.c (call_debugger, Finteractive_p, interactive_p):
2878 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2879 (maybe_call_debugger, Fbacktrace):
2880 * process.c (read_process_output, exec_sentinel):
2881 Use bool for booleans.
2882 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2883 All callers changed.
2884 * eval.c (interactive_p): Omit always-true boolean argument
2885 EXCLUDE_SUBRS_P. All callers changed.
2886 * dispextern.h, lisp.h: Reflect above API changes.
2887 * firstfile.c (dummy): Use the address of 'main', whose signature
2888 won't change, instead of the address of 'initialize', whose
2889 signature just changed from int to bool.
2890 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2891 * msdos.c (fatal_error_in_progress): ... from here.
2892 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2893 of incrementing it.
2894 (redisplay_internal, unwind_redisplay): Simply clear
2895 REDISPLAYING_P when unwinding, instead of saving its previous,
2896 always-false value and then restoring it.
2897
2898 Clean up some extern decls.
2899 Mostly, this hoists extern decls out of .c files and into .h files.
2900 That way, we're more likely to catch errors if the interfaces change.
2901 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2902 declare xg_mark_data.
2903 * dispextern.h (x_frame_parm_handlers):
2904 * font.h (Qxft):
2905 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2906 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2907 (Qultra_bold, Qoblique, Qitalic):
2908 Move extern decl here from .c file.
2909 * alloc.c (xg_mark_data) [USE_GTK]:
2910 * doc.c (Qclosure):
2911 * eval.c (Qlexical_binding):
2912 * fns.c (time) [!HAVE_UNISTD_H]:
2913 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2914 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2915 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2916 * lread.c (Qinternal_interpreter_environment):
2917 * minibuf.c (Qbuffer):
2918 * process.c (QCfamily, QCfilter):
2919 * widget.c (free_frame_faces):
2920 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2921 * xfont.c (x_clear_errors):
2922 * xterm.c (x_frame_parm_handlers):
2923 Remove now-redundant extern decls.
2924 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2925 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2926 Now static.
2927 * xfaces.c: Remove unnecessary static decls.
2928 * xterm.c (updating_frame): Remove decl of nonexistent object.
2929
2930 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2931 when building globals.h, as the objects that are not built on
2932 this host are not needed to compile C files on this host.
2933
2934 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2935
2936 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2937
2938 * frame.h: Add missing prototype for x_wm_set_size_hint.
2939
2940 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2941
2942 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2943 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2944 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2945 (Fsubstitute_command_keys):
2946 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2947 (save_excursion_save, save_excursion_restore)
2948 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2949 (format_time_string, general_insert_function)
2950 (make_buffer_string, make_buffer_string_both)
2951 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2952 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2953 (copy_text, insert_1, insert_1_both, insert_from_string)
2954 (insert_from_string_before_markers, insert_from_string_1)
2955 (insert_from_buffer, insert_from_buffer_1, replace_range)
2956 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2957 (del_range_2, modify_region):
2958 * intervals.c (intervals_equal, balance_possible_root_interval)
2959 (adjust_intervals_for_insertion, merge_properties_sticky)
2960 (graft_intervals_into_buffer, lookup_char_property)
2961 (adjust_for_invis_intang, set_point_both)
2962 (get_property_and_range, compare_string_intervals)
2963 (set_intervals_multibyte_1, set_intervals_multibyte):
2964 * keyboard.c (decode_timer):
2965 Use bool for boolean.
2966 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2967 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2968
2969 2012-09-02 Chong Yidong <cyd@gnu.org>
2970
2971 * keymap.c (push_key_description): Print M-TAB as C-M-i
2972 (Bug#11758).
2973
2974 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2975
2976 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2977 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2978 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2979 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2980 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2981 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2982 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2983
2984 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2985
2986 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2987 more than one grapheme cluster passed to the shaper: compute the
2988 offset adjustment values separately for each cluster. (Bug#11860)
2989
2990 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2991 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2992 about implicit conversions from integer to pointer.
2993
2994 2012-09-01 Daniel Colascione <dancol@dancol.org>
2995
2996 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2997 system used too early.
2998
2999 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3000
3001 Better seed support for (random).
3002 * emacs.c (main): Call init_random.
3003 * fns.c (Frandom): Set the seed from a string argument, if given.
3004 Remove long-obsolete Gentzel cruft.
3005 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3006 (init_random): New function.
3007
3008 2012-09-01 Daniel Colascione <dancol@dancol.org>
3009
3010 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3011 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3012 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3013 x_wm_set_size_hint, x_query_colors, x_real_positions,
3014 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3015 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3016 all of which have been moved to common code.
3017
3018 * xfaces.c: Include TERM_HEADER instead of listing all possible
3019 window-system headers.
3020
3021 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3022 to match header.
3023
3024 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3025 directly accessing frame internals.
3026
3027 * w32font.h: Include font.h. Define syms_of_w32font and
3028 globals_of_w32font.
3029
3030 * process.c: Include TERM_HEADER instead of listing all possible
3031 window-system headers.
3032
3033 * nsterm.h: Remove declarations now in frame.h.
3034 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3035
3036 * menu.c: Include TERM_HEADER instead of listing all possible
3037 window-system headers.
3038
3039 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3040 window system.
3041
3042 * keyboard.c: Include TERM_HEADER instead of listing all possible
3043 window-system headers.
3044
3045 * image.c: Include TERM_HEADER instead of listing all possible
3046 window-system headers. Declare Vlibrary_cache when compiling for
3047 Windows.
3048
3049 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3050 window system declarations.
3051
3052 * frame.h: Move common functions here: set_frame_menubar,
3053 x_set_window_size, x_sync, x_get_focus_frame,
3054 x_set_mouse_position, x_set_mouse_pixel_position,
3055 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3056 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3057 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3058 x_activate_menubar, x_real_positions, x_bitmap_icon,
3059 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3060 and x_query_colors.
3061
3062 * frame.c: Include TERM_HEADER instead of listing all possible
3063 window-system headers.
3064
3065 * font.c: Include TERM_HEADER instead of listing all possible
3066 window-system headers.
3067
3068 * emacs.c: Include TERM_HEADER.
3069
3070 * dispnew.c: Include TERM_HEADER instead of listing all possible
3071 window-system headers.
3072
3073 * ccl.h: Include character.h.
3074
3075 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3076 the current window system; include in list of objects to link into
3077 Emacs.
3078
3079 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3080
3081 Remove mark_ttys function and fix tty_display_info initialization.
3082 * lisp.h (mark_ttys): Remove prototype.
3083 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3084 to mark_ttys because all possible values of 'top_frame' slot are
3085 the frames which are reachable from Vframe_list.
3086 * term.c (mark_ttys): Remove.
3087 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3088
3089 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3090
3091 Change struct frame bitfields from unsigned char to unsigned.
3092 * frame.h (struct frame): Change type of 'display_preempted',
3093 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3094 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3095 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3096 bitfields from unsigned char to unsigned.
3097
3098 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3099
3100 Remove unused member of struct x_output and struct w32_output.
3101 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3102 * w32term.h (struct w32_output): Likewise.
3103
3104 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3105
3106 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3107 does not become zero (Bug#12234).
3108
3109 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3110
3111 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3112 for GCC 4.7.1 x86-64.
3113
3114 2012-08-30 Glenn Morris <rgm@gnu.org>
3115
3116 * lread.c (init_lread): For out-of-tree builds, only add the
3117 source directory's site-lisp dir to the load-path if it exists,
3118 consistent with in-tree builds. (Bug#12302)
3119
3120 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3121
3122 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3123 button_values to NULL. Call setStykeMask so dialogs get a close button.
3124 (windowShouldClose:): Set window_closed.
3125 (dealloc): New member, free button_values.
3126 (process_dialog:): Make member function. Remove window argument,
3127 replace window with self. Count buttons and allocate and store values
3128 in button_values.
3129 (addButton:value:row:): value is int with the name tag. Call setTag
3130 with tag. Remove return self, declare return value as void.
3131 (addString:row:): Remove return self, declare return value as void.
3132 (addSplit): Remove return self, declare return value as void.
3133 (clicked:): Remove return self, declare return value as void.
3134 Set dialog_return to button_values[seltag]. Code formatting change.
3135 (initFromContents:isQuestion:): Adjust call to process_dialog.
3136 Code formatting change.
3137 (timeout_handler:): Set timer_fired to YES.
3138 (runDialogAt:): Set timer_fired to NO.
3139 Handle click on close button as quit.
3140
3141 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3142 Add window_closed and button_values. Add void as return value for
3143 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3144 Add process_dialog as new member.
3145
3146 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3147
3148 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3149 is not one of the heaps we manage. (Bug#12242)
3150
3151 2012-08-28 Glenn Morris <rgm@gnu.org>
3152
3153 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3154
3155 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3156
3157 * window.c (Fset_window_configuration): Remove handling of
3158 auto-buffer-name window parameter. Install revision of reverted
3159 fix.
3160
3161 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3162
3163 Do not allow to set major mode for a dead buffer.
3164 * buffer.c (Fset_buffer_major_mode): Signal an error
3165 if the buffer is dead.
3166 (Fother_buffer, other_buffer_safely): Remove redundant
3167 nested declaration.
3168
3169 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3170
3171 Always use set_buffer_if_live to restore original buffer at unwind.
3172 * buffer.h (record_unwind_current_buffer): New function.
3173 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3174 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3175 * undo.c, window.c: Adjust users.
3176 * buffer.c (set_buffer_if_live): Fix comment.
3177
3178 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3179
3180 Fix usage of set_buffer_internal.
3181 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3182 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3183 * coding.c (decode_coding): Omit redundant test.
3184 * fileio.c (decide_coding_unwind): Likewise.
3185 * fns.c (secure_hash): Likewise.
3186 * insdel.c (modify_region): Likewise.
3187 * keyboard.c (command_loop_1): Likewise.
3188 * print.c (PRINTFINISH): Likewise.
3189 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3190
3191 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3192
3193 * dispnew.c: Use bool for boolean.
3194 (frame_garbaged, display_completed, delayed_size_change)
3195 (fonts_changed_p, add_window_display_history)
3196 (add_frame_display_history, verify_row_hash)
3197 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3198 (row_equal_p, realloc_glyph_pool)
3199 (allocate_matrices_for_frame_redisplay)
3200 (showing_window_margins_p)
3201 (adjust_frame_glyphs_for_frame_redisplay)
3202 (build_frame_matrix_from_leaf_window, make_current)
3203 (mirrored_line_dance, mirror_line_dance, update_frame)
3204 (update_window_tree, update_single_window)
3205 (check_current_matrix_flags, update_window, update_text_area)
3206 (update_window_line, set_window_update_flags, scrolling_window)
3207 (update_frame_1, scrolling, buffer_posn_from_coords)
3208 (do_pending_window_change, change_frame_size)
3209 (change_frame_size_1, sit_for):
3210 Use bool for boolean.
3211 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3212 and remove last int (actually boolean) argument, which was always 0.
3213 All callers changed.
3214 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3215 * dispextern.h (struct composition_it): Use bool for boolean.
3216 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3217 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3218 * dired.c (file_name_completion):
3219 Use bool for boolean. (This was missed in an earlier change.)
3220
3221 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3222
3223 * window.c (Fset_window_configuration): Revert first part of
3224 last change.
3225
3226 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3227
3228 * nsterm.h (NSPanel): New class variable dialog_return.
3229
3230 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3231 Initialize dialog_return.
3232 (windowShouldClose:): Use stop instead of stopModalWithCode.
3233 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3234 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3235 event.
3236 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3237 modal loop returns.
3238
3239 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3240
3241 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3242 * composite.c (find_composition, composition_gstring_p)
3243 (composition_reseat_it, find_automatic_composition):
3244 * data.c (let_shadows_buffer_binding_p)
3245 (let_shadows_global_binding_p, set_internal, make_blv)
3246 (Fmake_variable_buffer_local, Fmake_local_variable)
3247 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3248 (cons_to_signed, arith_driver):
3249 * dbusbind.c (xd_in_read_queued_messages):
3250 * dired.c (directory_files_internal, file_name_completion):
3251 Use bool for booleans.
3252 * dired.c (file_name_completion):
3253 * process.h (fd_callback):
3254 Omit int (actually boolean) argument. It wasn't being used.
3255 All uses changed.
3256 * composite.h, lisp.h: Reflect above API changes.
3257
3258 * cmds.c, coding.c: Use bool for booleans.
3259 * cmds.c (move_point, Fself_insert_command):
3260 * coding.h (struct composition status, struct coding_system):
3261 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3262 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3263 (emacs_mule_char, decode_coding_emacs_mule)
3264 (encode_coding_emacs_mule, detect_coding_iso_2022)
3265 (decode_coding_iso_2022, encode_invocation_designation)
3266 (encode_designation_at_bol, encode_coding_iso_2022)
3267 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3268 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3269 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3270 (encode_coding_raw_text, detect_coding_charset)
3271 (decode_coding_charset, encode_coding_charset, detect_eol)
3272 (detect_coding, get_translation_table, produce_chars)
3273 (consume_chars, reused_workbuf_in_use)
3274 (make_conversion_work_buffer, code_conversion_save)
3275 (decode_coding_object, encode_coding_object)
3276 (detect_coding_system, char_encodable_p)
3277 (Funencodable_char_position, code_convert_region)
3278 (code_convert_string, code_convert_string_norecord)
3279 (Fset_coding_system_priority):
3280 * fileio.c (Finsert_file_contents):
3281 Use bool for booleans.
3282 * coding.h, lisp.h: Reflect above API changes.
3283 * coding.c: Remove unnecessary static function decls.
3284 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3285 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3286 not a boolean 'int', since callers never look at the return value.
3287 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3288 * coding.h (decoding_buffer_size, encoding_buffer_size)
3289 (emacs_mule_string_char): Remove unused extern decls.
3290 (struct iso_2022_spec, struct coding_system):
3291 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3292 (struct emacs_mule_spec): Remove unused field 'full_support'.
3293 All initializations removed.
3294 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3295
3296 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3297
3298 Fix spare memory change (Bug#12286).
3299 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3300 (valid_lisp_object_p): Likewise.
3301
3302 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3303
3304 * window.c (Fset_window_configuration): Record any window's old
3305 buffer if it's replaced (see Bug#8789). If the new current
3306 buffer doesn't appear in the selected window, go to its old
3307 point (Bug#12208).
3308
3309 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3310
3311 Special MEM_TYPE_SPARE to denote reserved memory.
3312 * alloc.c (enum mem_type): New memory type.
3313 (refill_memory_reserve): Use new type for spare memory.
3314 This prevents live_cons_p and live_string_p from incorrect
3315 detection of uninitialized objects from spare memory as live.
3316
3317 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3318
3319 Spelling fixes.
3320 * Makefile.in (.PHONY): versioclean -> versionclean.
3321
3322 Remove unused external symbols.
3323 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3324 * window.c (Qwindow_valid_p, decode_valid_window):
3325 Now static, not extern.
3326 * data.c (Qinterval): Remove; unused.
3327 (syms_of_data): Do not define 'interval'.
3328 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3329 * window.h (decode_valid_window):
3330 Remove decls.
3331
3332 * character.c, charset.c, chartab.c: Use bool for booleans.
3333 * character.c (lisp_string_width, string_count_byte8)
3334 (string_escape_byte8):
3335 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3336 (load_charset_map_from_file, map_charset_chars)
3337 (Fdefine_charset_internal, define_charset_internal)
3338 (Fdeclare_equiv_charset, find_charsets_in_text)
3339 (Ffind_charset_region, char_charset, Fiso_charset):
3340 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3341 (sub_char_table_set, sub_char_table_set_range)
3342 (char_table_set_range, optimize_sub_char_table)
3343 (map_sub_char_table):
3344 Use bool for boolean.
3345 * character.c (str_to_unibyte): Omit last boolean argument; it was
3346 always 0. All callers changed.
3347 * character.h, charset.h: Adjust to match previous changes.
3348 * character.h (char_printable_p): Remove decl of nonexistent function.
3349 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3350 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3351 are all boolean, so make them single-bit bitfields.
3352
3353 * lisp.h (ASET): Remove attempt to detect side effects.
3354 It was meant to be temporary and it often doesn't work,
3355 because when IDX has side effects the behavior of IDX==IDX
3356 is undefined. See Stefan Monnier in
3357 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3358
3359 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3360
3361 * lisp.h (functionp): New function (extracted from Ffunctionp).
3362 (FUNCTIONP): Use it.
3363 * eval.c (Ffunctionp): Use it.
3364
3365 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3366
3367 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3368 as that's faster and simpler than static storage. Don't bother
3369 with the g_main_context_query overhead if g_main_context_pending
3370 says no events are pending.
3371 (gfds, gfds_size): Remove these static vars.
3372 (xgselect_initialize): Remove; no longer needed.
3373 All uses and decls removed.
3374
3375 * emacs.c (fatal_error_signal_hook): Remove.
3376 All uses removed. This leftover from old code was always 0.
3377
3378 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3379 * casefiddle.c (casify_object, casify_region):
3380 * casetab.c (set_case_table):
3381 * category.c, category.h (word_boundary_p):
3382 * category.h (CHAR_HAS_CATEGORY):
3383 Use bool for booleans, instead of int.
3384
3385 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3386
3387 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3388
3389 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3390
3391 On assertion failure, print backtrace if available.
3392 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3393 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3394 * Makefile.in (LIB_EXECINFO): New macro.
3395 (LIBES): Use it.
3396
3397 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3398 * bytecode.c (exec_byte_code):
3399 * callint.c (check_mark, Fcall_interactively):
3400 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3401 (getenv_internal, sync_process_alive, call_process_exited):
3402 * lisp.h (USE_SAFE_ALLOCA):
3403 Use bool for booleans, instead of int.
3404 * lisp.h, process.h: Adjust prototypes to match above changes.
3405 * callint.c (Fcall_interactively): Don't assume the mark's
3406 offset fits in 'int'.
3407
3408 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3409
3410 * buffer.c, buffer.h: Use bool for boolean.
3411 * buffer.c (reset_buffer_local_variables)
3412 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3413 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3414 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3415 (overlay_touches_p, overlay_strings, Foverlay_put)
3416 (report_overlay_modification, call_overlay_mod_hooks):
3417 (mmap_enlarge, mmap_set_vars):
3418 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3419 Use bool for booleans, instead of int.
3420 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3421 since the 1-or-0 return value is always ignored anyway.
3422 (mmap_initialized_p):
3423 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3424 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3425
3426 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3427
3428 * bidi.c: Use bool for boolean.
3429 This is a bit more readable, and makes the text segment of bidi.o
3430 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3431 Presumably it's faster too.
3432 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3433 Now bool.
3434 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3435 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3436 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3437 (bidi_explicit_dir_char, bidi_level_of_next_char)
3438 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3439 Use bool for booleans, instead of int.
3440 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3441 (bidi_unshelve_cache): Adjust decls to match code.
3442
3443 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3444
3445 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3446 argument.
3447
3448 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3449
3450 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3451 * atimer.h: Include <stdbool.h>.
3452
3453 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3454
3455 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3456 compile time tests instead of run time tests on systems that do
3457 not use them.
3458 (FRAME_MAC_P): Remove leftover from deleted code.
3459 * frame.c (syms_of_frame): Remove leftover from deleted code.
3460
3461 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3462
3463 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3464
3465 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3466
3467 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3468 Otherwise, the compiler complains about (A?B:C) where B is void
3469 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3470 (fontset_add): Return void, for FONTSET_ADD.
3471
3472 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3473
3474 * alloc.c: Use bool for booleans.
3475 (gc_in_progress, abort_on_gc)
3476 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3477 (dont_register_blocks) [GC_MALLOC_CHECK]:
3478 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3479 (check_string_bytes, make_specified_string, memory_full)
3480 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3481 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3482 (mark_stack, valid_pointer_p, make_pure_string)
3483 (Fgarbage_collect, survives_gc_p, gc_sweep):
3484 Use bool for booleans, instead of int.
3485 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3486 Remove unused local.
3487 * alloc.c (PURE_POINTER_P):
3488 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3489 * editfns.c (Fformat):
3490 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3491 (Fdo_auto_save):
3492 * fns.c (sweep_weak_table):
3493 * lisp.h (suppress_checking, push_message, survives_gc_p)
3494 (make_pure_string, gc_in_progress, abort_on_gc):
3495 * lread.c (readchar, read1):
3496 * print.c (Fprin1_to_string):
3497 * xdisp.c (push_message):
3498 Use bool for booleans affected directly or indirectly by
3499 alloc.c's changes.
3500
3501 Make recently-introduced setters macros.
3502 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3503 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3504 (set_fontset_default, set_fontset_fallback): Rename from their
3505 upper-case counterparts, and make them functions rather than macros.
3506 This is more consistent with the other recently-introduced setters.
3507 These don't need to be inline, since they're local.
3508
3509 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3510
3511 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3512 the loop (Bug#12247).
3513
3514 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3515
3516 * lisp.h (vcopy): Use memcpy rather than our own loop.
3517 This fixes a performance regression introduced by the recent
3518 addition of vcopy. This means 'vcopy' will need to be modified
3519 for a copying collector, but that's OK. Also, tighten the
3520 checking in the assertion.
3521
3522 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3523
3524 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3525 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3526 non-base glyph for the width of the base character, according to
3527 what x_draw_composite_glyph_string_foreground expects.
3528 Generate WADJUST value according to composition_gstring_width's
3529 expectations, to produce correct width of the composed character.
3530 Reverse the sign of the DU offset produced by ScriptPlace.
3531
3532 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3533
3534 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3535
3536 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3537
3538 Avoid direct writes to contents member of struct Lisp_Vector.
3539 * lisp.h (vcopy): New function to copy data into vector.
3540 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3541 * fns.c (Ffillarray): Use ASET.
3542 * keyboard.c (timer_check_2): Use AREF and ASET.
3543 (append_tool_bar_item, Frecent_keys): Use vcopy.
3544 * lread.c (read_vector): Use ASET.
3545 * msdos.c (Frecent_doskeys): Use vcopy.
3546 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3547 (Finternal_merge_in_global_face): Use ASET and vcopy.
3548 * xfont.c (xfont_list_pattern): Likewise.
3549
3550 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3551
3552 * window.c (Fwindow_point): For the selected window always return
3553 the position of its buffer's point.
3554 (Fset_window_point): For the selected window always go in its
3555 buffer to the specified position.
3556
3557 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3558
3559 Setter macros for fontsets.
3560 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3561 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3562 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3563 Adjust users.
3564
3565 2012-08-20 Glenn Morris <rgm@gnu.org>
3566
3567 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3568 Don't assume that `ln -f' works.
3569
3570 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3571
3572 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3573 and later about non-assignments with no effect. See discussion at
3574 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3575 details.
3576
3577 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3578
3579 Inline setter functions for Lisp_Objects slots of struct specbinding.
3580 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3581 Adjust users.
3582
3583 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3584
3585 * window.c (select_window): Always make selected window's buffer
3586 current.
3587
3588 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3589
3590 Use AREF and ASET for docstrings of category tables.
3591 * category.h (CATEGORY_DOCSTRING): Use AREF.
3592 (SET_CATEGORY_DOCSTRING): Use ASET.
3593 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3594
3595 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3596
3597 Inline setter functions for hash table members.
3598 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3599 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3600 (set_hash_key_and_value, set_hash_index, set_hash_next)
3601 (set_hash_hash): New functions.
3602 * charset.c, fns.c: Adjust users.
3603
3604 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3605
3606 Inline getter and setter functions for per-buffer values.
3607 * buffer.h (per_buffer_default, set_per_buffer_default)
3608 (per_buffer_value, set_per_buffer_value): New functions.
3609 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3610 * buffer.c, data.c: Adjust users.
3611
3612 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3613
3614 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3615
3616 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3617
3618 Rely on <config.h> + <unistd.h> to declare 'environ',
3619 as gnulib does this if the system doesn't.
3620 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3621 Remove declaration. MS-Windows declares it on stdlib.h which is
3622 included by conf_post.h.
3623 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3624 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3625 * vm-limit.c: Include <unistd.h>, for 'environ'.
3626
3627 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3628 (start_of_data): Remove decl; mem-limits.h provides it.
3629
3630 * xdisp.c (handle_invisible_prop): Make it a bit faster
3631 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3632
3633 2012-08-19 Chong Yidong <cyd@gnu.org>
3634
3635 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3636 ends (Bug#3874).
3637
3638 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3639
3640 * .gdbinit: Use call instead of set when calling a function in the
3641 inferior.
3642
3643 * data.c (set_internal): Don't use set_blv_found.
3644 (Fkill_local_variable): Likewise.
3645
3646 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3647
3648 * nsfont.m (ns_ascii_average_width): Ensure the string
3649 ascii_printable is initialized with a null-terminated character
3650 array. Otherwise, it can contain undesired extra characters.
3651
3652 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3653
3654 port new setting code to Sun C 5.8 2005/10/13
3655 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3656 Return void, not Lisp_Object. Otherwise, the compiler
3657 complains about (A?B:C) where B is void and C is Lisp_Object
3658 when compiling CHAR_TABLE_SET, due to the recent change to
3659 the API of sub_char_table_set_contents.
3660
3661 2012-08-18 Chong Yidong <cyd@gnu.org>
3662
3663 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3664 for the string case (Bug#3874).
3665
3666 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3667
3668 * buffer.h (BSET): Remove (Bug#12215).
3669 Replace all uses with calls to new setter functions.
3670 (bset_bidi_paragraph_direction, bset_case_canon_table)
3671 (bset_case_eqv_table, bset_directory, bset_display_count)
3672 (bset_display_time, bset_downcase_table)
3673 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3674 (bset_last_selected_window, bset_local_var_alist)
3675 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3676 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3677 (bset_width_table):
3678 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3679 (bset_auto_fill_function, bset_auto_save_file_format)
3680 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3681 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3682 (bset_cache_long_line_scans, bset_case_fold_search)
3683 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3684 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3685 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3686 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3687 (bset_header_line_format, bset_indicate_buffer_boundaries)
3688 (bset_indicate_empty_lines, bset_invisibility_spec)
3689 (bset_left_fringe_width, bset_major_mode, bset_mark)
3690 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3691 (bset_name, bset_overwrite_mode, bset_pt_marker)
3692 (bset_right_fringe_width, bset_save_length)
3693 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3694 (bset_scroll_up_aggressively, bset_selective_display)
3695 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3696 (bset_word_wrap, bset_zv_marker):
3697 * category.c (bset_category_table):
3698 * syntax.c (bset_syntax_table):
3699 New setter functions.
3700
3701 * process.h (PSET): Remove (Bug#12215).
3702 Replace all uses with calls to new setter functions.
3703 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3704 (PROCESS_INLINE): New macro.
3705 (pset_childp): New setter function.
3706 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3707 * process.c (PROCESS_INLINE):
3708 Define to EXTERN_INLINE, so that the corresponding functions
3709 are compiled into code.
3710 (pset_buffer, pset_command, pset_decode_coding_system)
3711 (pset_decoding_buf, pset_encode_coding_system)
3712 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3713 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3714 (pset_type, pset_write_queue): New setter functions.
3715
3716 * window.h (WSET): Remove (Bug#12215).
3717 Replace all uses with calls to new setter functions.
3718 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3719 (WINDOW_INLINE): New macro.
3720 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3721 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3722 (wset_total_lines, wset_vertical_scroll_bar)
3723 (wset_window_end_pos, wset_window_end_valid)
3724 (wset_window_end_vpos): New setter functions.
3725 * window.c (WINDOW_INLINE):
3726 Define to EXTERN_INLINE, so that the corresponding functions
3727 are compiled into code.
3728 (wset_combination_limit, wset_dedicated, wset_display_table)
3729 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3730 (wset_new_normal, wset_new_total, wset_next_buffers)
3731 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3732 (wset_prev_buffers, wset_right_fringe_width)
3733 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3734 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3735 (wset_window_parameters):
3736 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3737 (wset_column_number_displayed, wset_region_showing):
3738 New setter functions.
3739
3740 * termhooks.h (TSET): Remove (Bug#12215).
3741 Replace all uses with calls to new setter functions.
3742 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3743 (TERMHOOKS_INLINE): New macro.
3744 (tset_charset_list, tset_selection_alist): New setter functions.
3745 * terminal.c (TERMHOOKS_INLINE):
3746 Define to EXTERN_INLINE, so that the corresponding functions
3747 are compiled into code.
3748 (tset_param_alist): New setter function.
3749
3750 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3751
3752 * keyboard.h (KSET): Remove (Bug#12215).
3753 Replace all uses with calls to new setter functions.
3754 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3755 (KEYBOARD_INLINE): New macro.
3756 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3757 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3758 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3759 New setter functions.
3760 * keyboard.c (KEYBOARD_INLINE):
3761 Define to EXTERN_INLINE, so that the corresponding functions
3762 are compiled into code.
3763 (kset_echo_string, kset_kbd_queue)
3764 (kset_keyboard_translate_table, kset_last_prefix_arg)
3765 (kset_last_repeatable_command, kset_local_function_key_map)
3766 (kset_overriding_terminal_local_map, kset_real_last_command)
3767 (kset_system_key_syms): New setter functions.
3768
3769 * frame.h (FSET): Remove (Bug#12215).
3770 Replace all uses with calls to new setter functions.
3771 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3772 (FRAME_INLINE): New macro.
3773 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3774 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3775 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3776 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3777 (fset_param_alist, fset_root_window, fset_scroll_bars)
3778 (fset_selected_window, fset_title, fset_tool_bar_items)
3779 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3780 * frame.c (FRAME_INLINE):
3781 Define to EXTERN_INLINE, so that the corresponding functions
3782 are compiled into code.
3783 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3784
3785 A few more naming-convention fixes for getters and setters.
3786 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3787 and rename from buffer_overlays_set_before.
3788 (set_buffer_overlays_after): Move here from buffer.h, and rename
3789 from buffer_overlays_set_after.
3790 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3791 All uses changed.
3792 (set_buffer_intervals): Rename from buffer_set_intervals.
3793 * intervals.c (set_interval_object): Move here from intervals.h,
3794 and rename from interval_set_object.
3795 (set_interval_left): Move here from intervals.h, and rename from
3796 interval_set_left.
3797 (set_interval_right): Move here from intervals.h, and rename from
3798 interval_set_right.
3799 (copy_interval_parent): Move here from intervals.h, and rename from
3800 interval_copy_parent.
3801 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3802 (set_interval_plist): Rename from interval_set_plist.
3803 Return void, not Lisp_Object, since no caller uses the result.
3804 * lisp.h (string_intervals): Rename from string_get_intervals.
3805 (set_string_intervals): Rename from string_set_intervals.
3806
3807 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3808 (set_char_table_contents): Rename from char_table_set_contents.
3809 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3810 All uses changed. See the end of
3811 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3812
3813 * lisp.h (CSET): Remove (Bug#12215).
3814 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3815 (set_char_table_purpose): New functions,
3816 replacing CSET. All uses changed. For example, replace
3817 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3818 "set_char_table_parent (char_table, parent);".
3819 The old version was confusing because it used the same name
3820 'parent' for two different things.
3821
3822 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3823
3824 Functions to get and set Lisp_Object fields of buffer-local variables.
3825 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3826 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3827 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3828 * data.c, eval.c, frame.c: Adjust users.
3829
3830 2012-08-17 Chong Yidong <cyd@gnu.org>
3831
3832 * xfaces.c (merge_face_vectors): If the target font specfies a
3833 font spec, make the font's attributes take precedence over
3834 directly-specified attributes.
3835 (merge_face_ref): Recognize :font.
3836
3837 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3838
3839 Do not use memcpy for copying intervals.
3840 * intervals.c (reproduce_interval): New function.
3841 (reproduce_tree, reproduce_tree_obj): Use it.
3842 (reproduce_tree_obj): Remove prototype.
3843
3844 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3845
3846 * lisp.h (duration_to_sec_usec): Remove unused decl.
3847
3848 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3849
3850 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3851 to an allocated instance of NSString, not to the class itself.
3852
3853 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3854
3855 * makefile.w32-in (C_CTYPE_H): New macro.
3856 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3857 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3858 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3859
3860 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3861
3862 Use ASCII tests for character types.
3863 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3864 * xfns.c, xterm.c:
3865 Don't include <ctype.h>; was not needed.
3866 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3867 * sysdep.c, xfaces.c:
3868 Include <c-ctype.h> instead of <ctype.h>.
3869 * nsterm.m: Include <c-ctype.h>.
3870 * charset.c (read_hex):
3871 * doc.c (Fsnarf_documentation):
3872 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3873 (DRIVE_LETTER) [DOS_NT]:
3874 (Ffile_name_directory, Fexpand_file_name)
3875 (Fsubstitute_in_file_name):
3876 * font.c (font_parse_xlfd, font_parse_fcname):
3877 * frame.c (x_set_font_backend):
3878 * gtkutil.c (xg_get_font):
3879 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3880 * nsimage.m (hexchar):
3881 * nsterm.m (ns_xlfd_to_fontname):
3882 * sysdep.c (system_process_attributes):
3883 * xfaces.c (hash_string_case_insensitive):
3884 Use C-locale tests instead of locale-specific tests for character
3885 types, since we want the ASCII interpretation here, not the
3886 interpretation suitable for whatever happens to be the current locale.
3887
3888 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3889
3890 Consistently check windows for validity/liveness
3891 (Bug#11984, Bug#12025, Bug#12026).
3892 * lisp.h (CHECK_VALID_WINDOW): New macro.
3893 * window.c (decode_window): Rename to decode_live_window.
3894 (decode_valid_window, Fwindow_valid_p): New functions.
3895 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3896 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3897 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3898 (Fwindow_prev_sibling, Fwindow_combination_limit)
3899 (Fset_window_combination_limit, Fwindow_use_time)
3900 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3901 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3902 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3903 (Fwindow_hscroll, Fset_window_hscroll)
3904 (Fwindow_redisplay_end_trigger)
3905 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3906 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3907 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3908 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3909 (Fwindow_end, Fset_window_point, Fset_window_start)
3910 (Fpos_visible_in_window_p, Fwindow_line_height)
3911 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3912 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3913 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3914 (Fset_window_parameter, Fwindow_display_table)
3915 (Fset_window_display_table, Fdelete_other_windows_internal)
3916 (Fset_window_buffer, Fset_window_new_total)
3917 (Fset_window_new_normal, Fdelete_window_internal)
3918 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3919 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3920 (Fwindow_scroll_bars): Check whether argument window is a valid or
3921 live window. Update doc-strings.
3922 (syms_of_window): New symbol Qwindow_valid_p.
3923 * keyboard.c (Fposn_at_x_y): Check whether argument
3924 frame_or_window denotes a valid window.
3925
3926 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3927
3928 Fix previous char table change.
3929 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3930 * chartab.c (optimize_sub_char_table): Likewise.
3931
3932 2012-08-16 Chong Yidong <cyd@gnu.org>
3933
3934 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3935
3936 * xfont.c (xfont_open):
3937 * xftfont.c (xftfont_open): Set the font's max_width field.
3938
3939 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3940 min_width to space_width and average_width to the average over
3941 printable ASCII characters.
3942 (ns_char_width): Code cleanup.
3943 (ns_ascii_average_width): New utility function.
3944
3945 * font.h (struct font): Update comments.
3946
3947 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3948
3949 Simple interface to set Lisp_Object fields of character tables.
3950 * lisp.h (CSET): New macro.
3951 (char_table_set_extras, char_table_set_contents)
3952 (sub_char_table_set_contents): New function.
3953 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3954 * syntax.c: Adjust users.
3955
3956 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3957
3958 * eval.c (eval_sub): Bind lexical-binding.
3959 * lread.c (Qlexical_binding): Make non-static.
3960
3961 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3962
3963 * nsmenu.m (popupSession): Remove.
3964 (pop_down_menu): Remove endModalSession.
3965 (timeout_handler:): New method.
3966 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3967 Call runModalForWindow. Check timer_fired when it returns.
3968 If not set, cancel timer and break out of loop.
3969 Otherwise loop again, with a new timeout.
3970
3971 * nsterm.m: Include fcntl.h if present.
3972 (fd_entry, t_readfds, inNsSelect): Remove.
3973 (select_writefds, select_valid, select_timeout, selfds)
3974 (select_mutex, apploopnr): Add.
3975 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3976 Otherwise call kbd_buffer_store_event.
3977 (ns_send_appdefined): Remove release of fd_entry.
3978 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3979 Increment and decrement apploopnr.
3980 (ns_select): If no file descriptors, just do a NSTimer.
3981 Otherwise copy read/write masks and start select thread (fd_handler).
3982 Start main loop and wait for application defined event.
3983 Inform select thread to stop selecting after main loop is exited.
3984 (ns_term_init): Create selfds pipe and set non-blocking.
3985 Initialize select_mutex. Start the select thread (fd_handler).
3986 (fd_handler:): Loop forever, wait for info from the main thread
3987 to either start or stop selecting. When select returns, send
3988 and appdefined event.
3989 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3990 If not call kbd_buffer_store_event.
3991
3992 * nsterm.h (EmacsApp): fd_handler takes id argument.
3993 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3994
3995 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3996
3997 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3998
3999 * region-cache.c (move_cache_gap): Update gap_len using the actual
4000 growth of the boundaries array. Do not change cache_len.
4001 (Bug#12196)
4002
4003 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4004
4005 Generalize and cleanup font subsystem checks.
4006 * font.h (FONT_DEBUG, font_assert): Remove.
4007 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4008 Change font_assert to eassert. Use eassert where appropriate.
4009
4010 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4011
4012 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4013
4014 2012-08-15 Chong Yidong <cyd@gnu.org>
4015
4016 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4017 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4018 extract the font descriptor instead of just the font name.
4019 In that case, return a font spec instead of a string.
4020 (x_last_font_name): Move to this file from xfns.c.
4021
4022 * xfns.c (Fx_select_font): The return value can also be a font
4023 spec. Move x_last_font_name management to gtkutil.c.
4024
4025 * xfaces.c: Make font weight and style symbols non-static.
4026
4027 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4028
4029 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4030 (bug#12117).
4031
4032 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4033
4034 * alloc.c (Fgarbage_collect): Use plural form consistently.
4035
4036 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4037
4038 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4039 iteration through the command loop. Fixes a problem whereby mouse
4040 movements are ignored until the first mouse click.
4041
4042 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4043
4044 Use bool, not int, for Lisp booleans.
4045 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4046 makes Emacs a bit smaller and presumably a bit faster.
4047 * lisp.h: Include <stdbool.h>.
4048 (struct Lisp_Boolfwd, defvar_bool):
4049 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4050 * regex.c [!emacs]: Include <stdbool.h>.
4051 (false, true): Remove; <stdbool.h> does this for us now.
4052
4053 2012-08-14 Chong Yidong <cyd@gnu.org>
4054
4055 * character.c (Fcharacterp): Doc fix (Bug#12076).
4056
4057 * data.c (Findirect_variable): Doc fix (Bug#11040).
4058
4059 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4060
4061 * editfns.c (Fformat): Doc fix (Bug#12059).
4062 (Fsave_current_buffer): Doc fix (Bug#11542).
4063
4064 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4065
4066 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4067 (bug#12022).
4068
4069 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4070
4071 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4072 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4073 * minibuf.c (choose_minibuf_frame, read_minibuf):
4074 * w32fns.c (x_create_tip_frame):
4075 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4076 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4077
4078 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4079
4080 * intervals.c (offset_intervals): Remove obsolete comment.
4081
4082 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4083
4084 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4085
4086 2012-08-14 Gergely Risko <gergely@risko.hu>
4087
4088 * coding.c (decode_coding): Record buffer modification before
4089 disabling undo_list (Bug#11773).
4090
4091 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4092
4093 Revert and cleanup some recent overlay changes.
4094 * buffer.h (enum overlay_type): Remove.
4095 (buffer_get_overlays, buffer_set_overlays): Likewise.
4096 (buffer_set_overlays_before, buffer_set_overlays_after):
4097 New function. Adjust users.
4098 (unchain_both): Add eassert.
4099
4100 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4101
4102 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4103
4104 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4105
4106 * gtkutil.c (xg_mark_data): Don't assume C99.
4107
4108 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4109
4110 * gtkutil.c (xg_frame_tb_info): New struct.
4111 (TB_INFO_KEY): New define.
4112 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4113 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4114 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4115 if not present.
4116 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4117 is up to date. Otherwise store new data.
4118 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4119
4120 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4121
4122 Use KSET for write access to Lisp_Object members of struct kboard.
4123 * keyboard.h (KSET): New macro.
4124 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4125 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4126 * xterm.c: Adjust users.
4127
4128 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4129
4130 Use BSET for write access to Lisp_Object members of struct buffer.
4131 * buffer.h (BSET): New macro.
4132 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4133 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4134 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4135 * window.c, xdisp.c, xfns.c: Adjust users.
4136
4137 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4138
4139 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4140
4141 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4142
4143 * nsterm.m (not_in_argv): New function.
4144 (application:openFile, application:openTempFile:):
4145 (application:openFileWithoutUI:, application:openFiles:): Open file
4146 if not_in_argv returns non-zero (bug#12171).
4147
4148 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4149 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4150 Define for Gtk+ versions less than 3.2.
4151 (xg_get_font_name): Use those functions/macros here.
4152 Reported by Frans Oilinki <moilinki@gmail.com>.
4153
4154 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4155
4156 * unexmacosx.c (copy_data_segment): Copy initialized data in
4157 statically linked libraries from input file rather than memory.
4158
4159 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4160 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4161 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4162
4163 2012-08-10 Glenn Morris <rgm@gnu.org>
4164
4165 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4166 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4167
4168 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4169
4170 Fix last change to allow compilation with low optimization levels.
4171 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4172 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4173
4174 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4175
4176 Use common inline syntax in intervals.h.
4177 * intervals.h (INTERVALS_INLINE): New macro.
4178 Change all users from LISP_INLINE.
4179
4180 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4181
4182 Define Qnone once for all platforms.
4183 * frame.c (Qnone): Define here.
4184 (syms_of_frame): DEFSYM it.
4185 * lisp.h (Qnone): New declaration.
4186 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4187 * xfns.c: Remove duplication. Adjust users.
4188
4189 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4190
4191 Remove unused macros from intervals.h.
4192 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4193 * intervals.c: Adjust comment.
4194
4195 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4196
4197 * w32fns.c <w32_unicode_gui>: New static variable.
4198 (globals_of_w32fns): Initialize it according to os_subtype.
4199 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4200 testing os_subtype.
4201
4202 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4203 Eli Zaretskii <eliz@gnu.org>
4204
4205 Fix bug #10299 with Unicode characters sent by customized
4206 keyboards created by MSKLC.
4207 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4208 (w32_init_class): Use it to initialize the Emacs class with either
4209 ANSI or Unicode API calls.
4210 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4211 later.
4212 (w32_wnd_proc): If the character code sent by WM_CHAR or
4213 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4214 original message. Call DefWindowProcW on NT and later.
4215
4216 2012-08-10 Glenn Morris <rgm@gnu.org>
4217
4218 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4219
4220 * lisp.h (DIRECTORY_SEP): Let configure set it.
4221
4222 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4223
4224 Use TSET for write access to Lisp_Object slots of struct terminal.
4225 * termhooks.h (TSET): New macro.
4226 * coding.c, terminal.c, xselect.c: Adjust users.
4227
4228 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4229
4230 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4231 the failing expression, include them in the error message.
4232 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4233 * lisp.h (internal_condition_case_n): Update declaration.
4234
4235 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4236
4237 Inline functions to examine and change buffer overlays.
4238 * buffer.c (unchain_both): New function.
4239 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4240 (buffer_has_overlays): New function.
4241 (enum overlay_type): New enum.
4242 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4243 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4244
4245 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4246
4247 Inline functions to examine and change buffer intervals.
4248 * alloc.c (mark_interval_tree): Remove.
4249 (MARK_INTERVAL_TREE): Simplify.
4250 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4251 * intervals.c (buffer_balance_intervals): New function.
4252 (graft_intervals_into_buffer): Adjust indentation.
4253 (set_intervals_multibyte): Simplify.
4254 * buffer.h (BUF_INTERVALS): Remove.
4255 (buffer_get_intervals, buffer_set_intervals): New function.
4256 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4257 * intervals.c, textprop.c: Adjust users.
4258
4259 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4260
4261 Inline functions to examine and change string intervals.
4262 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4263 (string_get_intervals, string_set_intervals): New function.
4264 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4265 * lread.c, print.c, textprop.c: Adjust users.
4266
4267 2012-08-08 Glenn Morris <rgm@gnu.org>
4268
4269 * lisp.mk (lisp): Remove language/persian.elc.
4270
4271 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4272
4273 Cleanup intervals.
4274 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4275 (NULL_INTERVAL_P): Likewise. Adjust users.
4276 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4277 Adjust comment. Move under #if 0.
4278 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4279 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4280
4281 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4282
4283 Check total length of intervals with eassert.
4284 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4285 * intervals.c: Change all users to eassert.
4286
4287 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4288
4289 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4290 Rename fields to match removal of FGET and WGET and disuse of
4291 INTERNAL_FIELD in Lisp_Cons.
4292
4293 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4294
4295 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4296 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4297 name since all xname users are fixed long time ago. Do not
4298 use INTERNAL_FIELD.
4299 (set_symbol_name, set_symbol_function, set_symbol_plist):
4300 (set_symbol_next, set_overlay_plist): New function.
4301 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4302 (struct Lisp_Overlay): Likewise.
4303 (CVAR, MVAR, SVAR): Remove.
4304 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4305 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4306 * xterm.c: Adjust users.
4307 * .gdbinit: Change to use name field of struct Lisp_Symbol
4308 where appropriate.
4309
4310 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4311
4312 Basic functions to set Lisp_Object and pointer slots of intervals.
4313 * intervals.h (interval_set_parent, interval_set_object):
4314 (interval_set_left, interval_set_right, interval_set_plist):
4315 (interval_copy_parent): New function.
4316 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4317 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4318 Adjust indentation.
4319 (INTERVAL_SIZE): Remove. Adjust users.
4320 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4321
4322 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4323
4324 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4325 * process.h (PGET): Remove.
4326 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4327 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4328
4329 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4330
4331 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4332 * window.h (WGET): Remove.
4333 (struct window): Do not use INTERNAL_FIELD.
4334 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4335 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4336 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4337 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4338 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4339 Adjust users.
4340
4341 2012-08-07 Chong Yidong <cyd@gnu.org>
4342
4343 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4344 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4345 (Fdelete_window_internal): Signal an error if the window is not on
4346 a live frame (Bug#12025).
4347
4348 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4349
4350 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4351 * frame.h (FGET): Remove.
4352 (struct frame): Do not use INTERNAL_FIELD.
4353 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4354 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4355 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4356 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4357
4358 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4359
4360 * w32.c: Silence compiler warnings.
4361 (map_w32_filename): Remove unused variable `is_fat'.
4362 (chase_symlinks): Add parentheses around expression.
4363
4364 2012-08-06 Glenn Morris <rgm@gnu.org>
4365
4366 * sysdep.c: Respect BROKEN_GETWD.
4367
4368 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4369 Let configure handle it.
4370 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4371
4372 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4373
4374 Use GCALIGNMENT where appropriate.
4375 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4376 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4377 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4378
4379 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4380
4381 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4382 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4383
4384 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4385
4386 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4387 that should be sufficient for everyone.
4388
4389 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4390
4391 * keyboard.c (timer_check_2): Add break so timer_check returns next
4392 timeout.
4393
4394 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4395
4396 Fix Windows build errors introduced after converting to WGET and WSET.
4397 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4398 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4399
4400 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4401
4402 * nsterm.m (ns_frame_rehighlight): Use FSET.
4403
4404 * nsmenu.m (ns_update_menubar): Use FSET.
4405
4406 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4407
4408 Separate read and write access to Lisp_Object slots of Lisp_Process.
4409 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4410 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4411
4412 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4413
4414 Separate read and write access to Lisp_Object slots of struct window.
4415 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4416 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4417 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4418 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4419 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4420 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4421 Adjust users.
4422
4423 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4424
4425 Fix Windows build errors introduced after converting to FGET and FSET.
4426 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4427 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4428 (w32_judge_scroll_bars): Change to use FSET.
4429 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4430
4431 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4432
4433 Fix replacement typo.
4434 * window.c (replace_window): Set root_window instead of
4435 selected_window. This fixes a total window subsystem
4436 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4437
4438 2012-08-06 Glenn Morris <rgm@gnu.org>
4439
4440 * lisp.mk (lisp): Add language/persian.elc.
4441
4442 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4443
4444 Separate read and write access to Lisp_Object slots of struct frame.
4445 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4446 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4447 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4448 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4449 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4450
4451 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4452
4453 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4454
4455 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4456
4457 Generalize common compile-time constants.
4458 * lisp.h (header_size, bool_header_size, word_size): Now here.
4459 (struct Lisp_Vector): Add comment.
4460 (struct Lisp_Bool_Vector): Move up to define handy constants.
4461 (VECSIZE, PSEUDOVECSIZE): Simplify.
4462 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4463 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4464 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4465 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4466 * xfont.c, xmenu.c: Use word_size where appropriate.
4467
4468 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4469
4470 * search.c (Freplace_match): Treat \? in the replacement text
4471 literally (Bug#8161).
4472
4473 2012-08-05 Chong Yidong <cyd@gnu.org>
4474
4475 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4476 * frame.c (Vdelete_frame_functions):
4477 * emacs.c (Vkill_emacs_hook): Doc fix.
4478
4479 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4480
4481 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4482 --with-x-toolkit=no builds.
4483 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4484
4485 2012-08-04 Chong Yidong <cyd@gnu.org>
4486
4487 * syntax.c (Fmodify_syntax_entry): Doc fix.
4488
4489 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4490
4491 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4492 * w32.c (init_environment): Change the default values of many
4493 environment variables in dflt_envvars[] to NULL, to avoid pushing
4494 them into environment when they were not already defined.
4495 Remove the code that deletes site-lisp subdirectories from the default
4496 value of EMACSLOADPATH, as it is no longer needed.
4497 (check_windows_init_file): Now external, not static.
4498 Use Vload_path as is, without adding anything, as this function is now
4499 called when Vload_path is already set up.
4500
4501 * w32.h (check_windows_init_file): Add prototype.
4502
4503 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4504 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4505 compatibility with Posix platforms.
4506 (main): Move the call to check_windows_init_file to here from
4507 w32.c.
4508 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4509 any, in the DEFALT argument into the root of the Emacs build or
4510 installation tree, as appropriate.
4511
4512 * callproc.c (init_callproc_1): Call decode_env_path instead of
4513 doing its equivalent by hand.
4514 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4515 the code that sets Vexec_path run on MS-Windows.
4516
4517 * lread.c (init_lread): Add comments to #ifdef's.
4518
4519 * msdos.c (dos_set_window_size, IT_update_begin)
4520 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4521 instead of direct references.
4522
4523 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4524
4525 Export DEFAULT_REHASH_* to GDB.
4526 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4527 Now constants, not macros.
4528
4529 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4530
4531 Remove unnecessary casts involving pointers.
4532 These casts are no longer needed now that we assume C89 or later,
4533 since they involve casting to or from void *.
4534 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4535 (make_pure_float, make_pure_vector):
4536 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4537 * macros.c (Fstart_kbd_macro):
4538 * menu.c (find_and_return_menu_selection):
4539 * minibuf.c (read_minibuf_noninteractive):
4540 * sysdep.c (closedir):
4541 * xdisp.c (x_produce_glyphs):
4542 * xfaces.c (compare_fonts_by_sort_order):
4543 * xfns.c (x_real_positions, select_visual):
4544 * xselect.c (x_stop_queuing_selection_requests)
4545 (x_get_window_property, x_get_window_property_as_lisp_data):
4546 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4547 Remove unnecessary pointer casts.
4548 * alloc.c (record_xmalloc): New function.
4549 * lisp.h (record_xmalloc): New decl.
4550 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4551 more like a function. This is because the pointer cast is not
4552 needed. All uses changed.
4553 * print.c (print_string, print_error_message): Avoid length recalc.
4554
4555 Improve fix for macroexp crash with debugging (Bug#12118).
4556 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4557 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4558 not supposed to be invoked from the garbage collector.
4559 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4560 (gc_aset): New function, which is like ASET but can be
4561 used in the garbage collector.
4562 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4563 (set_hash_index): Use it instead of ASET.
4564
4565 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4566
4567 Support symlinks on latest versions of MS-Windows.
4568 * w32.c: Include winioctl.h and aclapi.h.
4569 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4570 (revert_to_self): Forward declarations of static functions.
4571 <static BOOL g_b_init_get_security_info>:
4572 <g_b_init_create_symbolic_link>: New static flags.
4573 (globals_of_w32): Initialize them to zero.
4574 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4575 (map_w32_filename): Improve commentary. Simplify switch.
4576 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4577 headers (most versions of MinGW w32api don't).
4578 (get_security_info, create_symbolic_link)
4579 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4580 New functions.
4581 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4582 in the argument file name.
4583 (sys_access): Call unc_volume_file_attributes only if
4584 GetFileAttributes fails with network-related error codes.
4585 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4586 have the required privileges.
4587 (get_file_security_desc_by_name): Rename from
4588 get_file_security_desc.
4589 (stat_worker): New function, with most of the guts of 'stat', and
4590 with addition of handling of symlinks and support for 'lstat'.
4591 If possible, get file's attributes and security information by
4592 handle, not by name. Produce S_IFLNK bit for symlinks, when
4593 called from 'lstat'.
4594 (stat, lstat): New functions, call 'stat_worker'.
4595 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4596 symlinks when the underlying filesystem supports them.
4597
4598 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4599
4600 Fix macroexp crash on Windows with debugging (Bug#12118).
4601 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4602 checking subscripts; problem introduced with the recent
4603 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4604 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4605 since it's used in non-static inline functions now.
4606
4607 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4608 Don't assume buffer size fits in 'int'. Remove unused local.
4609
4610 Use C99-style 'extern inline' if available.
4611 * buffer.h (BUFFER_INLINE):
4612 * category.h (CATEGORY_INLINE):
4613 * character.h (CHARACTER_INLINE):
4614 * charset.h (CHARSET_INLINE):
4615 * composite.h (COMPOSITE_INLINE):
4616 * dispextern.h (DISPEXTERN_INLINE):
4617 * lisp.h (LISP_INLINE):
4618 * systime.h (SYSTIME_INLINE):
4619 New macro, replacing 'static inline' in this header.
4620 * buffer.h, category.h, character.h, charset.h, composite.h:
4621 * dispextern.h, lisp.h, systime.h:
4622 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4623 * alloc.c (LISP_INLINE):
4624 * buffer.c (BUFFER_INLINE):
4625 * category.c (CATEGORY_INLINE):
4626 * character.c (CHARACTER_INLINE):
4627 * charset.c (CHARSET_INLINE):
4628 * composite.c (COMPOSITE_INLINE):
4629 * dispnew.c (DISPEXTERN_INLINE):
4630 * sysdep.c (SYSTIME_INLINE):
4631 Define to EXTERN_INLINE, so that the corresponding functions
4632 are compiled into code.
4633 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4634 (INLINE_HEADER_END): New macros.
4635 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4636 since it's used in non-static inline functions now.
4637 (VALMASK) [!USE_LSB_TAG]: Likewise.
4638
4639 2012-08-02 Glenn Morris <rgm@gnu.org>
4640
4641 * s/: Remove empty directory.
4642
4643 * s/ms-w32.h: Move to ../nt/inc.
4644 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4645 Update for new ms-w32.h location.
4646
4647 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4648
4649 Port to Solaris 8.
4650 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4651
4652 2012-08-02 Glenn Morris <rgm@gnu.org>
4653
4654 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4655 hard-coding the path separator.
4656
4657 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4658
4659 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4660 This how ASET and AREF are supposed to work, and makes
4661 it easier to think about future improvements. See
4662 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4663 * charset.h (set_charset_attr): New function.
4664 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4665 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4666 (aref_addr): New function. All uses of &AREF(...) changed.
4667 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4668 (set_hash_index): New functions. All lvalue-style uses of
4669 HASH_KEY etc. changed.
4670 * keyboard.c (set_prop): New function. All lvalue-style uses
4671 of PROP changed.
4672
4673 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4674
4675 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4676 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4677 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4678 * nsfns.m (ns_set_name_as_filename): Likewise.
4679 * nsmenu.m (ns_update_menubar): Likewise.
4680 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4681
4682 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4683
4684 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4685 Adapt to latest changes in field names of the corresponding Lisp
4686 objects.
4687
4688 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4689
4690 2012-08-01 Glenn Morris <rgm@gnu.org>
4691
4692 * s/msdos.h: Remove file.
4693 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4694 * Makefile.in (S_FILE): Remove.
4695 (config_h): Remove S_FILE.
4696
4697 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4698
4699 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4700 Remove; moved to nt/config.nt.
4701
4702 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4703
4704 Use INTERNAL_FIELD for conses and overlays.
4705 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4706 Remove obsolete comment.
4707 (MVAR): New macro.
4708 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4709 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4710
4711 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4712
4713 Use INTERNAL_FIELD for symbols.
4714 * lisp.h (SVAR): New macro. Adjust users.
4715 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4716 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4717
4718 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4719
4720 Use INTERNAL_FIELD for processes.
4721 * process.h (PVAR): New macro. Adjust style.
4722 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4723 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4724
4725 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4726
4727 Use INTERNAL_FIELD for windows.
4728 * window.h (WVAR): New macro.
4729 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4730 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4731 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4732 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4733 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4734 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4735
4736 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4737
4738 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4739
4740 2012-08-01 Glenn Morris <rgm@gnu.org>
4741
4742 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4743 Move to configure.ac.
4744
4745 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4746
4747 * makefile.w32-in (CONFIG_H): Update dependencies.
4748 (CONF_POST_H): New macro.
4749
4750 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4751
4752 2012-07-31 Glenn Morris <rgm@gnu.org>
4753
4754 * Makefile.in (S_FILE): No longer set by configure.
4755
4756 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4757 is available.
4758 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4759
4760 * process.h (NULL_DEVICE):
4761 * emacs.c (SEPCHAR):
4762 * editfns.c (USER_FULL_NAME): Let configure set them.
4763
4764 * s/README, s/template.h: Remove files.
4765
4766 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4767
4768 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4769 Move to configure.ac.
4770
4771 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4772
4773 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4774 resulting renaming of 'struct frame' members.
4775
4776 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4777
4778 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4779 after introduction of FVAR.
4780
4781 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4782
4783 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4784
4785 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4786 instead of compositeToPoint.
4787 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4788
4789 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4790
4791 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4792
4793 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4794 * lisp.h (INTERNAL_FIELD): New macro.
4795 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4796 (BVAR): Change to use INTERNAL_FIELD.
4797 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4798 (KVAR): Change to use INTERNAL_FIELD.
4799 * frame.h (FVAR): New macro.
4800 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4801 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4802 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4803 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4804 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4805
4806 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4807
4808 Miscellaneous fixes for non-default X toolkits.
4809 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4810 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4811 Move under #ifdef USE_LUCID.
4812 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4813 definition and usage to avoid warnings.
4814
4815 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4816
4817 * nsterm.m (openFiles): Fix previous checkin.
4818
4819 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4820
4821 * indent.c (compute_motion): Remove unused local.
4822
4823 2012-07-31 Glenn Morris <rgm@gnu.org>
4824
4825 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4826
4827 * conf_post.h [USG5_4]:
4828 Move remaining contents of s/usg5-4-common.h here.
4829 * s/usg5-4-common.h: Remove file.
4830
4831 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4832 * s/irix6-5.h: Remove file.
4833
4834 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4835 * s/darwin.h: Remove file.
4836
4837 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4838 * s/hpux10-20.h: Remove file, which is now empty.
4839
4840 2012-07-30 Glenn Morris <rgm@gnu.org>
4841
4842 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4843 * Makefile.in (config_h): Add conf_post.h.
4844 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4845
4846 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4847
4848 * nsterm.m (ns_do_open_file): New variable.
4849 (ns_term_init): Set ns_do_open_file to YES after run returns.
4850 (openFile, openTempFile, openFileWithoutUI, openFiles):
4851 Open files only if ns_do_open_file.
4852
4853 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4854
4855 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4856 This no-op macro hasn't been needed for many years.
4857 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4858
4859 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4860 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4861 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4862 gdb_make_enums_visible.
4863 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4864 (DIRECTORY_SEP): Now a constant, not a macro.
4865
4866 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4867
4868 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4869 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4870
4871 * w32term.c <w32_keyboard_codepage>: Renamed from
4872 keyboard_codepage and now external. All users changed.
4873
4874 * w32term.h: Add declaration of w32_keyboard_codepage.
4875
4876 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4877 the codepage to translate keys to Unicode. If this argument is
4878 -1, use the value returned by GetConsoleCP. All callers changed.
4879
4880 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 Update .PHONY listings in makefiles.
4883 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4884 bootstrap-clean, distclean, maintainer-clean, versioclean,
4885 extraclean, frc.
4886
4887 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4888 This is a bit clearer. Fix some commentary typos.
4889
4890 2012-07-30 Glenn Morris <rgm@gnu.org>
4891
4892 * s/netbsd.h: Let configure include signal.h if needed.
4893 Remove file, which is now empty.
4894
4895 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4896 Let configure set them.
4897 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4898 No more need to undefine.
4899
4900 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4901
4902 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4903 non-single-byte char when adding meta modifier. (Bug#12090)
4904
4905 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4906
4907 Convert safe_call to use variable number of arguments.
4908 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4909 (safe_call2): Fix comment.
4910 * lisp.h (safe_call): Adjust prototype.
4911 * coding.c (encode_coding_object): Change to use safe_call2.
4912 * xfaces.c (merge_face_heights): Change to use safe_call1.
4913
4914 2012-07-30 Glenn Morris <rgm@gnu.org>
4915
4916 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4917 does that unconditionally. Remove file, which is now empty.
4918
4919 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4920 Remove empty files.
4921
4922 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4923
4924 Export to GDB most of lisp.h's remaining object-like macros.
4925 * lisp.h (min, max): Move earlier, because they're used earlier now.
4926 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4927 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4928 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4929 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4930 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4931 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4932 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4933 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4934 Now constants, for GDB. They need not be macros.
4935 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4936 Now constants, for GDB, as well as macros, for static initializers.
4937 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4938 Move to after the definition of struct Lisp_Char_Table,
4939 since the former now needs that type defined.
4940 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4941 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4942 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4943 New enums, for gdb_make_enums_visible.
4944 (GLYPH_MODE_LINE_FACE): Remove; unused.
4945 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4946 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4947 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4948 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4949 enum maxargs, enum MAX_ALLOCA.
4950 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4951 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4952 no longer needed, now that they are done in lisp.h.
4953
4954 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4955
4956 Cleanup string bytes checking.
4957 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4958 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4959 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4960 (check_sblock, compact_small_strings): Simplify.
4961
4962 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4963
4964 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4965 These macros are confusing and no longer need to be defined, as
4966 the enum values now suffice. All uses replaced with definiens.
4967 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4968
4969 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4970
4971 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4972 ($(BLD)/w32console.$(O)): Update dependencies.
4973
4974 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4975
4976 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4977 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4978 time. Adjust users.
4979 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4980
4981 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4982
4983 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4984 setting sitelisp (Bug#12010).
4985
4986 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4987
4988 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4989
4990 * w32heap.c (cache_system_info):
4991 * w32.c (sys_rename):
4992 * w32proc.c (find_child_console, sys_kill): All users changed.
4993
4994 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4995
4996 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4997
4998 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4999
5000 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5001
5002 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5003
5004 Cleanup statistics calculation in Fgarbage_collect.
5005 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5006 Fix zombies percentage calculation. Simplify elapsed time calculation.
5007
5008 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5009
5010 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5011 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5012 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5013 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5014 (replace_range, replace_range_2, del_range_2): Change to eassert.
5015 * marker.c (byte_char_debug_check): Adjust style.
5016
5017 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5018
5019 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5020 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5021 long-ago-commented-out code that talks about "WIN32".
5022 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5023 All uses changed.
5024
5025 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5026
5027 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5028 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5029 Simplify by using alignof.
5030 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5031 * lisp.h: Include <stdalign.h>.
5032 (GCALIGNMENT): New macro and constant.
5033 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5034 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5035 (stdalign): New macro, if not already defined.
5036
5037 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5038
5039 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5040 * w32inevt.c: Include w32inevt.h.
5041 (w32_read_console_input): New inline function, calls either
5042 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5043 w32_console_unicode_input.
5044 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5045 (w32_kbd_patch_key, key_event): Use the codepage returned by
5046 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5047 (key_event): use uChar.UnicodeChar only if
5048 w32_console_unicode_input is non-zero.
5049
5050 * w32console.c: Include w32heap.h.
5051 <w32_console_unicode_input>: New global variable.
5052 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5053 family of Windows, zero otherwise.
5054
5055 * w32inevt.h: Declare w32_console_unicode_input.
5056
5057 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5058 --without-x. (Bug#11742)
5059
5060 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5061
5062 Adjust GDB to reflect pvec_type changes (Bug#12036).
5063 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5064 2012-07-04 changes to pseudovector representation.
5065 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5066
5067 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5068
5069 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5070 bus address.
5071 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5072
5073 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5074
5075 * alloc.c (listn): Fix the order the arguments are consed onto the
5076 list.
5077
5078 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5079 enumeration constants, as PURE and HEAP are too general, and clash
5080 with other headers and sources, such as gmalloc.c and the
5081 MS-Windows system headers. All users changed.
5082
5083 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5084
5085 Revert last save_excursion_save and save_excursion_restore changes.
5086 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5087 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5088
5089 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5090
5091 Fix recently-introduced typos in Windows port.
5092 Reported by Martin Rudalics <rudalics@gmx.at>.
5093 * w32.c (init_environment): Replace comma with semicolon.
5094 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5095
5096 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5097
5098 Improve GDB symbol export (Bug#12036).
5099 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5100 arms of an 'if', not using conditional expressions; otherwise GDB
5101 complains about the types in the unevaluated arm when the argument
5102 is an integer literal.
5103 (xgetint): Simplify expression.
5104 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5105 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5106 Zaretskii in <http://bugs.gnu.org/12036#13>.
5107 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5108 needed now that we have gdb_make_enums_visible.
5109 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5110 (enum enum_USE_LSB_TAG):
5111 New enum types, packaging up enums that need to be exported to GDB.
5112
5113 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5114
5115 Utility function to make a list from specified amount of objects.
5116 * lisp.h (enum constype): New datatype.
5117 (listn): New prototype.
5118 * alloc.c (listn): New function.
5119 (Fmemory_use_count, syms_of_alloc): Use it.
5120 * buffer.c (syms_of_buffer): Likewise.
5121 * callint.c (syms_of_callint): Likewise.
5122 * charset.c (define_charset_internal): Likewise.
5123 * coding.c (syms_of_coding): Likewise.
5124 * keymap.c (syms_of_keymap): Likewise.
5125 * search.c (syms_of_search): Likewise.
5126 * syntax.c (syms_of_syntax): Likewise.
5127 * w32.c (init_environment): Likewise.
5128 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5129 * xdisp.c (syms_of_xdisp): Likewise.
5130 * xfns.c (syms_of_xfns): Likewise.
5131
5132 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5133
5134 Fast save_excursion_save and save_excursion_restore.
5135 * lisp.h (struct Lisp_Excursion): New data type.
5136 (PVEC_EXCURSION): New pseudovector type.
5137 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5138 to deal with it. Adjust comments.
5139 (init_marker, attach_marker): New prototype.
5140 (unchain_marker): Adjust prototype.
5141 * marker.c (attach_marker): Change to global.
5142 (init_marker): New function.
5143 * alloc.c (Fmake_marker, build_marker): Use it.
5144 (build_marker): More easserts.
5145 (mark_object): Handle struct Lisp_Excursion.
5146 * editfns.c (save_excursion_save, save_excursion_restore):
5147 Reimplement to use struct Lisp_Excursion. Add comments.
5148
5149 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5150
5151 Fix export of symbols to GDB (Bug#12036).
5152 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5153 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5154 emacs.c, as this is a more-suitable home. Had this been done earlier
5155 the fix for 12036 would have avoided some of the problems noted in
5156 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5157 would have been more obvious.
5158 * emacs.c: Do not include <verify.h>; no longer needed.
5159 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5160 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5161 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5162 Remove; now done in lisp.h.
5163 * lisp.h (PUBLISH_TO_GDB): New macro.
5164 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5165 (DATA_SEG_BITS): Use it.
5166 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5167 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5168 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5169 not be usable in #if. This simplifies things.
5170
5171 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5172
5173 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5174
5175 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5176
5177 Simplify export of symbols to GDB (Bug#12036).
5178 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5179 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5180 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5181 Adjust to changes in lisp.h and emacs.c, by using
5182 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5183 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5184 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5185 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5186 instead of gdb_valbits.
5187 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5188 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5189 instead of gdb_array_mark_flag.
5190 (xboolvector): Get size from $->size, not $->header.size.
5191 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5192 (xreload, hook-run, hookpost-run): Remove.
5193 * emacs.c: Include <verify.h>.
5194 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5195 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5196 Remove.
5197 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5198 (gdb_USE_LSB_TAG): New enum constants.
5199 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5200 Also define these as enum constants, so they're visible to GDB.
5201 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5202 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5203 as constants, so they're visible to GDB.
5204 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5205 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5206 Now enum constants, not macros, so they're visible to GDB.
5207 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5208 more convenient now. All uses changed.
5209 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5210 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5211
5212 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5213
5214 Explicitly free restriction data that are not needed anymore.
5215 * editfns.c (save_restriction_restore): Free restriction data.
5216
5217 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5218
5219 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5220 add argument, tune behavior, and adjust all callers.
5221
5222 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5223
5224 Use typedef for EMACS_INT, EMACS_UINT.
5225 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5226 than macros. This simplifies debugging in the usual case, since
5227 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5228 and it allows expressions involving EMACS_INT casts.
5229 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5230
5231 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5232
5233 * nsterm.m (ns_read_socket): Return early if there is a modal
5234 window (Bug#12043).
5235
5236 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5237
5238 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5239 that FOCUS-FRAME can be omitted.
5240
5241 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5242
5243 Adjust buffer text indirection counters at the end of Fkill_buffer.
5244 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5245 buffer is definitely dead. This should really fix an issue reported
5246 by Christoph Scholtes again. (Bug#12007).
5247 (init_buffer_once): Initialize indirection counters of
5248 buffer_defaults and buffer_local_symbols (for sanity and safety).
5249
5250 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5251
5252 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5253 and continuation glyphs on tooltip frames, leave them at zero.
5254 Avoids continued lines in tooltips. (Bug#11832)
5255
5256 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5257
5258 Simplify copy_overlay.
5259 * buffer.c (copy_overlay): Simplify. Use build_marker.
5260 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5261
5262 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5263
5264 * print.c (print_object): Don't crash when a frame's name is nil
5265 or invalid. (Bug#12025)
5266
5267 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5268 it signals an error when a tooltip frame is being created.
5269
5270 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5271
5272 Cleanup miscellaneous objects allocation and initialization.
5273 * alloc.c (allocate_misc): Change to static. Add argument to
5274 specify the subtype. Adjust comment and users.
5275 (build_overlay): New function.
5276 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5277 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5278 (allocate_misc): Remove prototype.
5279 (build_overlay): Add prototype.
5280
5281 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5282
5283 Swap buffer text indirection counters in Fbuffer_swap_text.
5284 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5285 This avoids crash reported by Christoph Scholtes at
5286 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5287
5288 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5289
5290 * nsmenu.m (Popdown_data): New struct.
5291 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5292 free Popdown_data.
5293 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5294 (initWithContentRect): Make imgView and contentView non-static
5295 and autorelease them. Also autorelease img and matrix (Bug#12005).
5296 (dealloc): Remove (Bug#12005).
5297
5298 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5299
5300 Adjust consing_since_gc when objects are explicitly freed.
5301 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5302 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5303 (free_cons, free_misc): Subtract object size from consing_since_gc.
5304
5305 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5306
5307 Simplify and cleanup markers positioning code.
5308 * marker.c (attach_marker): More useful eassert.
5309 (live_buffer, set_marker_internal): New function.
5310 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5311 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5312
5313 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5314
5315 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5316 as it's limited by the amount of memory, not by INT_MAX.
5317
5318 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5319
5320 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5321 in special-event-map. See the discussion at
5322 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5323 for the reasons.
5324
5325 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5326 info.dwItemData. Fixes crashes on 64-bit Windows.
5327 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5328
5329 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5330
5331 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5332 (conversationIdentifier): Return value is NSInteger.
5333 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5334
5335 2012-07-21 Chong Yidong <cyd@gnu.org>
5336
5337 * window.c (decode_any_window): Signal an error if the window is
5338 on a dead frame (Bug#11984).
5339
5340 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5341
5342 Add indirection counting to speed up Fkill_buffer.
5343 * buffer.h (struct buffer): New member.
5344 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5345 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5346 base buffer indirection counter.
5347 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5348 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5349 through buffer list if indirection counter is 0.
5350
5351 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5352
5353 Extend the value returned by Fgarbage_collect with heap statistics.
5354 * alloc.c (Qheap): New symbol.
5355 (syms_of_alloc): DEFSYM it.
5356 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5357 (Fmemory_free): Remove.
5358 (syms_of_alloc): Don't defsubr it.
5359 * buffer.c (Fcompact_buffer): Remove.
5360 (syms_of_buffer): Don't defsubr it.
5361
5362 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5363
5364 Make maybe_gc inline.
5365 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5366 * lisp.h (consing_since_gc, gc_relative_threshold)
5367 (memory_full_cons_threshold): Revert declaration.
5368 (maybe_gc): Remove prototype, define as inline.
5369 * alloc.c: Remove old commented-out code.
5370 (consing_since_gc, gc_relative_threshold)
5371 (memory_full_cons_threshold): Revert to global.
5372 (maybe_gc): Remove.
5373
5374 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5375
5376 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5377 * lisp.h (build_unibyte_string): New function.
5378 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5379 * sysdep.c, w32fns.c, xfns.c: Use it.
5380 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5381 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5382 Adjust users accordingly.
5383 * font.h (font_open_by_name): Adjust prototype.
5384
5385 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5386
5387 Cleanup calls to Fgarbage_collect.
5388 * lisp.h (maybe_gc): New prototype.
5389 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5390 Remove declarations.
5391 * alloc.c (maybe_gc): New function.
5392 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5393 Make them static.
5394 * bytecode.c (MAYBE_GC): Use maybe_gc.
5395 * eval.c (eval_sub, Ffuncall): Likewise.
5396 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5397 to avoid dependency from auto-save feature.
5398
5399 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5400
5401 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5402 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5403 'for_each_per_buffer_object_at'.
5404 All uses changed. It's better to use upper-case for macros that
5405 cannot be implemented as functions, to give the reader a clue
5406 that they're special.
5407
5408 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5409
5410 * alloc.c (Fgarbage_collect): Tweak docstring.
5411
5412 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5413
5414 Tweak the value returned from Fgarbage_collect again.
5415 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5416 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5417 Adjust documentation.
5418 (total_vector_bytes): Rename to total_vector_slots, adjust
5419 accounting.
5420 (total_free_vector_bytes): Rename to total_free_vector_slots,
5421 adjust accounting.
5422 (Qstring_bytes, Qvector_slots): New symbols.
5423 (syms_of_alloc): DEFSYM them.
5424
5425 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5426
5427 Buffer compaction primitive which may be used from Lisp.
5428 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5429 (syms_of_buffer): Register Fcompact_buffer.
5430 * alloc.c (Fgarbage_collect): Use compact_buffer.
5431 * buffer.h (compact_buffer): New prototype.
5432 (struct buffer_text): New member.
5433
5434 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5435
5436 New macro to iterate over all buffers, miscellaneous cleanups.
5437 * lisp.h (all_buffers): Remove declaration.
5438 * buffer.h (all_buffers): Add declaration, with comment.
5439 (for_each_buffer): New macro.
5440 * alloc.c (Fgarbage_collect, mark_object): Use it.
5441 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5442 (init_buffer): Likewise.
5443 * data.c (Fset_default): Likewise.
5444 * coding.c (code_conversion_restore): Remove redundant check
5445 for dead buffer.
5446 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5447
5448 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5449
5450 Fix bug that created negative-length intervals.
5451 * intervals.c (merge_interval_right, merge_interval_left):
5452 Do not zero out this interval if it is absorbed by its children,
5453 as this interval's total length doesn't change in that case. See
5454 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5455
5456 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5457
5458 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5459 when invoking (make-bool-vector N t) and N is a positive
5460 multiple of 8 -- the last 8 bits were mistakenly cleared.
5461
5462 Remove some struct layout assumptions in bool vectors.
5463 * alloc.c (bool_header_size): New constant.
5464 (header_size, word_size): Move earlier, as they're now used earlier.
5465 Use 'word_size' in a few more places, where it's appropriate.
5466 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5467 padding before the data member of a bool vector.
5468 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5469 than doing the check by hand with an abort ().
5470
5471 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5472
5473 * eval.c (Fdefvar): Don't check constants since we only set the var if
5474 it's not yet defined anyway (bug#11904).
5475
5476 * lisp.h (last_undo_boundary): Declare new var.
5477 * keyboard.c (command_loop_1): Set it.
5478 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5479 were auto-added by the command loop (bug#11774).
5480
5481 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5482
5483 * w32font.c (Qsymbol): Remove local definition.
5484 (syms_of_w32font): Don't DEFSYM it.
5485
5486 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5487
5488 Fix sweep_vectors to handle large bool vectors correctly.
5489 * alloc.c (sweep_vectors): Account total_vector_bytes for
5490 bool vectors larger than VBLOCK_BYTES_MAX.
5491
5492 2012-07-18 Chong Yidong <cyd@gnu.org>
5493
5494 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5495 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5496
5497 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5498
5499 Return more descriptive data from Fgarbage_collect.
5500 Suggested by Stefan Monnier in
5501 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5502 * alloc.c (bounded_number): New function.
5503 (total_buffers, total_vectors): New variable.
5504 (total_string_size): Rename to total_string_bytes, adjust users.
5505 (total_vector_size): Rename to total_vector_bytes, adjust users.
5506 (sweep_vectors): Account total_vectors and total_vector_bytes.
5507 (Fgarbage_collect): New return value. Adjust documentation.
5508 (gc_sweep): Account total_buffers.
5509 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5510 (VECTOR_SIZE): Remove.
5511 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5512 (Qinterval, Qmisc): New symbols.
5513 (syms_of_data): Initialize them.
5514 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5515 (Qcons, Qbuffer): New declarations.
5516
5517 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5518
5519 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5520 Round up, not down. Improve doc.
5521
5522 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5523
5524 Restore old code in allocate_string_data to avoid Faset breakage.
5525 Reported by Julien Danjou <julien@danjou.info> in
5526 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5527 * alloc.c (allocate_string_data): Restore old code with minor
5528 adjustments, fix comment to explain this subtle issue.
5529
5530 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5531
5532 Remove FILE_SYSTEM_CASE.
5533 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5534
5535 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5536 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5537 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5538 call-process-region passes it through expand-file-name.
5539
5540 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5541
5542 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5543
5544 Fix crash when creating indirect buffer (Bug#11917)
5545 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5546 Don't handle unbound variables specially if non-zero.
5547 (Fbuffer_local_variables): Pass zero.
5548 (clone_per_buffer_values): Pass non-zero.
5549
5550 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5551
5552 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5553 to make the loop interruptible.
5554
5555 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5556
5557 * gnutls.c (emacs_gnutls_handshake): Only retry if
5558 GNUTLS_E_INTERRUPTED.
5559
5560 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5561
5562 Cleanup and convert miscellaneous checks to eassert.
5563 * alloc.c (mark_interval): Fix comment, partially rephrase
5564 old comment from intervals.h (see below).
5565 * intervals.c (find_interval, adjust_intervals_for_insertion)
5566 (delete_interval, adjust_intervals_for_deletion)
5567 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5568 Convert to eassert.
5569 (adjust_intervals_for_insertion, make_new_interval):
5570 Remove obsolete and unused code.
5571 * intervals.h (struct interval): Remove obsolete comment.
5572 * textprotp.c (erase_properties): Remove unused code.
5573 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5574 (Fremove_list_of_text_properties): Convert to eassert.
5575
5576 2012-07-17 Chong Yidong <cyd@gnu.org>
5577
5578 * editfns.c (Finsert_char): Doc fix.
5579
5580 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5581
5582 Fix previous change to make Fmemory_free always accurate.
5583 * alloc.c (make_interval): Update total_free_intervals.
5584 (make_float): Likewise for total_free_floats.
5585 (free_cons, Fcons): Likewise for total_free_conses.
5586 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5587 Likewise for total_free_vector_bytes.
5588 (Fmake_symbol): Likewise for total_free_symbols.
5589 (bytes_free): Remove.
5590
5591 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5592
5593 Simple free memory accounting feature.
5594 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5595 (sweep_vectors): Accumulate size of free vectors.
5596 (Fgarbage_collect): Setup bytes_free.
5597 (Fmemory_free): New function.
5598 (syms_of_alloc): Register it.
5599
5600 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5601
5602 Cleanup overlays checking.
5603 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5604 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5605 eassert and OVERLAYP.
5606 (sort_overlays): Change to use OVERLAYP.
5607
5608 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5609
5610 * editfns.c (Finsert_char): Make it interactive, and make the
5611 second arg optional. Copy interactive spec and docstring from
5612 ucs-insert.
5613
5614 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5615
5616 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5617 Unlike the other wrapped functions, fabs has an unspecified
5618 effect on errno.
5619
5620 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5621
5622 * nsterm.m (keyDown): Interpret flags without left/right bits
5623 as the left key (Bug#11670).
5624
5625 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5626
5627 Remove empty and useless init functions.
5628 * lisp.h (init_character_once, init_fns, init_image)
5629 (init_filelock, init_sound): Remove prototype.
5630 * character.c (init_character_once): Remove.
5631 * filelock.c (init_filelock): Likewise.
5632 * fns.c (init_fns): Likewise.
5633 * image.c (init_image): Likewise.
5634 * sound.c (init_sound): Likewise.
5635 * emacs.c (main): Adjust accordingly.
5636
5637 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5638
5639 * gtkutil.h: Tiny cleanups.
5640 (use_old_gtk_file_dialog): Remove useless declaration.
5641 (xg_uses_old_file_dialog): Add suggested const attribute.
5642
5643 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5644
5645 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5646 (bidi_paragraph_init): Use it to limit search forward for a strong
5647 directional character in abnormally large paragraphs full of
5648 neutral or weak characters. (Bug#11943)
5649
5650 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5651
5652 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5653 the toolbar (Bug#9451).
5654 (xg_make_tool_item): Give the widget event box a transparent
5655 background.
5656
5657 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5658
5659 Cleanup basic allocation variables and functions.
5660 * alloc.c (ignore_warnings, init_intervals, init_float)
5661 (init_cons, init_symbol, init_marker): Remove.
5662 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5663 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5664 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5665 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5666 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5667 (staticidx, init_alloc_once, init_strings, free_ablock):
5668 Remove redundant initialization.
5669 * fns.c (init_weak_hash_tables): Remove.
5670 * lisp.h (init_weak_hash_tables): Remove prototype.
5671
5672 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5673
5674 Use zero_vector where appropriate.
5675 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5676 accordingly.
5677 * lisp.h (zero_vector): New declaration.
5678 * font.c (null_vector): Remove.
5679 (syms_of_font): Remove initialization and staticpro.
5680 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5681 * keymap.c (Faccessible_keymaps): Likewise.
5682
5683 2012-07-15 Leo Liu <sdl.web@gmail.com>
5684
5685 * fringe.c: Fix typo in comments.
5686
5687 2012-07-14 Leo Liu <sdl.web@gmail.com>
5688
5689 * fringe.c: Add a new bitmap exclamation-mark.
5690
5691 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5692
5693 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5694
5695 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5696 (HAVE_MENUS): Don't define, defined by editing config.in with
5697 msdos/sed2v2.inp.
5698 (GMALLOC_INHIBIT_VALLOC): Don't define.
5699 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5700
5701 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5702
5703 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5704
5705 2012-07-14 Glenn Morris <rgm@gnu.org>
5706
5707 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5708 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5709 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5710
5711 2012-07-13 Glenn Morris <rgm@gnu.org>
5712
5713 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5714
5715 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5716 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5717
5718 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5719
5720 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5721 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5722 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5723 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5724 where appropriate.
5725 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5726 as boolean expression.
5727 (x_set_window_size): Remove unused variable toolbar.
5728 (ns_get_color_default, ns_mod_to_lisp): Remove.
5729 (ns_mouse_position): Remove unused variables xchar and ychar.
5730 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5731 (ns_set_vertical_scroll_bar): Remove unused variable count.
5732 (ns_delete_terminal): Remove unused variable i.
5733 (ns_term_init): Remove unused variables r, g and b.
5734 (mouseDown): Remove unused variable window.
5735 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5736 (initFrameFromEmacs): Remove unused variable vbextra.
5737 (mouseEntered): Remove unused variables p and dpyinfo.
5738 (mouseExited): Remove unused variables p and r.
5739 (ns_define_frame_cursor, ns_clear_frame_area)
5740 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5741 (menuDown): Assign [sender tag] to variable and cast the variable.
5742
5743 * nsterm.h (menuDown): Add id as type to argument sender.
5744 (ns_display_info_for_name): Add Lisp_Object argument.
5745 (ns_term_init): Add Lisp_Object argument.
5746 (ns_map_event_to_object): Add void argument.
5747 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5748 prototype with arguments and only declare if __OBJC__.
5749 (nxatoms_of_nsselect): Add void argument.
5750 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5751 (ns_alloc_autorelease_pool): Add void argument.
5752 (ns_release_autorelease_pool): Add void* argument.
5753 (ns_get_defaults_value): Add const char* argument.
5754
5755 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5756 (initFromContents): Use SSDATA where appropriate.
5757 (ns_update_menubar): Add braces to ambigous if-else.
5758 (initWithTitle): Put () around assignment in if statement.
5759 (ns_menu_show): Remove unused variables window and keymap.
5760 (update_frame_tool_bar): Remove unused variable selected_p.
5761 (initWithContentRect): Remove unused variable this_cmd_name.
5762
5763 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5764 appropriate.
5765 (setXBMColor): Remove unused variable len.
5766 (setPixmapData): Put () around assignment in loop statement.
5767
5768 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5769 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5770 where appropriate.
5771 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5772 around assignment in loop statement.
5773 (nsfont_open): Remove unused variable i.
5774 (nsfont_open): Remove unused variable len.
5775 (nsfont_draw): Remove unused variable cs.
5776
5777 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5778 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5779 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5780 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5781 (Fns_font_name, Fns_perform_service)
5782 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5783 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5784 (ns_set_name): Remove unused variable view.
5785 (x_set_menu_bar_lines): Remove unused variable olines.
5786 (x_set_tool_bar_lines): Remove unused variable root_window.
5787 (Fns_list_colors): Put () around assignment in while statement.
5788 (Fns_perform_service): Remove unused variable len.
5789 (Fns_display_usable_bounds): Remove unused variable top.
5790 (syms_of_nsfns): Remove unused variable i.
5791
5792 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5793 memcpy (Bug#11907).
5794
5795 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5796
5797 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5798 and free it with DestroyExceptionInfo (Bug#11558).
5799
5800 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5801
5802 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5803 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5804 Set here, not in nt/config.nt.
5805
5806 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5807
5808 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5809 cursor overflow into the last glyph on display line when the right
5810 fringe is off. (Bug#11832)
5811
5812 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5813
5814 * xdisp.c (produce_special_glyphs): Now static.
5815 * dispextern.h (produce_special_glyphs): Remove decl.
5816
5817 2012-07-13 Glenn Morris <rgm@gnu.org>
5818
5819 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5820 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5821
5822 * s/usg5-4-common.h (USG, USG5):
5823 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5824 * s/sol2-6.h (SOLARIS2):
5825 * s/irix6-5.h (IRIX6_5):
5826 * s/hpux10-20.h (USG, USG5, HPUX):
5827 * s/gnu-linux.h (USG, GNU_LINUX):
5828 * s/freebsd.h (BSD_SYSTEM):
5829 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5830 * s/cygwin.h (CYGWIN):
5831 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5832 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5833
5834 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5835
5836 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5837
5838 2012-07-13 Glenn Morris <rgm@gnu.org>
5839
5840 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5841
5842 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5843
5844 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5845 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5846
5847 2012-07-12 Glenn Morris <rgm@gnu.org>
5848
5849 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5850
5851 * process.c (init_process_emacs): Rename from init_process.
5852 The old name is also the name of a Mach system call.
5853 * lisp.h, emacs.c: Update for this name change.
5854 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5855 longer needed.
5856
5857 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5858
5859 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5860 memmove call that removes glyphs covered by the left truncation
5861 glyph. Improve commentary.
5862 (display_line): Fix display of continuation glyphs on GUI frames
5863 when the right fringe is turned off and variable-size fonts are
5864 used in the window. Move the code that appends a stretch glyph to
5865 produce_special_glyphs, so that it could be used for truncation
5866 and continuation glyphs alike.
5867 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5868 glyph of a suitably computed width, to align the special glyphs at
5869 the window margin. Code moved from display_line. (Bug#11832)
5870
5871 2012-07-12 Glenn Morris <rgm@gnu.org>
5872
5873 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5874
5875 * s/gnu-linux.h, s/hpux10-20.h:
5876 Do not unconditionally define HAVE_XRMSETDATABASE.
5877
5878 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5879
5880 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5881
5882 Fix typos that broke OS X build.
5883 Reported by Randal L. Schwartz in
5884 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5885 * nsterm.m (ns_timeout): Add missing local decl.
5886 (ns_get_color): snprintf -> sprintf, to fix typo.
5887
5888 2012-07-12 Glenn Morris <rgm@gnu.org>
5889
5890 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5891 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5892 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5893 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5894
5895 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5896 Move PTY_OPEN to configure.
5897
5898 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5899 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5900 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5901
5902 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5903
5904 Use empty_unibyte_string where applicable.
5905 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5906 * lread.c (read1): Likewise.
5907 * xsettings.c (syms_of_xsettings): Likewise.
5908
5909 2012-07-12 Glenn Morris <rgm@gnu.org>
5910
5911 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5912 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5913 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5914 * s/hpux10-20.h (RUN_TIME_REMAP):
5915 * s/bsd-common.h (TABDLY): Move to configure.
5916
5917 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5918
5919 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5920
5921 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5922 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5923
5924 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5925
5926 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5927 * s/template.h: Move NARROWPROTO to configure.
5928
5929 2012-07-11 Glenn Morris <rgm@gnu.org>
5930
5931 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5932 unused since 2011-01-17 change to systty.h.
5933
5934 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5935 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5936 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5937
5938 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5939
5940 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5941
5942 2012-07-11 Glenn Morris <rgm@gnu.org>
5943
5944 * s/darwin.h, s/gnu-linux.h, s/template.h:
5945 Move INTERRUPT_INPUT to configure.
5946
5947 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5948
5949 Minor adjustments to interning code.
5950 * lisp.h (intern, intern_c_string): Redefine as static inline
5951 wrappers for intern_1 and intern_c_string_1, respectively.
5952 (intern_1, intern_c_string_1): Rename prototypes.
5953 * lread.c (intern_1, intern_c_string_1, oblookup):
5954 Simplify Vobarray checking.
5955 * font.c (font_intern_prop): Likewise. Adjust comment.
5956 * w32font.c (intern_font_name): Likewise.
5957
5958 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5959
5960 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5961
5962 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5963 of Fcar/Fcdr if possible.
5964 * font.c (check_otf_features): Likewise.
5965 * fontset.c (Fnew_fontset): Likewise.
5966 * gnutls.c (Fgnutls_boot): Likewise.
5967 * minibuf.c (read_minibuf): Likewise.
5968 * msdos.c (IT_set_frame_parameters): Likewise.
5969 * xmenu.c (Fx_popup_dialog): Likewise.
5970 * w32menu.c (Fx_popup_dialog): Likewise.
5971
5972 2012-07-11 Glenn Morris <rgm@gnu.org>
5973
5974 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5975 since nothing has defined it on these platforms.
5976
5977 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5978 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5979
5980 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5981 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5982 Move CLASH_DETECTION to configure.
5983
5984 * s/gnu.h: Remove file, which is now empty.
5985
5986 * s/gnu.h, s/gnu-linux.h:
5987 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5988
5989 2012-07-11 John Wiegley <johnw@newartisans.com>
5990
5991 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5992 function attribute, so we only use it if it exists in the
5993 compiler.
5994
5995 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5996
5997 Avoid call to strlen in fast_c_string_match_ignore_case.
5998 * search.c (fast_c_string_match_ignore_case): Change to use
5999 length argument. Adjust users accordingly.
6000 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6001
6002 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6003
6004 Assume mkdir, rmdir.
6005 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6006 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6007
6008 Assume rename.
6009 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6010
6011 Assume perror.
6012 * s/hpux10-20.h (HAVE_PERROR): Remove.
6013 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6014 Remove dummy definition, as this problem was obsolete long ago.
6015
6016 Assume strerror.
6017 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6018
6019 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6020
6021 Avoid calls to strlen in font processing functions.
6022 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6023 (font_open_by_name): Change to use length argument.
6024 Adjust users accordingly.
6025 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6026 Adjust prototypes.
6027 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6028 Change to return ptrdiff_t.
6029 (xfont_list_pattern, xfont_match): Use length returned by
6030 xfont_decode_coding_xlfd.
6031 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6032
6033 2012-07-11 Glenn Morris <rgm@gnu.org>
6034
6035 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6036 Move DONT_REOPEN_PTY to configure.
6037
6038 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6039 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6040
6041 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6042
6043 Remove "#define unix" that is no longer needed (Bug#11905).
6044 * s/aix4-2.h (unix): Remove; no longer needed.
6045
6046 EMACS_TIME simplification (Bug#11875).
6047 This replaces macros (which typically do not work in GDB)
6048 with functions, typedefs and enums, making the code easier to debug.
6049 The functional style also makes code easier to read and maintain.
6050 * systime.h: Include <sys/time.h> on all hosts, not just if
6051 WINDOWSNT, since 'struct timeval' is needed in general.
6052 (EMACS_TIME): Now a typedef, not a macro.
6053 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6054 not macros.
6055 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6056 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6057 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6058 (EMACS_TIME_LE): Now functions, not macros.
6059 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6060 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6061 which are not functions. All uses rewritten to use:
6062 (make_emacs_time): New function.
6063 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6064 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6065 not functions. All uses rewritten to use the following, respectively:
6066 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6067 (add_emacs_time, sub_emacs_time): New functions.
6068 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6069 * fileio.c (Fcopy_file):
6070 * xterm.c (XTflash): Get the current time closer to when it's used.
6071 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6072
6073 * bytecode.c (targets): Suppress -Woverride-init warnings.
6074
6075 Simplify by avoiding confusing use of strncpy etc.
6076 * doc.c (Fsnarf_documentation):
6077 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6078 * frame.c (Fmake_terminal_frame):
6079 * gtkutil.c (get_utf8_string):
6080 * lread.c (openp):
6081 * nsmenu.m (ns_update_menubar):
6082 * regex.c (regerror):
6083 Prefer memcpy to strncpy and strncat when either will do.
6084 * fileio.c (Fsubstitute_in_file_name):
6085 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6086 (menu_separator_name_p):
6087 * nsmenu.m (ns_update_menubar):
6088 Prefer memcmp to strncmp when either will do.
6089 * nsterm.m: Include <ftoastr.h>.
6090 (ns_get_color):
6091 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6092 Prefer snprintf to strncpy.
6093 * nsterm.m (ns_term_init):
6094 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6095 * nsterm.m (ns_term_init):
6096 Avoid the need for strncpy, by using build_string or
6097 make_unibyte_string directly. Use dtoastr, not snprintf.
6098 * process.c (Fmake_network_process): Diagnose service names that
6099 are too long, rather than silently truncating them or creating
6100 non-null-terminated names.
6101 (Fnetwork_interface_info): Likewise, for interface names.
6102 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6103 Prefer sprintf to strncat.
6104 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6105 Prefer vsnprintf to vsprintf + strncpy.
6106
6107 2012-07-10 Glenn Morris <rgm@gnu.org>
6108
6109 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6110 Clarify fallback case.
6111
6112 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6113
6114 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6115 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6116 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6117 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6118 where argument type is known to be a Lisp_Cons.
6119
6120 2012-07-10 Tom Tromey <tromey@redhat.com>
6121
6122 * bytecode.c (BYTE_CODE_THREADED): New macro.
6123 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6124 (enum byte_code_op): New type.
6125 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6126 (exec_byte_code): Use them. Use token threading when applicable.
6127
6128 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6129
6130 Optimize pure C strings initialization.
6131 * lisp.h (make_pure_string): Fix prototype.
6132 (build_pure_c_string): New function, defined as static inline. This
6133 provides a better opportunity to optimize away calls to strlen when
6134 the function is called with compile-time constant argument.
6135 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6136 argument, adjust users accordingly. Use build_pure_c_string where
6137 appropriate.
6138 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6139 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6140 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6141
6142 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6143
6144 Avoid calls to strlen in miscellaneous functions.
6145 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6146 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6147 * lread.c (openp): Likewise.
6148
6149 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6150
6151 Avoid calls to strlen in path processing functions.
6152 * fileio.c (file_name_as_directory): Add comment. Change to add
6153 srclen argument and return the length of result. Adjust users
6154 accordingly.
6155 (directory_file_name): Fix comment. Change to add srclen argument,
6156 swap 1st and 2nd arguments to obey the common convention.
6157 Adjust users accordingly.
6158 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6159
6160 2012-07-10 Glenn Morris <rgm@gnu.org>
6161
6162 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6163 Move PENDING_OUTPUT_COUNT definition to configure.
6164
6165 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6166 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6167 * s/gnu.h (DATA_START): Move definitions to configure.
6168
6169 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6170 We include usg5-4-common.h, which defines them both.
6171
6172 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6173 O_RDONLY already includes it).
6174
6175 Stop ns builds setting the EMACSLOADPATH environment variable.
6176 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6177 Now it does not set EMACSLOADPATH, just returns the load-path string.
6178 * nsterm.h: Update accordingly.
6179 * lread.c [HAVE_NS]: Include nsterm.h.
6180 (init_lread) [HAVE_NS]: Use ns_load_path.
6181 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6182
6183 2012-07-09 Glenn Morris <rgm@gnu.org>
6184
6185 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6186 since the included bsd-common.h does so.
6187
6188 Stop ns builds setting the EMACSPATH environment variable.
6189 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6190 (ns_init_paths): Do not set EMACSPATH.
6191 * nsterm.h (ns_exec_path): Add it.
6192 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6193 Use ns_exec_path.
6194
6195 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6196
6197 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6198
6199 * process.c (wait_reading_process_output): 'waitchannels' was unset
6200 when read_kbd || !NILP (wait_for_cell); fix this.
6201
6202 Add GCC-style 'const' attribute to functions that can use it.
6203 * character.h (char_resolve_modifier_mask):
6204 * keyboard.h (make_ctrl_char):
6205 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6206 (init_character_once, next_almost_prime, init_fns, init_image)
6207 (flush_pending_output, init_sound):
6208 * mem-limits.h (start_of_data):
6209 * menu.h (finish_menu_items):
6210 Add ATTRIBUTE_CONST.
6211 * emacs.c (DEFINE_DUMMY_FUNCTION):
6212 Declare the dummy function with ATTRIBUTE_CONST.
6213 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6214 Add decls with ATTRIBUTE_CONST.
6215
6216 Minor improvements to make_formatted_string.
6217 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6218 where int is good enough, as vsprintf returns an int.
6219 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6220
6221 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6222
6223 Use make_formatted_string to avoid double length calculation.
6224 * lisp.h (make_formatted_string): New prototype.
6225 * alloc.c (make_formatted_string): New function.
6226 * buffer.c (Fgenerate_new_buffer_name): Use it.
6227 * dbusbind.c (syms_of_dbusbind): Likewise.
6228 * editfns.c (Fcurrent_time_zone): Likewise.
6229 * filelock.c (get_boot_time): Likewise.
6230 * frame.c (make_terminal_frame, set_term_frame_name)
6231 (x_report_frame_params): Likewise.
6232 * image.c (gs_load): Likewise.
6233 * minibuf.c (get_minibuffer): Likewise.
6234 * msdos.c (dos_set_window_size): Likewise.
6235 * process.c (make_process): Likewise.
6236 * xdisp.c (ensure_echo_area_buffers): Likewise.
6237 * xsettings.c (apply_xft_settings): Likewise.
6238
6239 2012-07-09 Glenn Morris <rgm@gnu.org>
6240
6241 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6242 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6243 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6244 * nsterm.h (ns_etc_directory): Add it.
6245 * callproc.c [HAVE_NS]: Include nsterm.h.
6246 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6247
6248 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6249
6250 Move marker debugging code under MARKER_DEBUG.
6251 * marker.c (MARKER_DEBUG): Move marker debugging code under
6252 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6253 for bootstrap with --enable-checking (~3x slowdown reported
6254 by Juanma Barranquero <lekktu@gmail.com>).
6255 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6256
6257 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6258
6259 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6260 See <http://bugs.gnu.org/11825#29>.
6261
6262 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6263
6264 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6265 has no font, use the frame's font. (Bug#11813)
6266 (display_line): Add commentary about displaying truncation glyphs
6267 on GUI frames.
6268 (produce_special_glyphs): Move here from term.c.
6269
6270 * term.c (produce_special_glyphs): Move to xdisp.c.
6271
6272 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6273 section.
6274
6275 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6276
6277 * xdisp.c (display_line): Avoid warning about implicit declaration
6278 of FRAME_FONT.
6279
6280 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6281
6282 * lisp.h: Remove empty conditional.
6283
6284 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6285
6286 * lread.c (load_path_check): Now static.
6287
6288 Fix some minor --with-ns problems found by static checking.
6289 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6290 (x_set_font) [!HAVE_X_WINDOWS]:
6291 * image.c (xpm_load_image) [HAVE_NS]:
6292 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6293 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6294 Remove unused local.
6295 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6296 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6297 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6298 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6299 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6300 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6301 Fix pointer signedness problem.
6302 * xfaces.c (FRAME_X_FONT_TABLE):
6303 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6304
6305 2012-07-07 Glenn Morris <rgm@gnu.org>
6306
6307 * lread.c (load_path_check): New function, split from init_lread.
6308 (init_lread): Reorganize. Motivation:
6309 If EMACSLOADPATH is set, check/warn about that rather than the
6310 defaults, which we are not going to use. Hence we can remove
6311 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6312 Don't warn if site-lisp directories are missing.
6313 If not installed, start from a blank load-path, since
6314 PATH_LOADSEARCH refers to the eventual installation directories.
6315
6316 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6317
6318 Support truncation and continuation glyphs on GUI frames, when
6319 fringes are disabled. (Bug#11832)
6320 * xdisp.c (init_iterator): Get dimensions of truncation and
6321 continuation glyphs even if on GUI frames.
6322 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6323 or both, are absent.
6324 (start_display, move_it_in_display_line_to): Handle the case of a
6325 GUI frame without a fringe to display continuation or truncation
6326 glyphs.
6327 (insert_left_trunc_glyphs): Support GUI frames: make sure
6328 truncation glyphs overwrite enough glyphs from the current line to
6329 have sufficient space in pixels.
6330 (display_line): Support truncation and continuation glyphs on GUI
6331 frames. If some spare pixels are left on the line after inserting
6332 the truncation glyphs, fill that space with a stretch glyph of a
6333 suitably computed width.
6334
6335 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6336 produce_glyphs, to support GUI sessions.
6337
6338 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6339
6340 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6341
6342 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6343
6344 Do not require float-time's arg to fit in time_t (Bug#11825).
6345 This works better on hosts where time_t is unsigned, and where
6346 float-time is applied to the (negative) difference between two times.
6347 * editfns.c (decode_time_components): Last arg is now double *,
6348 not int *, and means to store all the result as a double, without
6349 worrying about whether the seconds part fits in time_t.
6350 All callers changed.
6351 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6352 All callers changed.
6353 (Ffloat_time): Do not fail merely because the specified time falls
6354 outside of time_t range.
6355
6356 2012-07-07 Glenn Morris <rgm@gnu.org>
6357
6358 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6359 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6360 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6361
6362 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6363
6364 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6365 Update dependencies.
6366
6367 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6368
6369 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6370
6371 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6372 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6373 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6374 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6375 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6376 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6377
6378 * xfont.c (compare_font_names): Redo to omit the need for casts.
6379
6380 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6381
6382 * xfns.c (Fx_change_window_property): Doc fix.
6383 * w32fns.c (Fx_change_window_property): Doc fix.
6384
6385 * w32fns.c (Fx_window_property): Accept the same arguments as the
6386 X Windows version. Doc fix.
6387 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6388
6389 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6390 Eli Zaretskii <eliz@gnu.org>
6391
6392 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6393 Windows-specific code from nt/config.nt moved here.
6394 Obsolete settings removed.
6395
6396 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6397
6398 * process.c: Avoid unnecessary calls to gettime.
6399 (wait_reading_process_output): Don't get the time of day
6400 when gobbling data immediately and not waiting, as there's no need
6401 for it in that case. This removes a FIXME.
6402
6403 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6404
6405 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6406 is defined (Bug#11768).
6407
6408 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6409
6410 Fix marker debugging code.
6411 * marker.c (byte_char_debug_check): Do not perform the check
6412 if buffer is not multibyte.
6413 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6414 Call byte_char_debug_check with correct arguments.
6415
6416 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6417
6418 Compile marker debugging code only if ENABLE_CHECKING is defined.
6419 * marker.c (byte_char_debug_check, count_markers):
6420 Use only if ENABLE_CHECKING is defined.
6421 (byte_debug_flag): Remove.
6422 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6423 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6424
6425 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6426
6427 Avoid code repetition in marker-related functions.
6428 * marker.c (attach_marker): New function.
6429 (Fset_marker, set_marker_restricted, set_marker_both)
6430 (set_marker_restricted_both): Use it.
6431 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6432 Consistently rename charno to charpos.
6433 (marker_position): Add eassert.
6434 (marker_byte_position): Convert to eassert.
6435
6436 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6437
6438 Simplify list operations in unchain_overlay and unchain_marker.
6439 * buffer.c (unchain_overlay): Simplify. Add comment.
6440 * marker.c (unchain_marker): Simplify. Fix comments.
6441
6442 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6443
6444 Introduce fast path for the widely used marker operation.
6445 * alloc.c (build_marker): New function.
6446 * lisp.h (build_marker): New prototype.
6447 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6448 * composite.c (autocmp_chars): Likewise.
6449 * editfns.c (buildmark): Remove.
6450 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6451 (save_restriction_save): Use build_marker.
6452 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6453 * window.c (save_window_save): Likewise.
6454
6455 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6456
6457 Do not use Fdelete_overlay in delete_all_overlays
6458 to avoid redundant calls to unchain_overlay.
6459 * buffer.c (drop_overlay): New function.
6460 (delete_all_overlays, Fdelete_overlay): Use it.
6461 * minibuf.c (get_minibuffer): Fix comment.
6462
6463 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6464
6465 Port to OpenBSD 5.1 amd64.
6466 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6467 This is needed for OpenBSD, and should be harmless on all BSD systems.
6468 Also, include <sys/sysctl.h>, as it should be available on all
6469 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6470 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6471 use p_pid member, not kp_proc.pid.
6472
6473 2012-07-06 Glenn Morris <rgm@gnu.org>
6474
6475 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6476
6477 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6478
6479 More xmalloc and related cleanup.
6480 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6481 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6482 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6483 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6484 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6485 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6486 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6487 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6488 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6489 * xterm.c:
6490 Omit needless casts involving void * pointers and allocation.
6491 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6492 as the former is more robust if P's type is changed.
6493 Prefer xzalloc to xmalloc + memset 0.
6494 Simplify malloc-or-realloc to realloc.
6495 Don't worry about xmalloc returning a null pointer.
6496 Prefer xstrdup to xmalloc + strcpy.
6497 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6498 growing it.
6499 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6500 alloca of a constant.
6501
6502 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6503
6504 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6505 hscroll is larger than the line width. Fixes long and futile
6506 looping inside extend_face_to_end_of_line (on a TTY) producing
6507 glyphs that are not needed and thrown away.
6508
6509 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6510
6511 * marker.c (set_marker_restricted_both): Simplify by using
6512 clip_to_bounds.
6513
6514 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6515
6516 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6517
6518 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6519
6520 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6521 not defined (Bug#11768).
6522 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6523 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6524 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6525 followed by gtk_box_set_homogeneous (Bug#11768).
6526 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6527 (update_theme_scrollbar_width, xg_create_scroll_bar):
6528 Use gtk_scrollbar_new (Bug#11768).
6529 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6530 (is_box_type): New function (Bug#11768).
6531 (xg_tool_item_stale_p): Call is_box_type.
6532 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6533 with default display (Bug#11768).
6534
6535 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6536
6537 * xdisp.c (window_hscroll_limited): New function.
6538 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6539 coordinates when window's hscroll is set to insanely large
6540 values. (Bug#11857)
6541
6542 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6543
6544 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6545 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6546
6547 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6548
6549 Cleanup xmalloc.
6550 * lisp.h (xzalloc): New prototype. Omit needless casts.
6551 * alloc.c (xzalloc): New function. Omit needless casts.
6552 * charset.c: Omit needless casts. Convert all calls to
6553 xmalloc with following memset to xzalloc.
6554 * dispnew.c: Likewise.
6555 * fringe.c: Likewise.
6556 * image.c: Likewise.
6557 * sound.c: Likewise.
6558 * term.c: Likewise.
6559 * w32fns.c: Likewise.
6560 * w32font.c: Likewise.
6561 * w32term.c: Likewise.
6562 * xfaces.c: Likewise.
6563 * xfns.c: Likewise.
6564 * xterm.c: Likewise.
6565 * atimer.c: Omit needless casts.
6566 * buffer.c: Likewise.
6567 * callproc.c: Likewise.
6568 * ccl.c: Likewise.
6569 * coding.c: Likewise.
6570 * composite.c: Likewise.
6571 * doc.c: Likewise.
6572 * doprnt.c: Likewise.
6573 * editfns.c: Likewise.
6574 * emacs.c: Likewise.
6575 * eval.c: Likewise.
6576 * filelock.c: Likewise.
6577 * fns.c: Likewise.
6578 * gtkutil.c: Likewise.
6579 * keyboard.c: Likewise.
6580 * lisp.h: Likewise.
6581 * lread.c: Likewise.
6582 * minibuf.c: Likewise.
6583 * msdos.c: Likewise.
6584 * print.c: Likewise.
6585 * process.c: Likewise.
6586 * region-cache.c: Likewise.
6587 * search.c: Likewise.
6588 * sysdep.c: Likewise.
6589 * termcap.c: Likewise.
6590 * terminal.c: Likewise.
6591 * tparam.c: Likewise.
6592 * w16select.c: Likewise.
6593 * w32.c: Likewise.
6594 * w32reg.c: Likewise.
6595 * w32select.c: Likewise.
6596 * w32uniscribe.c: Likewise.
6597 * widget.c: Likewise.
6598 * xdisp.c: Likewise.
6599 * xmenu.c: Likewise.
6600 * xrdb.c: Likewise.
6601 * xselect.c: Likewise.
6602
6603 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6604
6605 * fileio.c (time_error_value): Check the right error number.
6606 Problem reported by Troels Nielsen in
6607 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6608
6609 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6610
6611 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6612 This should be fixed in a better way; see Eli Zaretskii in
6613 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6614 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6615
6616 * fileio.c (time_error_value): Rename from special_mtime.
6617 The old name's problems were noted by Eli Zaretskii in
6618 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6619
6620 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6621 This variable's comment says Emacs needs at least one GDB-visible
6622 symbol of type enum pvec_type, to work around GDB problems.
6623 The symbol's value doesn't matter.
6624
6625 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6626 that causes compilation to fail on pre-C99 compilers.
6627
6628 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6629
6630 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6631 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6632
6633 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6634
6635 * buffer.c (init_buffer_once): Fix initialization of
6636 headers for buffer_defaults and buffer_local_symbols.
6637 Reported by Juanma Barranquero <lekktu@gmail.com>.
6638
6639 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6640
6641 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6642 * lisp.h (enum pvec_type): Use fewer bits.
6643 (PSEUDOVECTOR_SIZE_BITS): New constant.
6644 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6645 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6646 change in pvec_type.
6647 (PSEUDOVECTOR_TYPEP): New macro.
6648 (TYPED_PSEUDOVECTORP): Use it.
6649 * fns.c (internal_equal): Adapt code to extract pvectype.
6650 * emacs.c (gdb_pvec_type): Update type.
6651 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6652 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6653 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6654 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6655 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6656 abusing vector->header.next.nbytes.
6657 (live_vector_p): Use PVEC_TYPE.
6658 (mark_object): Adapt code to extract pvectype. Use switch.
6659
6660 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6661
6662 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6663 Tighten new eassert a bit.
6664
6665 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6666
6667 Fix compilation with --enable-gcc-warnings and -O1
6668 optimization level.
6669 * doprnt.c (doprnt): Change type of tem to int, initialize
6670 to avoid compiler warning. Add eassert.
6671 * search.c (simple_search): Initialize match_byte to avoid
6672 compiler warning. Add eassert.
6673
6674 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6675
6676 Avoid weird behavior with large horizontal scrolls.
6677 Without this change, for example, large hscroll values would
6678 mess up Emacs's display on Fedora 15 x86, presumably due to
6679 overflows in int calculations in the display code.
6680 Also, if buffers had long lines, Emacs would freeze.
6681 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6682 (set_window_hscroll): New function, containing the old guts of
6683 Fset_window_hscroll. Return the clipped value.
6684 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6685 This avoids the need to check against PTRDIFF_MAX.
6686
6687 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6688
6689 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6690
6691 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6692
6693 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6694
6695 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6696 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6697 since GCC 4.4.6 issues a bogus warning for them.
6698
6699 Fix bugs in file timestamp newness comparisons.
6700 * fileio.c (Ffile_newer_than_file_p):
6701 * lread.c (Fload): Use full timestamp resolution of files,
6702 not just the 1-second resolution, so that files that are only
6703 slightly newer still count as newer.
6704 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6705 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6706
6707 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6708
6709 * fileio.c: Improve handling of file time marker. (Bug#11852)
6710 (special_mtime): New function.
6711 (Finsert_file_contents, Fverify_visited_file_modtime):
6712 Use it to set special mtime values consistently.
6713
6714 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6715
6716 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6717 marker for non-existing file. (Bug#11852)
6718
6719 2012-07-03 Glenn Morris <rgm@gnu.org>
6720
6721 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6722 and did not make it into globals.h).
6723
6724 2012-07-03 Tom Tromey <tromey@redhat.com>
6725
6726 * window.c (Fset_window_margins, Fset_window_fringes)
6727 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6728 * textprop.c (Fprevious_property_change): No longer static.
6729 * syntax.c (Fsyntax_table_p): No longer static.
6730 * process.c (Fget_process, Fprocess_datagram_address): No longer
6731 static.
6732 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6733 * keyboard.c (Fcommand_execute): No longer static.
6734 Remove EXFUN.
6735 * insdel.c (Fcombine_after_change_execute): No longer static.
6736 * image.c (Finit_image_library): No longer static.
6737 * fileio.c (Fmake_symbolic_link): No longer static.
6738 * eval.c (Ffetch_bytecode): No longer static.
6739 * editfns.c (Fuser_full_name): No longer static.
6740 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6741 No longer static.
6742 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6743 static.
6744 * dired.c (Ffile_attributes): No longer static.
6745 * composite.c (Fcomposition_get_gstring): No longer static.
6746 * callproc.c (Fgetenv_internal): No longer static.
6747
6748 * ccl.h: Remove EXFUNs.
6749 * buffer.h: Remove EXFUNs.
6750 * dispextern.h: Remove EXFUNs.
6751 * intervals.h: Remove EXFUNs.
6752 * fontset.h: Remove EXFUN.
6753 * font.h: Remove EXFUNs.
6754 * dosfns.c (system_process_attributes): Remove EXFUN.
6755 * keymap.h: Remove EXFUNs.
6756 * lisp.h: Remove EXFUNs.
6757 * w32term.h: Remove EXFUNs.
6758 * window.h: Remove EXFUNs.
6759 * xsettings.h: Remove EXFUN.
6760 * xterm.h: Remove EXFUN.
6761
6762 2012-07-03 Glenn Morris <rgm@gnu.org>
6763
6764 * lisp.h (Frandom): Make it visible to C.
6765 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6766 buffer for invisible buffers. (Bug#1229)
6767
6768 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6769
6770 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6771 values which aren't power of 2.
6772 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6773 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6774 accordingly.
6775
6776 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6777
6778 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6779
6780 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6781
6782 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6783
6784 * alloc.c (allocate_vector_block): Remove redundant
6785 calls to mallopt if DOUG_LEA_MALLOC is defined.
6786 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6787 avoid calls to mallopt if zero_vector is returned.
6788
6789 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6790
6791 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6792 is enabled, avoid dereferencing NULL current_sblock if
6793 running undumped.
6794
6795 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6796
6797 Cleanup basic buffer management.
6798 * buffer.h (struct buffer): Change layout to use generic vector
6799 marking code. Fix some comments. Change type of 'clip_changed'
6800 to bitfield. Remove unused #ifndef old.
6801 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6802 (GET_OVERLAYS_AT): Fix indentation.
6803 (for_each_per_buffer_object_at): New macro.
6804 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6805 (Fbuffer_local_variables): Use it.
6806 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6807 * alloc.c (allocate_buffer): Adjust to match new layout of
6808 struct buffer. Fix comment.
6809 (mark_overlay): New function.
6810 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6811 Lisp area of struct buffer.
6812 (mark_object): Use it. Adjust marking of misc objects
6813 and related comments.
6814
6815 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6816
6817 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6818 wrapper that is not needed because the wrapped code is a no-op (zero
6819 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6820 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6821
6822 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6823
6824 * alloc.c (mark_buffer): Simplify. Remove prototype.
6825 (mark_object): Add comment. Reorganize marking of vector-like
6826 objects. Use CHECK_LIVE for all vector-like objects except buffers
6827 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6828 Avoid redundant calls to mark_vectorlike for bool vectors.
6829
6830 2012-06-30 Glenn Morris <rgm@gnu.org>
6831
6832 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6833
6834 * epaths.in (PATH_SITELOADSEARCH): New.
6835 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6836 This is rather than relying on --enable-locallisppath elements
6837 having "site-lisp" in their names. (Bug#10208#25, 11658)
6838
6839 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6840
6841 * w32proc.c (sys_select): Accept and ignore one more argument.
6842
6843 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6844
6845 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6846 (pselect) [!MS_DOS]: Redirect to sys_select.
6847
6848 * sysdep.c: Don't include dos.h and dosfns.h.
6849
6850 * process.c (sys_select):
6851 * msdos.c (sys_select): Accept one more argument and ignore it.
6852
6853 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6854 adapt data types and code to that.
6855
6856 * dosfns.c:
6857 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6858 which clashes with the gnulib function of the same name.
6859
6860 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6861
6862 * font.c (font_style_to_value, font_style_symbolic)
6863 (font_prop_validate_style): Add type checks for values in
6864 font_style_table.
6865
6866 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6867 argument.
6868 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6869 uses.
6870
6871 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6872
6873 * xdisp.c (try_window_id): Undo last change.
6874
6875 * w32.c (getwd): Adjust commentary about startup_dir.
6876 (init_environment): Always call sys_access, even in non-MSVC
6877 builds. Don't chdir to the directory of the Emacs executable.
6878 This undoes code from 1997 which was justified by the need to
6879 "avoid conflicts when removing and renaming directories". But its
6880 downside was that every relative file name was being interpreted
6881 relative to the directory of the Emacs executable, which can never
6882 be TRT. In particular, it broke sys_access when called with
6883 relative file names.
6884 (sys_access): Map GetLastError to errno.
6885
6886 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6887
6888 * window.h (struct window): Change type of 'fringes_outside_margins'
6889 to bitfield. Fix comment. Adjust users accordingly.
6890 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6891 Adjust comment.
6892 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6893 to ptrdiff_t.
6894
6895 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6896
6897 * gnutls.c (emacs_gnutls_handshake):
6898 Add QUIT to make the loop interruptible.
6899
6900 2012-06-29 Glenn Morris <rgm@gnu.org>
6901
6902 * charset.c (init_charset): Make lack of etc/charsets fatal.
6903
6904 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6905
6906 * editfns.c (region_limit): Fix type mismatch.
6907
6908 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6909
6910 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6911 undefined. Convert from xassert to eassert.
6912 * nsmenu.m: Convert from xassert to eassert.
6913 * nsterm.m: Likewise.
6914
6915 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6916
6917 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6918
6919 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6920
6921 Avoid integer overflow on scroll-left and scroll-right.
6922 * window.c (HSCROLL_MAX): New macro.
6923 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6924 overflow when requested scroll falls outside ptrdiff_t range.
6925
6926 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6927
6928 * window.h (struct window): Change type of 'hscroll',
6929 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6930 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6931 Adjust users accordingly.
6932 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6933 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6934 from EMACS_INT to ptrdiff_t.
6935 (make_window): Omit redundant initialization.
6936
6937 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6938
6939 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6940
6941 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6942
6943 * window.h (struct window): Change type of 'use_time' and
6944 'sequence_number' from Lisp_Object to int.
6945 * frame.c (make_frame): Adjust users accordingly.
6946 * print.c (print_object): Likewise.
6947 * window.c (select_window, Fwindow_use_time, make_parent_window)
6948 (make_window): Likewise.
6949
6950 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6951
6952 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6953 enabled with --enable-checking=[all,glyphs] configure option.
6954 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6955 adjust comments accordingly.
6956 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6957 undefined, adjust comments accordingly.
6958 * image.c: Likewise.
6959 * scroll.c: Likewise.
6960 * w32fns.c: Likewise.
6961 * w32term.c: Likewise.
6962 * xdisp.c: Likewise.
6963 * xfaces.c: Likewise.
6964 * xfns.c: Likewise.
6965 * xterm.c: Likewise.
6966
6967 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6968
6969 Generalize run-time debugging checks.
6970 * dispextern.h (XASSERTS): Remove.
6971 * fontset.c (xassert): Remove.
6972 Convert from xassert to eassert.
6973 * alloc.c: Convert from xassert to eassert.
6974 * bidi.c: Likewise.
6975 * dispnew.c: Likewise.
6976 * fns.c: Likewise.
6977 * fringe.c: Likewise.
6978 * ftfont.c: Likewise.
6979 * gtkutil.c: Likewise.
6980 * image.c: Likewise.
6981 * keyboard.c: Likewise.
6982 * menu.c: Likewise.
6983 * process.c: Likewise.
6984 * scroll.c: Likewise.
6985 * sound.c: Likewise.
6986 * term.c: Likewise.
6987 * w32console.c: Likewise.
6988 * w32fns.c: Likewise.
6989 * w32term.c: Likewise.
6990 * window.c: Likewise.
6991 * xdisp.c: Likewise.
6992 * xfaces.c: Likewise.
6993 * xfns.c: Likewise.
6994 * xselect.c: Likewise.
6995 * xterm.c: Likewise.
6996
6997 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6998
6999 * fns.c (maybe_resize_hash_table): Output message when growing the
7000 purify-hashtable.
7001
7002 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7003
7004 * alloc.c (allocate_string_data): Remove dead code.
7005 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7006 avoid GCC warning about unused macro.
7007
7008 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7009
7010 * alloc.c (allocate_string): Omit intervals initialization.
7011 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7012 as in make_pure_string and make_pure_c_string.
7013
7014 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7015
7016 * alloc.c (allocate_string): Fix last change.
7017
7018 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7019
7020 * alloc.c (allocate_string): Remove two redundant calls
7021 to memset, add explicit initialization where appropriate.
7022
7023 2012-06-27 Glenn Morris <rgm@gnu.org>
7024
7025 * lisp.mk (lisp): Remove paths.elc.
7026
7027 2012-06-27 Chong Yidong <cyd@gnu.org>
7028
7029 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7030
7031 2012-06-26 John Wiegley <johnw@newartisans.com>
7032
7033 * unexmacosx.c (copy_data_segment): Add two section names used
7034 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7035
7036 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7037 when building with Clang.
7038
7039 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7040
7041 * eval.c (Fapply): Allow calling it with a single argument.
7042
7043 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7044
7045 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7046 _stricmp and _strnicmp.
7047 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7048
7049 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7050
7051 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7052 allocated window.
7053 (allocate_process): Likewise for new process.
7054 (allocate_terminal): Change to use offsetof.
7055 (allocate_frame): Likewise.
7056 * frame.c (make_frame): Omit redundant initialization.
7057 * window.c (make_parent_window): Use memset.
7058 (make_window): Omit redundant initialization.
7059 * process.c (make_process): Omit redundant initialization.
7060 * terminal.c (create_terminal): Likewise.
7061
7062 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7063
7064 * term.c (delete_tty): Remove redundant call to memset.
7065
7066 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7067
7068 * alloc.c: Remove build_string.
7069 * lisp.h: Define build_string as static inline. This provides
7070 a better opportunity to optimize away calls to strlen when the
7071 function is called with compile-time constant argument.
7072 * image.c (imagemagick_error): Convert to build_string.
7073 * w32proc.c (sys_spawnve): Likewise.
7074 * xterm.c (x_term_init): Likewise.
7075
7076 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7077
7078 Use sprintf return value instead of invoking strlen on result.
7079 In the old days this wasn't portable, since some sprintf
7080 implementations returned char *. But they died out years ago and
7081 Emacs already assumes sprintf returns int.
7082 Similarly for float_to_string.
7083 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7084 * ccl.c (ccl_driver):
7085 * character.c (string_escape_byte8):
7086 * data.c (Fnumber_to_string):
7087 * doprnt.c (doprnt):
7088 * print.c (print_object):
7089 * xdisp.c (message_dolog):
7090 * xfns.c (syms_of_xfns):
7091 Use sprintf or float_to_string result to avoid need to call strlen.
7092 * data.c (Fnumber_to_string):
7093 Use make_unibyte_string, since the string must be ASCII.
7094 * lisp.h, print.c (float_to_string): Now returns int length.
7095 * term.c (produce_glyphless_glyph):
7096 Use sprintf result rather than recomputing it.
7097
7098 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7099 * Makefile.in (ALL_CFLAGS):
7100 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7101 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7102
7103 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7104
7105 * dispextern.h (xstrcasecmp): Define to library function
7106 strcasecmp if available.
7107 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7108
7109 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7110
7111 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7112 Avoid comma operator.
7113 * menu.c (push_submenu_start, push_submenu_end)
7114 (push_left_right_boundary, push_menu_pane): Likewise.
7115 * msdos.c (dos_rawgetc): Likewise.
7116
7117 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7118
7119 * xfns.c (xic_create_fontsetname): Remove redundant calls
7120 to memset.
7121
7122 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7123
7124 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7125 sprintf already null-terminates its output.
7126
7127 * xfns.c (x_window): Remove redundant cast.
7128
7129 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7130
7131 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7132 `const char *' to `char *' to avoid compiler warning.
7133
7134 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7135
7136 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7137 instead of truncating it to 63 (admittedly a generous limit).
7138
7139 * process.c: Fix spelling and caps in comments.
7140
7141 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7142
7143 * emacs.c (setpgrp): Remove definition, unused.
7144 * sysdep.c (setpgrp): Remove definition, not used in this file.
7145
7146 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7147
7148 * makefile.w32-in: Update dependencies.
7149
7150 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7151
7152 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7153 (SYSTIME_H): Add nt/inc/sys/time.h.
7154
7155 * systime.h [WINDOWSNT]: Include sys/time.h.
7156
7157 * s/ms-w32.h (struct timespec): Definition moved from
7158 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7159
7160 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7161
7162 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7163 * buffer.h (buffer_slot_type_mismatch):
7164 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7165 * eval.c (unwind_to_catch):
7166 * image.c (my_png_error, my_error_exit):
7167 * keyboard.c (quit_throw_to_read_char, user_error)
7168 (Fexit_recursive_edit, Fabort_recursive_edit):
7169 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7170 (wrong_type_argument, buffer_overflow, __executable_start)
7171 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7172 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7173 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7174 (fatal):
7175 (child_setup) [!DOS_NT]:
7176 * lread.c (end_of_file_error, invalid_syntax):
7177 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7178 * puresize.h (pure_write_error):
7179 * search.c (matcher_overflow):
7180 * sound.c (sound_perror, alsa_sound_perror):
7181 * sysdep.c, syssignal.h (croak):
7182 * term.c (maybe_fatal, vfatal):
7183 * textprop.c (text_read_only):
7184 * undo.c (user_error):
7185 * unexmacosx.c (unexec_error):
7186 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7187 Use _Noreturn rather than NO_RETURN.
7188 No need for separate decl merely because of _Noreturn.
7189 * sound.c (sound_warning, parse_sound):
7190 Remove unnecessary forward decls.
7191
7192 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7193
7194 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7195 * lisp.h (WAIT_READING_MAX): New macro.
7196 * dispnew.c (Fsleep_for, sit_for):
7197 * keyboard.c (kbd_buffer_get_event):
7198 * process.c (Faccept_process_output):
7199 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7200 This improves on the previous patch, which introduced a bug
7201 when time_t is unsigned and as wide as intmax_t.
7202 See <http://bugs.gnu.org/9000#51>.
7203
7204 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7205
7206 * dispnew.c (sit_for, Fsleep_for):
7207 * keyboard.c (kbd_buffer_get_event):
7208 * process.c (Faccept_process_output): Avoid compiler warnings when
7209 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7210
7211 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7212
7213 * makefile.w32-in: Update dependencies.
7214
7215 * w32.c (ltime): Add return type and declare static.
7216 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7217
7218 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7219
7220 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7221 Privately reported by Herbert J. Skuhra.
7222 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7223 All uses changed.
7224 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7225 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7226
7227 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7228
7229 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7230 last argument of make_unibyte_string.
7231
7232 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7233 language ID in the event parameters.
7234
7235 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7236 event.code, not the obscure "character set ID".
7237
7238 2012-06-23 Chong Yidong <cyd@gnu.org>
7239
7240 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7241
7242 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7243
7244 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7245 * w32.c (fdutimens): New function.
7246
7247 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7248
7249 * s/ms-w32.h (pselect): Redirect to sys_select.
7250
7251 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7252
7253 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7254 in the logic of incrementing and decrementing the value of
7255 use_relocatable_buffers.
7256
7257 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7258
7259 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7260 Privately reported by Herbert J. Skuhra.
7261 [__FreeBSD__]: Remove "*/" typo after "#include".
7262 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7263 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7264 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7265 Don't assume EMACS_TIME and struct timeval are the same type.
7266
7267 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7268
7269 Support higher-resolution time stamps (Bug#9000).
7270 The time stamps are only nanosecond-resolution at the C level,
7271 since that's the best that any real-world system supports now.
7272 But they are picosecond-resolution at the Lisp level, as that's
7273 easy, and leaves room for future OS improvements.
7274
7275 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7276 (LIBES): Use it.
7277
7278 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7279 Don't get current time unless it's needed.
7280
7281 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7282 now provides it if it's absent.
7283 (start_atimer): Port to higher-res time stamps.
7284 Check for time stamp overflow. Don't get current time more
7285 often than is needed.
7286
7287 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7288 Include systime.h, not time.h.
7289 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7290
7291 * dired.c: Include stat-time.h.
7292 (Ffile-attributes): File times now have higher resolution.
7293
7294 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7295 (struct image): Timestamp now has higher resolution.
7296
7297 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7298 has at least microseconds now. All uses removed.
7299 (update_frame, update_single_window, update_window, update_frame_1)
7300 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7301 (duration_to_sec_usec): Remove; no longer needed.
7302
7303 * editfns.c (time_overflow): Now extern.
7304 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7305 (float-time, Fformat_time_string, Fcurrent_time_string)
7306 (Fcurrent_time_zone): Accept and generate higher-resolution
7307 time stamps.
7308 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7309 (decode_time_components, lisp_seconds_argument): New functions.
7310 (make_time): Now static.
7311 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7312 Report an error if the time is invalid, rather than having the caller
7313 do that.
7314
7315 * fileio.c: Include <stat-time.h>
7316 (Fcopy_file): Copy higher-resolution time stamps.
7317 Prefer to set the time stamp via a file descriptor if that works.
7318 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7319 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7320 (Fvisited_file_modtime, Fset_visited_file_modtime):
7321 Support higher-resolution time stamps.
7322
7323 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7324
7325 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7326
7327 * image.c (prepare_image_for_display, clear_image_cache)
7328 (lookup_image): Port to higer-resolution time stamps.
7329
7330 * keyboard.c (start_polling, bind_polling_period):
7331 Check for time stamp overflow.
7332 (read_char, kbd_buffer_get_event, timer_start_idle)
7333 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7334 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7335 Port to higher-resolution time stamps. Do not assume time_t is signed.
7336 (decode_timer): New function. Timers are now vectors of length 9,
7337 not 8, to accommodate the picosecond component.
7338 (timer_check_2): Use it.
7339
7340 * nsterm.m (select_timeout, timeval_subtract): Remove.
7341 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7342 as they're a bit more accurate and handle overflow better.
7343 (ns_select): Change prototype to be compatible with pselect.
7344 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7345 * nsterm.h (ns_select): Adjust prototype.
7346
7347 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7348 us-resolution time stamps.
7349 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7350
7351 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7352
7353 * lisp.h (time_overflow): New decl.
7354 (wait_reading_process_output): First arg is now intmax_t, not int,
7355 to accommodate larger waits.
7356
7357 * process.h (struct Lisp_Process.read_output_delay):
7358 Now counts nanoseconds, not microseconds.
7359 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7360 EMACS_HAS_USECS.
7361 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7362 (wait_reading_process_output):
7363 Port to ns-resolution time stamps.
7364 (Faccept_process_output, wait_reading_process_output):
7365 Check for time stamp overflow. Do not assume time_t is signed.
7366 (select_wrapper): Remove; we now use pselect.
7367 (Fprocess_attributes): Now generates ns-resolution time stamps.
7368
7369 * sysdep.c: Include utimens.h. Don't include utime.h
7370 or worry about struct utimbuf; gnulib does that for us now.
7371 (gettimeofday): Remove; gnulib provides a substitute.
7372 (make_timeval): New function.
7373 (set_file_times): Now sets ns-resolution time stamps.
7374 New arg FD; all uses changed.
7375 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7376 (system_process_attributes):
7377 Now returns ns-resolution time stamp. All uses changed.
7378 Check for time stamp overflow.
7379
7380 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7381 provides a substitute now.
7382
7383 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7384 since it guarantees struct timespec.
7385 (EMACS_TIME): Now struct timespec, so that we can support
7386 ns-resolution time stamps.
7387 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7388 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7389 (EMACS_USECS): Remove.
7390 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7391 so multiply the arg by 1000 before storing it.
7392 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7393 New macros.
7394 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7395 Port to ns-resolution time stamps.
7396 (EMACS_TIME_NEG_P): Remove; replaced by....
7397 (EMACS_TIME_SIGN): New macro.
7398 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7399 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7400 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7401 (make_timeval, make_lisp_time, decode_time_components): New decls.
7402 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7403 that it mishandled time_t overflow. You can't compare by subtracting!
7404 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7405 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7406
7407 * term.c: Include <sys/time.h>.
7408 (timeval_to_Time): New function, for proper overflow wraparound.
7409 (term_mouse_position, term_mouse_click): Use it.
7410
7411 * undo.c (record_first_change): Support higher-resolution time stamps
7412 in the undo buffer.
7413 (Fprimitive_undo): Use them when restoring time stamps.
7414
7415 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7416 (w32_get_internal_run_time):
7417 Port to higher-resolution Emacs time stamps.
7418 (ltime): Now accepts single 64-bit integer, as that's more convenient
7419 for callers.
7420
7421 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7422
7423 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7424 for compatibility with pselect. Support ns-resolution time stamps.
7425
7426 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7427
7428 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7429 Check for time stamp overflow, and support ns-resolution time stamps.
7430
7431 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7432 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7433 (timeval_subtract): Remove; no longer needed.
7434 (XTflash, XTring_bell, x_wait_for_event):
7435 Port to ns-resolution time stamps. Don't assume time_t is signed.
7436
7437 2012-06-22 Chong Yidong <cyd@gnu.org>
7438
7439 * xdisp.c (x_consider_frame_title): Revert last change.
7440
7441 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7442
7443 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7444 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7445 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7446 staticidx goes up to 1597 out of 1600 = 0x640.)
7447
7448 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7449
7450 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7451 Otherwise, the umask might be mistakenly 0 while handling input signals.
7452
7453 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7454
7455 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7456
7457 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7458
7459 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7460 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7461 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7462 access to `contents' member of Lisp_Vector objects with AREF and ASET
7463 where appropriate.
7464
7465 2012-06-19 Chong Yidong <cyd@gnu.org>
7466
7467 * frame.c (delete_frame): When selecting a frame on a different
7468 text terminal, do not alter the terminal's top-frame.
7469
7470 * xdisp.c (format_mode_line_unwind_data): Record the target
7471 frame's selected window and its terminal's top-frame.
7472 (unwind_format_mode_line): Restore them.
7473 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7474 Callers changed.
7475 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7476 since tty frames can be explicitly named.
7477 (prepare_menu_bars): Likewise.
7478
7479 * term.c (Ftty_top_frame): New function.
7480
7481 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7482
7483 Port byte-code-meter to modern targets.
7484 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7485 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7486 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7487 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7488 (METER_1, METER_2): Simplify.
7489
7490 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7491
7492 * data.c (Fdefalias): Return `symbol' (bug#11686).
7493
7494 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7495
7496 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7497 gets killed during executing of this function (Bug#11665).
7498 Try to always return Qt when the buffer has been actually killed.
7499 (Vkill_buffer_query_functions): In doc-string say that functions
7500 run by this hook should not change the current buffer.
7501
7502 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 Fix recently-introduced process.c problems found by static checking.
7505 * process.c (write_queue_push, write_queue_pop, send_process):
7506 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7507 (write_queue_pop): Fix pointer signedness problem.
7508 (send_process): Remove unused local.
7509
7510 2012-06-17 Chong Yidong <cyd@gnu.org>
7511
7512 * xdisp.c (redisplay_internal): No need to redisplay terminal
7513 frames that are not on top.
7514
7515 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7516
7517 * process.c (make_process): Initialize write_queue.
7518 (write_queue_push, write_queue_pop): New functions.
7519 (send_process): Use them to maintain correct ordering of process
7520 writes (Bug#10815).
7521
7522 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7523
7524 * lisp.h (eassert): Assume C89 or later.
7525 This removes the need for CHECK.
7526 (CHECK): Remove. Its comments about always evaluating its
7527 argument were confusing, as 'eassert' typically does not evaluate
7528 its argument.
7529
7530 * coding.c (produce_chars): Use ptrdiff_t, not int.
7531
7532 * xterm.c (x_draw_underwave): Check for integer overflow.
7533 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7534
7535 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7536
7537 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7538 referenced (Bug#11583).
7539
7540 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7541
7542 Implement wave-style variant of underlining.
7543 * dispextern.h (face_underline_type): New enum.
7544 (face): Add field for underline type.
7545 * nsterm.m (ns_draw_underwave): New function.
7546 (ns_draw_text_decoration): Use it.
7547 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7548 New functions.
7549 (x_draw_glyph_string): Use them.
7550 * xfaces.c (Qline, Qwave): New Lisp objects.
7551 (check_lface_attrs, merge_face_ref)
7552 (Finternal_set_lisp_face_attribute, realize_x_face):
7553 Handle wave-style underline face attributes.
7554 * xterm.c (x_draw_underwave): New function.
7555 (x_draw_glyph_string): Use it.
7556
7557 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7558
7559 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7560 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7561 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7562 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7563 ($(BLD)/w32select.$(O)): Update dependencies.
7564
7565 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7566
7567 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7568 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7569 * character.c (_fetch_multibyte_char_p): Remove.
7570 * alloc.c: Include "character.h" before "buffer.h".
7571 * bidi.c: Likewise.
7572 * buffer.c: Likewise.
7573 * bytecode.c: Likewise.
7574 * callint.c: Likewise.
7575 * callproc.c: Likewise.
7576 * casefiddle.c: Likewise.
7577 * casetab.c: Likewise.
7578 * category.c: Likewise.
7579 * cmds.c: Likewise.
7580 * coding.c: Likewise.
7581 * composite.c: Likewise.
7582 * dired.c: Likewise.
7583 * dispnew.c: Likewise.
7584 * doc.c: Likewise.
7585 * dosfns.c: Likewise.
7586 * editfns.c: Likewise.
7587 * emacs.c: Likewise.
7588 * fileio.c: Likewise.
7589 * filelock.c: Likewise.
7590 * font.c: Likewise.
7591 * fontset.c: Likewise.
7592 * fringe.c: Likewise.
7593 * indent.c: Likewise.
7594 * insdel.c: Likewise.
7595 * intervals.c: Likewise.
7596 * keyboard.c: Likewise.
7597 * keymap.c: Likewise.
7598 * lread.c: Likewise.
7599 * macros.c: Likewise.
7600 * marker.c: Likewise.
7601 * minibuf.c: Likewise.
7602 * nsfns.m: Likewise.
7603 * nsmenu.m: Likewise.
7604 * print.c: Likewise.
7605 * process.c: Likewise.
7606 * regex.c: Likewise.
7607 * region-cache.c: Likewise.
7608 * search.c: Likewise.
7609 * syntax.c: Likewise.
7610 * term.c: Likewise.
7611 * textprop.c: Likewise.
7612 * undo.c: Likewise.
7613 * unexsol.c: Likewise.
7614 * w16select.c: Likewise.
7615 * w32fns.c: Likewise.
7616 * w32menu.c: Likewise.
7617 * window.c: Likewise.
7618 * xdisp.c: Likewise.
7619 * xfns.c: Likewise.
7620 * xmenu.c: Likewise.
7621 * xml.c: Likewise.
7622 * xselect.c: Likewise.
7623
7624 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7625
7626 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7627 If all the glyphs of the glyph row came from strings, and we have no
7628 cursor positioning clues, put the cursor on the first glyph of the
7629 row.
7630 (handle_face_prop): Use chunk-relative overlay string index when
7631 indexing into it->string_overlays array. (Bug#11653)
7632 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7633 the rightmost. (Bug#11720)
7634
7635 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7636
7637 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7638 (CATEGORY_MEMBER): Enforce 1/0 value.
7639 * category.c (_temp_category_set): Remove.
7640
7641 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7642
7643 * window.c (Fdelete_other_windows_internal)
7644 (Fdelete_window_internal): Don't access frame's mouse highlight
7645 info of the initial frame. (Bug#11677)
7646
7647 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7648
7649 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7650 Assume USE_2_TAGS_FOR_INTS.
7651 (xreload): Adjust $tagmask width to match recent lisp.h change.
7652
7653 Simplify lisp.h in minor ways that should not affect code.
7654 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7655 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7656 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7657 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7658 (INTTYPEBITS): New macro, for clarity.
7659 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7660 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7661 Simplify now that USE_LSB_TAG is always defined.
7662 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7663 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7664
7665 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7666
7667 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7668
7669 2012-06-13 Glenn Morris <rgm@gnu.org>
7670
7671 * s/bsd-common.h (BSD4_3):
7672 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7673
7674 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7675
7676 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7677 instead of union.
7678 (XLI, XIL): Define.
7679 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7680 Use them.
7681 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7682 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7683 * alloc.c (widen_to_Lisp_Object): Remove.
7684 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7685 * frame.c (delete_frame): Remove outdated comment.
7686 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7687 USE_LISP_UNION_TYPE.
7688 (Fw32_unregister_hot_key): Likewise.
7689 (Fw32_toggle_lock_key): Likewise.
7690 * w32menu.c (add_menu_item): Likewise.
7691 (w32_menu_display_help): Use XIL instead of checking
7692 USE_LISP_UNION_TYPE.
7693 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7694 (init_heap): Likewise.
7695 * w32term.c (w32_read_socket): Update comment.
7696
7697 2012-06-13 Glenn Morris <rgm@gnu.org>
7698
7699 * s/usg5-4-common.h, src/s/unixware.h:
7700 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7701
7702 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7703
7704 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7705
7706 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7707 * alloc.c (make_number) [!defined make_number]:
7708 Remove, as lisp.h always defines this now.
7709 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7710 (roundup_size): Verify that it is a power of 2.
7711 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7712 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7713 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7714 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7715 USE_LSB_TAG now is always defined to be either 0 or 1.
7716 All uses changed.
7717 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7718 code works fine either way, and efficiency is not a concern here,
7719 as the union type is for debugging, not for production.
7720 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7721 Use an inline function on all platforms when using the union type,
7722 since this is simpler and 'static inline' can be used portably
7723 within Emacs now.
7724 (LISP_INITIALLY_ZERO): New macro.
7725 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7726 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7727
7728 2012-06-12 Glenn Morris <rgm@gnu.org>
7729
7730 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7731
7732 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7733
7734 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7735 Move BROKEN_SIGIO to configure.
7736
7737 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7738 Move NO_TERMIO to configure.
7739
7740 2012-06-12 Chong Yidong <cyd@gnu.org>
7741
7742 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7743 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7744 MagickExportImagePixels is undefined.
7745
7746 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7747
7748 * image.c (imagemagick_load_image): Remove unused label.
7749
7750 2012-06-11 Glenn Morris <rgm@gnu.org>
7751
7752 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7753 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7754 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7755 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7756
7757 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7758
7759 * alloc.c (make_byte_code): New function.
7760 (Fmake_byte_code): Use it. Don't purify here.
7761 * lread.c (read1): Use it as well to avoid extra allocation.
7762
7763 2012-06-11 Chong Yidong <cyd@gnu.org>
7764
7765 * image.c (imagemagick_load_image): Implement transparency.
7766
7767 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7768
7769 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7770 account for preceding backslashes. (Bug#11663)
7771
7772 2012-06-09 Chong Yidong <cyd@gnu.org>
7773
7774 * term.c: Support italics in capable terminals (Bug#9652).
7775 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7776 (turn_on_face): Output using TS_enter_italic_mode if available.
7777 Don't handle unused blinking and alt-charset cases.
7778 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7779 and tty_alt_charset_p cases.
7780 (tty_capable_p, init_tty): Support italics.
7781
7782 * termchar.h (struct tty_display_info): Add field for italics.
7783 Remove unused blink field.
7784
7785 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7786 Handle slant.
7787
7788 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7789 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7790 tty_alt_charset_p. Add tty_italic_p.
7791
7792 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7793
7794 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7795 dbus_type_is_basic if available.
7796 (xd_extract_signed, xd_extract_unsigned): Rename from
7797 extract_signed and extract_unsigned, respectively. Adapt callers.
7798
7799 2012-06-09 Chong Yidong <cyd@gnu.org>
7800
7801 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7802
7803 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7804 case (Bug#9752).
7805
7806 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7807
7808 * xdisp.c (vmessage): Treat frame message as multibyte.
7809 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7810 would generate the diagnostic "Making \302\247 buffer-local while
7811 let-bound!".
7812
7813 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7814
7815 * dispnew.c (showing_window_margins_p): Undo last change, which
7816 was done due to an inadvertent commit.
7817 (adjust_frame_glyphs_for_frame_redisplay): Do call
7818 showing_window_margins_p.
7819
7820 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7821
7822 * eval.c (Fmake_var_non_special): New primitive.
7823 (syms_of_eval): Defsubr it.
7824 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7825
7826 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7827
7828 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7829 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7830
7831 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7832
7833 * alloc.c (allocate_vectorlike): Fix last change.
7834
7835 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7836
7837 Block-based vector allocation of small vectors.
7838 * lisp.h (struct vectorlike_header): New field `nbytes',
7839 adjust comment accordingly.
7840 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7841 to denote vector blocks. Adjust users (live_vector_p,
7842 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7843 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7844 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7845 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7846 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7847 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7848 (roundup_size): New constant.
7849 (struct vector_block): New data type.
7850 (vector_blocks, vector_free_lists, zero_vector): New variables.
7851 (all_vectors): Rename to `large_vectors'.
7852 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7853 (sweep_vectors): New functions.
7854 (allocate_vectorlike): Return `zero_vector' as the only vector of
7855 0 items. Allocate new vector from block if vector size is less than
7856 or equal to VBLOCK_BYTES_MAX.
7857 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7858 (init_alloc_once): Add call to init_vectors.
7859
7860 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7861
7862 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7863
7864 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7865
7866 * doprnt.c (doprnt): Truncate multibyte char correctly.
7867 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7868 would mishandle a string argument "Xc" if X was a multibyte
7869 character of length 2: it would truncate after X's first byte
7870 rather than including all of X.
7871
7872 2012-06-06 Chong Yidong <cyd@gnu.org>
7873
7874 * buffer.c (word_wrap): Doc fix.
7875
7876 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7877
7878 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7879
7880 2012-06-03 Glenn Morris <rgm@gnu.org>
7881
7882 * xdisp.c (tool-bar-style): Doc fix.
7883
7884 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7885
7886 * Makefile.in (PAXCTL): Define.
7887 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7888 binary via PaX flags if the paxctl utility is available.
7889 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7890 Restore PaX flags to their default. (Bug#11398)
7891
7892 2012-06-03 Chong Yidong <cyd@gnu.org>
7893
7894 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7895 buffer (Bug#11226).
7896
7897 2012-06-03 Chong Yidong <cyd@gnu.org>
7898
7899 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7900 (note_mode_line_or_margin_highlight): If there is no help echo,
7901 use mode-line-default-help-echo. Handle the case where the mouse
7902 position is past the end of the mode line string.
7903
7904 * buffer.c (buffer_local_value_1): New function, split from
7905 Fbuffer_local_value; can return Qunbound.
7906 (Fbuffer_local_value): Use it.
7907 (Vmode_line_format): Docstring tweaks.
7908
7909 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7910
7911 * sysdep.c (system_process_attributes): Improve comment.
7912
7913 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7914
7915 * keyboard.c: Export real-this-command to Elisp.
7916 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7917 and DEFVAR it. Update all users.
7918
7919 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7920
7921 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7922
7923 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7924 Convert pctcpu and pctmem to Lisp float properly.
7925 Let the compiler fold better, as 100.0/0x8000 is exact.
7926
7927 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7928
7929 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7930 cons_block.
7931
7932 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7933
7934 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7935
7936 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7937
7938 For a 'struct window', replace some Lisp_Object fields to
7939 bitfields where appropriate, remove unused fields.
7940 * window.h (struct window): Remove unused 'last_mark_x' and
7941 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7942 change its type from Lisp_Object to bitfield.
7943 Change type of 'force_start', 'optional_new_start',
7944 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7945 fields from Lisp_Object to bitfield. Adjust users accordingly.
7946
7947 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7948
7949 Pacify gcc -Wdouble-precision when using Xaw.
7950 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7951 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7952 Use 'float' consistently, rather than 'float' in most places
7953 and 'double' in a couple of places.
7954
7955 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7956
7957 * xdisp.c (handle_stop): Detect whether we have overlay strings
7958 loaded by testing it->current.overlay_string_index to be
7959 non-negative, instead of checking whether n_overlay_strings is
7960 positive. (Bug#11587)
7961
7962 2012-05-31 Chong Yidong <cyd@gnu.org>
7963
7964 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7965
7966 * doc.c (Fsubstitute_command_keys): Doc fix.
7967
7968 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7969
7970 * search.c (search_buffer): Remove calls to
7971 r_alloc_inhibit_buffer_relocation, as it is now called by
7972 maybe_unify_char, which was the cause of relocation of buffer text
7973 in bug#11519.
7974
7975 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7976
7977 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7978 for the duration of call to load_charset, to avoid problems with
7979 callers of maybe_unify_char that access buffer text through C
7980 pointers.
7981
7982 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7983 decrement the inhibition flag, instead of just setting or
7984 resetting it.
7985
7986 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7987
7988 Remove obsolete '#define static' cruft.
7989 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7990 This #undef was "temporary" in 2000; it is no longer needed
7991 now that '#define static' has gone away.
7992 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7993 (gray_bitmap_bits): Remove; no longer needed.
7994 All uses replaced with definiens.
7995 * xterm.c: Include "bitmaps/gray.xbm".
7996
7997 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7998
7999 Clean up __executable_start, monstartup when --enable-profiling.
8000 The following changes affect the code only when profiling.
8001 * dispnew.c (__executable_start): Rename from safe_bcopy.
8002 Define only on platforms that need it.
8003 * emacs.c: Include <sys/gmon.h> when profiling.
8004 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8005 (__executable_start): Remove decl, since lisp.h does it now.
8006 (safe_bcopy): Remove decl; no longer has that name.
8007 (main): Coalesce #if into single bit of code, for simplicity.
8008 Cast pointers to uintptr_t, since standard libraries want integers
8009 and not pointers.
8010 * lisp.h (__executable_start): New decl.
8011
8012 2012-05-31 Glenn Morris <rgm@gnu.org>
8013
8014 * image.c (Fimagemagick_types): Doc fix.
8015
8016 2012-05-30 Jim Meyering <meyering@redhat.com>
8017
8018 * callproc.c (Fcall_process_region): Include directory component
8019 in mkstemp error message (Bug#11586).
8020
8021 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8022
8023 * alloc.c, lisp.h (make_pure_vector): Now static.
8024
8025 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8026
8027 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8028 Move to byte-run.el.
8029 (Fautoload): Do the hash-doc more carefully.
8030 * data.c (Fdefalias): Purify definition, except for keymaps.
8031 (Qdefun): Move from eval.c.
8032 * lisp.h (Qdefun): Remove.
8033 * lread.c (read1): Tiny simplification.
8034
8035 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8036
8037 Do not create empty overlays with the evaporate property (Bug#9642).
8038 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8039 Bug#9642, but explicitly check that the buffer the overlay would
8040 be moved to is live and rearrange lines to make sure that errors
8041 will not put the overlay in an inconsistent state.
8042 (Fdelete_overlay): Cosmetics.
8043
8044 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8045
8046 * w32term.c (my_bring_window_to_top): New function.
8047 (x_raise_frame): Use handle returned by DeferWindowPos, which
8048 could be different from the original one.
8049 Call my_bring_window_to_top instead of my_set_foreground_window.
8050 (Bug#11513)
8051
8052 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8053 by calling BringWindowToTop.
8054
8055 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8056 (WM_EMACS_END): Increase by one.
8057
8058 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8059
8060 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8061 This avoids undefined behavior that might cause the eassert
8062 to not catch an out-of-range value.
8063
8064 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8065
8066 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8067 Update dependencies.
8068
8069 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8070
8071 * bidi.c (bidi_mirror_char): Fix last change.
8072
8073 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8074
8075 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8076 when referring to sectname field in printf format.
8077
8078 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8079
8080 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8081 Only r_alloc_inhibit_buffer_relocation needed to be added;
8082 the others were already declared.
8083
8084 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8085 before checking whether it's out of range. Put the check inside
8086 eassert. See
8087 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8088
8089 2012-05-27 Ken Brown <kbrown@cornell.edu>
8090
8091 * callproc.c (Fcall_process): Restore a line that was accidentally
8092 commented out in the 2011-02-13 change (bug#11547).
8093
8094 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8095
8096 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8097 defined on ralloc.c.
8098
8099 * buffer.c [REL_ALLOC]: Remove prototypes of
8100 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8101 they are now on lisp.h.
8102
8103 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8104
8105 * search.c (search_buffer): Use it to inhibit relocation of buffer
8106 text while re_search_2 is doing its job, because re_search_2 is
8107 passed C pointers to buffer text. (Bug#11519)
8108
8109 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8110 Update value to 24.
8111
8112 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8113 state after an additional call to move_it_in_display_line_to, keep
8114 the values of it->max_ascent and it->max_descent found for the
8115 entire line.
8116 (pos_visible_p): Revert the comparison against bottom_y to what it
8117 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8118 (Bug#11464)
8119
8120 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8121
8122 Fix coding-related core dumps with gcc -ftrapv.
8123 The code was computing A - B, where A and B are pointers, and B is
8124 random garbage. This can lead to core dumps on platforms that
8125 have special pointer registers, and it also leads to core dumps on
8126 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8127 A - B only when B is initialized properly.
8128 * coding.c (coding_set_source, coding_set_destination): Return void.
8129 (coding_change_source, coding_change_destinations): New functions,
8130 with the old behaviors of coding_set_source and coding_set_destination.
8131 All callers that need an offset changed to use these new functions.
8132
8133 2012-05-26 Glenn Morris <rgm@gnu.org>
8134
8135 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8136
8137 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8138
8139 Extend mouse support on W32 text-mode console.
8140 * xdisp.c (draw_row_with_mouse_face):
8141 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8142
8143 * w32console.c: Include window.h.
8144 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8145 New functions.
8146 (initialize_w32_display): Initialize mouse-highlight data.
8147
8148 * w32inevt.c: Include termchar.h and window.h.
8149 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8150 moves, call note_mouse_highlight. If help_echo changed, call
8151 gen_help_event to produce help-echo message in the echo area.
8152 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8153 highlight info.
8154
8155 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8156
8157 * lread.c (read1): Simplify slightly to avoid an overflow warning
8158 with GCC 4.7.0 on x86-64.
8159
8160 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8161
8162 * bidi.c (bidi_mirror_char): Revert last change: an int is
8163 definitely wide enough here.
8164
8165 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8166
8167 Fix integer width and related bugs (Bug#9874).
8168 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8169 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8170 (string_bytes, check_sblock, allocate_string_data):
8171 (compact_small_strings, Fmake_bool_vector, make_string)
8172 (make_unibyte_string, make_multibyte_string)
8173 (make_string_from_bytes, make_specified_string)
8174 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8175 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8176 (mark_vectorlike):
8177 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8178 (allocate_pseudovector):
8179 Use int, not EMACS_INT, where int is wide enough.
8180 (inhibit_garbage_collection, Fgarbage_collect):
8181 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8182 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8183 int might not be wide enough.
8184 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8185 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8186 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8187 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8188 (bidi_level_of_next_char, bidi_move_to_visually_next):
8189 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8190 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8191 (Fkill_buffer, Fset_buffer_major_mode)
8192 (advance_to_char_boundary, Fbuffer_swap_text)
8193 (Fset_buffer_multibyte, overlays_at, overlays_in)
8194 (overlay_touches_p, struct sortvec, record_overlay_string)
8195 (overlay_strings, recenter_overlay_lists)
8196 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8197 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8198 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8199 (Foverlay_recenter, last_overlay_modification_hooks_used)
8200 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8201 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8202 (validate_region): Omit unnecessary test for b <= e,
8203 since that's guaranteed by the previous test.
8204 (adjust_overlays_for_delete): Avoid pos + length overflow.
8205 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8206 (report_overlay_modification):
8207 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8208 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8209 Omit pointer cast, which isn't needed anyway, and doesn't work
8210 after the EMACS_INT -> ptrdiff_t change.
8211 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8212 * buffer.h: Adjust decls to match defn changes elsewhere.
8213 (struct buffer_text, struct buffer):
8214 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8215 Use EMACS_INT, not int, where int might not be wide enough.
8216 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8217 not int, to avoid needless 32-bit limit on 64-bit hosts.
8218 (exec_byte_code): Use tighter memory-full test, one that checks
8219 for alloca overflow. Don't compute the address of the object just
8220 before an array, as that's not portable. Use EMACS_INT, not
8221 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8222 * callint.c (Fcall_interactively):
8223 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8224 * callproc.c (call_process_kill, Fcall_process):
8225 Don't assume pid_t fits into an Emacs fixnum.
8226 (call_process_cleanup, Fcall_process, child_setup):
8227 Don't assume pid_t fits into int.
8228 (call_process_cleanup, Fcall_process, delete_temp_file)
8229 (Fcall_process_region):
8230 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8231 (Fcall_process): Simplify handling of volatile integers.
8232 Use int, not EMACS_INT, where int will do.
8233 * casefiddle.c (casify_object, casify_region, operate_on_word)
8234 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8236 (casify_object): Avoid integer overflow when overallocating buffer.
8237 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8238 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8239 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8240 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8241 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8242 integers are now checked earlier. All uses replaced with XINT.
8243 (ccl_driver):
8244 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8245 For CCL_MapSingle, check that content and value are in int range.
8246 (ccl_driver, Fregister_code_conversion_map):
8247 Check that Vcode_version_map_vector is a vector.
8248 (resolve_symbol_ccl_program): Check that vector header is in range.
8249 Always copy the vector, so that we can check its contents reliably
8250 now rather than having to recheck each instruction as it's being
8251 executed. Check that vector words fit in 'int'.
8252 (ccl_get_compiled_code, Fregister_ccl_program)
8253 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8254 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8255 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8256 contents are in range.
8257 (Fccl_execute_on_string): Check that status is in range.
8258 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8259 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8260 Accept and return EMACS_INT, not int, because callers can pass values
8261 out of 'int' range.
8262 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8263 (multibyte_chars_in_text, parse_str_as_multibyte)
8264 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8265 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8266 (string_escape_byte8, Fget_byte):
8267 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8268 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8269 avoid mishandling large integers.
8270 * character.h: Adjust decls to match defn changes elsewhere.
8271 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8272 (Ffind_charset_region):
8273 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8274 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8275 (load_charset_map_from_vector, Fdefine_charset_internal):
8276 Don't assume fixnum fits in int.
8277 (load_charset_map_from_vector, Fmap_charset_chars):
8278 Remove now-unnecessary CHECK_NATNUMs.
8279 (Fdefine_charset_internal): Check ranges here, more carefully.
8280 Don't rely on undefined behavior with signed left shift overflow.
8281 Don't assume unsigned int fits into fixnum, or that fixnum fits
8282 into unsigned int. Don't require max_code to be a valid fixnum;
8283 that's not true for gb10830 4-byte on a 32-bit host. Allow
8284 invalid_code to be a cons, for the same reason. Require code_offset
8285 to be a character. Avoid int overflow if max_char is close
8286 to INT_MAX.
8287 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8288 this is intended anyway and avoids some undefined behavior.
8289 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8290 INDEX_TO_CODE_POINT, as that's what it expects.
8291 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8292 * charset.h (DECODE_CHAR): Return int, not unsigned;
8293 this is what was intended anyway, and it avoids undefined behavior.
8294 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8295 integer-overflow issues.
8296 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8297 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8298 where the argument is EMACS_INT, and this behavior is not intended.
8299 * chartab.c (Fmake_char_table, Fset_char_table_range)
8300 (uniprop_get_decoder, uniprop_get_encoder):
8301 Don't assume fixnum fits in int.
8302 * cmds.c (move_point): New function, that does the gist of
8303 Fforward_char and Fbackward_char, but does so while checking
8304 for integer overflow more accurately.
8305 (Fforward_char, Fbackward_char): Use it.
8306 (Fforward_line, Fend_of_line, internal_self_insert)
8307 (internal_self_insert):
8308 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8309 Fix a FIXME, by checking for integer overflow when calculating
8310 target_clm and actual_clm.
8311 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8312 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8313 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8314 (coding_alloc_by_making_gap, alloc_destination)
8315 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8316 (encode_coding_utf_16, detect_coding_emacs_mule)
8317 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8318 (detect_coding_iso_2022, decode_coding_iso_2022)
8319 (encode_invocation_designation, encode_designation_at_bol)
8320 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8321 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8322 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8323 (encode_coding_ccl, encode_coding_raw_text)
8324 (detect_coding_charset, decode_coding_charset)
8325 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8326 (produce_composition, produce_charset, produce_annotation)
8327 (decode_coding, handle_composition_annotation)
8328 (handle_charset_annotation, consume_chars, decode_coding_gap)
8329 (decode_coding_object, encode_coding_object, detect_coding_system)
8330 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8331 (code_convert_region, code_convert_string)
8332 (Fdefine_coding_system_internal)
8333 (coding_set_source, coding_set_destination):
8334 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8335 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8336 (Fdefine_coding_system_internal):
8337 Don't assume fixnums fit in int.
8338 (decode_coding_gap, decode_coding_object, encode_coding_object)
8339 (Fread_coding_system, Fdetect_coding_region)
8340 (Funencodable_char_position, Fcheck_coding_systems_region)
8341 (get_translation, handle_composition_annotation, consume_chars):
8342 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8343 (consume_chars): Rewrite to not calculate an address outside buffer.
8344 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8345 Don't access memory outside of the args array.
8346 (Fdefine_coding_system_internal): Check for charset-id overflow.
8347 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8348 result of ENCODE_CHAR.
8349 * coding.h: Adjust decls to match defn changes elsewhere.
8350 (struct coding_system):
8351 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8352 * composite.c (get_composition_id, find_composition)
8353 (run_composition_function, update_compositions)
8354 (compose_text, composition_gstring_put_cache)
8355 (composition_gstring_p, composition_gstring_width)
8356 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8357 (composition_compute_stop_pos, composition_reseat_it)
8358 (composition_update_it, struct position_record)
8359 (find_automatic_composition, composition_adjust_point)
8360 (Fcomposition_get_gstring, Ffind_composition_internal):
8361 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8362 (update_compositions):
8363 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8364 * composite.h: Adjust decls to match defn changes elsewhere.
8365 (struct composition):
8366 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8367 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8368 Do not attempt to compute the address of the object just before a
8369 buffer; this is not portable.
8370 (Faref, Faset):
8371 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8372 (Faset): Use int, not EMACS_INT, where int is wide enough.
8373 (Fstring_to_number): Don't assume fixnums fit in int.
8374 (Frem): Don't assume arg is nonnegative.
8375 * dbusbind.c (xd_append_arg): Check for integers out of range.
8376 (Fdbus_call_method): Don't overflow the timeout int.
8377 (extract_signed, extract_unsigned): New functions.
8378 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8379 (xd_get_connection_references): Return ptrdiff_t, not int.
8380 All uses changed.
8381 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8382 (xd_read_message_1):
8383 Use int, not unsigned, where the dbus API uses int.
8384 (Fdbus_message_internal): Don't overflow mtype.
8385 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8386 * dired.c (directory_files_internal, file_name_completion, scmp)
8387 (file_name_completion_stat):
8388 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8389 (file_name_completion): Don't overflow matchcount.
8390 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8391 * dispextern.h: Adjust decls to match defn changes elsewhere.
8392 (struct text_pos, struct glyph, struct bidi_saved_info)
8393 (struct bidi_string_data, struct bidi_it, struct composition_it)
8394 (struct it):
8395 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8396 (struct display_pos, struct composition_it, struct it):
8397 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8398 * dispnew.c (increment_matrix_positions)
8399 (increment_row_positions, mode_line_string)
8400 (marginal_area_string):
8401 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8402 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8403 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8404 (duration_to_sec_usec): New function, to check for overflow better.
8405 (Fsleep_for, sit_for): Use it.
8406 * doc.c (get_doc_string, store_function_docstring):
8407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8408 (get_doc_string, Fsnarf_documentation):
8409 Use int, not EMACS_INT, where int is wide enough.
8410 (get_doc_string):
8411 Use SAFE_ALLOCA, not alloca.
8412 Check for overflow when converting EMACS_INT to off_t.
8413 * doprnt.c (doprnt):
8414 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8415 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8416 Don't assume uid_t fits into fixnum.
8417 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8418 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8419 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8420 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8421 (general_insert_function)
8422 (Finsert_char, make_buffer_string, make_buffer_string_both)
8423 (update_buffer_properties, Fbuffer_substring)
8424 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8425 (Fsubst_char_in_region, check_translation)
8426 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8427 (transpose_markers, Ftranspose_regions):
8428 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8429 (clip_to_bounds): Move to lisp.h as an inline function).
8430 (Fconstrain_to_field): Don't assume integers are nonnegative.
8431 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8432 (Fsubst_char_in_region, Fsave_restriction):
8433 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8434 (Femacs_pid): Don't assume pid_t fits into fixnum.
8435 (lo_time): Use int, not EMACS_INT, when int suffices.
8436 (lisp_time_argument): Check for usec out of range.
8437 (Fencode_time): Don't assume fixnum fits in int.
8438 (Fuser_login_name, Fuser_full_name): Signal an error
8439 if a uid argument is out of range, rather than relying on
8440 undefined behavior.
8441 (Fformat_time_string): Remove now-unnecessary check.
8442 lisp_time_argument checks for out-of-range usec now.
8443 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8444 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8445 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8446 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8447 (init_cmdargs, Fdump_emacs):
8448 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8449 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8450 the bottom (typically) 32 bits of the fixnum.
8451 * eval.c (specpdl_size, call_debugger):
8452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8453 (when_entered_debugger, Fbacktrace_debug):
8454 Don't assume fixnum can fit in int.
8455 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8456 the object just before a buffer; this is not portable.
8457 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8458 (grow_specpdl, unbind_to):
8459 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8460 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8461 (grow_specpdl): Simplify allocation by using xpalloc.
8462 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8463 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8464 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8465 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8466 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8467 (a_write, e_write):
8468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8469 (Fcopy_file, non_regular_nbytes, read_non_regular)
8470 (Finsert_file_contents):
8471 Use int, not EMACS_INT, where int is wide enough.
8472 (READ_BUF_SIZE): Verify that it fits in int.
8473 (Finsert_file_contents): Check that counts are in proper range,
8474 rather than assuming fixnums fit into ptrdiff_t etc.
8475 Don't assume fixnums fit into int.
8476 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8477 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8478 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8479 (string_char_to_byte, string_byte_to_char)
8480 (string_make_multibyte, string_to_multibyte)
8481 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8482 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8483 (substring_both, Fdelete, internal_equal, Ffillarray)
8484 (Fclear_string, mapcar1)
8485 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8486 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8487 (larger_vector, make_hash_table, maybe_resize_hash_table)
8488 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8489 (Fmaphash, secure_hash):
8490 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8491 (concat): Check for string index and length overflow.
8492 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8493 (Frequire):
8494 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8495 (larger_vector): New API (vec, incr_min, size_max) replaces old
8496 one (vec, new_size, init). This catches size overflow.
8497 INIT was removed because it was always Qnil.
8498 All callers changed.
8499 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8500 the upper bound on a hash table index size.
8501 (make_hash_table, maybe_resize_hash_table): Use it.
8502 (secure_hash): Computer start_byte and end_byte only after
8503 they're known to be in ptrdiff_t range.
8504 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8505 (Ffont_get_glyphs, Ffont_at):
8506 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8507 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8508 (Flist_fonts, Fopen_font):
8509 Don't assume fixnum can fit in int.
8510 (check_gstring): Don't assume index can fit in int.
8511 (font_match_p): Check that fixnum is a character, not a nonnegative
8512 fixnum, since the later code needs to stuff it into an int.
8513 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8514 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8515 conversion overflow issues.
8516 (Fopen_font): Check for integer out of range.
8517 (Ffont_get_glyphs): Don't assume index can fit in int.
8518 * font.h: Adjust decls to match defn changes elsewhere.
8519 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8520 integer overflow.
8521 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8522 printmax_t, where ptrdiff_t is wide enough.
8523 (Finternal_char_font):
8524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8525 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8526 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8527 (Fset_frame_position, x_set_frame_parameters)
8528 (x_set_line_spacing, x_set_border_width)
8529 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8530 Check that fixnums are in proper range for system types.
8531 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8532 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8533 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8534 Use SAFE_ALLOCA_LISP, not alloca.
8535 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8536 intptr_t is wide enough.
8537 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8538 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8539 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8540 Check for fixnum out of range.
8541 * ftfont.c (ftfont_list): Don't assume index fits in int.
8542 Check that fixnums are in proper range for system types.
8543 (ftfont_shape_by_flt):
8544 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8545 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8546 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8547 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8548 Check that fixnums are in proper range for system types.
8549 * gnutls.h: Adjust decls to match defn changes elsewhere.
8550 * gtkutil.c (xg_dialog_run):
8551 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8552 (update_frame_tool_bar):
8553 Check that fixnums are in proper range for system types.
8554 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8555 (lookup_image): Check that fixnums are in range for system types.
8556 * indent.c (last_known_column, last_known_column_point):
8557 (current_column_bol_cache):
8558 (skip_invisible, current_column, check_display_width):
8559 (check_display_width, scan_for_column, current_column_1)
8560 (Findent_to, Fcurrent_indentation, position_indentation)
8561 (indented_beyond_p, Fmove_to_column, compute_motion):
8562 (Fcompute_motion, Fvertical_motion):
8563 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8564 (last_known_column_modified): Use EMACS_INT, not int.
8565 (check_display_width):
8566 (Fcompute_motion):
8567 Check that fixnums and floats are in proper range for system types.
8568 (compute_motion): Don't assume index or fixnum fits in int.
8569 (compute_motion, Fcompute_motion):
8570 Use int, not EMACS_INT, when it is wide enough.
8571 (vmotion): Omit local var start_hpos that is always 0; that way
8572 we don't need to worry about overflow in expressions involving it.
8573 * indent.h: Adjust decls to match defn changes elsewhere.
8574 (struct position):
8575 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8576 Use int, not EMACS_INT, where int is wide enough.
8577 Remove unused members ovstring_chars_done and tab_offset;
8578 all uses removed.
8579 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8580 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8581 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8582 (make_gap, copy_text, insert, insert_and_inherit)
8583 (insert_before_markers, insert_before_markers_and_inherit)
8584 (insert_1, count_combining_before, count_combining_after)
8585 (insert_1_both, insert_from_string)
8586 (insert_from_string_before_markers, insert_from_string_1)
8587 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8588 (adjust_after_replace, adjust_after_insert, replace_range)
8589 (replace_range_2, del_range, del_range_1, del_range_byte)
8590 (del_range_both, del_range_2, modify_region)
8591 (prepare_to_modify_buffer, signal_before_change)
8592 (signal_after_change, Fcombine_after_change_execute):
8593 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8594 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8595 (balance_an_interval, split_interval_right, split_interval_left)
8596 (find_interval, next_interval, update_interval)
8597 (adjust_intervals_for_insertion, delete_node, delete_interval)
8598 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8599 (static_offset_intervals, offset_intervals)
8600 (merge_interval_right, merge_interval_left, make_new_interval)
8601 (graft_intervals_into_buffer, temp_set_point_both)
8602 (temp_set_point, set_point, adjust_for_invis_intang)
8603 (set_point_both, move_if_not_intangible, get_property_and_range)
8604 (get_local_map, copy_intervals, copy_intervals_to_string)
8605 (compare_string_intervals, set_intervals_multibyte_1):
8606 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8607 * intervals.h: Adjust decls to match defn changes elsewhere.
8608 (struct interval):
8609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8610 * keyboard.c (this_command_key_count, this_single_command_key_start)
8611 (before_command_key_count, before_command_echo_length, echo_now)
8612 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8613 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8614 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8615 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8616 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8617 (last_non_minibuf_size, last_point_position, echo_truncate)
8618 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8619 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8620 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8621 (stuff_buffered_input):
8622 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8623 (last_auto_save, command_loop_1, read_char):
8624 Use EMACS_INT, not int, to avoid integer overflow.
8625 (record_char): Avoid overflow in total_keys computation.
8626 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8627 * keyboard.h: Adjust decls to match defn changes elsewhere.
8628 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8629 (Fkey_description, Fdescribe_vector, Flookup_key):
8630 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8631 (click_position): New function, to check that positions are in range.
8632 (Fcurrent_active_maps):
8633 (describe_command):
8634 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8635 (Faccessible_keymaps, Fkey_description):
8636 (preferred_sequence_p):
8637 Don't assume fixnum can fit into int.
8638 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8639 Check for integer overflow in size calculations.
8640 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8641 avoid mishandling large integers.
8642 * lisp.h: Adjust decls to match defn changes elsewhere.
8643 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8644 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8645 (struct Lisp_Marker):
8646 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8647 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8648 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8649 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8650 All callers changed.
8651 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8652 Assume the arg has valid form, since it always does.
8653 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8654 unsigned integer system type.
8655 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8656 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8658 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8659 (duration_to_sec_usec): New decl.
8660 * lread.c (read_from_string_index, read_from_string_index_byte)
8661 (read_from_string_limit, readchar, unreadchar, openp)
8662 (read_internal_start, read1, oblookup):
8663 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8664 (Fload, readevalloop, Feval_buffer, Feval_region):
8665 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8666 (openp): Check for out-of-range argument to 'access'.
8667 (read1): Use int, not EMACS_INT, where int is wide enough.
8668 Don't assume fixnum fits into int.
8669 Fix off-by-one error that can read outside a buffer.
8670 (read_filtered_event): Use duration_to_sec_usec
8671 to do proper overflow checking on durations.
8672 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8673 in size calculation.
8674 (Fexecute_kbd_macro):
8675 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8676 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8677 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8678 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8679 (set_marker_both, set_marker_restricted_both, marker_position)
8680 (marker_byte_position, Fbuffer_has_markers_at):
8681 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8682 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8683 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8684 It now merely ensures that the menu is large enough, without
8685 necessarily growing it, as this avoids some integer overflow issues.
8686 All callers changed.
8687 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8688 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8689 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8690 Use SAFE_ALLOCA_LISP, not alloca.
8691 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8692 to EMACS_INT. Check that fixnums are in proper range for system types.
8693 * minibuf.c (minibuf_prompt_width, string_to_object)
8694 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8695 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8697 (get_minibuffer, read_minibuf_unwind):
8698 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8699 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8700 this simplifies overflow checking. All callers changed.
8701 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8702 (Ftest_completion):
8703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8704 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8705 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8706 Check that fixnums are in proper range for system types.
8707 (Fx_create_frame, Fx_show_tip):
8708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8709 * nsfont.m (ns_findfonts, nsfont_list_family):
8710 Don't assume fixnum fits in long.
8711 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8712 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8713 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8714 wide enough.
8715 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8716 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8717 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8718 (PRINTDECLARE, PRINTPREPARE):
8719 (strout, print_string):
8720 (print, print_preprocess, print_check_string_charset_prop)
8721 (print_object):
8722 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8723 (PRINTDECLARE):
8724 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8725 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8726 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8727 (printchar, strout): Use xpalloc to catch size calculation overflow.
8728 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8729 (print_error_message): Use SAFE_ALLOCA, not alloca.
8730 (print_object): Use int, not EMACS_INT, where int is wide enough.
8731 (print_depth, new_backquote_output, print_number_index):
8732 Use ptrdiff_t, not int, where int might not be wide enough.
8733 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8734 (Fset_process_window_size, Fformat_network_address)
8735 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8736 (sigchld_handler):
8737 Check that fixnums are in proper range for system types.
8738 (Fsignal_process): Simplify by avoiding a goto.
8739 Check for process-ids out of pid_t range rather than relying on
8740 undefined behavior.
8741 (process_tick, update_tick): Use EMACS_INT, not int.
8742 (Fformat_network_address, read_process_output, send_process)
8743 (Fprocess_send_region, status_notify):
8744 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8745 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8746 (wait_reading_process_output, read_process_output, exec_sentinel):
8747 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8748 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8749 (Faccept_process_output): Use duration_to_sec_usec to do proper
8750 overflow checking on durations.
8751 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8752 Don't assume pid_t fits in int.
8753 * process.h (struct Lisp_Process): Members tick and update_tick
8754 are now of type EMACS_INT, not int.
8755 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8756 configured --with-wide-int.
8757 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8758 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8759 * search.c (looking_at_1, string_match_1):
8760 (fast_string_match, fast_c_string_match_ignore_case)
8761 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8762 (scan_newline, find_before_next_newline, search_command)
8763 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8764 (set_search_regs, wordify):
8765 (Freplace_match):
8766 (Fmatch_data):
8767 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8768 (string_match_1, search_buffer, set_search_regs):
8769 (Fmatch_data):
8770 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8771 (wordify): Check for overflow in size calculation.
8772 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8773 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8774 Check that fixnums are in proper range for system types.
8775 * sound.c (struct sound_device)
8776 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8778 (Fplay_sound_internal):
8779 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8780 * syntax.c (struct lisp_parse_state, find_start_modiff)
8781 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8782 (Fparse_partial_sexp):
8783 Don't assume fixnums can fit in int.
8784 (struct lisp_parse_state, find_start_pos, find_start_value)
8785 (find_start_value_byte, find_start_begv)
8786 (update_syntax_table, char_quoted, dec_bytepos)
8787 (find_defun_start, prev_char_comend_first, back_comment):
8788 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8789 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8791 (Finternal_describe_syntax_value): Check that match_lisp is a
8792 character, not an integer, since the code stuffs it into int.
8793 (scan_words, scan_sexps_forward):
8794 Check that fixnums are in proper range for system types.
8795 (Fforward_word):
8796 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8797 (scan_sexps_forward):
8798 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8799 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8800 * syntax.h: Adjust decls to match defn changes elsewhere.
8801 (struct gl_state_s):
8802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8803 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8804 MOST_POSITIVE_FIXNUM.
8805 * sysdep.c (wait_for_termination_1, wait_for_termination)
8806 (interruptible_wait_for_termination, mkdir):
8807 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8808 (emacs_read, emacs_write):
8809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8810 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8811 and double all fit in int.
8812 * term.c (set_tty_color_mode):
8813 Check that fixnums are in proper range for system types.
8814 * termhooks.h (struct input_event):
8815 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8816 * textprop.c (validate_interval_range, interval_of)
8817 (Fadd_text_properties, set_text_properties_1)
8818 (Fremove_text_properties, Fremove_list_of_text_properties)
8819 (Ftext_property_any, Ftext_property_not_all)
8820 (copy_text_properties, text_property_list, extend_property_ranges)
8821 (verify_interval_modification):
8822 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8823 (Fnext_single_char_property_change)
8824 (Fprevious_single_char_property_change):
8825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8826 (copy_text_properties):
8827 Check for integer overflow in index calculation.
8828 * undo.c (last_boundary_position, record_point, record_insert)
8829 (record_delete, record_marker_adjustment, record_change)
8830 (record_property_change):
8831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8832 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8833 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8834 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8835 (Fx_hide_tip, Fx_file_dialog):
8836 * w32menu.c (set_frame_menubar):
8837 Use ptrdiff_t, not int, for consistency with rest of code.
8838 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8839 (select_window, Fdelete_other_windows_internal)
8840 (window_scroll_pixel_based, window_scroll_line_based)
8841 (Frecenter, Fset_window_configuration):
8842 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8843 (Fset_window_hscroll, run_window_configuration_change_hook)
8844 (set_window_buffer, temp_output_buffer_show, scroll_command)
8845 (Fscroll_other_window, Frecenter):
8846 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8847 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8848 Don't assume fixnum fits in int.
8849 (Fset_window_scroll_bars):
8850 Check that fixnums are in proper range for system types.
8851 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8852 (string_pos, c_string_pos, number_of_chars, init_iterator)
8853 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8854 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8855 (compute_display_string_end, handle_face_prop)
8856 (face_before_or_after_it_pos, handle_invisible_prop)
8857 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8858 (display_prop_intangible_p, string_buffer_position_lim)
8859 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8860 (get_overlay_strings_1, get_overlay_strings)
8861 (iterate_out_of_display_property, forward_to_next_line_start)
8862 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8863 (get_next_display_element, set_iterator_to_next)
8864 (get_visually_first_element, compute_stop_pos_backwards)
8865 (handle_stop_backwards, next_element_from_buffer)
8866 (move_it_in_display_line_to, move_it_in_display_line)
8867 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8868 (add_to_log, message_dolog, message_log_check_duplicate)
8869 (message2, message2_nolog, message3, message3_nolog
8870 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8871 (current_message_1, truncate_echo_area, truncate_message_1)
8872 (set_message, set_message_1, store_mode_line_noprop)
8873 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8874 (text_outside_line_unchanged_p, check_point_in_composition)
8875 (reconsider_clip_changes)
8876 (redisplay_internal, set_cursor_from_row, try_scrolling)
8877 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8878 (redisplay_window, find_last_unchanged_at_beg_row)
8879 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8880 (trailing_whitespace_p, find_row_edges, display_line)
8881 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8882 (display_mode_element, store_mode_line_string)
8883 (pint2str, pint2hrstr, decode_mode_spec)
8884 (display_count_lines, display_string, draw_glyphs)
8885 (x_produce_glyphs, x_insert_glyphs)
8886 (rows_from_pos_range, mouse_face_from_buffer_pos)
8887 (fast_find_string_pos, mouse_face_from_string_pos)
8888 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8889 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8890 (safe_call, init_from_display_pos, handle_fontified_prop)
8891 (handle_single_display_spec, load_overlay_strings)
8892 (with_echo_area_buffer, setup_echo_area_for_printing)
8893 (display_echo_area, echo_area_display)
8894 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8895 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8896 (redisplay_window, dump_glyph_row, display_mode_line)
8897 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8898 (handle_display_spec, display_prop_string_p):
8899 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8900 (handle_single_display_spec, build_desired_tool_bar_string)
8901 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8902 (get_specified_cursor_type):
8903 Check that fixnums are in proper range for system types.
8904 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8905 (Flookup_image_map):
8906 Don't assume fixnums fit in int.
8907 (compare_overlay_entries):
8908 Avoid mishandling comparisons due to subtraction overflow.
8909 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8910 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8911 (handle_tool_bar_click):
8912 Use int, not unsigned, since we prefer signed and the signedness
8913 doesn't matter here.
8914 (get_next_display_element, next_element_from_display_vector):
8915 Use int, not EMACS_INT, when int is wide enough.
8916 (start_hourglass): Use duration_to_sec_usec to do proper
8917 overflow checking on durations.
8918 * xfaces.c (Fbitmap_spec_p):
8919 Check that fixnums are in proper range for system types.
8920 (compare_fonts_by_sort_order):
8921 Avoid mishandling comparisons due to subtraction overflow.
8922 (Fx_family_fonts, realize_basic_faces):
8923 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8924 (Fx_family_fonts):
8925 Don't assume fixnum fits in int.
8926 Use SAFE_ALLOCA_LISP, not alloca.
8927 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8928 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8929 (face_at_buffer_position, face_for_overlay_string)
8930 (face_at_string_position):
8931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8932 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8933 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8934 (Fx_show_tip):
8935 Check that fixnums are in proper range for system types.
8936 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8937 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8938 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8939 (Fx_change_window_property): Don't assume fixnums fit in int.
8940 * xfont.c (xfont_chars_supported):
8941 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8942 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8943 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8944 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8945 * xml.c (parse_region):
8946 * xrdb.c (magic_file_p):
8947 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8948 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8949 (x_get_local_selection, x_reply_selection_request)
8950 (x_handle_selection_request, wait_for_property_change):
8951 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8952 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8953 short is wide enough.
8954 (x_send_client_event): Don't assume fixnum fits in int.
8955 * xterm.c (x_x_to_emacs_modifiers):
8956 Don't assume EMACS_INT overflows nicely into int.
8957 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8958 may come from Lisp.
8959 (handle_one_xevent): NATNUMP can eval its arg twice.
8960 (x_connection_closed):
8961 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8962 * xterm.h: Adjust decls to match defn changes elsewhere.
8963 (struct scroll_bar): Use struct vectorlike_header
8964 rather than rolling our own approximation.
8965 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8966
8967 2012-05-25 Glenn Morris <rgm@gnu.org>
8968
8969 * lisp.mk (lisp): Update for more files being compiled now.
8970
8971 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8972
8973 * lread.c: Remove `read_pure' which makes no difference.
8974 (read_pure): Remove var.
8975 (unreadpure): Remove function.
8976 (readevalloop): Don't call read_list with -1 flag.
8977 (read1, read_vector): Don't test read_pure any more.
8978 (read_list): Simplify.
8979
8980 * fileio.c, character.h: Minor style tweaks.
8981
8982 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8983
8984 * window.h (clip_changed): Remove useless declaration.
8985
8986 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8987
8988 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8989 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8990
8991 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8992
8993 Remove src/m/*.
8994 This directory predates autoconf and is no longer needed nowadays.
8995 Move its few remaining bits of functionality to where they're needed.
8996 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8997 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8998 * m/template.h: Remove.
8999 * Makefile.in (M_FILE): Remove. All uses removed.
9000 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9001 * lisp.h (USE_LSB_TAG):
9002 * mem-limits.h (EXCEEDS_LISP_PTR):
9003 Use VAL_MAX, not VALBITS, in #if.
9004 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9005 (EMACS_UINT): Define unconditionally now.
9006 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9007 (BITS_PER_EMACS_INT): New constants, replacing
9008 what used to be in config.h, but not useful in #if.
9009 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9010 define them any more.
9011 (VAL_MAX): New macro.
9012 (VALMASK): Use it.
9013 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9014 BITS_PER_EMACS_INT, in #if.
9015 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9016 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9017 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9018 * s/ms-w32.h (DATA_START):
9019 Move here from removed file m/intel386.h.
9020 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9021 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9022
9023 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9024
9025 Assume C89 or later.
9026 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9027 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9028 (xrealloc):
9029 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9030 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9031 * textprop.c, tparam.c (NULL): Remove.
9032 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9033 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9034 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9035 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9036 * xterm.c (input_signal_count): Assume volatile works.
9037
9038 2012-05-21 Ken Brown <kbrown@cornell.edu>
9039
9040 * xgselect.c (xg_select): Fix first argument in call to 'select'
9041 (bug#11508).
9042
9043 2012-05-20 Ken Brown <kbrown@cornell.edu>
9044
9045 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9046 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9047
9048 2012-05-19 Ken Brown <kbrown@cornell.edu>
9049
9050 * xfns.c (x_in_use): Remove `static' qualifier.
9051 * xterm.h (x_in_use): Declare.
9052 * xgselect.c: Include xterm.h.
9053 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9054 and `display_arg' (bug#9754).
9055
9056 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9057
9058 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9059
9060 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9061 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9062
9063 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9064
9065 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9066
9067 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9068 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9069
9070 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9071 reference to image_cache->refcount.
9072 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9073
9074 2012-05-17 Juri Linkov <juri@jurta.org>
9075
9076 * search.c (Fword_search_regexp, Fword_search_backward)
9077 (Fword_search_forward, Fword_search_backward_lax)
9078 (Fword_search_forward_lax): Move functions to isearch.el
9079 (bug#10145, bug#11381).
9080
9081 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9082
9083 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9084
9085 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9086
9087 * lread.c (init_obarray): Declare Qt and Qnil as special.
9088
9089 2012-05-14 Glenn Morris <rgm@gnu.org>
9090
9091 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9092 Put "libexec" before "bin", for the sake of init_callproc_1.
9093
9094 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9095
9096 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9097
9098 * unexaix.c: Port to more-recent AIX compilers.
9099 (report_error, report_error_1, make_hdr, copy_sym)
9100 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9101 Make arguments const char *, not char *, to avoid violations of C
9102 standard and to fix some AIX warnings reported by Gilles Pion.
9103
9104 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9105
9106 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9107 already have overlays loaded.
9108 (handle_single_display_spec): Before returning without displaying
9109 fringe bitmap, synchronize the bidi iterator with the main display
9110 iterator, by calling iterate_out_of_display_property.
9111 (iterate_out_of_display_property): Detect buffer iteration by
9112 testing that it->string is a Lisp string.
9113 (get_next_display_element): When the current object is exhausted,
9114 and there's something on it->stack, call set_iterator_to_next to
9115 proceed with what's on the stack, instead of returning zero.
9116 (set_iterator_to_next): If called at the end of a Lisp string,
9117 proceed to consider_string_end without incrementing string
9118 position. Don't increment display vector index past the end of
9119 the display vector. (Bug#11417)
9120 (pos_visible_p): Don't report a position visible when move_it_to
9121 stopped at the last line of window, which happens to be scanned
9122 backwards by the bidi iteration. (Bug#11464)
9123
9124 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9125
9126 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9127 and right-margin display specs even if the spec is invalid or we
9128 are on a TTY, and thus unable to display on the fringes.
9129 That's because the text with the property will not be displayed anyway,
9130 so we need to signal to the caller that this is a "replacing"
9131 display spec. This fixes display when the spec is invalid or we
9132 are on a TTY.
9133
9134 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 * unexaix.c (make_hdr): Fix typo in prototype.
9137 This bug broke the build on AIX. Problem reported by Gilles Pion.
9138
9139 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9140
9141 * keyboard.c (kbd_buffer_get_event): Read special events also in
9142 batch mode. (Bug#11415)
9143
9144 2012-05-12 Glenn Morris <rgm@gnu.org>
9145
9146 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9147
9148 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9149
9150 * lisp.mk (lisp): Add newcomment.elc.
9151
9152 2012-05-12 Glenn Morris <rgm@gnu.org>
9153
9154 * Makefile.in (MKDIR_P): New, set by configure.
9155 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9156
9157 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9158
9159 Remove unused function hourglass_started.
9160 * dispextern.h (hourglass_started):
9161 * w32fns.c (hourglass_started):
9162 * xdisp.c (hourglass_started): Remove.
9163
9164 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9165
9166 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9167 Update dependencies.
9168
9169 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9170
9171 * xgselect.c (xg_select): Put maxfds+1 into a var.
9172 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9173
9174 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9175
9176 2012-05-10 Dave Abrahams <dave@boostpro.com>
9177
9178 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9179 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9180
9181 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9182
9183 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9184 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9185 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9186 Initialize xd_registered_buses.
9187
9188 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9189
9190 Untag more efficiently if USE_LSB_TAG.
9191 This is based on a proposal by YAMAMOTO Mitsuharu in
9192 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9193 For an admittedly artificial (nth 8000 longlist) benchmark on
9194 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9195 Emacs's overall text size by 1%.
9196 * lisp.h (XUNTAG): New macro.
9197 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9198 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9199 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9200 * eval.c (Fautoload):
9201 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9202 * frame.h (XFRAME): Use XUNTAG.
9203
9204 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9205 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9206 Remove unportable assumptions about print widths of types like
9207 dbus_uint32_t.
9208 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9209 intptr_t when converting between pointer and integer, to avoid GCC
9210 warnings about wrong width.
9211
9212 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9213
9214 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9215 stack for each reader_thread, instead of defaulting to 8MB
9216 determined by the linker. This avoids failures in creating
9217 subprocesses on Windows 7, see the discussion in this thread:
9218 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9219
9220 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9221
9222 Fix up display of the *Minibuf-0* buffer in the mini window.
9223 * keyboard.c (read_char): Don't clear the echo area if there's no
9224 message to clear.
9225 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9226 contents of *Minibuf-0*) if there's no message displayed in its stead.
9227
9228 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9229
9230 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9231 batch mode.
9232
9233 2012-05-06 Chong Yidong <cyd@gnu.org>
9234
9235 * lisp.mk (lisp): Update.
9236
9237 2012-05-05 Jim Meyering <meyering@redhat.com>
9238
9239 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9240
9241 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9242
9243 * data.c (PUT_ERROR): New macro.
9244 (syms_of_data): Use it. Add new error type `user-error'.
9245 * undo.c (user_error): New function.
9246 (Fprimitive_undo): Use it.
9247 * print.c (print_error_message): Adjust print style for `user-error'.
9248 * keyboard.c (user_error): New function.
9249 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9250
9251 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9252
9253 Do not limit current-time-string to years 1000..9999.
9254 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9255 (Fcurrent_time_string): Support any year that is supported by the
9256 underlying localtime representation. Don't use asctime, as it
9257 has undefined behavior for years outside the range -999..9999.
9258
9259 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9260
9261 Fix race conditions involving setenv, gmtime, localtime, asctime.
9262 Without this fix, interrupts could mess up code that uses these
9263 nonreentrant functions, since setting TZ invalidates existing
9264 tm_zone or tzname values, and since most of these functions return
9265 pointers to static storage.
9266 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9267 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9268 Grow the critical sections to include not just invoking
9269 localtime/gmtime, but also accessing these functions' results
9270 including their tm_zone values if any, and any related TZ setting.
9271 (format_time_string): Last arg is now struct tm *, not struct tm **,
9272 so that the struct tm is saved in the critical section.
9273 All callers changed. Simplify allocation of initial buffer, partly
9274 motivated by the fact that memory allocation needs to be outside
9275 the critical section.
9276
9277 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9278
9279 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9280 with RESET_INTERVAL.
9281
9282 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9283 Remove duplicated buffer name initialization.
9284
9285 2012-05-02 Jim Meyering <jim@meyering.net>
9286
9287 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9288
9289 * xfns.c (x_window): Use xstrdup (Bug#11375).
9290
9291 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9292
9293 * xdisp.c (pos_visible_p): If already at a newline from the
9294 display string before the 'while' loop, don't walk back the glyphs
9295 from it3.glyph_row. Solves assertion violation when the display
9296 string begins with a newline (egg.el). (Bug#11367)
9297
9298 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9299
9300 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9301 Move to simple.el.
9302
9303 2012-05-01 Glenn Morris <rgm@gnu.org>
9304
9305 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9306 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9307 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9308 All were removed before 23.1.
9309
9310 * dispnew.c: Remove HAVE_LIBNCURSES test;
9311 it is always true on relevant platforms.
9312
9313 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9314 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9315
9316 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9317
9318 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9319
9320 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9321 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9322 Remove.
9323
9324 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9325
9326 Do not avoid creating empty evaporating overlays (Bug#9642).
9327 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9328 That is, do not delete an evaporating overlay if it becomes
9329 empty after its bounds are adjusted to fit within its buffer.
9330 This fix caused other problems, and I'm reverting it until we get
9331 to the bottom of them.
9332
9333 2012-04-27 Chong Yidong <cyd@gnu.org>
9334
9335 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9336
9337 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9338
9339 * xdisp.c (pos_visible_p): If the window start position is beyond
9340 ZV, start the display from buffer beginning. Prevents assertion
9341 violation in init_iterator when the minibuffer window is scrolled
9342 via the scroll bar.
9343
9344 * window.c (window_scroll_pixel_based): Likewise.
9345
9346 2012-04-27 Chong Yidong <cyd@gnu.org>
9347
9348 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9349
9350 2012-04-27 Glenn Morris <rgm@gnu.org>
9351
9352 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9353 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9354
9355 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9356
9357 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9358 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9359
9360 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9361
9362 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9363 display element, check also the underlying string or buffer
9364 character. (Bug#11341)
9365
9366 * w32menu.c: Include w32heap.h.
9367 (add_menu_item): If the call to AppendMenuW (via
9368 unicode_append_menu) fails, disable Unicode menus only if we are
9369 running on Windows 9X/Me.
9370
9371 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9372
9373 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9374 (xgetint): Add missing shift for LSB tags.
9375
9376 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9377
9378 * keyboard.c (read_char): Don't wipe echo area for select window
9379 events: These might get delayed via `mouse-autoselect-window'
9380 (Bug#11304).
9381
9382 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9383
9384 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9385 manipulation of :loaded-from data.
9386
9387 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9388
9389 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9390 now a cons (bug#11311).
9391
9392 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9393
9394 Do not create empty overlays with the evaporate property (Bug#9642).
9395 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9396 if it becomes empty after its bounds are adjusted to fit within
9397 its buffer. Without this fix, in a nonempty buffer (let ((o
9398 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9399 yields an empty overlay that has the evaporate property, which is
9400 not supposed to happen.
9401
9402 Fix minor GTK3 problems found by static checking.
9403 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9404 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9405 (struct _EmacsFixedClass, emacs_fixed_get_type):
9406 Move decls here from emacsgtkfixed.h, since they needn't be public.
9407 (emacs_fixed_get_type): Now static.
9408 (emacs_fixed_class_init): Omit unused local.
9409 (emacs_fixed_child_type): Remove; unused.
9410 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9411 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9412 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9413 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9414 (EMACS_FIXED_GET_CLASS): Remove; unused.
9415 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9416
9417 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9418 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9419
9420 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9421
9422 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9423 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9424 (__malloc_size_t, __malloc_ptrdiff_t):
9425 Remove. All uses removed, replaced by the definiens if needed,
9426 since we can assume C89 or better now.
9427 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9428 (protect_malloc_state, align, get_contiguous_space)
9429 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9430 (malloc_atfork_handler_child, malloc_enable_thread)
9431 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9432 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9433 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9434 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9435 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9436 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9437 Define using prototypes, not old style.
9438 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9439 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9440 (align): Don't assume that signed integer overflow wraps around.
9441 Omit unused local var.
9442 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9443 (_free_internal_nolock, memalign, mallochook, reallochook):
9444 Omit no-longer-needed casts.
9445 (valloc): Use getpagesize, not __getpagesize.
9446 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9447 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9448
9449 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9450
9451 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9452
9453 Move functions from C to Lisp. Make non-blocking method calls
9454 the default. Implement further D-Bus standard interfaces.
9455
9456 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9457 (QCdbus_request_name_allow_replacement)
9458 (QCdbus_request_name_replace_existing)
9459 (QCdbus_request_name_do_not_queue)
9460 (QCdbus_request_name_reply_primary_owner)
9461 (QCdbus_request_name_reply_in_queue)
9462 (QCdbus_request_name_reply_exists)
9463 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9464 (QCdbus_registered_serial, QCdbus_registered_method)
9465 (QCdbus_registered_signal): New Lisp objects.
9466 (XD_DEBUG_MESSAGE): Use sizeof.
9467 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9468 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9469 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9470 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9471 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9472 (xd_signature, xd_append_arg): Allow float for integer types.
9473 (xd_get_connection_references): New function.
9474 (xd_get_connection_address): Rename from xd_initialize.
9475 Return cached address.
9476 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9477 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9478 level.
9479 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9480 Return number of refcounts.
9481 (Fdbus_get_unique_name): Make stronger parameter check.
9482 (Fdbus_message_internal): New defun.
9483 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9484 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9485 (Fdbus_send_signal, Fdbus_register_service)
9486 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9487 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9488 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9489 (Vdbus_compiled_version, Vdbus_runtime_version)
9490 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9491 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9492 (Vdbus_message_type_signal): New defvars.
9493 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9494 Adapt docstring.
9495
9496 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9497
9498 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9499 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9500 Do not assume ptrdiff_t is the same width as 'int'.
9501
9502 * alloc.c: Handle unusual debugging option combinations.
9503 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9504 since the two debugging options are incompatible.
9505 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9506 is defined.
9507 (mem_init, mem_insert, mem_insert_fixup):
9508 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9509 (NEED_MEM_INSERT): Remove; no longer needed.
9510
9511 2012-04-22 Leo Liu <sdl.web@gmail.com>
9512
9513 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9514
9515 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9516
9517 * sysdep.c [__FreeBSD__]: Minor cleanups.
9518 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9519 Use Emacs indenting style more consistently. Avoid some casts.
9520 Use 'double' consistently rather than mixing 'float' and 'double'.
9521
9522 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9523
9524 * sysdep.c (list_system_processes, system_process_attributes):
9525 Add implementation for FreeBSD (Bug#5243).
9526
9527 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9528
9529 * lisp.mk (lisp): Update.
9530
9531 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9532
9533 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9534 It is never used otherwise.
9535
9536 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9537
9538 * print.c (print_preprocess): Only check print_depth if print-circle
9539 is nil.
9540 (print_object): Check for cycles even when print-circle is nil and
9541 print-gensym is t, but only check print_depth if print-circle is nil.
9542
9543 2012-04-20 Chong Yidong <cyd@gnu.org>
9544
9545 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9546 set the status to "failed" and ensure that sentinel is run.
9547
9548 2012-04-20 Glenn Morris <rgm@gnu.org>
9549
9550 * process.c (Fset_process_inherit_coding_system_flag)
9551 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9552 (Fmake_network_process, Fmake_serial_process): Doc fix.
9553
9554 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9555
9556 * xdisp.c (string_buffer_position_lim): Limit starting position to
9557 BEGV.
9558 (set_cursor_from_row): If called for a mode-line or header-line
9559 row, return zero immediately.
9560 (try_cursor_movement): If inside continuation line, don't back up
9561 farther than the first row after the header line, if any.
9562 Don't consider the header-line row as "partially visible", even if
9563 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9564
9565 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9566
9567 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9568 (bug#11238).
9569
9570 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9571 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9572
9573 configure: new option --enable-gcc-warnings (Bug#11207)
9574 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9575 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9576 (ALL_CFLAGS): Use new macros rather than old.
9577 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9578 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9579 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9580 -Wunused-result, -Wunused-variable. This should go away once
9581 the Emacs and Gnulib regex code is merged.
9582 (xmalloc, xrealloc): Now static.
9583
9584 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9585
9586 * dired.c (Fsystem_groups): Remove unused local.
9587
9588 2012-04-17 Glenn Morris <rgm@gnu.org>
9589
9590 * dired.c (Fsystem_users): Doc fix.
9591
9592 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9593
9594 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9595 (syms_of_dired): Add them.
9596
9597 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9598
9599 Fix minor alloc.c problems found by static checking.
9600 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9601 New extern decls, to avoid calling undeclared functions.
9602 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9603 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9604 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9605 (NEED_MEM_INSERT): New macro.
9606 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9607 Remove one incorrect comment and fix another.
9608
9609 Fix minor ralloc.c problems found by static checking.
9610 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9611 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9612 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9613 (r_alloc_sbrk): Now static.
9614
9615 Improve ralloc.c interface checking.
9616 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9617 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9618 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9619 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9620 [REL_ALLOC]: ... to here, to check interface.
9621 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9622 Remove decls. This fixes an "It stinks!".
9623
9624 * alloc.c (which_symbols): Fix alignment issue / type clash.
9625
9626 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9627
9628 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9629 (struct Lisp_Misc_Any): Likewise.
9630 (struct Lisp_Free): Likewise.
9631 * alloc.c (union aligned_Lisp_Symbol): Define.
9632 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9633 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9634 (union aligned_Lisp_Misc): Define.
9635 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9636 aligned_Lisp_Misc instead of union Lisp_Misc.
9637 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9638
9639 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9640
9641 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9642 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9643 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9644 * s/netbsd.h, s/sol2-6.h:
9645 Remove definition of GC_MARK_STACK, since the default now works.
9646 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9647 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9648 no longer the default.
9649 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9650
9651 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9652
9653 * lread.c (lisp_file_lexically_bound_p):
9654 Fix hang at ";-*-\n" (bug#11238).
9655
9656 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9657
9658 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9659 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9660
9661 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9662
9663 * nsterm.m (constrainFrameRect): Always constrain when there is only
9664 one screen (Bug#10962).
9665
9666 2012-04-13 Ken Brown <kbrown@cornell.edu>
9667
9668 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9669
9670 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9671
9672 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9673
9674 2012-04-11 Daniel Colascione <dancol@dancol.org>
9675
9676 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9677 against is gone. It's better to use vfork now so that when Cygwin
9678 gains a new, working vfork, we use it automatically (bug#10398).
9679
9680 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9681
9682 * window.c (save_window_save): Obey window-point-insertion-type.
9683
9684 2012-04-11 Glenn Morris <rgm@gnu.org>
9685
9686 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9687
9688 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9689
9690 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9691
9692 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9693
9694 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9695 (force_quit_count): New var.
9696 (handle_interrupt): Use it.
9697
9698 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9699
9700 * w32.c (w32_delayed_load): Record the full path of the library
9701 being loaded (bug#10424).
9702
9703 2012-04-09 Glenn Morris <rgm@gnu.org>
9704
9705 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9706 not just in the obarray, before snarfing them. (Bug#11036)
9707
9708 * Makefile.in ($(leimdir)/leim-list.el):
9709 Pass EMACS rather than BUILT_EMACS.
9710
9711 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9712
9713 * process.c (make_process):
9714 * process.h: Add integer `gnutls_handshakes_tried' member to
9715 process struct.
9716
9717 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9718 Add convenience `GNUTLS_LOG2i' macro.
9719
9720 * gnutls.c (gnutls_log_function2i): Convenience log function.
9721 (emacs_gnutls_read): Use new log functions,
9722 `gnutls_handshakes_tried' process member, and
9723 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9724 attempts per process (connection).
9725
9726 2012-04-09 Chong Yidong <cyd@gnu.org>
9727
9728 * eval.c (Fuser_variable_p, user_variable_p_eh)
9729 (lisp_indirect_variable): Functions deleted.
9730 (Fdefvar): Caller changed.
9731
9732 * callint.c (Finteractive, Fcall_interactively):
9733 * minibuf.c (Fread_variable): Callers changed.
9734
9735 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9736
9737 * xdisp.c (set_cursor_from_row): If the display string appears in
9738 the buffer at position that is closer to point than the position
9739 after the display string, display the cursor on the first glyph of
9740 the display string. Fixes cursor display when a 'display' text
9741 property immediately follows invisible text. (Bug#11094)
9742
9743 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9744
9745 composite.c: use 'double' consistently
9746 * composite.c (get_composition_id): Use 'double' consistently
9747 instead of converting 'float' to 'double' and vice versa; this is
9748 easier to understand and avoids a GCC warning.
9749
9750 2012-04-09 Glenn Morris <rgm@gnu.org>
9751
9752 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9753 preparation for dumping it with emacs. (Bug#4789)
9754 (leimdir): New variable.
9755 ($(leimdir)/leim-list.el): New rule.
9756 (emacs$(EXEEXT)): Depend on leim-list.el.
9757
9758 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9759 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9760 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9761
9762 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9763
9764 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9765 proper alignment.
9766
9767 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9768
9769 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9770 Remove unused local variable.
9771
9772 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9773
9774 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9775 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9776 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9777 objects, as mark_maybe_pointer will catch them otherwise.
9778 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9779 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9780
9781 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9782
9783 Fix typo that broke non-Windows builds.
9784 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9785
9786 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9787
9788 Support building on MS-Windows with libxml2.
9789
9790 * makefile.w32-in (OBJ2): Add xml.$(O).
9791 (GLOBAL_SOURCES): Add xml.c.
9792 ($(BLD)/xml.$(O)): New dependency list.
9793
9794 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9795 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9796 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9797 [!WINDOWSNT]: New macros.
9798 (init_libxml2_functions, libxml2_loaded_p): New functions.
9799 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9800 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9801 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9802 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9803 linked in).
9804 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9805 Call init_libxml2_functions before calling libxml2 functions.
9806 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9807
9808 * emacs.c: Don't include libxml/parser.h.
9809 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9810 xmlCleanupParser directly.
9811
9812 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9813
9814 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9815
9816 * indent.c (Fvertical_motion): If there is a display string at
9817 point, use it.vpos to compute how many lines to backtrack after
9818 move_it_to point. (Bug#11133)
9819
9820 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9821
9822 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9823 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9824 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9825 macros related to unification of CJK characters. For the details,
9826 see the discussion following the message here:
9827 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9828
9829 2012-04-04 Chong Yidong <cyd@gnu.org>
9830
9831 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9832
9833 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9834
9835 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9836 instead of alloca. (Bug#11138)
9837
9838 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9839
9840 * w32menu.c (is_simple_dialog): Properly check lisp types.
9841 (Bug#11141)
9842
9843 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9844
9845 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9846 position we get to after a call to move_it_to fails the
9847 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9848 only if we wind up in a string from display property. (Bug#11063)
9849
9850 * window.c (Fdelete_other_windows_internal): Invalidate the row
9851 and column information about mouse highlight, so that redisplay
9852 restores it after reallocating the glyph matrices. (Bug#7464)
9853
9854 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9855 string comes from a `display' text property, use the buffer
9856 position of that property as if we actually saw that position in
9857 the row's glyphs.
9858 (move_it_by_lines): Remove the assertion that
9859 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9860 violated when there's a before-string at the beginning of a line.
9861 (Bug#11063)
9862
9863 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9864
9865 * xdisp.c (append_space_for_newline): If the default face was
9866 remapped, use the remapped face for the appended newline.
9867 (extend_face_to_end_of_line): Use the remapped default face for
9868 extending the face to the end of the line.
9869 (display_line): Call extend_face_to_end_of_line when the default
9870 face was remapped. (Bug#11068)
9871
9872 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9873
9874 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9875
9876 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9877
9878 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9879
9880 2012-03-27 Glenn Morris <rgm@gnu.org>
9881
9882 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9883 Doc fixes.
9884
9885 2012-03-26 Kenichi Handa <handa@m17n.org>
9886
9887 * dispextern.h (struct glyph): Fix previous change. Change the
9888 bit length of glyphless.ch to 25 (Bug#11082).
9889
9890 2012-03-26 Chong Yidong <cyd@gnu.org>
9891
9892 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9893 (command_loop_1): Use it; inhibit selection update for
9894 handle-select-window too (Bug#8996).
9895
9896 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9897
9898 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9899
9900 2012-03-25 Kenichi Handa <handa@m17n.org>
9901
9902 * dispextern.h (struct glyph): Change the bit length of
9903 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9904
9905 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9906
9907 * s/ms-w32.h (tzname): Include time.h before redirecting to
9908 _tzname. Fixes the MSVC build. (Bug#9960)
9909
9910 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9911
9912 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9913 characters.
9914
9915 * xterm.c (XTread_socket): Only modify handling_signal if
9916 !SYNC_INPUT. (Bug#11080)
9917
9918 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9919
9920 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9921 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9922 when fetching a multibyte character consumes more bytes than
9923 CHAR_BYTES returns, due to unification of CJK characters in
9924 string_char. (Bug#11073)
9925
9926 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9927
9928 * process.c (wait_reading_process_output): Handle pty disconnect
9929 by refraining from sending oneself a SIGCHLD (bug#10933).
9930
9931 2012-03-22 Chong Yidong <cyd@gnu.org>
9932
9933 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9934
9935 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9936 Mark string as coming from a prefix property.
9937 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9938 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9939
9940 2012-03-21 Chong Yidong <cyd@gnu.org>
9941
9942 * xfaces.c (Vface_remapping_alist): Doc fix.
9943
9944 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9945
9946 * w32proc.c (Fw32_set_console_codepage)
9947 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9948 Doc fixes.
9949
9950 2012-03-20 Chong Yidong <cyd@gnu.org>
9951
9952 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9953 to reflect default non-nil value of redisplay-dont-pause.
9954
9955 2012-03-19 Kenichi Handa <handa@m17n.org>
9956
9957 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9958 it fit in a valid range (Bug#11003).
9959
9960 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9961
9962 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9963 that is not from display property, accept the row as a "cursor
9964 row" if one of the string's character has a non-nil `cursor'
9965 property. Fixes cursor positioning when there are newlines in
9966 overlay strings, e.g. in icomplete.el. (Bug#11035)
9967
9968 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9969
9970 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9971
9972 2012-03-12 Chong Yidong <cyd@gnu.org>
9973
9974 * eval.c (inhibit_lisp_code): Rename from
9975 inhibit_window_configuration_change_hook; move from window.c.
9976
9977 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9978 * window.c (run_window_configuration_change_hook)
9979 (syms_of_window): Callers changed.
9980
9981 2012-03-11 Chong Yidong <cyd@gnu.org>
9982
9983 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9984
9985 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9986
9987 2012-03-10 Chong Yidong <cyd@gnu.org>
9988
9989 * frame.c (other_visible_frames): Don't assume the selected frame
9990 is visible (Bug#10955).
9991
9992 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9993
9994 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9995
9996 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9997
9998 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9999 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10000 zero (Bug#10954).
10001
10002 2012-03-03 Glenn Morris <rgm@gnu.org>
10003
10004 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10005
10006 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10007
10008 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10009 position past the first glyph_row that ends at ZV. (Bug#10902)
10010 (redisplay_window, next_element_from_string): Fix typos in
10011 comments.
10012 (redisplay_window): Pass to move_it_vertically the margin in
10013 pixels, not in screen lines.
10014
10015 2012-03-02 Glenn Morris <rgm@gnu.org>
10016
10017 * buffer.c (buffer-list-update-hook): Doc fix.
10018
10019 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10020
10021 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10022 push_it before setting up the iterator for the first overlay
10023 string, even if we have an empty string loaded.
10024 (next_overlay_string): If there's an empty string on the iterator
10025 stack, pop the stack. (Bug#10903)
10026
10027 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10028
10029 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10030 Suggested by Stefan Monnier in
10031 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10032 * alloc.c (widen_to_Lisp_Object): New static function.
10033 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10034 and widening them to Lisp_Objects. This would work even if
10035 USE_LSB_TAG is defined and wide integers are used, which might
10036 happen in a future version of Emacs.
10037
10038 2012-02-25 Chong Yidong <cyd@gnu.org>
10039
10040 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10041 Doc fix.
10042
10043 * xselect.c (Fx_selection_exists_p): Doc fix.
10044 (x_clipboard_manager_save_all): Print an informative message
10045 before saving to clipboard manager.
10046
10047 2012-02-24 Chong Yidong <cyd@gnu.org>
10048
10049 * keyboard.c (process_special_events): Handle all X selection
10050 requests in kbd_buffer, not just the next one (Bug#8869).
10051
10052 2012-02-23 Chong Yidong <cyd@gnu.org>
10053
10054 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10055 call when setting menu-bar-lines and tool-bar-lines parameters.
10056 (unwind_create_frame_1): New helper function.
10057
10058 * window.c (inhibit_window_configuration_change_hook): New var.
10059 (run_window_configuration_change_hook): Obey it.
10060 (syms_of_window): Initialize it.
10061
10062 2012-02-22 Chong Yidong <cyd@gnu.org>
10063
10064 * xterm.c (x_draw_image_relief): Add missing type check for
10065 Vtool_bar_button_margin (Bug#10743).
10066
10067 2012-02-21 Chong Yidong <cyd@gnu.org>
10068
10069 * fileio.c (Vfile_name_handler_alist): Doc fix.
10070
10071 * buffer.c (Fget_file_buffer): Protect against invalid file
10072 handler return value.
10073
10074 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10075
10076 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10077 when computing $valmask.
10078
10079 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10080 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10081 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10082 It's useless in that case, and it can cause problems on hosts
10083 that allocate halves of EMACS_INT values separately.
10084 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10085 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10086 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10087 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10088 it avoids undefined behavior on hosts where shifting right by more
10089 than the word width has undefined behavior.
10090
10091 2012-02-19 Chong Yidong <cyd@gnu.org>
10092
10093 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10094 (Funhandled_file_name_directory, Ffile_name_as_directory)
10095 (Fdirectory_file_name, Fexpand_file_name)
10096 (Fsubstitute_in_file_name): Protect against invalid file handler
10097 return values (Bug#10845).
10098
10099 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10100
10101 * .gdbinit (pitx): Fix incorrect references to fields of the
10102 iterator stack.
10103
10104 2012-02-17 Chong Yidong <cyd@gnu.org>
10105
10106 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10107
10108 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10109
10110 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10111 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10112
10113 2012-02-15 Chong Yidong <cyd@gnu.org>
10114
10115 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10116 marked as special. Also, starting docstrings with * is obsolete.
10117
10118 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10119
10120 * gnutls.c (emacs_gnutls_write): Fix last change.
10121
10122 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10123
10124 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10125 send_process.
10126
10127 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10128
10129 * keymap.c (Fsingle_key_description): Handle char ranges.
10130
10131 2012-02-12 Chong Yidong <cyd@gnu.org>
10132
10133 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10134 as that creates a dangerous corner case.
10135
10136 * window.c (Fdelete_window_internal): Invalidate the mouse
10137 highlight (Bug#9904).
10138
10139 2012-02-12 Glenn Morris <rgm@gnu.org>
10140
10141 * xselect.c (Fx_own_selection_internal)
10142 (Fx_get_selection_internal, Fx_disown_selection_internal)
10143 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10144 * nsselect.m (Fx_own_selection_internal)
10145 (Fx_disown_selection_internal, Fx_selection_exists_p)
10146 (Fx_selection_owner_p, Fx_get_selection_internal):
10147 Sync docs and argument specs with the xselect.c versions.
10148
10149 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10150
10151 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10152
10153 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10154
10155 * w32select.c (Fx_selection_exists_p): Sync doc string and
10156 argument list with xselect.c. (Bug#10783)
10157
10158 * w16select.c (Fx_selection_exists_p): Sync doc string and
10159 argument list with xselect.c. (Bug#10783)
10160
10161 2012-02-10 Glenn Morris <rgm@gnu.org>
10162
10163 * fns.c (Fsecure_hash): Doc fix.
10164
10165 2012-02-09 Kenichi Handa <handa@m17n.org>
10166
10167 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10168
10169 2012-02-07 Chong Yidong <cyd@gnu.org>
10170
10171 * buffer.c (Fbuffer_local_variables)
10172 (buffer_lisp_local_variables): Handle unbound vars correctly;
10173 don't let Qunbound leak into Lisp.
10174
10175 2012-02-07 Glenn Morris <rgm@gnu.org>
10176
10177 * image.c (Fimagemagick_types): Doc fix.
10178
10179 * image.c (imagemagick-render-type): Change it from a lisp object
10180 to an integer. Move the doc here from the lisp manual.
10181 Treat all values not equal to 0 the same.
10182
10183 2012-02-06 Chong Yidong <cyd@gnu.org>
10184
10185 * doc.c (store_function_docstring): Avoid applying docstring of
10186 alias to base function (Bug#2603).
10187
10188 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10189
10190 * .gdbinit (pp1, pv1): Remove redundant defines.
10191 (pr): Use pp.
10192
10193 2012-02-04 Chong Yidong <cyd@gnu.org>
10194
10195 * nsterm.m: Declare a global (Bug#10694).
10196
10197 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10198
10199 * w32.c (get_emacs_configuration_options):
10200 Include --enable-checking, if specified, in the return value.
10201
10202 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10203
10204 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10205 after rounding frame sizes. (Bug#9723)
10206
10207 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10208
10209 * keyboard.c (adjust_point_for_property): Don't position point
10210 before BEGV. (Bug#10696)
10211
10212 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10213
10214 Handle overflow when computing char display width (Bug#9496).
10215 * character.c (char_width): Return EMACS_INT, not int.
10216 (char_width, c_string_width): Check for overflow when
10217 computing the width; this is possible now that individual
10218 characters can have unbounded width. Problem introduced
10219 by merge from Emacs 23 on 2012-01-19.
10220
10221 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10222
10223 * dbusbind.c (Fdbus_register_method): Mention the return value
10224 :ignore in the docstring.
10225
10226 2012-02-02 Glenn Morris <rgm@gnu.org>
10227
10228 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10229
10230 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10231 Unconditionally set to t. (Bug#10673)
10232 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10233 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10234 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10235
10236 2012-02-02 Kenichi Handa <handa@m17n.org>
10237
10238 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10239 0, do not call append_composite_glyph.
10240
10241 2012-02-02 Kenichi Handa <handa@m17n.org>
10242
10243 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10244 NULL (Bug#6988).
10245 (x_produce_glyphs): If the component of a composition is a null
10246 string, set it->pixel_width to 1 to avoid zero-width glyph.
10247
10248 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10249
10250 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10251 first 2 arguments are identical. This makes inserting large
10252 output from a subprocess an order of magnitude faster on
10253 MS-Windows, where all sbrk'ed memory is always contiguous.
10254
10255 2012-01-31 Glenn Morris <rgm@gnu.org>
10256
10257 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10258 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10259 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10260
10261 2012-01-29 Glenn Morris <rgm@gnu.org>
10262
10263 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10264
10265 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10266
10267 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10268
10269 2012-01-28 Chong Yidong <cyd@gnu.org>
10270
10271 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10272
10273 2012-01-26 Chong Yidong <cyd@gnu.org>
10274
10275 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10276
10277 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10278 repeat counts (Bug#10507).
10279
10280 2012-01-26 Glenn Morris <rgm@gnu.org>
10281
10282 * lread.c (syms_of_lread): Doc fix.
10283
10284 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10285
10286 * coding.c (encode_designation_at_bol): Change return value to
10287 EMACS_INT.
10288
10289 2012-01-25 Chong Yidong <cyd@gnu.org>
10290
10291 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10292
10293 2012-01-21 Chong Yidong <cyd@gnu.org>
10294
10295 * floatfns.c (Fcopysign): Make the second argument non-optional,
10296 since nil is not allowed anyway.
10297
10298 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10299
10300 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10301 (send_process): Likewise.
10302
10303 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10304
10305 * window.c (save_window_save, Fcurrent_window_configuration)
10306 (Vwindow_persistent_parameters): Do not use Qstate.
10307 Rewrite doc-strings.
10308
10309 2012-01-19 Kenichi Handa <handa@m17n.org>
10310
10311 * character.c (char_width): New function.
10312 (Fchar_width, c_string_width, lisp_string_width):
10313 Use char_width (Bug#9496).
10314
10315 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10316
10317 * window.c (Vwindow_persistent_parameters): New variable.
10318 (Fset_window_configuration, save_window_save): Handle persistent
10319 window parameters.
10320
10321 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10322
10323 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10324 thrashing the stack of the thread. (Bug#9087)
10325
10326 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10327
10328 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10329
10330 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10331
10332 * xdisp.c (rows_from_pos_range): Handle the case where the
10333 highlight ends on a newline. (Bug#10464)
10334 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10335 he end column for display of highlight that ends on a newline
10336 before a R2L line.
10337
10338 2012-01-11 Glenn Morris <rgm@gnu.org>
10339
10340 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10341 from load-path also when installation-directory is nil. (Bug#10208)
10342
10343 2012-01-10 Glenn Morris <rgm@gnu.org>
10344
10345 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10346
10347 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10348 Update template values to be closer to their typical values these days.
10349
10350 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10351
10352 * xdisp.c (rows_from_pos_range): Accept additional argument
10353 DISP_STRING, and accept any glyph in a row whose object is that
10354 string as eligible for mouse highlight. Fixes mouse highlight of
10355 display strings from overlays. (Bug#10464)
10356
10357 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10358
10359 emacs: fix an auto-save permissions race condition (Bug#10400)
10360 * fileio.c (auto_saving_dir_umask): New static var.
10361 (Fmake_directory_internal): Use it.
10362 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10363 creating the directory. The old code temporarily assigns
10364 too-generous permissions to the directory.
10365 (do_auto_save_eh): Clear it.
10366 (Fdo_auto_save): Catch all errors, not just file errors, so
10367 that the var is always cleared.
10368
10369 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10370
10371 * search.c (scan_buffer): Pass character positions to
10372 know_region_cache, not byte positions. (Bug#6540)
10373
10374 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10375
10376 * w32.c (sys_rename): Report EXDEV when rename of a directory
10377 fails because the target is on another logical disk. (Bug#10284)
10378
10379 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10380
10381 * xterm.c (x_embed_request_focus): New function.
10382
10383 * xterm.h: Add prototype.
10384
10385 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10386
10387 2012-01-05 Glenn Morris <rgm@gnu.org>
10388
10389 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10390
10391 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10392
10393 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10394 Load gnutls_transport_set_lowat only if GnuTLS version is below
10395 2.11.1.
10396 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10397 GnuTLS versions below 2.11.1.
10398
10399 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10400
10401 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10402 to the doc string advising against its use for altering the way
10403 windows are scrolled.
10404
10405 2011-12-28 Kenichi Handa <handa@m17n.org>
10406
10407 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10408 coding-system ASCII compatible only when it does not produce BOM
10409 on encoding (Bug#10383).
10410
10411 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10412
10413 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10414 can scroll.
10415 (create_and_show_popup_menu): Always use menu_position_func for
10416 Gtk3 (Bug#10361).
10417
10418 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10419
10420 * callint.c (Fcall_interactively): Don't truncate prompt string.
10421
10422 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10423
10424 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10425 property that ends at ZV, so that the bidi iteration could be
10426 resumed from there (after widening). (Bug#10360)
10427
10428 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10429
10430 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10431
10432 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10433
10434 * nsterm.m (x_free_frame_resources):
10435 Release f->output_data.ns->miniimage.
10436 (ns_index_color): Fix indentation. Do not retain
10437 color_table->colors[i].
10438
10439 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10440 before returning.
10441
10442 * nsfns.m (x_set_background_color): Assign return value from
10443 ns_index_color to face-background instead of NSColor*.
10444 (ns_implicitly_set_icon_type): Fix indentation.
10445 Change assignment in for loop to comparison.
10446
10447 * emacs.c (ns_pool): New variable.
10448 (main): Assign ns_pool.
10449 (Fkill_emacs): Call ns_release_autorelease_pool.
10450
10451 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10452 autorelease fdesc, release fdAttrs and tdict.
10453 (ns_get_covering_families): Release charset.
10454 (ns_findfonts): Release NSFontDescriptor created with new.
10455 (ns_uni_to_glyphs): Fix indentation.
10456 (setString): Release attrStr before assigning new value.
10457
10458 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10459
10460 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10461 and NS_IMPL_COCOA.
10462 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10463 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10464
10465 2011-12-18 David Reitter <reitter@cmu.edu>
10466
10467 * nsterm.m (ns_term_init): Subscribe for notifications
10468 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10469 to method trackingNotification in EmacsMenu.
10470
10471 * nsmenu.m (trackingMenu): New variable.
10472 (trackingNotification): New method (from Aquamacs).
10473 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10474 from Aquamacs (Bug#7030).
10475
10476 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10477
10478 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10479 (symbol_to_nsstring): Fix indentation.
10480 (ns_symbol_to_pb): New function.
10481 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10482 (Fns_rotate_cut_buffers_internal): Remove.
10483 (Fns_store_selection_internal): Rename from
10484 Fns_store_cut_buffer_internal.
10485 (ns_get_foreign_selection, Fx_own_selection_internal)
10486 (Fx_disown_selection_internal, Fx_selection_exists_p)
10487 (Fns_get_selection_internal, Fns_store_selection_internal):
10488 Use ns_symbol_to_pb and check if return value is nil.
10489 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10490 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10491 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10492 renamed to Sns_store_selection_internal.
10493 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10494 and remove this function.
10495 (ns_handle_selection_clear): Remove, never used.
10496 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10497 here.
10498
10499 2011-12-17 Ken Brown <kbrown@cornell.edu>
10500
10501 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10502 GID is unknown (Bug#10257).
10503
10504 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10505
10506 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10507 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10508 which caused a build failure on GNU/Linux IA-64. This problem was
10509 introduced by my 2011-10-07 patch.
10510
10511 2011-12-15 Juri Linkov <juri@jurta.org>
10512
10513 * image.c (imagemagick_error): New function. (Bug#10112)
10514 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10515 Use `imagemagick_error' where ImageMagick functions return
10516 `MagickFalse'.
10517 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10518 proper order.
10519
10520 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10521
10522 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10523 fill background (Bug#8992).
10524
10525 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10526
10527 * window.c (Vwindow_combination_resize)
10528 (Vwindow_combination_limit): Use t instead of non-nil in
10529 doc-strings.
10530 (Vrecenter_redisplay): Add first sentence of doc-string on
10531 separate line.
10532 (Frecenter): Fix doc-string typo.
10533
10534 2011-12-11 Kenichi Handa <handa@m17n.org>
10535
10536 * coding.c (Funencodable_char_position): Pay attention to the
10537 buffer text relocation (Bug#9389).
10538
10539 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10540
10541 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10542 gtk_init (Bug#10100).
10543
10544 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10545
10546 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10547 IT->string is nil. (Bug#10263)
10548
10549 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10550
10551 * nsterm.h (x_free_frame_resources): Declare.
10552
10553 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10554 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10555
10556 * nsterm.h (ns_get_defaults_value): Declare.
10557
10558 * nsterm.m (ns_default): Call ns_get_defaults_value.
10559
10560 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10561
10562 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10563 (Bug#10170)
10564
10565 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10566
10567 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10568 that where the value of an _OBJC_* symbol points to is in the .bss
10569 section (Bug#10240).
10570
10571 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10572
10573 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10574 after the loop to call ccl_driver at least once (Bug#8619).
10575
10576 2011-12-08 Kenichi Handa <handa@m17n.org>
10577
10578 * ftfont.c (get_adstyle_property): Fix previous change
10579 (Bug#10233).
10580
10581 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10582
10583 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10584 dirs from the default value of EMACSLOADPATH (bug#10208).
10585
10586 2011-12-07 Glenn Morris <rgm@gnu.org>
10587
10588 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10589 installation and source directories as well. (Bug#10208)
10590
10591 2011-12-06 Chong Yidong <cyd@gnu.org>
10592
10593 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10594
10595 2011-12-06 Glenn Morris <rgm@gnu.org>
10596
10597 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10598 as an error, not just -1. (Bug#10217)
10599
10600 2011-12-05 Chong Yidong <cyd@gnu.org>
10601
10602 * keyboard.c (process_special_events): New function.
10603 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10604
10605 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10606
10607 * coding.c (encode_designation_at_bol): Don't use uninitialized
10608 local variable (Bug#9318).
10609
10610 2011-12-05 Kenichi Handa <handa@m17n.org>
10611
10612 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10613 return Qnil (Bug#8046, Bug#10193).
10614
10615 2011-12-05 Kenichi Handa <handa@m17n.org>
10616
10617 * coding.c (encode_designation_at_bol): New args charbuf_end and
10618 dst. Return the number of produced bytes. Callers changed.
10619 (coding_set_source): Return how many bytes coding->source was
10620 relocated.
10621 (coding_set_destination): Return how many bytes
10622 coding->destination was relocated.
10623 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10624 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10625
10626 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10627
10628 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10629 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10630 macro (Bug#9318).
10631
10632 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10633
10634 The following changes are to fix Bug#9318.
10635
10636 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10637 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10638 (encode_coding_iso_2022, encode_coding_sjis)
10639 (encode_coding_big5, encode_coding_charset): Use the above macros.
10640
10641 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10642
10643 * lisp.h (process_quit_flag): Fix external declaration.
10644
10645 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10646
10647 Don't macro-inline non-performance-critical code.
10648 * eval.c (process_quit_flag): New function.
10649 * lisp.h (QUIT): Use it.
10650
10651 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10652
10653 * nsfns.m (get_geometry_from_preferences): New function.
10654 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10655
10656 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10657
10658 * emacs.c (Qkill_emacs): Define.
10659 (syms_of_emacs): Initialize it.
10660 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10661 Qquit_flag to `kill-emacs' instead.
10662 (quit_throw_to_read_char): Add parameter `from_signal'.
10663 All callers changed. Call Fkill_emacs if requested and safe.
10664 * lisp.h (QUIT): Call Fkill_emacs if requested.
10665
10666 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10667
10668 * widget.c (update_wm_hints): Return if wmshell is null.
10669 (widget_update_wm_size_hints): New function.
10670
10671 * widget.h (widget_update_wm_size_hints): Declare.
10672
10673 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10674 widget_update_wm_size_hints (Bug#10104).
10675
10676 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10677
10678 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10679 before a newline, prepare the bidi iterator for consuming the
10680 newline, and keep the current paragraph direction. (Bug#10183)
10681 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10682
10683 2011-12-02 Juri Linkov <juri@jurta.org>
10684
10685 * search.c (Fword_search_regexp): New Lisp function created from
10686 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10687 (Fword_search_backward, Fword_search_forward)
10688 (Fword_search_backward_lax, Fword_search_forward_lax):
10689 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10690 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10691
10692 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10693
10694 * fileio.c (Finsert_file_contents): Move after-change-function call
10695 to before the "handled:" label, since all "goto handled" appear in
10696 cases where the *-change-functions have already been properly called
10697 (bug#10117).
10698
10699 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10700
10701 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10702 waiting for input. (Bug#10169)
10703
10704 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10705
10706 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10707 verifies glyph row's hash code--we have just reallocated the
10708 glyphs, so their contents can be complete garbage. (Bug#10164)
10709
10710 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10711
10712 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10713
10714 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10715
10716 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10717 attributes are tested _before_ calling verify_row_hash, to protect
10718 against GCC re-ordering of the tests. (Bug#10164)
10719
10720 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10721
10722 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10723
10724 * xterm.c (handle_one_xevent): Only set async_visible and friends
10725 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10726 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10727 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10728
10729 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10730
10731 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10732 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10733 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10734 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10735 All uses changed to use GCPRO1 etc.
10736 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10737 Revert to old implementation (i.e., before 2011-03-11).
10738
10739 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10740
10741 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10742 of scroll runs so as to avoid assigning disabled bogus rows and
10743 unnecessary graphics copy operations.
10744
10745 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10746
10747 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10748 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10749 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10750 (malloc, free, realloc, calloc): Redirect to e_* only when
10751 compiling Emacs.
10752
10753 * lisp.h (GCTYPEBITS): Move before first use.
10754 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10755 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10756 this macro definition.
10757
10758 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10759 _MSC_VER.
10760
10761 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10762
10763 * gtkutil.c (xg_create_frame_widgets):
10764 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10765 present with Gtk+ 2.0.
10766
10767 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10768
10769 * fileio.c (Finsert_file_contents): Undo previous change; see
10770 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10771
10772 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10773
10774 Rename locals to avoid shadowing.
10775 * fileio.c (Finsert_file_contents):
10776 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10777 * process.c (wait_reading_process_output):
10778 Rename inner 'proc' to 'p' to avoid shadowing.
10779 Indent for consistency with usual Emacs style.
10780
10781 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10782
10783 * xdisp.c (redisplay_window): If cursor row is not fully visible
10784 after recentering, and scroll-conservatively is set to a large
10785 number, scroll window by a few more lines to make the cursor fully
10786 visible and out of scroll-margin. (Bug#10105)
10787 (start_display): Don't move to the next line if the display should
10788 start at a newline that is part of a display vector or an overlay
10789 string. (Bug#10119)
10790
10791 2011-11-24 Juri Linkov <juri@jurta.org>
10792
10793 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10794 after the `MagickPingImage' call. (Bug#10112)
10795
10796 2011-11-23 Chong Yidong <cyd@gnu.org>
10797
10798 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10799
10800 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10801
10802 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10803 making another buffer current. (Bug#10114)
10804
10805 2011-11-23 Glenn Morris <rgm@gnu.org>
10806
10807 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10808
10809 2011-11-23 Chong Yidong <cyd@gnu.org>
10810
10811 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10812 using it (Bug#5984).
10813
10814 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10815
10816 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10817 and header-lines, as they don't have one computed for them.
10818 (Bug#10098)
10819
10820 * .gdbinit (prow): Make displayed values more self-explaining.
10821 Add row's hash code.
10822
10823 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10824
10825 * process.c (wait_reading_process_output): Fix asynchrounous
10826 GnuTLS socket handling on some versions of the GnuTLS library.
10827 (wait_reading_process_output): Add comment and URL.
10828
10829 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10830
10831 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10832
10833 2011-11-21 Chong Yidong <cyd@gnu.org>
10834
10835 * window.c (Fnext_window, Fprevious_window): Doc fix.
10836
10837 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10838
10839 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10840
10841 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10842
10843 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10844
10845 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10846
10847 * window.c (Fset_window_combination_limit): Rename argument
10848 STATUS to LIMIT.
10849 (Vwindow_combination_limit): Remove "status" from doc-string.
10850
10851 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10852
10853 * m/ibms390.h: Remove.
10854 * m/ibms390x.h: Don't include "ibms390.h".
10855
10856 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10857
10858 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10859 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10860
10861 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10862
10863 * casetab.c (Fset_case_table):
10864 * charset.c (Fcharset_after): Fix typos.
10865
10866 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10867
10868 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10869 Otherwise, valgrind does not work on some platforms.
10870 Problem reported by Andreas Schwab in
10871 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10872 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10873 is set, removing the need for VIRT_ADDRESS_VARIES.
10874 (PURE_P): Use a more-efficient implementation that needs just one
10875 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10876 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10877 to 4 (xorl, subq, cmpq, setbe).
10878 * alloc.c (pure): Always extern now, since that's the
10879 VIRT_ADDR_VARIES behavior.
10880 (PURE_POINTER_P): Use a single comparison, not two, for
10881 consistency with the new puresize.h.
10882 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10883 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10884 Remove VIRT_ADDR_VARIES no longer needed.
10885
10886 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10887
10888 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10889 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10890 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10891 behave as if the cursor position were at the window margin.
10892
10893 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10894 and the cursor position is out of bounds, behave as if the cursor
10895 position were at the window margin. (Bug#10075)
10896
10897 2011-11-18 Chong Yidong <cyd@gnu.org>
10898
10899 * window.c (Fwindow_combination_limit): Make first argument
10900 non-optional, since it is meaningless for live windows like the
10901 selected window.
10902
10903 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10904
10905 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10906
10907 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10908
10909 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10910 (graft_intervals_into_buffer): Simplify.
10911
10912 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10913
10914 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10915 hash values of the two rows.
10916 (copy_row_except_pointers): Preserve the used[] arrays and the
10917 hash values of the two rows. (Bug#10035)
10918 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10919
10920 * xdisp.c (row_hash): New function, body extracted from
10921 compute_line_metrics.
10922 (compute_line_metrics): Call row_hash, instead of computing the
10923 hash code inline.
10924
10925 * dispnew.c (verify_row_hash): Call row_hash for computing the
10926 hash code of a row, instead of duplicating code from xdisp.c.
10927
10928 * dispextern.h (row_hash): Add prototype.
10929
10930 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10931
10932 * frame.c (delete_frame): Don't delete the terminal when the last
10933 X frame is closed if emacs is built with GTK toolkit.
10934
10935 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10936
10937 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10938
10939 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10940
10941 * window.c (Vwindow_splits): Rename to
10942 Vwindow_combination_resize. Suggested by Juri Linkov.
10943 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10944 of Vwindow_splits.
10945
10946 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10947
10948 * nsfns.m (Fns_font_name):
10949 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10950
10951 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10952
10953 * window.h (window): Rename slot "nest" to "combination_limit".
10954 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10955 (Fset_window_nest): Rename to Fset_window_combination_limit.
10956 (Vwindow_nest): Rename to Vwindow_combination_limit.
10957 (recombine_windows, make_parent_window, make_window)
10958 (Fsplit_window_internal, saved_window)
10959 (Fset_window_configuration, save_window_save): Rename all
10960 occurrences of window_nest to window_combination_limit.
10961
10962 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10963
10964 * image.c (imagemagick_load_image): Fix typo.
10965
10966 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10967
10968 * xdisp.c (display_line): Move the call to
10969 highlight_trailing_whitespace before the call to
10970 compute_line_metrics, since the latter needs to see the final
10971 faces of all the glyphs to compute ROW's hash value.
10972 Fixes assertion violations in row_equal_p. (Bug#10035)
10973
10974 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10975
10976 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10977 just return (bug#10044).
10978
10979 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10980
10981 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10982 with user-defined heap size. Bump the default size of the temacs
10983 heap to 27MB, to avoid memory warning when running temacs.
10984 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10985
10986 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10987 current_matrix and desired_matrix. (Bug#9990)
10988 (verify_row_hash) [XASSERTS]: New function.
10989 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10990 that the hash value of glyph rows is correct.
10991
10992 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10993
10994 * window.h (window): Remove splits slot.
10995 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10996 (Fdelete_other_windows_internal, make_parent_window)
10997 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10998 (Fset_window_configuration, save_window_save): Don't deal with
10999 split status of windows.
11000 (saved_window): Remove splits slot.
11001 (Vwindow_splits): Rewrite doc-string.
11002
11003 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11004
11005 * xfns.c (unwind_create_frame):
11006 * nsfns.m (unwind_create_frame):
11007 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11008 Vframe_list (Bug#9999).
11009
11010 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11011
11012 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11013
11014 2011-11-11 Kenichi Handa <handa@m17n.org>
11015
11016 * callproc.c (Fcall_process): Set the member dst_multibyte of
11017 process_coding.
11018
11019 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11020
11021 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11022 avoid a crash (bug#9496).
11023
11024 2011-11-09 Chong Yidong <cyd@gnu.org>
11025
11026 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11027 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11028
11029 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11030
11031 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11032
11033 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11034
11035 Avoid some portability problems by eschewing 'extern inline' functions.
11036 The trivial performance wins aren't worth the portability hassles; see
11037 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11038 et seq.
11039 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11040 (window_box_width, window_box_left, window_box_left_offset)
11041 (window_box_right, window_box_right_offset): Undo previous change,
11042 by removing the "extern"s.
11043 * intervals.c (adjust_intervals_for_insertion)
11044 (adjust_intervals_for_deletion): Undo previous change,
11045 making these static again.
11046 (offset_intervals, temp_set_point_both, temp_set_point)
11047 (copy_intervals_to_string): No longer inline.
11048 * xdisp.c (window_text_bottom_y, window_box_width)
11049 (window_box_height, window_box_left_offset)
11050 (window_box_right_offset, window_box_left, window_box_right)
11051 (window_box): No longer inline.
11052
11053 2011-11-08 Chong Yidong <cyd@gnu.org>
11054
11055 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11056 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11057 Signal an error if not a live window.
11058 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11059 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11060
11061 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11062
11063 * lisp.h (syms_of_abbrev): Remove declaration.
11064 Reported by CHENG Gao <chenggao@royau.me>.
11065
11066 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11067
11068 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11069 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11070 of temacs in GUI mode.
11071
11072 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11073
11074 * window.h: Declare delete_all_child_windows instead of
11075 delete_all_subwindows.
11076 * window.c (Fwindow_nest, Fset_window_nest)
11077 (Fset_window_new_total, Fset_window_new_normal)
11078 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11079 (delete_all_subwindows): Rename to delete_all_child_windows.
11080 (Fdelete_other_windows_internal, Fset_window_configuration):
11081 Call delete_all_child_windows instead of delete_all_subwindows.
11082 * frame.c (delete_frame): Call delete_all_child_windows instead
11083 of delete_all_subwindows.
11084
11085 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11086
11087 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11088 This is also needed for porting to any host where GC_MARK_STACK is
11089 not GC_MAKE_GCPROS_NOOPS.
11090 (which_symbols): Use it.
11091
11092 2011-11-07 Kenichi Handa <handa@m17n.org>
11093
11094 * coding.c (coding_set_destination): Check coding->src_pos only
11095 when coding->src_object is a buffer (bug#9910).
11096
11097 * process.c (send_process): Set the member src_multibyte of coding
11098 to 0 (bug#9911) when sending a unibyte text.
11099
11100 * callproc.c (Fcall_process): Set the member src_multibyte of
11101 process_coding to 0 (bug#9912).
11102
11103 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11104
11105 * xmenu.c (cleanup_widget_value_tree): New function.
11106 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11107 calling free_menubar_widget_value_tree directly (Bug#9830).
11108
11109 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11110
11111 Fix some portability problems with 'inline'.
11112 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11113 (window_box_width, window_box_left, window_box_left_offset)
11114 (window_box_right, window_box_right_offset): Declare extern.
11115 Otherwise, these inline functions do not conform to C99 and
11116 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11117 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11118 * intervals.c (adjust_intervals_for_insertion)
11119 (adjust_intervals_for_deletion): Now extern, because otherwise the
11120 extern inline functions 'offset_intervals' couldn't refer to it.
11121 (static_offset_intervals): Remove.
11122 (offset_intervals): Rewrite using the old contents of
11123 static_offset_intervals. The old version didn't conform to C99
11124 because an extern inline function contained a reference to an
11125 identifier with static linkage.
11126
11127 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11128
11129 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11130 GC.
11131
11132 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11133
11134 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11135 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11136 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11137 return Qleft_to_right.
11138
11139 2011-11-06 Chong Yidong <cyd@gnu.org>
11140
11141 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11142 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11143 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11144 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11145 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11146 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11147 (Fwindow_vscroll): Doc fix.
11148 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11149 argument, since it makes no sense to pass a live window and for
11150 consistency with window-child.
11151
11152 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11153
11154 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11155 support MSVC.
11156
11157 2011-11-05 Jason Rumney <jasonr@gnu.org>
11158
11159 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11160 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11161 fonts (Bug#6029).
11162 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11163 bitwise arithmetic preventing use of unicode-sip and non-truetype
11164 opentype fonts.
11165
11166 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11167
11168 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11169 "emacs"-only part.
11170
11171 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11172 initialization code to keep similarity to xfns.c after changes
11173 from 2011-11-05.
11174
11175 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11176
11177 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11178 (unwind_create_frame): New function (Bug#9943).
11179 (Fx_create_frame): Restructure code to be more similar to the one in
11180 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11181 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11182 Move terminal->reference_count++ just before making the frame official
11183 (Bug#9943).
11184
11185 * nsterm.m (x_free_frame_resources): New function.
11186 (x_destroy_window): Move code to x_free_frame_resources.
11187
11188 * xfns.c (unwind_create_frame): Fix comment.
11189 (Fx_create_frame, x_create_tip_frame):
11190 Move terminal->reference_count++ just before making the frame
11191 official. Move initialization of image_cache_refcount and
11192 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11193
11194 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11195
11196 Support MSVC build with newer versions of Visual Studio.
11197 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11198 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11199 nt/gmake.defs.
11200
11201 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11202 which are not supported by MSVC.
11203 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11204 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11205 bitfields.
11206 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11207 types in bitfields.
11208 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11209
11210 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11211
11212 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11213
11214 Support MSVC build with newer versions of Visual Studio.
11215 * w32.c: Don't include w32api.h for MSVC.
11216 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11217
11218 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11219 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11220 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11221 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11222 e_* cousins.
11223 (alloca) [_MSC_VER]: Define to _alloca.
11224
11225 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11226
11227 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11228
11229 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11230
11231 * xdisp.c (note_mouse_highlight): If either of
11232 previous/next-single-property-change returns nil, treat that as
11233 the beginning or the end of the buffer. (Bug#9955)
11234
11235 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11236
11237 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11238 label is not null (Bug#9951).
11239 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11240 may be NULL.
11241
11242 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11243
11244 * window.c (Fwindow_body_size): Mention in the doc string that the
11245 return value is in frame's canonical units. (Bug#9949)
11246
11247 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11248
11249 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11250
11251 * w32fns.c (unwind_create_frame): If needed, free the glyph
11252 matrices of the partially constructed frame. (Bug#9943)
11253 * xfns.c (unwind_create_frame): Likewise.
11254
11255 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11256
11257 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11258 Don't stop backward scan on the continuation glyph, even though
11259 its CHARPOS is positive.
11260 (mouse_face_from_buffer_pos, note_mouse_highlight):
11261 Rename cover_string to disp_string.
11262
11263 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11264
11265 * window.c (temp_output_buffer_show): Don't use
11266 Vtemp_buffer_show_specifiers.
11267 (Vtemp_buffer_show_specifiers): Remove unused variable.
11268
11269 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11270
11271 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11272 past the beginning of the current glyph matrix.
11273
11274 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11275
11276 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11277 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11278 HAVE_GTK3 (Bug#9869).
11279
11280 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11281 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11282
11283 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11284
11285 * xterm.c: Declare x_handle_net_wm_state to return int.
11286 (handle_one_xevent): Check if we are iconified but don't have
11287 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11288 (get_current_wm_state): Return non-zero if not hidden,
11289 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11290 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11291 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11292 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11293
11294 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11295
11296 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11297 so that this new function doesn't get optimized away by a
11298 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11299
11300 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11301
11302 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11303
11304 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11305
11306 Fix the `xbytecode' command.
11307 * .gdbinit (xprintbytestr): New command.
11308 (xwhichsymbols): Rename from `which'; all callers changed.
11309 (xbytecode): Print the byte-code string as well.
11310
11311 2011-10-29 Kim Storm <storm@cua.dk>
11312
11313 * alloc.c (which_symbols): New function.
11314
11315 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11316
11317 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11318 line. (Bug#9903)
11319
11320 2011-10-29 Glenn Morris <rgm@gnu.org>
11321
11322 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11323 Not clear what it was for, and it causes various bugs. (Bug#9839)
11324
11325 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11326
11327 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11328 possible random value that matches one of those tested as
11329 condition to clear the mouse face.
11330
11331 2011-10-28 Chong Yidong <cyd@gnu.org>
11332
11333 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11334
11335 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11336
11337 * window.c (make_window): Initialize phys_cursor_on_p.
11338
11339 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11340
11341 * lisp.h (struct Lisp_Symbol): Update comments.
11342
11343 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11344
11345 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11346
11347 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11348
11349 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11350 <oslsachem@gmail.com> for helping to debug this.
11351
11352 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11353 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11354 (g_b_init_get_glyph_outline_w): New static variables.
11355 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11356 (GetGlyphOutlineW_Proc): New typedefs.
11357 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11358 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11359 New functions.
11360 (w32font_open_internal, compute_metrics):
11361 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11362 instead of calling the "wide" APIs directly.
11363
11364 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11365
11366 * w32.h (syms_of_w32font): Add prototype.
11367
11368 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11369
11370 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11371 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11372 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11373 (Fmove_to_window_line): Doc fix.
11374
11375 2011-10-27 Chong Yidong <cyd@gnu.org>
11376
11377 * process.c (make_process): Set gnutls_state to NULL.
11378
11379 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11380 non-NULL, regardless of GNUTLS_INITSTAGE.
11381 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11382 an error. Set process slots as soon as we allocate them.
11383
11384 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11385
11386 2011-10-27 Chong Yidong <cyd@gnu.org>
11387
11388 * gnutls.c (emacs_gnutls_deinit): New function.
11389 Deallocate credentials structures as well as calling gnutls_deinit.
11390 (Fgnutls_deinit, Fgnutls_boot): Use it.
11391
11392 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11393 (deactivate_process): Call emacs_gnutls_deinit.
11394
11395 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11396
11397 * image.c (x_create_x_image_and_pixmap):
11398 * w32.c (sys_rename, w32_delayed_load):
11399 * w32font.c (fill_in_logfont):
11400 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11401
11402 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11403
11404 * w32fns.c (w32_default_color_map): New function,
11405 extracted from Fw32_default_color_map.
11406 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11407
11408 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11409
11410 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11411
11412 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11413
11414 * keyboard.c (test_undefined): New function (bug#9751).
11415 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11416
11417 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11418
11419 * sysdep.c (init_sys_modes): Fix the check for the controlling
11420 terminal (Bug#6649).
11421
11422 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11423
11424 * dispextern.h (struct bidi_it): New member next_en_type.
11425
11426 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11427 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11428 current character, check also for next_en_type being WEAK_EN.
11429 (bidi_resolve_weak): Don't enter the expensive loop if the current
11430 position is before next_en_pos. Record the bidi type of the first
11431 non-ET, non-BN character we find, in addition to its position.
11432 (bidi_level_of_next_char): Invalidate next_en_type when
11433 next_en_pos is over-stepped.
11434
11435 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11436
11437 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11438 * editfns.c: Rewrite current-time-zone so that it invokes
11439 the equivalent of (format-time-string "%Z") to get the time zone name.
11440 This fixes a bug when the time zone name contains characters that
11441 need converting from the system time locale to Emacs internal format.
11442 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11443 that patch fixed format-time-string to do the conversion, but
11444 I forgot to fix current-time-zone.
11445 (format_time_string): New function, containing most of
11446 what Fformat_time_string used to contain.
11447 (Fformat_time_string): Rewrite in terms of format_time_string.
11448 This doesn't change this function's behavior.
11449 (current-time-zone): Rewrite to use format_time_string.
11450 This fixes the bug reported by Michael Schierl in
11451 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11452 Jason Rumney's 2007-06-07 change worked around this bug, but
11453 didn't fix it.
11454 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11455
11456 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11457
11458 * xdisp.c (start_display): If the character at POS is displayed
11459 via a display vector, reset IT->current.dpvec_index to zero.
11460 (try_window_reusing_current_matrix): If a line ends in a display
11461 vector or the next line starts in a display vector, continue
11462 redrawing the window even though the character position of
11463 start_row was reached.
11464 (Bug#9771, part 2)
11465
11466 2011-10-18 Chong Yidong <cyd@gnu.org>
11467
11468 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11469 with nobreak-char-display too.
11470
11471 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11472
11473 Fix part 3 of bug#9771.
11474 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11475 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11476 non-neutral characters if the current character is a paragraph
11477 separator (a.k.a. Newline). This avoids running the same
11478 expensive loop twice, once when we consume the preceding newline
11479 and the other time when the line actually needs to be displayed.
11480 Avoid the loop when we see neutrals on the base embedding level
11481 following a character whose directionality is the same as the
11482 paragraph's. This avoids running the expensive loop when a line
11483 ends in a long sequence of neutrals, like control characters.
11484 Add assertion against STRONG_AL type. Slightly rearrange code
11485 that determines the type of a neutral given the first non-neutral
11486 that follows it.
11487 (bidi_level_of_next_char): Set next_en_pos to zero when
11488 invalidating its info.
11489
11490 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11491
11492 * xdisp.c (push_display_prop): Determine whether to record string
11493 or buffer position by IT->string, not by IT->method. Allow
11494 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11495 (move_it_vertically_backward): Don't look for character position
11496 immediately after the newline when in a continuation line.
11497 (Bug#9771, part 1)
11498
11499 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11500
11501 * window.c (coordinates_in_window): Rewrite and delabelize
11502 vertical border check. (Bug#5357) (Bug#9618)
11503
11504 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11505
11506 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11507 errors in XSetWindowBorder (bug#9310).
11508
11509 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11510
11511 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11512 avoid crash when xmalloc overrun checking is enabled.
11513
11514 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11515
11516 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11517 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11518 cursor motion with <left> and <right> arrow keys.
11519
11520 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11521 some callers set that themselves.
11522
11523 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11524
11525 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11526 display string and the previous row comes from the same string and
11527 is empty. (Bug#9739) (Bug#9738)
11528
11529 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11530
11531 * doc.c (get_doc_string): Encode file name (bug#9735).
11532
11533 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11534
11535 * bidi.c (bidi_level_of_next_char):
11536 * xdisp.c (get_visually_first_element): Remove old incorrect
11537 comments regarding the Unicode Line Separator character.
11538
11539 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11540
11541 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11542
11543 * alloc.c (Fgc_status): Do not access beyond zombies array
11544 boundary if nzombies > MAX_ZOMBIES.
11545 * alloc.c (dump_zombies): Add missing format specifier.
11546
11547 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11548
11549 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11550 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11551
11552 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11553 Some packages use them to denote characters with modifiers.
11554
11555 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11556
11557 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11558 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11559 matching a pp-number. Rename parameter var to var1.
11560
11561 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11562
11563 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11564
11565 2011-10-08 Glenn Morris <rgm@gnu.org>
11566
11567 * callint.c (Fcall_interactively): Give a more explicit error for the
11568 'c' case with a non-character input. (Bug#8479)
11569
11570 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11571
11572 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11573 lines.
11574 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11575 lines that are hscrolled on the left.
11576
11577 * dispnew.c (buffer_posn_from_coords): Account for a possible
11578 presence of header-line. (Bug#4426)
11579
11580 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11581
11582 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11583 Don't advertise functionality which we discourage or doesn't work.
11584
11585 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11586
11587 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11588 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11589 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11590 this makes Emacs dump core during garbage collection on rare
11591 occasions. sizeof is obviously inferior to offsetof here, so
11592 stick with offsetof.
11593 (GC_POINTER_ALIGNMENT): New macro.
11594 (mark_memory): Omit 3rd (offset) arg; caller changed.
11595 Don't assume EMACS_INT alignment is the same as pointer alignment.
11596
11597 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11598
11599 * keyboard.c (read_key_sequence_remapped): New var.
11600 (read_key_sequence): Compute remapping in the right buffer.
11601 (command_loop_1): Use read_key_sequence's remapping directly.
11602
11603 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11604
11605 * dired.c (file_name_completion): Don't expand file name.
11606 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11607 before checking file name handler.
11608
11609 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11610 they've been requested explicitly (bug#9591).
11611
11612 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11613
11614 * keymap.c (Fsingle_key_description): Use make_specified_string
11615 instead of build_string to build string from push_key_description.
11616 (Bug#5193)
11617
11618 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11619
11620 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11621 This fixes a Y2038 bug on 64-bit hosts.
11622 * buffer.c (reset_buffer):
11623 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11624 (Fclear_buffer_auto_save_failure):
11625 Use 0, not -1, to represent an unset failure time, since time_t
11626 might not be signed.
11627
11628 Remove dependency on glibc malloc internals.
11629 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11630 Move back here from lisp.h, but with their new implementations.
11631 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11632 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11633 * charset.c (charset_table_init): New static var.
11634 (syms_of_charset): Use it instead of xmalloc. This removes a
11635 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11636 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11637 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11638 Move back to alloc.c.
11639 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11640 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11641
11642 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11643
11644 * nsterm.m (windowDidResize): Call x_set_window_size only when
11645 ns_in_resize is true. Otherwise set pixelwidth/height and
11646 call change_frame_size (Bug#9628).
11647
11648 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11649
11650 Port --enable-checking=all to Fedora 14 x86-64.
11651 * charset.c (syms_of_charset): Also account for glibc malloc's
11652 internal overhead when calculating the initial malloc maximum.
11653
11654 Port --enable-checking=all to Fedora 14 x86.
11655 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11656 Move to lisp.h.
11657 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11658 (overrun_check_realloc, overrun_check_free):
11659 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11660 That way, xmalloc returns a properly-aligned pointer even if
11661 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11662 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11663 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11664 into account when calculating the initial malloc maximum.
11665 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11666 Move here from alloc.c, so that charset.c can use it too.
11667 Properly align; the old code wasn't right for common 32-bit hosts
11668 when configured with --enable-checking=all.
11669 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11670 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11671
11672 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11673
11674 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11675 use EDOM.
11676
11677 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11678
11679 * xdisp.c (compute_display_string_end): If there's no display
11680 string at CHARPOS, return -1.
11681
11682 * bidi.c (bidi_fetch_char): When compute_display_string_end
11683 returns a negative value, treat the character as a normal
11684 character not covered by a display string. (Bug#9624)
11685
11686 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11687
11688 * lread.c (Fread_from_string): Fix typo in docstring.
11689
11690 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11691
11692 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11693 newline, reseat the iterator instead of bidi-iterating there one
11694 character at a time. (Bug#9610)
11695 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11696 TO_CHARPOS if the bidi iterator is at base embedding level.
11697
11698 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11699
11700 * lread.c (readevalloop): Use correct code for NBSP.
11701 (read1): Likewise. (Bug#9608)
11702
11703 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11704
11705 * dbusbind.c (Fdbus_register_signal): When service is not
11706 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11707
11708 2011-09-25 Glenn Morris <rgm@gnu.org>
11709
11710 * buffer.c (truncate-lines): Doc fix.
11711
11712 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11713
11714 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11715 (Fset_window_next_buffers): Doc fix.
11716
11717 2011-09-24 Glenn Morris <rgm@gnu.org>
11718
11719 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11720
11721 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11722
11723 Fix minor problems found by static checking.
11724 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11725 * indent.c (Fvertical_motion): Fix == vs = typo.
11726
11727 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11728
11729 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11730 Default value is now t. Doc fix.
11731
11732 * indent.c (Fvertical_motion): Compute and apply the overshoot
11733 logic when moving up, not only when moving down. Fix the
11734 confusing name and values of the it_overshoot_expected variable;
11735 logic changes accordingly. (Bug#9254) (Bug#9549)
11736
11737 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11738 CHARPOS is covered by a display string which includes newlines.
11739 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11740 is covered by a display string with embedded newlines.
11741
11742 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11743
11744 * dbusbind.c (Fdbus_register_signal): Add match rule to
11745 Vdbus_registered_objects_table. (Bug#9581)
11746 (Fdbus_register_method, Vdbus_registered_objects_table):
11747 Fix docstring.
11748
11749 2011-09-24 Jim Meyering <meyering@redhat.com>
11750
11751 do not ignore write error for any output size
11752 The previous change was incomplete.
11753 While it makes emacs --batch detect the vast majority of stdout
11754 write failures, errors were still ignored whenever the output size is
11755 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11756 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11757 && echo FAIL: ignored write error
11758 FAIL: ignored write error
11759 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11760 && echo FAIL: ignored write error
11761 FAIL: ignored write error
11762 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11763
11764 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11765
11766 * emacs.c (Fkill_emacs): In noninteractive mode exit
11767 non-successfully if a write error occurred on stdout. (Bug#9574)
11768
11769 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11770
11771 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11772 the xassert test.
11773
11774 * dispextern.h (struct it): Update the comment documenting what
11775 can it->OBJECT be.
11776
11777 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11778
11779 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11780 a display string, extend search for cursor position to end of row.
11781 (find_row_edges): If the row ends in a newline from a display
11782 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11783 Handle the case of a display string with multiple newlines.
11784 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11785 non-empty line. Fixes confusing cursor motion with arrow keys at
11786 the beginning of a line that starts with whitespace.
11787
11788 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11789
11790 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11791 (bug#9493).
11792
11793 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11794
11795 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11796 boolean (Bug#9154).
11797
11798 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11799
11800 * xdisp.c (display_line): Record maximum and minimum buffer
11801 positions even if no glyphs were produced (e.g., by a zero-width
11802 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11803 buffer positions that will be removed from the glyph row because
11804 they don't fit.
11805 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11806 column is beyond frame width: don't subtract 1 "pixel" when
11807 computing width of the stretch.
11808 (reseat_at_next_visible_line_start): Undo the change made on
11809 2011-09-17 that saved paragraph information and restored it after
11810 the call to `reseat'. (Bug#9545)
11811
11812 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11813
11814 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11815 and turn window cursor on if cleared (Bug#9415).
11816
11817 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11818
11819 * search.c (boyer_moore): Take unibyte characters from pattern
11820 literally. (Bug#9458)
11821
11822 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11823
11824 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11825
11826 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11827
11828 Fix minor problem found by static checking.
11829 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11830 initialized, to pacify gcc -Wuninitialized.
11831
11832 * fileio.c: Report proper errno when syscall falls.
11833 (Finsert_file_contents): Save and restore errno,
11834 so that report_file_error outputs the correct diagnostic.
11835 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11836
11837 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11838
11839 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11840
11841 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11842
11843 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11844 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11845
11846 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11847
11848 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11849 about the current paragraph and restore it after the call to reseat.
11850
11851 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11852 (bidi_find_paragraph_start): Search back for paragraph beginning
11853 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11854 (bidi_move_to_visually_next): Only trigger paragraph-related
11855 computations when the last character is a newline or at EOB, not
11856 just any NEUTRAL_B. (Bug#9470)
11857
11858 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11859 truncated lines if point is covered by a display string. (Bug#9524)
11860
11861 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11862
11863 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11864 (cons_to_x_long): New function.
11865 (lisp_data_to_selection_data): Use it. Correct the test for
11866 short-versus-long data; it was negated. Break out of vector
11867 loop, for efficiency, when a long datum is discovered.
11868
11869 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11870
11871 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11872
11873 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11874
11875 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11876 GCC PR/17406) by declaring this function with external scope.
11877
11878 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11879
11880 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11881 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11882
11883 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11884
11885 * editfns.c (Fformat): Correctly handle text properties on "%%".
11886
11887 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11888
11889 * xterm.c (x_draw_composite_glyph_string_foreground):
11890 * w32term.c (x_draw_composite_glyph_string_foreground):
11891 * term.c (encode_terminal_code):
11892 * composite.c (composition_update_it, get_composition_id):
11893 * xdisp.c (get_next_display_element)
11894 (fill_composite_glyph_string): Add comments about special meaning
11895 of TAB characters in a composition.
11896
11897 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11898
11899 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11900 This occurs when processing a multibyte format.
11901 Problem reported by Wolfgang Jenker.
11902
11903 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11904
11905 * xdisp.c (try_cursor_movement): Only check for exact match if
11906 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11907
11908 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11909
11910 Remove unused external symbols.
11911 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11912 * xdisp.c (calc_pixel_width_or_height): Now static.
11913 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11914 * indent.c (check_display_width):
11915 * w32term.c: Fix comment to match code.
11916 * xterm.c, xterm.h (x_catching_errors): Remove.
11917
11918 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11919
11920 * xselect.c: Use signed conversions more consistently (Bug#9498).
11921 (selection_data_to_lisp_data): Assume incoming selection data are
11922 signed integers, not unsigned. This is to be consistent with
11923 outgoing selection data, which was modified to use signed integers
11924 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11925 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11926 expects long, not unsigned long.
11927
11928 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11929
11930 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11931 computation of loop end. Reported by Johan Bockgård
11932 <bojohan@gnu.org>.
11933
11934 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11935
11936 * frame.c (Fother_visible_frames_p): Function deleted.
11937
11938 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11939
11940 * indent.c (compute_motion): Process display vector front to back
11941 rather than the other way around. (Bug#2496)
11942
11943 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11944
11945 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11946
11947 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11948
11949 * minibuf.c (Fread_from_minibuffer): Doc fix.
11950
11951 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11952
11953 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11954 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11955
11956 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11957
11958 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11959 value for non-existent files.
11960
11961 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11962
11963 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11964 set its "size" to -1. This will set the modtime_size field of
11965 the corresponding buffer to -1, which is what
11966 verify-visited-file-modtime expects for files that do not exist.
11967 (Bug#9139)
11968
11969 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11970
11971 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11972 here ...
11973 * lisp.h: ... from here. push_key_description is no longer
11974 defined in keyboard.c, so its declaration should not be in
11975 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11976 logically belongs with push_key_description.
11977
11978 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11979
11980 * buffer.h: Include <sys/types.h> instead of <time.h>.
11981 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11982 Problem reported by Herbert J. Skuhra.
11983
11984 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11985
11986 * xml.c (parse_region): Make the parsing work for
11987 non-comment-starting XML files again (bug#9144).
11988
11989 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11990
11991 * image.c (gif_load): Fix calculation of bottom and right corner.
11992 (Bug#9468)
11993
11994 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11995
11996 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11997 redisplay in small windows.
11998
11999 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12000
12001 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12002
12003 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12004
12005 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12006 Operate on live windows only.
12007
12008 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12009
12010 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12011
12012 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12013
12014 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12015 only under bidi iteration.
12016
12017 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12018
12019 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12020
12021 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12022
12023 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12024 Without this fix, the command to link temacs failed due to an
12025 undefined symbol __builtin_isnan. This is because
12026 /usr/include/iso/math_c99.h #defines isnan(x) to
12027 __builtin_isnan(x), but the bundled gcc, which identifies itself
12028 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12029 a __builtin_isnan.
12030 * floatfns.c (isnan): #undef, and then #define to a clone of
12031 what's in data.c.
12032 (Fisnan): Always define, since it's always available now.
12033 (syms_of_floatfns): Always define isnan at the Lisp level.
12034
12035 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12036
12037 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12038
12039 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12040
12041 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12042 The previous code assumed that file offsets (off_t values) fit in
12043 EMACS_INT variables, which is not true on typical 32-bit hosts.
12044 The code messed up by falsely reporting buffer overflow in cases
12045 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12046 when "big" contains more than 2**29 bytes, even though this
12047 inserts just one byte and does not overflow the buffer.
12048 (Finsert_file_contents): Store file offsets as off_t
12049 values, not as EMACS_INT values. Check for overflow when
12050 converting between EMACS_INT and off_t. When checking for
12051 buffer overflow or for overlap, take the offsets into account.
12052 Don't use EMACS_INT for small values where int suffices.
12053 When checking for overlap, fix a typo: ZV was used where
12054 ZV_BYTE was intended.
12055 (Fwrite_region): Don't assume off_t fits into 'long'.
12056 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12057
12058 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12059
12060 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12061
12062 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12063
12064 sprintf-related integer and memory overflow issues (Bug#9412).
12065
12066 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12067 (esprintf, exprintf, evxprintf): New functions.
12068 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12069 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12070 (modify_event_symbol): Do not assume that the length of
12071 name_alist_or_stem is safe to alloca and fits in int.
12072 (Fexecute_extended_command): Likewise for function name and binding.
12073 (Frecursion_depth): Wrap around reliably on integer overflow.
12074 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12075 since some callers pass EMACS_INT values.
12076 (Fsingle_key_description): Don't crash if symbol name contains more
12077 than MAX_ALLOCA bytes.
12078 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12079 (get_minibuffer): Arg is now EMACS_INT, not int.
12080 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12081 (esprintf, exprintf, evxprintf): New decls.
12082 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12083
12084 * dbusbind.c (signature_cat): New function.
12085 (xd_signature, Fdbus_register_signal):
12086 Do not overrun buffer; instead, report string overflow.
12087
12088 * dispnew.c (add_window_display_history): Don't overrun buffer.
12089 Truncate instead; this is OK since it's just a log.
12090
12091 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12092 even if the time zone offset is outlandishly large.
12093 Don't mishandle offset == INT_MIN.
12094
12095 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12096 when creating daemon; the previous buffer-overflow check was incorrect.
12097
12098 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12099 which has the guts of the old verror function.
12100
12101 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12102 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12103
12104 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12105 (font_unparse_xlfd): Don't blindly alloca long strings.
12106 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12107 fits in int, when using sprintf. Use single snprintf to count
12108 length of string rather than counting it via multiple sprintfs;
12109 that's simpler and more reliable.
12110 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12111 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12112 sprintf, in case result does not fit in int.
12113
12114 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12115 (fontset_from_font): Print it.
12116
12117 * frame.c (tty_frame_count): Now printmax_t, not int.
12118 (make_terminal_frame, set_term_frame_name): Print it.
12119 (x_report_frame_params): In X, window IDs are unsigned long,
12120 not signed long, so print them as unsigned.
12121 (validate_x_resource_name): Check for implausibly long names,
12122 and don't assume name length fits in 'int'.
12123 (x_get_resource_string): Don't blindly alloca invocation name;
12124 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12125 not fit in int.
12126
12127 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12128 (xg_check_special_colors, xg_set_geometry):
12129 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12130
12131 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12132 Use esprintf, not sprintf, in case result does not fit in int.
12133
12134 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12135 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12136 it as a large positive number.
12137 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12138 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12139
12140 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12141 in case result does not fit in int.
12142
12143 * print.c (float_to_string): Detect width overflow more reliably.
12144 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12145 buffer overrun. Don't assume list length fits in 'int'. Treat
12146 print length of 0 as 0, not as infinity; to be consistent with other
12147 uses of print length in this function. Don't overflow print length
12148 index. Don't assume hash table size fits in 'long', or that
12149 vectorlike size fits in 'unsigned long'.
12150
12151 * process.c (make_process): Use printmax_t, not int, to format
12152 process-name gensyms.
12153
12154 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12155
12156 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12157 to avoid potential buffer overrun.
12158
12159 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12160 if X resource line is longer than 512 bytes.
12161
12162 * xfns.c (x_window): Make sprintf buffer a bit bigger
12163 to avoid potential buffer overrun.
12164
12165 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12166
12167 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12168
12169 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12170
12171 Integer overflow fixes for scrolling, etc.
12172 Without these, Emacs silently mishandles large integers sometimes.
12173 For example, "C-u 4294967297 M-x recenter" was treated as if
12174 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12175
12176 * xdisp.c (try_window_id): Check Emacs fixnum range before
12177 converting to 'int'.
12178
12179 * window.c (window_scroll_line_based, Frecenter):
12180 Check that an Emacs fixnum is in range before assigning it to 'int'.
12181 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12182 values converted from Emacs fixnums.
12183 (Frecenter): Don't wrap around a line count if it is out of 'int'
12184 range; instead, treat it as an extreme value.
12185 (Fset_window_configuration, compare_window_configurations):
12186 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12187
12188 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12189 that can exceed INT_MAX. Check that EMACS_INT value is in range
12190 before assigning it to the (possibly-narrower) index.
12191 (match_limit): Don't assume that a fixnum can fit in 'int'.
12192
12193 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12194 exceed INT_MAX.
12195
12196 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12197 (Fvertical_motion): Don't wrap around LINES values that don't fit
12198 in 'int'. Instead, treat them as extreme values. This is good
12199 enough for windows, which can't have more than INT_MAX lines anyway.
12200
12201 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12202
12203 * Require libxml/parser.h to avoid compilation warning.
12204
12205 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12206
12207 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12208 since this reportedly can destroy thread storage.
12209
12210 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12211
12212 * syntax.c (find_defun_start): Update all cache variables if
12213 exiting early (Bug#9401).
12214
12215 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12216
12217 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12218
12219 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12220 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12221 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12222
12223 * term.c (tty_append_glyph): New function.
12224 (produce_stretch_glyph): Static function and its prototype deleted.
12225
12226 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12227 Add prototypes.
12228
12229 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12230
12231 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12232 when checking :margin (Bug#9390).
12233 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12234 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12235 so that the name doesn't mislead. All uses changed.
12236
12237 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12238
12239 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12240 set_tty_hooks.
12241
12242 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12243
12244 * xdisp.c (move_it_to): Don't bail out early when reaching
12245 position beyond to_charpos, if we are scanning backwards.
12246 (move_it_vertically_backward): When DY == 0, make sure we get to
12247 the first character in the line after the newline.
12248
12249 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12250
12251 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12252 (ccl_driver): Do not generate an out-of-range pointer.
12253 (Fccl_execute_on_string): Remove unnecessary check for
12254 integer overflow, noted by Stefan Monnier in
12255 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12256 Remove a FIXME that didn't need fixing.
12257 Simplify the newly-introduced buffer reallocation code.
12258
12259 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12260
12261 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12262
12263 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12264
12265 Integer and memory overflow issues (Bug#9196).
12266
12267 * doc.c (get_doc_string): Rework so that
12268 get_doc_string_buffer_size is the actual buffer size, rather than
12269 being 1 less than the actual buffer size; this makes xpalloc more
12270 convenient.
12271
12272 * image.c (x_allocate_bitmap_record, cache_image):
12273 * xselect.c (Fx_register_dnd_atom):
12274 Simplify previous changes by using xpalloc.
12275
12276 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12277 since either will do and ptrdiff_t is convenient with xpalloc.
12278
12279 * charset.c (charset_table_size)
12280 (struct charset_sort_data.priority): Now ptrdiff_t.
12281 (charset_compare): Don't overflow if priorities differ greatly.
12282 (Fsort_charsets): Don't assume list length fits in int.
12283 Check for size-calculation overflow when allocating sort data.
12284 (syms_of_charset): Allocate an initial charset table that is
12285 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12286
12287 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12288
12289 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12290 The actual value is always <= INT_MAX, and leaving it unsigned made
12291 overflow checking harder.
12292
12293 * dispextern.h (struct glyph_matrix.rows_allocated)
12294 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12295 with xpalloc. The values are still always <= INT_MAX.
12296
12297 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12298
12299 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12300 (SAFE_NALLOCA): New macro.
12301
12302 * region-cache.c (struct boundary.pos, find_cache_boundary)
12303 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12304 (set_cache_region, invalidate_region_cache)
12305 (revalidate_region_cache, know_region_cache, region_cache_forward)
12306 (region_cache_backward, pp_cache):
12307 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12308 so that ptrdiff_t * can be passed to xpalloc.
12309 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12310 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12311 (pp_cache): Don't assume cache_len fits in int.
12312 * region-cache.h: Adjust extern decls to match.
12313
12314 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12315 EMACS_INT, since either will do, for xpalloc.
12316
12317 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12318 (xnmalloc, xnrealloc, xpalloc): New functions.
12319
12320 * bidi.c (bidi_shelve_header_size): New constant.
12321 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12322 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12323
12324 * bidi.c (bidi_cache_shrink):
12325 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12326 (overlay_strings):
12327 Don't update size of array until after memory allocation succeeds,
12328 because xmalloc/xrealloc may not return.
12329 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12330 now that we have proper integer overflow checking.
12331 (record_overlay_string, overlay_strings): Catch overflows when
12332 calculating size of overlay_str_buf.
12333
12334 * callproc.c (Fcall_process): Check for size overflow when
12335 calculating size of args2.
12336 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12337 Normally we prefer signed values, but sticking with ptrdiff_t would
12338 require adding more-complicated checks.
12339
12340 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12341 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12342 Redo buffer-overflow calculations to avoid integer overflow.
12343 Add a FIXME comment where memory seems to be over-allocated.
12344
12345 * character.c (Fstring): Check for size-calculation overflow.
12346
12347 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12348 unnecessary integer overflow. Check for size overflow.
12349 (encode_coding_object): Don't update size until xmalloc succeeds.
12350
12351 * composite.c (get_composition_id): Check for overflow in glyph
12352 length calculations.
12353
12354 Integer and memory overflow fixes for display code.
12355 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12356 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12357 (scrolling_window): Check for overflow in size calculations.
12358 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12359 Don't assume glyph table len fits in int.
12360 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12361 (row_table_size): Now ptrdiff_t, not int.
12362 (scrolling_window): Avoid overflow in size calculations.
12363 Don't update size until allocation succeeds.
12364 * fns.c (concat): Check for overflow in size calculations.
12365 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12366 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12367 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12368
12369 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12370 (get_doc_string): Check for size calculation overflow.
12371 Don't update size until allocation succeeds.
12372 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12373 EMACS_INT, where ptrdiff_t will do.
12374 (Fsubstitute_command_keys): Check for string overflow.
12375
12376 * editfns.c (set_time_zone_rule): Don't assume environment length
12377 fits in int.
12378 (message_length): Now ptrdiff_t, not int.
12379 (Fmessage_box): Don't update size until allocation succeeds.
12380 Don't assume message length fits in int.
12381 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12382
12383 * emacs.c (main): Do not reallocate argv, since there is a null at
12384 the end that can be overwritten, and this way there's no need to
12385 worry about size-calculation overflow.
12386 (sort_args): Check for size-calculation overflow.
12387
12388 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12389 alloc succeeds.
12390 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12391
12392 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12393 (x_set_scroll_bar_width, x_figure_window_size):
12394 Check for integer overflow.
12395 (x_set_alpha): Do not assume XINT fits in int.
12396
12397 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12398 This is for the members text_lines, text_cols, total_lines, total_cols,
12399 where the system imposes an 'int' limit.
12400
12401 * fringe.c (Fdefine_fringe_bitmap):
12402 Don't update size until alloc works.
12403
12404 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12405 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12406
12407 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12408 Check for size-calculation overflow.
12409 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12410 do, as we prefer signed integers.
12411 (id_to_widget.max_size, id_to_widget.used)
12412 (xg_store_widget_in_map, xg_remove_widget_from_map)
12413 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12414 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12415 Use and return ptrdiff_t, not int.
12416 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12417 * gtkutil.h: Change prototypes to match the above.
12418
12419 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12420 are duplicate now that they've been promoted to lisp.h.
12421 (x_allocate_bitmap_record, x_alloc_image_color)
12422 (make_image_cache, cache_image, xpm_load):
12423 Don't update size until alloc is done.
12424 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12425 (x_detect_edges):
12426 Check for size calculation overflow.
12427 (ct_colors_allocated_max): New constant.
12428 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12429 overflow.
12430
12431 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12432 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12433 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12434 Use ptrdiff_t, not int, to count maps.
12435 (read_char_minibuf_menu_prompt): Check for overflow in size
12436 calculations. Don't update size until allocation succeeds.
12437 Redo calculations to avoid overflow.
12438 * keyboard.h: Change prototypes to match the above.
12439
12440 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12441 to count maps.
12442 (current_minor_maps): Check for size calculation overflow.
12443 * keymap.h: Change prototypes to match the above.
12444
12445 * lread.c (read1, init_obarray): Don't update size until alloc done.
12446
12447 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12448 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12449
12450 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12451 Now ptrdiff_t, not int.
12452 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12453 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12454
12455 * process.c (Fnetwork_interface_list): Check for overflow
12456 in size calculation.
12457
12458 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12459
12460 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12461 overflow. Don't bother calling xmalloc when xrealloc will do.
12462
12463 * search.c (Freplace_match): Check for size calculation overflow.
12464 (Fset_match_data): Don't assume list lengths fit in 'int'.
12465
12466 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12467 for command line length. Do not attempt to address one before the
12468 beginning of an array, as that's not portable.
12469
12470 * term.c (max_frame_lines): Remove; unused.
12471 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12472 not int.
12473 (encode_terminal_code, calculate_costs): Check for size
12474 calculation overflow.
12475 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12476 table lengths and related sizes. Don't update size until alloc
12477 done. Redo calculations to avoid overflow.
12478 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12479
12480 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12481 subtracting pointers.
12482 (gobble_line): Check for overflow more carefully. Don't update size
12483 until alloc done.
12484
12485 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12486 Don't update size until alloc done.
12487 Redo size calculations to avoid overflow.
12488 Check for size calculation overflow.
12489 (main) [DEBUG]: Fix typo in invoking tparam1.
12490
12491 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12492 Use ptrdiff_t, not int, for sizes.
12493 (store_mode_line_noprop_char): Don't update size until alloc done.
12494
12495 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12496 Use ptrdiff_t, not int, for sizes.
12497 (Finternal_make_lisp_face, cache_face):
12498 Check for size calculation overflow.
12499 (cache_face): Treat size calculation overflows as if they were
12500 memory exhaustion (the usual treatment), rather than aborting.
12501
12502 * xfns.c (x_encode_text, x_set_name_internal)
12503 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12504 sizes, since they can exceed INT_MAX in size. Check for size
12505 calculation overflow.
12506
12507 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12508 (xg_select): Check for size calculation overflow.
12509 Don't update size until alloc done.
12510
12511 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12512 as sprintf is limited to int lengths.
12513
12514 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12515 (X_LONG_MIN): New macros.
12516 Use them to make the following changes clearer.
12517 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12518 This change doesn't affect the value now, but it may help remind
12519 future maintainers not to raise the value too much later.
12520 (SELECTION_QUANTUM): Remove, replacing with ...
12521 (selection_quantum): ... new function, which avoids overflow.
12522 All uses changed.
12523 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12524 assumption that selection length fits in 'int'.
12525 (x_reply_selection_request, x_handle_selection_request)
12526 (x_get_window_property, receive_incremental_selection)
12527 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12528 (lisp_data_to_selection_data, clean_local_selection_data):
12529 Use ptrdiff_t, not int, to record length of selection.
12530 (x_reply_selection_request, x_get_window_property)
12531 (receive_incremental_selection, x_property_data_to_lisp):
12532 Redo calculations to avoid overflow.
12533 (x_reply_selection_request): When sending hint, ceiling it at
12534 X_LONG_MAX rather than relying on wraparound overflow to send
12535 something.
12536 (x_get_window_property, receive_incremental_selection)
12537 (lisp_data_to_selection_data, x_property_data_to_lisp):
12538 Check for size-calculation overflow.
12539 (x_get_window_property, receive_incremental_selection)
12540 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12541 Don't store size until memory allocation succeeds.
12542 (x_get_window_property): Plug memory leak on memory exhaustion.
12543 Don't double-block input; malloc is safe here. Don't assume 2**34
12544 - 4 fits in unsigned long. Add an xassert to check
12545 XGetWindowProperty overflow. Be more careful about overflow
12546 calculations, and distinguish size from memory overflow better.
12547 (receive_incremental_selection): When tracing, don't assume
12548 unsigned int is less than INT_MAX.
12549 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12550 harmful) conversions of unsigned short to int.
12551 (lisp_data_to_selection_data): Don't assume that integers
12552 in the range -65535 through -1 fit in an X unsigned short.
12553 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12554 result parameters unless successful. Rely on cons_to_unsigned
12555 to report problems with elements; the old code wasn't right anyway.
12556 (x_check_property_data): Check for int overflow; we cannot use
12557 a wider type due to X limits.
12558 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12559
12560 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12561
12562 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12563 (x_term_init): Check for size calculation overflow.
12564 (x_color_cells): Don't store size until memory allocation succeeds.
12565 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12566 Don't assume alloca size is less than MAX_ALLOCA.
12567 (x_term_init): Don't assume length fits in int (sprintf is limited
12568 to int size).
12569
12570 Use ptrdiff_t for composition IDs.
12571 * character.c (lisp_string_width):
12572 * composite.c (composition_table_size, n_compositions)
12573 (get_composition_id, composition_gstring_from_id):
12574 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12575 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12576 * window.c (Frecenter):
12577 Use ptrdiff_t, not int, for composition IDs.
12578 * composite.c (get_composition_id): Check for integer overflow.
12579 * composite.h: Adjust prototypes to match the above changes.
12580
12581 Use ptrdiff_t for hash table indexes.
12582 * category.c (hash_get_category_set):
12583 * ccl.c (ccl_driver):
12584 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12585 * coding.c (coding_system_charset_list, detect_coding_system):
12586 * coding.h (struct coding_system.id):
12587 * composite.c (get_composition_id, gstring_lookup_cache):
12588 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12589 * image.c (xpm_get_color_table_h):
12590 * lisp.h (hash_lookup, hash_put):
12591 * minibuf.c (Ftest_completion):
12592 Use ptrdiff_t for hash table indexes, not int (which is too
12593 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12594 32-bit --with-wide-int hosts).
12595
12596 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12597 Add a FIXME comment about memory leaks.
12598 (syms_of_charset): Don't assume xmalloc returns.
12599
12600 Don't assume that stated character widths fit in int.
12601 * character.c (Fchar_width, c_string_width, lisp_string_width):
12602 * character.h (CHAR_WIDTH):
12603 * indent.c (MULTIBYTE_BYTES_WIDTH):
12604 Use sanitize_char_width to avoid undefined and/or bad behavior
12605 with outlandish widths.
12606 * character.h (sanitize_tab_width): Rename from sanitize_width,
12607 now that we have two such functions. All uses changed.
12608 (sanitize_char_width): New inline function.
12609
12610 Don't assume that tab-width fits in int.
12611 * character.h (sanitize_width): New inline function.
12612 (SANE_TAB_WIDTH): New macro.
12613 (ASCII_CHAR_WIDTH): Use it.
12614 * indent.c (sane_tab_width): Remove. All uses replaced by
12615 SANE_TAB_WIDTH (current_buffer).
12616 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12617
12618 * fileio.c: Integer overflow issues with file modes.
12619 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12620
12621 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12622 Remove unreachable code.
12623 (read_hex, load_charset_map_from_file): Check for integer overflow.
12624
12625 * xterm.c: Don't go over XClientMessageEvent limit.
12626 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12627 (x_send_scroll_bar_event): Likewise. Check that the size does not
12628 exceed limits imposed by XClientMessageEvent, as well as the usual
12629 ptrdiff_t and size_t limits.
12630
12631 * keyboard.c: Overflow, signedness and related fixes.
12632 (make_lispy_movement): Use same integer type in forward decl
12633 that is used in the definition.
12634 (read_key_sequence, keyremap_step):
12635 Change bufsize argument back to int, undoing my 2011-03-30 change.
12636 We prefer signed types, and int is wide enough here.
12637 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12638 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12639 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12640 length, not size_t. Use ptrdiff_t for index, not int.
12641 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12642 possibility of integer overflow.
12643
12644 Overflow, signedness and related fixes for images.
12645
12646 * dispextern.h (struct it.stack[0].u.image.image_id)
12647 (struct_it.image_id, struct image.id, struct image_cache.size)
12648 (struct image_cache.used, struct image_cache.ref_count):
12649 * gtkutil.c (update_frame_tool_bar):
12650 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12651 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12652 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12653 * nsmenu.m (update_frame_tool_bar):
12654 * xdisp.c (calc_pixel_width_or_height):
12655 * xfns.c (image_cache_refcount):
12656 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12657 on typical 64-bit hosts.
12658
12659 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12660 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12661 Omit unnecessary casts to int.
12662 (parse_image_spec): Check that integers fall into 'int' range
12663 when the callers expect that.
12664 (image_ascent): Redo ascent calculation to avoid int overflow.
12665 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12666 (lookup_image): Remove unnecessary tests.
12667 (xbm_image_p): Locals are now of int, not EMACS_INT,
12668 since parse_image_check makes sure they fit into int.
12669 (png_load, gif_load, svg_load_image):
12670 Prefer int to unsigned where either will do.
12671 (tiff_handler): New function, combining the cores of the
12672 old tiff_error_handler and tiff_warning_handler.
12673 This function is rewritten to use vsnprintf and thereby avoid
12674 stack buffer overflows. It uses only the features of vsnprintf
12675 that are common to both POSIX and native Microsoft.
12676 (tiff_error_handler, tiff_warning_handler): Use it.
12677 (tiff_load, gif_load, imagemagick_load_image):
12678 Don't assume :index value fits in 'int'.
12679 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12680 (imagemagick_load_image): Check that crop parameters fit into
12681 the integer types that MagickCropImage accepts. Don't assume
12682 Vimagemagick_render_type has a nonnegative value. Don't assume
12683 size_t fits in 'long'.
12684 (gs_load): Use printmax_t to print the widest integers possible.
12685 Check for integer overflow when computing image height and width.
12686
12687 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12688
12689 * xdisp.c (redisplay_window): Don't force window start if point
12690 will be invisible in the resulting window. (Bug#9324)
12691
12692 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12693
12694 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12695 the display spec is of the form `(space ...)'.
12696 (handle_display_spec): Return the value returned by
12697 handle_single_display_spec, not just 1 or zero.
12698 (handle_single_display_spec): If the display spec is of the form
12699 `(space ...)', and specifies display in the text area, return 2
12700 rather than 1.
12701 (try_cursor_movement): Check for the need to scroll more
12702 accurately, and prefer exact match for point under bidi.
12703 Don't advance `row' beyond the last row of the window.
12704
12705 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12706 into disp_prop; all users changed.
12707
12708 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12709 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12710 for the text covered by the display property.
12711
12712 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12713
12714 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12715 Change return value to nil.
12716 (Frecord_buffer): Delete unused function.
12717
12718 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12719
12720 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12721 buffers, return left-to-right.
12722 (set_cursor_from_row): Consider candidate row a win if its glyph
12723 represents a newline and point is on that newline. Fixes cursor
12724 positioning on the newline at EOL of R2L text within L2R
12725 paragraph, and vice versa.
12726 (try_cursor_movement): Check continued rows, in addition to
12727 continuation rows. Fixes unwarranted scroll when point enters a
12728 continued line of R2L text within an L2R paragraph, or vice versa.
12729 (cursor_row_p): Consider the case of point being equal to
12730 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12731 from the end of a short line to the beginning of a continued line
12732 of R2L text within L2R paragraph.
12733 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12734 composed characters.
12735
12736 * bidi.c (bidi_check_type): Use xassert.
12737 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12738 members.
12739
12740 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12741
12742 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12743 a character.
12744
12745 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12746
12747 * nsfont.m (ns_otf_to_script): Fix typo.
12748
12749 2011-08-22 Kenichi Handa <handa@m17n.org>
12750
12751 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12752 extra slot even if the purpose is char-code-property-table.
12753
12754 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12755
12756 * xdisp.c (redisplay_window): When computing centering_position,
12757 account for the height of the header line. (Bug#8874)
12758
12759 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12760 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12761 candidate is selected by the mouse, and that candidate has a
12762 composed character under the mouse.
12763
12764 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12765 coordinates reported by pos-visible-in-window-p for a composed
12766 character in column zero.
12767
12768 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12769
12770 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12771
12772 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12773
12774 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12775 consider it a hit if to_charpos is anywhere in the range of the
12776 composed buffer positions.
12777
12778 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12779
12780 * image.c (gif_load): Don't assume that each subimage has the same
12781 dimensions as the base image. Handle disposal method that is
12782 "undefined" by the gif spec (Bug#9335).
12783
12784 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12785
12786 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12787 (Fcondition_case): Document `debug' symbol in error handler.
12788
12789 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12790
12791 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12792 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12793 from an Org mode buffer to a Speedbar frame.
12794
12795 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12796 a composition, take its buffer position from IT->cmp_it.charpos.
12797 Fixes cursor positioning at the beginning of a line that begins
12798 with a composed character.
12799
12800 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12801
12802 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12803 character bidirectional type, use STRONG_L instead. Fixes crashes
12804 in a buffer produced by `describe-categories'.
12805
12806 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12807 members before the level stack, so they would be saved and
12808 restored when copying iterator state. Fixes incorrect reordering
12809 around TABs covered by display properties.
12810
12811 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12812
12813 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12814
12815 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12816
12817 * eval.c (internal_condition_case, internal_condition_case_1)
12818 (internal_condition_case_2, internal_condition_case_n):
12819 Remove unnecessary aborts (Bug#9081).
12820
12821 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12822
12823 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12824 has no `load' handler, try opening the file locally. (Bug#9311)
12825
12826 2011-08-16 Ken Brown <kbrown@cornell.edu>
12827
12828 * gmalloc.c: Expand comment.
12829
12830 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12831
12832 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12833 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12834
12835 2011-08-16 Ken Brown <kbrown@cornell.edu>
12836
12837 Fix memory allocation problems in Cygwin build (Bug#9273).
12838
12839 * unexcw.c ( __malloc_initialized): Declare external variable.
12840 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12841
12842 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12843 New variables.
12844 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12845 dumped emacs.
12846 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12847 in the static heap.
12848 [CYGWIN] (special_realloc): New function.
12849 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12850 requests to realloc storage in the static heap.
12851
12852 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12853
12854 * bidi.c (bidi_initialize): Remove unused local.
12855
12856 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12857
12858 * bidimirror.h:
12859 * biditype.h: Remove file.
12860 * makefile.w32-in ($(BLD)/bidi.$(O)):
12861 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12862
12863 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12864
12865 * chartab.c: Improve commentary for the uniprop_table API.
12866
12867 * bidi.c (bidi_paragraph_init): Support zero value of
12868 bidi_ignore_explicit_marks_for_paragraph_level.
12869 (bidi_initialize): Use uniprop_table instead of including
12870 biditype.h and bidimirror.h.
12871
12872 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12873 coordinates of the iterator when restoring from ppos_it.
12874 (Bug#9296)
12875
12876 2011-08-14 Kenichi Handa <handa@m17n.org>
12877
12878 * process.c (create_process): Call setup_process_coding_systems
12879 after the pid of the process is set to -1 (Bug#8162).
12880
12881 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12882
12883 * xdisp.c (move_it_in_display_line_to): Don't invoke
12884 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12885 ppos_it. Fixes vertical cursor motion when line beginning is
12886 covered by an image. (Bug#9296)
12887
12888 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12889
12890 * nsterm.h (ns_run_ascript): Declare.
12891 (NSAPP_DATA2_RUNASSCRIPT): Define.
12892
12893 * nsfns.m (as_script, as_result, as_status): New static variables.
12894 (ns_run_ascript): New function.
12895 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12896 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12897 the event loop. Get status from as_status (Bug#7276).
12898
12899 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12900 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12901 the event loop (Bug#7276).
12902
12903 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12904
12905 * gnutls.c (QCgnutls_bootprop_priority)
12906 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12907 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12908 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12909 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12910 (QCgnutls_bootprop_verify_hostname_error)
12911 (QCgnutls_bootprop_callbacks_verify): Rename from
12912 Qgnutls_bootprop_..., all uses changed.
12913
12914 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12915 uses changed.
12916
12917 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12918
12919 * xfaces.c (Qframe_set_background_mode): Now static.
12920 * dispextern.h (Qframe_set_background_mode): Remove decl.
12921
12922 * process.c (Fnetwork_interface_info): Declare local only if needed.
12923
12924 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12925
12926 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12927 (Fnetwork_interface_list): Allocate in increments of bytes instead
12928 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12929 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12930 sockaddr.
12931 (struct ifflag_def): notrailers is smart on OSX.
12932 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12933 Get hardware address with getifaddrs if available.
12934
12935 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12936
12937 * xdisp.c (iterate_out_of_display_property): xassert that
12938 IT->position is set to within IT->object's boundaries. Break from
12939 the loop as soon as EOB is reached; avoids infloops in redisplay
12940 when IT->position is set up wrongly due to some bug.
12941 Set IT->current to match the bidi iterator unconditionally.
12942 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12943 entry. Force push_it to save on the stack the current
12944 buffer/string position, to be restored by pop_it. Fix flags in
12945 the iterator structure wrt the object coming from a display
12946 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12947 properties. (Bug#9284)
12948
12949 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12950
12951 * fontset.c (fontset_get_font_group): Add proper type checks.
12952 (Bug#9172)
12953
12954 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12955
12956 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12957 and LC_VERSION_MIN_MACOSX.
12958 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12959 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12960
12961 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12962
12963 * xdisp.c (forward_to_next_line_start): Allow to use the
12964 no-display-properties-and-no-overlays under bidi display.
12965 Set disp_pos in the bidi iterator to avoid searches for display
12966 properties and overlays.
12967
12968 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12969
12970 * editfns.c (Fset_time_zone_rule): Document relationship with the
12971 setenv function.
12972
12973 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12974 the font entity extracted from the cache (Bug#8109).
12975
12976 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12977
12978 * composite.c (autocmp_chars): Don't reset point. That is done by
12979 restore_point_unwind (Bug#5984).
12980
12981 2011-08-07 Juri Linkov <juri@jurta.org>
12982
12983 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12984 to show the arg `TIME' instead of `TIMEVAL'.
12985
12986 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12987
12988 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12989 display property strides EOL and includes a newline, as in
12990 longlines-mode. (Bug#9254)
12991 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12992 word-wrap under bidirectional display. (Bug#9224)
12993
12994 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12995 is non-zero, even if the data buffer is NULL. Fixes a crash in
12996 vertical-motion with longlines-mode. (Bug#9254)
12997
12998 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12999
13000 * bidi.c <bidi_cache_total_alloc>: Now static.
13001 (bidi_initialize): Initialize bidi_cache_total_alloc.
13002
13003 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13004 cache. (Bug#9221)
13005
13006 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13007 amount allocated this far in `bidi_cache_total_alloc'.
13008 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13009 non-zero, only free the data buffer without restoring the cache
13010 contents. All callers changed.
13011
13012 * dispextern.h (bidi_unshelve_cache): Update prototype.
13013
13014 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13015 (move_it_in_display_line, move_it_to)
13016 (move_it_vertically_backward, move_it_by_lines): Replace the call
13017 to xfree to an equivalent call to bidi_unshelve_cache.
13018 (move_it_in_display_line_to): Fix logic of returning
13019 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13020
13021 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13022
13023 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13024 came from a string character with a `cursor' property. (Bug#9229)
13025
13026 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13027
13028 * Makefile.in (LIB_PTHREAD): New variable.
13029 (LIBES): Add LIB_PTHREAD (Bug#9216).
13030
13031 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13032 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13033
13034 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13035
13036 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13037
13038 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13039
13040 * xterm.c (x_find_topmost_parent): New function.
13041 (x_set_frame_alpha): Find topmost parent window with
13042 x_find_topmost_parent and set the property there also (bug#9181).
13043 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13044
13045 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13046
13047 * callproc.c (Fcall_process): Avoid vfork clobbering
13048 the local vars buffer, coding_systems, current_dir.
13049
13050 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13051
13052 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13053
13054 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13055
13056 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13057 so that it is not optimized away.
13058
13059 * xdisp.c (compute_display_string_pos): Remove unused local.
13060
13061 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13062
13063 Fix slow cursor motion and scrolling in large buffers with
13064 selective display, like Org Mode buffers. (Bug#9218)
13065
13066 * dispextern.h (struct bidi_it): New member disp_prop_p.
13067
13068 * xdisp.c: Remove one-slot cache of display string positions.
13069 (compute_display_string_pos): Accept an additional argument
13070 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13071 for a display string or property. If found, set DISP_PROP_P
13072 non-zero.
13073
13074 * bidi.c (bidi_fetch_char): Accept an additional argument
13075 DISP_PROP_P, and pass it to compute_display_string_pos.
13076 Only handle text covered by a display string if DISP_PROP_P is returned
13077 non-zero. All callers of bidi_fetch_char changed.
13078
13079 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13080
13081 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13082
13083 2010-12-03 Don March <don@ohspite.net>
13084
13085 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13086 last character M-[char] is translated to ESC [char] (bug#7541).
13087
13088 2011-08-02 Kenichi Handa <handa@m17n.org>
13089
13090 * lisp.h (uniprop_table): Extern it.
13091
13092 * chartab.c (uniprop_table): Make it non-static.
13093
13094 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13095
13096 * xdisp.c (forward_to_next_line_start): Accept additional argument
13097 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13098 on the newline.
13099 (reseat_at_next_visible_line_start): Use the bidi iterator state
13100 returned by forward_to_next_line_start to restore the state of
13101 it->bidi_it after backing up to previous newline. (Bug#9212)
13102
13103 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13104
13105 * regex.c (re_comp): Protoize.
13106 (re_exec): Fix return type.
13107 (regexec): Fix type of `ret'. (Bug#9203)
13108
13109 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13110
13111 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13112 This is needed if max-image-size is a floating-point number.
13113
13114 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13115
13116 * print.c (print_object): Print empty symbol as ##.
13117
13118 * lread.c (read1): Read ## as empty symbol.
13119
13120 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13121
13122 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13123 setting frame foreground color (Bug#9175).
13124 (x_set_background_color): Likewise.
13125
13126 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13127 contents (Bug#9176).
13128 (EmacsTooltip -init): Remove bezels and add shadows to
13129 tooltip windows.
13130
13131 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13132 or scroll bar (Bug#8470).
13133
13134 * nsfont.m (nsfont_open): Remove assignment to voffset and
13135 unnecessary vars hshink, expand, hd, full_height, min_height.
13136 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13137
13138 * nsterm.h (nsfont_info): Remove voffset field.
13139
13140 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13141
13142 Implement strike-through and overline on NextStep (Bug#8863).
13143
13144 * nsfont.m (nsfont_open): Use underline position provided by font,
13145 instead of hard-coded value of 2.
13146 (nsfont_draw): Call ns_draw_text_decoration instead.
13147
13148 * nsterm.h: Add declaration for ns_draw_text_decoration.
13149
13150 * nsterm.m (ns_draw_text_decoration): New function for drawing
13151 underline, overline, and strike-through.
13152 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13153 ns_draw_text_decoration. Change treatment of cursor drawing to
13154 accommodate underlining, etc.
13155
13156 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13157
13158 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13159 default.
13160
13161 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13162
13163 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13164 Without this fix, if a signal arrives just after memory fills up,
13165 'malloc' might be invoked reentrantly.
13166
13167 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13168 In other words, assume that every image size is allowed, on non-X
13169 hosts. This assumption is probably wrong, but it lets Emacs compile.
13170
13171 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13172
13173 * regex.c (re_iswctype): Convert return values to boolean.
13174
13175 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13176
13177 * xdisp.c (compute_display_string_pos): Don't use cached display
13178 string position if the buffer had its restriction changed.
13179 (Bug#9184)
13180
13181 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13182
13183 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13184
13185 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13186
13187 Integer signedness and overflow and related fixes. (Bug#9079)
13188
13189 * bidi.c: Integer size and overflow fixes.
13190 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13191 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13192 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13193 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13194 (bidi_find_other_level_edge):
13195 Use ptrdiff_t instead of EMACS_INT where either will do.
13196 This works better on 32-bit hosts configured --with-wide-int.
13197 (bidi_cache_ensure_space): Check for size-calculation overflow.
13198 Use % rather than repeated addition, for better worst-case speed.
13199 Don't set bidi_cache_size until after xrealloc returns, because it
13200 might not return.
13201 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13202 (bidi_cache_ensure_space): Also check that the bidi cache size
13203 does not exceed that of the largest Lisp string or buffer. See Eli
13204 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13205
13206 * alloc.c (__malloc_size_t): Remove.
13207 All uses replaced by size_t. See Andreas Schwab's note
13208 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13209
13210 * image.c: Improve checking for integer overflow.
13211 (check_image_size): Assume that f is nonnull, since
13212 it is always nonnull in practice. This is one less thing to
13213 worry about when checking for integer overflow later.
13214 (x_check_image_size): New function, which checks for integer
13215 overflow issues inside X.
13216 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13217 This removes the need for a memory_full check.
13218 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13219 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13220 (xbm_read_bitmap_data): Change locals back to 'int', since
13221 their values must fit in 'int'.
13222 (xpm_load_image, png_load, tiff_load):
13223 Invoke x_create_x_image_and_pixmap earlier,
13224 to avoid much needless work if the image is too large.
13225 (tiff_load): Treat overly large images as if
13226 x_create_x_image_and_pixmap failed, not as malloc failures.
13227 (gs_load): Use x_check_image_size.
13228
13229 * gtkutil.c: Omit integer casts.
13230 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13231 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13232
13233 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13234
13235 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13236 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13237 would wrongly return t on a 64-bit host.
13238
13239 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13240 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13241 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13242 and therefore cause GCC to emit a bogus diagnostic in some cases.
13243
13244 * image.c: Integer signedness and overflow and related fixes.
13245 This is not an exhaustive set of fixes, but it's time to
13246 record what I've got.
13247 (lookup_pixel_color, check_image_size): Remove redundant decls.
13248 (check_image_size): Don't assume that arbitrary EMACS_INT values
13249 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13250 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13251 (tiff_load, imagemagick_load_image):
13252 Check for overflow in size calculations.
13253 (x_create_x_image_and_pixmap): Remove unnecessary test for
13254 xmalloc returning NULL; that can't happen.
13255 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13256 (xpm_color_bucket): Use better integer hashing function.
13257 (xpm_cache_color): Don't possibly over-allocate memory.
13258 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13259 (gif_memory_source):
13260 Use ptrdiff_t, not int or size_t, to record sizes.
13261 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13262 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13263 either works, as we prefer signed integers.
13264 (tiff_read_from_memory, tiff_write_from_memory):
13265 Return tsize_t, not size_t, since that's what the TIFF API wants.
13266 (tiff_read_from_memory): Don't fail simply because the read would
13267 go past EOF; instead, return a short read.
13268 (tiff_load): Omit no-longer-needed casts.
13269 (Fimagemagick_types): Don't assume size fits into 'int'.
13270
13271 Improve hashing quality when configured --with-wide-int.
13272 * fns.c (hash_string): New function, taken from sxhash_string.
13273 Do not discard information about ASCII character case; this
13274 discarding is no longer needed.
13275 (sxhash-string): Use it. Change sig to match it. Caller changed.
13276 * lisp.h: Declare it.
13277 * lread.c (hash_string): Remove, since we now use fns.c's version.
13278 The fns.c version returns a wider integer if --with-wide-int is
13279 specified, so this should help the quality of the hashing a bit.
13280
13281 * emacs.c: Integer overflow minor fix.
13282 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13283 Define only if GNU_LINUX.
13284 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13285
13286 * dispnew.c: Integer signedness and overflow fixes.
13287 Remove unnecessary forward decls, that were a maintenance hassle.
13288 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13289 All uses changed.
13290 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13291 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13292 (prepare_desired_row, line_draw_cost):
13293 Use int, not unsigned, where either works.
13294 (save_current_matrix, restore_current_matrix):
13295 Use ptrdiff_t, not size_t, where either works.
13296 (init_display): Check for overflow more accurately, and without
13297 relying on undefined behavior.
13298
13299 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13300 Remove, replacing with the new symbols in lisp.h. All uses changed.
13301 * fileio.c (make_temp_name):
13302 * filelock.c (lock_file_1, lock_file):
13303 * xdisp.c (message_dolog):
13304 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13305 Use pMd etc. instead.
13306 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13307 replacing the pWIDE etc. symbols removed from editfns.c.
13308
13309 * keyboard.h (num_input_events): Now uintmax_t.
13310 This is (very slightly) less likely to mess up due to wraparound.
13311 All uses changed.
13312
13313 * buffer.c: Integer signedness fixes.
13314 (alloc_buffer_text, enlarge_buffer_text):
13315 Use ptrdiff_t rather than size_t when either will do, as we prefer
13316 signed integers.
13317
13318 * alloc.c: Integer signedness and overflow fixes.
13319 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13320 (__malloc_size_t): Default to size_t, not to int.
13321 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13322 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13323 Prefer ptrdiff_t to size_t when either would do, as we prefer
13324 signed integers.
13325 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13326 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13327 Now const. Initialize with values that are in range even if char
13328 is signed.
13329 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13330 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13331 These functions do the right thing with sizes > 2**32.
13332 (check_depth): Now ptrdiff_t, not int.
13333 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13334 Adjust to new way of storing sizes. Check for size overflow bugs
13335 in rest of code.
13336 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13337 slightly wrong anyway, as it missed one instance of
13338 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13339 (refill_memory_reserve): Omit needless cast to size_t.
13340 (mark_object_loop_halt): Mark as externally visible.
13341
13342 * xselect.c: Integer signedness and overflow fixes.
13343 (Fx_register_dnd_atom, x_handle_dnd_message):
13344 Use ptrdiff_t, not size_t, since we prefer signed.
13345 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13346 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13347 x_dnd_atoms_size and x_dnd_atoms_length.
13348
13349 * doprnt.c: Prefer signed to unsigned when either works.
13350 * eval.c (verror):
13351 * doprnt.c (doprnt):
13352 * lisp.h (doprnt):
13353 * xdisp.c (vmessage):
13354 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13355 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13356 prefer signed arithmetic to avoid comparison confusion.
13357 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13358 but is a bit tricky.
13359
13360 Assume freestanding C89 headers, string.h, stdlib.h.
13361 * data.c, doprnt.c, floatfns.c, print.c:
13362 Include float.h unconditionally.
13363 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13364 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13365 * regex.c: Likewise for stddef.h, string.h.
13366 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13367 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13368 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13369 (STDC_HEADERS): Remove obsolete defines.
13370 * sysdep.c: Include limits.h unconditionally.
13371
13372 Assume support for memcmp, memcpy, memmove, memset.
13373 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13374 * regex.c (memcmp, memcpy):
13375 Remove; we assume C89 now.
13376
13377 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13378 (__malloc_safe_bcopy): Remove; no longer needed.
13379
13380 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13381 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13382 well either way, and we prefer signed to unsigned.
13383
13384 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13385
13386 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13387 closes the connection while we're reading (bug#9182).
13388
13389 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13390
13391 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13392 are specified (Bug#9168).
13393
13394 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13395
13396 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13397 Found by GCC static checking and --with-wide-int on a 32-bit host.
13398
13399 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13400
13401 * xdisp.c (compute_display_string_pos): Fix logic of caching
13402 previous display string position. Initialize cached_prev_pos to
13403 -1. Fixes slow-down at the beginning of a buffer.
13404
13405 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13406
13407 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13408 for attrs[LFACE_FONTSET_INDEX].
13409
13410 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13411
13412 * xml.c (parse_region): Remove unused local
13413 that was recently introduced.
13414
13415 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13416
13417 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13418 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13419
13420 * xdisp.c (move_it_in_display_line_to): Record the best matching
13421 position for TO_CHARPOS while scanning the line, and restore it on
13422 exit if none of the characters scanned was an exact match.
13423 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13424 when exact match is impossible due to invisible text, and the
13425 lines are truncated.
13426
13427 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13428
13429 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13430 for OSX >= 10.7.
13431
13432 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13433
13434 Fix a significant slow-down of cursor motion with C-n, C-p,
13435 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13436 auto-repeat under bidi redisplay in fontified buffers.
13437 * xdisp.c (compute_stop_pos_backwards): New function.
13438 (next_element_from_buffer): Call compute_stop_pos_backwards to
13439 find a suitable prev_stop when we find ourselves before
13440 base_level_stop.
13441 (reseat): Don't look for prev_stop, as that could mean a very long
13442 run.
13443 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13444 <cached_disp_overlay_modiff>: Cache for last found display string
13445 position.
13446 (compute_display_string_pos): Return the cached position if asked
13447 about the same buffer in the same area of character positions, and
13448 the buffer wasn't changed since the time the display string
13449 position was cached.
13450
13451 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13452
13453 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13454 is an integer, which is important for empty lines. (Bug#9149)
13455
13456 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13457
13458 * frame.c (Fmodify_frame_parameters): In tty case, update the
13459 default face if necessary (Bug#4238).
13460
13461 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13462
13463 * editfns.c (Fstring_to_char): No need to explain what a character
13464 is in the docstring (Bug#6576).
13465
13466 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13467
13468 * xml.c (parse_region): Make sure we always return a tree.
13469
13470 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13471
13472 * xml.c (parse_region): If a document contains only comments,
13473 return that, too.
13474
13475 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13476
13477 * xml.c (make_dom): Return comments, too.
13478
13479 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13480
13481 Port to OpenBSD.
13482 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13483 and the surrounding thread.
13484 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13485 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13486 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13487 timer goes off.
13488 * s/openbsd.h (BROKEN_SIGIO): Define.
13489 * unexelf.c (unexec) [__OpenBSD__]:
13490 Don't update the .mdebug section of the Alpha COFF symbol table.
13491
13492 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13493
13494 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13495 (bug#8460).
13496
13497 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13498
13499 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13500 This fixes some race conditions on the permissions of any newly
13501 created file.
13502
13503 * alloc.c (valid_pointer_p): Use pipe, not open.
13504 This fixes some permissions issues when debugging.
13505
13506 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13507 If fchown fails to set both uid and gid, try to set just gid,
13508 as that is sometimes allowed. Adjust the file's mode to eliminate
13509 setuid or setgid bits that are inappropriate if fchown fails.
13510
13511 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13512
13513 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13514 to compare Lisp_Objects.
13515 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13516 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13517 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13518
13519 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13520
13521 * lread.c (read_integer): Unread even EOF character.
13522 (read1): Likewise. Properly record start position of symbol.
13523
13524 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13525 symbol character follows.
13526
13527 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13528
13529 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13530 This works around a problem with the previous change to Fcopy_file.
13531 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13532 and without this change, GCC might complain about discarding
13533 fchown's return value.
13534
13535 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13536
13537 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13538
13539 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13540
13541 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13542
13543 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13544
13545 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13546 it's used from the C level.
13547
13548 * process.c: Use the same condition for POLL_FOR_INPUT in both
13549 keyboard.c and process.c (bug#1858).
13550
13551 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13552
13553 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13554 (Fgnutls_boot): Use it.
13555
13556 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13557
13558 * doc.c (Fsubstitute_command_keys): Revert last change.
13559
13560 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13561
13562 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13563 quotes the next character, and doesn't affect other longer
13564 sequences (bug#8935).
13565
13566 * lread.c (syms_of_lread): Clarify that is isn't only
13567 `eval-buffer' and `eval-defun' that's affected by
13568 `lexical-binding' (bug#8460).
13569
13570 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13571
13572 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13573 bidi redisplay when a line includes both an image and is truncated.
13574
13575 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13576
13577 Fix minor problems found by static checking.
13578 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13579 (elsz): Now a signed constant, not a size_t var. We prefer signed
13580 types to unsigned, to avoid integer comparison confusion. Without
13581 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13582 "cannot optimize loop, the loop counter may overflow", a symptom
13583 of the confusion.
13584 * indent.c (Fvertical_motion): Mark locals as initialized.
13585 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13586
13587 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13588
13589 * search.c (Fre_search_backward): Mention `case-fold-search' in
13590 all the re_search_* functions (bug#8138).
13591
13592 * keyboard.c (Fopen_dribble_file): Document when the file is
13593 closed (bug#8056).
13594
13595 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13596
13597 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13598 bidi_cache_idx.
13599
13600 Support bidi reordering of display and overlay strings.
13601 * xdisp.c (compute_display_string_pos)
13602 (compute_display_string_end): Accept additional argument STRING.
13603 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13604 (reseat_to_string): Initialize bidi_it->string.s and
13605 bidi_it->string.schars.
13606 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13607 NULL (avoids a crash in bidi_paragraph_init).
13608 Initialize itb.string.lstring.
13609 (init_iterator): Call bidi_init_it only of a valid
13610 buffer position was specified. Initialize paragraph_embedding to
13611 L2R.
13612 (reseat_to_string): Initialize the bidi iterator.
13613 (display_string): If we need to ignore text properties of
13614 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13615 original value of -1 will not work with bidi.)
13616 (compute_display_string_pos): First arg is now struct
13617 `text_pos *'; all callers changed. Support display properties on
13618 Lisp strings.
13619 (compute_display_string_end): Support display properties on Lisp
13620 strings.
13621 (init_iterator, reseat_1, reseat_to_string): Initialize the
13622 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13623 when iterating on a string not from display properties).
13624 (compute_display_string_pos, compute_display_string_end):
13625 Fix calculation of the object to scan. Fixes an error when using
13626 arrow keys.
13627 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13628 base_level_stop; instead, set base_level_stop to BEGV.
13629 Fixes crashes in vertical-motion.
13630 (next_element_from_buffer): Improve commentary for when
13631 the iterator is before prev_stop.
13632 (init_iterator): Initialize bidi_p from the default value of
13633 bidi-display-reordering, not from buffer-local value. Use the
13634 buffer-local value only if initializing for buffer iteration.
13635 (handle_invisible_prop): Support invisible properties on strings
13636 that are being bidi-reordered.
13637 (set_iterator_to_next): Support bidi reordering of C strings and
13638 Lisp strings.
13639 (next_element_from_string): Support bidi reordering of Lisp
13640 strings.
13641 (handle_stop_backwards): Support Lisp strings as well.
13642 (display_string): Support display of R2L glyph rows.
13643 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13644 (init_iterator): Don't initialize it->bidi_p for strings
13645 here.
13646 (reseat_to_string): Initialize it->bidi_p for strings here.
13647 (next_element_from_string, next_element_from_c_string)
13648 (next_element_from_buffer): Add xassert's for correspondence
13649 between IT's object being iterated and it->bidi_it.string
13650 structure.
13651 (face_before_or_after_it_pos): Support bidi iteration.
13652 (next_element_from_c_string): Handle the case of the first string
13653 character that is not the first one in the visual order.
13654 (get_visually_first_element): New function, refactored from common
13655 parts of next_element_from_buffer, next_element_from_string, and
13656 next_element_from_c_string.
13657 (tool_bar_lines_needed, redisplay_tool_bar)
13658 (display_menu_bar): Force left-to-right direction. Add a FIXME
13659 comment for making that be controlled by a user option.
13660 (push_it, pop_it): Save and restore the state of the
13661 bidi iterator. Save and restore the bidi_p flag.
13662 (pop_it): Iterate out of display property for string iteration as
13663 well.
13664 (iterate_out_of_display_property): Support iteration over strings.
13665 (handle_single_display_spec): Set up it->bidi_it for iteration
13666 over a display string, and call bidi_init_it.
13667 (handle_single_display_spec, next_overlay_string)
13668 (get_overlay_strings_1, push_display_prop): Set up the bidi
13669 iterator for displaying display or overlay strings.
13670 (forward_to_next_line_start): Don't use the shortcut if
13671 bidi-iterating.
13672 (back_to_previous_visible_line_start): If handle_display_prop
13673 pushed the iterator stack, restore the internal state of the bidi
13674 iterator by calling bidi_pop_it same number of times.
13675 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13676 and we are bidi-iterating, don't decrement the iterator position;
13677 instead, set the first_elt flag in the bidi iterator, to produce
13678 the same effect.
13679 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13680 (push_display_prop): xassert that we are iterating a buffer.
13681 (push_it, pop_it): Save and restore paragraph_embedding member.
13682 (handle_single_display_spec, next_overlay_string)
13683 (get_overlay_strings_1, reseat_1, reseat_to_string)
13684 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13685 correctly. Don't assume unibyte strings are not bidi-reordered.
13686 (compute_display_string_pos)
13687 (compute_display_string_end): Fix handling the case of C string.
13688 (push_it, pop_it): Save and restore from_disp_prop_p.
13689 (handle_single_display_spec, push_display_prop): Set the
13690 from_disp_prop_p flag.
13691 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13692 (pop_it): Call iterate_out_of_display_property only if we are
13693 popping after iteration over a string that came from a display
13694 property. Fix a typo in popping stretch info. Add an assertion
13695 for verifying that the iterator position is in sync with the bidi
13696 iterator.
13697 (handle_single_display_spec, get_overlay_strings_1)
13698 (push_display_prop): Fix initialization of paragraph direction for
13699 string when that of the parent object is not yet determined.
13700 (reseat_1): Call bidi_init_it to resync the bidi
13701 iterator with IT's position. (Bug#7616)
13702 (find_row_edges): If ROW->start.pos gives position
13703 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13704 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13705 Reset the from_disp_prop_p flag.
13706 (SAVE_IT, RESTORE_IT): New macros.
13707 (pos_visible_p, face_before_or_after_it_pos)
13708 (back_to_previous_visible_line_start)
13709 (move_it_in_display_line_to, move_it_in_display_line)
13710 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13711 (try_scrolling, redisplay_window, display_line): Use them when
13712 saving a temporary copy of the iterator and restoring it back.
13713 (back_to_previous_visible_line_start, reseat_1)
13714 (init_iterator): Empty the bidi cache "stack".
13715 (move_it_in_display_line_to): If iterator ended up at
13716 EOL, but we never saw any buffer positions smaller than
13717 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13718 motion in bidi-reordered lines.
13719 (move_it_in_display_line_to): Record prev_method and prev_pos
13720 immediately before the call to set_iterator_to_next. Fixes cursor
13721 motion in bidi-reordered lines with stretch glyphs and strings
13722 displayed in margins. (Bug#8133) (Bug#8867)
13723 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13724 TO_CHARPOS.
13725 (pos_visible_p): Support positions in bidi-reordered lines.
13726 Save and restore bidi cache.
13727
13728 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13729 (bidi_paragraph_info): Delete unused struct.
13730 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13731 (bidi_cache_start): New variable.
13732 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13733 to zero.
13734 (bidi_cache_fetch_state, bidi_cache_search)
13735 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13736 (bidi_cache_find, bidi_peek_at_next_level)
13737 (bidi_level_of_next_char, bidi_find_other_level_edge)
13738 (bidi_move_to_visually_next): Compare cache index with
13739 bidi_cache_start rather than with zero.
13740 (bidi_fetch_char): Accept new argument STRING; all callers
13741 changed. Support iteration over a string. Support strings with
13742 display properties. Support unibyte strings. Fix the type of
13743 `len' according to what STRING_CHAR_AND_LENGTH expects.
13744 (bidi_paragraph_init, bidi_resolve_explicit_1)
13745 (bidi_resolve_explicit, bidi_resolve_weak)
13746 (bidi_level_of_next_char, bidi_move_to_visually_next):
13747 Support iteration over a string.
13748 (bidi_set_sor_type, bidi_resolve_explicit_1)
13749 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13750 can now be zero (for strings); special values 0 and -1 were
13751 changed to -1 and -2, respectively.
13752 (bidi_char_at_pos): New function.
13753 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13754 Call it instead of FETCH_MULTIBYTE_CHAR.
13755 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13756 initialized to valid values.
13757 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13758 values.
13759 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13760 the test for valid cached positions. Fix the logic for looking up
13761 the sentinel state in the cache. GCPRO the Lisp string we are
13762 iterating.
13763 (bidi_push_it, bidi_pop_it): New functions.
13764 (bidi_initialize): Initialize the bidi cache start stack pointer.
13765 (bidi_cache_ensure_space): New function, refactored from part of
13766 bidi_cache_iterator_state. Don't assume the required size is just
13767 one BIDI_CACHE_CHUNK away.
13768 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13769 (bidi_count_bytes, bidi_char_at_pos): New functions.
13770 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13771 always valid if bidi_cache_idx is valid.
13772 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13773 is valid if it's going to be used.
13774 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13775 (bidi_cache_fetch_state, bidi_cache_search)
13776 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13777 (bidi_cache_iterator_state, bidi_cache_find)
13778 (bidi_find_other_level_edge, bidi_cache_start_stack):
13779 All variables related to cache indices are now EMACS_INT.
13780
13781 * dispextern.h (struct bidi_string_data): New structure.
13782 (struct bidi_it): New member `string'. Make flag members be 1-bit
13783 fields, and put them last in the struct.
13784 (compute_display_string_pos, compute_display_string_end):
13785 Update prototypes.
13786 (bidi_push_it, bidi_pop_it): Add prototypes.
13787 (struct iterator_stack_entry): New members bidi_p,
13788 paragraph_embedding, and from_disp_prop_p.
13789 (struct it): Member bidi_p is now a bit field 1 bit wide.
13790 (bidi_shelve_cache, bidi_unshelve_cache):
13791 Declare prototypes.
13792
13793 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13794 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13795 and vector-like objects.
13796
13797 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13798 cache around display iteration.
13799
13800 * window.c (Fwindow_end, window_scroll_pixel_based)
13801 (displayed_window_lines, Frecenter): Save and restore the bidi
13802 cache around display iteration.
13803
13804 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13805
13806 * editfns.c (Fdelete_region): Clarify the use of the named
13807 parameters (bug#6788).
13808
13809 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13810
13811 * indent.c (Fvertical_motion): Set and restore w->pointm when
13812 saving and restoring the window's buffer (Bug#9006).
13813
13814 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13815
13816 * editfns.c (Fstring_to_char): Clarify just what is returned
13817 (bug#6576). Text by Eli Zaretskii.
13818
13819 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13820
13821 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13822
13823 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13824
13825 * buffer.c (mmap_find): Fix a typo.
13826
13827 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13828
13829 Fix execution of x selection hooks.
13830 * xselect.c (Qx_lost_selection_functions)
13831 (Qx_sent_selection_functions): New vars.
13832 (syms_of_xselect): DEFSYM them.
13833 (x_handle_selection_request): Pass Qx_sent_selection_functions
13834 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13835 (x_handle_selection_clear,x_clear_frame_selections):
13836 Pass Qx_lost_selection_functions rather than
13837 Vx_lost_selection_functions to Frun_hook_with_args.
13838
13839 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13840
13841 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13842 The old code sometimes used this field without initializing it.
13843
13844 * alloc.c (gc_sweep): Don't read past end of array.
13845 In theory, the old code could also have corrupted Emacs internals,
13846 though it'd be very unlikely.
13847
13848 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13849
13850 * character.c (Fcharacterp): Don't advertise optional ignored
13851 argument. (Bug#4026)
13852
13853 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13854
13855 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13856 key" (bug#4257).
13857
13858 * window.c (Fset_window_start): Doc fix (bug#4199).
13859 (Fset_window_hscroll): Ditto.
13860
13861 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13862
13863 Fix minor new problems caught by GCC 4.6.1.
13864 * term.c (init_tty): Remove unused local.
13865 * xsettings.c (store_monospaced_changed): Define this function only
13866 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13867 not used otherwise.
13868
13869 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13870
13871 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13872
13873 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13874
13875 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13876 are the mini-buffer and the echo area (bug#3320).
13877
13878 * term.c (init_tty): Remove support for supdup, c10 and perq
13879 terminals, which are no longer supported (bug#1482).
13880
13881 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13882
13883 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13884
13885 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13886
13887 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13888 for non-popups (Bug#3642).
13889
13890 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13891
13892 * alloc.c (reset_malloc_hooks): Protoize.
13893 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13894 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13895 * cm.c (losecursor): Likewise.
13896 * data.c (fmod): Likewise.
13897 * dispnew.c (swap_glyphs_in_rows): Likewise.
13898 * emacs.c (memory_warning_signal): Likewise.
13899 * floatfns.c (float_error): Likewise.
13900 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13901 (otf_open, font_otf_capability, generate_otf_features)
13902 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13903 Likewise.
13904 * image.c (pbm_read_file): Likewise.
13905 * indent.c (string_display_width): Likewise.
13906 * intervals.c (check_for_interval, search_for_interval)
13907 (inc_interval_count, count_intervals, root_interval)
13908 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13909 * lread.c (defalias): Likewise.
13910 * ralloc.c (r_alloc_check): Likewise.
13911 * regex.c (set_image_of_range_1, set_image_of_range)
13912 (regex_grow_registers): Likewise.
13913 * sysdep.c (strerror): Likewise.
13914 * termcap.c (valid_filename_p, tprint, main): Likewise.
13915 * tparam.c (main): Likewise.
13916 * unexhp9k800.c (run_time_remap, save_data_space)
13917 (update_file_ptrs, read_header, write_header, calculate_checksum)
13918 (copy_file, copy_rest, display_header): Likewise.
13919 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13920 Likewise.
13921 * xdisp.c (check_it): Likewise.
13922 * xfaces.c (register_color, unregister_color, unregister_colors):
13923 Likewise.
13924 * xfns.c (print_fontset_result): Likewise.
13925 * xrdb.c (member, fatal, main): Likewise.
13926
13927 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13928
13929 Fix minor problems found by static checking (Bug#9031).
13930 * chartab.c (char_table_set_range, map_sub_char_table):
13931 Remove unused locals.
13932 (uniprop_table): Now static.
13933 * composite.c (_work_char): Remove unused static var.
13934
13935 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13936
13937 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13938
13939 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13940
13941 * gtkutil.c (qttip_cb): Remove code without function.
13942
13943 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13944
13945 * w32.c (pthread_sigmask): New stub.
13946
13947 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13948
13949 Use pthread_sigmask, not sigprocmask (Bug#9010).
13950 sigprocmask is portable only for single-threaded applications, and
13951 Emacs can be multi-threaded when it uses GTK.
13952 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13953 (LIBES): Use it.
13954 * callproc.c (Fcall_process):
13955 * process.c (create_process):
13956 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13957 Use pthread_sigmask, not sigprocmask.
13958
13959 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13960
13961 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13962 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13963 wrong (Bug#8591).
13964
13965 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13966
13967 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13968 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13969 (xg_hide_tooltip): Fix comment.
13970
13971 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13972 in registerServicesMenuSendTypes.
13973 (validRequestorForSendType): Don't check ns_return_types.
13974
13975 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13976 ns_return_type.
13977
13978 2011-07-08 Jason Rumney <jasonr@gnu.org>
13979
13980 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13981 SH_SHOW for hidden windows (Bug#5482).
13982
13983 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13984 frame struct members of non-existent frames (Bug#6284).
13985
13986 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13987
13988 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13989 variable firstTime not needed on OSX >= 10.6.
13990 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13991 >= 10.5. Use setKnobProportion, setDoubleValue.
13992
13993 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13994 (MAC_OS_X_VERSION_10_5): Define if not defined.
13995 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13996 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13997 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13998
13999 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14000 cString and lossyCString on OSX >= 10.4.
14001
14002 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14003 sizeToFit on OSX >= 10.2.
14004
14005 * nsimage.m (allocInitFromFile): Don't use deprecated method
14006 bestRepresentationForDevice on OSX >= 10.6.
14007
14008 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14009 to avoid warning.
14010
14011 * emacs.c: Declare unexec_init_emacs_zone.
14012
14013 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14014
14015 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14016
14017 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14018 on svcsMenu (Bug#8842).
14019
14020 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14021 ns_return_types.
14022 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14023
14024 * nsterm.m (QUTF8_STRING): Declare.
14025 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14026 (validRequestorForSendType): Return type is (id).
14027 Change indexOfObjectIdenticalTo to indexOfObject.
14028 Check if we have local selection before returning self (Bug#8842).
14029 (writeSelectionToPasteboard): Put local selection into paste board
14030 if we have a local selection (Bug#8842).
14031 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14032
14033 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14034 (ns_get_local_selection): Declare.
14035
14036 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14037
14038 * keymap.c (describe_map_tree): Don't insert a double newline at
14039 the end of the buffer (bug#1169) and return whether we inserted
14040 something.
14041
14042 * callint.c (Fcall_interactively): Change "reading args" to
14043 "providing args" to try to clarify what it does (bug#1010).
14044
14045 2011-07-07 Kenichi Handa <handa@m17n.org>
14046
14047 * composite.c (composition_compute_stop_pos): Ignore a static
14048 composition starting before CHARPOS (Bug#8915).
14049
14050 * xdisp.c (handle_composition_prop): Likewise.
14051
14052 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14053
14054 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14055 (Bug#9015)
14056
14057 2011-07-07 Kenichi Handa <handa@m17n.org>
14058
14059 * character.h (unicode_category_t): New enum type.
14060
14061 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14062 (Qchar_code_property_table): New variable.
14063 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14064 (UNIPROP_COMPRESSED_FORM_P): New macros.
14065 (char_table_ascii): Uncompress the compressed values.
14066 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14067 Uncompress the compressed values.
14068 (sub_char_table_ref_and_range): Likewise.
14069 (char_table_ref_and_range): Uncompress the compressed values.
14070 (sub_char_table_set): New arg is_uniprop. Callers changed.
14071 Uncompress the compressed values.
14072 (sub_char_table_set_range): Args changed. Callers changed.
14073 (char_table_set_range): Adjuted for the above change.
14074 (map_sub_char_table): Delete args default_val and parent. Add arg
14075 top. Give decoded values to a Lisp function.
14076 (map_char_table): Adjust for the above change. Give decoded
14077 values to a Lisp function. Gcpro more variables.
14078 (uniprop_table_uncompress)
14079 (uniprop_decode_value_run_length): New functions.
14080 (uniprop_decoder, uniprop_decoder_count): New variables.
14081 (uniprop_get_decoder, uniprop_encode_value_character)
14082 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14083 New functions.
14084 (uniprop_encoder, uniprop_encoder_count): New variables.
14085 (uniprop_get_encoder, uniprop_table)
14086 (Funicode_property_table_internal, Fget_unicode_property_internal)
14087 (Fput_unicode_property_internal): New functions.
14088 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14089 Sunicode_property_table_internal, Sget_unicode_property_internal,
14090 and Sput_unicode_property_internal. Defvar_lisp
14091 char-code-property-alist.
14092
14093 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14094 Vunicode_category_table.
14095
14096 * font.c (font_range): Adjust for the change of
14097 Vunicode_category_table.
14098
14099 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14100
14101 * m/iris4d.h: Remove file, move contents ...
14102 * s/irix6-5.h: ... here.
14103
14104 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14105
14106 Remove unportable assumption about struct layout (Bug#8884).
14107 * alloc.c (mark_buffer):
14108 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14109 (clone_per_buffer_values): Don't assume that
14110 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14111 This isn't true in general, and it's particularly not true
14112 if Emacs is configured with --with-wide-int.
14113 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14114 New macros, used in the buffer.c change.
14115
14116 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14117
14118 * xsettings.c: Use both GConf and GSettings if both are available.
14119 (store_config_changed_event): Add comment.
14120 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14121 (store_tool_bar_style_changed): New functions.
14122 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14123 (struct xsettings): Move font inside HAVE_XFT.
14124 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14125 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14126 Move inside HAVE_XFT.
14127 (something_changed_gsettingsCB): Rename from something_changedCB.
14128 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14129 also.
14130 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14131 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14132 (something_changed_gconfCB): Rename from something_changedCB.
14133 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14134 (parse_settings): Move check for font inside HAVE_XFT.
14135 (read_settings, apply_xft_settings): Add comment.
14136 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14137 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14138 call store_font_name_changed.
14139 (xft_settings_event): Add comment.
14140 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14141 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14142 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14143 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14144 (xsettings_initialize): Call init_gsettings last.
14145 (xsettings_get_system_font, xsettings_get_system_normal_font):
14146 Add comment.
14147
14148 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14149
14150 Random fixes. E.g., (random) never returned negative values.
14151 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14152 subseconds part to the entropy, as that's a bit more random.
14153 Prefer signed to unsigned, since the signedness doesn't matter and
14154 in general we prefer signed. When given a limit, use a
14155 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14156 latter isn't right if USE_2_TAGS_FOR_INTS.
14157 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14158 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14159
14160 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14161
14162 * textprop.c (text_property_stickiness):
14163 Obey Vtext_property_default_nonsticky.
14164 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14165 * w32fns.c (syms_of_w32fns):
14166 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14167
14168 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14169
14170 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14171 This is more efficient than Ffile_directory_p and avoids a minor race.
14172
14173 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14174
14175 * buffer.c (Foverlay_put): Say what the return value is
14176 (bug#7835).
14177
14178 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14179 is a directory before asking whether to use the file name
14180 (bug#7564).
14181 (barf_or_query_if_file_exists): Make the "File is a directory"
14182 error be more correct.
14183
14184 * fns.c (Frequire): Remove the mention of the .gz files, since
14185 that's installation-specific, but keep the mention of
14186 `get-load-suffixes'.
14187
14188 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14189
14190 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14191 Report string overflow if the output is too long.
14192
14193 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14194
14195 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14196 (syms_of_gnutls): Remove duplicate DEFSYM for
14197 Qgnutls_bootprop_verify_hostname_error, an error for
14198 Qgnutls_bootprop_verify_error (which is no longer used).
14199
14200 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14201 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14202 Also (re)move comments that are misplaced or no longer relevant.
14203
14204 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14205
14206 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14207
14208 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14209
14210 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14211 and background color parameters if they have been changed.
14212
14213 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14214
14215 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14216
14217 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14218
14219 * xsettings.c (SYSTEM_FONT): Define only when used.
14220 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14221
14222 * keymap.c (access_keymap_1): Now static.
14223
14224 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14225
14226 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14227 leave any prefix arg for the up event (Bug#1586).
14228
14229 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14230
14231 * lread.c (syms_of_lread): Mention single symbols defined by
14232 `defvar' or `defconst' (bug#7154).
14233
14234 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14235 (Frequire): Mention get-load-suffixes.
14236
14237 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14238
14239 * window.h (window): Remove clone_number slot.
14240 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14241 Remove.
14242 (make_parent_window, make_window, saved_window)
14243 (Fset_window_configuration, save_window_save): Don't deal with
14244 clone numbers.
14245 * buffer.c (Qclone_number): Remove declaration.
14246 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14247
14248 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14249
14250 Add multiple inheritance to keymaps.
14251 * keymap.c (Fmake_composed_keymap): New function.
14252 (Fset_keymap_parent): Simplify.
14253 (fix_submap_inheritance): Remove.
14254 (access_keymap_1): New function extracted from access_keymap to handle
14255 embedded parents and handle lists of maps.
14256 (access_keymap): Use it.
14257 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14258 (Fcopy_keymap): Handle embedded parents.
14259 (Fcommand_remapping, define_as_prefix): Simplify.
14260 (Fkey_binding): Simplify.
14261 (syms_of_keymap): Move minibuffer-local-completion-map,
14262 minibuffer-local-filename-completion-map,
14263 minibuffer-local-must-match-map, and
14264 minibuffer-local-filename-must-match-map to Elisp.
14265 (syms_of_keymap): Defsubr make-composed-keymap.
14266 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14267 (parse_menu_item): Trivial simplification.
14268
14269 2011-07-01 Glenn Morris <rgm@gnu.org>
14270
14271 * Makefile.in (SETTINGS_LIBS): Fix typo.
14272
14273 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14274
14275 * coding.c (Fencode_coding_string): Record the last coding system
14276 used, as the function doc string says (bug#8738).
14277
14278 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14279
14280 * xsettings.c (store_monospaced_changed): Take new font as arg and
14281 check for change against current_mono_font.
14282 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14283 (emacs_settings_constructor, emacs_settings_get_property)
14284 (emacs_settings_set_property, emacs_settings_class_init)
14285 (emacs_settings_init, gsettings_obj): Remove.
14286 (something_changedCB): New function for HAVE_GSETTINGS.
14287 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14288 with value as argument.
14289 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14290 g_settings_new (Bug#8967). Do not create gsettings_obj.
14291 Remove calls to g_settings_bind. Connect something_changedCB to
14292 "changed".
14293
14294 * xgselect.c: Add defined (HAVE_GSETTINGS).
14295 (xgselect_initialize): Ditto.
14296
14297 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14298 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14299 xg_select.
14300
14301 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14302
14303 * eval.c (struct backtrace): Simplify and port the data structure.
14304 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14305 signed bit field, as this assumption is not portable and it makes
14306 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14307 "char debug_on_exit : 1" as this is not portable either; instead,
14308 use the portable "unsigned int debug_on_exit : 1". Remove unused
14309 member evalargs. Remove obsolete comments about cc bombing out.
14310
14311 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14312
14313 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14314 Let HAVE_GSETTINGS override HAVE_GCONF.
14315 (store_monospaced_changed): New function.
14316 (EMACS_SETTINGS): A new type derived from GObject to handle
14317 GSettings notifications.
14318 (emacs_settings_constructor, emacs_settings_get_property)
14319 (emacs_settings_set_property, emacs_settings_class_init):
14320 New functions.
14321 (gsettings_client, gsettings_obj): New variables.
14322 (GSETTINGS_SCHEMA): New define.
14323 (something_changedCB): Call store_monospaced_changed.
14324 (init_gsettings): New function.
14325 (xsettings_initialize): Call init_gsettings.
14326 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14327 to NULL.
14328
14329 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14330 GCONF_CFLAGS/LIBS.
14331
14332 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14333
14334 * window.c (resize_root_window, grow_mini_window)
14335 (shrink_mini_window): Rename Qresize_root_window to
14336 Qwindow_resize_root_window and Qresize_root_window_vertically to
14337 Qwindow_resize_root_window_vertically.
14338
14339 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14340
14341 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14342
14343 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14344
14345 * makefile.w32-in: Redesign dependencies so they reflect more
14346 clearly which files are directly included by each source file,
14347 and not through other includes.
14348
14349 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14350
14351 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14352 (sort_overlays, overlay_strings): When an overlay's clone number
14353 matches the window's clone number process the overlay even if
14354 the overlay's window property doesn't match the current window.
14355
14356 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14357 (Fwindow_hchild): Rename to Fwindow_left_child.
14358 (Fwindow_next): Rename to Fwindow_next_sibling.
14359 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14360 (resize_window_check): Rename to window_resize_check.
14361 (resize_window_apply): Rename to window_resize_apply.
14362 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14363 (Fdelete_other_windows_internal, resize_frame_windows)
14364 (Fsplit_window_internal, Fdelete_window_internal)
14365 (grow_mini_window, shrink_mini_window)
14366 (Fresize_mini_window_internal): Fix callers accordingly.
14367
14368 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14369
14370 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14371 (emacs_fixed_set_min_size): Remove.
14372 (emacs_fixed_new): Take frame as argument.
14373
14374 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14375 (_EmacsFixedPrivate): Remove minwidth/height.
14376 Add struct frame *f.
14377 (emacs_fixed_init): Initialize priv->f.
14378 (get_parent_class, emacs_fixed_set_min_size): Remove.
14379 (emacs_fixed_new): Set priv->f to argument.
14380 (emacs_fixed_get_preferred_width)
14381 (emacs_fixed_get_preferred_height): Use min_width/height from
14382 frames size_hint to set minimum and natural (Bug#8919).
14383 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14384 and use min_width/height from frames size_hint to set
14385 min_width/height (Bug#8919).
14386
14387 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14388 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14389 Fix indentation.
14390
14391 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14392
14393 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14394 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14395 called at ZV.
14396
14397 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14398
14399 * process.c (wait_reading_process_output): Bypass select if
14400 waiting for a cell while ignoring keyboard input, and input is
14401 pending. Suggested by Jan Djärv (Bug#8869).
14402
14403 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14404
14405 Use gnulib's dup2 module instead of rolling our own.
14406 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14407
14408 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14409
14410 * dispnew.c (scrolling_window): Before scrolling, turn off a
14411 mouse-highlight in the window being scrolled.
14412
14413 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14414
14415 Move DEFSYM to lisp.h and use everywhere.
14416
14417 * character.h (DEFSYM): Move declaration...
14418 * lisp.h (DEFSYM): ...here.
14419
14420 * gnutls.c:
14421 * minibuf.c:
14422 * w32menu.c:
14423 * w32proc.c:
14424 * w32select.c: Don't include character.h.
14425
14426 * alloc.c (syms_of_alloc):
14427 * buffer.c (syms_of_buffer):
14428 * bytecode.c (syms_of_bytecode):
14429 * callint.c (syms_of_callint):
14430 * casefiddle.c (syms_of_casefiddle):
14431 * casetab.c (init_casetab_once):
14432 * category.c (init_category_once, syms_of_category):
14433 * ccl.c (syms_of_ccl):
14434 * cmds.c (syms_of_cmds):
14435 * composite.c (syms_of_composite):
14436 * dbusbind.c (syms_of_dbusbind):
14437 * dired.c (syms_of_dired):
14438 * dispnew.c (syms_of_display):
14439 * doc.c (syms_of_doc):
14440 * editfns.c (syms_of_editfns):
14441 * emacs.c (syms_of_emacs):
14442 * eval.c (syms_of_eval):
14443 * fileio.c (syms_of_fileio):
14444 * fns.c (syms_of_fns):
14445 * frame.c (syms_of_frame):
14446 * fringe.c (syms_of_fringe):
14447 * insdel.c (syms_of_insdel):
14448 * keymap.c (syms_of_keymap):
14449 * lread.c (init_obarray, syms_of_lread):
14450 * macros.c (syms_of_macros):
14451 * msdos.c (syms_of_msdos):
14452 * print.c (syms_of_print):
14453 * process.c (syms_of_process):
14454 * search.c (syms_of_search):
14455 * sound.c (syms_of_sound):
14456 * syntax.c (init_syntax_once, syms_of_syntax):
14457 * terminal.c (syms_of_terminal):
14458 * textprop.c (syms_of_textprop):
14459 * undo.c (syms_of_undo):
14460 * w32.c (globals_of_w32):
14461 * window.c (syms_of_window):
14462 * xdisp.c (syms_of_xdisp):
14463 * xfaces.c (syms_of_xfaces):
14464 * xfns.c (syms_of_xfns):
14465 * xmenu.c (syms_of_xmenu):
14466 * xsettings.c (syms_of_xsettings):
14467 * xterm.c (syms_of_xterm): Use DEFSYM.
14468
14469 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14470
14471 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14472
14473 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14474
14475 Integer and buffer overflow fixes (Bug#8873).
14476
14477 * print.c (printchar, strout): Check for string overflow.
14478 (PRINTPREPARE, printchar, strout):
14479 Don't set size unless allocation succeeds.
14480
14481 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14482 for sizes. Check for string overflow more accurately.
14483 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14484
14485 * macros.c: Integer and buffer overflow fixes.
14486 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14487 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14488 Use ptrdiff_t, not int, for sizes.
14489 Don't increment bufsize until after realloc succeeds.
14490 Check for size-calculation overflow.
14491 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14492
14493 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14494
14495 * lread.c: Integer overflow fixes.
14496 (read_integer): Radix is now EMACS_INT, not int,
14497 to improve quality of diagnostics for out-of-range radices.
14498 Calculate buffer size correctly for out-of-range radices.
14499 (read1): Check for integer overflow in radices, and in
14500 read-circle numbers.
14501 (read_escape): Avoid int overflow.
14502 (Fload, openp, read_buffer_size, read1)
14503 (substitute_object_recurse, read_vector, read_list, map_obarray):
14504 Use ptrdiff_t, not int, for sizes.
14505 (read1): Use EMACS_INT, not int, for sizes.
14506 Check for size overflow.
14507
14508 * image.c (cache_image): Check for size arithmetic overflow.
14509
14510 * lread.c: Integer overflow issues.
14511 (saved_doc_string_size, saved_doc_string_length)
14512 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14513 Now ptrdiff_t, not int.
14514 (read1): Don't assume doc string length fits in int. Check for
14515 out-of-range doc string lengths.
14516 (read_list): Don't assume file position fits in int.
14517 (read_escape): Check for hex character overflow.
14518
14519 2011-06-22 Leo Liu <sdl.web@gmail.com>
14520
14521 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14522 Move to minibuffer.el.
14523
14524 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14525
14526 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14527 The following patches are for when GLYPH_DEBUG && !XASSERT.
14528 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14529 * dispnew.c (flush_stdout):
14530 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14531 Mark as externally visible.
14532 * dispnew.c (check_window_matrix_pointers): Now static.
14533 * dispnew.c (window_to_frame_vpos):
14534 * xfns.c (unwind_create_frame):
14535 * xterm.c (x_check_font): Remove unused local.
14536 * scroll.c (CHECK_BOUNDS):
14537 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14538 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14539 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14540 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14541 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14542 Now static.
14543 (debug_method_add): Use va_list and vsprintf rather than relying
14544 on undefined behavior with wrong number of arguments.
14545 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14546 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14547 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14548 since we're not interested in debugging glyphs with old libraries.
14549 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14550 GCC 4.6.0's static checking.
14551
14552 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14553
14554 Integer overflow and signedness fixes (Bug#8873).
14555 A few related buffer overrun fixes, too.
14556
14557 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14558
14559 * dispextern.h (struct face.stipple):
14560 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14561 (x_bitmap_mask, x_allocate_bitmap_record)
14562 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14563 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14564 (x_create_bitmap_from_xpm_data):
14565 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14566 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14567 (.bitmaps_last):
14568 * xfaces.c (load_pixmap):
14569 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14570 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14571 (.bitmaps_last, struct x_output.icon_bitmap):
14572 Use ptrdiff_t, not int, for bitmap indexes.
14573 (x_allocate_bitmap_record): Check for size overflow.
14574 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14575
14576 Use ptrdiff_t, not int, for overlay counts.
14577 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14578 * editfns.c (overlays_around, get_pos_property):
14579 * textprop.c (get_char_property_and_overlay):
14580 * xdisp.c (next_overlay_change, note_mouse_highlight):
14581 * xfaces.c (face_at_buffer_position):
14582 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14583 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14584 (Fnext_overlay_change, Fprevious_overlay_change)
14585 (mouse_face_overlay_overlaps, Foverlays_in):
14586 Use ptrdiff_t, not int, for sizes.
14587 (overlays_at, overlays_in): Check for size-calculation overflow.
14588
14589 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14590
14591 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14592 (x_session_initialize): Do not assume string length fits in int.
14593
14594 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14595 This is unlikely, but can occur if DPI is outlandish.
14596
14597 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14598 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14599
14600 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14601 * xrdb.c (magic_file_p, search_magic_path):
14602 Omit last arg SUFFIX; it was always 0. All callers changed.
14603 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14604
14605 * xfont.c (xfont_match): Avoid need for strlen.
14606
14607 * xfns.c: Don't assume strlen fits in int.
14608 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14609
14610 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14611 not unsigned long, as we prefer signed integers. All callers changed.
14612 Detect integer overflow in repeat count.
14613 (message_dolog): Don't assume print length fits in 39 bytes.
14614 (display_mode_element): Don't assume strlen fits in int.
14615
14616 * termcap.c: Don't assume sizes fit in int and never overflow.
14617 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14618 (gobble_line): Check for size-calculation overflow.
14619
14620 * minibuf.c (Fread_buffer):
14621 * lread.c (intern, intern_c_string):
14622 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14623 Don't assume string length fits in int.
14624
14625 * keyboard.c (parse_tool_bar_item):
14626 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14627
14628 * font.c: Don't assume string length fits in int.
14629 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14630 Use ptrdiff_t, not int.
14631 (font_intern_prop): Don't assume string length fits in int.
14632 Don't assume integer property fits in fixnum.
14633 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14634
14635 * filelock.c: Fix some buffer overrun and integer overflow issues.
14636 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14637 Reformulate so as not to need the command string.
14638 Invoke gzip -cd rather than gunzip, as it's more portable.
14639 (lock_info_type, lock_file_1, lock_file):
14640 Don't assume pid_t and time_t fit in unsigned long.
14641 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14642 (current_lock_owner): Prefer signed type for sizes.
14643 Use memcpy, not strncpy, where memcpy is what is really wanted.
14644 Don't assume (via atoi) that time_t and pid_t fit in int.
14645 Check for time_t and/or pid_t out of range, e.g., via a network share.
14646 Don't alloca where an auto var works fine.
14647
14648 * fileio.c: Fix some integer overflow issues.
14649 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14650 Don't assume string length fits in int.
14651 (directory_file_name): Don't assume string length fits in long.
14652 (make_temp_name): Don't assume pid fits in int, or that its print
14653 length is less than 20.
14654
14655 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14656
14657 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14658
14659 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14660
14661 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14662 We prefer signed integers, even for size calculations.
14663
14664 * emacs.c: Don't assume string length fits in 'int'.
14665 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14666 (main): Don't invoke strlen when not needed.
14667
14668 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14669 (XD_DEBUG_MESSAGE): Don't waste a byte.
14670
14671 * callproc.c (getenv_internal_1, getenv_internal)
14672 (Fgetenv_internal):
14673 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14674
14675 * lread.c (invalid_syntax): Omit length argument.
14676 All uses changed. This doesn't fix a bug, but it simplifies the
14677 code away from its former Hollerith-constant appearance, and it's
14678 one less 'int' to worry about when looking at integer-overflow issues.
14679 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14680
14681 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14682 This didn't break anything, but it didn't help either.
14683 It's confusing to put a bogus integer in a place where the actual
14684 value does not matter.
14685 (LIST_END_P): Remove unused macro and its bogus comment.
14686 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14687
14688 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14689 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14690 implementation.
14691 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14692 We prefer signed types, and the value cannot exceed the EMACS_INT
14693 range anyway (because otherwise the length would not be representable).
14694 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14695 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14696 This avoids a GCC warning when WIDE_EMACS_INT.
14697
14698 * indent.c (sane_tab_width): New function.
14699 (current_column, scan_for_column, Findent_to, position_indentation)
14700 (compute_motion): Use it. This is just for clarity.
14701 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14702
14703 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14704
14705 * lisp.h (lint_assume): New macro.
14706 * composite.c (composition_gstring_put_cache):
14707 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14708
14709 * editfns.c, insdel.c:
14710 Omit unnecessary forward decls, to simplify future changes.
14711
14712 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14713
14714 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14715
14716 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14717 Use much-faster test for byte-length change.
14718 Don't assume string byte-length fits in 'int'.
14719 Check that character arg fits in 'int'.
14720 (mapcar1): Declare byte as byte, for clarity.
14721
14722 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14723
14724 * fns.c (concat): Catch string overflow earlier.
14725 Do not rely on integer wraparound.
14726
14727 * dispextern.h (struct it.overlay_strings_charpos)
14728 (struct it.selective): Now EMACS_INT, not int.
14729 * xdisp.c (forward_to_next_line_start)
14730 (back_to_previous_visible_line_start)
14731 (reseat_at_next_visible_line_start, next_element_from_buffer):
14732 Don't arbitrarily truncate the value of 'selective' to int.
14733
14734 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14735
14736 * composite.c: Don't truncate sizes to 'int'.
14737 (composition_gstring_p, composition_reseat_it)
14738 (composition_adjust_point): Use EMACS_INT, not int.
14739 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14740 not EMACS_UINT, for indexes.
14741
14742 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14743
14744 * buffer.c: Include <verify.h>.
14745 (struct sortvec.priority, struct sortstr.priority):
14746 Now EMACS_INT, not int.
14747 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14748 (struct sortstr.size, record_overlay_string)
14749 (struct sortstrlist.size, struct sortlist.used):
14750 Don't truncate size to int.
14751 (record_overlay_string): Check for size-calculation overflow.
14752 (init_buffer_once): Check at compile-time, not run-time.
14753
14754 2011-06-22 Jim Meyering <meyering@redhat.com>
14755
14756 Don't leak an XBM-image-sized buffer
14757 * image.c (xbm_load): Free the image buffer after using it.
14758
14759 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14760
14761 Port to Sun C.
14762 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14763 that Sun C diagnosed.
14764 * fns.c (secure_hash): Fix pointer signedness issue.
14765 * intervals.c (static_offset_intervals): New function.
14766 (offset_intervals): Use it.
14767
14768 2011-06-21 Leo Liu <sdl.web@gmail.com>
14769
14770 * deps.mk (fns.o):
14771 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14772 sha512.h.
14773
14774 * fns.c (secure_hash): Rename from crypto_hash_function and change
14775 the first arg to accept symbols.
14776 (Fsecure_hash): New primitive.
14777 (syms_of_fns): New symbols.
14778
14779 2011-06-20 Deniz Dogan <deniz@dogan.se>
14780
14781 * process.c (Fset_process_buffer): Clarify return value in
14782 docstring.
14783
14784 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14785
14786 * dispnew.c (add_window_display_history): Use BVAR.
14787
14788 * xdisp.c (debug_method_add): Use BVAR.
14789 (check_window_end, dump_glyph_matrix, dump_glyph)
14790 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14791
14792 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14793 Likewise.
14794
14795 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14796 check till after the cache is created in init_frame_faces.
14797
14798 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14799
14800 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14801
14802 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14803
14804 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14805 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14806 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14807
14808 Improve buffer-overflow checking (Bug#8873).
14809 * fileio.c (Finsert_file_contents):
14810 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14811 Remove the old (too-loose) buffer overflow checks.
14812 They weren't needed, since make_gap checks for buffer overflow.
14813 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14814 The old code merely checked for Emacs fixnum overflow, and relied
14815 on undefined (wraparound) behavior. The new code avoids undefined
14816 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14817
14818 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14819 Tune. Don't use wider integers than needed. Don't use alloca.
14820 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14821
14822 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14823
14824 * insdel.c, lisp.h (buffer_overflow): New function.
14825 (insert_from_buffer_1, replace_range, replace_range_2):
14826 * insdel.c (make_gap_larger):
14827 * editfns.c (Finsert_char):
14828 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14829
14830 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14831
14832 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14833
14834 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14835
14836 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14837 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14838
14839 * fileio.c: Don't assume EMACS_INT fits in off_t.
14840 (emacs_lseek): New static function.
14841 (Finsert_file_contents, Fwrite_region): Use it.
14842 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14843
14844 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14845
14846 * fns.c: Don't overflow int when computing a list length.
14847 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14848 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14849 truncation on 64-bit hosts. Check for QUIT every
14850 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14851 faster and is responsive enough.
14852 (Flength): Report an error instead of overflowing an integer.
14853 (Fsafe_length): Return a float if the value is not representable
14854 as a fixnum. This shouldn't happen except in contrived situations.
14855 (Fnthcdr, Fsort): Don't assume list length fits in int.
14856 (Fcopy_sequence): Don't assume vector length fits in int.
14857
14858 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14859 (header_size, word_size): New constants.
14860 (allocate_vectorlike): Don't check size overflow here.
14861 (allocate_vector): Check it here instead, since this is the only
14862 caller of allocate_vectorlike that could cause overflow.
14863 Check that the new vector's length is representable as a fixnum.
14864
14865 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14866 The previous code was bogus. For example, next_almost_prime (32)
14867 returned 39, which is undesirable as it is a multiple of 3; and
14868 next_almost_prime (24) returned 25, which is a multiple of 5 so
14869 why was the code bothering to check for multiples of 7?
14870
14871 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14872
14873 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14874
14875 Variadic C functions now count arguments with ptrdiff_t.
14876 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14877 Back then I didn't know that the Emacs coding style prefers signed int.
14878 Also, in the meantime I found a few more instances where arguments
14879 were being counted with int, which may truncate counts on 64-bit
14880 machines, or EMACS_INT, which may be unnecessarily wide.
14881 * lisp.h (struct Lisp_Subr.function.aMANY)
14882 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14883 Arg counts are now ptrdiff_t, not size_t.
14884 All variadic functions and their callers changed accordingly.
14885 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14886 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14887 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14888 * callint.c (Fcall_interactively): Check arg count for overflow,
14889 to avoid potential buffer overrun. Use signed char, not 'int',
14890 for 'varies' array, so that we needn't bother to check its size
14891 calculation for overflow.
14892 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14893 * eval.c (apply_lambda):
14894 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14895 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14896 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14897
14898 * callint.c (Fcall_interactively): Don't use index var as event count.
14899
14900 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14901 * mem-limits.h (SIZE): Remove; no longer used.
14902
14903 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14904
14905 Remove unnecessary casts.
14906 * xterm.c (x_term_init):
14907 * xfns.c (x_set_border_pixel):
14908 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14909 These aren't needed now that we assume ANSI C.
14910
14911 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14912 It's more likely to cause problems (due to unsigned overflow)
14913 than to cure them.
14914
14915 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14916
14917 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14918
14919 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14920
14921 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14922
14923 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14924
14925 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14926
14927 GLYPH_CODE_FACE returns EMACS_INT, not int.
14928 * dispextern.h (merge_faces):
14929 * xfaces.c (merge_faces):
14930 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14931 Don't assume EMACS_INT fits in int.
14932
14933 * character.h (CHAR_VALID_P): Remove unused parameter.
14934 * fontset.c, lisp.h, xdisp.c: All uses changed.
14935
14936 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14937
14938 * fns.c (concat): Minor tuning based on overflow analysis.
14939 This doesn't fix any bugs. Use int to hold character, instead
14940 of constantly refetching from Emacs object. Use XFASTINT, not
14941 XINT, for value known to be a character. Don't bother comparing
14942 a single byte to 0400, as it's always less.
14943
14944 * floatfns.c (Fexpt):
14945 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14946
14947 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14948 for characters.
14949
14950 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14951
14952 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14953 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14954 incorrectly succeed when S was a string, because 4294967386 was
14955 truncated before it was used.
14956
14957 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14958 Otherwise, an out-of-range integer could cause undefined behavior
14959 on a 64-bit host.
14960
14961 * composite.c: Use int, not EMACS_INT, for characters.
14962 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14963 EMACS_INT, for values that are known to be in character range.
14964 This doesn't fix any bugs but is the usual style inside Emacs and
14965 may generate better code on 32-bit machines.
14966
14967 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14968 This is for reasons similar to the recent CHAR_STRING fix.
14969 * charset.c (Fencode_char): Check that character arg is actually
14970 a character. Pass an int to ENCODE_CHAR.
14971 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14972 wider than 'int', as a compile-time check to prevent future regressions
14973 in this area.
14974
14975 * character.c (char_string): Remove unnecessary casts.
14976
14977 Make sure a 64-bit char is never passed to CHAR_STRING.
14978 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14979 by silently ignoring the top 32 bits, allowing some values
14980 that were far too large to be valid characters.
14981 * character.h: Include <verify.h>.
14982 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14983 arguments are no wider than unsigned, as a compile-time check
14984 to prevent future regressions in this area.
14985 * data.c (Faset):
14986 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14987 (Fsubst_char_in_region):
14988 * fns.c (concat):
14989 * xdisp.c (decode_mode_spec_coding):
14990 Adjust to CHAR_STRING's new requirement.
14991 * editfns.c (Finsert_char, Fsubst_char_in_region):
14992 * fns.c (concat): Check that character args are actually
14993 characters. Without this test, these functions did the wrong
14994 thing with wildly out-of-range values on 64-bit hosts.
14995
14996 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14997 These casts should not be needed on 32-bit hosts, either.
14998 * keyboard.c (read_char):
14999 * lread.c (Fload): Remove casts to unsigned.
15000
15001 * lisp.h (UNSIGNED_CMP): New macro.
15002 This fixes comparison bugs on 64-bit hosts.
15003 (ASCII_CHAR_P): Use it.
15004 * casefiddle.c (casify_object):
15005 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15006 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15007 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15008 * dispextern.h (FACE_FROM_ID):
15009 * keyboard.c (read_char): Use UNSIGNED_CMP.
15010
15011 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15012 not to EMACS_INT, to avoid GCC warning.
15013
15014 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15015
15016 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15017 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15018 isn't needed on 32-bit machines.
15019
15020 * buffer.c (Fgenerate_new_buffer_name):
15021 Use EMACS_INT for count, not int.
15022 (advance_to_char_boundary): Return EMACS_INT, not int.
15023
15024 * data.c (Qcompiled_function): Now static.
15025
15026 * window.c (window_body_lines): Now static.
15027
15028 * image.c (gif_load): Rename local to avoid shadowing.
15029
15030 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15031 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15032 * alloc.c (make_save_value): Integer argument is now of type
15033 ptrdiff_t, not int.
15034 (mark_object): Use ptrdiff_t, not int.
15035 * lisp.h (pD): New macro.
15036 * print.c (print_object): Use it.
15037
15038 * alloc.c: Use EMACS_INT, not int, to count objects.
15039 (total_conses, total_markers, total_symbols, total_vector_size)
15040 (total_free_conses, total_free_markers, total_free_symbols)
15041 (total_free_floats, total_floats, total_free_intervals)
15042 (total_intervals, total_strings, total_free_strings):
15043 Now EMACS_INT, not int. All uses changed.
15044 (Fgarbage_collect): Compute overall total using a double, so that
15045 integer overflow is less likely to be a problem. Check for overflow
15046 when converting back to an integer.
15047 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15048 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15049 These were 'int' variables that could overflow on 64-bit hosts;
15050 they were never used, so remove them instead of repairing them.
15051 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15052 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15053 Previously, this ceilinged at INT_MAX, but that doesn't work on
15054 64-bit machines.
15055 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15056
15057 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15058 (allocate_vectorlike): Check for ptrdiff_t overflow.
15059 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15060 when a (possibly-narrower) signed value would do just as well.
15061 We prefer using signed arithmetic, to avoid comparison confusion.
15062
15063 * alloc.c: Catch some string size overflows that we were missing.
15064 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15065 for convenience in STRING_BYTES_MAX.
15066 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15067 The definition here is exact; the one in lisp.h was approximate.
15068 (allocate_string_data): Check for string overflow. This catches
15069 some instances we weren't catching before. Also, it catches
15070 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15071 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15072 and ptrdiff_t and EMACS_INT are both 64 bits.
15073
15074 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15075 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15076 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15077
15078 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15079
15080 * alloc.c (Fmake_string): Check for out-of-range init.
15081
15082 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15083
15084 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15085
15086 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15087
15088 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15089 xg_get_default_scrollbar_width.
15090
15091 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15092 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15093 (style_changed_cb): Call update_theme_scrollbar_width and call
15094 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15095 all frames (Bug#8505).
15096 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15097 Call gtk_window_set_resizable if HAVE_GTK3.
15098 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15099 and height if HAVE_GTK3 (Bug#8505).
15100 (scroll_bar_width_for_theme): New variable.
15101 (update_theme_scrollbar_width): New function.
15102 (xg_get_default_scrollbar_width): Move code to
15103 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15104 (xg_initialize): Call update_theme_scrollbar_width.
15105
15106 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15107
15108 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15109
15110 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15111
15112 * frame.c (make_frame): Call other_buffer_safely instead of
15113 other_buffer.
15114
15115 * window.c (temp_output_buffer_show): Call display_buffer with
15116 second argument Vtemp_buffer_show_specifiers and reset latter
15117 immediately after the call.
15118 (Vtemp_buffer_show_specifiers): New variable.
15119 (auto_window_vscroll_p, next_screen_context_lines)
15120 (Vscroll_preserve_screen_position): Remove leading asterisks from
15121 doc-strings.
15122
15123 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15124
15125 Fix minor problems found by GCC 4.6.0 static checking.
15126 * buffer.c (Qclone_number): Remove for now, as it's unused.
15127 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15128 (record_buffer): Remove unused local.
15129 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15130 (set_frame_buffer_list): Remove; unused.
15131 * frame.h (other_visible_frames): Remove decl.
15132 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15133 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15134 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15135 if HAVE_GPM.
15136 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15137 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15138 Define only if HAVE_GPM.
15139 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15140 (update_hints_inhibit): Remove; never set. All uses removed.
15141 * widgetprv.h (emacsFrameClassRec): Remove decl.
15142 * window.c (delete_deletable_window): Now returns void, since it
15143 wasn't returning anything.
15144 (compare_window_configurations): Remove unused locals.
15145 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15146 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15147 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15148 the same widths as pointers. This follows up on the 2011-05-06 patch.
15149 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15150 * xterm.h: Likewise.
15151 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15152
15153 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15154
15155 * makefile.w32-in: Update dependencies.
15156 (LISP_H): Add lib/intprops.h.
15157
15158 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15159
15160 * image.c (gif_load): Add animation frame delay to the metadata.
15161 (syms_of_image): Use DEFSYM. New symbol `delay'.
15162
15163 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15164
15165 * window.c (delete_deletable_window): Re-add.
15166 (Fset_window_configuration): Rewrite to handle dead buffers and
15167 consequently deletable windows.
15168 (window_tree, Fwindow_tree): Remove. Supply functionality in
15169 window.el.
15170 (compare_window_configurations): Simplify code.
15171
15172 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15173
15174 * image.c (imagemagick_load_image): Fix type mismatch.
15175 (Fimagemagick_types): Likewise.
15176
15177 * window.h (replace_buffer_in_windows): Declare.
15178
15179 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15180
15181 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15182 Qclone_number. Remove external declaration of Qdelete_window.
15183 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15184 code.
15185 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15186 Run Qbuffer_list_update_hook if allowed.
15187 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15188 buffer list implementation.
15189 (other_buffer_safely): New function.
15190 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15191 calls to replace_buffer_in_windows and
15192 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15193 if allowed.
15194 (record_buffer): Inhibit quitting and rewrite using quittable
15195 functions. Run Qbuffer_list_update_hook if allowed.
15196 (Frecord_buffer, Funrecord_buffer): New functions.
15197 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15198 Move switch-to-buffer to window.el.
15199 (bury-buffer): Move to window.el.
15200 (Vbuffer_list_update_hook): New variable.
15201
15202 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15203 section.
15204
15205 * window.h (resize_frame_windows): Move up in code.
15206 (Fwindow_frame): Remove EXFUN.
15207 (replace_buffer_in_all_windows): Remove prototype.
15208 (replace_buffer_in_windows_safely): Add prototype.
15209
15210 * window.c: Declare Qdelete_window static again. Move down
15211 declaration of select_count.
15212 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15213 (Fother_window): Move to window.el.
15214 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15215 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15216 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15217 window.el.
15218 (replace_buffer_in_windows): Implement by calling
15219 Qreplace_buffer_in_windows.
15220 (replace_buffer_in_all_windows): Remove with some functionality
15221 moved into replace_buffer_in_windows_safely.
15222 (replace_buffer_in_windows_safely): New function.
15223 (select_window_norecord, select_frame_norecord): Move in front
15224 of run_window_configuration_change_hook. Remove now obsolete
15225 declarations.
15226 (Fset_window_buffer): Rewrite doc-string.
15227 Call Qrecord_window_buffer.
15228 (keys_of_window): Move binding for other-window to window.el.
15229
15230 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15231
15232 * dispextern.h (struct image): Replace data member, whose int_val
15233 and ptr_val fields were not used by anything, with a single
15234 lisp_val object.
15235
15236 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15237 (gif_clear_image, gif_load, imagemagick_load_image)
15238 (gs_clear_image, gs_load): Callers changed.
15239
15240 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15241
15242 * buffer.h: Include <time.h>, for time_t.
15243 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15244
15245 Fix minor problems found by static checking.
15246
15247 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15248
15249 Make identifiers static if they are not used in other modules.
15250 * data.c (Qcompiled_function, Qframe, Qvector):
15251 * image.c (QimageMagick, Qsvg):
15252 * minibuf.c (Qmetadata):
15253 * window.c (resize_window_check, resize_root_window): Now static.
15254 * window.h (resize_window_check, resize_root_window): Remove decls.
15255
15256 * window.c (window_deletion_count, delete_deletable_window):
15257 Remove; unused.
15258 (window_body_lines): Now static.
15259 (Fdelete_other_windows_internal): Mark vars as initialized.
15260 Make sure 'resize_failed' is initialized.
15261 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15262 (resize_window_apply): Remove unused local.
15263 * window.h (delete_deletable_window): Remove decl.
15264
15265 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15266 (imagemagick_load_image): Fix pointer signedness problem by changing
15267 last arg from unsigned char * to char *. All uses changed.
15268 Also, fix a local for similar reasons.
15269 Remove unused locals. Remove locals to avoid shadowing.
15270 (fn_rsvg_handle_free): Remove; unused.
15271 (svg_load, svg_load_image): Fix pointer signedness problem.
15272 (imagemagick_load_image): Don't use garbage pointer image_wand.
15273
15274 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15275
15276 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15277
15278 * image.c (gif_load): Fix omitted cast error introduced by
15279 2011-06-06 change.
15280
15281 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15282
15283 * window.h (resize_proportionally, orig_total_lines)
15284 (orig_top_line): Remove from window structure.
15285 (set_window_height, set_window_width, change_window_heights)
15286 (Fdelete_window): Remove prototypes.
15287 (resize_frame_windows): Remove duplicate declaration.
15288
15289 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15290
15291 * window.h (resize_frame_windows, resize_window_check)
15292 (delete_deletable_window, resize_root_window)
15293 (resize_frame_windows): Declare prototypes.
15294
15295 * window.c (resize_window_apply): Make definition be "static" to
15296 match the prototype.
15297
15298 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15299
15300 * window.c: Remove declarations of Qwindow_size_fixed,
15301 window_min_size_1, window_min_size_2, window_min_size,
15302 size_window, window_fixed_size_p, enlarge_window, delete_window.
15303 Remove static from declaration of Qdelete_window, it's
15304 temporarily needed by Fbury_buffer.
15305 (replace_window): Don't assign orig_top_line and
15306 orig_total_lines.
15307 (Fdelete_window, delete_window): Remove. Window deletion is
15308 handled by window.el.
15309 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15310 Replace Fdelete_window calls with calls to Qdelete_window.
15311 (Fdelete_other_windows): Remove. Deleting other windows is
15312 handled by window.el.
15313 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15314 handled in window.el.
15315 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15316 Window minimum sizes are handled in window.el.
15317 (shrink_windows, size_window, set_window_height)
15318 (set_window_width, change_window_heights, window_height)
15319 (window_width, CURBEG, CURSIZE, enlarge_window)
15320 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15321 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15322 handled in window.el.
15323 (make_dummy_parent): Rename to make_parent_window and give it a
15324 second argument horflag.
15325 (make_window): Don't set resize_proportionally any more.
15326 (Fsplit_window): Remove. Windows are split in window.el.
15327 (save_restore_action, save_restore_orig_size)
15328 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15329 Resize mini windows in window.el.
15330 (grow_mini_window, shrink_mini_window): Implement by calling
15331 Qresize_root_window_vertically, resize_window_check and
15332 resize_window_apply.
15333 (saved_window, Fset_window_configuration, save_window_save):
15334 Do not handle orig_top_line, orig_total_lines, and
15335 resize_proportionally.
15336 (window_min_height, window_min_width): Move to window.el.
15337 (keys_of_window): Move bindings for delete-other-windows,
15338 split-window, delete-window and enlarge-window to window.el.
15339
15340 * buffer.c: Temporarily extern Qdelete_window.
15341 (Fbury_buffer): Temporarily call Qdelete_window instead of
15342 Fdelete_window (Fbury_buffer will move to window.el soon).
15343
15344 * frame.c (set_menu_bar_lines_1): Remove code handling
15345 orig_top_line and orig_total_lines.
15346
15347 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15348 set_window_height but set heights directly.
15349 (change_frame_size_1): Use resize_frame_windows.
15350
15351 * xdisp.c (init_xdisp): Don't use set_window_height but set
15352 heights directly.
15353
15354 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15355 Use resize_frame_windows instead of change_window_heights and run
15356 run_window_configuration_change_hook.
15357
15358 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15359 instead of change_window_heights and run
15360 run_window_configuration_change_hook.
15361
15362 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15363
15364 * window.c (replace_window): Rename second argument REPLACEMENT to
15365 NEW. New third argument SETFLAG. Rewrite.
15366 (delete_window, make_dummy_parent): Call replace_window with
15367 third argument 1.
15368 (window_list_1): Move down in code.
15369 (run_window_configuration_change_hook): Move set_buffer part
15370 before select_frame_norecord part in order to unwind correctly.
15371 Rename count1 to count.
15372 (recombine_windows, delete_deletable_window, resize_root_window)
15373 (Fdelete_other_windows_internal)
15374 (Frun_window_configuration_change_hook, make_parent_window)
15375 (resize_window_check, resize_window_apply, Fresize_window_apply)
15376 (resize_frame_windows, Fsplit_window_internal)
15377 (Fdelete_window_internal, Fresize_mini_window_internal):
15378 New functions.
15379 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15380
15381 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15382
15383 * window.h (window): Add some new members to window structure -
15384 normal_lines, normal_cols, new_total, new_normal, clone_number,
15385 splits, nest, prev_buffers, next_buffers.
15386 (WINDOW_TOTAL_SIZE): Move here from window.c.
15387 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15388
15389 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15390 Remove.
15391 (make_dummy_parent): Set new members of windows structure.
15392 (make_window): Move down in code. Handle new members of window
15393 structure.
15394 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15395 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15396 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15397 (Fset_window_prev_buffers, Fwindow_next_buffers)
15398 (Fset_window_next_buffers, Fset_window_clone_number):
15399 New functions.
15400 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15401 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15402 Doc-string fixes.
15403 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15404 Argument WINDOW can be now internal window too.
15405 (Fwindow_use_time): Move up in code.
15406 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15407 Rewrite doc-string.
15408 (Fset_window_configuration, saved_window)
15409 (Fcurrent_window_configuration, save_window_save): Handle new
15410 members of window structure.
15411 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15412 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15413 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15414 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15415 Qget_mru_window, Qresize_root_window,
15416 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15417 Qauto_buffer_name; staticpro them.
15418
15419 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15420
15421 * window.c (Fwindow_total_size, Fwindow_left_column)
15422 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15423 (Fwindow_list_1): New functions.
15424 (window_box_text_cols): Replace with window_body_cols.
15425 (Fwindow_width, Fscroll_left, Fscroll_right):
15426 Use window_body_cols instead of window_box_text_cols.
15427 (delete_window, Fset_window_configuration):
15428 Call delete_all_subwindows with window as argument.
15429 (delete_all_subwindows): Take a window as argument and not a
15430 structure. Rewrite.
15431 (window_loop): Remove handling of GET_LRU_WINDOW and
15432 GET_LARGEST_WINDOW.
15433 (Fget_lru_window, Fget_largest_window): Move to window.el.
15434
15435 * window.h: Extern window_body_cols instead of
15436 window_box_text_cols. delete_all_subwindows now takes a
15437 Lisp_Object as argument.
15438
15439 * indent.c (compute_motion, Fcompute_motion):
15440 Use window_body_cols instead of window_box_text_cols.
15441
15442 * frame.c (delete_frame): Call delete_all_subwindows with root
15443 window as argument.
15444
15445 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15446
15447 * fns.c (Fputhash): Document return value.
15448
15449 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15450
15451 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15452
15453 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15454
15455 Cons<->int and similar integer overflow fixes (Bug#8794).
15456
15457 Check for overflow when converting integer to cons and back.
15458 * charset.c (Fdefine_charset_internal, Fdecode_char):
15459 Use cons_to_unsigned to catch overflow.
15460 (Fencode_char): Use INTEGER_TO_CONS.
15461 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15462 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15463 * data.c (long_to_cons, cons_to_long): Remove.
15464 (cons_to_unsigned, cons_to_signed): New functions.
15465 These signal an error for invalid or out-of-range values.
15466 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15467 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15468 * font.c (Ffont_variation_glyphs):
15469 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15470 * lisp.h: Include <intprops.h>.
15471 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15472 (cons_to_signed, cons_to_unsigned): New decls.
15473 (long_to_cons, cons_to_long): Remove decls.
15474 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15475 (Fprimitive_undo): Use CONS_TO_INTEGER.
15476 * xfns.c (Fx_window_property): Likewise.
15477 * xselect.c: Include <limits.h>.
15478 (x_own_selection, selection_data_to_lisp_data):
15479 Use INTEGER_TO_CONS.
15480 (x_handle_selection_request, x_handle_selection_clear)
15481 (x_get_foreign_selection, Fx_disown_selection_internal)
15482 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15483 (lisp_data_to_selection_data): Use cons_to_unsigned.
15484 (x_fill_property_data): Use cons_to_signed.
15485 Report values out of range.
15486
15487 Check for buffer and string overflow more precisely.
15488 * buffer.h (BUF_BYTES_MAX): New macro.
15489 * lisp.h (STRING_BYTES_MAX): New macro.
15490 * alloc.c (Fmake_string):
15491 * character.c (string_escape_byte8):
15492 * coding.c (coding_alloc_by_realloc):
15493 * doprnt.c (doprnt):
15494 * editfns.c (Fformat):
15495 * eval.c (verror):
15496 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15497 since they may not be the same number.
15498 * editfns.c (Finsert_char):
15499 * fileio.c (Finsert_file_contents):
15500 Likewise for BUF_BYTES_MAX.
15501
15502 * image.c: Use ptrdiff_t, not int, for sizes.
15503 (slurp_file): Switch from int to ptrdiff_t.
15504 All uses changed.
15505 (slurp_file): Check that file size fits in both size_t (for
15506 malloc) and ptrdiff_t (for sanity and safety).
15507
15508 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15509 if b->modtime has its maximal value.
15510
15511 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15512
15513 Don't assume time_t can fit into int.
15514 * buffer.h (struct buffer.modtime): Now time_t, not int.
15515 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15516 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15517
15518 Minor fixes for signed vs unsigned integers.
15519 * character.h (MAYBE_UNIFY_CHAR):
15520 * charset.c (maybe_unify_char):
15521 * keyboard.c (read_char, reorder_modifiers):
15522 XINT -> XFASTINT, since the integer must be nonnegative.
15523 * ftfont.c (ftfont_spec_pattern):
15524 * keymap.c (access_keymap, silly_event_symbol_error):
15525 XUINT -> XFASTINT, since the integer must be nonnegative.
15526 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15527 since it makes no difference and we prefer signed.
15528 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15529 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15530 nonnegative.
15531
15532 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15533
15534 * window.h (Fwindow_frame): Declare.
15535
15536 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15537
15538 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15539 (SPARE_MEMORY): Always define.
15540 (LARGE_REQUEST): Remove.
15541 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15542
15543 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15544
15545 * lisp.h: Move EXFUNS for Fframe_root_window,
15546 Fframe_first_window and Fset_frame_selected_window to window.h.
15547
15548 * window.h: Move EXFUNS for Fframe_root_window,
15549 Fframe_first_window and Fset_frame_selected_window here from
15550 lisp.h.
15551
15552 * frame.c (Fwindow_frame, Fframe_first_window)
15553 (Fframe_root_window, Fframe_selected_window)
15554 (Fset_frame_selected_window): Move to window.c.
15555 (Factive_minibuffer_window): Move to minibuf.c.
15556 (Fother_visible_frames_p): New function.
15557
15558 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15559
15560 * window.c (decode_window, decode_any_window): Move up in code.
15561 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15562 (inhibit_frame_unsplittable): Remove unused variable.
15563 (Fwindow_buffer): Move up and rewrite doc-string.
15564 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15565 (Fwindow_prev): New functions.
15566 (Fwindow_frame): Move here from frame.c. Accept any window as
15567 argument.
15568 (Fframe_root_window, Fframe_first_window)
15569 (Fframe_selected_window): Move here from frame.c. Accept frame
15570 or arbitrary window as argument. Update doc-strings.
15571 (Fminibuffer_window): Move up in code.
15572 (Fwindow_minibuffer_p): Move up in code and simplify.
15573 (Fset_frame_selected_window): Move here from frame.c.
15574 Marginal rewrite.
15575 (Fselected_window, select_window, Fselect_window): Move up in
15576 code. Minor doc-string fixes.
15577
15578 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15579
15580 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15581 Do not assume that spare memory exists; that assumption is valid
15582 only if SYSTEM_MALLOC.
15583 (LARGE_REQUEST): New macro, so that the issue of large requests
15584 is separated from the issue of spare memory.
15585
15586 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15587
15588 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15589 format. (Bug#8806)
15590
15591 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15592
15593 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15594 before statements.
15595
15596 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15597
15598 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15599
15600 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15601
15602 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15603 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15604
15605 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15606
15607 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15608
15609 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15610
15611 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15612 (x_clipboard_manager_save): Add return value.
15613 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15614 New error handlers.
15615 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15616 Obey Vx_select_enable_clipboard_manager. Catch errors in
15617 x_clipboard_manager_save (Bug#8779).
15618 (Vx_select_enable_clipboard_manager): New variable.
15619 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15620
15621 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15622
15623 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15624
15625 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15626
15627 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15628 in the current matrix if keep_current_p is non-zero.
15629
15630 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15631
15632 * bidi.c (bidi_level_of_next_char): Fix last change.
15633
15634 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15635
15636 Support bidi reordering of text covered by display properties.
15637
15638 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15639 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15640 (bidi_cache_search, bidi_cache_iterator_state)
15641 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15642 (bidi_level_of_next_char, bidi_move_to_visually_next):
15643 Support character positions inside a run of characters covered by a
15644 display string.
15645 (bidi_paragraph_init, bidi_resolve_explicit_1)
15646 (bidi_level_of_next_char): Call bidi_fetch_char and
15647 bidi_fetch_char_advance instead of FETCH_CHAR and
15648 FETCH_CHAR_ADVANCE.
15649 (bidi_init_it): Initialize new members.
15650 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15651 definitions.
15652 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15653 instead of using explicit *_CHAR codes.
15654 (bidi_resolve_explicit, bidi_resolve_weak):
15655 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15656 bidirectional text is supported only in multibyte buffers.
15657 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15658 it to initialize the frame_window_p member of struct bidi_it.
15659 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15660 (bidi_resolve_explicit, bidi_resolve_weak)
15661 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15662 bidi_it->nchars is non-positive.
15663 (bidi_level_of_next_char): Don't try to lookup the cache for the
15664 next/previous character if nothing is cached there yet, or if we
15665 were just reseat()'ed to a new position.
15666
15667 * xdisp.c (set_cursor_from_row): Set start and stop points
15668 according to the row's direction when priming the loop that looks
15669 for the glyph on which to display cursor.
15670 (single_display_spec_intangible_p): Function deleted.
15671 (display_prop_intangible_p): Reimplement to call
15672 handle_display_spec instead of single_display_spec_intangible_p.
15673 Accept 3 additional arguments needed by handle_display_spec.
15674 This fixes incorrect cursor motion across display property with complex
15675 values: lists, `(when COND...)' forms, etc.
15676 (single_display_spec_string_p): Support property values that are
15677 lists with the argument STRING its top-level element.
15678 (display_prop_string_p): Fix the condition for processing a
15679 property that is a list to be consistent with handle_display_spec.
15680 (handle_display_spec): New function, refactored from the
15681 last portion of handle_display_prop.
15682 (compute_display_string_pos): Accept additional argument
15683 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15684 value of a `display' property is a "replacing spec".
15685 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15686 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15687 the display property, but just return a value indicating whether
15688 the display property will replace the characters it covers.
15689 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15690 frame_window_p members of struct bidi_it.
15691 (compute_display_string_pos, compute_display_string_end):
15692 New functions.
15693 (push_it): Accept second argument POSITION, where pop_it should
15694 jump to continue iteration.
15695 (reseat_1): Initialize bidi_it.disp_pos.
15696
15697 * keyboard.c (adjust_point_for_property): Adjust the call to
15698 display_prop_intangible_p to its new signature.
15699
15700 * dispextern.h (struct bidi_it): New member frame_window_p.
15701 (bidi_init_it): Update prototypes.
15702 (display_prop_intangible_p): Update prototype.
15703 (compute_display_string_pos, compute_display_string_end):
15704 Declare prototypes.
15705 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15706 EMACS_INT.
15707
15708 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15709
15710 Malloc failure behavior now depends on size of allocation.
15711 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15712 * lisp.h: Change signatures accordingly.
15713 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15714 All callers changed. (Bug#8762)
15715
15716 * gnutls.c: Use Emacs's memory allocators.
15717 Without this change, the gnutls library would invoke malloc etc.
15718 directly, which causes problems on non-SYNC_INPUT hosts, and which
15719 runs afoul of improving memory_full behavior. (Bug#8761)
15720 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15721 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15722 xfree instead of the default malloc, realloc, free.
15723 (Fgnutls_boot): No need to check for memory allocation failure,
15724 since xmalloc does that for us.
15725
15726 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15727 * category.c (hash_get_category_set):
15728 * ccl.c (ccl_driver):
15729 * charset.c (Fdefine_charset_internal):
15730 * charset.h (struct charset.hash_index):
15731 * composite.c (get_composition_id, gstring_lookup_cache)
15732 (composition_gstring_put_cache):
15733 * composite.h (struct composition.hash_index):
15734 * dispextern.h (struct image.hash):
15735 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15736 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15737 (hashfn_equal, hashfn_user_defined, make_hash_table)
15738 (maybe_resize_hash_table, hash_lookup, hash_put)
15739 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15740 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15741 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15742 * image.c (make_image, search_image_cache, lookup_image)
15743 (xpm_put_color_table_h):
15744 * lisp.h (struct Lisp_Hash_Table):
15745 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15746 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15747 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15748 * alloc.c (allocate_vectorlike):
15749 Check for overflow in vector size calculations.
15750 * ccl.c (ccl_driver):
15751 Check for overflow when converting EMACS_INT to int.
15752 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15753 need to be updated by these changes.
15754 * fns.c (make_hash_table, maybe_resize_hash_table):
15755 Check for integer overflow with large hash tables.
15756 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15757 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15758 (SXHASH_REDUCE): New macro.
15759 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15760 Use it instead of discarding useful hash info with large hash values.
15761 (sxhash_float): New function.
15762 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15763 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15764 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15765 Rewrite to use FIXNUM_BITS, as this simplifies things.
15766 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15767 Adjust signatures to match updated version of code.
15768 (consing_since_gc): Now EMACS_INT, since a single hash table can
15769 use more than INT_MAX bytes.
15770
15771 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15772
15773 Make it possible to build with GCC-4.6+ -O2 -flto.
15774
15775 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15776
15777 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15778
15779 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15780 Call minibuffer-inactive-mode.
15781
15782 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15783
15784 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15785 Update dependencies.
15786
15787 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15788
15789 * data.c (init_data): Remove code for UTS, this system is not
15790 supported anymore.
15791
15792 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15793
15794 Don't force ./temacs to start in terminal mode.
15795
15796 * frame.c (make_initial_frame): Initialize faces in all cases, not
15797 only when CANNOT_DUMP is defined.
15798 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15799
15800 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15801
15802 * dispnew.c (add_window_display_history): Use const for the string
15803 pointer. Remove declaration, not needed.
15804
15805 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15806
15807 Use 'inline', not 'INLINE'.
15808 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15809 * alloc.c, fontset.c (INLINE): Remove.
15810 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15811 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15812 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15813 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15814 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15815
15816 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15817
15818 Make it possible to run ./temacs.
15819
15820 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15821 syms_of_callproc does the same thing. Remove test for
15822 "initialized", do it in the caller.
15823 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15824
15825 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15826
15827 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15828 (read_minibuf): Use get_minibuffer.
15829 (syms_of_minibuf): Use DEFSYM.
15830 (Qmetadata): New var.
15831 * data.c (Qbuffer): Don't make it static.
15832 (syms_of_data): Use DEFSYM.
15833
15834 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15835
15836 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15837 (CCL_CODE_MIN): New macro.
15838
15839 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15840
15841 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15842
15843 * eval.c (Qdebug): Now static.
15844 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15845 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15846 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15847
15848 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15849
15850 * image.c: Various fixes to ImageMagick code comments.
15851 (Fimagemagick_types): Doc fix.
15852
15853 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15854
15855 Minor fixes prompted by GCC 4.6.0 warnings.
15856
15857 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15858
15859 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15860 (x_clipboard_manager_save_all): Move extern decl to ...
15861 * xterm.h: ... here, so that it can be checked for consistency.
15862
15863 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15864
15865 * xselect.c (x_clipboard_manager_save_frame)
15866 (x_clipboard_manager_save_all): New functions.
15867 (Fx_clipboard_manager_save): Lisp function deleted.
15868
15869 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15870 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15871
15872 * xterm.h: Update prototype.
15873
15874 2011-05-28 William Xu <william.xwl@gmail.com>
15875
15876 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15877 exiting (Bug#8239).
15878
15879 2011-05-28 Jim Meyering <meyering@redhat.com>
15880
15881 Avoid a sign-extension bug in crypto_hash_function.
15882 * fns.c (to_uchar): Define.
15883 (crypto_hash_function): Use it to convert some newly-signed
15884 variables to unsigned, to avoid sign-extension bugs. For example,
15885 without this change, (md5 "truc") would evaluate to
15886 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15887 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15888 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15889
15890 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15891
15892 Integer overflow fixes.
15893
15894 * dbusbind.c: Serial number integer overflow fixes.
15895 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15896 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15897 to hold a serial number that is too large for a fixnum.
15898 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15899 Check for serial numbers out of range. Decode any serial number
15900 that was so large that it became a float. (Bug#8722)
15901
15902 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15903 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15904 Use XFASTINT rather than XUINT when numbers are nonnegative.
15905 (xd_append_arg, Fdbus_method_return_internal):
15906 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15907 arguments, check that Lisp number is nonnegative, rather than
15908 silently wrapping negative numbers around. (Bug#8722)
15909 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15910 (Bug#8722)
15911
15912 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15913
15914 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15915
15916 ccl: Add integer overflow checks.
15917 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15918 (IN_INT_RANGE): New macros.
15919 (ccl_driver): Use them to check for integer overflow when
15920 decoding a CCL program. Many of the new checks are whether XINT (x)
15921 fits in int; it doesn't always, on 64-bit hosts. The new version
15922 doesn't catch all possible integer overflows, but it's an
15923 improvement. (Bug#8719)
15924
15925 * alloc.c (make_event_array): Use XINT, not XUINT.
15926 There's no need for unsigned here.
15927
15928 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15929 This follows up to the 2011-05-06 change that substituted uintptr_t
15930 for EMACS_INT. This case wasn't caught back then.
15931
15932 Rework Fformat to avoid integer overflow issues.
15933 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15934 now (part of C89). Include <verify.h>.
15935 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15936 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15937 (Fformat): Avoid the prepass trying to compute sizes; it was only
15938 approximate and thus did not catch overflow reliably. Instead, walk
15939 through the format just once, formatting and computing sizes as we go,
15940 checking for integer overflow at every step, and allocating a larger
15941 buffer as needed. Keep track separately whether the format is
15942 multibyte. Keep only the most-recently calculated precision, rather
15943 than them all. Record whether each argument has been converted to
15944 string. Use EMACS_INT, not int, for byte and char and arg counts.
15945 Support field widths and precisions larger than INT_MAX. Avoid
15946 sprintf's undefined behavior with conversion specifications such as %#d
15947 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15948 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15949 formatting out-of-range floating point numbers with int
15950 formats. (Bug#8668)
15951
15952 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15953
15954 * data.c: Avoid integer truncation in expressions involving floats.
15955 * data.c: Include <intprops.h>.
15956 (arith_driver): When there's an integer overflow in an expression
15957 involving floating point, convert the integers to floating point
15958 so that the resulting value does not suffer from catastrophic
15959 integer truncation. For example, on a 64-bit host (* 4
15960 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15961 Do not rely on undefined behavior after integer overflow.
15962
15963 merge count_size_as_multibyte, parse_str_to_multibyte
15964 * character.c, character.h (count_size_as_multibyte):
15965 Rename from parse_str_to_multibyte; all uses changed.
15966 Check for integer overflow.
15967 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15968 since it's now a duplicate of the other. This is more of
15969 a character than a buffer op, so better that it's in character.c.
15970 * fns.c, print.c: Adjust to above changes.
15971
15972 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15973
15974 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15975
15976 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15977
15978 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15979 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15980 (x_clipboard_manager_save): Now static.
15981 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15982
15983 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15984 (crypto_hash_function): Now static.
15985 Fix pointer signedness problems. Avoid unnecessary initializations.
15986
15987 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15988
15989 * termhooks.h (Vselection_alist): Make it terminal-local.
15990
15991 * terminal.c (create_terminal): Initialize it.
15992
15993 * xselect.c: Support for clipboard managers.
15994 (Vselection_alist): Move to termhooks.h as terminal-local var.
15995 (LOCAL_SELECTION): New macro.
15996 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15997 (symbol_to_x_atom): Remove gratuitous arg.
15998 (x_handle_selection_request, lisp_data_to_selection_data)
15999 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16000 (x_own_selection, x_get_local_selection, x_convert_selection):
16001 New arg, specifying work frame. Use terminal-local Vselection_alist.
16002 (some_frame_on_display): Delete unused function.
16003 (Fx_own_selection_internal, Fx_get_selection_internal)
16004 (Fx_disown_selection_internal, Fx_selection_owner_p)
16005 (Fx_selection_exists_p): New optional frame arg.
16006 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16007 (x_handle_selection_clear): Don't treat other terminals with the
16008 same keyboard specially. Use the terminal-local Vselection_alist.
16009 (x_clear_frame_selections): Use Frun_hook_with_args.
16010
16011 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16012
16013 * xterm.h: Add support for those atoms.
16014
16015 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16016
16017 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16018 (converted_selections, conversion_fail_tag): New global variables.
16019 (x_selection_request_lisp_error): Free the above.
16020 (x_get_local_selection): Remove unnecessary code.
16021 (x_reply_selection_request): Args changed; handle arbitrary array
16022 of converted selections stored in converted_selections.
16023 Separate the XChangeProperty and SelectionNotify steps.
16024 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16025 (x_convert_selection): New function.
16026 (x_handle_selection_event): Simplify.
16027 (x_get_foreign_selection): Don't ignore incoming requests while
16028 waiting for an answer; this will fail when we implement
16029 SAVE_TARGETS, and seems unnecessary anyway.
16030 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16031 (Vx_sent_selection_functions): Doc fix.
16032
16033 2011-05-26 Leo Liu <sdl.web@gmail.com>
16034
16035 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16036
16037 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16038
16039 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16040
16041 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16042 for fringe update if it has periodic bitmap.
16043 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16044 and fringe_bitmap_periodic_p.
16045
16046 * fringe.c (get_fringe_bitmap_data): New function.
16047 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16048 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16049 row. Mark glyph row for fringe update if periodicity changed.
16050
16051 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16052 for fringe update unless it has periodic bitmap.
16053
16054 2011-05-25 Kenichi Handa <handa@m17n.org>
16055
16056 * xdisp.c (get_next_display_element): Set correct it->face_id for
16057 a static composition.
16058
16059 2011-05-24 Leo Liu <sdl.web@gmail.com>
16060
16061 * deps.mk (fns.o):
16062 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16063
16064 * fns.c (crypto_hash_function, Fsha1): New function.
16065 (Fmd5): Use crypto_hash_function.
16066 (syms_of_fns): Add Ssha1.
16067
16068 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16069
16070 * gnutls.c: Remove unused macros.
16071 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16072 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16073 Remove macros that are defined and never used.
16074 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16075
16076 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16077
16078 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16079 (Fx_get_selection_internal): Minor cleanup.
16080 (Fx_own_selection_internal): Rename arguments for consistency with
16081 select.el.
16082
16083 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16084
16085 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16086
16087 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16088
16089 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16090
16091 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16092
16093 * dispnew.c (scrolling_window): Don't exclude the case that the
16094 last enabled row in the desired matrix touches the bottom boundary.
16095
16096 2011-05-21 Glenn Morris <rgm@gnu.org>
16097
16098 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16099 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16100 and add some more files.
16101
16102 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16103
16104 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16105 report_file_error introduced by the change from 2011-05-07.
16106
16107 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16108
16109 * systime.h (Time): Define only if emacs is defined.
16110 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16111 where the include path doesn't have X11/X.h by default. See
16112 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16113
16114 2011-05-20 Kenichi Handa <handa@m17n.org>
16115
16116 * composite.c (find_automatic_composition): Fix previous change.
16117
16118 2011-05-20 Glenn Morris <rgm@gnu.org>
16119
16120 * lisp.mk: New file, split from Makefile.in.
16121 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16122 (shortlisp): Remove.
16123 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16124
16125 2011-05-19 Glenn Morris <rgm@gnu.org>
16126
16127 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16128 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16129 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16130 (lisp): Set the order to that of loadup.el.
16131 (shortlisp): Make it a copy of $lisp.
16132 (SOME_MACHINE_LISP): Remove.
16133 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16134 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16135
16136 2011-05-18 Kenichi Handa <handa@m17n.org>
16137
16138 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16139 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16140 (find_automatic_composition): Mostly rewrite for efficiency.
16141
16142 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16143
16144 * makefile.w32-in: Update dependencies.
16145
16146 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16147
16148 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16149 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16150
16151 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16152
16153 Fix some integer overflow issues, such as string length overflow.
16154
16155 * insdel.c (count_size_as_multibyte): Check for string overflow.
16156
16157 * character.c (lisp_string_width): Check for string overflow.
16158 Use EMACS_INT, not int, for string indexes and lengths; in
16159 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16160 the resulting string length overflows an EMACS_INT; instead,
16161 report a string overflow if no precision given. When checking for
16162 precision exhaustion, use a check that cannot possibly have
16163 integer overflow. (Bug#8675)
16164 * character.h (lisp_string_width): Adjust to new signature.
16165
16166 * alloc.c (string_overflow): New function.
16167 (Fmake_string): Use it. This doesn't change behavior, but saves
16168 a few bytes and will simplify future changes.
16169 * character.c (string_escape_byte8): Likewise.
16170 * lisp.h (string_overflow): New decl.
16171
16172 Fixups, following up to the user-interface timestamp change.
16173 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16174 for UI timestamps, instead of unsigned long.
16175 * msdos.c (mouse_get_pos): Likewise.
16176 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16177 * w32gui.h (Time): Define by including "systime.h" rather than by
16178 declaring it ourselves. (Bug#8664)
16179
16180 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16181 * image.c (clear_image_cache): Likewise.
16182
16183 * term.c (term_mouse_position): Don't assume time_t wraparound.
16184
16185 Be more systematic about user-interface timestamps.
16186 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16187 and sometimes 'EMACS_UINT', to represent these timestamps.
16188 This change causes it to use 'Time' uniformly, as that's what X uses.
16189 This makes the code easier to follow, and makes it easier to catch
16190 integer overflow bugs such as Bug#8664.
16191 * frame.c (Fmouse_position, Fmouse_pixel_position):
16192 Use Time, not unsigned long, for user-interface timestamps.
16193 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16194 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16195 * keyboard.h (last_event_timestamp): Likewise.
16196 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16197 * menu.h (xmenu_show): Likewise.
16198 * term.c (term_mouse_position): Likewise.
16199 * termhooks.h (struct input_event.timestamp): Likewise.
16200 (struct terminal.mouse_position_hook): Likewise.
16201 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16202 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16203 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16204 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16205 what it was before.
16206 * menu.h, termhooks.h: Include "systime.h", for Time.
16207
16208 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16209 Don't assume that the difference between two unsigned long values
16210 can fit into an integer. At this point, we know button_down_time
16211 <= event->timestamp, so the difference must be nonnegative, so
16212 there's no need to cast the result if double-click-time is
16213 nonnegative, as it should be; check that it's nonnegative, just in
16214 case. This bug is triggered when events are more than 2**31 ms
16215 apart (about 25 days). (Bug#8664)
16216
16217 * xselect.c (last_event_timestamp): Remove duplicate decl.
16218 (x_own_selection): Remove needless cast to unsigned long.
16219
16220 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16221 that always fit in int. Use a sentinel instead of a counter, to
16222 avoid a temp and to allay GCC's concerns about possible int overflow.
16223 * frame.h (struct frame): Use int for menu_bar_items_used
16224 instead of EMACS_INT, since it always fits in int.
16225
16226 * menu.c (grow_menu_items): Check for int overflow.
16227
16228 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16229
16230 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16231 Before, the code was not consistent. These values cannot exceed
16232 2**31 - 1 so there's no need to make them unsigned.
16233 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16234 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16235 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16236 as modifiers.
16237 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16238
16239 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16240 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16241 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16242 presumably because the widths might not match.
16243
16244 * window.c (size_window): Avoid needless test at loop start.
16245
16246 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16247
16248 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16249
16250 2011-05-12 Drew Adams <drew.adams@oracle.com>
16251
16252 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16253
16254 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16255
16256 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16257 `width' to `bar_area_x' and `bar_area_width', respectively.
16258 (x_scroll_run): Take account of fringe background extension.
16259
16260 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16261 Rename local vars `left' and `width' to `bar_area_x' and
16262 `bar_area_width', respectively.
16263 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16264 background extension.
16265
16266 2011-05-10 Jim Meyering <meyering@redhat.com>
16267
16268 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16269
16270 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16271
16272 * image.c (Finit_image_library): Return t for built-in image types,
16273 like pbm and xbm. (Bug#8640)
16274
16275 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16276
16277 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16278
16279 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16280
16281 * w32console.c (Fset_screen_color): Doc fix.
16282 (Fget_screen_color): New function.
16283 (syms_of_ntterm): Defsubr it.
16284
16285 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16286 unlink the temporary file if Fcall_process didn't create it in the
16287 first place.
16288 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16289 child process will be redirected to a file specified with `:file'.
16290 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16291 cue to call_process_cleanup not to close that handle.
16292
16293 2011-05-07 Ben Key <bkey76@gmail.com>
16294
16295 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16296 one of two shell specific rules, either bootstrap-temacs-CMD or
16297 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16298 to the previous implementation of the bootstrap-temacs rule.
16299 The bootstrap-temacs-CMD rule is similar to the previous
16300 implementation of the bootstrap-temacs rule except that it
16301 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16302 variable.
16303
16304 These changes, along with some changes to nt/configure.bat,
16305 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16306 earlier fix to add support for --cflags and --ldflags options
16307 that include quotes so that it works whether make uses cmd or
16308 sh as the shell.
16309
16310 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16311
16312 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16313 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16314 is a constant.
16315 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16316 a string. Handle both cases.
16317 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16318 (Fdbus_register_method): Use Qinvalid_function.
16319
16320 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16321
16322 * makefile.w32-in: Update dependencies.
16323 (LISP_H): Add inttypes.h and stdin.h.
16324 (PROCESS_H): Add unistd.h.
16325
16326 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16327
16328 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16329 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16330
16331 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16332
16333 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16334
16335 * term.c (vfatal): Remove stray call to va_end.
16336 It's not needed and the C Standard doesn't allow it here anyway.
16337
16338 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16339 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16340
16341 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16342 bytes.
16343
16344 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16345
16346 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16347
16348 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16349
16350 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16351
16352 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16353
16354 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16355 * charset.c (Fdefine_charset_internal): Don't initialize
16356 charset.code_space[15]. The value was garbage, on hosts with
16357 32-bit int (Bug#8600).
16358
16359 * lread.c (read_integer): Be more consistent with string-to-number.
16360 Use string_to_number to do the actual conversion; this avoids
16361 rounding errors and fixes some other screwups. Without this fix,
16362 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16363 (digit_to_number): Move earlier, for benefit of read_integer.
16364 Return -1 if the digit is out of range for the base, -2 if it is
16365 not a digit in any supported base. (Bug#8602)
16366
16367 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16368
16369 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16370 to match comment at start of function. This also removes a
16371 GCC warning about overflow in a 32+64-bit port.
16372
16373 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16374
16375 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16376 Reported by Stefan Monnier in
16377 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16378 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16379 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16380
16381 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16382 (EMACS_UINTPTR): Likewise, with uintptr_t.
16383
16384 * lisp.h: Prefer 64-bit EMACS_INT if available.
16385 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16386 on 32-bit hosts that have 64-bit int, so that they can access
16387 large files.
16388 However, temporarily disable this change unless the temporary
16389 symbol WIDE_EMACS_INT is defined.
16390
16391 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16392
16393 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16394 This removes an assumption that EMACS_INT and long are the same
16395 width as pointers. The assumption is true for Emacs porting targets
16396 now, but we want to make other targets possible.
16397 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16398 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16399 In the rest of the code, change types of integers that hold casted
16400 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16401 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16402 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16403 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16404 No need to cast type when ORing.
16405 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16406 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16407 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16408 assume EMACS_INT is the same width as char *.
16409 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16410 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16411 Remove no-longer-needed casts.
16412 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16413 (xg_tool_bar_help_callback, xg_make_tool_item):
16414 Use EMACS_INTPTR to hold an integer
16415 that will be cast to void *; this can avoid a GCC warning
16416 if EMACS_INT is not the same width as void *.
16417 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16418 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16419 (current_message_1, set_message_1):
16420 Use a local to convert to proper width without a cast.
16421 * xmenu.c (dialog_selection_callback): Likewise.
16422
16423 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16424 Also, don't assume VALBITS / RAND_BITS is less than 5,
16425 and don't rely on undefined behavior when shifting a 1 left into
16426 the sign bit.
16427 * lisp.h (get_random): Change signature to match.
16428
16429 * lread.c (hash_string): Use size_t, not int, for hash computation.
16430 Normally we prefer signed values; but hashing is special, because
16431 it's better to use unsigned division on hash table sizes so that
16432 the remainder is nonnegative. Also, size_t is the natural width
16433 for hashing into memory. The previous code used 'int', which doesn't
16434 retain enough info to hash well into very large tables.
16435 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16436
16437 * dbusbind.c: Don't possibly lose pointer info when converting.
16438 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16439 Use XPNTR rather than XHASH, so that the high-order bits of
16440 the pointer aren't lost when converting through void *.
16441
16442 * eval.c (Fautoload): Don't double-shift a pointer.
16443
16444 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16445
16446 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16447
16448 * gnutls.c (DEF_GNUTLS_FN):
16449 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16450
16451 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16452
16453 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16454 marker. (Bug#8610)
16455
16456 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16457
16458 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16459 New version that can reserve upto 2GB of heap space.
16460
16461 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16462
16463 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16464
16465 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16466
16467 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16468 `gnutls_certificate_set_x509_key_file'.
16469
16470 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16471
16472 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16473 Update dependencies.
16474
16475 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16476
16477 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16478 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16479 Remove unused parameter `fildes'.
16480 * process.c (read_process_output, send_process): Don't pass it.
16481
16482 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16483
16484 Fix previous change: the library cache is defined in w32.c.
16485 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16486 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16487
16488 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16489
16490 Implement dynamic loading of GnuTLS on Windows.
16491
16492 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16493 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16494 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16495 Declare.
16496
16497 * gnutls.c (Qgnutls_dll): Define.
16498 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16499 (gnutls_*): Declare function pointers.
16500 (init_gnutls_functions): New function to initialize function pointers.
16501 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16502 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16503 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16504 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16505 (emacs_gnutls_write, emacs_gnutls_read)
16506 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16507 (Fgnutls_available_p): New function.
16508 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16509 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16510 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16511
16512 * image.c: Include w32.h.
16513 (Vimage_type_cache): Delete.
16514 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16515 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16516 (w32_delayed_load): Move to w32.c.
16517
16518 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16519
16520 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16521 (w32_delayed_load): Move from image.c. When loading a library, record
16522 its filename in the :loaded-from property of the library id.
16523 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16524 Initialize and staticpro them.
16525 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16526
16527 * process.c: Include lisp.h before w32.h, not after.
16528 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16529 instead of gnutls_record_check_pending.
16530
16531 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16532
16533 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16534
16535 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16536 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16537 as passed in.
16538
16539 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16540
16541 * xterm.c (x_set_frame_alpha): Do not set property on anything
16542 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16543
16544 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16545
16546 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16547
16548 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16549
16550 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16551 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16552 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16553 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16554 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16555 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16556 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16557 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16558 (Qgnutls_bootprop_callbacks_verify): Make static.
16559
16560 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16561
16562 * callproc.c: Indentation fixup.
16563
16564 * sysdep.c (wait_for_termination_1): Make static.
16565 (wait_for_termination, interruptible_wait_for_termination):
16566 Move after wait_for_termination_1.
16567
16568 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16569
16570 * sysdep.c (interruptible_wait_for_termination): New function
16571 which is like wait_for_termination, but allows keyboard
16572 interruptions.
16573
16574 * callproc.c (Fcall_process): Add (:file "file") as an option for
16575 the STDOUT buffer.
16576 (Fcall_process_region): Ditto.
16577
16578 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16579
16580 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16581 rather than `XVECTOR (FOO)->size'.
16582
16583 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16584 inttypes.h, as a gnulib replacement is used if it not available in
16585 system headers.
16586
16587 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16588
16589 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16590 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16591 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16592
16593 * coding.c (coding_alloc_by_realloc): Error out if destination
16594 will grow beyond MOST_POSITIVE_FIXNUM.
16595 (decode_coding_emacs_mule): Abort if there isn't enough place in
16596 charbuf for the composition carryover bytes. Reserve an extra
16597 space for up to 2 characters produced in a loop.
16598 (decode_coding_iso_2022): Abort if there isn't enough place in
16599 charbuf for the composition carryover bytes.
16600
16601 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16602
16603 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16604 aborting when %lld or %lll format is passed.
16605 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16606 %llo or %llx format is passed. (Bug#8545)
16607
16608 * window.c (window_scroll_line_based): Use a marker instead of
16609 simple variables to record original value of point. (Bug#7952)
16610
16611 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16612 produced by %s or %c overflows available buffer space. (Bug#8545)
16613
16614 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16615
16616 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16617 (SIZE_MAX): Move defn after all includes, as they might #define it.
16618
16619 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16620
16621 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16622
16623 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16624
16625 * keyboard.c (Qdelayed_warnings_hook): Define.
16626 (command_loop_1): Run `delayed-warnings-hook'
16627 if Vdelayed_warnings_list is non-nil.
16628 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16629 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16630
16631 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16632
16633 * doprnt.c (doprnt): Don't return value smaller than the buffer
16634 size if the message was truncated. (Bug#8545).
16635
16636 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16637
16638 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16639 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16640
16641 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16642
16643 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16644
16645 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16646
16647 * makefile.w32-in: Update dependencies.
16648
16649 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16650
16651 Improve `doprnt' and its usage. (Bug#8545)
16652 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16653 `format_end'. Remove support for %l as a conversion specifier.
16654 Don't use xrealloc. Improve diagnostics when the %l size modifier
16655 is used. Update the commentary.
16656
16657 * eval.c (verror): Simplify calculation of size_t.
16658
16659 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16660 messages.
16661
16662 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16663
16664 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16665 change.
16666
16667 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16668
16669 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16670 This makes this file independent of the recent pseudovector change.
16671
16672 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16673
16674 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16675
16676 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16677 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16678 Remove unused local.
16679 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16680
16681 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16682 GCC 4.6.0 optimizes based on type-based alias analysis.
16683 For example, if b is of type struct buffer * and v of type struct
16684 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16685 != &v->size, and therefore "v->size = 1; b->size = 2; return
16686 v->size;" must therefore return 1. This assumption is incorrect
16687 for Emacs, since it type-puns struct Lisp_Vector * with many other
16688 types. To fix this problem, this patch adds a new type struct
16689 vectorlike_header that documents the constraints on layout of vectors
16690 and pseudovectors, and helps optimizing compilers not get fooled
16691 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16692 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16693 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16694 the size member.
16695 (XSETPVECTYPE): Rewrite in terms of new macro.
16696 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16697 This is a bit clearer, and further avoids the possibility of
16698 undesirable aliasing.
16699 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16700 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16701 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16702 since Lisp_Subr is a special case (no "next" field).
16703 (ASIZE): Now uses header.size rather than size.
16704 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16705 to avoid the hassle of writing XVECTOR (foo)->header.size.
16706 (struct vectorlike_header): New type.
16707 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16708 object, to help avoid aliasing.
16709 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16710 (SUBRP): Likewise, since Lisp_Subr is a special case.
16711 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16712 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16713 (struct Lisp_Hash_Table): Combine first two members into a single
16714 struct vectorlike_header member. All uses of "size" and "next" members
16715 changed to be "header.size" and "header.next".
16716 * buffer.h (struct buffer): Likewise.
16717 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16718 * frame.h (struct frame): Likewise.
16719 * process.h (struct Lisp_Process): Likewise.
16720 * termhooks.h (struct terminal): Likewise.
16721 * window.c (struct save_window_data, struct saved_window): Likewise.
16722 * window.h (struct window): Likewise.
16723 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16724 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16725 * buffer.c (init_buffer_once): Likewise.
16726 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16727 special case.
16728 * process.c (Fformat_network_address): Use local var for size,
16729 for brevity.
16730
16731 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16732
16733 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16734 * data.c (atof): Remove decl; no longer used or needed.
16735 (digit_to_number): Move to lread.c.
16736 (Fstring_to_number): Use new string_to_number function, to be
16737 consistent with how the Lisp reader treats infinities and NaNs.
16738 Do not assume that floating-point numbers represent EMACS_INT
16739 without losing information; this is not true on most 64-bit hosts.
16740 Avoid double-rounding errors, by insisting on integers when
16741 parsing non-base-10 numbers, as the documentation specifies.
16742 * lisp.h (string_to_number): New decl, replacing ...
16743 (isfloat_string): Remove.
16744 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16745 (read1): Do not accept +. and -. as integers; this
16746 appears to have been a coding error. Similarly, do not accept
16747 strings like +-1e0 as floating point numbers. Do not report
16748 overflow for integer overflows unless the base is not 10 which
16749 means we have no simple and reliable way to continue.
16750 Break out the floating-point parsing into a new
16751 function string_to_number, so that Fstring_to_number parses
16752 floating point numbers consistently with the Lisp reader.
16753 (digit_to_number): Move here from data.c. Make it static inline.
16754 (E_CHAR, EXP_INT): Remove, replacing with ...
16755 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16756 (string_to_number): New function, replacing isfloat_string.
16757 This function checks for valid syntax and produces the resulting
16758 Lisp float number too. Rework it so that string-to-number
16759 no longer mishandles examples like "1.0e+". Use strtoumax,
16760 so that overflow for non-base-10 numbers is reported only when
16761 there's no portable and simple way to convert to floating point.
16762
16763 * textprop.c (set_text_properties_1): Rewrite for clarity,
16764 and to avoid GCC warning about integer overflow.
16765
16766 * intervals.h (struct interval): Use EMACS_INT for members
16767 where EMACS_UINT might cause problems. See
16768 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16769 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16770 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16771 All uses changed.
16772 (offset_intervals): Tell GCC not to worry about length overflow
16773 when negating a negative length.
16774
16775 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16776 (overrun_check_free): Likewise.
16777
16778 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16779 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16780 word size.
16781
16782 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16783 (gnutls_make_error): Rename local to avoid shadowing.
16784 (gnutls_emacs_global_deinit): ifdef out; not used.
16785 (Fgnutls_boot): Use const for pointer to readonly storage.
16786 Comment out unused local. Fix pointer signedness problems.
16787
16788 * lread.c (openp): Don't stuff size_t into an 'int'.
16789 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16790 about possible signed overflow.
16791
16792 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16793 (GDK_KEY_g): Don't define if already defined.
16794 (xg_prepare_tooltip): Avoid pointer signedness problem.
16795 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16796
16797 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16798 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16799
16800 * xfns.c (Fx_window_property): Simplify a bit,
16801 to make a bit faster and to avoid GCC 4.6.0 warning.
16802 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16803
16804 * fns.c (internal_equal): Don't assume size_t fits in int.
16805
16806 * alloc.c (compact_small_strings): Tighten assertion a little.
16807
16808 Replace pEd with more-general pI, and fix some printf arg casts.
16809 * lisp.h (pI): New macro, generalizing old pEd macro to other
16810 conversion specifiers. For example, use "...%"pI"d..." rather
16811 than "...%"pEd"...".
16812 (pEd): Remove. All uses replaced with similar uses of pI.
16813 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16814 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16815 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16816 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16817 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16818 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16819 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16820 64-bit hosts.
16821 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16822 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16823 * print.c (safe_debug_print, print_object): Likewise.
16824 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16825 to int.
16826 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16827 avoiding the 0 flag, which is not portable.
16828 * process.c (Fmake_network_process): Use pI to avoid cast.
16829 * region-cache.c (pp_cache): Likewise.
16830 * xdisp.c (decode_mode_spec): Likewise.
16831 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16832 behavior on 64-bit hosts with printf arg.
16833 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16834 (x_stop_queuing_selection_requests): Likewise.
16835 (x_get_window_property): Don't truncate byte count to an 'int'
16836 when tracing.
16837
16838 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16839 here, since it parses constructs like leading '-' and spaces,
16840 which are not wanted; and it overflows with large numbers.
16841 Instead, simply match F[0-9]+, which is what is wanted anyway.
16842
16843 * alloc.c: Remove unportable assumptions about struct layout.
16844 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16845 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16846 (allocate_vectorlike, make_pure_vector): Use the new macros,
16847 plus offsetof, to remove unportable assumptions about struct layout.
16848 These assumptions hold on all porting targets that I know of, but
16849 they are not guaranteed, they're easy to remove, and removing them
16850 makes further changes easier.
16851
16852 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16853 This doesn't fix a bug but makes the code clearer.
16854 (string_overrun_cookie): Now const. Use initializers that
16855 don't formally overflow signed char, to avoid warnings.
16856 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16857 can cause Emacs to crash when string overrun checking is enabled.
16858 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16859 multiple of sizeof (EMACS_INT); it need not be, if
16860 alignof(EMACS_INT) < sizeof (EMACS_INT).
16861 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16862
16863 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16864
16865 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16866
16867 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16868
16869 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16870 supposed to be handshaking. (Bug#8556)
16871 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16872
16873 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16874
16875 * lisp.h (Qdebug): List symbol.
16876 * eval.c (Qdebug): Restore global linkage.
16877 * keyboard.c (debug-on-event): New variable.
16878 (handle_user_signal): Break into debugger when debug-on-event
16879 matches the current signal symbol.
16880
16881 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16882
16883 * alloc.c (check_sblock, check_string_bytes)
16884 (check_string_free_list): Convert to standard C.
16885
16886 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16887
16888 * w32.c (emacs_gnutls_push): Fix typo.
16889
16890 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16891
16892 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16893 "cast to pointer from integer of different size".
16894
16895 Improve doprnt and its use in verror. (Bug#8545)
16896 * doprnt.c (doprnt): Document the set of format control sequences
16897 supported by the function. Use SAFE_ALLOCA instead of always
16898 using `alloca'.
16899
16900 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16901 is one byte too soon. Don't use xrealloc; instead xfree and
16902 xmalloc anew.
16903
16904 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16905
16906 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16907 callbacks stage.
16908
16909 * gnutls.c: Renamed global_initialized to
16910 gnutls_global_initialized. Added internals for the
16911 :verify-hostname-error, :verify-error, and :verify-flags
16912 parameters of `gnutls-boot' and documented those parameters in the
16913 docstring. Start callback support.
16914 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16915 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16916 on error. Return error code.
16917 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16918 (emacs_gnutls_read): Likewise.
16919 (Fgnutls_boot): Return handshake error code.
16920 (emacs_gnutls_handle_error): New function.
16921 (wsaerror_to_errno): Likewise.
16922
16923 * w32.h (emacs_gnutls_pull): Add prototype.
16924 (emacs_gnutls_push): Likewise.
16925
16926 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16927 (emacs_gnutls_push): Likewise.
16928
16929 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16930
16931 * process.c (wait_reading_process_output): Check if GnuTLS
16932 buffered some data internally if no FDs are set for TLS
16933 connections.
16934
16935 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16936 (LIBS): Link to USER_LIBS.
16937 ($(BLD)/gnutls.$(0)): New target.
16938
16939 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16940
16941 * xdisp.c (handle_single_display_spec): Rename the
16942 display_replaced_before_p argument into display_replaced_p, to
16943 make it consistent with the commentary. Fix typos in the
16944 commentary.
16945
16946 * textprop.c (syms_of_textprop): Remove dead code.
16947 (copy_text_properties): Delete obsolete commentary about an
16948 interface that was deleted long ago. Fix typos in the description
16949 of arguments.
16950
16951 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16952 to changes in oldXMenu/XMenu.h from 2011-04-16.
16953 <menu_help_message, prev_menu_help_message>: Constify.
16954 (IT_menu_make_room): menu->help_text is now `const char **';
16955 adjust.
16956
16957 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16958 to changes in oldXMenu/XMenu.h from 2011-04-16.
16959 (struct XMenu): Declare `help_text' `const char **'.
16960
16961 * xfaces.c <Qunspecified>: Make extern again.
16962
16963 * syntax.c: Include sys/types.h before including regex.h, as
16964 required by POSIX.
16965
16966 * doc.c (get_doc_string): Improve the format passed to `error'.
16967
16968 * doprnt.c (doprnt): Improve commentary.
16969
16970 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16971
16972 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16973 them with etags.
16974
16975 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16976 changes in globals.h immediately force recompilation.
16977 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16978 $(CURDIR)/s/ms-w32.h.
16979 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16980
16981 * character.c (Fchar_direction): Function deleted.
16982 (syms_of_character): Don't defsubr it.
16983 <char-direction-table>: Deleted.
16984
16985 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16986
16987 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16988 * doprnt.c: Include limits.h.
16989 (SIZE_MAX): New macro.
16990 (doprnt): Return a size_t value. 2nd arg is now size_t.
16991 Many local variables are now size_t instead of int or unsigned.
16992 Improve overflow protection. Support `l' modifier for integer
16993 conversions. Support %l conversion. Don't assume an EMACS_INT
16994 argument for integer conversions and for %c.
16995
16996 * lisp.h (doprnt): Restore prototype.
16997
16998 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16999 $(SRC)/character.h.
17000
17001 * Makefile.in (base_obj): Add back doprnt.o.
17002
17003 * deps.mk (doprnt.o): Add back prerequisites.
17004 (callint.o): Depend on character.h.
17005
17006 * eval.c (internal_lisp_condition_case): Include the handler
17007 representation in the error message.
17008 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17009 when breaking from the loop.
17010
17011 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17012
17013 * callint.c (Fcall_interactively): When displaying error message
17014 about invalid control letter, pass the character's codepoint, not
17015 a pointer to its multibyte form. Improve display of the character
17016 in octal and display also its hex code.
17017
17018 * character.c (char_string): Use %x to display the (unsigned)
17019 codepoint of an invalid character, to avoid displaying a bogus
17020 negative value.
17021
17022 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17023 `error', not SYMBOL_NAME itself.
17024
17025 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17026 character arguments to `error'.
17027
17028 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17029 to `error' in error message about FINAL_CHAR argument. Make sure
17030 FINAL_CHAR is a character, and use %c when it is passed as
17031 argument to `error'.
17032
17033 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17034
17035 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17036
17037 * w32.c: Include <time.h>.
17038 (sys_localtime): New function.
17039
17040 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17041
17042 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17043
17044 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17045
17046 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17047
17048 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17049 zombies (Bug#8467).
17050
17051 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17052
17053 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17054 gl_state.e_property when gl_state.object is Qt.
17055
17056 * insdel.c (make_gap_larger): Remove limitation of buffer size
17057 to <= INT_MAX.
17058
17059 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17060
17061 * xdisp.c (lookup_glyphless_char_display)
17062 (produce_glyphless_glyph): Handle cons cell entry in
17063 glyphless-char-display.
17064 (Vglyphless_char_display): Document it.
17065
17066 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17067 glyphless-char-display.
17068
17069 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17070
17071 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17072
17073 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17074
17075 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17076 definition for no-X builds.
17077
17078 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17079
17080 Static checks with GCC 4.6.0 and non-default toolkits.
17081
17082 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17083
17084 * process.c (keyboard_bit_set): Define only if SIGIO.
17085 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17086 (send_process): Repair possible setjmp clobbering.
17087
17088 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17089
17090 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17091
17092 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17093
17094 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17095 Define only if needed.
17096
17097 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17098 by pacifying GCC about it. Maybe it's time to retire it?
17099 * xfaces.c (USG, __TIMEVAL__): Likewise.
17100
17101 * dispextern.h (struct redisplay_interface): Rename param
17102 to avoid shadowing.
17103 * termhooks.h (struct terminal): Likewise.
17104 * xterm.c (xembed_send_message): Likewise.
17105
17106 * insdel.c (make_gap_smaller): Define only if
17107 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17108
17109 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17110 it.
17111
17112 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17113 so that we aren't warned about unused symbols.
17114
17115 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17116
17117 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17118
17119 * xfns.c (x_real_positions): Mark locals as initialized.
17120
17121 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17122
17123 * xterm.c: Fix problems found by static analysis with other toolkits.
17124 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17125 (x_dispatch_event): Declare static if USE_GTK, and
17126 define if USE_GTK || USE_X_TOOLKIT.
17127 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17128 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17129 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17130 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17131
17132 * xmenu.c (menu_help_callback): Pointer type fixes.
17133 Use const pointers when pointing at readonly data. Avoid pointer
17134 signedness clashes.
17135 (FALSE): Remove unused macro.
17136 (update_frame_menubar): Remove unused decl.
17137
17138 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17139
17140 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17141 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17142 (single_menu_item): Rename local to avoid shadowing.
17143
17144 * keyboard.c (make_lispy_event): Remove unused local var.
17145
17146 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17147 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17148
17149 * bitmaps: Change bitmaps from unsigned char back to the X11
17150 compatible char. Avoid the old compiler warnings about
17151 out-of-range initializers by using, for example, '\xab' rather
17152 than 0xab.
17153
17154 * xgselect.c (xgselect_initialize): Check vs interface
17155 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17156
17157 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17158
17159 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17160 to read-only memory.
17161
17162 * fns.c (vector): Remove; this old hack is no longer needed.
17163
17164 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17165 Remove unused var.
17166 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17167
17168 * xrdb.c (x_load_resources): Omit unused local.
17169
17170 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17171 (x_window): Rename locals to avoid shadowing.
17172 (USG): Use the kludged USG macro, to pacify gcc.
17173
17174 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17175 (x_term_init): Remove local to avoid shadowing.
17176
17177 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17178
17179 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17180 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17181
17182 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17183
17184 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17185
17186 Fix regex.c, syntax.c and friends for buffers > 2GB.
17187 * syntax.h (struct gl_state_s): Declare character position members
17188 EMACS_INT.
17189
17190 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17191
17192 * textprop.c (verify_interval_modification, interval_of):
17193 Declare arguments EMACS_INT.
17194
17195 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17196 EMACS_INT.
17197
17198 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17199
17200 * indent.c (Fvertical_motion): Local variable it_start is now
17201 EMACS_INT.
17202
17203 * regex.c (re_match, re_match_2, re_match_2_internal)
17204 (bcmp_translate, regcomp, regexec, print_double_string)
17205 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17206 (re_compile_pattern, re_exec): Declare arguments and local
17207 variables `size_t' and `ssize_t' and return values `regoff_t', as
17208 appropriate.
17209 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17210 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17211 <compile_stack_type>: `size' and `avail' are now `size_t'.
17212
17213 * regex.h <regoff_t>: Use ssize_t, not int.
17214 (re_search, re_search_2, re_match, re_match_2): Arguments that
17215 specify buffer/string position and length are now ssize_t and
17216 size_t. Return type is regoff_t.
17217
17218 2011-04-16 Ben Key <bkey76@gmail.com>
17219
17220 * nsfont.m: Fixed bugs in ns_get_family and
17221 ns_descriptor_to_entity that were caused by using free to
17222 deallocate memory blocks that were allocated by xmalloc (via
17223 xstrdup). This caused Emacs to crash when compiled with
17224 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17225 --enable-checking=xmallocoverrun). xfree is now used to
17226 deallocate these memory blocks.
17227
17228 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17229
17230 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17231
17232 emacs_write: Accept and return EMACS_INT for sizes.
17233 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17234 et seq.
17235 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17236 Accept and return EMACS_INT.
17237 (emacs_gnutls_write): Return the number of bytes written on
17238 partial writes.
17239 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17240 (emacs_read, emacs_write): Remove check for negative size, as the
17241 Emacs source code has been audited now.
17242 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17243 (emacs_read, emacs_write): Use it.
17244 * process.c (send_process): Adjust to the new signatures of
17245 emacs_write and emacs_gnutls_write. Do not attempt to store
17246 a byte offset into an 'int'; it might overflow.
17247 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17248
17249 * sound.c: Don't assume sizes fit in 'int'.
17250 (struct sound_device.period_size, alsa_period_size):
17251 Return EMACS_INT, not int.
17252 (struct sound_device.write, vox_write, alsa_write):
17253 Accept EMACS_INT, not int.
17254 (wav_play, au_play): Use EMACS_INT to store sizes and to
17255 record read return values.
17256
17257 2011-04-15 Ben Key <bkey76@gmail.com>
17258
17259 * keyboard.c (Qundefined): Don't declare static since it is used
17260 in nsfns.m.
17261 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17262 static since they are used in nsfont.m.
17263
17264 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17265
17266 * process.c (Qprocessp): Don't declare static.
17267 * lisp.h (Qprocessp): Declare again.
17268
17269 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17270
17271 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17272
17273 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17274
17275 Improve C-level modularity by making more things 'static'.
17276
17277 Don't publish debugger-only interfaces to other modules.
17278 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17279 (verify_bytepos, count_markers): Move decls to the only modules
17280 that need them.
17281 * region-cache.h (pp_cache): Likewise.
17282 * window.h (check_all_windows): Likewise.
17283 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17284
17285 * sysdep.c (croak): Now static, if
17286 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17287 * syssignal.h (croak): Declare only if not static.
17288
17289 * alloc.c (refill_memory_reserve): Now static if
17290 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17291 * lisp.h (refill_memory_reserve): Declare only if not static.
17292
17293 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17294 Define only if USE_LUCID.
17295
17296 * xrdb.c (x_customization_string, x_rm_string): Now static.
17297
17298 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17299 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17300
17301 * xdisp.c (draw_row_with_mouse_face): Now static.
17302 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17303
17304 * window.h (check_all_windows): Mark externally visible.
17305
17306 * window.c (window_deletion_count): Now static.
17307
17308 * undo.c: Make symbols static if they're not exported.
17309 (last_undo_buffer, last_boundary_position, pending_boundary):
17310 Now static.
17311
17312 * textprop.c (interval_insert_behind_hooks): Now static.
17313 (interval_insert_in_front_hooks): Likewise.
17314
17315 * term.c: Make symbols static if they're not exported.
17316 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17317 (max_frame_lines, tty_set_terminal_modes):
17318 (tty_reset_terminal_modes, tty_turn_off_highlight):
17319 (get_tty_terminal): Now static.
17320 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17321 * termhooks.h (term_mouse_moveto): Do not declare if
17322 HAVE_WINDOW_SYSTEM.
17323 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17324 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17325
17326 * sysdep.c: Make symbols static if they're not exported.
17327 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17328 Now static.
17329 (sigprocmask_set, full_mask): Remove; unused.
17330 (wait_debugging): Mark as visible.
17331 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17332 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17333
17334 * syntax.c (syntax_temp): Define only if !__GNUC__.
17335
17336 * sound.c (current_sound_device, current_sound): Now static.
17337
17338 * search.c (searchbufs, searchbuf_head): Now static.
17339
17340 * scroll.c (scroll_cost): Remove; unused.
17341 * dispextern.h (scroll_cost): Remove decl.
17342
17343 * region-cache.h (pp_cache): Mark as externally visible.
17344
17345 * process.c: Make symbols static if they're not exported.
17346 (process_tick, update_tick, create_process, chan_process):
17347 (Vprocess_alist, proc_buffered_char, datagram_access):
17348 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17349 (deactivate_process): Mark defn as static, as well as decl.
17350 * lisp.h (create_process): Remove decl.
17351 * process.h (chan_process, Vprocess_alist): Remove decls.
17352
17353 * print.c: Make symbols static if they're not exported.
17354 (print_depth, new_backquote_output, being_printed, print_buffer):
17355 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17356 (print_interval, print_number_index, initial_stderr_stream):
17357 Now static.
17358 * lisp.h (Fprinc): Remove decl.
17359 (debug_output_compilation_hack): Mark as externally visible.
17360
17361 * sysdep.c (croak): Move decl from here to syssignal.h.
17362 * syssignal.h (croak): Put it here, so the API can be checked when
17363 'croak' is called from dissociate_if_controlling_tty.
17364
17365 * minibuf.c: Make symbols static if they're not exported.
17366 (minibuf_save_list, choose_minibuf_frame): Now static.
17367 * lisp.h (choose_minibuf_frame): Remove decl.
17368
17369 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17370
17371 * lread.c: Make symbols static if they're not exported.
17372 (read_objects, initial_obarray, oblookup_last_bucket_number):
17373 Now static.
17374 (make_symbol): Remove; unused.
17375 * lisp.h (initial_obarray, make_symbol): Remove decls.
17376
17377 * keyboard.c: Make symbols static if they're not exported.
17378 (single_kboard, recent_keys_index, total_keys, recent_keys):
17379 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17380 (this_single_command_key_start, echoing, last_auto_save):
17381 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17382 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17383 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17384 (Vlispy_mouse_stem, double_click_count):
17385 Now static.
17386 (force_auto_save_soon): Define only if SIGDANGER.
17387 (ignore_mouse_drag_p): Now static if
17388 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17389 (print_help): Remove; unused.
17390 (stop_character, last_timer_event): Mark as externally visible.
17391 * keyboard.h (ignore_mouse_drag_p): Declare only if
17392 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17393 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17394 * lisp.h (echoing): Remove decl.
17395 (force_auto_save_soon): Declare only if SIGDANGER.
17396 * xdisp.c (redisplay_window): Simplify code, to make it more
17397 obvious that ignore_mouse_drag_p is not accessed if !defined
17398 USE_GTK && !defined HAVE_NS.
17399
17400 * intervals.c: Make symbols static if they're not exported.
17401 (merge_properties_sticky, merge_interval_right, delete_interval):
17402 Now static.
17403 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17404
17405 * insdel.c: Make symbols static if they're not exported.
17406 However, leave prepare_to_modify_buffer alone. It's never
17407 called from outside this function, but that appears to be a bug.
17408 (combine_after_change_list, combine_after_change_buffer):
17409 (adjust_after_replace, signal_before_change): Now static.
17410 (adjust_after_replace_noundo): Remove; unused.
17411 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17412 (signal_before_change): Remove decls.
17413
17414 * indent.c (val_compute_motion, val_vmotion): Now static.
17415
17416 * image.c: Make symbols static if they're not exported.
17417 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17418 if USE_GTK.
17419 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17420 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17421
17422 * fringe.c (standard_bitmaps): Now static.
17423 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17424
17425 * frame.c: Make symbols static if they're not exported.
17426 (x_report_frame_params, make_terminal_frame): Now static.
17427 (get_frame_param): Now static, unless HAVE_NS.
17428 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17429 (x_get_resource_string): Remove; not used.
17430 * frame.h (make_terminal_frame, x_report_frame_params):
17431 (x_get_resource_string); Remove decls.
17432 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17433 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17434
17435 * font.c, fontset.c: Make symbols static if they're not exported.
17436 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17437 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17438 * font.c (font_close_object): Now static.
17439 * font.h (font_close_object): Remove.
17440 * fontset.c (FONTSET_OBJLIST): Remove.
17441 (free_realized_fontset) #if-0 the body, which does nothing.
17442 (face_suitable_for_char_p): #if-0, as it's never called.
17443 * fontset.h (face_suitable_for_char_p): Remove decl.
17444 * xfaces.c (face_at_string_position):
17445 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17446 since 0 is always ASCII.
17447
17448 * fns.c (weak_hash_tables): Now static.
17449
17450 * fileio.c: Make symbols static if they're not exported.
17451 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17452 (Vwrite_region_annotation_buffers): Now static.
17453
17454 * eval.c: Make symbols static if they're not exported.
17455 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17456 * lisp.h (backtrace_list): Remove decl.
17457
17458 * emacs.c: Make symbols static if they're not exported.
17459 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17460 (fatal_error_code, fatal_error_signal_hook, standard_args):
17461 Now static.
17462 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17463 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17464 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17465 * lisp.h (fatal_error_signal_hook): Remove decl.
17466 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17467
17468 * editfns.c: Move a (normally-unused) function to its only use.
17469 * editfns.c, lisp.h (get_operating_system_release): Remove.
17470 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17471 worth the hassle of breaking this out.
17472
17473 * xterm.c: Make symbols static if they're not exported.
17474 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17475 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17476 (x_destroy_window, x_delete_display):
17477 Now static.
17478 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17479 (x_mouse_leave): Remove; unused.
17480 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17481 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17482 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17483 Remove decls.
17484 (x_mouse_leave): Declare only if WINDOWSNT.
17485 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17486 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17487 USE_X_TOOLKIT.
17488
17489 * ftxfont.c: Make symbols static if they're not exported.
17490 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17491 HAVE_FREETYPE.
17492 * font.h (ftxfont_driver): Likewise.
17493
17494 * xfns.c: Make symbols static if they're not exported.
17495 (x_last_font_name, x_display_info_for_name):
17496 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17497 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17498 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17499 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17500 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17501 (last_show_tip_args): Now static.
17502 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17503 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17504 (x_screen_planes): Remove; unused.
17505 * dispextern.h (x_screen_planes): Remove decl.
17506
17507 * dispnew.c: Make symbols static if they're not exported.
17508 * dispextern.h (redraw_garbaged_frames, scrolling):
17509 (increment_row_positions): Remove.
17510 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17511 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17512 Now static.
17513 (redraw_garbaged_frames): Remove; unused.
17514
17515 * xfaces.c: Make symbols static if they're not exported.
17516 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17517 Remove decls.
17518 * xterm.h (defined_color): Remove decls.
17519 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17520 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17521 (menu_face_changed_default, defined_color, free_realized_face):
17522 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17523 (ascii_face_of_lisp_face): Remove; unused.
17524
17525 * xdisp.c: Make symbols static if they're not exported.
17526 * dispextern.h (scratch_glyph_row, window_box_edges):
17527 (glyph_to_pixel_coords, set_cursor_from_row):
17528 (get_next_display_element, set_iterator_to_next):
17529 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17530 (show_mouse_face): Remove decls
17531 * frame.h (message_buf_print): Likewise.
17532 * lisp.h (pop_message, set_message, check_point_in_composition):
17533 Likewise.
17534 * xterm.h (set_vertical_scroll_bar): Likewise.
17535 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17536 (message_buf_print, scratch_glyph_row, displayed_buffer):
17537 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17538 (get_next_display_element, show_mouse_face, window_box_edges):
17539 (frame_to_window_pixel_xy, check_point_in_composition):
17540 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17541 (glyph_to_pixel_coords): Remove; unused.
17542
17543 * dired.c (file_name_completion): Now static.
17544
17545 * dbusbind.c (xd_in_read_queued_messages): Now static.
17546
17547 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17548 * data.c (circular_list_error): Remove.
17549
17550 * commands.h (last_point_position, last_point_position_buffer):
17551 (last_point_position_window): Remove decls.
17552 * keyboard.c: Make these variables static.
17553
17554 * coding.h (coding, code_convert_region, encode_coding_gap):
17555 Remove decls.
17556 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17557 (iso_code_class, detect_coding, code_convert_region): Now static.
17558 (encode_coding_gap): Remove; unused.
17559
17560 * chartab.c (chartab_chars, chartab_bits): Now static.
17561
17562 * charset.h (charset_iso_8859_1): Remove decl.
17563 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17564 Now static.
17565
17566 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17567 * ccl.c (Vccl_program_table): Now static.
17568 (check_ccl_update): Remove; unused.
17569
17570 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17571 * category.h: ... from here.
17572 * category.c (check_category_table, set_category_set): Now static.
17573
17574 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17575 * lisp.h: Remove these decls.
17576
17577 * buffer.c (buffer_count): Remove unused var.
17578
17579 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17580 so that it's not optimized away.
17581 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17582 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17583 exported only to the debugger.
17584
17585 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17586 * atimer.h (run_all_atimers): Remove; not exported.
17587
17588 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17589 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17590 was inaccessible from Lisp.
17591 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17592 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17593
17594 alloc.c: Import and export fewer symbols, and remove unused items.
17595 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17596 is defined.
17597 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17598 it's not optimized away by whole-program optimization.
17599 (message_enable_multibyte, free_misc): Remove.
17600 (catchlist, handlerlist, mark_backtrace):
17601 Declare only if BYTE_MARK_STACK.
17602 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17603 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17604 (message_enable_multibyte): Remove decl.
17605 (free_misc, interval_free_list, float_block, float_block_index):
17606 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17607 (cons_free_list, last_marked_index):
17608 Now static.
17609 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17610 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17611 (mark_backtrace): Define only if BYTE_MARK_STACK.
17612 * xdisp.c (message_enable_multibyte): Now static.
17613
17614 Declare Lisp_Object Q* variables to be 'static' if not exported.
17615 This makes it easier for human readers (and static analyzers)
17616 to see whether these variables are used from other modules.
17617 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17618 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17619 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17620 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17621 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17622 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17623 * xmenu.c, xselect.c:
17624 Declare Q* vars static if they are not used in other modules.
17625 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17626 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17627 Remove decls of unexported vars.
17628 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17629
17630 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17631
17632 Make Emacs functions such as Fatom 'static' by default.
17633 This makes it easier for human readers (and static analyzers)
17634 to see whether these functions can be called from other modules.
17635 DEFUN now defines a static function. To make the function external
17636 so that it can be used in other C modules, use the new macro DEFUE.
17637 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17638 (Finit_image_library):
17639 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17640 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17641 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17642 Remove decls, since these functions are now static.
17643 (Funintern, Fget_internal_run_time): New decls, since these functions
17644 were already external.
17645
17646 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17647 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17648 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17649 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17650 * keyboard.c, keymap.c, lread.c:
17651 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17652 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17653 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17654 Mark functions with DEFUE instead of DEFUN,
17655 if they are used in other modules.
17656 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17657 decls for now-static functions.
17658 * buffer.h (Fdelete_overlay): Remove decl.
17659 * callproc.c (Fgetenv_internal): Mark as internal.
17660 * composite.c (Fremove_list_of_text_properties): Remove decl.
17661 (Fcomposition_get_gstring): New forward static decl.
17662 * composite.h (Fcomposite_get_gstring): Remove decl.
17663 * dired.c (Ffile_attributes): New forward static decl.
17664 * doc.c (Fdocumntation_property): New forward static decl.
17665 * eval.c (Ffetch_bytecode): New forward static decl.
17666 (Funintern): Remove extern decl; now in .h file where it belongs.
17667 * fileio.c (Fmake_symbolic_link): New forward static decl.
17668 * image.c (Finit_image_library): New forward static decl.
17669 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17670 * intervals.h (Fprevious_property_change):
17671 (Fremove_list_of_text_properties): Remove decls.
17672 * keyboard.c (Fthis_command_keys): Remove decl.
17673 (Fcommand_execute): New forward static decl.
17674 * keymap.c (Flookup_key): New forward static decl.
17675 (Fcopy_keymap): Now static.
17676 * keymap.h (Flookup_key): Remove decl.
17677 * process.c (Fget_process): New forward static decl.
17678 (Fprocess_datagram_address): Mark as internal.
17679 * syntax.c (Fsyntax_table_p): New forward static decl.
17680 (skip_chars): Remove duplicate decl.
17681 * textprop.c (Fprevious_property_change): New forward static decl.
17682 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17683 Now internal.
17684 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17685 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17686
17687 * editfns.c (Fformat): Remove unreachable code.
17688
17689 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17690
17691 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17692 change. (Bug#8496)
17693
17694 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17695
17696 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17697 when at ZV. (Bug#8487)
17698
17699 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17700
17701 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17702 (Bug#8437)
17703 * keyboard.c (parse_tool_bar_item): Likewise.
17704 * sound.c (sound_cleanup, alsa_close): Likewise.
17705 * termcap.c (tgetent): Likewise.
17706 * xfns.c (x_default_font_parameter): Likewise.
17707 * xsettings.c (read_and_apply_settings): Likewise.
17708
17709 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17710 (overrun_check_free): Protoize.
17711
17712 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17713
17714 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17715 since callers should never pass a negative size.
17716 Change the signature to match that of plain 'read' and 'write'; see
17717 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17718 * lisp.h: Update prototypes of emacs_write and emacs_read.
17719
17720 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17721
17722 * xdisp.c (redisplay_window): Don't try to determine the character
17723 position of the scroll margin if the window start point w->startp
17724 is outside the buffer's accessible region. (Bug#8468)
17725
17726 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17727
17728 Fix write-region and its subroutines for buffers > 2GB.
17729 * fileio.c (a_write, e_write): Modify declaration of arguments and
17730 local variables to support buffers larger than 2GB.
17731 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17732
17733 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17734 argument, local variables, and return value.
17735
17736 * lisp.h: Update prototypes of emacs_write and emacs_read.
17737
17738 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17739
17740 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17741
17742 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17743
17744 Fix more problems found by GCC 4.6.0's static checks.
17745
17746 * xdisp.c (vmessage): Use a better test for character truncation.
17747
17748 * charset.c (load_charset_map): <, not <=, for optimization,
17749 and to avoid potential problems with integer overflow.
17750 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17751 * casetab.c (set_identity, shuffle): Likewise.
17752 * editfns.c (Fformat): Likewise.
17753 * syntax.c (skip_chars): Likewise.
17754
17755 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17756 This also lets GCC 4.6.0 generate slightly better loop code.
17757
17758 * callint.c (Fcall_interactively): <, not <=, for optimization.
17759 (Fcall_interactively): Count the number of arguments produced,
17760 not the number of arguments given. This is simpler and lets GCC
17761 4.6.0 generate slightly better code.
17762
17763 * ftfont.c: Distingish more carefully between FcChar8 and char.
17764 The previous code passed unsigned char * to a functions like
17765 strlen and xstrcasecmp that expect char *, which does not
17766 conform to the C standard.
17767 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17768 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17769 char * when the C standard requires it.
17770
17771 * keyboard.c (read_char): Remove unused var.
17772
17773 * eval.c: Port to Windows vsnprintf (Bug#8435).
17774 Include <limits.h>.
17775 (SIZE_MAX): Define if the headers do not.
17776 (verror): Do not give up if vsnprintf returns a negative count.
17777 Instead, grow the buffer. This ports to Windows vsnprintf, which
17778 does not conform to C99. Problem reported by Eli Zaretskii.
17779 Also, simplify the allocation scheme, by avoiding the need for
17780 calling realloc, and removing the ALLOCATED variable.
17781
17782 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17783
17784 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17785 But keep the doprint source code for now, as we might revamp it
17786 and use it again (Bug#8435).
17787 * lisp.h (doprnt): Remove.
17788 * Makefile.in (base_obj): Remove doprnt.o.
17789 * deps.mk (doprnt.o): Remove.
17790
17791 error: Print 32- and 64-bit integers portably (Bug#8435).
17792 Without this change, on typical 64-bit hosts error ("...%d...", N)
17793 was used to print both 32- and 64-bit integers N, which relied on
17794 undefined behavior.
17795 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17796 * lisp.h (error, verror): Mark as printf-like functions.
17797 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17798 Report overflow in size calculations when allocating printf buffer.
17799 Do not truncate output string at its first null byte.
17800 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17801 Truncate the output at a character boundary, since vsnprintf does not
17802 do that.
17803 * charset.c (check_iso_charset_parameter): Convert internal
17804 character to string before calling 'error', since %c now has the
17805 printf meaning.
17806 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17807 overflow when computing char to be passed to 'error'. Do not
17808 pass Lisp_Object to 'error'; pass the integer instead.
17809 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17810 formatted with plain %d.
17811
17812 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17813
17814 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17815
17816 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17817
17818 * xterm.c (x_catch_errors): Remove duplicate declaration.
17819
17820 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17821
17822 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17823
17824 2011-04-10 Jim Meyering <meyering@redhat.com>
17825
17826 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17827 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17828 return ssize_t not "int", and use size_t as the buffer length.
17829 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17830 * gnutls.h: Update declarations.
17831 * process.c (read_process_output): Use ssize_t, to match.
17832 (send_process): Likewise.
17833
17834 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17835
17836 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17837
17838 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17839
17840 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17841 Use unsigned char, to match FcChar8 type definition.
17842
17843 * xterm.c (handle_one_xevent):
17844 * xmenu.c (create_and_show_popup_menu):
17845 * xselect.c (x_decline_selection_request)
17846 (x_reply_selection_request): Avoid type-punned deref of X events.
17847
17848 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17849
17850 Fix some uses of `int' instead of EMACS_INT.
17851 * search.c (string_match_1, fast_string_match)
17852 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17853 (scan_buffer, find_next_newline_no_quit)
17854 (find_before_next_newline, search_command, Freplace_match)
17855 (Fmatch_data): Make some `int' variables be EMACS_INT.
17856
17857 * xdisp.c (display_count_lines): 3rd argument and return value now
17858 EMACS_INT. All callers changed.
17859 (pint2hrstr): Last argument is now EMACS_INT.
17860
17861 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17862 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17863 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17864 (decode_coding_utf_16, decode_coding_emacs_mule)
17865 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17866 (decode_coding_ccl, decode_coding_charset)
17867 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17868 (decode_coding_iso_2022, decode_coding_emacs_mule)
17869 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17870 <char_offset, last_offset>: Declare EMACS_INT.
17871 (encode_coding_utf_8, encode_coding_utf_16)
17872 (encode_coding_emacs_mule, encode_invocation_designation)
17873 (encode_designation_at_bol, encode_coding_iso_2022)
17874 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17875 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17876 Declare EMACS_INT.
17877 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17878 (encode_invocation_designation): Last argument P_NCHARS is now
17879 EMACS_INT.
17880 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17881 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17882
17883 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17884 All users changed.
17885
17886 * ccl.c (Fccl_execute_on_string): Declare some variables
17887 EMACS_INT.
17888
17889 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17890
17891 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17892
17893 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17894
17895 * process.c (Fformat_network_address): Doc fix.
17896
17897 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17898
17899 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17900
17901 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17902
17903 * keyboard.c (read_char): Call Lisp function help-form-show,
17904 instead of using internal_with_output_to_temp_buffer.
17905 (Qhelp_form_show): New var.
17906 (syms_of_keyboard): Use DEFSYM macro.
17907
17908 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17909
17910 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17911
17912 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17913
17914 * process.c (Flist_processes): Remove to Lisp.
17915 (list_processes_1): Delete.
17916
17917 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17918
17919 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17920
17921 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17922
17923 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17924
17925 Fix more problems found by GCC 4.6.0's static checks.
17926
17927 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17928
17929 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17930
17931 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17932
17933 * xdisp.c (vmessage): Mark as a printf-like function.
17934
17935 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17936
17937 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17938
17939 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17940 printf-like functions.
17941 (tiff_load): Add casts to remove these marks before passing them
17942 to system-supplied API.
17943
17944 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17945
17946 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17947 This avoids several warnings with gcc -Wstrict-overflow.
17948 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17949 directly, rather than having caller test rule sign. This avoids
17950 some unnecessary tests.
17951 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17952 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17953 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17954
17955 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17956 (xfont_open): Avoid unnecessary tests.
17957
17958 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17959
17960 * composite.h, composite.c (composition_gstring_put_cache):
17961 Use EMACS_INT, not int, for length.
17962
17963 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17964 breaking out part of COMPOSITION_DECODE_RULE.
17965 (COMPOSITION_DECODE_RULE): Use it.
17966 * composite.c (get_composition_id): Remove unused local vars,
17967 by using the new macro.
17968
17969 * textprop.c (set_text_properties_1): Change while to do-while,
17970 since the condition is always true at first.
17971
17972 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17973 (interval_deletion_adjustment): Return unsigned value.
17974 All uses changed.
17975
17976 * process.c (list_processes_1, create_pty, read_process_output):
17977 (exec_sentinel): Remove vars that were set but not used.
17978 (create_pty): Remove unnecessary "volatile"s.
17979 (Fnetwork_interface_info): Avoid possibility of int overflow.
17980 (read_process_output): Do adaptive read buffering even if carryover.
17981 (read_process_output): Simplify nbytes computation if buffered.
17982
17983 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17984
17985 * syntax.c (scan_words): Remove var that was set but not used.
17986 (update_syntax_table): Use unsigned instead of int.
17987
17988 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17989 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17990 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17991
17992 * print.c (print_error_message): Avoid int overflow.
17993
17994 * font.c (font_list_entities): Redo for clarity,
17995 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17996
17997 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17998 (font_score): Avoid potential overflow in diff calculation.
17999
18000 * fns.c (substring_both): Remove var that is set but not used.
18001 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18002
18003 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18004
18005 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18006 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18007 can always succeed if overflow has undefined behavior.
18008
18009 * search.c (boyer_moore, wordify): Remove vars set but not used.
18010 (wordify): Omit three unnecessary tests.
18011
18012 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18013 All callers changed. This avoids the need for an unused var.
18014
18015 * casefiddle.c (casify_region): Remove var that is set but not used.
18016
18017 * dired.c (file_name_completion): Remove var that is set but not used.
18018
18019 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18020
18021 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18022 (Finsert_file_contents): Remove unnecessary code checking fd.
18023
18024 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18025 Check for integer overflow on size calculations.
18026
18027 * buffer.c (Fprevious_overlay_change): Remove var that is set
18028 but not used.
18029
18030 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18031 Remove vars that are set but not used.
18032 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18033 (timer_check_2): Mark vars as initialized.
18034
18035 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18036
18037 * image.c (lookup_image): Remove var that is set but not used.
18038 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18039
18040 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18041 that are set but not used.
18042
18043 * xfns.c (make_invisible_cursor): Don't return garbage
18044 if XCreateBitmapFromData fails (Bug#8410).
18045
18046 * xselect.c (x_get_local_selection, x_handle_property_notify):
18047 Remove vars that are set but not used.
18048
18049 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18050 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18051
18052 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18053 Remove var that is set but not used.
18054 (scroll_bar_windows_size): Now size_t, not int.
18055 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18056 Check for overflow.
18057
18058 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18059 (map_tty_color) [!defined MSDOS]: Likewise.
18060
18061 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18062
18063 * coding.c: Remove vars that are set but not used.
18064 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18065 All callers changed.
18066 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18067 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18068 (decode_coding_charset): Remove vars that are set but not used.
18069
18070 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18071 that is set but not used.
18072
18073 * print.c (print_object): Remove var that is set but not used.
18074
18075 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18076 The gnulib version avoids calling malloc in the usual case,
18077 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18078 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18079 * filelock.c (current_lock_owner): Likewise.
18080 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18081 * sysdep.c: Include allocator.h, careadlinkat.h.
18082 (emacs_no_realloc_allocator): New static constant.
18083 (emacs_readlink): New function.
18084 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18085 ../lib/careadlinkat.h.
18086
18087 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18088
18089 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18090 first non-nil return value).
18091
18092 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18093
18094 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18095 if not defined (Bug#8403).
18096
18097 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18098
18099 * xdisp.c (display_count_lines): Remove parameter `start',
18100 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18101 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18102 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18103 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18104 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18105 and thereabouts. All callers changed.
18106 (get_per_char_metric): Remove parameter `f', unused since
18107 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18108
18109 2011-04-02 Jim Meyering <meyering@redhat.com>
18110
18111 do not dereference NULL upon failed strdup
18112 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18113 (ns_get_family): Likewise.
18114
18115 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18116
18117 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18118
18119 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18120
18121 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18122 later (Bug#8403).
18123
18124 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18125
18126 Add lexical binding.
18127
18128 * window.c (Ftemp_output_buffer_show): New fun.
18129 (Fsave_window_excursion):
18130 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18131
18132 * lread.c (lisp_file_lexically_bound_p): New function.
18133 (Fload): Bind Qlexical_binding.
18134 (readevalloop): Remove `evalfun' arg.
18135 Bind Qinternal_interpreter_environment.
18136 (Feval_buffer): Bind Qlexical_binding.
18137 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18138 Mark as dynamic.
18139 (syms_of_lread): Declare `lexical-binding'.
18140
18141 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18142
18143 * keyboard.c (eval_dyn): New fun.
18144 (menu_item_eval_property): Use it.
18145
18146 * image.c (parse_image_spec): Use Ffunctionp.
18147
18148 * fns.c (concat, mapcar1): Accept byte-code-functions.
18149
18150 * eval.c (Fsetq): Handle lexical vars.
18151 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18152 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18153 (FletX, Flet): Obey lexical binding.
18154 (Fcommandp): Handle closures.
18155 (Feval): New `lexical' arg.
18156 (eval_sub): New function extracted from Feval. Use it almost
18157 everywhere where Feval was used. Look up vars in lexical env.
18158 Handle closures.
18159 (Ffunctionp): Move from subr.el.
18160 (Ffuncall): Handle closures.
18161 (apply_lambda): Remove `eval_flags'.
18162 (funcall_lambda): Handle closures and new byte-code-functions.
18163 (Fspecial_variable_p): New function.
18164 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18165 but without exporting it to Lisp.
18166
18167 * doc.c (Fdocumentation, store_function_docstring):
18168 * data.c (Finteractive_form): Handle closures.
18169
18170 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18171 interactive spec.
18172
18173 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18174 New byte-codes.
18175 (exec_byte_code): New function extracted from Fbyte_code to handle new
18176 calling convention for byte-code-functions. Add new byte-codes.
18177
18178 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18179
18180 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18181
18182 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18183
18184 * xdisp.c (redisplay_internal): Fix prototype.
18185
18186 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18187
18188 * xdisp.c (SCROLL_LIMIT): New macro.
18189 (try_scrolling): Use it when setting scroll_limit.
18190 Limit scrolling to 100 screen lines.
18191 (redisplay_window): Even when falling back on "recentering",
18192 position point in the window according to scroll-conservatively,
18193 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18194
18195 (try_scrolling): When point is above the window, allow searching
18196 as far as scroll_max, or one screenful, to compute vertical
18197 distance from PT to the scroll margin position. This prevents
18198 try_scrolling from unnecessarily failing when
18199 scroll-conservatively is set to a value slightly larger than the
18200 window height. Clean up the case of PT below the margin at bottom
18201 of window: scroll_max can no longer be INT_MAX. When aggressive
18202 scrolling is in use, don't let point enter the opposite scroll
18203 margin as result of the scroll.
18204 (syms_of_xdisp) <scroll-conservatively>: Document the
18205 threshold of 100 lines for never-recentering scrolling.
18206
18207 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18208
18209 * dispextern.h (move_it_by_lines):
18210 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18211 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18212 (message_log_check_duplicate): Remove parameters `prev_bol' and
18213 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18214 (redisplay_internal): Remove parameter `preserve_echo_area',
18215 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18216
18217 * indent.c (Fvertical_motion):
18218 * window.c (window_scroll_pixel_based, Frecenter):
18219 Don't pass `need_y_p' to `move_it_by_lines'.
18220
18221 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18222
18223 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18224 steal a few bits to be more compact.
18225 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18226 Remove unneeded casts.
18227
18228 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18229
18230 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18231
18232 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18233 binding" message (bug#7967).
18234
18235 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18236
18237 Fix more problems found by GCC 4.6.0's static checks.
18238
18239 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18240 Remove unused local var.
18241
18242 * editfns.c (Fmessage_box): Remove unused local var.
18243
18244 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18245 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18246 Omit unused local vars.
18247 * window.c (shrink_windows): Omit unused local var.
18248 * menu.c (digest_single_submenu): Omit unused local var.
18249 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18250 Omit unused local var.
18251
18252 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18253 Don't assume string length fits in int.
18254 (keyremap_step, read_key_sequence): Use size_t for sizes.
18255 (read_key_sequence): Don't check last_real_key_start redundantly.
18256
18257 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18258 instead of alloca (Bug#8344).
18259
18260 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18261 (Fbacktrace_frame): Don't assume nframes fits in int.
18262
18263 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18264
18265 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18266 concerns.
18267
18268 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18269
18270 * cm.c (calccost): Turn while-do into do-while, for clarity.
18271
18272 * keyboard.c (syms_of_keyboard): Use the same style as later
18273 in this function when indexing through an array. This also
18274 works around GCC bug 48267.
18275
18276 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18277
18278 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18279
18280 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18281 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18282
18283 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18284 This avoids undefined behavior on integer overflow, and is a bit
18285 more convenient anyway since it is compared to a size_t variable.
18286
18287 Variadic C functions now count arguments with size_t, not int.
18288 This avoids an unnecessary limitation on 64-bit machines, which
18289 caused (substring ...) to crash on large vectors (Bug#8344).
18290 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18291 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18292 All variadic functions and their callers changed accordingly.
18293 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18294 * data.c (arith_driver, float_arith_driver): Likewise.
18295 * editfns.c (general_insert_function): Likewise.
18296 * eval.c (struct backtrace.nargs, interactive_p)
18297 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18298 (funcall_lambda, mark_backtrace): Likewise.
18299 * fns.c (concat): Likewise.
18300 * frame.c (x_set_frame_parameters): Likewise.
18301 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18302 0 if not found, not -1. All callers changed.
18303
18304 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18305 (stack_copy_size): Now size_t, not int.
18306 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18307
18308 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18309
18310 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18311 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18312 All callers changed.
18313
18314 * lisp.h (multibyte_char_to_unibyte):
18315 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18316 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18317 * character.h (CHAR_TO_BYTE8):
18318 * cmds.c (internal_self_insert):
18319 * editfns.c (general_insert_function):
18320 * keymap.c (push_key_description):
18321 * search.c (Freplace_match):
18322 * xdisp.c (message_dolog, set_message_1): All callers changed.
18323
18324 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18325
18326 * keyboard.c (safe_run_hook_funcall): New function.
18327 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18328 don't set the hook to nil, but remove the offending function instead.
18329 (Qcommand_hook_internal): Remove, unused.
18330 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18331 Vcommand_hook_internal.
18332
18333 * eval.c (enum run_hooks_condition): Remove.
18334 (funcall_nil, funcall_not): New functions.
18335 (run_hook_with_args): Call each function through a `funcall' argument.
18336 Remove `cond' argument, now redundant.
18337 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18338 (Frun_hook_with_args_until_failure): Adjust accordingly.
18339 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18340
18341 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18342
18343 * dispextern.h (string_buffer_position): Remove declaration.
18344
18345 * print.c (strout): Remove parameter `multibyte', unused since
18346 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18347
18348 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18349 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18350 All callers changed.
18351
18352 * w32.c (_wsa_errlist): Use braces for struct initializers.
18353
18354 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18355 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18356 All callers changed.
18357 (string_buffer_position): Likewise. Also, make static (it's never
18358 used outside xdisp.c).
18359 (cursor_row_p): Remove parameter `w', unused since
18360 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18361 (decode_mode_spec): Remove parameter `precision', introduced during
18362 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18363 All callers changed.
18364
18365 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18366
18367 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18368
18369 2011-03-27 Anders Lindgren <andlind@gmail.com>
18370
18371 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18372 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18373 (ns_update_auto_hide_menu_bar): New functions.
18374 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18375 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18376 ns_constrain_all_frames.
18377 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18378 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18379
18380 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18381
18382 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18383
18384 2011-03-27 Glenn Morris <rgm@gnu.org>
18385
18386 * syssignal.h: Replace RETSIGTYPE with void.
18387 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18388 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18389 Replace SIGTYPE with void everywhere.
18390 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18391 * s/template.h (SIGTYPE): Remove commented out definition.
18392
18393 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18394
18395 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18396 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18397
18398 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18399
18400 * w32.c (read_unc_volume): Use parameter `henum', instead of
18401 global variable `wget_enum_handle'.
18402
18403 * keymap.c (describe_vector): Remove parameters `indices' and
18404 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18405 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18406
18407 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18408
18409 * keyboard.c (timer_check): Remove parameter `do_it_now',
18410 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18411 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18412 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18413
18414 * keyboard.c (read_char):
18415 * w32menu.c (w32_menu_display_help):
18416 * xmenu.c (show_help_event, menu_help_callback):
18417 Adjust calls to `show_help_echo'.
18418
18419 * gtkutil.c (xg_maybe_add_timer):
18420 * keyboard.c (readable_events):
18421 * process.c (wait_reading_process_output):
18422 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18423
18424 * insdel.c (adjust_markers_gap_motion):
18425 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18426 (gap_left, gap_right): Don't call it.
18427
18428 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18429
18430 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18431 incurred during fontification.
18432
18433 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18434
18435 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18436 (DEFVAR_PER_BUFFER): Don't pass it.
18437
18438 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18439 (scrolling_window): Don't pass it.
18440
18441 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18442
18443 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18444
18445 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18446 and `suffix'.
18447 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18448 of variables specific to SELinux and computation of `encoded_absname'.
18449
18450 * image.c (XPutPixel): Remove unused variable `height'.
18451
18452 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18453
18454 * unexw32.c (get_section_info): Remove unused variable `section'.
18455
18456 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18457 (system_process_attributes): Remove unused variable `sess'.
18458 (sys_read): Remove unused variable `err'.
18459
18460 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18461 (w32_wnd_proc): Remove unused variable `isdead'.
18462 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18463 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18464 (x_create_tip_frame): Remove unused variable `tem'.
18465
18466 * w32inevt.c (w32_console_read_socket):
18467 Remove unused variable `no_events'.
18468
18469 * w32term.c (x_draw_composite_glyph_string_foreground):
18470 Remove unused variable `width'.
18471
18472 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18473
18474 * w32term.c (x_set_glyph_string_clipping):
18475 Don't pass uninitialized region to CombineRgn.
18476
18477 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18478
18479 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18480 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18481 (Fx_close_connection): Remove unused variable `i'.
18482
18483 * w32font.c (w32font_draw): Return number of glyphs.
18484 (w32font_open_internal): Remove unused variable `i'.
18485 (w32font_driver): Add missing initializer.
18486
18487 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18488 (fill_in_menu): Remove unused variable `items_added'.
18489
18490 * w32term.c (last_mouse_press_frame): Remove static global variable.
18491 (w32_clip_to_row): Remove unused variable `f'.
18492 (x_delete_terminal): Remove unused variable `i'.
18493
18494 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18495 (NOTHING): Remove unused static global variable.
18496 (uniscribe_check_otf): Remove unused variable `table'.
18497 (uniscribe_font_driver): Add missing initializers.
18498
18499 2011-03-23 Julien Danjou <julien@danjou.info>
18500
18501 * term.c (Fsuspend_tty, Fresume_tty):
18502 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18503 * window.c (temp_output_buffer_show):
18504 * insdel.c (signal_before_change):
18505 * frame.c (Fhandle_switch_frame):
18506 * fileio.c (Fdo_auto_save):
18507 * emacs.c (Fkill_emacs):
18508 * editfns.c (save_excursion_restore):
18509 * cmds.c (internal_self_insert):
18510 * callint.c (Fcall_interactively):
18511 * buffer.c (Fkill_all_local_variables):
18512 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18513 Use Frun_hooks.
18514 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18515 unconditionally since it does the check itself.
18516
18517 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18518
18519 Fix more problems found by GCC 4.5.2's static checks.
18520
18521 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18522 the first time through the loop, since we know p0 < p1 then.
18523 This also avoids a gcc -Wstrict-overflow warning.
18524
18525 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18526 leading to a memory leak, possible in functions like
18527 load_charset_map_from_file that can allocate an unbounded number
18528 of objects (Bug#8318).
18529
18530 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18531 that could (at least in theory) be that large.
18532
18533 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18534 This is less likely to overflow, and avoids undefined behavior if
18535 overflow does occur. All callers changed. Use strtoul to scan
18536 for the unsigned long integer.
18537 (pint2hrstr): Simplify and tune code slightly.
18538 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18539
18540 * scroll.c (do_scrolling): Work around GCC bug 48228.
18541 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18542
18543 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18544 This also avoids a warning with gcc -Wstrict-overflow.
18545 (validate_x_resource_name): Simplify count usage.
18546 This also avoids a warning with gcc -Wstrict-overflow.
18547
18548 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18549 fail (Bug#8306).
18550
18551 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18552
18553 * process.c (Fmake_network_process): Use socklen_t, not int,
18554 where POSIX says socklen_t is required in portable programs.
18555 This fixes a porting bug on hosts like 64-bit HP-UX, where
18556 socklen_t is wider than int (Bug#8277).
18557 (Fmake_network_process, server_accept_connection):
18558 (wait_reading_process_output, read_process_output):
18559 Likewise.
18560
18561 * process.c: Rename or move locals to avoid shadowing.
18562 (list_processes_1, Fmake_network_process):
18563 (read_process_output_error_handler, exec_sentinel_error_handler):
18564 Rename or move locals.
18565 (Fmake_network_process): Define label "retry_connect" only if needed.
18566 (Fnetwork_interface_info): Fix pointer signedness.
18567 (process_send_signal): Add cast to avoid pointer signedness problem.
18568 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18569 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18570
18571 Make tparam.h and terminfo.c consistent.
18572 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18573 Include tparam.h instead, since it declares them.
18574 * cm.h (PC): Remove extern decl; tparam.h now does this.
18575 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18576 * terminfo.c: Include tparam.h, to check interfaces.
18577 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18578 (tparam): Adjust signature to match interface in tparam.h;
18579 this removes some undefined behavior. Check that outstring and len
18580 are zero, which they always are with Emacs.
18581 * tparam.h (PC, BC, UP): New extern decls.
18582
18583 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18584 (xftfont_open): Rename locals to avoid shadowing.
18585
18586 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18587 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18588 (OTF_TAG_SYM): Omit macro if not needed.
18589 (ftfont_list): Remove unused local.
18590 (get_adstyle_property, ftfont_pattern_entity):
18591 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18592 Rename locals to avoid shadowing.
18593
18594 * xfont.c (xfont_list_family): Mark var as initialized.
18595
18596 * xml.c (make_dom): Now static.
18597
18598 * composite.c (composition_compute_stop_pos): Rename local to
18599 avoid shadowing.
18600 (composition_reseat_it): Remove unused locals.
18601 (find_automatic_composition, composition_adjust_point): Likewise.
18602 (composition_update_it): Mark var as initialized.
18603 (find_automatic_composition): Mark vars as initialized,
18604 with a FIXME (Bug#8290).
18605
18606 character.h: Rename locals to avoid shadowing.
18607 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18608 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18609 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18610 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18611 to avoid shadowing.
18612
18613 * textprop.c (property_change_between_p): Remove; unused.
18614
18615 * intervals.c (interval_start_pos): Now static.
18616
18617 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18618
18619 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18620 Rename locals to avoid shadowing.
18621
18622 * sound.c (wav_play, au_play, Fplay_sound_internal):
18623 Fix pointer signedness.
18624 (alsa_choose_format): Remove unused local var.
18625 (wav_play): Initialize a variable to 0, to prevent undefined
18626 behavior (Bug#8278).
18627
18628 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18629
18630 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18631
18632 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18633 clobbering (Bug#8298).
18634 * sysdep.c (sys_subshell): Likewise.
18635 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18636
18637 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18638 This should get cleaned up, so that child_setup has the
18639 same signature on all platforms.
18640
18641 * callproc.c (call_process_cleanup): Now static.
18642 (relocate_fd): Rename locals to avoid shadowing.
18643
18644 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18645
18646 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18647 not to be necessary, and produces flickering.
18648
18649 2011-03-20 Glenn Morris <rgm@gnu.org>
18650
18651 * config.in: Remove file.
18652
18653 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18654
18655 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18656 are now in src/globals.h.
18657 (syms_of_minibuf): Remove spurious & from previous change.
18658
18659 2011-03-20 Leo Liu <sdl.web@gmail.com>
18660
18661 * minibuf.c (completing-read-function): New variable.
18662 (completing-read-default): Rename from completing-read.
18663 (completing-read): Call completing-read-function.
18664
18665 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18666
18667 * xfaces.c (Fx_load_color_file):
18668 Read color file from absolute filename (bug#8250).
18669
18670 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18671
18672 * makefile.w32-in: Update dependencies.
18673
18674 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18675
18676 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18677
18678 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18679
18680 Fix more problems found by GCC 4.5.2's static checks.
18681
18682 * process.c (make_serial_process_unwind, send_process_trap):
18683 (sigchld_handler): Now static.
18684
18685 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18686 That way, the code declares only the vars that it needs.
18687 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18688 * s/cygwin.h (PTY_ITERATION): Likewise.
18689 * s/darwin.h (PTY_ITERATION): Likewise.
18690 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18691
18692 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18693 * process.c (allocate_pty): Don't declare stb unless it's needed.
18694
18695 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18696 (CONSTANTLIM): Remove; unused.
18697 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18698 Define only if needed.
18699
18700 * unexelf.c (unexec): Name an expression,
18701 to avoid gcc -Wbad-function-cast warning.
18702 Use a different way to cause a compilation error if anyone uses
18703 n rather than nn, a way that does not involve shadowing.
18704 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18705
18706 * deps.mk (unexalpha.o): Remove; unused.
18707
18708 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18709 * unexec.h: New file.
18710 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18711 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18712 Depend on unexec.h.
18713 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18714 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18715 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18716 Change as necessary to match prototype in unexec.h.
18717
18718 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18719 shadowing.
18720 (back_comment, skip_chars): Mark vars as initialized.
18721
18722 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18723 Rename locals to avoid shadowing.
18724
18725 * lread.c (read1): Rewrite so as not to use empty "else".
18726 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18727
18728 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18729
18730 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18731 warning when compiling print.c.
18732
18733 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18734 instead of using an uninitialized var.
18735 (font_sort_entities): Mark var as initialized.
18736
18737 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18738
18739 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18740 pointers to constants.
18741 (font_parse_fcname): Remove unused vars.
18742 (font_delete_unmatched): Now static.
18743 (font_get_spec): Remove; unused.
18744 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18745 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18746 Rename or move locals to avoid shadowing.
18747
18748 * fns.c (require_nesting_list, require_unwind): Now static.
18749 (Ffillarray): Rename locals to avoid shadowing.
18750
18751 * floatfns.c (domain_error2): Define only if needed.
18752 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18753
18754 * alloc.c (mark_backtrace): Move decl from here ...
18755 * lisp.h: ... to here, so that it can be checked.
18756
18757 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18758 (Fdefvar): Rewrite so as not to use empty "else".
18759 (lisp_indirect_variable): Name an expression,
18760 to avoid gcc -Wbad-function-cast warning.
18761 (Fdefvar): Rename locals to avoid shadowing.
18762
18763 * callint.c (quotify_arg, quotify_args): Now static.
18764 (Fcall_interactively): Rename locals to avoid shadowing.
18765 Use const pointer when appropriate.
18766
18767 * lisp.h (get_system_name, get_operating_system_release):
18768 Move decls here, to check interfaces.
18769 * process.c (get_operating_system_release): Move decl to lisp.h.
18770 * xrdb.c (get_system_name): Likewise.
18771 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18772 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18773 some of which prompt warnings from gcc -Wbad-function-cast.
18774 (Fformat_time_string, Fencode_time, Finsert_char):
18775 (Ftranslate_region_internal, Fformat):
18776 Rename or remove local vars to avoid shadowing.
18777 (Ftranslate_region_internal): Mark var as initialized.
18778
18779 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18780 avoid shadowing.
18781
18782 * lisp.h (eassert): Check that the argument compiles, even if
18783 ENABLE_CHECKING is not defined.
18784
18785 * data.c (Findirect_variable): Name an expression, to avoid
18786 gcc -Wbad-function-cast warning.
18787 (default_value, arithcompare, arith_driver, arith_error): Now static.
18788 (store_symval_forwarding): Rename local to avoid shadowing.
18789 (Fmake_variable_buffer_local, Fmake_local_variable):
18790 Mark variables as initialized.
18791 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18792
18793 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18794 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18795 Rename locals to avoid shadowing.
18796 (mark_stack): Move local variables into the #ifdef region where
18797 they're used.
18798 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18799 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18800 needed otherwise.
18801 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18802 (GC_STRING_CHARS): Remove; not used.
18803 (Fmemory_limit): Cast sbrk's returned value to char *.
18804
18805 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18806 avoids undefined behavior in theory.
18807
18808 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18809
18810 Use functions, not macros, for up- and down-casing (Bug#8254).
18811 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18812 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18813 to use the following functions instead of these macros.
18814 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18815 EMACS_INT, since callers assume the returned value fits in int.
18816 (upcase1): Likewise, for UPCASE_TABLE.
18817 (uppercasep, lowercasep, upcase): New static inline functions.
18818 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18819 the race-condition problem in the old DOWNCASE.
18820
18821 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18822 Rename locals to avoid shadowing.
18823 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18824 (regex_compile, re_search_2, re_match_2_internal):
18825 Remove unused local vars.
18826 (FREE_VAR): Rewrite so as not to use empty "else",
18827 which gcc can warn about.
18828 (regex_compile, re_match_2_internal): Mark locals as initialized.
18829 (RETALLOC_IF): Define only if needed.
18830 (WORDCHAR_P): Likewise. This one is never needed, but is used
18831 only in a comment talking about a compiler bug, so put inside
18832 the #if 0 of that comment.
18833 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18834 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18835 Remove; unused.
18836
18837 * search.c (boyer_moore): Rename locals to avoid shadowing.
18838 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18839 (PREV_CHAR_BOUNDARY): Likewise.
18840
18841 * search.c (simple_search): Remove unused var.
18842
18843 * dired.c (compile_pattern): Move decl from here ...
18844 * lisp.h: ... to here, so that it can be checked.
18845 (struct re_registers): New forward decl.
18846
18847 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18848
18849 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18850 All uses changed.
18851 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18852 Rename locals to avoid shadowing.
18853 (Fvertical_motion): Mark locals as initialized.
18854
18855 * casefiddle.c (casify_object, casify_region): Now static.
18856 (casify_region): Mark local as initialized.
18857
18858 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18859
18860 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18861 New macros, so that the caller can use some names other than
18862 gcpro1, gcpro2, etc.
18863 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18864 of the new macros.
18865 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18866 argument, for consistency with GCPRO2_VAR, etc: it is now the
18867 prefix of the variable, not the variable itself. All uses
18868 changed.
18869 * dired.c (directory_files_internal, file_name_completion):
18870 Rename locals to avoid shadowing.
18871
18872 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18873 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18874 dired.c's scmp function, had undefined behavior.
18875 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18876 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18877 * buffer.h: ... to here, because these macros use current_buffer,
18878 and the new implementation with inline functions needs to have
18879 current_buffer in scope now, rather than later when the macros
18880 are used.
18881 (downcase, upcase1): New static inline functions.
18882 (DOWNCASE, UPCASE1): Reimplement using these functions.
18883 This avoids undefined behavior in expressions like
18884 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18885 from race conditions in accessing the global variables
18886 case_temp1 and case_temp2.
18887 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18888 * lisp.h (case_temp1, case_temp2): Remove their decls.
18889 * character.h (ASCII_CHAR_P): Move from here ...
18890 * lisp.h: ... to here, so that the inline functions mentioned
18891 above can use them.
18892
18893 * dired.c (directory_files_internal_unwind): Now static.
18894
18895 * fileio.c (file_name_as_directory, directory_file_name):
18896 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18897 Now static.
18898 (file_name_as_directory): Use const pointers when appropriate.
18899 (Fexpand_file_name): Likewise. In particular, newdir might
18900 point at constant storage, so make it a const pointer.
18901 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18902 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18903 signedness issues.
18904 (Fset_file_times, Finsert_file_contents, auto_save_error):
18905 Rename locals to avoid shadowing.
18906
18907 * minibuf.c (choose_minibuf_frame_1): Now static.
18908 (Ftry_completion, Fall_completions): Rename or remove locals
18909 to avoid shadowing.
18910
18911 * marker.c (bytepos_to_charpos): Remove; unused.
18912
18913 * lisp.h (verify_bytepos, count_markers): New decls,
18914 so that gcc does not warn that these functions aren't declared.
18915
18916 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18917 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18918 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18919 (copy_text): Remove unused local var.
18920
18921 * filelock.c (within_one_second): Now static.
18922 (lock_file_1): Rename local to avoid shadowing.
18923
18924 * buffer.c (fix_overlays_before): Mark locals as initialized.
18925 (fix_start_end_in_overlays): Likewise. This function should be
18926 simplified by using pointers-to-pointers, but that's a different
18927 matter.
18928 (switch_to_buffer_1): Now static.
18929 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18930 (report_overlay_modification): Rename locals to avoid shadowing.
18931
18932 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18933 Fix pointer signedness issue.
18934 (sys_subshell): Mark local as volatile if checking for lint,
18935 to suppress a gcc -Wclobbered warning that does not seem to be right.
18936 (MAXPATHLEN): Define only if needed.
18937
18938 * process.c (serial_open, serial_configure): Move decls from here ...
18939 * systty.h: ... to here, so that they can be checked.
18940
18941 * fns.c (get_random, seed_random): Move extern decls from here ...
18942 * lisp.h: ... to here, so that they can be checked.
18943
18944 * sysdep.c (reset_io): Now static.
18945 (wait_for_termination_signal): Remove; unused.
18946
18947 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18948 (copy_keymap_item, append_key, push_text_char_description):
18949 Now static.
18950 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18951 (DENSE_TABLE_SIZE): Remove; unused.
18952 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18953 (describe_map_tree):
18954 Rename locals to avoid shadowing.
18955
18956 * keyboard.c: Declare functions static if they are not used elsewhere.
18957 (echo_char, echo_dash, cmd_error, top_level_2):
18958 (poll_for_input, handle_async_input): Now static.
18959 (read_char, kbd_buffer_get_event, make_lispy_position):
18960 (make_lispy_event, make_lispy_movement, apply_modifiers):
18961 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18962 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18963 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18964 (read_key_sequence, read_char): Mark locals as initialized.
18965 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18966
18967 * keyboard.h (make_ctrl_char): New decl.
18968 (mark_kboards): Move decl here ...
18969 * alloc.c (mark_kboards): ... from here.
18970
18971 * lisp.h (force_auto_save_soon): New decl.
18972
18973 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18974 (DEFINE_DUMMY_FUNCTION): New macro.
18975 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18976 Use it.
18977 (main): Add casts to avoid warnings
18978 if GCC considers string literals to be constants.
18979
18980 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18981
18982 * dbusbind.c: Pointer signedness fixes.
18983 (xd_signature, xd_append_arg, xd_initialize):
18984 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18985 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18986 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18987 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18988
18989 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18990 if GCC considers string literals to be constants.
18991 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18992
18993 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18994
18995 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18996 (print_preprocess, print_object): New macro to fix last change.
18997
18998 * print.c (print_preprocess): Don't forget font objects.
18999
19000 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19001
19002 * emacs.c (USAGE3): Doc fixes.
19003
19004 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19005
19006 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19007 structure.
19008
19009 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19010
19011 * lisp.h (VWindow_system, Qfile_name_history):
19012 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19013 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19014 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19015
19016 * w32select.c: Don't #include "keyboard.h".
19017 (run_protected): Add extern declaration for waiting_for_input.
19018
19019 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19020 * w32console.c (detect_input_pending, read_input_pending)
19021 (encode_terminal_code):
19022 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19023 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19024 (w32_system_caret_y, Qfile_name_history):
19025 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19026 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19027 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19028 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19029 * w32proc.c (Qlocal, report_file_error):
19030 * w32term.c (Vwindow_system, updating_frame):
19031 * w32uniscribe.c (initialized, uniscribe_font_driver):
19032 Remove unneeded extern declarations.
19033
19034 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19035
19036 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19037
19038 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19039
19040 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19041 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19042 These macros can no longer be used for assignment.
19043
19044 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19045 Assign struct members directly, instead of using BUF_BEGV etc.
19046 (record_buffer_markers, fetch_buffer_markers): New functions for
19047 recording and fetching special buffer markers.
19048 (set_buffer_internal_1, set_buffer_temp): Use them.
19049
19050 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19051
19052 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19053
19054 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19055 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19056
19057 * xdisp.c (hscroll_window_tree):
19058 (reconsider_clip_changes): Use PT instead of BUF_PT.
19059
19060 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19061
19062 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19063 $(EMACS_ROOT)/lib/intprops.h.
19064
19065 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19066
19067 Fix more problems found by GCC 4.5.2's static checks.
19068
19069 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19070 to unsigned char * to avoid compiler diagnostic.
19071 (xg_free_frame_widgets): Make it clear that a local variable is
19072 needed only if USE_GTK_TOOLTIP.
19073 (gdk_window_get_screen): Make it clear that this macro is needed
19074 only if USE_GTK_TOOLTIP.
19075 (int_gtk_range_get_value): New function, which avoids a diagnostic
19076 from gcc -Wbad-function-cast.
19077 (xg_set_toolkit_scroll_bar_thumb): Use it.
19078 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19079 diagnostic from gcc -Wbad-function-cast.
19080 (get_utf8_string, xg_get_file_with_chooser):
19081 Rename locals to avoid shadowing.
19082 (create_dialog): Move locals to avoid shadowing.
19083
19084 * xgselect.c (xg_select): Remove unused var.
19085
19086 * image.c (four_corners_best): Mark locals as initialized.
19087 (gif_load): Initialize transparent_p to zero (Bug#8238).
19088 Mark another local as initialized.
19089 (my_png_error, my_error_exit): Mark with NO_RETURN.
19090
19091 * image.c (clear_image_cache): Now static.
19092 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19093 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19094 (x_edge_detection): Remove unnecessary cast that
19095 gcc -Wbad-function-cast diagnoses.
19096 (gif_load): Fix pointer signedness.
19097 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19098 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19099
19100 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19101
19102 Improve quality of tests for time stamp overflow.
19103 For example, without this patch (encode-time 0 0 0 1 1
19104 1152921504606846976) returns the obviously-bogus value (-948597
19105 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19106 reports time overflow. See
19107 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19108 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19109 * editfns.c: Include limits.h and intprops.h.
19110 (TIME_T_MIN, TIME_T_MAX): New macros.
19111 (time_overflow): Move earlier, to before first use.
19112 (hi_time, lo_time): New functions, for an accurate test for
19113 out-of-range times.
19114 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19115 (Fget_internal_run_time): Don't assume time_t fits in int.
19116 (make_time): Use list2 instead of Fcons twice.
19117 (Fdecode_time): More accurate test for out-of-range times.
19118 (check_tm_member): New function.
19119 (Fencode_time): Use it, to test for out-of-range times.
19120 (lisp_time_argument): Don't rely on undefined left-shift and
19121 right-shift behavior when checking for time stamp overflow.
19122
19123 * editfns.c (time_overflow): New function, refactoring common code.
19124 (Fformat_time_string, Fdecode_time, Fencode_time):
19125 (Fcurrent_time_string): Use it.
19126
19127 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19128 * dired.c (make_time): Move to ...
19129 * editfns.c (make_time): ... here.
19130 * systime.h: Note the move.
19131
19132 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19133
19134 * fringe.c (update_window_fringes): Remove unused variables.
19135
19136 * unexmacosx.c (copy_data_segment): Also copy __got section.
19137 (Bug#8223)
19138
19139 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19140
19141 * termcap.c [MSDOS]: Include "msdos.h".
19142 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19143 Constify `char *' arguments and their references according to
19144 prototypes in tparam.h.
19145
19146 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19147
19148 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19149 Adapt all references accordingly.
19150
19151 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19152
19153 2011-03-11 Tom Tromey <tromey@redhat.com>
19154
19155 * buffer.c (syms_of_buffer): Remove obsolete comment.
19156
19157 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19158
19159 * termhooks.h (encode_terminal_code): Declare prototype.
19160
19161 * msdos.c (encode_terminal_code): Don't declare prototype.
19162
19163 * term.c (encode_terminal_code): Now external again, used by
19164 w32console.c and msdos.c.
19165
19166 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19167 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19168
19169 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19170
19171 Fix some minor problems found by GCC 4.5.2's static checks.
19172
19173 * fringe.c (update_window_fringes): Mark locals as initialized
19174 (Bug#8227).
19175 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19176
19177 * alloc.c (mark_fringe_data): Move decl from here ...
19178 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19179 to check its interface.
19180 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19181
19182 * fontset.c (free_realized_fontset): Now static.
19183 (Fset_fontset_font): Rename local to avoid shadowing.
19184 (fontset_font): Mark local as initialized.
19185 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19186
19187 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19188
19189 * xselect.c (x_disown_buffer_selections): Remove; not used.
19190 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19191 (x_own_selection, Fx_disown_selection_internal): Rename locals
19192 to avoid shadowing.
19193 (x_handle_dnd_message): Remove local to avoid shadowing.
19194
19195 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19196 so that the caller can use some name other than gcpro1.
19197 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19198 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19199 (Fx_backspace_delete_keys_p):
19200 Use them to avoid shadowing, and rename vars to avoid shadowing.
19201 (x_decode_color, x_set_name, x_window): Now static.
19202 (Fx_create_frame): Add braces to silence GCC warning.
19203 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19204 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19205 Remove unused locals.
19206 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19207 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19208 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19209 macros.
19210
19211 * xterm.h (x_mouse_leave): New decl.
19212
19213 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19214 Remove unused functions.
19215 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19216 (x_calc_absolute_position): Now static.
19217 (XTread_socket): Don't define label "out" unless it's used.
19218 Don't declare local "event" unless it's used.
19219 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19220 unless they are used.
19221 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19222 (x_fatal_error_signal): Remove; not used.
19223 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19224 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19225 (x_error_catcher, x_connection_closed, x_error_handler):
19226 (x_error_quitter, xembed_send_message, x_iconify_frame):
19227 (my_log_handler): Rename locals to avoid shadowing.
19228 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19229 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19230
19231 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19232 Rename or move locals to avoid shadowing.
19233 (tty_defined_color, merge_face_heights): Now static.
19234 (free_realized_faces_for_fontset): Remove; not used.
19235 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19236 does not deduce is never used uninitialized.
19237 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19238 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19239
19240 * terminal.c (store_terminal_param): Now static.
19241
19242 * xmenu.c (menu_highlight_callback): Now static.
19243 (set_frame_menubar): Remove unused local.
19244 (xmenu_show): Rename parameter to avoid shadowing.
19245 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19246 since they might point to immutable storage.
19247 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19248 since it's unused otherwise.
19249
19250 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19251 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19252 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19253 avoids a gcc -Wuninitialized diagnostic.
19254 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19255 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19256 does not deduce are never used uninitialized.
19257
19258 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19259
19260 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19261 * window.c (window_loop, size_window):
19262 (run_window_configuration_change_hook, enlarge_window): Likewise.
19263
19264 * window.c (display_buffer): Now static.
19265 (size_window): Mark variables that gcc -Wuninitialized
19266 does not deduce are never used uninitialized.
19267 * window.h (check_all_windows): New decl, to forestall
19268 gcc -Wmissing-prototypes diagnostic.
19269 * dispextern.h (bidi_dump_cached_states): Likewise.
19270
19271 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19272 shadowing.
19273 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19274 Include <limits.h>.
19275 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19276 and to avoid gcc -Wuninitialized warning.
19277 (load_charset_map): Mark variables that gcc -Wuninitialized
19278 does not deduce are never used uninitialized.
19279 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19280
19281 * coding.c (coding_set_source, coding_set_destination):
19282 Use "else { /* comment */ }" rather than "else /* comment */;"
19283 for clarity, and to avoid gcc -Wempty-body warning.
19284 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19285 a block, when the outer 'i' will do.
19286 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19287 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19288 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19289 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19290 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19291 Rename locals to avoid shadowing.
19292 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19293 * coding.c (emacs_mule_char, encode_invocation_designation):
19294 Now static, since they're not used elsewhere.
19295 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19296 (decode_coding_object, encode_coding_object, detect_coding_system):
19297 (decode_coding_emacs_mule): Mark variables that gcc
19298 -Wuninitialized does not deduce are never used uninitialized.
19299 (detect_coding_iso_2022): Initialize a local variable that might
19300 be used uninitialized. Leave a FIXME because it's not clear that
19301 this initialization is needed. (Bug#8211)
19302 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19303 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19304 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19305 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19306 Remove unused macros.
19307
19308 * category.c (hash_get_category_set): Remove unused local var.
19309 (copy_category_table): Now static, since it's not used elsewhere.
19310 * character.c (string_count_byte8): Likewise.
19311
19312 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19313 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19314
19315 * chartab.c (copy_sub_char_table): Now static, since it's not used
19316 elsewhere.
19317 (sub_char_table_ref_and_range, char_table_ref_and_range):
19318 Rename locals to avoid shadowing.
19319 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19320
19321 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19322 (BIDI_BOB): Remove unused macro.
19323
19324 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19325 deduce are never used uninitialized.
19326 * term.c (encode_terminal_code): Likewise.
19327
19328 * term.c (encode_terminal_code): Now static. Remove unused local.
19329
19330 * tparam.h: New file.
19331 * term.c, tparam.h: Include it.
19332 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19333 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19334 Move these decls to tparam.h, and make them agree with what
19335 is actually in tparam.c. The previous trick of using incompatible
19336 decls in different modules does not conform to the C standard.
19337 All callers of tparam changed to use tparam's actual API.
19338 * tparam.c (tparam1, tparam, tgoto):
19339 Use const pointers where appropriate.
19340
19341 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19342 * cm.h (struct cm): Likewise.
19343 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19344 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19345 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19346 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19347 (turn_on_face, init_tty): Likewise.
19348 * termchar.h (struct tty_display_info): Likewise.
19349
19350 * term.c (term_mouse_position): Rename local to avoid shadowing.
19351
19352 * alloc.c (mark_ttys): Move decl from here ...
19353 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19354
19355 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19356
19357 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19358
19359 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19360
19361 * search.c (compile_pattern_1): Remove argument regp, unused since
19362 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19363 (compile_pattern): Don't pass it.
19364
19365 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19366
19367 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19368 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19369 for ! HAVE_GTK3.
19370 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19371
19372 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19373
19374 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19375 gdk_window_get_screen, gdk_window_get_geometry,
19376 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19377 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19378 (xg_get_pixbuf_from_pixmap): New function.
19379 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19380 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19381 Call xg_get_pixbuf_from_pixmap instead of
19382 gdk_pixbuf_get_from_drawable.
19383 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19384 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19385 (xg_check_special_colors): Use GtkStyleContext and its functions
19386 for HAVE_GTK3.
19387 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19388 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19389 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19390 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19391 Call gtk_widget_get_preferred_size.
19392 (xg_frame_resized): gdk_window_get_geometry only takes 5
19393 parameters.
19394 (xg_win_to_widget, xg_event_is_for_menubar):
19395 Call gdk_x11_window_lookup_for_display.
19396 (xg_set_widget_bg): New function.
19397 (delete_cb): New function.
19398 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19399 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19400 (xg_set_background_color): Call xg_set_widget_bg.
19401 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19402 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19403 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19404 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19405 if ! HAVE_GTK3.
19406 (update_frame_tool_bar): Call gtk_widget_hide.
19407 (xg_initialize): Use GDK_KEY_g.
19408
19409 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19410 if ! HAVE_GTK3
19411 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19412
19413 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19414 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19415 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19416
19417 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19418
19419 * w32xfns.c (select_palette): Check success of RealizePalette against
19420 GDI_ERROR, not zero.
19421
19422 See ChangeLog.11 for earlier changes.
19423
19424 ;; Local Variables:
19425 ;; coding: utf-8
19426 ;; End:
19427
19428 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19429
19430 This file is part of GNU Emacs.
19431
19432 GNU Emacs is free software: you can redistribute it and/or modify
19433 it under the terms of the GNU General Public License as published by
19434 the Free Software Foundation, either version 3 of the License, or
19435 (at your option) any later version.
19436
19437 GNU Emacs is distributed in the hope that it will be useful,
19438 but WITHOUT ANY WARRANTY; without even the implied warranty of
19439 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19440 GNU General Public License for more details.
19441
19442 You should have received a copy of the GNU General Public License
19443 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.