]> code.delx.au - gnu-emacs/blob - src/ChangeLog
* fns.c (Fcompare_strings): Doc fix.
[gnu-emacs] / src / ChangeLog
1 2012-12-15 Chong Yidong <cyd@gnu.org>
2
3 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
4
5 2012-12-14 Eli Zaretskii <eliz@gnu.org>
6
7 * w32.c (get_name_and_id): Always pass NULL as the first argument
8 of lookup_account_sid. Avoids crashes with UNC file names that
9 refer to DFS domains, not to specific machine names. (Bug#12621)
10 Remove now unused argument FNAME; all callers changed.
11 (get_file_owner_and_group): Remove now unused argument FNAME; all
12 callers changed.
13
14 2012-12-11 Eli Zaretskii <eliz@gnu.org>
15
16 * search.c (search_buffer): Check the inverse translations of each
17 character in pattern when the buffer being searched is unibyte.
18 (Bug#13084)
19
20 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
21
22 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
23 files, fixing a regression from 24.2.
24 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
25
26 2012-12-08 Jan Djärv <jan.h.d@swipnet.se>
27
28 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
29
30 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
31
32 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
33 DWORD_PTR, for compatibility with 64-bit builds.
34
35 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
36 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
37 (system_process_attributes): Use SIZE_T rather than DWORD, for
38 compatibility with 64-bit builds.
39
40 2012-12-08 Christopher Schmidt <christopher@ch.ristopher.com>
41
42 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
43
44 2012-12-07 Eli Zaretskii <eliz@gnu.org>
45
46 * indent.c (Fvertical_motion): If a display string will be
47 displayed on the left or the right margin, don't consider it as a
48 factor in cursor positioning. (Bug#13108)
49
50 2012-12-07 Martin Rudalics <rudalics@gmx.at>
51
52 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
53
54 2012-12-05 Eli Zaretskii <eliz@gnu.org>
55
56 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
57 fails, signal an error instead of continuing with an empty
58 string. (Bug#13079)
59 Encode expanded temp file pattern before passing it to mkstemp or
60 mktemp.
61
62 2012-12-04 Eli Zaretskii <eliz@gnu.org>
63
64 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
65 Encode the file name before passing it to dostounix_filename, in
66 case it will downcase it (under w32-downcase-file-names).
67 (Bug#12933)
68
69 2012-12-01 Chong Yidong <cyd@gnu.org>
70
71 * fileio.c (Vauto_save_list_file_name): Doc fix.
72
73 2012-11-30 Fabrice Popineau <fabrice.popineau@gmail.com>
74
75 * w32fns.c: Remove prototype of atof.
76 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
77 builds.
78 (file_dialog_callback): Declared UINT_PTR.
79
80 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
81 with 64-bit builds.
82
83 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
84 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
85 defined.
86
87 2012-11-27 Glenn Morris <rgm@gnu.org>
88
89 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
90
91 2012-11-26 Eli Zaretskii <eliz@gnu.org>
92
93 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
94 (Bug#11964)
95
96 2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
97
98 Revert recent change for Bug#8855.
99 As reported by Harald Hanche-Olsen in
100 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00445.html>
101 the change introduces a further bug, of creating lots of zombie
102 processes in some cases. Further work is needed to come up with a
103 better fix for Bug#8855.
104
105 2012-11-24 Eli Zaretskii <eliz@gnu.org>
106
107 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
108 highlighting on the frame was cleared. Prevents assertion
109 violations when repeatedly clicking on the "Top" link of the
110 "bread-crumbs" in Info buffers.
111
112 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
113 Eli Zaretskii <eliz@gnu.org>
114
115 Fix a race condition with glib (Bug#8855).
116 The symptom is a diagnostic "GLib-WARNING **: In call to
117 g_spawn_sync(), exit status of a child process was requested but
118 SIGCHLD action was set to SIG_IGN and ECHILD was received by
119 waitpid(), so exit status can't be returned." The diagnostic
120 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
121 The real bug is a race condition between Emacs and glib: Emacs
122 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
123 so that glib can't find it. Work around the bug by invoking
124 waitpid only on subprocesses that Emacs itself creates.
125
126 This is a backport from the trunk, consisting of:
127
128 * w32proc.c (create_child): Don't clip the PID of the child
129 process to fit into an Emacs integer, as this is no longer a
130 restriction.
131 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
132 reaping only the process specified by PID argument, if that is
133 positive. Use PID instead of dead_child to know which process to
134 reap. Wait for the child to die only if WNOHANG is not in
135 OPTIONS.
136 (sys_select): Don't set dead_child.
137
138 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
139 as it is no longer needed.
140
141 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
142 no longer needed.
143 (create_process, record_child_status_change): Don't use special
144 value -1 in pid field, as the caller now must know the pid rather
145 than having the callee infer it. The inference was sometimes
146 incorrect anyway, due to another race.
147 (create_process): Set new 'alive' member if child is created.
148 (process_status_retrieved): New function.
149 (record_child_status_change): Use it.
150 Accept negative 1st argument, which means to wait for the
151 processes that Emacs already knows about. Move special-case code
152 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
153 processes that have already been waited for, by testing and
154 clearing new 'alive' member. Remove the setting of
155 record_at_most_one_child for the !WNOHANG case.
156 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
157 now does this internally.
158 (handle_child_signal): Let record_child_status_change do all
159 the work, since we do not want to reap all exited child processes,
160 only the child processes that Emacs itself created.
161 * process.h (Lisp_Process): New boolean member 'alive'.
162
163 2012-11-23 Eli Zaretskii <eliz@gnu.org>
164
165 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
166 between bpos_covered and bpos_max. This fixes cursor display when
167 several display strings follow each other.
168
169 * .gdbinit (pgx): If the glyph's object is a string, display the
170 pointer to string data, rather than the value of the string object
171 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
172
173 2012-11-21 Eli Zaretskii <eliz@gnu.org>
174
175 * indent.c (Fvertical_motion): If the starting position is covered
176 by a display string, return to one position before that, to avoid
177 overshooting it inside move_it_to. (Bug#12930)
178
179 2012-11-20 Daniel Colascione <dancol@dancol.org>
180
181 * w32fns.c (Fx_file_dialog):
182 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
183 cygwin_convert_file_name*.
184
185 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
186 Rename cygwin_convert_path* to cygwin_convert_file_name*.
187
188 2012-11-20 Ken Brown <kbrown@cornell.edu>
189
190 * emacs.c (main): Set the G_SLICE environment variable for all
191 Cygwin builds, not just GTK builds. See
192 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
193
194 2012-11-19 Eli Zaretskii <eliz@gnu.org>
195
196 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
197 w32_note_current_window with code. (Backport from trunk.)
198
199 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
200 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
201 Define for the MSVC compiler.
202
203 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
204 semi-colon.
205
206 2012-11-18 Eli Zaretskii <eliz@gnu.org>
207
208 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
209 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
210 dostounix_filename. Prevents crashes down the road, because
211 dostounix_filename assumes it gets a unibyte string. Reported by
212 Michel de Ruiter <michel@sentient.nl>, see
213 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
214
215 2012-11-17 Eli Zaretskii <eliz@gnu.org>
216
217 * w32select.c: Include w32common.h before w32term.h, so that
218 windows.h gets included before w32term.h uses some of its
219 features, see below.
220
221 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
222 typedefs.
223 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
224 prototypes.
225 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
226
227 2012-11-17 Jan Djärv <jan.h.d@swipnet.se>
228
229 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
230 (ns_select): Return at once if events are held (Bug#12834).
231
232 2012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
233
234 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
235 Needed following 2012-10-20 change. (Bug#12902)
236
237 2012-11-16 Glenn Morris <rgm@gnu.org>
238
239 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
240
241 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
242
243 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
244
245 2012-11-14 Eli Zaretskii <eliz@gnu.org>
246
247 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
248 use the same value of thread handle.
249 (start_timer_thread): If the timer thread exited (due to error),
250 clean up by closing the two handles it used. Duplicate the caller
251 thread's handle here, so it gets duplicated only once, when
252 launching the timer thread. Set priority of the timer thread, not
253 the caller thread.
254 (getitimer): Don't duplicate the caller thread's handle here.
255 (Bug#12832)
256
257 2012-11-13 Jan Djärv <jan.h.d@swipnet.se>
258
259 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
260 called (Bug#12834).
261
262 2012-11-12 Eli Zaretskii <eliz@gnu.org>
263
264 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
265 passed to pint2str and pint2hrstr to be at most the size of the
266 frame's decode_mode_spec_buffer. This avoids crashes with very
267 large values of FIELD_WIDTH argument to decode_mode_spec.
268 (Bug#12867)
269
270 2012-11-07 Martin Rudalics <rudalics@gmx.at>
271
272 * window.c (Fsplit_window_internal): Set combination limit of
273 new parent window to t iff Vwindow_combination_limit is t;
274 fixing a regression introduced with the change from 2012-09-22.
275 (Fwindow_combination_limit, Fset_window_combination_limit):
276 Fix doc-strings.
277
278 2012-11-06 Eli Zaretskii <eliz@gnu.org>
279
280 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
281 amount when the scroll margins are too large. When scrolling
282 backwards in the buffer, give up if cannot reach point or the
283 scroll margin within a reasonable number of screen lines.
284 Fixes point position in window under scroll-up/down-aggressively when
285 point is positioned many lines beyond the window top/bottom.
286 (Bug#12811)
287
288 2012-11-05 Eli Zaretskii <eliz@gnu.org>
289
290 * ralloc.c (relinquish): If real_morecore fails to return memory
291 to the system, don't crash; instead, leave the last heap
292 unchanged and return. (Bug#12774)
293
294 2012-11-03 Eli Zaretskii <eliz@gnu.org>
295
296 * lisp.mk: Adjust comments to the fact that term/internal is now
297 loaded from loadup.el.
298
299 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
300 (msdos_fatal_signal): New function.
301 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
302 its argument list.
303
304 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
305 for GCC versions before 4.
306 (emacs_raise): Define to call msdos_fatal_signal.
307
308 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
309 iterator when starting in the middle of a display or overlay
310 string. (Bug#12745)
311
312 2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
313
314 * widget.c (resize_cb): New function.
315 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
316 (EmacsFrameResize): Check if all is up to date before changing frame
317 size.
318
319 2012-11-01 Eli Zaretskii <eliz@gnu.org>
320
321 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
322
323 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
324
325 Fix crash when using Emacs as commit editor for git (Bug#12697).
326 * callproc.c (setpgrp): Remove macro, as we now use setpgid
327 and it is configured in conf_post.h.
328 (Fcall_process): Don't invoke both setsid and setpgid; the former
329 is enough, if it exists.
330 * callproc.c (Fcall_process, child_setup):
331 * process.c (create_process): Use setpgid.
332 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
333 for the real thing.
334 * dispnew.c (init_display): Initialize the foreground group
335 if we are running a tty display.
336 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
337 * lisp.h (init_foreground_group): New decl.
338 * sysdep.c (inherited_pgroup): New static var.
339 (init_foreground_group, tcsetpgrp_without_stopping)
340 (narrow_foreground_group, widen_foreground_group): New functions.
341 (init_sys_modes): Narrow foreground group.
342 (reset_sys_modes): Widen foreground group.
343
344 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
345
346 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
347
348 2012-10-31 Martin Rudalics <rudalics@gmx.at>
349
350 * minibuf.c (read_minibuf): Restore current buffer since
351 choose_minibuf_frame calling Fset_frame_selected_window may
352 change it (Bug#12766).
353
354 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
355
356 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
357
358 2012-10-30 Kenichi Handa <handa@gnu.org>
359
360 * font.c (Ffont_at): If WINDOW is specified and it is not
361 displaying the current buffer, signal an error.
362
363 2012-10-29 Daniel Colascione <dancol@dancol.org>
364
365 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
366 In preparation for fixing bug#12739, move these functions from
367 here...
368
369 * coding.h, coding.c: ... to here, and compile them only when
370 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
371 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
372
373 2012-10-28 Eli Zaretskii <eliz@gnu.org>
374
375 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
376 (timer_loop, getitimer, setitimer): Use it instead of
377 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
378 'clock'.
379 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
380 literal 10000.
381
382 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
383
384 * nsterm.m (NO_APPDEFINED_DATA): New define.
385 (last_appdefined_event_data): New variable
386 (last_appdefined_event): Remove.
387 (ns_select): Initialize t from last_appdefined_event_data instead
388 of [last_appdefined_event data1].
389 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
390 remove last_appdefined_event (Bug#12698).
391
392 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
393
394 * frame.c (x_set_font): Catch internal error.
395
396 2012-10-27 Eli Zaretskii <eliz@gnu.org>
397
398 Avoid overflow in w32 implementation of interval timers.
399 When possible, for ITIMER_PROF count only times the main thread
400 actually executes.
401 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
402 'volatile ULONGLONG' types. All the other data which was
403 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
404 (GetThreadTimes_Proc): New typedef.
405 (w32_get_timer_time): New function, returns a suitable time value
406 for the timer.
407 (timer_loop): Enter critical section when accessing ULONGLONG
408 values of the itimer_data struct, as these accesses are no longer
409 atomic. Call 'w32_get_timer_time' instead of 'clock'.
410 Remove unused variable.
411 (init_timers): Initialize s_pfn_Get_Thread_Times.
412 (start_timer_thread): Don't assign itimer->caller_thread here.
413 (getitimer): Assign itimer->caller_thread here.
414 (setitimer): Always call getitimer to get the value of ticks_now.
415 (sys_spawnve): Avoid compiler warning about format mismatch.
416
417 2012-10-26 Eli Zaretskii <eliz@gnu.org>
418
419 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
420 mouse movement events if the menu bar is active. This avoids
421 producing a busy "hour-glass" cursor by Windows if the mouse
422 pointer is positioned over a tooltip shown for some menu item.
423
424 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
425
426 Don't assume process IDs fit in int.
427 * emacs.c (shut_down_emacs) [!DOS_NT]:
428 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
429 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
430 Use pid_t, not int, to store process IDs, as 'int'
431 is not wide enough on a few platforms (e.g., AIX and IRIX).
432
433 2012-10-23 Kenichi Handa <handa@gnu.org>
434
435 The following change is to make face-font-rescale-alist work
436 correctly for non-ASCII fonts.
437
438 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
439 (font_open_for_lface): Handle Vface_font_rescale_alist.
440
441 2012-10-23 Chong Yidong <cyd@gnu.org>
442
443 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
444
445 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
446
447 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
448 for screen font.
449 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
450
451 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
452 event (Bug#12681).
453
454 2012-10-21 Glenn Morris <rgm@gnu.org>
455
456 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
457
458 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
459
460 Port to OpenBSD 5.1.
461 * frame.c (Fmouse_position, Fmouse_pixel_position):
462 * xdisp.c (produce_stretch_glyph):
463 Declare local vars only when they're needed.
464 This is clearer and avoids a warning on OpenBSD about unused vars.
465 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
466 This is safer, and avoids OpenBSD warnings about unused vars.
467 * keyboard.c (record_menu_key): Remove unnecessary decl.
468 (poll_timer): Define only if POLL_FOR_INPUT is defined.
469 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
470 as our definition clashes with OpenBSD's.
471 * xfaces.c (load_face_colors, check_lface_attrs)
472 (get_lface_attributes_no_remap, get_lface_attributes)
473 (lface_fully_specified_p, x_supports_face_attributes_p)
474 (tty_supports_face_attributes_p, face_fontset, realize_face)
475 (realize_x_face, realize_tty_face):
476 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
477 merely Lisp_Object *. This is more informative and avoids
478 a warning on OpenBSD about accessing beyond an object's size.
479
480 2012-10-20 Chong Yidong <cyd@gnu.org>
481
482 * lread.c (Fload): Doc fix (Bug#12592).
483
484 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
485
486 * font.c (Ffont_at): Fix previous change.
487
488 2012-10-19 Eli Zaretskii <eliz@gnu.org>
489
490 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
491 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
492 for the reasons.
493
494 * alloc.c (NSTATICS): Decrease to 0x800.
495
496 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
497
498 * fns.c (Fnreverse): Include the problem element when signalling an
499 error (bug#12677).
500
501 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
502
503 * nsterm.m (ns_select): Check writefds before call to
504 FD_ISSET (Bug#12668).
505
506 2012-10-18 Daniel Colascione <dancol@dancol.org>
507
508 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
509 (staticpro): If we run out of staticpro slots, die with an
510 informative error instead of just calling emacs_abort.
511
512 2012-10-18 Martin Rudalics <rudalics@gmx.at>
513
514 Fix two flaws reported by Dmitry Antipov.
515 * window.c (Ftemp_output_buffer_show): Remove.
516 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
517 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
518
519 2012-10-17 Eli Zaretskii <eliz@gnu.org>
520
521 * makefile.w32-in ($(BLD)/w32.$(O)):
522 ($(BLD)/vm-limit.$(O)):
523 ($(BLD)/term.$(O)):
524 ($(BLD)/unexw32.$(O)):
525 ($(BLD)/fileio.$(O)):
526 ($(BLD)/dispnew.$(O)): Update dependencies.
527
528 * w32term.h (w32_initialize_display_info, initialize_w32_display):
529 Add prototypes.
530
531 * w32proc.c: Include ctype.h.
532
533 * w32.h (init_environment, check_windows_init_file)
534 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
535 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
536 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
537 (sys_link): Add prototypes.
538
539 * w32.c: Include w32select.h.
540 (sys_access, e_malloc, sys_select): Add prototypes.
541 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
542
543 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
544
545 * unexw32.c: Include lisp.h and w32.h.
546
547 * term.c [WINDOWSNT]: Include w32term.h.
548
549 * process.c [WINDOWSNT]: Add prototype of sys_select.
550
551 * fileio.c [WINDOWSNT]: Include w32.h.
552
553 * dispnew.c [WINDOWSNT]: Include w32.h.
554
555 * cygw32.c (Fcygwin_convert_path_to_windows)
556 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
557 Lisp_Object values. (Bug#12661)
558
559 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
560 to Lisp_Object. (Bug#12661)
561
562 2012-10-17 Kenichi Handa <handa@gnu.org>
563
564 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
565 invalidate.
566
567 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
568
569 * buffer.c (Fkill_buffer): When unchaining the marker,
570 reset its buffer pointer to NULL (Bug#12652).
571
572 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
573
574 Do not verify indirection counters of killed buffers (Bug#12579).
575 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
576 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
577
578 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
579
580 * alloc.c (Fmake_byte_code): Fix typo in comment.
581 * print.c (print_interval): Define as static to match prototype.
582 * indent.c (disptab_matches_widthtab, recompute_width_table):
583 Convert to eassert.
584
585 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
586
587 * editfns.c (get_system_name): Remove.
588 * lisp.h (get_system_name): Remove prototype.
589 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
590 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
591
592 2012-10-15 Daniel Colascione <dancol@dancol.org>
593
594 * dbusbind.c: Add comment explaining reason for previous change.
595
596 2012-10-15 Martin Rudalics <rudalics@gmx.at>
597
598 * window.c (Fwindow_end): Rewrite check whether cached position
599 can be used (Bug#12600).
600 (resize_frame_windows, grow_mini_window, shrink_mini_window):
601 Set windows_or_buffers_changed.
602
603 2012-10-15 Daniel Colascione <dancol@dancol.org>
604
605 * dbusbind.c: Fix cygw32 build break when compiling with dbus
606 enabled by undefining the symbol "interface", which the platform
607 headers define to something incompatible.
608
609 2012-10-14 Daniel Colascione <dancol@dancol.org>
610
611 * image.c (init_tiff_functions, init_imagemagick_functions)
612 (init_svg_functions): Fix cygw32 build break by using these
613 functions only when WINDOWSNT _and_ HAVE_NTGUI.
614
615 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
616
617 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
618
619 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
620
621 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
622
623 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
624
625 * coding.c (detect_coding): Set coding->id before calling
626 this->detector.
627
628 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
629
630 * fileio.c: Formatting fixes.
631
632 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
633
634 Fix some stat-related races.
635 * fileio.c (Fwrite_region): Avoid race condition if a file is
636 removed or renamed by some other process immediately after Emacs
637 writes it but before Emacs stats it. Do not assume that stat (or
638 fstat) succeeds.
639 * image.c (slurp_file): Resolve the file name with fopen + fstat
640 rather than stat + fopen.
641 (pbm_read_file) [0]: Remove unused code with stat race.
642 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
643 Remove ineffective code with stat race.
644
645 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
646
647 * doc.c (get_doc_string): Don't signal an error if the file is missing.
648
649 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
650
651 * nsterm.m (hold_event_q): New static variable.
652 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
653 ! q_event_ptr.
654 (hold_event): New function.
655 (ns_read_socket): If hold_event_q have events, store them and
656 return (Bug#12384).
657 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
658 is zero (Bug#12384).
659
660 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
661
662 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
663
664 2012-10-12 Eli Zaretskii <eliz@gnu.org>
665
666 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
667
668 * fileio.c (check_existing): New function.
669 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
670 instead of calling 'stat', when what's needed is to check whether
671 a file exists. This avoids expensive system calls on MS-Windows.
672 (Bug#12587)
673
674 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
675
676 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
677 determine whether a file exists and is not a directory.
678
679 * lisp.h (check_existing): Add prototype.
680
681 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
682
683 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
684
685 2012-10-12 Glenn Morris <rgm@gnu.org>
686
687 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
688
689 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
690
691 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
692
693 * eval.c (Fautoload): Remember previous autoload status in load-history.
694
695 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
696
697 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
698 * lread.c (load_each_byte, new_backquote_flag, readchar)
699 (read_filtered_event, lisp_file_lexically_bound_p)
700 (safe_to_load_version, Fload, complete_filename_p, openp)
701 (build_load_history, readevalloop, read_escape, read1)
702 (string_to_number, read_vector, read_list):
703 * macros.c (Fstart_kbd_macro):
704 * marker.c (CONSIDER):
705 * menu.c (parse_single_submenu, digest_single_submenu)
706 (find_and_return_menu_selection, Fx_popup_menu):
707 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
708 (Ftry_completion):
709 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
710 (ns_menu_show):
711 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
712 (xmenu_show, xdialog_show):
713 Use bool for booleans.
714 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
715 as it's not a predicate. All uses changed. Omit unnecessary
716 buffer termination.
717
718 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
719
720 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
721 (save_excursion_restore): Do not restore mark if it was not saved.
722
723 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
724
725 * marker.c (cached_modiff): EMACS_INT, not int.
726
727 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
728 instead of having a wrong decl.
729 * nsmenu.m (waiting_for_input): Remove wrong decl.
730
731 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
732
733 keyboard.c, keymap.c: Use bool for booleans.
734 * dispnew.c (sit_for): Distinguish between 3-way display_option
735 and boolean do_display.
736 * keyboard.c (single_kboard, this_command_key_count_reset)
737 (waiting_for_input, echoing, immediate_quit, input_pending)
738 (interrupt_input, interrupts_deferred, pop_kboard)
739 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
740 (command_loop_1, adjust_point_for_property)
741 (safe_run_hooks_error, input_polling_used, read_char):
742 (help_char_p, readable_events, kbd_buffer_events_waiting)
743 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
744 (lucid_event_type_list_p, get_input_pending):
745 (gobble_input, menu_separator_name_p, menu_bar_item)
746 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
747 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
748 (keyremap_step, test_undefined, read_key_sequence)
749 (detect_input_pending, detect_input_pending_ignore_squeezables)
750 (detect_input_pending_run_timers, requeued_events_pending_p)
751 (quit_throw_to_read_char, Fset_input_interrupt_mode):
752 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
753 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
754 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
755 (accessible_keymaps_1, Fkey_description, push_key_description):
756 (shadow_lookup, struct where_is_internal_data)
757 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
758 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
759 (describe_map, describe_vector):
760 * menu.c (single_menu_item):
761 * nsmenu.m (ns_update_menubar):
762 * process.c (wait_reading_process_output):
763 * search.c (scan_buffer, scan_newline):
764 Use bool for boolean.
765 * keyboard.c (timers_run, swallow_events)
766 (detect_input_pending_run_timers):
767 * process.c (wait_reading_process_output):
768 Use unsigned for counter where wraparound-on-overflow is desired,
769 since unsigned is guaranteed to have that behavior and signed is not.
770 (read_char): Use ptrdiff_t for string length.
771 (get_input_pending): Remove first argument, since it was always
772 the same pointer-to-int (now pointer-to-boolean) &input_pending,
773 and behave as if it had that value. Return new value of
774 input_pending. All callers changed.
775 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
776 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
777 a string length.
778 * keymap.c (push_key_description): Omit last arg, which was always 1.
779 All callers changed.
780
781 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
782
783 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
784
785 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
786 ($(BLD)/term.$(O)): Update dependencies.
787
788 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
789
790 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
791 * lisp.h (enum pvec_type): Adjust comments and omit explicit
792 initializer for PVEC_NORMAL_VECTOR.
793
794 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
795
796 Clean out old termopts cruft.
797 * termopts.h (flow_control, meta_key): Remove unused decls.
798 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
799 Don't include termopts.h.
800
801 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
802
803 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
804
805 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
806
807 * commands.h (immediate_quit): Remove duplicate decl.
808
809 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
810
811 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
812 caching.
813 (nsfont_open): Remove setting of Vfonts_in_cache.
814 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
815
816 2012-10-09 Eli Zaretskii <eliz@gnu.org>
817
818 * w32fns.c (w32_last_error): Change the return value to DWORD, to
819 match what GetLastError returns. Explain why the function is
820 needed.
821
822 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
823 'is_tooltip_frame', to avoid confusion with its global namesake.
824
825 2012-10-08 Daniel Colascione <dancol@dancol.org>
826
827 * xdisp.c (start_hourglass): Call w32_note_current_window when
828 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
829 build that caused Emacs to display the hourglass cursor forever.
830
831 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
832 which is broken under remote desktop, calculate the number of
833 colors available for a display based on the display's number of
834 planes and number of bits per pixel per plane. (bug#10397).
835
836 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
837
838 * nsfont.m (Vfonts_in_cache): New variable.
839 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
840 are used. Add cached fonts to Vfonts_in_cache.
841 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
842
843 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
844
845 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
846 in nt/config.nt.
847 (FONT_H): Define after FRAME_H.
848 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
849 Update dependencies.
850
851 * w32term.c: Remove leftover declaration of keyboard_codepage.
852
853 2012-10-08 Eli Zaretskii <eliz@gnu.org>
854
855 * makefile.w32-in (FONT_H): Add $(FRAME_H).
856 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
857 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
858 (GLOBAL_SOURCES): Add cygw32.c.
859 ($(BLD)/unexw32.$(O)):
860 ($(BLD)/w32.$(O)):
861 ($(BLD)/w32console.$(O)):
862 ($(BLD)/w32fns.$(O)):
863 ($(BLD)/w32heap.$(O)):
864 ($(BLD)/w32menu.$(O)):
865 ($(BLD)/w32proc.$(O)): Add w32common.h.
866
867 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
868 'const char *'.
869 (x_to_w32_color): Don't modify the argument, modify a copy instead.
870
871 2012-10-08 Daniel Colascione <dancol@dancol.org>
872
873 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
874 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
875 accidental message numbering hole. Change other messages to
876 match.
877
878 * w32select.h (HAVE_W32SELECT): Remove.
879
880 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
881 w32common.h instead of w32heap.h.
882
883 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
884 (get_allocation_unit, get_processor_type, get_w32_major_version)
885 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
886 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
887 (OS_NT, os_subtype, cache_system_info): Move declarations to
888 w32common.
889
890 * w32heap.c: Include w32common.h.
891 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
892 (w32_minor_version, w32_build_number, w32_subtype):
893 Remove duplicate definitions.
894
895 * w32fns.c: Include w32common.h; include w32heap.h only in
896 WINDOWSNT.
897
898 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
899 Use `report_file_error' instead of `error' in order to better
900 inform users of what went wrong. Increase NTGUI_UNICODE file
901 dialog box file name length to 32k, the maximum allowed by the NT
902 kernel.
903
904 * w32common.h: New file.
905 (ROUND_UP, ROUND_DOWN, get_page_size)
906 (get_allocation_unit, get_processor_type, get_w32_major_version)
907 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
908 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
909 (OS_NT, os_subtype, cache_system_info): Move here.
910
911 * unexw32.c, unexcw.c: Include w32common.h.
912
913 * emacs.c (main): Use (defined (WINDOWSNT) || defined
914 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
915 to call syms_of_w32select.
916
917 * cygw32.h: Remove obsolete EXFUN declarations.
918
919 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
920
921 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
922 of w32inevt.o from SOME_MACHINE_OBJECTS.
923
924 2012-10-08 Daniel Colascione <dancol@dancol.org>
925
926 * image.c: Permanent fix for JPEG compilation issue --- limit
927 jpeglib `boolean' redefinition to Cygwin builds.
928
929 2012-10-08 Eli Zaretskii <eliz@gnu.org>
930
931 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
932
933 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
934 Cygwin.
935
936 2012-10-08 Daniel Colascione <dancol@dancol.org>
937
938 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
939 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
940 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
941 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
942 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
943 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
944 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
945 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
946 now a supported configuration.
947
948 * Makefile.in: consolidate image variables into LIBIMAGE; add
949 W32_OBJ and W32_LIBS. Compile new files.
950
951 * conf_post.h:
952 (_DebPrint) declare tracing facility for W32 debugging. We need
953 to unify tracing later.
954
955 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
956 unconditional use of W32 Unicode functions. Cygwin runs only on
957 100% Unicode operating systems.
958
959 * cygw32.c: New file. Define Cygwin-specific facilities.
960 (Fcygwin_convert_path_to_windows)
961 (Fcygwin_convert_path_from_windows): New user functions for
962 accessing Cygwin path-munging routines.
963
964 * cygw32.h: New file.
965 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
966 UTF-16LE strings temporarily inside non-Lisp-visible string
967 objects.
968
969 (w32_strerror): Just what it says on the tin.
970
971 * emacs.c: Make the NS fork-then-exec code for daemon-launching
972 also run for Cygwin; both systems have the same problem with using
973 GUI facilities in a forked child. Also call syms_of_cygw32,
974 syms_of_w32select in correct places.
975
976 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
977 needs fork-then-exec for daemon launching.
978
979 * font.h: Include frame.h.
980
981 * image.c: Use the image library cache machinery only when we're
982 compiling for native WINDOWSNT; Cygwin can use shared libraries
983 like any other Unixlike system.
984
985 * keyboard.c: Clarify a comment regarding the input loop.
986
987 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
988 functions directly instead of trying to detect at runtime that our
989 host operating system supports them. We make this change for two
990 reasons: Cygwin lacks support for the multibyte character
991 conversion functions used by the legacy menu code, and Cygwin
992 never needs to rely on non-Unicode APIs.
993
994 * unexw32.c (hinst): Declare extern.
995
996 * w32.c: Change header order;
997 (w32_strerror): Move to w32fns.c because we need it for
998 non-WINDOWSNT builds.
999
1000 * w32.h: Add #error macro to make sure we don't include w32.h for
1001 Cygwin builds. Remove w32select declarations.
1002
1003 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1004 w32fns.c. w32console.c is WINDOWSNT-only.
1005
1006 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1007 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1008 POSIXy alternative.
1009 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1010 (w32_major_version, w32_minor_version, w32_build_number)
1011 (os_subtype, sound_type): Define here
1012 (w32_defined_color): Make color parameter const for consistency
1013 with other _defined_color functions.
1014 (w32_createwindow): Unconditionally call w32_init_class instead of
1015 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1016 through the code is complex and unnecessary because class
1017 registration is practically free.
1018 (w32_name_of_message): New EMACSDEBUG-only function.
1019 (Fset_message_beep): Move here
1020 (Fx_open_connection): Require that the display name for Windows be
1021 "w32" for consistency, emacsclient disambiguation, and maybe, one
1022 day, multi-window-system support.
1023 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1024 Cygwin files for W32 GUI facilities, since these clearly don't
1025 expect Cygwin names.
1026 (_DebPrint): Define.
1027 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1028 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1029 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1030 (w32_last_error): Remove.
1031
1032 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1033
1034 * w32heap.c (syspage_mask): Declare here.
1035 (cache_system_info): Remove.
1036
1037 * w32inevt.c (faked_key): Define globally, not statically.
1038 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1039 (w32_console_toggle_lock_key): Move to w32fns.c.
1040
1041 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1042
1043 * w32proc.c (_DebPrint): Move to w32fns.c.
1044 * w32select.c: Include string.h, stdio.h for Cygwin.
1045 * w32select.h: New File.
1046
1047 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1048 get_osfhandle.
1049 (w32_message_fd): New variable. Under Cygwin, holds the file
1050 descriptor the system used to tell us about pending thread
1051 messages.
1052
1053 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1054 that prevented compilation under non-WINDOWSNT systems.
1055
1056 (w32_initialize): Open /dev/windows and assign it to
1057 w32_message_fd. Provide w32 feature.
1058
1059 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1060 (WM_EMACS_INPUT_READY): add.
1061 (prepend_msg, w32_message_fd): Declare globally.
1062
1063 * w32xfns.c:
1064 (keyboard_handle): Use only when WINDOWSNT.
1065 (notify_msg_ready): New function. Posts a message to the main
1066 thread's message queue under CYGWIN, which wakes up the main
1067 thread from select(2) by making the /dev/windows file descriptor
1068 ready. Under WINDOWSNT, it sets an event the same way the old
1069 code did.
1070
1071 (post, prepend_msg): Actually call notify_msg_ready instead of
1072 setting the input event directly.
1073
1074 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1075
1076 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1077 but it still has blocs in it, don't return it to the system,
1078 instead of aborting. (Bug#12402)
1079
1080 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1081
1082 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1083
1084 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1085 MAC_OS_X_VERSION_10_6.
1086 (syms_of_nsterm): Remove comment about Panther and above for
1087 ns-antialias-text.
1088 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1089 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1090 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1091
1092 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1093 MAC_OS_X_VERSION_10_4.
1094
1095 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1096 MAC_OS_X_VERSION_10_2.
1097
1098 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1099
1100 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1101 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1102
1103 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1104 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1105 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1106 Remove ns_in_resize check.
1107 (ns_clear_frame_area): Remove resize handle code.
1108
1109 * nsfns.m (ns_in_resize): Remove.
1110 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1111 Remove ns_in_resize check.
1112
1113 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1114
1115 Improve sys_siglist detection.
1116 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1117 defined as a macro, as is done in Solaris.
1118 (sys_siglist_entries): New macro.
1119 (save_strsignal): Use it.
1120 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1121 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1122
1123 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1124
1125 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1126 fullscreen/Fullscreen.
1127
1128 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1129 tobar_height is new.
1130
1131 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1132 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1133 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1134 (windowDidResize:): Check for correct window if old style fullscreen.
1135 Capitalize word in comment. Remove incorrect comment.
1136 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1137 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1138 error in drawing background.
1139 (toggleFullScreen:): Remove comment. Rearrange calls.
1140 Set toolbar values to zero, save old height in tobar_height.
1141 Restore tool bar height when leaving fullscreen.
1142 (canBecomeMainWindow): New function.
1143
1144 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1145
1146 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1147
1148 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1149
1150 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1151
1152 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1153 that time stamps of directories could also be changed.
1154 Don't request the too broad GENERIC_WRITE, only the more restrictive
1155 FILE_WRITE_ATTRIBUTES access rights.
1156
1157 * fileio.c (Fset_file_times): Special-case ignoring errors for
1158 directories only on MSDOS, not on MS-Windows.
1159
1160 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1161
1162 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1163
1164 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1165
1166 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1167 see whether CreateFile failed.
1168
1169 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1170
1171 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1172 to avoid similar races.
1173 * keyboard.c (pending_signals): Now bool, not int.
1174
1175 Port timers to OpenBSD, plus check for timer failures.
1176 OpenBSD problem reported by Han Boetes.
1177 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1178 and/or setitimer.
1179 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1180 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1181 like OpenBSD, which has timer_settime but does not declare it.
1182 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1183 whether to use itimerspec-related primitives. All uses of
1184 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1185
1186 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1187
1188 * profiler.c (handle_profiler_signal): Fix a malloc race
1189 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1190
1191 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1192
1193 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1194
1195 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1196
1197 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1198 consistent with the change in return value of 'safe_strsignal'.
1199
1200 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1201
1202 Prefer plain 'static' to 'static inline' (Bug#12541).
1203 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1204 (bidi_set_sor_type, bidi_push_embedding_level)
1205 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1206 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1207 (bidi_cache_search, bidi_cache_ensure_space)
1208 (bidi_cache_iterator_state, bidi_cache_find)
1209 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1210 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1211 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1212 Now 'static', not 'static inline'.
1213
1214 Count overruns when profiling; change units to ns.
1215 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1216 Give extra weight to samples after overruns, to attempt to count
1217 the time more accurately.
1218 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1219 the underlying primitives nominally do ns.
1220 (Fprofiler_cpu_start): Document the change. Mention that
1221 the sampling intervals are only approximate.
1222
1223 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1224
1225 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1226
1227 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1228 case for the special 0 coding-system.
1229
1230 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1231 (Fmake_overlay): Remove redundant tests.
1232 (fix_start_end_in_overlays): Remove redundant recentering.
1233
1234 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1235
1236 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1237 Update dependencies.
1238
1239 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1240
1241 Fix a malloc race condition involving strsignal.
1242 A signal can arrive in the middle of a malloc, and Emacs's signal
1243 handler can invoke strsignal, which can invoke malloc, which is
1244 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1245 Fix it by altering the signal handler so that it does not invoke
1246 strsignal.
1247 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1248 * process.c (status_message): Use const pointer, in case strsignal
1249 is #defined to safe_strsignal.
1250 * sysdep.c (sys_siglist, init_signals): Always define and
1251 initialize a substitute sys_siglist if the system does not define
1252 one, even if HAVE_STRSIGNAL.
1253 (safe_strsignal): Rename from strsignal. Always define,
1254 using sys_siglist. Return a const pointer.
1255 * syssignal.h (safe_strsignal): New decl.
1256 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1257
1258 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1259
1260 * w32proc.c (timer_loop): Fix code that waits for timer
1261 expiration, to avoid high CPU usage.
1262
1263 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1264
1265 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1266 (sweep_weak_table): Remove redundant prototypes.
1267
1268 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1269
1270 * emacs.c: Move the inclusion of TERM_HEADER after including
1271 windows.h on WINDOWSNT. This avoids compilation problems with
1272 MSVC.
1273
1274 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1275
1276 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1277 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1278 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1279 as the previous version used 'void *'.
1280
1281 * ralloc.c (ROUNDUP): Fix last change.
1282 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1283 'size_t'.
1284
1285 * w32proc.c <disable_itimers>: New static flag.
1286 (init_timers): Initialize it to zero, after creating the critical
1287 sections used by the timer threads.
1288 (term_timers): Set to 1 before deleting the critical sections.
1289 (getitimer, setitimer): If disable_itimers is non-zero, return an
1290 error indication without doing anything. Reported by Fabrice
1291 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1292 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1293 return results.
1294 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1295 support timers.
1296
1297 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1298 term_ntproc after all the other bookkeeping, to get timers working
1299 as long as possible.
1300
1301 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1302
1303 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1304 Suggested by Juri Linkov in
1305 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1306
1307 Prefer plain 'static' to 'static inline' (Bug#12541).
1308 With static functions, modern compilers inline pretty well by
1309 themselves; advice from programmers often hurts as much as it helps.
1310 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1311 this change shrinks the text size of the Emacs executable by 1.1%
1312 without affecting CPU significantly in my benchmark.
1313 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1314 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1315 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1316 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1317 (bset_auto_fill_function, bset_auto_save_file_format)
1318 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1319 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1320 (bset_cache_long_line_scans, bset_case_fold_search)
1321 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1322 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1323 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1324 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1325 (bset_header_line_format, bset_indicate_buffer_boundaries)
1326 (bset_indicate_empty_lines, bset_invisibility_spec)
1327 (bset_left_fringe_width, bset_major_mode, bset_mark)
1328 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1329 (bset_name, bset_overwrite_mode, bset_pt_marker)
1330 (bset_right_fringe_width, bset_save_length)
1331 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1332 (bset_scroll_up_aggressively, bset_selective_display)
1333 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1334 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1335 (set_buffer_overlays_after):
1336 * category.c (bset_category_table):
1337 * charset.c (read_hex):
1338 * coding.c (produce_composition, produce_charset)
1339 (handle_composition_annotation, handle_charset_annotation)
1340 (char_encodable_p):
1341 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1342 (assign_row, set_frame_matrix_frame, make_current)
1343 (add_row_entry):
1344 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1345 * fns.c (maybe_resize_hash_table):
1346 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1347 * gmalloc.c (register_heapinfo):
1348 * image.c (lookup_image_type):
1349 * intervals.c (set_interval_object, set_interval_left)
1350 (set_interval_right, copy_interval_parent, rotate_right)
1351 (rotate_left, balance_possible_root_interval):
1352 * keyboard.c (kset_echo_string, kset_kbd_queue)
1353 (kset_keyboard_translate_table, kset_last_prefix_arg)
1354 (kset_last_repeatable_command, kset_local_function_key_map)
1355 (kset_overriding_terminal_local_map, kset_real_last_command)
1356 (kset_system_key_syms, clear_event, set_prop):
1357 * lread.c (digit_to_number):
1358 * marker.c (attach_marker, live_buffer, set_marker_internal):
1359 * nsterm.m (ns_compute_glyph_string_overhangs):
1360 * process.c (pset_buffer, pset_command)
1361 (pset_decode_coding_system, pset_decoding_buf)
1362 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1363 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1364 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1365 * syntax.c (bset_syntax_table, dec_bytepos):
1366 * terminal.c (tset_param_alist):
1367 * textprop.c (interval_has_some_properties)
1368 (interval_has_some_properties_list):
1369 * window.c (wset_combination_limit, wset_dedicated)
1370 (wset_display_table, wset_hchild, wset_left_fringe_width)
1371 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1372 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1373 (wset_right_fringe_width, wset_right_margin_cols)
1374 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1375 (wset_vertical_scroll_bar_type, wset_window_parameters):
1376 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1377 (wset_column_number_displayed, wset_region_showing)
1378 (window_box_edges, run_window_scroll_functions)
1379 (append_glyph_string_lists, prepend_glyph_string_lists)
1380 (append_glyph_string, set_glyph_string_background_width)
1381 (append_glyph, append_composite_glyph)
1382 (take_vertical_position_into_account):
1383 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1384 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1385 (lface_hash, lface_same_font_attributes_p, lookup_face):
1386 * xml.c (libxml2_loaded_p):
1387 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1388 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1389 Now 'static', not 'static inline'.
1390
1391 * bidi.c: Tune.
1392 (bidi_copy_it): Do the whole copy with a single memcpy.
1393 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1394
1395 Revert the FOLLOW-SYMLINKS change for file-attributes.
1396 Doing it right would require several changes to Tramp, and there's
1397 not enough time to get that tested before the freeze today.
1398 * dired.c (directory_files_internal, Ffile_attributes):
1399 Undo last change.
1400
1401 * frame.c (x_report_frame_params): Port better to wider ints.
1402 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1403 or that pointers can be printed in 15 decimal digits.
1404 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1405
1406 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1407
1408 Support x64 build on MS-Windows.
1409 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1410 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1411 compatibility with x64.
1412 (x_get_focus_frame): Add prototype.
1413
1414 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1415 defining an XRectangle structure.
1416
1417 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1418 arithmetics for compatibility with x64.
1419
1420 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1421 compatibility with x64.
1422
1423 * w32heap.h: Adjust prototypes and declarations.
1424
1425 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1426 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1427 DWORD, long, and unsigned long, for compatibility with x64.
1428 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1429 (sbrk): Argument is now of type ptrdiff_t.
1430
1431 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1432 less than 0x0500.
1433 (w32_msg_pump): Use WPARAM type for 'result'.
1434
1435 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1436 architecture.
1437 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1438 compatibility with x64.
1439
1440 * vm-limit.c (lim_data): Now size_t.
1441 (check_memory_limits): Adjust prototypes of real_morecore and
1442 __morecore to receive argument of type ptrdiff_t. Use size_t for
1443 five_percent and data_size.
1444
1445 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1446 variables, for compatibility with x64.
1447 (rva_to_section, offset_to_section, relocate_offset)
1448 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1449 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1450 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1451 for compatibility with x64.
1452
1453 * sysdep.c (STDERR_FILENO): Define if not already defined.
1454
1455 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1456 (__morecore): Argument type is now ptrdiff_t.
1457 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1458 (relinquish): Use ptrdiff_t type for 'excess'.
1459 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1460
1461 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1462 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1463 instead of a literal number.
1464
1465 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1466 (min): Define only if not already defined.
1467
1468 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1469 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1470 hosts.
1471
1472 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1473 'bitmaps' is a pointer.
1474
1475 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1476
1477 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1478
1479 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1480
1481 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1482 * dired.c (directory_files_internal, Ffile_attributes):
1483 New arg follow_symlinks. All uses changed.
1484
1485 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1486
1487 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1488
1489 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1490
1491 Support atimers and CPU profiler via profile.c on MS-Windows.
1492 * w32proc.c (sig_mask, crit_sig): New static variables.
1493 (sys_signal): Support SIGALRM and SIGPROF.
1494 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1495 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1496 sigfillset, and sigprocmask are no longer no-ops.
1497 (sigismember): New function.
1498 (struct itimer_data): New definition.
1499 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1500 (crit_prof): New static variables.
1501 (MAX_SINGLE_SLEEP): New definition.
1502 (timer_loop, stop_timer_thread, term_timers, init_timers)
1503 (start_timer_thread, getitimer, setitimer): New functions.
1504 (alarm): No longer a no-op, calls setitimer.
1505
1506 * w32.c (term_ntproc): Call term_timers.
1507 (init_ntproc): Make sure all signals are unblocked at startup, to
1508 erase any traces of dumping. Call init_timers.
1509
1510 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1511 Windows-specific code to display the hourglass mouse pointer is no
1512 longer used.
1513 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1514 to hourglass timer expiration.
1515 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1516 Remove, no longer used.
1517 (w32_note_current_window, show_hourglass, hide_hourglass):
1518 New functions, in support of hourglass cursor display similar to other
1519 window systems.
1520 (syms_of_w32fns): Don't initialize hourglass_timer.
1521
1522 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1523 WINDOWSNT as well.
1524 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1525
1526 * w32.h (init_timers, term_timers): Add prototypes.
1527
1528 2012-09-30 Kenichi Handa <handa@gnu.org>
1529
1530 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1531 to the buffer relocation which may be caused by ccl_driver.
1532
1533 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1534
1535 * xfns.c (Fx_file_dialog): Update comment.
1536
1537 * w32fns.c (Fx_file_dialog): Update comment.
1538
1539 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1540 Initialize panel name field if OSX >= 10.6.
1541
1542 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1543
1544 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1545
1546 * nsterm.m (NEW_STYLE_FS): New define.
1547 (ns_fullscreen_hook, windowWillEnterFullScreen)
1548 (windowDidEnterFullScreen, windowWillExitFullScreen)
1549 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1550 (setFSValue): New functions.
1551 (EmacsFSWindow): New implementation.
1552 (canBecomeKeyWindow): New function for EmacsFSWindow.
1553 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1554 (dealloc): Release nonfs_window if in fullscreen.
1555 (updateFrameSize:): Call windowDidMove to update top/left.
1556 (windowWillResize:toSize:): Check if frame is still maximized.
1557 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1558 next_maximized, maximized_width, maximized_height and nonfs_window.
1559 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1560 tbar_height.
1561 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1562 fullscreen. Set maximized_width/height. Act on next_maximized.
1563
1564 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1565 (EmacsView): Add variables for fullscreen.
1566 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1567 (EmacsFSWindow): New interface for fullscreen.
1568
1569 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1570
1571 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1572
1573 2012-09-30 Chong Yidong <cyd@gnu.org>
1574
1575 * fns.c (Frandom): Doc fix.
1576
1577 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1578
1579 * window.c (Vwindow_combination_limit): New default value.
1580 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1581
1582 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1583
1584 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1585 Suggested by Eli Zaretskii in
1586 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1587
1588 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1589
1590 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1591 HAVE_TIMER_SETTIME is defined.
1592
1593 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1594
1595 Profiler improvements: more-accurate timers, overflow checks.
1596 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1597 signal.h, setjmp.h. Include systime.h instead.
1598 (saturated_add): New function.
1599 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1600 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1601 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1602 New static vars.
1603 (enum profiler_cpu_running): New enum.
1604 (profiler_cpu_running): Now of that enum type, not bool.
1605 All uses changed to store the new value.
1606 (handle_profiler_signal): Rename from sigprof_handler_1,
1607 for consistency with other handlers. Do not check whether
1608 cpu_log is a hash-table if garbage collecting, since it
1609 doesn't matter in that case.
1610 (deliver_profiler_signal): Rename from sigprof_handler,
1611 for consistency with other handlers.
1612 (setup_cpu_timer): New function, with much of what used to be in
1613 Fprofiler_cpu_start. Check for out-of-range argument.
1614 Prefer timer_settime if available, and prefer
1615 thread cputime clocks, then process cputime clocks, then
1616 monotonic clocks, to the old realtime clock. Use make_timeval
1617 to round more-correctly when falling back to setitimer.
1618 (Fprofiler_cpu_start): Use it.
1619 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1620 Don't assume that passing NULL as the 2nd argument of setitimer
1621 is the same as passing a pointer to all-zero storage.
1622 Ignore SIGPROF afterwards.
1623 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1624 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1625 non-fatal signal handlers. Ignore SIGPROF on startup.
1626 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1627 in profiler.c, since sysdep.c now uses it.
1628
1629 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1630 Suggested by Eli Zaretskii in
1631 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1632
1633 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1634
1635 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1636
1637 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1638
1639 * lisp.h (struct backtrace): Remove indirection for `function' field.
1640 * xdisp.c (redisplay_internal):
1641 * profiler.c (record_backtrace, sigprof_handler_1):
1642 * alloc.c (Fgarbage_collect):
1643 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1644 (Fbacktrace_frame): Adjust accordingly.
1645
1646 2012-09-28 Glenn Morris <rgm@gnu.org>
1647
1648 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1649 (Frun_hook_with_args_until_failure): Doc fixes.
1650
1651 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1652
1653 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1654 Qautomatic_redisplay and change the symbol name. All users changed.
1655
1656 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1657
1658 * profiler.c (sigprof_handler): Fix race condition.
1659
1660 2012-09-28 Glenn Morris <rgm@gnu.org>
1661
1662 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1663
1664 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1665
1666 Check more robustly for timer_settime.
1667 * Makefile.in (LIB_TIMER_TIME): New macro.
1668 (LIBES): Add it.
1669 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1670 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1671 call timer_settime.
1672
1673 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1674
1675 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1676
1677 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1678
1679 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1680
1681 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1682
1683 * character.h (MAYBE_UNIFY_CHAR): Remove.
1684 * charset.c, charset.h (maybe_unify_char): Now static.
1685 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1686 Since this stuff is now private to charset.c, there's no need for
1687 a public macro and no need to inline by hand.
1688
1689 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1690 Stefan Monnier <monnier@iro.umontreal.ca>
1691 Juanma Barranquero <lekktu@gmail.com>
1692
1693 * profiler.c: New file.
1694 * Makefile.in (base_obj): Add profiler.o.
1695 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1696 ($(BLD)/profiler.$(O)): New target.
1697 * emacs.c (main): Call syms_of_profiler.
1698 * alloc.c (Qautomatic_gc): New constant.
1699 (MALLOC_PROBE): New macro.
1700 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1701 (total_bytes_of_live_objects): New function.
1702 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1703 Call malloc_probe for the memory profiler.
1704 (syms_of_alloc): Define Qautomatic_gc.
1705 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1706 race condition.
1707 (struct backtrace): Move definition...
1708 * lisp.h (struct backtrace): ..here.
1709 (Qautomatic_gc, profiler_memory_running): Declare vars.
1710 (malloc_probe, syms_of_profiler): Declare functions.
1711 * xdisp.c (Qautomatic_redisplay): New constant.
1712 (redisplay_internal): Record itself in backtrace_list.
1713 (syms_of_xdisp): Define Qautomatic_redisplay.
1714
1715 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1716 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1717
1718 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1719
1720 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1721
1722 Prefer POSIX timers if available.
1723 They avoid a race if the timer is too close to the current time.
1724 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1725 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1726 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1727
1728 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1729
1730 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1731 CHAR_STRING_ADVANCE.
1732 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1733 STRING_CHAR_ADVANCE.
1734
1735 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1736
1737 Move Vlibrary_cache to emacs.c and reset before dumping.
1738
1739 * lisp.h (reset_image_types): Declare.
1740 [WINDOWSNT] (Vlibrary_cache): Declare.
1741
1742 * image.c (reset_image_types): New function.
1743
1744 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1745 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1746 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1747
1748 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1749 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1750
1751 * w32.h (Vlibrary_cache): Do not declare.
1752
1753 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1754
1755 * w32proc.c (sys_signal): Handle all signals defined by the
1756 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1757 handlers for signals supported by Windows. Don't override
1758 term_ntproc as the handler for SIGABRT.
1759 (sigaction): Rewrite to call sys_signal instead of duplicating its
1760 code.
1761 (sys_kill): Improve commentary.
1762
1763 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1764 consistency with a signature of a signal handler. All callers
1765 changed.
1766 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1767 install term_ntproc as a signal handler for SIGABRT, as that
1768 should be done by the dumped Emacs.
1769
1770 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1771
1772 * w32select.c (term_w32select): Protect against repeated
1773 invocation by setting clipboard_owner to NULL after calling
1774 DestroyWindow.
1775
1776 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1777 and term_ntproc to their modified signatures.
1778
1779 * character.c (char_string, string_char): Remove calls to
1780 MAYBE_UNIFY_CHAR. See the discussion starting at
1781 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1782 for the details.
1783
1784 2012-09-25 Chong Yidong <cyd@gnu.org>
1785
1786 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1787
1788 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1789
1790 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1791 when encountering an unknown bytecode.
1792
1793 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1794
1795 image.c, indent.c: Use bool for booleans.
1796 * dispextern.h (struct image_type): Members valid_p, load, init
1797 now return bool, not int. All uses changed.
1798 * image.c: Omit unnecessary static decls.
1799 (x_create_bitmap_mask, x_build_heuristic_mask):
1800 Return void, not int, since callers don't care about the return value.
1801 (x_create_bitmap_mask, define_image_type, valid_image_p)
1802 (struct image_keyword, parse_image_spec, image_spec_value)
1803 (check_image_size, image_background)
1804 (image_background_transparent, x_clear_image_1)
1805 (postprocess_image, lookup_image, x_check_image_size)
1806 (x_create_x_image_and_pixmap, xbm_image_p)
1807 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1808 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1809 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1810 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1811 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1812 (png_image_p, init_png_functions, png_load_body, png_load)
1813 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1814 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1815 (init_gif_functions, gif_load, imagemagick_image_p)
1816 (imagemagick_load_image, imagemagick_load, svg_image_p)
1817 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1818 (gs_load):
1819 * nsimage.m (ns_load_image):
1820 * nsterm.m (ns_defined_color):
1821 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1822 * xfns.c (x_defined_color):
1823 * xterm.c (x_alloc_lighter_color_for_widget)
1824 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1825 (x_alloc_lighter_color):
1826 * indent.c (disptab_matches_widthtab, current_column)
1827 (scan_for_column, string_display_width, indented_beyond_p)
1828 (compute_motion, vmotion, Fvertical_motion):
1829 Use bool for booleans.
1830
1831 2012-09-24 Chong Yidong <cyd@gnu.org>
1832
1833 * chartab.c (Fset_char_table_default): Obsolete function removed.
1834
1835 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1836
1837 Move pid_t related decls out of lisp.h.
1838 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1839 (interruptible_wait_for_termination):
1840 Move these decls from lisp.h to syswait.h, since they use pid_t.
1841 Needed on FreeBSD; see Herbert J. Skuhra in
1842 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1843 * callproc.c: Include syswait.h.
1844
1845 gnutls.c, gtkutil.c: Use bool for boolean.
1846 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1847 (emacs_gnutls_handle_error):
1848 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1849 (xg_hide_tooltip, xg_create_frame_widgets)
1850 (create_dialog, xg_uses_old_file_dialog)
1851 (xg_get_file_with_chooser, xg_get_file_with_selection)
1852 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1853 (xg_item_label_same_p, xg_update_menubar)
1854 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1855 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1856 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1857 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1858 (update_frame_tool_bar, free_frame_tool_bar):
1859 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1860 * nsmenu.m (ns_update_menubar):
1861 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1862 * xfns.c (Fx_show_tip) [USE_GTK]:
1863 Use bool for boolean.
1864 * gtkutil.c (xg_update_frame_menubar):
1865 * xmenu.c (update_frame_menubar):
1866 Return void, not int, since caller ignores return value.
1867 * gtkutil.c (xg_change_toolbar_position):
1868 Return void, not 1.
1869
1870 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1871
1872 * makefile.w32-in (BLOCKINPUT_H): Remove.
1873 (SYSSIGNAL_H): New macro.
1874 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1875 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1876 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1877 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1878 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1879 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1880 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1881 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1882 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1883 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1884 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1885 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1886 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1887 ($(BLD)/w32xfns.$(O)): Update dependencies.
1888
1889 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1890
1891 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1892 fatal_error_backtrace.
1893
1894 * w32proc.c (sys_kill): Undo last change: don't do anything when
1895 invoked to deliver SIGABRT to our own process. This is now
1896 handled by emacs_raise.
1897
1898 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1899
1900 * w32term.c (w32_read_socket): Remove leftover reference to
1901 interrupt_input_pending.
1902
1903 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1904
1905 Do not use SA_NODEFER.
1906 Problem reported by Dani Moncayo in
1907 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1908 * alloc.c (die):
1909 * sysdep.c (emacs_abort): Do not reset signal handler.
1910 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1911 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1912 wanted even on POSIXish hosts, and it doesn't work on Windows.
1913
1914 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1915
1916 * xterm.c (x_term_init): Call fixup_locale before and after calling
1917 gtk_init (Bug#12392).
1918
1919 2012-09-23 Chong Yidong <cyd@gnu.org>
1920
1921 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1922 Vdynamic_library_alist.
1923
1924 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1925 (Fgnutls_available_p): Caller changed.
1926
1927 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1928 (Flibxml_parse_xml_region): Likewise.
1929
1930 * dispextern.h (struct image_type): Remove arg from init function.
1931
1932 * image.c (Finit_image_library, lookup_image_type)
1933 (define_image_type): Remove now-unneeded second arg.
1934 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1935 (init_tiff_functions, init_gif_functions, init_svg_functions):
1936 Arglist and w32_delayed_load calling convention changed.
1937 (gs_type): Remove init_gs_functions; there is no such function.
1938 (valid_image_p, make_image): Fix caller to lookup_image_type.
1939
1940 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1941
1942 Simplify and avoid signal-handling races (Bug#12471).
1943 * alloc.c (die):
1944 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1945 Avoid recursive loop if there's a fatal error in the function itself.
1946 * atimer.c (pending_atimers):
1947 * blockinput.h: Don't include "atimer.h"; no longer needed.
1948 (interrupt_input_pending): Remove. All uses removed.
1949 pending_signals now counts both atimers and ordinary interrupts.
1950 This is less racy than having three separate pending-signal flags.
1951 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1952 (input_blocked_p):
1953 Rename from their upper-case counterparts BLOCK_INPUT,
1954 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1955 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1956 This makes it easier to access volatile variables more accurately.
1957 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1958 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1959 that's more reliable if the code is buggy and sets
1960 interrupt_input_blocked to a negative value. All uses changed.
1961 * atimer.c (deliver_alarm_signal):
1962 Remove. No need to deliver this to the parent; any thread can
1963 handle this signal now. All uses replaced by underlying handler.
1964 * atimer.c (turn_on_atimers):
1965 * dispnew.c (handle_window_change_signal):
1966 * emacs.c (handle_danger_signal):
1967 * keyboard.c (kbd_buffer_get_event):
1968 Don't reestablish signal handler; not needed with sigaction.
1969 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1970 (UNBLOCK_INPUT_TO):
1971 Rework to avoid unnecessary accesses to volatile variables.
1972 (UNBLOCK_INPUT_TO): Now a function.
1973 (totally_unblock_input, unblock_input): New decls.
1974 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1975 (init_data): Remove. Necessary stuff now done in init_signal.
1976 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1977 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1978 (fatal_error_code): Remove; no longer needed.
1979 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1980 it doesn't always backtrace. All uses changed. No need to reset
1981 signal to default, since sigaction and/or die does that for us now.
1982 Use emacs_raise (FOO), not kill (getpid (), FOO).
1983 (main): Check more-accurately whether we're dumping.
1984 Move fatal-error setup to sysdep.c
1985 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1986 * gtkutil.c (xg_get_file_name, xg_get_font):
1987 Remove no-longer-needed signal-mask manipulation.
1988 * keyboard.c, process.c (POLL_FOR_INPUT):
1989 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1990 * keyboard.c (read_avail_input): Remove.
1991 All uses replaced by gobble_input.
1992 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1993 (kbd_buffer_store_event_hold, gobble_input):
1994 (record_asynch_buffer_change) [USABLE_SIGIO]:
1995 (store_user_signal_events):
1996 No need to mess with signal mask.
1997 (gobble_input): If blocking input and there are terminals, simply
1998 set pending_signals to 1 and return. All hooks changed to not
1999 worry about whether input is blocked.
2000 (process_pending_signals): Clear pending_signals before processing
2001 them, in case a signal comes in while we're processing.
2002 By convention callers now test pending_signals before calling us.
2003 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2004 New functions, to support changes to blockinput.h.
2005 (handle_input_available_signal): Now extern.
2006 (reinvoke_input_signal): Remove. All uses replaced by
2007 handle_async_input.
2008 (quit_count): Now volatile, since a signal handler uses it.
2009 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2010 All callers changed. Block SIGINT only if not already blocked.
2011 Clear sigmask reliably, even if Fsignal returns, which it can.
2012 Omit unnecessary accesses to volatile var.
2013 (quit_throw_to_read_char): No need to restore sigmask.
2014 * keyboard.c (gobble_input, handle_user_signal):
2015 * process.c (wait_reading_process_output):
2016 Call signal-handling code rather than killing ourselves.
2017 * lisp.h: Include <float.h>, for...
2018 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2019 (pending_signals): Now volatile.
2020 (syms_of_data): Now const if IEEE floating point.
2021 (handle_input_available_signal) [USABLE_SIGIO]:
2022 (terminate_due_to_signal, record_child_status_change): New decls.
2023 * process.c (create_process): Avoid disaster if memory is exhausted
2024 while we're processing a vfork, by tightening the critical section
2025 around the vfork.
2026 (send_process_frame, process_sent_to, handle_pipe_signal)
2027 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2028 ignores SIGPIPE.
2029 (send_process): No need for setjmp/longjmp any more, since the
2030 SIGPIPE stuff is now gone. Instead, report an error if errno
2031 is EPIPE.
2032 (record_child_status_change): Now extern. PID and W are now args.
2033 Return void, not bool. All callers changed.
2034 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2035 Remove. All uses removed. This bug should be fixed now in a
2036 different way.
2037 (wait_for_termination_1): Use waitpid rather than sigsuspend,
2038 and record the child status change directly. This avoids the
2039 need to futz with the signal mask.
2040 (process_fatal_action): Move here from emacs.c.
2041 (emacs_sigaction_flags): New function, containing
2042 much of what used to be in emacs_sigaction_init.
2043 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2044 caught by emacs, to make races less likely.
2045 (deliver_process_signal): Rename from handle_on_main_thread.
2046 All uses changed.
2047 (BACKTRACE_LIMIT_MAX): Now at top level.
2048 (thread_backtrace_buffer, threadback_backtrace_pointers):
2049 New static vars.
2050 (deliver_thread_signal, deliver_fatal_thread_signal):
2051 New functions, for more-accurate delivery of thread-specific signals.
2052 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2053 (deliver_arith_signal): Handle in this thread, not
2054 in the main thread, since it's triggered by this thread.
2055 (maybe_fatal_sig): New function.
2056 (init_signals): New arg DUMPING so that we can be more accurate
2057 about whether we're dumping. Caller changed.
2058 Treat thread-specific signals differently from process-general signals.
2059 Block all signals while handling fatal error; that's safer.
2060 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2061 on IEEE hosts.
2062 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2063 Ignore SIGPIPE unless batch.
2064 (emacs_backtrace): Output backtrace for the appropriate thread,
2065 which is not necessarily the main thread.
2066 * syssignal.h: Include <stdbool.h>.
2067 (emacs_raise): New macro.
2068 * xterm.c (x_connection_signal): Remove; no longer needed
2069 now that we use sigaction.
2070 (x_connection_closed): No need to mess with sigmask now.
2071 (x_initialize): No need to reset SIGPIPE handler here, since
2072 init_signals does this for us now.
2073
2074 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2075
2076 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2077 background rect may be larger (Bug#12245).
2078
2079 2012-09-23 Chong Yidong <cyd@gnu.org>
2080
2081 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2082
2083 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2084
2085 * .gdbinit: Just stop at fatal_error_backtrace.
2086 See Stefan Monnier's request in
2087 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2088 Remove no-longer-used query of system type.
2089
2090 2012-09-22 Chong Yidong <cyd@gnu.org>
2091
2092 * search.c (Freplace_match): Doc fix (Bug#12325).
2093
2094 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2095
2096 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2097 (Fline_end_position): Doc fix.
2098
2099 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2100
2101 2012-09-22 Chong Yidong <cyd@gnu.org>
2102
2103 * dispextern.h (struct image_type): Add new slot, storing a type
2104 initialization function.
2105
2106 * image.c (define_image_type): Call the image initializer function
2107 if it is defined. Arguments and return value changed.
2108 (valid_image_p, make_image): Callers changed.
2109 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2110 (gif_type, imagemagick_type, svg_type, gs_type):
2111 Add initialization functions.
2112 (Finit_image_library): Call lookup_image_type.
2113 (CHECK_LIB_AVAILABLE): Macro deleted.
2114 (lookup_image_type): Call define_image_type here, rather than via
2115 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2116 (syms_of_image): Move define_image_type calls for xbm_type and
2117 pbm_type to lookup_image_type.
2118
2119 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2120
2121 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2122 'idle_timers' from here ...
2123 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2124 lists, to avoid infloops when the timer does something stupid,
2125 like reinvoke itself with the same or smaller time-out.
2126 (Bug#12447)
2127
2128 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2129
2130 * window.c (Fsplit_window_internal): Handle only Qt value of
2131 Vwindow_combination_limit separately.
2132 (Qtemp_buffer_resize): New symbol.
2133 (Vwindow_combination_limit): New default value.
2134 Rewrite doc-string.
2135
2136 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2137
2138 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2139 the new overlay string. (Bug#10159)
2140
2141 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2142
2143 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2144 or that fprintf is async-signal-safe. POSIX doesn't require
2145 either assumption.
2146
2147 2012-09-22 Chong Yidong <cyd@gnu.org>
2148
2149 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2150 (Bug#8207).
2151
2152 2012-09-22 Kenichi Handa <handa@gnu.org>
2153
2154 * composite.c (composition_reseat_it): Handle the case that a
2155 grapheme cluster is not covered by a single font (Bug#12352).
2156
2157 2012-09-21 Chong Yidong <cyd@gnu.org>
2158
2159 * image.c (define_image_type): Avoid adding duplicate types to
2160 image_types (Bug#12463). Suggested by Jörg Walter.
2161
2162 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2163
2164 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2165 (print_load_command_name): Add case LC_DATA_IN_CODE.
2166 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2167
2168 2012-09-21 Glenn Morris <rgm@gnu.org>
2169
2170 * eval.c (Frun_hook_with_args_until_success)
2171 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2172
2173 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2174
2175 * fileio.c (Ffile_selinux_context): Only call freecon when
2176 lgetfilecon succeeded.
2177 (Fset_file_selinux_context): Likewise. (Bug#12444)
2178
2179 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2180
2181 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2182 reordering, locate the cursor by calling set_cursor_from_row; if
2183 that fails, clear the desired glyph matrix before returning a
2184 failure indication to the caller. Fixes leaving garbled display
2185 when fast scrolling with a down-key. (Bug#12403)
2186 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2187 scrolling through multibyte text.
2188
2189 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2190
2191 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2192 calling mark_vectorlike since that's the one that marks the window.
2193 (mark_discard_killed_buffers): Mark the final cdr.
2194 * window.h (struct window): Move prev/next_buffers to the
2195 non-standard fields.
2196 * window.c (make_window): Initialize prev/next_buffers manually.
2197
2198 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2199
2200 Omit unused arg EXPECTED from socket hooks.
2201 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2202 * nsterm.m (ns_term_init):
2203 * termhooks.h (struct terminal.read_socket_hook):
2204 * w32inevt.c (w32_console_read_socket):
2205 * w32term.c (w32_read_socket):
2206 * xterm.c (XTread_socket):
2207 Omit unused arg EXPECTED. All callers changed.
2208 (store_user_signal_events): Return void, not int, since callers no
2209 longer care about the return value. All uses changed.
2210
2211 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2212
2213 * w32gui.h (XParseGeometry): Do not declare.
2214
2215 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2216
2217 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2218 Ignore 'expected'. See Eli Zaretskii in
2219 <http://bugs.gnu.org/12471#8> (last line).
2220
2221 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2222 (XParseGeometry): Now static. Substitute extremal values for
2223 values that are out of range.
2224
2225 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2226
2227 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2228
2229 * nsfns.m (XParseGeometry): Remove.
2230 (Fx_create_frame): Call x_set_offset to correctly interpret
2231 top_pos in geometry.
2232
2233 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2234 (Fx_parse_geometry): If there is a space in string, call
2235 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2236
2237 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2238
2239 * search.c (scan_buffer): Use character positions in calls to
2240 region_cache_forward and region_cache_backward, not byte
2241 positions. (Bug#12196)
2242
2243 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2244 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2245
2246 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2247 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2248 emacs_blocked_malloc, now deleted.
2249
2250 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2251
2252 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2253 The workaround was for improving performance on Solaris 2.4, but
2254 is getting in the way now. Emacs will still work if someone is
2255 still running Solaris 2.4 in a museum somewhere; Sun dropped
2256 support for Solaris 2.4 in 2003.
2257 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2258 * process.c (create_process) [HAVE_WORKING_VFORK]:
2259 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2260 since Emacs no longer uses vfork on that platform.
2261
2262 2012-09-17 Glenn Morris <rgm@gnu.org>
2263
2264 * emacs.c: Use COPYRIGHT.
2265
2266 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2267
2268 Remove configure's --without-sync-input option (Bug#12450).
2269 When auditing signal-handling in preparation for cleaning it up,
2270 I found that SYNC_INPUT has race conditions and would be a real
2271 pain to fix. Since it's an undocumented and deprecated
2272 configure-time option, now seems like a good time to remove it.
2273 Also see <http://bugs.gnu.org/11080#16>.
2274 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2275 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2276 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2277 (malloc_hysteresis):
2278 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2279 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2280 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2281 (dont_register_blocks, bytes_used_when_reconsidered)
2282 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2283 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2284 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2285 Remove. All uses removed.
2286 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2287 implementation, one that depends on whether the new macro
2288 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2289 is defined.
2290 * atimer.c (run_timers, handle_alarm_signal):
2291 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2292 (handle_async_input, process_pending_signals)
2293 (handle_input_available_signal, init_keyboard):
2294 * nsterm.m (ns_read_socket):
2295 * process.c (wait_reading_process_output):
2296 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2297 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2298 (emacs_write):
2299 * xterm.c (XTread_socket):
2300 Assume SYNC_INPUT.
2301 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2302 * eval.c (handling_signal): Remove. All uses removed.
2303 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2304 All uses replaced with the SYNC_INPUT version.
2305 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2306 Remove decls.
2307 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2308 Now static.
2309
2310 * font.c (Ffont_shape_gstring): Remove unused local.
2311
2312 2012-09-16 Glenn Morris <rgm@gnu.org>
2313
2314 * Makefile.in (clean): No longer run nextstep's clean.
2315
2316 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2317 (ns_frag): Remove.
2318 (ns-app): Move here from ns.mk, and simplify.
2319 (clean): Simplify nextstep entry.
2320 * ns.mk: Remove file.
2321
2322 2012-09-17 Kenichi Handa <handa@gnu.org>
2323
2324 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2325 not covert the last few charactes.
2326
2327 2012-09-16 Kenichi Handa <handa@gnu.org>
2328
2329 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2330 here, but just check the validity of glyphs in the glyph-string.
2331
2332 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2333
2334 * window.c (Fwindow_parameter, Fset_window_parameter):
2335 Accept any window as argument (Bug#12452).
2336
2337 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2338
2339 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2340 to ns_term_init to avoid memory leak.
2341
2342 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2343 explicit retain/release.
2344 (ns_term_init): Only allow one display. Initialize outerpool and
2345 ns_*_types.
2346
2347 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2348
2349 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2350 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2351 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2352 the Microsoft problem in a different way, by altering ../nt/config.nt.
2353
2354 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2355
2356 * w32xfns.c:
2357 * w32uniscribe.c:
2358 * w32term.c:
2359 * w32select.c:
2360 * w32reg.c:
2361 * w32proc.c:
2362 * w32menu.c:
2363 * w32inevt.c:
2364 * w32heap.c:
2365 * w32font.c:
2366 * w32fns.c:
2367 * w32console.c:
2368 * w32.c:
2369 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2370 by lisp.h. This completes removal of setjmp.h inclusion
2371 erroneously announced in the previous commit. (Bug#12446)
2372
2373 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2374 more accurate.
2375
2376 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2377 not defined as a macro. The latter happens on MS-Windows.
2378 (Bug#12446)
2379
2380 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2381
2382 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2383 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2384 Some instances of '#include <setjmp.h>' removed, if the
2385 only reason for the instance was because "lisp.h" was included.
2386 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2387 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2388 and _longjmp with the new symbols. Emacs already uses _setjmp if
2389 available, so this change affects only POSIXish hosts that have
2390 sigsetjmp but not _setjmp, such as some versions of Solaris and
2391 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2392 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2393 (png_load_body) [HAVE_PNG]:
2394 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2395 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2396 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2397 since PNG requires jmp_buf. This is the only exception to the
2398 general rule that we now use sys_setjmp and sys_longjmp.
2399 This exception is OK since this code does not change the signal
2400 mask or longjmp out of a signal handler.
2401
2402 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2403
2404 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2405 Include "syssignal.h", for 'main_thread'.
2406
2407 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2408
2409 Avoid out-of-range marker position (Bug#12426).
2410 * insdel.c (replace_range, replace_range_2):
2411 Adjust markers before overlays, as suggested by comments.
2412 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2413 Remove redundant check before calling offset_intervals.
2414
2415 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2416
2417 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2418 current buffer (Bug#12387).
2419
2420 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2421
2422 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2423
2424 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2425
2426 Use a more backwards-compatible timer format (Bug#12430).
2427 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2428 vector element, not from the 4th, since PSECS is now at the end.
2429 (Fcurrent_idle_time): Doc fix.
2430
2431 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2432
2433 Function to mark objects and remove killed buffers at once.
2434 * alloc.c (discard_killed_buffers): Rename to ...
2435 (mark_discard_killed buffers) ... new name. Add marking
2436 of remaining objects. Fix comment. Adjust users.
2437 (mark_object): Do not touch frame buffer lists here.
2438 * frame.c (delete_frame): Reset frame buffer lists here.
2439
2440 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2441
2442 Better workaround for GNOME bug when --enable-gcc-warnings.
2443 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2444 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2445 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2446
2447 Simplify SIGIO usage (Bug#12408).
2448 The code that dealt with SIGIO was crufty and confusing, e.g., it
2449 played tricks like "#undef SIGIO" but these tricks were not used
2450 consistently. Simplify mostly by not #undeffing standard symbols,
2451 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2452 or not as we please) rather than "defined SIGIO" (standard symbol
2453 that we probably shouldn't #undef).
2454 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2455 Modules that need it can include it.
2456 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2457 * dispextern.h (ignore_sigio): New decl.
2458 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2459 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2460 * emacs.c (shut_down_emacs):
2461 * keyboard.c (kbd_buffer_store_event_hold):
2462 Use ignore_sigio rather than invoking 'signal' directly.
2463 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2464 for FIONREAD.
2465 (FIONREAD, SIGIO): Do not #undef.
2466 (tty_read_avail_input): Use #error rather than a syntax error.
2467 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2468 for I_PIPE, used by SETUP_SLAVE_PTY.
2469 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2470 * sysdep.c (croak): Remove; no longer needed. This bit of
2471 temporary code, with Fred N. Fish's comment that it's temporary,
2472 has been in Emacs since at least 1992!
2473 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2474 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2475 * syssignal.h (croak): Remove decl.
2476 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2477 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2478 now that we're termios-only.
2479 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2480 * term.c (dissociate_if_controlling_tty): Use #error rather than
2481 a run-time error.
2482
2483 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2484 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2485 to work around GNOME bug 683906.
2486 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2487 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2488 This works around GCC bug 54561.
2489
2490 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2491
2492 More fixes for 'volatile' and setjmp/longjmp.
2493 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2494 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2495 (png_load_body) [HAVE_PNG]:
2496 (jpeg_load_body) [HAVE_JPEG]:
2497 New function, with most of the old parent function's body.
2498 (png_load) [HAVE_PNG]:
2499 (jpeg_load) [HAVE_JPEG]:
2500 Invoke the new function, to avoid longjmp munging our locals.
2501 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2502 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2503 longjmp is passed 2, as the C standard doesn't guarantee this.
2504 Instead, store the failure code into mgr->failure_code.
2505
2506 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2507
2508 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2509 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2510 (syms_of_keyboard): Remove support for unread-command-char.
2511
2512 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2513
2514 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2515 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2516 violation. (Bug#12426)
2517
2518 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2519
2520 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2521
2522 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2523
2524 * eval.c: Add `inhibit-debugger'.
2525 (Qinhibit_debugger): New symbol.
2526 (call_debugger): Bind it instead of Qdebug_on_error.
2527 (maybe_call_debugger): Test Vinhibit_debugger.
2528 (syms_of_eval): Define inhibit-debugger.
2529 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2530 (syms_of_xdisp): Remove inhibit-debug-on-message.
2531
2532 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2533
2534 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2535 If a nonvolatile local variable is written before a _longjmp to
2536 the frame containing the variable, and is read after the _longjmp,
2537 the value read is indeterminate. Some local variables of type
2538 'struct handler' and 'struct catchtag' are used in this way, so
2539 mark each of their slots as volatile if the slot can be set before
2540 _longjmp and read afterwards.
2541 * lisp.h (struct handler): var and chosen_clause are now volatile.
2542 (struct catchtag): val, next, and pdlcount are now volatile.
2543
2544 * bidi.c (bidi_push_it, bidi_pop_it):
2545 * fns.c (copy_hash_table):
2546 * image.c (define_image_type):
2547 * keyboard.c (kbd_buffer_store_event_hold):
2548 * process.c (Fprocess_send_eof):
2549 * xfaces.c (x_create_gc) [HAVE_NS]:
2550 * xgselect.c (xg_select):
2551 Prefer assignment to memcpy when either will do.
2552
2553 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2554 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2555 time an item is removed. No need to mark this function 'inline';
2556 the compiler knows better than we do.
2557
2558 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2559
2560 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2561 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2562 to change_frame_size (Bug#12388).
2563 (windowDidResize:): Pass YES to updateFrameSize.
2564
2565 * nsterm.h: Add delay parameter to updateFrameSize.
2566
2567 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2568
2569 Discard killed buffers from deleted window and frame objects.
2570 This reduces an amount of references to killed buffers and
2571 helps GC to reclaim them faster.
2572 * alloc.c (discard_killed_buffers): New function.
2573 (mark_object): Use it for deleted windows and frames.
2574 (mark_object): If symbol's value is set up for a killed buffer
2575 or deleted frame, restore its global binding.
2576 * data.c (swap_in_global_binding): Add GC notice.
2577 (swap_in_symval_forwarding): Use convenient set_blv_where.
2578 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2579 * window.h: ... to here.
2580
2581 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2582
2583 Convenient macro to check whether the buffer is live.
2584 * buffer.h (BUFFER_LIVE_P): New macro.
2585 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2586 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2587
2588 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2589
2590 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2591 composition cases (Bug#12364).
2592
2593 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2594 overhang of succeeding glyphs overlapping box cursor.
2595
2596 * w32term.c (x_draw_glyph_string): Likewise.
2597
2598 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2599
2600 Simplify, document, and port floating-point (Bug#12381).
2601 The porting part of this patch fixes bugs on non-IEEE platforms
2602 with frexp, ldexp, logb.
2603 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2604 Now static.
2605 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2606 support, by removing commented-out code and briefly listing the
2607 C89 functions excluded. The commented-out stuff was confusing
2608 maintenance, e.g., we thought we needed cbrt but it was commented out.
2609 (logb): Remove decl; no longer needed.
2610 (isfinite): New macro, if not already supplied.
2611 (isnan): Don't replace any existing macro.
2612 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2613 are present on all C89 platforms.
2614 (Ffrexp): Do not special-case zero, as frexp does the right thing
2615 for that case.
2616 (Flogb): Do not use logb, as it doesn't have the desired meaning
2617 on hosts that use non-base-2 floating point. Instead, stick with
2618 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2619 frexp, to avoid getting an unspecified result.
2620
2621 * xdisp.c (Qinhibit_debug_on_message): Now static.
2622
2623 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2624
2625 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2626 NSBezierPath (Bug#12131).
2627
2628 2012-09-10 Chong Yidong <cyd@gnu.org>
2629
2630 * fns.c (Fdelq, Fdelete): Doc fix.
2631
2632 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2633
2634 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2635 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2636
2637 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2638
2639 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2640 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2641 Use it.
2642
2643 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2644
2645 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2646 left fringe if the window has a left margin. This avoids leaving
2647 traces of the cursor because its leftmost pixel is not drawn over.
2648
2649 * dispnew.c (update_window_line): When the left margin area of a
2650 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2651 that screen line. (Bug#12277)
2652
2653 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2654
2655 Assume C89 or later for math functions (Bug#12381).
2656 This simplifies the code, and makes it a bit smaller and faster,
2657 and (most important) makes it easier to clean up signal handling
2658 since we can stop worring about floating-point exceptions in
2659 library code. That was a problem before C89, but the problem
2660 went away many years ago on all practical Emacs targets.
2661 * data.c, image.c, lread.c, print.c:
2662 Don't include <math.h>; no longer needed.
2663 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2664 might be autoconfigured, as that never happens.
2665 * data.c (fmod):
2666 * doprnt.c (DBL_MAX_10_EXP):
2667 * print.c (DBL_DIG):
2668 Remove. C89 or later always defines these.
2669 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2670 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2671 (arith_error, domain_error, domain_error2):
2672 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2673 no longer needed -- we simply return what C returns. All uses removed.
2674 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2675 the wrapped code.
2676 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2677 Remove. All uses expanded, as these macros are no longer used
2678 more than once and are now more trouble than they're worth.
2679 (Ftan): Use tan, not sin / cos.
2680 (Flogb): Assume C89 frexp.
2681 (fmod_float): Assume C89 fmod.
2682 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2683 (init_floatfns): Remove. All uses removed.
2684
2685 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2686
2687 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2688 compositeToPoint for OSX < 10.6 (Bug#12390).
2689
2690 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2691
2692 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2693 This produces more-accurate results.
2694
2695 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2696
2697 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2698 changes (Bug#12088).
2699
2700 2012-09-08 Chong Yidong <cyd@gnu.org>
2701
2702 * syntax.c (Fstring_to_syntax): Doc fix.
2703
2704 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2705
2706 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2707 in the internal border.
2708 (x_set_window_size): Remove static variables and their usage.
2709 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2710 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2711 Remove fringe/internal border adjustment (Bug#11052).
2712 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2713 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2714 (ns_fix_rect_ibw): Remove.
2715 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2716 (ns_dumpglyphs_box_or_relief): Ditto.
2717 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2718 adjustment.
2719 (ns_dumpglyphs_image): Ditto.
2720 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2721 border adjustment.
2722 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2723 their usage. Add fringe_extended_p and its use as in other terms.
2724 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2725 scroll bar was removed.
2726 (updateFrameSize): New function.
2727 (windowDidResize): Move code to updateFrameSize and call it.
2728
2729 * nsterm.h (EmacsView): Add updateFrameSize.
2730
2731 2012-09-07 Chong Yidong <cyd@gnu.org>
2732
2733 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2734
2735 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2736
2737 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2738
2739 More signal-handler cleanup (Bug#12327).
2740 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2741 Problem introduced when merging patches. Noted by Eli Zaretskii in
2742 <http://bugs.gnu.org/12327#67>.
2743 * floatfns.c: Comment fix.
2744 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2745 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2746 and anyway the declaration is harmless even if SIGDANGER is not defined.
2747 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2748 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2749 source files not surprisingly expected syssignal.h to define, or
2750 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2751 Include <sys/ioctl.h>, for FIONREAD.
2752 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2753 This eliminates a problem whereby other files mysteriously had
2754 to include "syssignal.h" before including "systty.h" if they
2755 wanted to use "#ifdef SIGIO".
2756
2757 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2758
2759 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2760
2761 * w32.c (sigemptyset): Empty the set.
2762 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2763
2764 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2765
2766 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2767
2768 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2769 (mark_object): Likewise for frame objects.
2770
2771 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2772
2773 * syssignal.h (handle_on_main_thread): Always declare,
2774 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2775 This ports to platforms without HAVE_PTHREAD.
2776
2777 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2778
2779 Signal-handler cleanup (Bug#12327).
2780 Emacs's signal handlers were written in the old 4.2BSD style with
2781 sigblock and sigmask and so forth, and this led to some
2782 inefficiencies and confusion. Rewrite these to use
2783 pthread_sigmask etc. without copying signal sets around. Also,
2784 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2785 'signal', and instead use functions that do not attempt to take
2786 over the system name space. This patch causes Emacs's text
2787 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2788 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2789 Do not include <signal.h> or "syssignal.h", as these
2790 modules do not use signals.
2791 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2792 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2793 Do not include <signal.h>, as "syssignal.h" does that for us now.
2794 * atimer.c (sigmask_atimers): New function.
2795 (block_atimers, unblock_atimers): New functions,
2796 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2797 All uses replaced.
2798 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2799 no longer needed here.
2800 * emacs.c (main): Inspect existing signal handler with sigaction,
2801 so that there's no need to block and unblock SIGHUP.
2802 * sysdep.c (struct save_signal): New member 'action', replacing
2803 old member 'handler'.
2804 (save_signal_handlers, restore_signal_handlers):
2805 Use sigaction instead of 'signal' to save and restore.
2806 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2807 New function. All users of 'signal' modified to use set_sighandler
2808 if they're writeonly, and to use sys_signal if they're read+write.
2809 (emacs_sigaction_init, forwarded_signal): New functions.
2810 (sys_signal): Remove. All uses replaced by calls to sigaction
2811 and emacs_sigaction_init, or by direct calls to 'signal'.
2812 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2813 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2814 all uses replaced by pthread_sigmask etc. calls.
2815 * syssignal.h: Include <signal.h>.
2816 (emacs_sigaction_init, forwarded_signal): New decls.
2817 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2818 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2819 (sigmask, sys_sigmask): Remove; no longer needed.
2820 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2821 (sigblock, sigunblock, sigfree):
2822 (sigsetmask) [!defined sigsetmask]:
2823 Remove. All uses replaced by pthread_sigmask.
2824 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2825 no longer need to be replaced, and its typical old uses
2826 are now done via emacs_sigaction_init and sigaction.
2827 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2828 (sys_sigdel): Remove; unused.
2829 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2830
2831 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2832
2833 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2834 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2835
2836 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2837
2838 Explicitly mark buffer_defaults and buffer_local_symbols.
2839 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2840 mark_local_symbols here.
2841 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2842 since special buffers aren't marked here any more.
2843 (allocate_buffer): Chain new buffer with all_buffers here...
2844 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2845 not here.
2846 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2847 (syms_of_buffer): Remove staticpro of the above.
2848 (init_buffer_once): Set names for buffer_defaults and
2849 buffer_local_symbols.
2850
2851 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2852
2853 Use bool for booleans in font-related modules.
2854 * font.c (font_intern_prop, font_style_to_value)
2855 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2856 (generate_otf_features, font_check_otf_features, font_check_otf)
2857 (font_match_p, font_list_entities, font_at):
2858 * fontset.c (fontset_id_valid_p, reorder_font_vector
2859 (fontset_find_font, Fset_fontset_font)
2860 (face_suitable_for_char_p) [0]:
2861 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2862 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2863 (m17n_flt_initialized, ftfont_shape_by_flt):
2864 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2865 * nsfont.m (nsfont_draw):
2866 * w32font.c (w32font_draw):
2867 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2868 Use bool for booleans.
2869 * font.h: Adjust to above API changes.
2870 (struct font, struct font_driver, struct font_driver_list):
2871 Use bool for booleans.
2872 (struct font): Remove useless member encoding_type.
2873 All users removed.
2874 * fontset.c, xftfont.c: Omit unnecessary static decls.
2875
2876 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2877
2878 * alloc.c (mark_object): Revert window marking code
2879 since it's unsafe for the Fset_window_configuration.
2880
2881 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2882
2883 Fix race conditions with signal handlers and errno (Bug#12327).
2884 Be more systematic about preserving errno whenever a signal
2885 handler returns, even if it's not in the main thread. Do this by
2886 renaming signal handlers to distinguish between signal delivery
2887 and signal handling. All uses changed.
2888 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2889 * data.c (deliver_arith_signal): Rename from arith_error.
2890 * dispnew.c (deliver_window_change_signal): Rename from
2891 window_change_signal.
2892 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2893 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2894 * keyboard.c (deliver_input_available_signal): Rename from
2895 input_available_signal.
2896 (deliver_user_signal): Rename from handle_user_signal.
2897 (deliver_interrupt_signal): Rename from interrupt_signal.
2898 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2899 (deliver_child_signal): Rename from sigchld_handler.
2900 * atimer.c (handle_alarm_signal):
2901 * data.c (handle_arith_signal):
2902 * dispnew.c (handle_window_change_signal):
2903 * emacs.c (handle_fatal_signal, handle_danger_signal):
2904 * keyboard.c (handle_input_available_signal):
2905 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2906 * process.c (handle_pipe_signal, handle_child_signal):
2907 New functions, with the actual signal-handling code taken from the
2908 original respective signal handlers, sans the sporadic attempts to
2909 preserve errno, since that's now done by handle_on_main_thread.
2910 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2911 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2912 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2913 Move to sysdep.c.
2914 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2915 Move initialization of main_thread to sysdep.c's init_signals.
2916 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2917 our usage, and simplifies the mainline code.
2918 (record_child_status_change): New static function, as a helper
2919 for handle_child_signal, and with most of the old child handler's
2920 contents.
2921 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2922 (handle_child_signal): Use the above.
2923 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2924 Moved here from emacs.c.
2925 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2926 code moved here from emacs.c's main function.
2927 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2928 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2929 This lets callers save and restore errno properly.
2930
2931 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2932
2933 Remove redundant or unused things here and there.
2934 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2935 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2936 * editfns.c (Fcompare_buffer_substrings): Likewise.
2937 * frame.h (struct terminal, struct font_driver_list):
2938 Remove redundant declarations.
2939 * window.h (Qleft, Qright): Likewise.
2940
2941 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2942
2943 Do not mark objects from deleted buffers, windows and frames.
2944 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2945 (mark_object): Likewise for windows and frames.
2946
2947 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2948
2949 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2950 buffer_defaults and buffer_local_symbols as valid objects.
2951 Return special value to denote them.
2952
2953 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2954
2955 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2956 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2957 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2958 (file_name_absolute_p, Fsubstitute_in_file_name):
2959 (check_executable, check_writable, Ffile_accessible_directory_p)
2960 (Fset_file_selinux_context, Fdefault_file_modes)
2961 (Finsert_file_contents, choose_write_coding_system)
2962 (Fwrite_region, build_annotations, a_write, e_write)
2963 (Fdo_auto_save):
2964 * filelock.c (boot_time_initialized, get_boot_time)
2965 (get_boot_time_1, lock_file_1, within_one_second):
2966 * floatfns.c (in_float):
2967 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2968 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2969 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2970 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2971 * window.c (compare_window_configurations):
2972 Use bool for booleans.
2973 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2974 (Fdefault_file_modes): Now mode_t, not int, for modes.
2975 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2976 (internal_delete_file): Now returns void, not a (boolean) int,
2977 since nobody was looking at the return value.
2978 * lisp.h, window.h: Adjust to above API changes.
2979
2980 * xdisp.c (set_message): Simplify and reindent last change.
2981
2982 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2983
2984 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2985
2986 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2987
2988 * eval.c (call_debugger): Make the function non-static so that we
2989 can call it from set_message.
2990
2991 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2992 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2993
2994 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2995
2996 Give more-useful info on a fatal error (Bug#12328).
2997 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2998 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2999 of doing the work ourselves.
3000 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3001 do most of the work.
3002 (fatal_error_backtrace): New function, taken from the guts
3003 of the old fatal_error_signal, but with a new option to output
3004 a backtrace.
3005 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3006 info about the signal than just its number.
3007 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3008 * sysdep.c: Include <execinfo.h>
3009 (emacs_backtrace): New function, taken partly from the previous
3010 code of the 'die' function.
3011 (emacs_abort): Call fatal_error_backtrace rather than abort.
3012
3013 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3014
3015 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3016 eager (load-time) macro-expansion.
3017 * lisp.mk (lisp): Add macroexp.
3018
3019 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3020
3021 Simplify redefinition of 'abort' (Bug#12316).
3022 Do not try to redefine the 'abort' function. Instead, redo
3023 the code so that it calls 'emacs_abort' rather than 'abort'.
3024 This removes the need for the NO_ABORT configure-time macro
3025 and makes it easier to change the abort code to do a backtrace.
3026 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3027 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3028 Remove; sysdep.c's emacs_abort now takes its place.
3029 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3030 'abort' changed to use 'emacs_abort'.
3031 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3032 (abort) [!defined abort]: Rename to ...
3033 (emacs_abort): ... new name.
3034 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3035 the place of the old 'abort' in emacs.c.
3036 * w32.c, w32fns.c (abort): Do not #undef.
3037 * w32.c (emacs_abort): Rename from w32_abort.
3038
3039 2012-09-04 Eli Zaretskii <eliz@gnu.org>
3040
3041 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3042 offsets[j].dv, since the y axis of the screen coordinates points
3043 down, while the y axis of the font definition coordinates points
3044 up. This fixes display of Arabic diacritics such as KASRA and
3045 KASRATAN. (Bug#11860)
3046
3047 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3048
3049 Be more systematic about _setjmp vs setjmp.
3050 * alloc.c (test_setjmp, mark_stack):
3051 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3052 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3053 (png_load, my_error_exit, jpeg_load):
3054 * process.c (send_process_trap, send_process):
3055 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3056 The underscored versions are up to 30x faster on some hosts.
3057 Formerly, the code used setjmp+longjmp sometimes and
3058 _setjmp+_longjmp at other times, with no particular reason to
3059 prefer setjmp+longjmp.
3060
3061 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3062
3063 Fix minor problem found by static checking.
3064 * buffer.c (Fdelete_all_overlays): Return nil.
3065
3066 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3067
3068 * buffer.c (Fdelete_all_overlays): New function.
3069
3070 2012-09-03 Chong Yidong <cyd@gnu.org>
3071
3072 * gtkutil.c: Add extern decl for Qxft.
3073
3074 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3075
3076 * emacs.c, eval.c: Use bool for boolean.
3077 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3078 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3079 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3080 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3081 (main, decode_env_path, Fdaemon_initialized):
3082 * eval.c (call_debugger, Finteractive_p, interactive_p):
3083 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3084 (maybe_call_debugger, Fbacktrace):
3085 * process.c (read_process_output, exec_sentinel):
3086 Use bool for booleans.
3087 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3088 All callers changed.
3089 * eval.c (interactive_p): Omit always-true boolean argument
3090 EXCLUDE_SUBRS_P. All callers changed.
3091 * dispextern.h, lisp.h: Reflect above API changes.
3092 * firstfile.c (dummy): Use the address of 'main', whose signature
3093 won't change, instead of the address of 'initialize', whose
3094 signature just changed from int to bool.
3095 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3096 * msdos.c (fatal_error_in_progress): ... from here.
3097 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3098 of incrementing it.
3099 (redisplay_internal, unwind_redisplay): Simply clear
3100 REDISPLAYING_P when unwinding, instead of saving its previous,
3101 always-false value and then restoring it.
3102
3103 Clean up some extern decls.
3104 Mostly, this hoists extern decls out of .c files and into .h files.
3105 That way, we're more likely to catch errors if the interfaces change.
3106 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3107 declare xg_mark_data.
3108 * dispextern.h (x_frame_parm_handlers):
3109 * font.h (Qxft):
3110 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3111 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3112 (Qultra_bold, Qoblique, Qitalic):
3113 Move extern decl here from .c file.
3114 * alloc.c (xg_mark_data) [USE_GTK]:
3115 * doc.c (Qclosure):
3116 * eval.c (Qlexical_binding):
3117 * fns.c (time) [!HAVE_UNISTD_H]:
3118 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3119 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3120 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3121 * lread.c (Qinternal_interpreter_environment):
3122 * minibuf.c (Qbuffer):
3123 * process.c (QCfamily, QCfilter):
3124 * widget.c (free_frame_faces):
3125 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3126 * xfont.c (x_clear_errors):
3127 * xterm.c (x_frame_parm_handlers):
3128 Remove now-redundant extern decls.
3129 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3130 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3131 Now static.
3132 * xfaces.c: Remove unnecessary static decls.
3133 * xterm.c (updating_frame): Remove decl of nonexistent object.
3134
3135 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3136 when building globals.h, as the objects that are not built on
3137 this host are not needed to compile C files on this host.
3138
3139 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3140
3141 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3142
3143 * frame.h: Add missing prototype for x_wm_set_size_hint.
3144
3145 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3146
3147 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3148 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3149 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3150 (Fsubstitute_command_keys):
3151 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3152 (save_excursion_save, save_excursion_restore)
3153 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3154 (format_time_string, general_insert_function)
3155 (make_buffer_string, make_buffer_string_both)
3156 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3157 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3158 (copy_text, insert_1, insert_1_both, insert_from_string)
3159 (insert_from_string_before_markers, insert_from_string_1)
3160 (insert_from_buffer, insert_from_buffer_1, replace_range)
3161 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3162 (del_range_2, modify_region):
3163 * intervals.c (intervals_equal, balance_possible_root_interval)
3164 (adjust_intervals_for_insertion, merge_properties_sticky)
3165 (graft_intervals_into_buffer, lookup_char_property)
3166 (adjust_for_invis_intang, set_point_both)
3167 (get_property_and_range, compare_string_intervals)
3168 (set_intervals_multibyte_1, set_intervals_multibyte):
3169 * keyboard.c (decode_timer):
3170 Use bool for boolean.
3171 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3172 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3173
3174 2012-09-02 Chong Yidong <cyd@gnu.org>
3175
3176 * keymap.c (push_key_description): Print M-TAB as C-M-i
3177 (Bug#11758).
3178
3179 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3180
3181 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3182 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3183 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3184 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3185 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3186 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3187 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3188
3189 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3190
3191 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3192 more than one grapheme cluster passed to the shaper: compute the
3193 offset adjustment values separately for each cluster. (Bug#11860)
3194
3195 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3196 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3197 about implicit conversions from integer to pointer.
3198
3199 2012-09-01 Daniel Colascione <dancol@dancol.org>
3200
3201 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3202 system used too early.
3203
3204 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3205
3206 Better seed support for (random).
3207 * emacs.c (main): Call init_random.
3208 * fns.c (Frandom): Set the seed from a string argument, if given.
3209 Remove long-obsolete Gentzel cruft.
3210 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3211 (init_random): New function.
3212
3213 2012-09-01 Daniel Colascione <dancol@dancol.org>
3214
3215 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3216 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3217 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3218 x_wm_set_size_hint, x_query_colors, x_real_positions,
3219 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3220 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3221 all of which have been moved to common code.
3222
3223 * xfaces.c: Include TERM_HEADER instead of listing all possible
3224 window-system headers.
3225
3226 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3227 to match header.
3228
3229 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3230 directly accessing frame internals.
3231
3232 * w32font.h: Include font.h. Define syms_of_w32font and
3233 globals_of_w32font.
3234
3235 * process.c: Include TERM_HEADER instead of listing all possible
3236 window-system headers.
3237
3238 * nsterm.h: Remove declarations now in frame.h.
3239 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3240
3241 * menu.c: Include TERM_HEADER instead of listing all possible
3242 window-system headers.
3243
3244 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3245 window system.
3246
3247 * keyboard.c: Include TERM_HEADER instead of listing all possible
3248 window-system headers.
3249
3250 * image.c: Include TERM_HEADER instead of listing all possible
3251 window-system headers. Declare Vlibrary_cache when compiling for
3252 Windows.
3253
3254 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3255 window system declarations.
3256
3257 * frame.h: Move common functions here: set_frame_menubar,
3258 x_set_window_size, x_sync, x_get_focus_frame,
3259 x_set_mouse_position, x_set_mouse_pixel_position,
3260 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3261 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3262 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3263 x_activate_menubar, x_real_positions, x_bitmap_icon,
3264 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3265 and x_query_colors.
3266
3267 * frame.c: Include TERM_HEADER instead of listing all possible
3268 window-system headers.
3269
3270 * font.c: Include TERM_HEADER instead of listing all possible
3271 window-system headers.
3272
3273 * emacs.c: Include TERM_HEADER.
3274
3275 * dispnew.c: Include TERM_HEADER instead of listing all possible
3276 window-system headers.
3277
3278 * ccl.h: Include character.h.
3279
3280 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3281 the current window system; include in list of objects to link into
3282 Emacs.
3283
3284 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3285
3286 Remove mark_ttys function and fix tty_display_info initialization.
3287 * lisp.h (mark_ttys): Remove prototype.
3288 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3289 to mark_ttys because all possible values of 'top_frame' slot are
3290 the frames which are reachable from Vframe_list.
3291 * term.c (mark_ttys): Remove.
3292 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3293
3294 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3295
3296 Change struct frame bitfields from unsigned char to unsigned.
3297 * frame.h (struct frame): Change type of 'display_preempted',
3298 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3299 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3300 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3301 bitfields from unsigned char to unsigned.
3302
3303 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3304
3305 Remove unused member of struct x_output and struct w32_output.
3306 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3307 * w32term.h (struct w32_output): Likewise.
3308
3309 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3310
3311 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3312 does not become zero (Bug#12234).
3313
3314 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3315
3316 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3317 for GCC 4.7.1 x86-64.
3318
3319 2012-08-30 Glenn Morris <rgm@gnu.org>
3320
3321 * lread.c (init_lread): For out-of-tree builds, only add the
3322 source directory's site-lisp dir to the load-path if it exists,
3323 consistent with in-tree builds. (Bug#12302)
3324
3325 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3326
3327 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3328 button_values to NULL. Call setStykeMask so dialogs get a close button.
3329 (windowShouldClose:): Set window_closed.
3330 (dealloc): New member, free button_values.
3331 (process_dialog:): Make member function. Remove window argument,
3332 replace window with self. Count buttons and allocate and store values
3333 in button_values.
3334 (addButton:value:row:): value is int with the name tag. Call setTag
3335 with tag. Remove return self, declare return value as void.
3336 (addString:row:): Remove return self, declare return value as void.
3337 (addSplit): Remove return self, declare return value as void.
3338 (clicked:): Remove return self, declare return value as void.
3339 Set dialog_return to button_values[seltag]. Code formatting change.
3340 (initFromContents:isQuestion:): Adjust call to process_dialog.
3341 Code formatting change.
3342 (timeout_handler:): Set timer_fired to YES.
3343 (runDialogAt:): Set timer_fired to NO.
3344 Handle click on close button as quit.
3345
3346 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3347 Add window_closed and button_values. Add void as return value for
3348 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3349 Add process_dialog as new member.
3350
3351 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3352
3353 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3354 is not one of the heaps we manage. (Bug#12242)
3355
3356 2012-08-28 Glenn Morris <rgm@gnu.org>
3357
3358 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3359
3360 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3361
3362 * window.c (Fset_window_configuration): Remove handling of
3363 auto-buffer-name window parameter. Install revision of reverted
3364 fix.
3365
3366 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3367
3368 Do not allow to set major mode for a dead buffer.
3369 * buffer.c (Fset_buffer_major_mode): Signal an error
3370 if the buffer is dead.
3371 (Fother_buffer, other_buffer_safely): Remove redundant
3372 nested declaration.
3373
3374 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3375
3376 Always use set_buffer_if_live to restore original buffer at unwind.
3377 * buffer.h (record_unwind_current_buffer): New function.
3378 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3379 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3380 * undo.c, window.c: Adjust users.
3381 * buffer.c (set_buffer_if_live): Fix comment.
3382
3383 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3384
3385 Fix usage of set_buffer_internal.
3386 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3387 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3388 * coding.c (decode_coding): Omit redundant test.
3389 * fileio.c (decide_coding_unwind): Likewise.
3390 * fns.c (secure_hash): Likewise.
3391 * insdel.c (modify_region): Likewise.
3392 * keyboard.c (command_loop_1): Likewise.
3393 * print.c (PRINTFINISH): Likewise.
3394 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3395
3396 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3397
3398 * dispnew.c: Use bool for boolean.
3399 (frame_garbaged, display_completed, delayed_size_change)
3400 (fonts_changed_p, add_window_display_history)
3401 (add_frame_display_history, verify_row_hash)
3402 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3403 (row_equal_p, realloc_glyph_pool)
3404 (allocate_matrices_for_frame_redisplay)
3405 (showing_window_margins_p)
3406 (adjust_frame_glyphs_for_frame_redisplay)
3407 (build_frame_matrix_from_leaf_window, make_current)
3408 (mirrored_line_dance, mirror_line_dance, update_frame)
3409 (update_window_tree, update_single_window)
3410 (check_current_matrix_flags, update_window, update_text_area)
3411 (update_window_line, set_window_update_flags, scrolling_window)
3412 (update_frame_1, scrolling, buffer_posn_from_coords)
3413 (do_pending_window_change, change_frame_size)
3414 (change_frame_size_1, sit_for):
3415 Use bool for boolean.
3416 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3417 and remove last int (actually boolean) argument, which was always 0.
3418 All callers changed.
3419 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3420 * dispextern.h (struct composition_it): Use bool for boolean.
3421 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3422 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3423 * dired.c (file_name_completion):
3424 Use bool for boolean. (This was missed in an earlier change.)
3425
3426 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3427
3428 * window.c (Fset_window_configuration): Revert first part of
3429 last change.
3430
3431 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3432
3433 * nsterm.h (NSPanel): New class variable dialog_return.
3434
3435 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3436 Initialize dialog_return.
3437 (windowShouldClose:): Use stop instead of stopModalWithCode.
3438 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3439 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3440 event.
3441 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3442 modal loop returns.
3443
3444 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3445
3446 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3447 * composite.c (find_composition, composition_gstring_p)
3448 (composition_reseat_it, find_automatic_composition):
3449 * data.c (let_shadows_buffer_binding_p)
3450 (let_shadows_global_binding_p, set_internal, make_blv)
3451 (Fmake_variable_buffer_local, Fmake_local_variable)
3452 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3453 (cons_to_signed, arith_driver):
3454 * dbusbind.c (xd_in_read_queued_messages):
3455 * dired.c (directory_files_internal, file_name_completion):
3456 Use bool for booleans.
3457 * dired.c (file_name_completion):
3458 * process.h (fd_callback):
3459 Omit int (actually boolean) argument. It wasn't being used.
3460 All uses changed.
3461 * composite.h, lisp.h: Reflect above API changes.
3462
3463 * cmds.c, coding.c: Use bool for booleans.
3464 * cmds.c (move_point, Fself_insert_command):
3465 * coding.h (struct composition status, struct coding_system):
3466 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3467 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3468 (emacs_mule_char, decode_coding_emacs_mule)
3469 (encode_coding_emacs_mule, detect_coding_iso_2022)
3470 (decode_coding_iso_2022, encode_invocation_designation)
3471 (encode_designation_at_bol, encode_coding_iso_2022)
3472 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3473 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3474 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3475 (encode_coding_raw_text, detect_coding_charset)
3476 (decode_coding_charset, encode_coding_charset, detect_eol)
3477 (detect_coding, get_translation_table, produce_chars)
3478 (consume_chars, reused_workbuf_in_use)
3479 (make_conversion_work_buffer, code_conversion_save)
3480 (decode_coding_object, encode_coding_object)
3481 (detect_coding_system, char_encodable_p)
3482 (Funencodable_char_position, code_convert_region)
3483 (code_convert_string, code_convert_string_norecord)
3484 (Fset_coding_system_priority):
3485 * fileio.c (Finsert_file_contents):
3486 Use bool for booleans.
3487 * coding.h, lisp.h: Reflect above API changes.
3488 * coding.c: Remove unnecessary static function decls.
3489 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3490 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3491 not a boolean 'int', since callers never look at the return value.
3492 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3493 * coding.h (decoding_buffer_size, encoding_buffer_size)
3494 (emacs_mule_string_char): Remove unused extern decls.
3495 (struct iso_2022_spec, struct coding_system):
3496 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3497 (struct emacs_mule_spec): Remove unused field 'full_support'.
3498 All initializations removed.
3499 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3500
3501 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3502
3503 Fix spare memory change (Bug#12286).
3504 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3505 (valid_lisp_object_p): Likewise.
3506
3507 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3508
3509 * window.c (Fset_window_configuration): Record any window's old
3510 buffer if it's replaced (see Bug#8789). If the new current
3511 buffer doesn't appear in the selected window, go to its old
3512 point (Bug#12208).
3513
3514 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3515
3516 Special MEM_TYPE_SPARE to denote reserved memory.
3517 * alloc.c (enum mem_type): New memory type.
3518 (refill_memory_reserve): Use new type for spare memory.
3519 This prevents live_cons_p and live_string_p from incorrect
3520 detection of uninitialized objects from spare memory as live.
3521
3522 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3523
3524 Spelling fixes.
3525 * Makefile.in (.PHONY): versioclean -> versionclean.
3526
3527 Remove unused external symbols.
3528 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3529 * window.c (Qwindow_valid_p, decode_valid_window):
3530 Now static, not extern.
3531 * data.c (Qinterval): Remove; unused.
3532 (syms_of_data): Do not define 'interval'.
3533 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3534 * window.h (decode_valid_window):
3535 Remove decls.
3536
3537 * character.c, charset.c, chartab.c: Use bool for booleans.
3538 * character.c (lisp_string_width, string_count_byte8)
3539 (string_escape_byte8):
3540 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3541 (load_charset_map_from_file, map_charset_chars)
3542 (Fdefine_charset_internal, define_charset_internal)
3543 (Fdeclare_equiv_charset, find_charsets_in_text)
3544 (Ffind_charset_region, char_charset, Fiso_charset):
3545 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3546 (sub_char_table_set, sub_char_table_set_range)
3547 (char_table_set_range, optimize_sub_char_table)
3548 (map_sub_char_table):
3549 Use bool for boolean.
3550 * character.c (str_to_unibyte): Omit last boolean argument; it was
3551 always 0. All callers changed.
3552 * character.h, charset.h: Adjust to match previous changes.
3553 * character.h (char_printable_p): Remove decl of nonexistent function.
3554 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3555 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3556 are all boolean, so make them single-bit bitfields.
3557
3558 * lisp.h (ASET): Remove attempt to detect side effects.
3559 It was meant to be temporary and it often doesn't work,
3560 because when IDX has side effects the behavior of IDX==IDX
3561 is undefined. See Stefan Monnier in
3562 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3563
3564 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3565
3566 * lisp.h (functionp): New function (extracted from Ffunctionp).
3567 (FUNCTIONP): Use it.
3568 * eval.c (Ffunctionp): Use it.
3569
3570 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3571
3572 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3573 as that's faster and simpler than static storage. Don't bother
3574 with the g_main_context_query overhead if g_main_context_pending
3575 says no events are pending.
3576 (gfds, gfds_size): Remove these static vars.
3577 (xgselect_initialize): Remove; no longer needed.
3578 All uses and decls removed.
3579
3580 * emacs.c (fatal_error_signal_hook): Remove.
3581 All uses removed. This leftover from old code was always 0.
3582
3583 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3584 * casefiddle.c (casify_object, casify_region):
3585 * casetab.c (set_case_table):
3586 * category.c, category.h (word_boundary_p):
3587 * category.h (CHAR_HAS_CATEGORY):
3588 Use bool for booleans, instead of int.
3589
3590 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3591
3592 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3593
3594 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3595
3596 On assertion failure, print backtrace if available.
3597 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3598 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3599 * Makefile.in (LIB_EXECINFO): New macro.
3600 (LIBES): Use it.
3601
3602 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3603 * bytecode.c (exec_byte_code):
3604 * callint.c (check_mark, Fcall_interactively):
3605 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3606 (getenv_internal, sync_process_alive, call_process_exited):
3607 * lisp.h (USE_SAFE_ALLOCA):
3608 Use bool for booleans, instead of int.
3609 * lisp.h, process.h: Adjust prototypes to match above changes.
3610 * callint.c (Fcall_interactively): Don't assume the mark's
3611 offset fits in 'int'.
3612
3613 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3614
3615 * buffer.c, buffer.h: Use bool for boolean.
3616 * buffer.c (reset_buffer_local_variables)
3617 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3618 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3619 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3620 (overlay_touches_p, overlay_strings, Foverlay_put)
3621 (report_overlay_modification, call_overlay_mod_hooks):
3622 (mmap_enlarge, mmap_set_vars):
3623 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3624 Use bool for booleans, instead of int.
3625 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3626 since the 1-or-0 return value is always ignored anyway.
3627 (mmap_initialized_p):
3628 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3629 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3630
3631 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3632
3633 * bidi.c: Use bool for boolean.
3634 This is a bit more readable, and makes the text segment of bidi.o
3635 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3636 Presumably it's faster too.
3637 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3638 Now bool.
3639 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3640 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3641 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3642 (bidi_explicit_dir_char, bidi_level_of_next_char)
3643 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3644 Use bool for booleans, instead of int.
3645 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3646 (bidi_unshelve_cache): Adjust decls to match code.
3647
3648 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3649
3650 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3651 argument.
3652
3653 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3654
3655 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3656 * atimer.h: Include <stdbool.h>.
3657
3658 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3659
3660 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3661 compile time tests instead of run time tests on systems that do
3662 not use them.
3663 (FRAME_MAC_P): Remove leftover from deleted code.
3664 * frame.c (syms_of_frame): Remove leftover from deleted code.
3665
3666 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3667
3668 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3669
3670 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3671
3672 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3673 Otherwise, the compiler complains about (A?B:C) where B is void
3674 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3675 (fontset_add): Return void, for FONTSET_ADD.
3676
3677 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3678
3679 * alloc.c: Use bool for booleans.
3680 (gc_in_progress, abort_on_gc)
3681 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3682 (dont_register_blocks) [GC_MALLOC_CHECK]:
3683 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3684 (check_string_bytes, make_specified_string, memory_full)
3685 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3686 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3687 (mark_stack, valid_pointer_p, make_pure_string)
3688 (Fgarbage_collect, survives_gc_p, gc_sweep):
3689 Use bool for booleans, instead of int.
3690 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3691 Remove unused local.
3692 * alloc.c (PURE_POINTER_P):
3693 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3694 * editfns.c (Fformat):
3695 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3696 (Fdo_auto_save):
3697 * fns.c (sweep_weak_table):
3698 * lisp.h (suppress_checking, push_message, survives_gc_p)
3699 (make_pure_string, gc_in_progress, abort_on_gc):
3700 * lread.c (readchar, read1):
3701 * print.c (Fprin1_to_string):
3702 * xdisp.c (push_message):
3703 Use bool for booleans affected directly or indirectly by
3704 alloc.c's changes.
3705
3706 Make recently-introduced setters macros.
3707 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3708 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3709 (set_fontset_default, set_fontset_fallback): Rename from their
3710 upper-case counterparts, and make them functions rather than macros.
3711 This is more consistent with the other recently-introduced setters.
3712 These don't need to be inline, since they're local.
3713
3714 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3715
3716 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3717 the loop (Bug#12247).
3718
3719 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3720
3721 * lisp.h (vcopy): Use memcpy rather than our own loop.
3722 This fixes a performance regression introduced by the recent
3723 addition of vcopy. This means 'vcopy' will need to be modified
3724 for a copying collector, but that's OK. Also, tighten the
3725 checking in the assertion.
3726
3727 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3728
3729 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3730 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3731 non-base glyph for the width of the base character, according to
3732 what x_draw_composite_glyph_string_foreground expects.
3733 Generate WADJUST value according to composition_gstring_width's
3734 expectations, to produce correct width of the composed character.
3735 Reverse the sign of the DU offset produced by ScriptPlace.
3736
3737 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3738
3739 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3740
3741 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3742
3743 Avoid direct writes to contents member of struct Lisp_Vector.
3744 * lisp.h (vcopy): New function to copy data into vector.
3745 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3746 * fns.c (Ffillarray): Use ASET.
3747 * keyboard.c (timer_check_2): Use AREF and ASET.
3748 (append_tool_bar_item, Frecent_keys): Use vcopy.
3749 * lread.c (read_vector): Use ASET.
3750 * msdos.c (Frecent_doskeys): Use vcopy.
3751 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3752 (Finternal_merge_in_global_face): Use ASET and vcopy.
3753 * xfont.c (xfont_list_pattern): Likewise.
3754
3755 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3756
3757 * window.c (Fwindow_point): For the selected window always return
3758 the position of its buffer's point.
3759 (Fset_window_point): For the selected window always go in its
3760 buffer to the specified position.
3761
3762 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3763
3764 Setter macros for fontsets.
3765 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3766 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3767 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3768 Adjust users.
3769
3770 2012-08-20 Glenn Morris <rgm@gnu.org>
3771
3772 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3773 Don't assume that `ln -f' works.
3774
3775 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3776
3777 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3778 and later about non-assignments with no effect. See discussion at
3779 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3780 details.
3781
3782 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3783
3784 Inline setter functions for Lisp_Objects slots of struct specbinding.
3785 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3786 Adjust users.
3787
3788 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3789
3790 * window.c (select_window): Always make selected window's buffer
3791 current.
3792
3793 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3794
3795 Use AREF and ASET for docstrings of category tables.
3796 * category.h (CATEGORY_DOCSTRING): Use AREF.
3797 (SET_CATEGORY_DOCSTRING): Use ASET.
3798 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3799
3800 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3801
3802 Inline setter functions for hash table members.
3803 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3804 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3805 (set_hash_key_and_value, set_hash_index, set_hash_next)
3806 (set_hash_hash): New functions.
3807 * charset.c, fns.c: Adjust users.
3808
3809 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3810
3811 Inline getter and setter functions for per-buffer values.
3812 * buffer.h (per_buffer_default, set_per_buffer_default)
3813 (per_buffer_value, set_per_buffer_value): New functions.
3814 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3815 * buffer.c, data.c: Adjust users.
3816
3817 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3818
3819 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3820
3821 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3822
3823 Rely on <config.h> + <unistd.h> to declare 'environ',
3824 as gnulib does this if the system doesn't.
3825 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3826 Remove declaration. MS-Windows declares it on stdlib.h which is
3827 included by conf_post.h.
3828 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3829 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3830 * vm-limit.c: Include <unistd.h>, for 'environ'.
3831
3832 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3833 (start_of_data): Remove decl; mem-limits.h provides it.
3834
3835 * xdisp.c (handle_invisible_prop): Make it a bit faster
3836 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3837
3838 2012-08-19 Chong Yidong <cyd@gnu.org>
3839
3840 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3841 ends (Bug#3874).
3842
3843 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3844
3845 * .gdbinit: Use call instead of set when calling a function in the
3846 inferior.
3847
3848 * data.c (set_internal): Don't use set_blv_found.
3849 (Fkill_local_variable): Likewise.
3850
3851 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3852
3853 * nsfont.m (ns_ascii_average_width): Ensure the string
3854 ascii_printable is initialized with a null-terminated character
3855 array. Otherwise, it can contain undesired extra characters.
3856
3857 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3858
3859 port new setting code to Sun C 5.8 2005/10/13
3860 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3861 Return void, not Lisp_Object. Otherwise, the compiler
3862 complains about (A?B:C) where B is void and C is Lisp_Object
3863 when compiling CHAR_TABLE_SET, due to the recent change to
3864 the API of sub_char_table_set_contents.
3865
3866 2012-08-18 Chong Yidong <cyd@gnu.org>
3867
3868 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3869 for the string case (Bug#3874).
3870
3871 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3872
3873 * buffer.h (BSET): Remove (Bug#12215).
3874 Replace all uses with calls to new setter functions.
3875 (bset_bidi_paragraph_direction, bset_case_canon_table)
3876 (bset_case_eqv_table, bset_directory, bset_display_count)
3877 (bset_display_time, bset_downcase_table)
3878 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3879 (bset_last_selected_window, bset_local_var_alist)
3880 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3881 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3882 (bset_width_table):
3883 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3884 (bset_auto_fill_function, bset_auto_save_file_format)
3885 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3886 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3887 (bset_cache_long_line_scans, bset_case_fold_search)
3888 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3889 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3890 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3891 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3892 (bset_header_line_format, bset_indicate_buffer_boundaries)
3893 (bset_indicate_empty_lines, bset_invisibility_spec)
3894 (bset_left_fringe_width, bset_major_mode, bset_mark)
3895 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3896 (bset_name, bset_overwrite_mode, bset_pt_marker)
3897 (bset_right_fringe_width, bset_save_length)
3898 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3899 (bset_scroll_up_aggressively, bset_selective_display)
3900 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3901 (bset_word_wrap, bset_zv_marker):
3902 * category.c (bset_category_table):
3903 * syntax.c (bset_syntax_table):
3904 New setter functions.
3905
3906 * process.h (PSET): Remove (Bug#12215).
3907 Replace all uses with calls to new setter functions.
3908 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3909 (PROCESS_INLINE): New macro.
3910 (pset_childp): New setter function.
3911 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3912 * process.c (PROCESS_INLINE):
3913 Define to EXTERN_INLINE, so that the corresponding functions
3914 are compiled into code.
3915 (pset_buffer, pset_command, pset_decode_coding_system)
3916 (pset_decoding_buf, pset_encode_coding_system)
3917 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3918 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3919 (pset_type, pset_write_queue): New setter functions.
3920
3921 * window.h (WSET): Remove (Bug#12215).
3922 Replace all uses with calls to new setter functions.
3923 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3924 (WINDOW_INLINE): New macro.
3925 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3926 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3927 (wset_total_lines, wset_vertical_scroll_bar)
3928 (wset_window_end_pos, wset_window_end_valid)
3929 (wset_window_end_vpos): New setter functions.
3930 * window.c (WINDOW_INLINE):
3931 Define to EXTERN_INLINE, so that the corresponding functions
3932 are compiled into code.
3933 (wset_combination_limit, wset_dedicated, wset_display_table)
3934 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3935 (wset_new_normal, wset_new_total, wset_next_buffers)
3936 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3937 (wset_prev_buffers, wset_right_fringe_width)
3938 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3939 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3940 (wset_window_parameters):
3941 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3942 (wset_column_number_displayed, wset_region_showing):
3943 New setter functions.
3944
3945 * termhooks.h (TSET): Remove (Bug#12215).
3946 Replace all uses with calls to new setter functions.
3947 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3948 (TERMHOOKS_INLINE): New macro.
3949 (tset_charset_list, tset_selection_alist): New setter functions.
3950 * terminal.c (TERMHOOKS_INLINE):
3951 Define to EXTERN_INLINE, so that the corresponding functions
3952 are compiled into code.
3953 (tset_param_alist): New setter function.
3954
3955 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3956
3957 * keyboard.h (KSET): Remove (Bug#12215).
3958 Replace all uses with calls to new setter functions.
3959 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3960 (KEYBOARD_INLINE): New macro.
3961 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3962 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3963 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3964 New setter functions.
3965 * keyboard.c (KEYBOARD_INLINE):
3966 Define to EXTERN_INLINE, so that the corresponding functions
3967 are compiled into code.
3968 (kset_echo_string, kset_kbd_queue)
3969 (kset_keyboard_translate_table, kset_last_prefix_arg)
3970 (kset_last_repeatable_command, kset_local_function_key_map)
3971 (kset_overriding_terminal_local_map, kset_real_last_command)
3972 (kset_system_key_syms): New setter functions.
3973
3974 * frame.h (FSET): Remove (Bug#12215).
3975 Replace all uses with calls to new setter functions.
3976 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3977 (FRAME_INLINE): New macro.
3978 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3979 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3980 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3981 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3982 (fset_param_alist, fset_root_window, fset_scroll_bars)
3983 (fset_selected_window, fset_title, fset_tool_bar_items)
3984 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3985 * frame.c (FRAME_INLINE):
3986 Define to EXTERN_INLINE, so that the corresponding functions
3987 are compiled into code.
3988 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3989
3990 A few more naming-convention fixes for getters and setters.
3991 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3992 and rename from buffer_overlays_set_before.
3993 (set_buffer_overlays_after): Move here from buffer.h, and rename
3994 from buffer_overlays_set_after.
3995 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3996 All uses changed.
3997 (set_buffer_intervals): Rename from buffer_set_intervals.
3998 * intervals.c (set_interval_object): Move here from intervals.h,
3999 and rename from interval_set_object.
4000 (set_interval_left): Move here from intervals.h, and rename from
4001 interval_set_left.
4002 (set_interval_right): Move here from intervals.h, and rename from
4003 interval_set_right.
4004 (copy_interval_parent): Move here from intervals.h, and rename from
4005 interval_copy_parent.
4006 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4007 (set_interval_plist): Rename from interval_set_plist.
4008 Return void, not Lisp_Object, since no caller uses the result.
4009 * lisp.h (string_intervals): Rename from string_get_intervals.
4010 (set_string_intervals): Rename from string_set_intervals.
4011
4012 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4013 (set_char_table_contents): Rename from char_table_set_contents.
4014 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4015 All uses changed. See the end of
4016 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4017
4018 * lisp.h (CSET): Remove (Bug#12215).
4019 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4020 (set_char_table_purpose): New functions,
4021 replacing CSET. All uses changed. For example, replace
4022 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4023 "set_char_table_parent (char_table, parent);".
4024 The old version was confusing because it used the same name
4025 'parent' for two different things.
4026
4027 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4028
4029 Functions to get and set Lisp_Object fields of buffer-local variables.
4030 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4031 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4032 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4033 * data.c, eval.c, frame.c: Adjust users.
4034
4035 2012-08-17 Chong Yidong <cyd@gnu.org>
4036
4037 * xfaces.c (merge_face_vectors): If the target font specfies a
4038 font spec, make the font's attributes take precedence over
4039 directly-specified attributes.
4040 (merge_face_ref): Recognize :font.
4041
4042 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4043
4044 Do not use memcpy for copying intervals.
4045 * intervals.c (reproduce_interval): New function.
4046 (reproduce_tree, reproduce_tree_obj): Use it.
4047 (reproduce_tree_obj): Remove prototype.
4048
4049 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4050
4051 * lisp.h (duration_to_sec_usec): Remove unused decl.
4052
4053 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4054
4055 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4056 to an allocated instance of NSString, not to the class itself.
4057
4058 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4059
4060 * makefile.w32-in (C_CTYPE_H): New macro.
4061 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4062 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4063 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4064
4065 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4066
4067 Use ASCII tests for character types.
4068 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4069 * xfns.c, xterm.c:
4070 Don't include <ctype.h>; was not needed.
4071 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4072 * sysdep.c, xfaces.c:
4073 Include <c-ctype.h> instead of <ctype.h>.
4074 * nsterm.m: Include <c-ctype.h>.
4075 * charset.c (read_hex):
4076 * doc.c (Fsnarf_documentation):
4077 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4078 (DRIVE_LETTER) [DOS_NT]:
4079 (Ffile_name_directory, Fexpand_file_name)
4080 (Fsubstitute_in_file_name):
4081 * font.c (font_parse_xlfd, font_parse_fcname):
4082 * frame.c (x_set_font_backend):
4083 * gtkutil.c (xg_get_font):
4084 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4085 * nsimage.m (hexchar):
4086 * nsterm.m (ns_xlfd_to_fontname):
4087 * sysdep.c (system_process_attributes):
4088 * xfaces.c (hash_string_case_insensitive):
4089 Use C-locale tests instead of locale-specific tests for character
4090 types, since we want the ASCII interpretation here, not the
4091 interpretation suitable for whatever happens to be the current locale.
4092
4093 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4094
4095 Consistently check windows for validity/liveness
4096 (Bug#11984, Bug#12025, Bug#12026).
4097 * lisp.h (CHECK_VALID_WINDOW): New macro.
4098 * window.c (decode_window): Rename to decode_live_window.
4099 (decode_valid_window, Fwindow_valid_p): New functions.
4100 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4101 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4102 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4103 (Fwindow_prev_sibling, Fwindow_combination_limit)
4104 (Fset_window_combination_limit, Fwindow_use_time)
4105 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4106 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4107 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4108 (Fwindow_hscroll, Fset_window_hscroll)
4109 (Fwindow_redisplay_end_trigger)
4110 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4111 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4112 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4113 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4114 (Fwindow_end, Fset_window_point, Fset_window_start)
4115 (Fpos_visible_in_window_p, Fwindow_line_height)
4116 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4117 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4118 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4119 (Fset_window_parameter, Fwindow_display_table)
4120 (Fset_window_display_table, Fdelete_other_windows_internal)
4121 (Fset_window_buffer, Fset_window_new_total)
4122 (Fset_window_new_normal, Fdelete_window_internal)
4123 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4124 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4125 (Fwindow_scroll_bars): Check whether argument window is a valid or
4126 live window. Update doc-strings.
4127 (syms_of_window): New symbol Qwindow_valid_p.
4128 * keyboard.c (Fposn_at_x_y): Check whether argument
4129 frame_or_window denotes a valid window.
4130
4131 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4132
4133 Fix previous char table change.
4134 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4135 * chartab.c (optimize_sub_char_table): Likewise.
4136
4137 2012-08-16 Chong Yidong <cyd@gnu.org>
4138
4139 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4140
4141 * xfont.c (xfont_open):
4142 * xftfont.c (xftfont_open): Set the font's max_width field.
4143
4144 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4145 min_width to space_width and average_width to the average over
4146 printable ASCII characters.
4147 (ns_char_width): Code cleanup.
4148 (ns_ascii_average_width): New utility function.
4149
4150 * font.h (struct font): Update comments.
4151
4152 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4153
4154 Simple interface to set Lisp_Object fields of character tables.
4155 * lisp.h (CSET): New macro.
4156 (char_table_set_extras, char_table_set_contents)
4157 (sub_char_table_set_contents): New function.
4158 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4159 * syntax.c: Adjust users.
4160
4161 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4162
4163 * eval.c (eval_sub): Bind lexical-binding.
4164 * lread.c (Qlexical_binding): Make non-static.
4165
4166 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4167
4168 * nsmenu.m (popupSession): Remove.
4169 (pop_down_menu): Remove endModalSession.
4170 (timeout_handler:): New method.
4171 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4172 Call runModalForWindow. Check timer_fired when it returns.
4173 If not set, cancel timer and break out of loop.
4174 Otherwise loop again, with a new timeout.
4175
4176 * nsterm.m: Include fcntl.h if present.
4177 (fd_entry, t_readfds, inNsSelect): Remove.
4178 (select_writefds, select_valid, select_timeout, selfds)
4179 (select_mutex, apploopnr): Add.
4180 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4181 Otherwise call kbd_buffer_store_event.
4182 (ns_send_appdefined): Remove release of fd_entry.
4183 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4184 Increment and decrement apploopnr.
4185 (ns_select): If no file descriptors, just do a NSTimer.
4186 Otherwise copy read/write masks and start select thread (fd_handler).
4187 Start main loop and wait for application defined event.
4188 Inform select thread to stop selecting after main loop is exited.
4189 (ns_term_init): Create selfds pipe and set non-blocking.
4190 Initialize select_mutex. Start the select thread (fd_handler).
4191 (fd_handler:): Loop forever, wait for info from the main thread
4192 to either start or stop selecting. When select returns, send
4193 and appdefined event.
4194 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4195 If not call kbd_buffer_store_event.
4196
4197 * nsterm.h (EmacsApp): fd_handler takes id argument.
4198 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4199
4200 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4201
4202 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4203
4204 * region-cache.c (move_cache_gap): Update gap_len using the actual
4205 growth of the boundaries array. Do not change cache_len.
4206 (Bug#12196)
4207
4208 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4209
4210 Generalize and cleanup font subsystem checks.
4211 * font.h (FONT_DEBUG, font_assert): Remove.
4212 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4213 Change font_assert to eassert. Use eassert where appropriate.
4214
4215 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4216
4217 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4218
4219 2012-08-15 Chong Yidong <cyd@gnu.org>
4220
4221 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4222 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4223 extract the font descriptor instead of just the font name.
4224 In that case, return a font spec instead of a string.
4225 (x_last_font_name): Move to this file from xfns.c.
4226
4227 * xfns.c (Fx_select_font): The return value can also be a font
4228 spec. Move x_last_font_name management to gtkutil.c.
4229
4230 * xfaces.c: Make font weight and style symbols non-static.
4231
4232 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4233
4234 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4235 (bug#12117).
4236
4237 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4238
4239 * alloc.c (Fgarbage_collect): Use plural form consistently.
4240
4241 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4242
4243 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4244 iteration through the command loop. Fixes a problem whereby mouse
4245 movements are ignored until the first mouse click.
4246
4247 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4248
4249 Use bool, not int, for Lisp booleans.
4250 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4251 makes Emacs a bit smaller and presumably a bit faster.
4252 * lisp.h: Include <stdbool.h>.
4253 (struct Lisp_Boolfwd, defvar_bool):
4254 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4255 * regex.c [!emacs]: Include <stdbool.h>.
4256 (false, true): Remove; <stdbool.h> does this for us now.
4257
4258 2012-08-14 Chong Yidong <cyd@gnu.org>
4259
4260 * character.c (Fcharacterp): Doc fix (Bug#12076).
4261
4262 * data.c (Findirect_variable): Doc fix (Bug#11040).
4263
4264 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4265
4266 * editfns.c (Fformat): Doc fix (Bug#12059).
4267 (Fsave_current_buffer): Doc fix (Bug#11542).
4268
4269 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4270
4271 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4272 (bug#12022).
4273
4274 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4275
4276 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4277 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4278 * minibuf.c (choose_minibuf_frame, read_minibuf):
4279 * w32fns.c (x_create_tip_frame):
4280 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4281 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4282
4283 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4284
4285 * intervals.c (offset_intervals): Remove obsolete comment.
4286
4287 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4288
4289 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4290
4291 2012-08-14 Gergely Risko <gergely@risko.hu>
4292
4293 * coding.c (decode_coding): Record buffer modification before
4294 disabling undo_list (Bug#11773).
4295
4296 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4297
4298 Revert and cleanup some recent overlay changes.
4299 * buffer.h (enum overlay_type): Remove.
4300 (buffer_get_overlays, buffer_set_overlays): Likewise.
4301 (buffer_set_overlays_before, buffer_set_overlays_after):
4302 New function. Adjust users.
4303 (unchain_both): Add eassert.
4304
4305 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4306
4307 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4308
4309 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4310
4311 * gtkutil.c (xg_mark_data): Don't assume C99.
4312
4313 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4314
4315 * gtkutil.c (xg_frame_tb_info): New struct.
4316 (TB_INFO_KEY): New define.
4317 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4318 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4319 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4320 if not present.
4321 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4322 is up to date. Otherwise store new data.
4323 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4324
4325 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4326
4327 Use KSET for write access to Lisp_Object members of struct kboard.
4328 * keyboard.h (KSET): New macro.
4329 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4330 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4331 * xterm.c: Adjust users.
4332
4333 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4334
4335 Use BSET for write access to Lisp_Object members of struct buffer.
4336 * buffer.h (BSET): New macro.
4337 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4338 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4339 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4340 * window.c, xdisp.c, xfns.c: Adjust users.
4341
4342 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4343
4344 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4345
4346 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4347
4348 * nsterm.m (not_in_argv): New function.
4349 (application:openFile, application:openTempFile:):
4350 (application:openFileWithoutUI:, application:openFiles:): Open file
4351 if not_in_argv returns non-zero (bug#12171).
4352
4353 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4354 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4355 Define for Gtk+ versions less than 3.2.
4356 (xg_get_font_name): Use those functions/macros here.
4357 Reported by Frans Oilinki <moilinki@gmail.com>.
4358
4359 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4360
4361 * unexmacosx.c (copy_data_segment): Copy initialized data in
4362 statically linked libraries from input file rather than memory.
4363
4364 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4365 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4366 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4367
4368 2012-08-10 Glenn Morris <rgm@gnu.org>
4369
4370 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4371 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4372
4373 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4374
4375 Fix last change to allow compilation with low optimization levels.
4376 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4377 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4378
4379 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4380
4381 Use common inline syntax in intervals.h.
4382 * intervals.h (INTERVALS_INLINE): New macro.
4383 Change all users from LISP_INLINE.
4384
4385 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4386
4387 Define Qnone once for all platforms.
4388 * frame.c (Qnone): Define here.
4389 (syms_of_frame): DEFSYM it.
4390 * lisp.h (Qnone): New declaration.
4391 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4392 * xfns.c: Remove duplication. Adjust users.
4393
4394 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4395
4396 Remove unused macros from intervals.h.
4397 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4398 * intervals.c: Adjust comment.
4399
4400 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4401
4402 * w32fns.c <w32_unicode_gui>: New static variable.
4403 (globals_of_w32fns): Initialize it according to os_subtype.
4404 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4405 testing os_subtype.
4406
4407 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4408 Eli Zaretskii <eliz@gnu.org>
4409
4410 Fix bug #10299 with Unicode characters sent by customized
4411 keyboards created by MSKLC.
4412 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4413 (w32_init_class): Use it to initialize the Emacs class with either
4414 ANSI or Unicode API calls.
4415 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4416 later.
4417 (w32_wnd_proc): If the character code sent by WM_CHAR or
4418 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4419 original message. Call DefWindowProcW on NT and later.
4420
4421 2012-08-10 Glenn Morris <rgm@gnu.org>
4422
4423 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4424
4425 * lisp.h (DIRECTORY_SEP): Let configure set it.
4426
4427 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4428
4429 Use TSET for write access to Lisp_Object slots of struct terminal.
4430 * termhooks.h (TSET): New macro.
4431 * coding.c, terminal.c, xselect.c: Adjust users.
4432
4433 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4434
4435 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4436 the failing expression, include them in the error message.
4437 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4438 * lisp.h (internal_condition_case_n): Update declaration.
4439
4440 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4441
4442 Inline functions to examine and change buffer overlays.
4443 * buffer.c (unchain_both): New function.
4444 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4445 (buffer_has_overlays): New function.
4446 (enum overlay_type): New enum.
4447 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4448 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4449
4450 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4451
4452 Inline functions to examine and change buffer intervals.
4453 * alloc.c (mark_interval_tree): Remove.
4454 (MARK_INTERVAL_TREE): Simplify.
4455 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4456 * intervals.c (buffer_balance_intervals): New function.
4457 (graft_intervals_into_buffer): Adjust indentation.
4458 (set_intervals_multibyte): Simplify.
4459 * buffer.h (BUF_INTERVALS): Remove.
4460 (buffer_get_intervals, buffer_set_intervals): New function.
4461 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4462 * intervals.c, textprop.c: Adjust users.
4463
4464 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4465
4466 Inline functions to examine and change string intervals.
4467 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4468 (string_get_intervals, string_set_intervals): New function.
4469 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4470 * lread.c, print.c, textprop.c: Adjust users.
4471
4472 2012-08-08 Glenn Morris <rgm@gnu.org>
4473
4474 * lisp.mk (lisp): Remove language/persian.elc.
4475
4476 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4477
4478 Cleanup intervals.
4479 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4480 (NULL_INTERVAL_P): Likewise. Adjust users.
4481 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4482 Adjust comment. Move under #if 0.
4483 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4484 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4485
4486 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4487
4488 Check total length of intervals with eassert.
4489 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4490 * intervals.c: Change all users to eassert.
4491
4492 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4493
4494 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4495 Rename fields to match removal of FGET and WGET and disuse of
4496 INTERNAL_FIELD in Lisp_Cons.
4497
4498 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4499
4500 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4501 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4502 name since all xname users are fixed long time ago. Do not
4503 use INTERNAL_FIELD.
4504 (set_symbol_name, set_symbol_function, set_symbol_plist):
4505 (set_symbol_next, set_overlay_plist): New function.
4506 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4507 (struct Lisp_Overlay): Likewise.
4508 (CVAR, MVAR, SVAR): Remove.
4509 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4510 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4511 * xterm.c: Adjust users.
4512 * .gdbinit: Change to use name field of struct Lisp_Symbol
4513 where appropriate.
4514
4515 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4516
4517 Basic functions to set Lisp_Object and pointer slots of intervals.
4518 * intervals.h (interval_set_parent, interval_set_object):
4519 (interval_set_left, interval_set_right, interval_set_plist):
4520 (interval_copy_parent): New function.
4521 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4522 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4523 Adjust indentation.
4524 (INTERVAL_SIZE): Remove. Adjust users.
4525 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4526
4527 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4528
4529 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4530 * process.h (PGET): Remove.
4531 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4532 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4533
4534 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4535
4536 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4537 * window.h (WGET): Remove.
4538 (struct window): Do not use INTERNAL_FIELD.
4539 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4540 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4541 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4542 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4543 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4544 Adjust users.
4545
4546 2012-08-07 Chong Yidong <cyd@gnu.org>
4547
4548 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4549 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4550 (Fdelete_window_internal): Signal an error if the window is not on
4551 a live frame (Bug#12025).
4552
4553 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4554
4555 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4556 * frame.h (FGET): Remove.
4557 (struct frame): Do not use INTERNAL_FIELD.
4558 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4559 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4560 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4561 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4562
4563 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4564
4565 * w32.c: Silence compiler warnings.
4566 (map_w32_filename): Remove unused variable `is_fat'.
4567 (chase_symlinks): Add parentheses around expression.
4568
4569 2012-08-06 Glenn Morris <rgm@gnu.org>
4570
4571 * sysdep.c: Respect BROKEN_GETWD.
4572
4573 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4574 Let configure handle it.
4575 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4576
4577 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4578
4579 Use GCALIGNMENT where appropriate.
4580 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4581 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4582 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4583
4584 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4585
4586 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4587 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4588
4589 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4590
4591 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4592 that should be sufficient for everyone.
4593
4594 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4595
4596 * keyboard.c (timer_check_2): Add break so timer_check returns next
4597 timeout.
4598
4599 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4600
4601 Fix Windows build errors introduced after converting to WGET and WSET.
4602 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4603 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4604
4605 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4606
4607 * nsterm.m (ns_frame_rehighlight): Use FSET.
4608
4609 * nsmenu.m (ns_update_menubar): Use FSET.
4610
4611 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4612
4613 Separate read and write access to Lisp_Object slots of Lisp_Process.
4614 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4615 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4616
4617 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4618
4619 Separate read and write access to Lisp_Object slots of struct window.
4620 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4621 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4622 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4623 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4624 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4625 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4626 Adjust users.
4627
4628 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4629
4630 Fix Windows build errors introduced after converting to FGET and FSET.
4631 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4632 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4633 (w32_judge_scroll_bars): Change to use FSET.
4634 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4635
4636 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4637
4638 Fix replacement typo.
4639 * window.c (replace_window): Set root_window instead of
4640 selected_window. This fixes a total window subsystem
4641 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4642
4643 2012-08-06 Glenn Morris <rgm@gnu.org>
4644
4645 * lisp.mk (lisp): Add language/persian.elc.
4646
4647 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4648
4649 Separate read and write access to Lisp_Object slots of struct frame.
4650 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4651 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4652 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4653 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4654 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4655
4656 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4657
4658 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4659
4660 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4661
4662 Generalize common compile-time constants.
4663 * lisp.h (header_size, bool_header_size, word_size): Now here.
4664 (struct Lisp_Vector): Add comment.
4665 (struct Lisp_Bool_Vector): Move up to define handy constants.
4666 (VECSIZE, PSEUDOVECSIZE): Simplify.
4667 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4668 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4669 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4670 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4671 * xfont.c, xmenu.c: Use word_size where appropriate.
4672
4673 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4674
4675 * search.c (Freplace_match): Treat \? in the replacement text
4676 literally (Bug#8161).
4677
4678 2012-08-05 Chong Yidong <cyd@gnu.org>
4679
4680 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4681 * frame.c (Vdelete_frame_functions):
4682 * emacs.c (Vkill_emacs_hook): Doc fix.
4683
4684 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4685
4686 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4687 --with-x-toolkit=no builds.
4688 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4689
4690 2012-08-04 Chong Yidong <cyd@gnu.org>
4691
4692 * syntax.c (Fmodify_syntax_entry): Doc fix.
4693
4694 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4695
4696 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4697 * w32.c (init_environment): Change the default values of many
4698 environment variables in dflt_envvars[] to NULL, to avoid pushing
4699 them into environment when they were not already defined.
4700 Remove the code that deletes site-lisp subdirectories from the default
4701 value of EMACSLOADPATH, as it is no longer needed.
4702 (check_windows_init_file): Now external, not static.
4703 Use Vload_path as is, without adding anything, as this function is now
4704 called when Vload_path is already set up.
4705
4706 * w32.h (check_windows_init_file): Add prototype.
4707
4708 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4709 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4710 compatibility with Posix platforms.
4711 (main): Move the call to check_windows_init_file to here from
4712 w32.c.
4713 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4714 any, in the DEFALT argument into the root of the Emacs build or
4715 installation tree, as appropriate.
4716
4717 * callproc.c (init_callproc_1): Call decode_env_path instead of
4718 doing its equivalent by hand.
4719 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4720 the code that sets Vexec_path run on MS-Windows.
4721
4722 * lread.c (init_lread): Add comments to #ifdef's.
4723
4724 * msdos.c (dos_set_window_size, IT_update_begin)
4725 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4726 instead of direct references.
4727
4728 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4729
4730 Export DEFAULT_REHASH_* to GDB.
4731 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4732 Now constants, not macros.
4733
4734 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4735
4736 Remove unnecessary casts involving pointers.
4737 These casts are no longer needed now that we assume C89 or later,
4738 since they involve casting to or from void *.
4739 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4740 (make_pure_float, make_pure_vector):
4741 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4742 * macros.c (Fstart_kbd_macro):
4743 * menu.c (find_and_return_menu_selection):
4744 * minibuf.c (read_minibuf_noninteractive):
4745 * sysdep.c (closedir):
4746 * xdisp.c (x_produce_glyphs):
4747 * xfaces.c (compare_fonts_by_sort_order):
4748 * xfns.c (x_real_positions, select_visual):
4749 * xselect.c (x_stop_queuing_selection_requests)
4750 (x_get_window_property, x_get_window_property_as_lisp_data):
4751 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4752 Remove unnecessary pointer casts.
4753 * alloc.c (record_xmalloc): New function.
4754 * lisp.h (record_xmalloc): New decl.
4755 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4756 more like a function. This is because the pointer cast is not
4757 needed. All uses changed.
4758 * print.c (print_string, print_error_message): Avoid length recalc.
4759
4760 Improve fix for macroexp crash with debugging (Bug#12118).
4761 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4762 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4763 not supposed to be invoked from the garbage collector.
4764 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4765 (gc_aset): New function, which is like ASET but can be
4766 used in the garbage collector.
4767 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4768 (set_hash_index): Use it instead of ASET.
4769
4770 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4771
4772 Support symlinks on latest versions of MS-Windows.
4773 * w32.c: Include winioctl.h and aclapi.h.
4774 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4775 (revert_to_self): Forward declarations of static functions.
4776 <static BOOL g_b_init_get_security_info>:
4777 <g_b_init_create_symbolic_link>: New static flags.
4778 (globals_of_w32): Initialize them to zero.
4779 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4780 (map_w32_filename): Improve commentary. Simplify switch.
4781 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4782 headers (most versions of MinGW w32api don't).
4783 (get_security_info, create_symbolic_link)
4784 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4785 New functions.
4786 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4787 in the argument file name.
4788 (sys_access): Call unc_volume_file_attributes only if
4789 GetFileAttributes fails with network-related error codes.
4790 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4791 have the required privileges.
4792 (get_file_security_desc_by_name): Rename from
4793 get_file_security_desc.
4794 (stat_worker): New function, with most of the guts of 'stat', and
4795 with addition of handling of symlinks and support for 'lstat'.
4796 If possible, get file's attributes and security information by
4797 handle, not by name. Produce S_IFLNK bit for symlinks, when
4798 called from 'lstat'.
4799 (stat, lstat): New functions, call 'stat_worker'.
4800 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4801 symlinks when the underlying filesystem supports them.
4802
4803 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4804
4805 Fix macroexp crash on Windows with debugging (Bug#12118).
4806 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4807 checking subscripts; problem introduced with the recent
4808 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4809 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4810 since it's used in non-static inline functions now.
4811
4812 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4813 Don't assume buffer size fits in 'int'. Remove unused local.
4814
4815 Use C99-style 'extern inline' if available.
4816 * buffer.h (BUFFER_INLINE):
4817 * category.h (CATEGORY_INLINE):
4818 * character.h (CHARACTER_INLINE):
4819 * charset.h (CHARSET_INLINE):
4820 * composite.h (COMPOSITE_INLINE):
4821 * dispextern.h (DISPEXTERN_INLINE):
4822 * lisp.h (LISP_INLINE):
4823 * systime.h (SYSTIME_INLINE):
4824 New macro, replacing 'static inline' in this header.
4825 * buffer.h, category.h, character.h, charset.h, composite.h:
4826 * dispextern.h, lisp.h, systime.h:
4827 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4828 * alloc.c (LISP_INLINE):
4829 * buffer.c (BUFFER_INLINE):
4830 * category.c (CATEGORY_INLINE):
4831 * character.c (CHARACTER_INLINE):
4832 * charset.c (CHARSET_INLINE):
4833 * composite.c (COMPOSITE_INLINE):
4834 * dispnew.c (DISPEXTERN_INLINE):
4835 * sysdep.c (SYSTIME_INLINE):
4836 Define to EXTERN_INLINE, so that the corresponding functions
4837 are compiled into code.
4838 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4839 (INLINE_HEADER_END): New macros.
4840 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4841 since it's used in non-static inline functions now.
4842 (VALMASK) [!USE_LSB_TAG]: Likewise.
4843
4844 2012-08-02 Glenn Morris <rgm@gnu.org>
4845
4846 * s/: Remove empty directory.
4847
4848 * s/ms-w32.h: Move to ../nt/inc.
4849 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4850 Update for new ms-w32.h location.
4851
4852 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4853
4854 Port to Solaris 8.
4855 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4856
4857 2012-08-02 Glenn Morris <rgm@gnu.org>
4858
4859 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4860 hard-coding the path separator.
4861
4862 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4863
4864 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4865 This how ASET and AREF are supposed to work, and makes
4866 it easier to think about future improvements. See
4867 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4868 * charset.h (set_charset_attr): New function.
4869 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4870 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4871 (aref_addr): New function. All uses of &AREF(...) changed.
4872 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4873 (set_hash_index): New functions. All lvalue-style uses of
4874 HASH_KEY etc. changed.
4875 * keyboard.c (set_prop): New function. All lvalue-style uses
4876 of PROP changed.
4877
4878 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4879
4880 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4881 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4882 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4883 * nsfns.m (ns_set_name_as_filename): Likewise.
4884 * nsmenu.m (ns_update_menubar): Likewise.
4885 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4886
4887 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4888
4889 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4890 Adapt to latest changes in field names of the corresponding Lisp
4891 objects.
4892
4893 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4894
4895 2012-08-01 Glenn Morris <rgm@gnu.org>
4896
4897 * s/msdos.h: Remove file.
4898 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4899 * Makefile.in (S_FILE): Remove.
4900 (config_h): Remove S_FILE.
4901
4902 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4903
4904 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4905 Remove; moved to nt/config.nt.
4906
4907 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4908
4909 Use INTERNAL_FIELD for conses and overlays.
4910 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4911 Remove obsolete comment.
4912 (MVAR): New macro.
4913 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4914 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4915
4916 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4917
4918 Use INTERNAL_FIELD for symbols.
4919 * lisp.h (SVAR): New macro. Adjust users.
4920 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4921 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4922
4923 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4924
4925 Use INTERNAL_FIELD for processes.
4926 * process.h (PVAR): New macro. Adjust style.
4927 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4928 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4929
4930 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4931
4932 Use INTERNAL_FIELD for windows.
4933 * window.h (WVAR): New macro.
4934 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4935 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4936 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4937 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4938 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4939 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4940
4941 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4942
4943 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4944
4945 2012-08-01 Glenn Morris <rgm@gnu.org>
4946
4947 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4948 Move to configure.ac.
4949
4950 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4951
4952 * makefile.w32-in (CONFIG_H): Update dependencies.
4953 (CONF_POST_H): New macro.
4954
4955 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4956
4957 2012-07-31 Glenn Morris <rgm@gnu.org>
4958
4959 * Makefile.in (S_FILE): No longer set by configure.
4960
4961 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4962 is available.
4963 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4964
4965 * process.h (NULL_DEVICE):
4966 * emacs.c (SEPCHAR):
4967 * editfns.c (USER_FULL_NAME): Let configure set them.
4968
4969 * s/README, s/template.h: Remove files.
4970
4971 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4972
4973 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4974 Move to configure.ac.
4975
4976 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4977
4978 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4979 resulting renaming of 'struct frame' members.
4980
4981 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4982
4983 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4984 after introduction of FVAR.
4985
4986 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4987
4988 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4989
4990 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4991 instead of compositeToPoint.
4992 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4993
4994 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4995
4996 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4997
4998 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4999 * lisp.h (INTERNAL_FIELD): New macro.
5000 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5001 (BVAR): Change to use INTERNAL_FIELD.
5002 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5003 (KVAR): Change to use INTERNAL_FIELD.
5004 * frame.h (FVAR): New macro.
5005 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5006 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5007 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5008 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5009 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5010
5011 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5012
5013 Miscellaneous fixes for non-default X toolkits.
5014 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5015 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5016 Move under #ifdef USE_LUCID.
5017 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5018 definition and usage to avoid warnings.
5019
5020 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5021
5022 * nsterm.m (openFiles): Fix previous checkin.
5023
5024 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5025
5026 * indent.c (compute_motion): Remove unused local.
5027
5028 2012-07-31 Glenn Morris <rgm@gnu.org>
5029
5030 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5031
5032 * conf_post.h [USG5_4]:
5033 Move remaining contents of s/usg5-4-common.h here.
5034 * s/usg5-4-common.h: Remove file.
5035
5036 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5037 * s/irix6-5.h: Remove file.
5038
5039 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5040 * s/darwin.h: Remove file.
5041
5042 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5043 * s/hpux10-20.h: Remove file, which is now empty.
5044
5045 2012-07-30 Glenn Morris <rgm@gnu.org>
5046
5047 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5048 * Makefile.in (config_h): Add conf_post.h.
5049 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5050
5051 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5052
5053 * nsterm.m (ns_do_open_file): New variable.
5054 (ns_term_init): Set ns_do_open_file to YES after run returns.
5055 (openFile, openTempFile, openFileWithoutUI, openFiles):
5056 Open files only if ns_do_open_file.
5057
5058 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5059
5060 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5061 This no-op macro hasn't been needed for many years.
5062 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5063
5064 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5065 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5066 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5067 gdb_make_enums_visible.
5068 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5069 (DIRECTORY_SEP): Now a constant, not a macro.
5070
5071 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5072
5073 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5074 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5075
5076 * w32term.c <w32_keyboard_codepage>: Renamed from
5077 keyboard_codepage and now external. All users changed.
5078
5079 * w32term.h: Add declaration of w32_keyboard_codepage.
5080
5081 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5082 the codepage to translate keys to Unicode. If this argument is
5083 -1, use the value returned by GetConsoleCP. All callers changed.
5084
5085 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5086
5087 Update .PHONY listings in makefiles.
5088 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5089 bootstrap-clean, distclean, maintainer-clean, versioclean,
5090 extraclean, frc.
5091
5092 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5093 This is a bit clearer. Fix some commentary typos.
5094
5095 2012-07-30 Glenn Morris <rgm@gnu.org>
5096
5097 * s/netbsd.h: Let configure include signal.h if needed.
5098 Remove file, which is now empty.
5099
5100 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5101 Let configure set them.
5102 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5103 No more need to undefine.
5104
5105 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5106
5107 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5108 non-single-byte char when adding meta modifier. (Bug#12090)
5109
5110 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5111
5112 Convert safe_call to use variable number of arguments.
5113 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5114 (safe_call2): Fix comment.
5115 * lisp.h (safe_call): Adjust prototype.
5116 * coding.c (encode_coding_object): Change to use safe_call2.
5117 * xfaces.c (merge_face_heights): Change to use safe_call1.
5118
5119 2012-07-30 Glenn Morris <rgm@gnu.org>
5120
5121 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5122 does that unconditionally. Remove file, which is now empty.
5123
5124 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5125 Remove empty files.
5126
5127 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5128
5129 Export to GDB most of lisp.h's remaining object-like macros.
5130 * lisp.h (min, max): Move earlier, because they're used earlier now.
5131 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5132 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5133 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5134 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5135 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5136 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5137 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5138 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5139 Now constants, for GDB. They need not be macros.
5140 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5141 Now constants, for GDB, as well as macros, for static initializers.
5142 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5143 Move to after the definition of struct Lisp_Char_Table,
5144 since the former now needs that type defined.
5145 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5146 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5147 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5148 New enums, for gdb_make_enums_visible.
5149 (GLYPH_MODE_LINE_FACE): Remove; unused.
5150 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5151 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5152 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5153 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5154 enum maxargs, enum MAX_ALLOCA.
5155 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5156 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5157 no longer needed, now that they are done in lisp.h.
5158
5159 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5160
5161 Cleanup string bytes checking.
5162 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5163 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5164 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5165 (check_sblock, compact_small_strings): Simplify.
5166
5167 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5168
5169 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5170 These macros are confusing and no longer need to be defined, as
5171 the enum values now suffice. All uses replaced with definiens.
5172 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5173
5174 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5175
5176 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5177 ($(BLD)/w32console.$(O)): Update dependencies.
5178
5179 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5180
5181 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5182 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5183 time. Adjust users.
5184 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5185
5186 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5187
5188 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5189 setting sitelisp (Bug#12010).
5190
5191 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5192
5193 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5194
5195 * w32heap.c (cache_system_info):
5196 * w32.c (sys_rename):
5197 * w32proc.c (find_child_console, sys_kill): All users changed.
5198
5199 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5200
5201 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5202
5203 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5204
5205 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5206
5207 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5208
5209 Cleanup statistics calculation in Fgarbage_collect.
5210 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5211 Fix zombies percentage calculation. Simplify elapsed time calculation.
5212
5213 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5214
5215 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5216 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5217 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5218 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5219 (replace_range, replace_range_2, del_range_2): Change to eassert.
5220 * marker.c (byte_char_debug_check): Adjust style.
5221
5222 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5223
5224 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5225 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5226 long-ago-commented-out code that talks about "WIN32".
5227 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5228 All uses changed.
5229
5230 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5231
5232 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5233 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5234 Simplify by using alignof.
5235 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5236 * lisp.h: Include <stdalign.h>.
5237 (GCALIGNMENT): New macro and constant.
5238 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5239 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5240 (stdalign): New macro, if not already defined.
5241
5242 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5243
5244 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5245 * w32inevt.c: Include w32inevt.h.
5246 (w32_read_console_input): New inline function, calls either
5247 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5248 w32_console_unicode_input.
5249 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5250 (w32_kbd_patch_key, key_event): Use the codepage returned by
5251 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5252 (key_event): use uChar.UnicodeChar only if
5253 w32_console_unicode_input is non-zero.
5254
5255 * w32console.c: Include w32heap.h.
5256 <w32_console_unicode_input>: New global variable.
5257 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5258 family of Windows, zero otherwise.
5259
5260 * w32inevt.h: Declare w32_console_unicode_input.
5261
5262 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5263 --without-x. (Bug#11742)
5264
5265 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5266
5267 Adjust GDB to reflect pvec_type changes (Bug#12036).
5268 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5269 2012-07-04 changes to pseudovector representation.
5270 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5271
5272 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5273
5274 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5275 bus address.
5276 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5277
5278 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5279
5280 * alloc.c (listn): Fix the order the arguments are consed onto the
5281 list.
5282
5283 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5284 enumeration constants, as PURE and HEAP are too general, and clash
5285 with other headers and sources, such as gmalloc.c and the
5286 MS-Windows system headers. All users changed.
5287
5288 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5289
5290 Revert last save_excursion_save and save_excursion_restore changes.
5291 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5292 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5293
5294 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5295
5296 Fix recently-introduced typos in Windows port.
5297 Reported by Martin Rudalics <rudalics@gmx.at>.
5298 * w32.c (init_environment): Replace comma with semicolon.
5299 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5300
5301 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5302
5303 Improve GDB symbol export (Bug#12036).
5304 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5305 arms of an 'if', not using conditional expressions; otherwise GDB
5306 complains about the types in the unevaluated arm when the argument
5307 is an integer literal.
5308 (xgetint): Simplify expression.
5309 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5310 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5311 Zaretskii in <http://bugs.gnu.org/12036#13>.
5312 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5313 needed now that we have gdb_make_enums_visible.
5314 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5315 (enum enum_USE_LSB_TAG):
5316 New enum types, packaging up enums that need to be exported to GDB.
5317
5318 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5319
5320 Utility function to make a list from specified amount of objects.
5321 * lisp.h (enum constype): New datatype.
5322 (listn): New prototype.
5323 * alloc.c (listn): New function.
5324 (Fmemory_use_count, syms_of_alloc): Use it.
5325 * buffer.c (syms_of_buffer): Likewise.
5326 * callint.c (syms_of_callint): Likewise.
5327 * charset.c (define_charset_internal): Likewise.
5328 * coding.c (syms_of_coding): Likewise.
5329 * keymap.c (syms_of_keymap): Likewise.
5330 * search.c (syms_of_search): Likewise.
5331 * syntax.c (syms_of_syntax): Likewise.
5332 * w32.c (init_environment): Likewise.
5333 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5334 * xdisp.c (syms_of_xdisp): Likewise.
5335 * xfns.c (syms_of_xfns): Likewise.
5336
5337 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5338
5339 Fast save_excursion_save and save_excursion_restore.
5340 * lisp.h (struct Lisp_Excursion): New data type.
5341 (PVEC_EXCURSION): New pseudovector type.
5342 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5343 to deal with it. Adjust comments.
5344 (init_marker, attach_marker): New prototype.
5345 (unchain_marker): Adjust prototype.
5346 * marker.c (attach_marker): Change to global.
5347 (init_marker): New function.
5348 * alloc.c (Fmake_marker, build_marker): Use it.
5349 (build_marker): More easserts.
5350 (mark_object): Handle struct Lisp_Excursion.
5351 * editfns.c (save_excursion_save, save_excursion_restore):
5352 Reimplement to use struct Lisp_Excursion. Add comments.
5353
5354 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5355
5356 Fix export of symbols to GDB (Bug#12036).
5357 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5358 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5359 emacs.c, as this is a more-suitable home. Had this been done earlier
5360 the fix for 12036 would have avoided some of the problems noted in
5361 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5362 would have been more obvious.
5363 * emacs.c: Do not include <verify.h>; no longer needed.
5364 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5365 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5366 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5367 Remove; now done in lisp.h.
5368 * lisp.h (PUBLISH_TO_GDB): New macro.
5369 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5370 (DATA_SEG_BITS): Use it.
5371 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5372 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5373 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5374 not be usable in #if. This simplifies things.
5375
5376 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5377
5378 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5379
5380 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5381
5382 Simplify export of symbols to GDB (Bug#12036).
5383 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5384 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5385 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5386 Adjust to changes in lisp.h and emacs.c, by using
5387 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5388 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5389 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5390 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5391 instead of gdb_valbits.
5392 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5393 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5394 instead of gdb_array_mark_flag.
5395 (xboolvector): Get size from $->size, not $->header.size.
5396 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5397 (xreload, hook-run, hookpost-run): Remove.
5398 * emacs.c: Include <verify.h>.
5399 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5400 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5401 Remove.
5402 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5403 (gdb_USE_LSB_TAG): New enum constants.
5404 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5405 Also define these as enum constants, so they're visible to GDB.
5406 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5407 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5408 as constants, so they're visible to GDB.
5409 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5410 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5411 Now enum constants, not macros, so they're visible to GDB.
5412 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5413 more convenient now. All uses changed.
5414 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5415 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5416
5417 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5418
5419 Explicitly free restriction data that are not needed anymore.
5420 * editfns.c (save_restriction_restore): Free restriction data.
5421
5422 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5423
5424 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5425 add argument, tune behavior, and adjust all callers.
5426
5427 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5428
5429 Use typedef for EMACS_INT, EMACS_UINT.
5430 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5431 than macros. This simplifies debugging in the usual case, since
5432 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5433 and it allows expressions involving EMACS_INT casts.
5434 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5435
5436 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5437
5438 * nsterm.m (ns_read_socket): Return early if there is a modal
5439 window (Bug#12043).
5440
5441 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5442
5443 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5444 that FOCUS-FRAME can be omitted.
5445
5446 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5447
5448 Adjust buffer text indirection counters at the end of Fkill_buffer.
5449 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5450 buffer is definitely dead. This should really fix an issue reported
5451 by Christoph Scholtes again. (Bug#12007).
5452 (init_buffer_once): Initialize indirection counters of
5453 buffer_defaults and buffer_local_symbols (for sanity and safety).
5454
5455 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5456
5457 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5458 and continuation glyphs on tooltip frames, leave them at zero.
5459 Avoids continued lines in tooltips. (Bug#11832)
5460
5461 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5462
5463 Simplify copy_overlay.
5464 * buffer.c (copy_overlay): Simplify. Use build_marker.
5465 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5466
5467 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5468
5469 * print.c (print_object): Don't crash when a frame's name is nil
5470 or invalid. (Bug#12025)
5471
5472 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5473 it signals an error when a tooltip frame is being created.
5474
5475 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5476
5477 Cleanup miscellaneous objects allocation and initialization.
5478 * alloc.c (allocate_misc): Change to static. Add argument to
5479 specify the subtype. Adjust comment and users.
5480 (build_overlay): New function.
5481 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5482 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5483 (allocate_misc): Remove prototype.
5484 (build_overlay): Add prototype.
5485
5486 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5487
5488 Swap buffer text indirection counters in Fbuffer_swap_text.
5489 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5490 This avoids crash reported by Christoph Scholtes at
5491 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5492
5493 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5494
5495 * nsmenu.m (Popdown_data): New struct.
5496 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5497 free Popdown_data.
5498 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5499 (initWithContentRect): Make imgView and contentView non-static
5500 and autorelease them. Also autorelease img and matrix (Bug#12005).
5501 (dealloc): Remove (Bug#12005).
5502
5503 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5504
5505 Adjust consing_since_gc when objects are explicitly freed.
5506 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5507 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5508 (free_cons, free_misc): Subtract object size from consing_since_gc.
5509
5510 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5511
5512 Simplify and cleanup markers positioning code.
5513 * marker.c (attach_marker): More useful eassert.
5514 (live_buffer, set_marker_internal): New function.
5515 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5516 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5517
5518 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5519
5520 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5521 as it's limited by the amount of memory, not by INT_MAX.
5522
5523 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5524
5525 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5526 in special-event-map. See the discussion at
5527 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5528 for the reasons.
5529
5530 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5531 info.dwItemData. Fixes crashes on 64-bit Windows.
5532 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5533
5534 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5535
5536 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5537 (conversationIdentifier): Return value is NSInteger.
5538 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5539
5540 2012-07-21 Chong Yidong <cyd@gnu.org>
5541
5542 * window.c (decode_any_window): Signal an error if the window is
5543 on a dead frame (Bug#11984).
5544
5545 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5546
5547 Add indirection counting to speed up Fkill_buffer.
5548 * buffer.h (struct buffer): New member.
5549 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5550 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5551 base buffer indirection counter.
5552 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5553 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5554 through buffer list if indirection counter is 0.
5555
5556 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5557
5558 Extend the value returned by Fgarbage_collect with heap statistics.
5559 * alloc.c (Qheap): New symbol.
5560 (syms_of_alloc): DEFSYM it.
5561 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5562 (Fmemory_free): Remove.
5563 (syms_of_alloc): Don't defsubr it.
5564 * buffer.c (Fcompact_buffer): Remove.
5565 (syms_of_buffer): Don't defsubr it.
5566
5567 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5568
5569 Make maybe_gc inline.
5570 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5571 * lisp.h (consing_since_gc, gc_relative_threshold)
5572 (memory_full_cons_threshold): Revert declaration.
5573 (maybe_gc): Remove prototype, define as inline.
5574 * alloc.c: Remove old commented-out code.
5575 (consing_since_gc, gc_relative_threshold)
5576 (memory_full_cons_threshold): Revert to global.
5577 (maybe_gc): Remove.
5578
5579 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5580
5581 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5582 * lisp.h (build_unibyte_string): New function.
5583 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5584 * sysdep.c, w32fns.c, xfns.c: Use it.
5585 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5586 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5587 Adjust users accordingly.
5588 * font.h (font_open_by_name): Adjust prototype.
5589
5590 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5591
5592 Cleanup calls to Fgarbage_collect.
5593 * lisp.h (maybe_gc): New prototype.
5594 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5595 Remove declarations.
5596 * alloc.c (maybe_gc): New function.
5597 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5598 Make them static.
5599 * bytecode.c (MAYBE_GC): Use maybe_gc.
5600 * eval.c (eval_sub, Ffuncall): Likewise.
5601 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5602 to avoid dependency from auto-save feature.
5603
5604 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5605
5606 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5607 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5608 'for_each_per_buffer_object_at'.
5609 All uses changed. It's better to use upper-case for macros that
5610 cannot be implemented as functions, to give the reader a clue
5611 that they're special.
5612
5613 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5614
5615 * alloc.c (Fgarbage_collect): Tweak docstring.
5616
5617 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5618
5619 Tweak the value returned from Fgarbage_collect again.
5620 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5621 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5622 Adjust documentation.
5623 (total_vector_bytes): Rename to total_vector_slots, adjust
5624 accounting.
5625 (total_free_vector_bytes): Rename to total_free_vector_slots,
5626 adjust accounting.
5627 (Qstring_bytes, Qvector_slots): New symbols.
5628 (syms_of_alloc): DEFSYM them.
5629
5630 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5631
5632 Buffer compaction primitive which may be used from Lisp.
5633 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5634 (syms_of_buffer): Register Fcompact_buffer.
5635 * alloc.c (Fgarbage_collect): Use compact_buffer.
5636 * buffer.h (compact_buffer): New prototype.
5637 (struct buffer_text): New member.
5638
5639 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5640
5641 New macro to iterate over all buffers, miscellaneous cleanups.
5642 * lisp.h (all_buffers): Remove declaration.
5643 * buffer.h (all_buffers): Add declaration, with comment.
5644 (for_each_buffer): New macro.
5645 * alloc.c (Fgarbage_collect, mark_object): Use it.
5646 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5647 (init_buffer): Likewise.
5648 * data.c (Fset_default): Likewise.
5649 * coding.c (code_conversion_restore): Remove redundant check
5650 for dead buffer.
5651 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5652
5653 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5654
5655 Fix bug that created negative-length intervals.
5656 * intervals.c (merge_interval_right, merge_interval_left):
5657 Do not zero out this interval if it is absorbed by its children,
5658 as this interval's total length doesn't change in that case. See
5659 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5660
5661 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5662
5663 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5664 when invoking (make-bool-vector N t) and N is a positive
5665 multiple of 8 -- the last 8 bits were mistakenly cleared.
5666
5667 Remove some struct layout assumptions in bool vectors.
5668 * alloc.c (bool_header_size): New constant.
5669 (header_size, word_size): Move earlier, as they're now used earlier.
5670 Use 'word_size' in a few more places, where it's appropriate.
5671 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5672 padding before the data member of a bool vector.
5673 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5674 than doing the check by hand with an abort ().
5675
5676 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5677
5678 * eval.c (Fdefvar): Don't check constants since we only set the var if
5679 it's not yet defined anyway (bug#11904).
5680
5681 * lisp.h (last_undo_boundary): Declare new var.
5682 * keyboard.c (command_loop_1): Set it.
5683 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5684 were auto-added by the command loop (bug#11774).
5685
5686 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5687
5688 * w32font.c (Qsymbol): Remove local definition.
5689 (syms_of_w32font): Don't DEFSYM it.
5690
5691 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5692
5693 Fix sweep_vectors to handle large bool vectors correctly.
5694 * alloc.c (sweep_vectors): Account total_vector_bytes for
5695 bool vectors larger than VBLOCK_BYTES_MAX.
5696
5697 2012-07-18 Chong Yidong <cyd@gnu.org>
5698
5699 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5700 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5701
5702 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5703
5704 Return more descriptive data from Fgarbage_collect.
5705 Suggested by Stefan Monnier in
5706 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5707 * alloc.c (bounded_number): New function.
5708 (total_buffers, total_vectors): New variable.
5709 (total_string_size): Rename to total_string_bytes, adjust users.
5710 (total_vector_size): Rename to total_vector_bytes, adjust users.
5711 (sweep_vectors): Account total_vectors and total_vector_bytes.
5712 (Fgarbage_collect): New return value. Adjust documentation.
5713 (gc_sweep): Account total_buffers.
5714 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5715 (VECTOR_SIZE): Remove.
5716 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5717 (Qinterval, Qmisc): New symbols.
5718 (syms_of_data): Initialize them.
5719 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5720 (Qcons, Qbuffer): New declarations.
5721
5722 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5723
5724 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5725 Round up, not down. Improve doc.
5726
5727 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5728
5729 Restore old code in allocate_string_data to avoid Faset breakage.
5730 Reported by Julien Danjou <julien@danjou.info> in
5731 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5732 * alloc.c (allocate_string_data): Restore old code with minor
5733 adjustments, fix comment to explain this subtle issue.
5734
5735 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5736
5737 Remove FILE_SYSTEM_CASE.
5738 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5739
5740 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5741 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5742 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5743 call-process-region passes it through expand-file-name.
5744
5745 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5746
5747 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5748
5749 Fix crash when creating indirect buffer (Bug#11917)
5750 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5751 Don't handle unbound variables specially if non-zero.
5752 (Fbuffer_local_variables): Pass zero.
5753 (clone_per_buffer_values): Pass non-zero.
5754
5755 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5756
5757 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5758 to make the loop interruptible.
5759
5760 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5761
5762 * gnutls.c (emacs_gnutls_handshake): Only retry if
5763 GNUTLS_E_INTERRUPTED.
5764
5765 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5766
5767 Cleanup and convert miscellaneous checks to eassert.
5768 * alloc.c (mark_interval): Fix comment, partially rephrase
5769 old comment from intervals.h (see below).
5770 * intervals.c (find_interval, adjust_intervals_for_insertion)
5771 (delete_interval, adjust_intervals_for_deletion)
5772 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5773 Convert to eassert.
5774 (adjust_intervals_for_insertion, make_new_interval):
5775 Remove obsolete and unused code.
5776 * intervals.h (struct interval): Remove obsolete comment.
5777 * textprotp.c (erase_properties): Remove unused code.
5778 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5779 (Fremove_list_of_text_properties): Convert to eassert.
5780
5781 2012-07-17 Chong Yidong <cyd@gnu.org>
5782
5783 * editfns.c (Finsert_char): Doc fix.
5784
5785 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5786
5787 Fix previous change to make Fmemory_free always accurate.
5788 * alloc.c (make_interval): Update total_free_intervals.
5789 (make_float): Likewise for total_free_floats.
5790 (free_cons, Fcons): Likewise for total_free_conses.
5791 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5792 Likewise for total_free_vector_bytes.
5793 (Fmake_symbol): Likewise for total_free_symbols.
5794 (bytes_free): Remove.
5795
5796 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5797
5798 Simple free memory accounting feature.
5799 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5800 (sweep_vectors): Accumulate size of free vectors.
5801 (Fgarbage_collect): Setup bytes_free.
5802 (Fmemory_free): New function.
5803 (syms_of_alloc): Register it.
5804
5805 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5806
5807 Cleanup overlays checking.
5808 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5809 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5810 eassert and OVERLAYP.
5811 (sort_overlays): Change to use OVERLAYP.
5812
5813 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5814
5815 * editfns.c (Finsert_char): Make it interactive, and make the
5816 second arg optional. Copy interactive spec and docstring from
5817 ucs-insert.
5818
5819 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5820
5821 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5822 Unlike the other wrapped functions, fabs has an unspecified
5823 effect on errno.
5824
5825 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5826
5827 * nsterm.m (keyDown): Interpret flags without left/right bits
5828 as the left key (Bug#11670).
5829
5830 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5831
5832 Remove empty and useless init functions.
5833 * lisp.h (init_character_once, init_fns, init_image)
5834 (init_filelock, init_sound): Remove prototype.
5835 * character.c (init_character_once): Remove.
5836 * filelock.c (init_filelock): Likewise.
5837 * fns.c (init_fns): Likewise.
5838 * image.c (init_image): Likewise.
5839 * sound.c (init_sound): Likewise.
5840 * emacs.c (main): Adjust accordingly.
5841
5842 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5843
5844 * gtkutil.h: Tiny cleanups.
5845 (use_old_gtk_file_dialog): Remove useless declaration.
5846 (xg_uses_old_file_dialog): Add suggested const attribute.
5847
5848 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5849
5850 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5851 (bidi_paragraph_init): Use it to limit search forward for a strong
5852 directional character in abnormally large paragraphs full of
5853 neutral or weak characters. (Bug#11943)
5854
5855 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5856
5857 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5858 the toolbar (Bug#9451).
5859 (xg_make_tool_item): Give the widget event box a transparent
5860 background.
5861
5862 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5863
5864 Cleanup basic allocation variables and functions.
5865 * alloc.c (ignore_warnings, init_intervals, init_float)
5866 (init_cons, init_symbol, init_marker): Remove.
5867 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5868 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5869 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5870 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5871 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5872 (staticidx, init_alloc_once, init_strings, free_ablock):
5873 Remove redundant initialization.
5874 * fns.c (init_weak_hash_tables): Remove.
5875 * lisp.h (init_weak_hash_tables): Remove prototype.
5876
5877 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5878
5879 Use zero_vector where appropriate.
5880 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5881 accordingly.
5882 * lisp.h (zero_vector): New declaration.
5883 * font.c (null_vector): Remove.
5884 (syms_of_font): Remove initialization and staticpro.
5885 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5886 * keymap.c (Faccessible_keymaps): Likewise.
5887
5888 2012-07-15 Leo Liu <sdl.web@gmail.com>
5889
5890 * fringe.c: Fix typo in comments.
5891
5892 2012-07-14 Leo Liu <sdl.web@gmail.com>
5893
5894 * fringe.c: Add a new bitmap exclamation-mark.
5895
5896 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5897
5898 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5899
5900 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5901 (HAVE_MENUS): Don't define, defined by editing config.in with
5902 msdos/sed2v2.inp.
5903 (GMALLOC_INHIBIT_VALLOC): Don't define.
5904 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5905
5906 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5907
5908 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5909
5910 2012-07-14 Glenn Morris <rgm@gnu.org>
5911
5912 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5913 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5914 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5915
5916 2012-07-13 Glenn Morris <rgm@gnu.org>
5917
5918 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5919
5920 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5921 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5922
5923 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5924
5925 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5926 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5927 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5928 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5929 where appropriate.
5930 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5931 as boolean expression.
5932 (x_set_window_size): Remove unused variable toolbar.
5933 (ns_get_color_default, ns_mod_to_lisp): Remove.
5934 (ns_mouse_position): Remove unused variables xchar and ychar.
5935 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5936 (ns_set_vertical_scroll_bar): Remove unused variable count.
5937 (ns_delete_terminal): Remove unused variable i.
5938 (ns_term_init): Remove unused variables r, g and b.
5939 (mouseDown): Remove unused variable window.
5940 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5941 (initFrameFromEmacs): Remove unused variable vbextra.
5942 (mouseEntered): Remove unused variables p and dpyinfo.
5943 (mouseExited): Remove unused variables p and r.
5944 (ns_define_frame_cursor, ns_clear_frame_area)
5945 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5946 (menuDown): Assign [sender tag] to variable and cast the variable.
5947
5948 * nsterm.h (menuDown): Add id as type to argument sender.
5949 (ns_display_info_for_name): Add Lisp_Object argument.
5950 (ns_term_init): Add Lisp_Object argument.
5951 (ns_map_event_to_object): Add void argument.
5952 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5953 prototype with arguments and only declare if __OBJC__.
5954 (nxatoms_of_nsselect): Add void argument.
5955 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5956 (ns_alloc_autorelease_pool): Add void argument.
5957 (ns_release_autorelease_pool): Add void* argument.
5958 (ns_get_defaults_value): Add const char* argument.
5959
5960 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5961 (initFromContents): Use SSDATA where appropriate.
5962 (ns_update_menubar): Add braces to ambigous if-else.
5963 (initWithTitle): Put () around assignment in if statement.
5964 (ns_menu_show): Remove unused variables window and keymap.
5965 (update_frame_tool_bar): Remove unused variable selected_p.
5966 (initWithContentRect): Remove unused variable this_cmd_name.
5967
5968 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5969 appropriate.
5970 (setXBMColor): Remove unused variable len.
5971 (setPixmapData): Put () around assignment in loop statement.
5972
5973 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5974 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5975 where appropriate.
5976 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5977 around assignment in loop statement.
5978 (nsfont_open): Remove unused variable i.
5979 (nsfont_open): Remove unused variable len.
5980 (nsfont_draw): Remove unused variable cs.
5981
5982 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5983 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5984 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5985 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5986 (Fns_font_name, Fns_perform_service)
5987 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5988 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5989 (ns_set_name): Remove unused variable view.
5990 (x_set_menu_bar_lines): Remove unused variable olines.
5991 (x_set_tool_bar_lines): Remove unused variable root_window.
5992 (Fns_list_colors): Put () around assignment in while statement.
5993 (Fns_perform_service): Remove unused variable len.
5994 (Fns_display_usable_bounds): Remove unused variable top.
5995 (syms_of_nsfns): Remove unused variable i.
5996
5997 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5998 memcpy (Bug#11907).
5999
6000 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
6001
6002 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6003 and free it with DestroyExceptionInfo (Bug#11558).
6004
6005 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
6006
6007 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6008 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6009 Set here, not in nt/config.nt.
6010
6011 2012-07-13 Eli Zaretskii <eliz@gnu.org>
6012
6013 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6014 cursor overflow into the last glyph on display line when the right
6015 fringe is off. (Bug#11832)
6016
6017 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6018
6019 * xdisp.c (produce_special_glyphs): Now static.
6020 * dispextern.h (produce_special_glyphs): Remove decl.
6021
6022 2012-07-13 Glenn Morris <rgm@gnu.org>
6023
6024 * s/bsd-common.h, s/cygwin.h: Remove empty files.
6025 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6026
6027 * s/usg5-4-common.h (USG, USG5):
6028 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6029 * s/sol2-6.h (SOLARIS2):
6030 * s/irix6-5.h (IRIX6_5):
6031 * s/hpux10-20.h (USG, USG5, HPUX):
6032 * s/gnu-linux.h (USG, GNU_LINUX):
6033 * s/freebsd.h (BSD_SYSTEM):
6034 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6035 * s/cygwin.h (CYGWIN):
6036 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6037 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6038
6039 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
6040
6041 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6042
6043 2012-07-13 Glenn Morris <rgm@gnu.org>
6044
6045 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6046
6047 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6048
6049 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6050 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6051
6052 2012-07-12 Glenn Morris <rgm@gnu.org>
6053
6054 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6055
6056 * process.c (init_process_emacs): Rename from init_process.
6057 The old name is also the name of a Mach system call.
6058 * lisp.h, emacs.c: Update for this name change.
6059 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6060 longer needed.
6061
6062 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6063
6064 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6065 memmove call that removes glyphs covered by the left truncation
6066 glyph. Improve commentary.
6067 (display_line): Fix display of continuation glyphs on GUI frames
6068 when the right fringe is turned off and variable-size fonts are
6069 used in the window. Move the code that appends a stretch glyph to
6070 produce_special_glyphs, so that it could be used for truncation
6071 and continuation glyphs alike.
6072 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6073 glyph of a suitably computed width, to align the special glyphs at
6074 the window margin. Code moved from display_line. (Bug#11832)
6075
6076 2012-07-12 Glenn Morris <rgm@gnu.org>
6077
6078 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6079
6080 * s/gnu-linux.h, s/hpux10-20.h:
6081 Do not unconditionally define HAVE_XRMSETDATABASE.
6082
6083 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6084
6085 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6086
6087 Fix typos that broke OS X build.
6088 Reported by Randal L. Schwartz in
6089 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6090 * nsterm.m (ns_timeout): Add missing local decl.
6091 (ns_get_color): snprintf -> sprintf, to fix typo.
6092
6093 2012-07-12 Glenn Morris <rgm@gnu.org>
6094
6095 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6096 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6097 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6098 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6099
6100 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6101 Move PTY_OPEN to configure.
6102
6103 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6104 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6105 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6106
6107 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6108
6109 Use empty_unibyte_string where applicable.
6110 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6111 * lread.c (read1): Likewise.
6112 * xsettings.c (syms_of_xsettings): Likewise.
6113
6114 2012-07-12 Glenn Morris <rgm@gnu.org>
6115
6116 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6117 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6118 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6119 * s/hpux10-20.h (RUN_TIME_REMAP):
6120 * s/bsd-common.h (TABDLY): Move to configure.
6121
6122 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6123
6124 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6125
6126 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6127 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6128
6129 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6130
6131 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6132 * s/template.h: Move NARROWPROTO to configure.
6133
6134 2012-07-11 Glenn Morris <rgm@gnu.org>
6135
6136 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6137 unused since 2011-01-17 change to systty.h.
6138
6139 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6140 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6141 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6142
6143 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6144
6145 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6146
6147 2012-07-11 Glenn Morris <rgm@gnu.org>
6148
6149 * s/darwin.h, s/gnu-linux.h, s/template.h:
6150 Move INTERRUPT_INPUT to configure.
6151
6152 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6153
6154 Minor adjustments to interning code.
6155 * lisp.h (intern, intern_c_string): Redefine as static inline
6156 wrappers for intern_1 and intern_c_string_1, respectively.
6157 (intern_1, intern_c_string_1): Rename prototypes.
6158 * lread.c (intern_1, intern_c_string_1, oblookup):
6159 Simplify Vobarray checking.
6160 * font.c (font_intern_prop): Likewise. Adjust comment.
6161 * w32font.c (intern_font_name): Likewise.
6162
6163 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6164
6165 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6166
6167 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6168 of Fcar/Fcdr if possible.
6169 * font.c (check_otf_features): Likewise.
6170 * fontset.c (Fnew_fontset): Likewise.
6171 * gnutls.c (Fgnutls_boot): Likewise.
6172 * minibuf.c (read_minibuf): Likewise.
6173 * msdos.c (IT_set_frame_parameters): Likewise.
6174 * xmenu.c (Fx_popup_dialog): Likewise.
6175 * w32menu.c (Fx_popup_dialog): Likewise.
6176
6177 2012-07-11 Glenn Morris <rgm@gnu.org>
6178
6179 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6180 since nothing has defined it on these platforms.
6181
6182 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6183 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6184
6185 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6186 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6187 Move CLASH_DETECTION to configure.
6188
6189 * s/gnu.h: Remove file, which is now empty.
6190
6191 * s/gnu.h, s/gnu-linux.h:
6192 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6193
6194 2012-07-11 John Wiegley <johnw@newartisans.com>
6195
6196 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6197 function attribute, so we only use it if it exists in the
6198 compiler.
6199
6200 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6201
6202 Avoid call to strlen in fast_c_string_match_ignore_case.
6203 * search.c (fast_c_string_match_ignore_case): Change to use
6204 length argument. Adjust users accordingly.
6205 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6206
6207 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6208
6209 Assume mkdir, rmdir.
6210 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6211 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6212
6213 Assume rename.
6214 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6215
6216 Assume perror.
6217 * s/hpux10-20.h (HAVE_PERROR): Remove.
6218 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6219 Remove dummy definition, as this problem was obsolete long ago.
6220
6221 Assume strerror.
6222 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6223
6224 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6225
6226 Avoid calls to strlen in font processing functions.
6227 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6228 (font_open_by_name): Change to use length argument.
6229 Adjust users accordingly.
6230 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6231 Adjust prototypes.
6232 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6233 Change to return ptrdiff_t.
6234 (xfont_list_pattern, xfont_match): Use length returned by
6235 xfont_decode_coding_xlfd.
6236 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6237
6238 2012-07-11 Glenn Morris <rgm@gnu.org>
6239
6240 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6241 Move DONT_REOPEN_PTY to configure.
6242
6243 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6244 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6245
6246 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6247
6248 Remove "#define unix" that is no longer needed (Bug#11905).
6249 * s/aix4-2.h (unix): Remove; no longer needed.
6250
6251 EMACS_TIME simplification (Bug#11875).
6252 This replaces macros (which typically do not work in GDB)
6253 with functions, typedefs and enums, making the code easier to debug.
6254 The functional style also makes code easier to read and maintain.
6255 * systime.h: Include <sys/time.h> on all hosts, not just if
6256 WINDOWSNT, since 'struct timeval' is needed in general.
6257 (EMACS_TIME): Now a typedef, not a macro.
6258 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6259 not macros.
6260 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6261 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6262 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6263 (EMACS_TIME_LE): Now functions, not macros.
6264 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6265 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6266 which are not functions. All uses rewritten to use:
6267 (make_emacs_time): New function.
6268 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6269 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6270 not functions. All uses rewritten to use the following, respectively:
6271 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6272 (add_emacs_time, sub_emacs_time): New functions.
6273 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6274 * fileio.c (Fcopy_file):
6275 * xterm.c (XTflash): Get the current time closer to when it's used.
6276 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6277
6278 * bytecode.c (targets): Suppress -Woverride-init warnings.
6279
6280 Simplify by avoiding confusing use of strncpy etc.
6281 * doc.c (Fsnarf_documentation):
6282 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6283 * frame.c (Fmake_terminal_frame):
6284 * gtkutil.c (get_utf8_string):
6285 * lread.c (openp):
6286 * nsmenu.m (ns_update_menubar):
6287 * regex.c (regerror):
6288 Prefer memcpy to strncpy and strncat when either will do.
6289 * fileio.c (Fsubstitute_in_file_name):
6290 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6291 (menu_separator_name_p):
6292 * nsmenu.m (ns_update_menubar):
6293 Prefer memcmp to strncmp when either will do.
6294 * nsterm.m: Include <ftoastr.h>.
6295 (ns_get_color):
6296 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6297 Prefer snprintf to strncpy.
6298 * nsterm.m (ns_term_init):
6299 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6300 * nsterm.m (ns_term_init):
6301 Avoid the need for strncpy, by using build_string or
6302 make_unibyte_string directly. Use dtoastr, not snprintf.
6303 * process.c (Fmake_network_process): Diagnose service names that
6304 are too long, rather than silently truncating them or creating
6305 non-null-terminated names.
6306 (Fnetwork_interface_info): Likewise, for interface names.
6307 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6308 Prefer sprintf to strncat.
6309 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6310 Prefer vsnprintf to vsprintf + strncpy.
6311
6312 2012-07-10 Glenn Morris <rgm@gnu.org>
6313
6314 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6315 Clarify fallback case.
6316
6317 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6318
6319 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6320 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6321 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6322 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6323 where argument type is known to be a Lisp_Cons.
6324
6325 2012-07-10 Tom Tromey <tromey@redhat.com>
6326
6327 * bytecode.c (BYTE_CODE_THREADED): New macro.
6328 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6329 (enum byte_code_op): New type.
6330 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6331 (exec_byte_code): Use them. Use token threading when applicable.
6332
6333 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6334
6335 Optimize pure C strings initialization.
6336 * lisp.h (make_pure_string): Fix prototype.
6337 (build_pure_c_string): New function, defined as static inline. This
6338 provides a better opportunity to optimize away calls to strlen when
6339 the function is called with compile-time constant argument.
6340 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6341 argument, adjust users accordingly. Use build_pure_c_string where
6342 appropriate.
6343 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6344 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6345 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6346
6347 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6348
6349 Avoid calls to strlen in miscellaneous functions.
6350 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6351 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6352 * lread.c (openp): Likewise.
6353
6354 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6355
6356 Avoid calls to strlen in path processing functions.
6357 * fileio.c (file_name_as_directory): Add comment. Change to add
6358 srclen argument and return the length of result. Adjust users
6359 accordingly.
6360 (directory_file_name): Fix comment. Change to add srclen argument,
6361 swap 1st and 2nd arguments to obey the common convention.
6362 Adjust users accordingly.
6363 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6364
6365 2012-07-10 Glenn Morris <rgm@gnu.org>
6366
6367 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6368 Move PENDING_OUTPUT_COUNT definition to configure.
6369
6370 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6371 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6372 * s/gnu.h (DATA_START): Move definitions to configure.
6373
6374 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6375 We include usg5-4-common.h, which defines them both.
6376
6377 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6378 O_RDONLY already includes it).
6379
6380 Stop ns builds setting the EMACSLOADPATH environment variable.
6381 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6382 Now it does not set EMACSLOADPATH, just returns the load-path string.
6383 * nsterm.h: Update accordingly.
6384 * lread.c [HAVE_NS]: Include nsterm.h.
6385 (init_lread) [HAVE_NS]: Use ns_load_path.
6386 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6387
6388 2012-07-09 Glenn Morris <rgm@gnu.org>
6389
6390 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6391 since the included bsd-common.h does so.
6392
6393 Stop ns builds setting the EMACSPATH environment variable.
6394 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6395 (ns_init_paths): Do not set EMACSPATH.
6396 * nsterm.h (ns_exec_path): Add it.
6397 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6398 Use ns_exec_path.
6399
6400 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6401
6402 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6403
6404 * process.c (wait_reading_process_output): 'waitchannels' was unset
6405 when read_kbd || !NILP (wait_for_cell); fix this.
6406
6407 Add GCC-style 'const' attribute to functions that can use it.
6408 * character.h (char_resolve_modifier_mask):
6409 * keyboard.h (make_ctrl_char):
6410 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6411 (init_character_once, next_almost_prime, init_fns, init_image)
6412 (flush_pending_output, init_sound):
6413 * mem-limits.h (start_of_data):
6414 * menu.h (finish_menu_items):
6415 Add ATTRIBUTE_CONST.
6416 * emacs.c (DEFINE_DUMMY_FUNCTION):
6417 Declare the dummy function with ATTRIBUTE_CONST.
6418 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6419 Add decls with ATTRIBUTE_CONST.
6420
6421 Minor improvements to make_formatted_string.
6422 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6423 where int is good enough, as vsprintf returns an int.
6424 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6425
6426 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6427
6428 Use make_formatted_string to avoid double length calculation.
6429 * lisp.h (make_formatted_string): New prototype.
6430 * alloc.c (make_formatted_string): New function.
6431 * buffer.c (Fgenerate_new_buffer_name): Use it.
6432 * dbusbind.c (syms_of_dbusbind): Likewise.
6433 * editfns.c (Fcurrent_time_zone): Likewise.
6434 * filelock.c (get_boot_time): Likewise.
6435 * frame.c (make_terminal_frame, set_term_frame_name)
6436 (x_report_frame_params): Likewise.
6437 * image.c (gs_load): Likewise.
6438 * minibuf.c (get_minibuffer): Likewise.
6439 * msdos.c (dos_set_window_size): Likewise.
6440 * process.c (make_process): Likewise.
6441 * xdisp.c (ensure_echo_area_buffers): Likewise.
6442 * xsettings.c (apply_xft_settings): Likewise.
6443
6444 2012-07-09 Glenn Morris <rgm@gnu.org>
6445
6446 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6447 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6448 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6449 * nsterm.h (ns_etc_directory): Add it.
6450 * callproc.c [HAVE_NS]: Include nsterm.h.
6451 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6452
6453 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6454
6455 Move marker debugging code under MARKER_DEBUG.
6456 * marker.c (MARKER_DEBUG): Move marker debugging code under
6457 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6458 for bootstrap with --enable-checking (~3x slowdown reported
6459 by Juanma Barranquero <lekktu@gmail.com>).
6460 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6461
6462 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6463
6464 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6465 See <http://bugs.gnu.org/11825#29>.
6466
6467 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6468
6469 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6470 has no font, use the frame's font. (Bug#11813)
6471 (display_line): Add commentary about displaying truncation glyphs
6472 on GUI frames.
6473 (produce_special_glyphs): Move here from term.c.
6474
6475 * term.c (produce_special_glyphs): Move to xdisp.c.
6476
6477 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6478 section.
6479
6480 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6481
6482 * xdisp.c (display_line): Avoid warning about implicit declaration
6483 of FRAME_FONT.
6484
6485 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6486
6487 * lisp.h: Remove empty conditional.
6488
6489 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6490
6491 * lread.c (load_path_check): Now static.
6492
6493 Fix some minor --with-ns problems found by static checking.
6494 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6495 (x_set_font) [!HAVE_X_WINDOWS]:
6496 * image.c (xpm_load_image) [HAVE_NS]:
6497 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6498 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6499 Remove unused local.
6500 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6501 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6502 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6503 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6504 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6505 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6506 Fix pointer signedness problem.
6507 * xfaces.c (FRAME_X_FONT_TABLE):
6508 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6509
6510 2012-07-07 Glenn Morris <rgm@gnu.org>
6511
6512 * lread.c (load_path_check): New function, split from init_lread.
6513 (init_lread): Reorganize. Motivation:
6514 If EMACSLOADPATH is set, check/warn about that rather than the
6515 defaults, which we are not going to use. Hence we can remove
6516 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6517 Don't warn if site-lisp directories are missing.
6518 If not installed, start from a blank load-path, since
6519 PATH_LOADSEARCH refers to the eventual installation directories.
6520
6521 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6522
6523 Support truncation and continuation glyphs on GUI frames, when
6524 fringes are disabled. (Bug#11832)
6525 * xdisp.c (init_iterator): Get dimensions of truncation and
6526 continuation glyphs even if on GUI frames.
6527 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6528 or both, are absent.
6529 (start_display, move_it_in_display_line_to): Handle the case of a
6530 GUI frame without a fringe to display continuation or truncation
6531 glyphs.
6532 (insert_left_trunc_glyphs): Support GUI frames: make sure
6533 truncation glyphs overwrite enough glyphs from the current line to
6534 have sufficient space in pixels.
6535 (display_line): Support truncation and continuation glyphs on GUI
6536 frames. If some spare pixels are left on the line after inserting
6537 the truncation glyphs, fill that space with a stretch glyph of a
6538 suitably computed width.
6539
6540 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6541 produce_glyphs, to support GUI sessions.
6542
6543 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6544
6545 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6546
6547 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6548
6549 Do not require float-time's arg to fit in time_t (Bug#11825).
6550 This works better on hosts where time_t is unsigned, and where
6551 float-time is applied to the (negative) difference between two times.
6552 * editfns.c (decode_time_components): Last arg is now double *,
6553 not int *, and means to store all the result as a double, without
6554 worrying about whether the seconds part fits in time_t.
6555 All callers changed.
6556 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6557 All callers changed.
6558 (Ffloat_time): Do not fail merely because the specified time falls
6559 outside of time_t range.
6560
6561 2012-07-07 Glenn Morris <rgm@gnu.org>
6562
6563 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6564 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6565 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6566
6567 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6568
6569 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6570 Update dependencies.
6571
6572 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6573
6574 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6575
6576 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6577 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6578 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6579 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6580 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6581 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6582
6583 * xfont.c (compare_font_names): Redo to omit the need for casts.
6584
6585 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6586
6587 * xfns.c (Fx_change_window_property): Doc fix.
6588 * w32fns.c (Fx_change_window_property): Doc fix.
6589
6590 * w32fns.c (Fx_window_property): Accept the same arguments as the
6591 X Windows version. Doc fix.
6592 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6593
6594 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6595 Eli Zaretskii <eliz@gnu.org>
6596
6597 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6598 Windows-specific code from nt/config.nt moved here.
6599 Obsolete settings removed.
6600
6601 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6602
6603 * process.c: Avoid unnecessary calls to gettime.
6604 (wait_reading_process_output): Don't get the time of day
6605 when gobbling data immediately and not waiting, as there's no need
6606 for it in that case. This removes a FIXME.
6607
6608 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6609
6610 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6611 is defined (Bug#11768).
6612
6613 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6614
6615 Fix marker debugging code.
6616 * marker.c (byte_char_debug_check): Do not perform the check
6617 if buffer is not multibyte.
6618 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6619 Call byte_char_debug_check with correct arguments.
6620
6621 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6622
6623 Compile marker debugging code only if ENABLE_CHECKING is defined.
6624 * marker.c (byte_char_debug_check, count_markers):
6625 Use only if ENABLE_CHECKING is defined.
6626 (byte_debug_flag): Remove.
6627 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6628 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6629
6630 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6631
6632 Avoid code repetition in marker-related functions.
6633 * marker.c (attach_marker): New function.
6634 (Fset_marker, set_marker_restricted, set_marker_both)
6635 (set_marker_restricted_both): Use it.
6636 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6637 Consistently rename charno to charpos.
6638 (marker_position): Add eassert.
6639 (marker_byte_position): Convert to eassert.
6640
6641 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6642
6643 Simplify list operations in unchain_overlay and unchain_marker.
6644 * buffer.c (unchain_overlay): Simplify. Add comment.
6645 * marker.c (unchain_marker): Simplify. Fix comments.
6646
6647 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6648
6649 Introduce fast path for the widely used marker operation.
6650 * alloc.c (build_marker): New function.
6651 * lisp.h (build_marker): New prototype.
6652 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6653 * composite.c (autocmp_chars): Likewise.
6654 * editfns.c (buildmark): Remove.
6655 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6656 (save_restriction_save): Use build_marker.
6657 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6658 * window.c (save_window_save): Likewise.
6659
6660 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6661
6662 Do not use Fdelete_overlay in delete_all_overlays
6663 to avoid redundant calls to unchain_overlay.
6664 * buffer.c (drop_overlay): New function.
6665 (delete_all_overlays, Fdelete_overlay): Use it.
6666 * minibuf.c (get_minibuffer): Fix comment.
6667
6668 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6669
6670 Port to OpenBSD 5.1 amd64.
6671 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6672 This is needed for OpenBSD, and should be harmless on all BSD systems.
6673 Also, include <sys/sysctl.h>, as it should be available on all
6674 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6675 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6676 use p_pid member, not kp_proc.pid.
6677
6678 2012-07-06 Glenn Morris <rgm@gnu.org>
6679
6680 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6681
6682 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6683
6684 More xmalloc and related cleanup.
6685 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6686 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6687 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6688 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6689 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6690 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6691 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6692 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6693 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6694 * xterm.c:
6695 Omit needless casts involving void * pointers and allocation.
6696 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6697 as the former is more robust if P's type is changed.
6698 Prefer xzalloc to xmalloc + memset 0.
6699 Simplify malloc-or-realloc to realloc.
6700 Don't worry about xmalloc returning a null pointer.
6701 Prefer xstrdup to xmalloc + strcpy.
6702 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6703 growing it.
6704 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6705 alloca of a constant.
6706
6707 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6708
6709 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6710 hscroll is larger than the line width. Fixes long and futile
6711 looping inside extend_face_to_end_of_line (on a TTY) producing
6712 glyphs that are not needed and thrown away.
6713
6714 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6715
6716 * marker.c (set_marker_restricted_both): Simplify by using
6717 clip_to_bounds.
6718
6719 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6720
6721 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6722
6723 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6724
6725 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6726 not defined (Bug#11768).
6727 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6728 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6729 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6730 followed by gtk_box_set_homogeneous (Bug#11768).
6731 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6732 (update_theme_scrollbar_width, xg_create_scroll_bar):
6733 Use gtk_scrollbar_new (Bug#11768).
6734 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6735 (is_box_type): New function (Bug#11768).
6736 (xg_tool_item_stale_p): Call is_box_type.
6737 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6738 with default display (Bug#11768).
6739
6740 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6741
6742 * xdisp.c (window_hscroll_limited): New function.
6743 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6744 coordinates when window's hscroll is set to insanely large
6745 values. (Bug#11857)
6746
6747 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6748
6749 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6750 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6751
6752 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6753
6754 Cleanup xmalloc.
6755 * lisp.h (xzalloc): New prototype. Omit needless casts.
6756 * alloc.c (xzalloc): New function. Omit needless casts.
6757 * charset.c: Omit needless casts. Convert all calls to
6758 xmalloc with following memset to xzalloc.
6759 * dispnew.c: Likewise.
6760 * fringe.c: Likewise.
6761 * image.c: Likewise.
6762 * sound.c: Likewise.
6763 * term.c: Likewise.
6764 * w32fns.c: Likewise.
6765 * w32font.c: Likewise.
6766 * w32term.c: Likewise.
6767 * xfaces.c: Likewise.
6768 * xfns.c: Likewise.
6769 * xterm.c: Likewise.
6770 * atimer.c: Omit needless casts.
6771 * buffer.c: Likewise.
6772 * callproc.c: Likewise.
6773 * ccl.c: Likewise.
6774 * coding.c: Likewise.
6775 * composite.c: Likewise.
6776 * doc.c: Likewise.
6777 * doprnt.c: Likewise.
6778 * editfns.c: Likewise.
6779 * emacs.c: Likewise.
6780 * eval.c: Likewise.
6781 * filelock.c: Likewise.
6782 * fns.c: Likewise.
6783 * gtkutil.c: Likewise.
6784 * keyboard.c: Likewise.
6785 * lisp.h: Likewise.
6786 * lread.c: Likewise.
6787 * minibuf.c: Likewise.
6788 * msdos.c: Likewise.
6789 * print.c: Likewise.
6790 * process.c: Likewise.
6791 * region-cache.c: Likewise.
6792 * search.c: Likewise.
6793 * sysdep.c: Likewise.
6794 * termcap.c: Likewise.
6795 * terminal.c: Likewise.
6796 * tparam.c: Likewise.
6797 * w16select.c: Likewise.
6798 * w32.c: Likewise.
6799 * w32reg.c: Likewise.
6800 * w32select.c: Likewise.
6801 * w32uniscribe.c: Likewise.
6802 * widget.c: Likewise.
6803 * xdisp.c: Likewise.
6804 * xmenu.c: Likewise.
6805 * xrdb.c: Likewise.
6806 * xselect.c: Likewise.
6807
6808 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6809
6810 * fileio.c (time_error_value): Check the right error number.
6811 Problem reported by Troels Nielsen in
6812 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6813
6814 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6815
6816 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6817 This should be fixed in a better way; see Eli Zaretskii in
6818 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6819 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6820
6821 * fileio.c (time_error_value): Rename from special_mtime.
6822 The old name's problems were noted by Eli Zaretskii in
6823 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6824
6825 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6826 This variable's comment says Emacs needs at least one GDB-visible
6827 symbol of type enum pvec_type, to work around GDB problems.
6828 The symbol's value doesn't matter.
6829
6830 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6831 that causes compilation to fail on pre-C99 compilers.
6832
6833 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6834
6835 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6836 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6837
6838 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6839
6840 * buffer.c (init_buffer_once): Fix initialization of
6841 headers for buffer_defaults and buffer_local_symbols.
6842 Reported by Juanma Barranquero <lekktu@gmail.com>.
6843
6844 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6845
6846 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6847 * lisp.h (enum pvec_type): Use fewer bits.
6848 (PSEUDOVECTOR_SIZE_BITS): New constant.
6849 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6850 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6851 change in pvec_type.
6852 (PSEUDOVECTOR_TYPEP): New macro.
6853 (TYPED_PSEUDOVECTORP): Use it.
6854 * fns.c (internal_equal): Adapt code to extract pvectype.
6855 * emacs.c (gdb_pvec_type): Update type.
6856 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6857 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6858 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6859 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6860 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6861 abusing vector->header.next.nbytes.
6862 (live_vector_p): Use PVEC_TYPE.
6863 (mark_object): Adapt code to extract pvectype. Use switch.
6864
6865 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6866
6867 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6868 Tighten new eassert a bit.
6869
6870 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6871
6872 Fix compilation with --enable-gcc-warnings and -O1
6873 optimization level.
6874 * doprnt.c (doprnt): Change type of tem to int, initialize
6875 to avoid compiler warning. Add eassert.
6876 * search.c (simple_search): Initialize match_byte to avoid
6877 compiler warning. Add eassert.
6878
6879 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6880
6881 Avoid weird behavior with large horizontal scrolls.
6882 Without this change, for example, large hscroll values would
6883 mess up Emacs's display on Fedora 15 x86, presumably due to
6884 overflows in int calculations in the display code.
6885 Also, if buffers had long lines, Emacs would freeze.
6886 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6887 (set_window_hscroll): New function, containing the old guts of
6888 Fset_window_hscroll. Return the clipped value.
6889 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6890 This avoids the need to check against PTRDIFF_MAX.
6891
6892 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6893
6894 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6895
6896 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6897
6898 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6899
6900 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6901 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6902 since GCC 4.4.6 issues a bogus warning for them.
6903
6904 Fix bugs in file timestamp newness comparisons.
6905 * fileio.c (Ffile_newer_than_file_p):
6906 * lread.c (Fload): Use full timestamp resolution of files,
6907 not just the 1-second resolution, so that files that are only
6908 slightly newer still count as newer.
6909 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6910 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6911
6912 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6913
6914 * fileio.c: Improve handling of file time marker. (Bug#11852)
6915 (special_mtime): New function.
6916 (Finsert_file_contents, Fverify_visited_file_modtime):
6917 Use it to set special mtime values consistently.
6918
6919 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6920
6921 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6922 marker for non-existing file. (Bug#11852)
6923
6924 2012-07-03 Glenn Morris <rgm@gnu.org>
6925
6926 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6927 and did not make it into globals.h).
6928
6929 2012-07-03 Tom Tromey <tromey@redhat.com>
6930
6931 * window.c (Fset_window_margins, Fset_window_fringes)
6932 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6933 * textprop.c (Fprevious_property_change): No longer static.
6934 * syntax.c (Fsyntax_table_p): No longer static.
6935 * process.c (Fget_process, Fprocess_datagram_address): No longer
6936 static.
6937 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6938 * keyboard.c (Fcommand_execute): No longer static.
6939 Remove EXFUN.
6940 * insdel.c (Fcombine_after_change_execute): No longer static.
6941 * image.c (Finit_image_library): No longer static.
6942 * fileio.c (Fmake_symbolic_link): No longer static.
6943 * eval.c (Ffetch_bytecode): No longer static.
6944 * editfns.c (Fuser_full_name): No longer static.
6945 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6946 No longer static.
6947 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6948 static.
6949 * dired.c (Ffile_attributes): No longer static.
6950 * composite.c (Fcomposition_get_gstring): No longer static.
6951 * callproc.c (Fgetenv_internal): No longer static.
6952
6953 * ccl.h: Remove EXFUNs.
6954 * buffer.h: Remove EXFUNs.
6955 * dispextern.h: Remove EXFUNs.
6956 * intervals.h: Remove EXFUNs.
6957 * fontset.h: Remove EXFUN.
6958 * font.h: Remove EXFUNs.
6959 * dosfns.c (system_process_attributes): Remove EXFUN.
6960 * keymap.h: Remove EXFUNs.
6961 * lisp.h: Remove EXFUNs.
6962 * w32term.h: Remove EXFUNs.
6963 * window.h: Remove EXFUNs.
6964 * xsettings.h: Remove EXFUN.
6965 * xterm.h: Remove EXFUN.
6966
6967 2012-07-03 Glenn Morris <rgm@gnu.org>
6968
6969 * lisp.h (Frandom): Make it visible to C.
6970 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6971 buffer for invisible buffers. (Bug#1229)
6972
6973 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6974
6975 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6976 values which aren't power of 2.
6977 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6978 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6979 accordingly.
6980
6981 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6982
6983 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6984
6985 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6986
6987 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6988
6989 * alloc.c (allocate_vector_block): Remove redundant
6990 calls to mallopt if DOUG_LEA_MALLOC is defined.
6991 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6992 avoid calls to mallopt if zero_vector is returned.
6993
6994 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6995
6996 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6997 is enabled, avoid dereferencing NULL current_sblock if
6998 running undumped.
6999
7000 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7001
7002 Cleanup basic buffer management.
7003 * buffer.h (struct buffer): Change layout to use generic vector
7004 marking code. Fix some comments. Change type of 'clip_changed'
7005 to bitfield. Remove unused #ifndef old.
7006 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7007 (GET_OVERLAYS_AT): Fix indentation.
7008 (for_each_per_buffer_object_at): New macro.
7009 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7010 (Fbuffer_local_variables): Use it.
7011 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7012 * alloc.c (allocate_buffer): Adjust to match new layout of
7013 struct buffer. Fix comment.
7014 (mark_overlay): New function.
7015 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7016 Lisp area of struct buffer.
7017 (mark_object): Use it. Adjust marking of misc objects
7018 and related comments.
7019
7020 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7021
7022 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7023 wrapper that is not needed because the wrapped code is a no-op (zero
7024 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7025 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7026
7027 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7028
7029 * alloc.c (mark_buffer): Simplify. Remove prototype.
7030 (mark_object): Add comment. Reorganize marking of vector-like
7031 objects. Use CHECK_LIVE for all vector-like objects except buffers
7032 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7033 Avoid redundant calls to mark_vectorlike for bool vectors.
7034
7035 2012-06-30 Glenn Morris <rgm@gnu.org>
7036
7037 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7038
7039 * epaths.in (PATH_SITELOADSEARCH): New.
7040 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7041 This is rather than relying on --enable-locallisppath elements
7042 having "site-lisp" in their names. (Bug#10208#25, 11658)
7043
7044 2012-06-30 Eli Zaretskii <eliz@gnu.org>
7045
7046 * w32proc.c (sys_select): Accept and ignore one more argument.
7047
7048 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7049
7050 * sysselect.h [DOS_NT]: Don't include sys/select.h.
7051 (pselect) [!MS_DOS]: Redirect to sys_select.
7052
7053 * sysdep.c: Don't include dos.h and dosfns.h.
7054
7055 * process.c (sys_select):
7056 * msdos.c (sys_select): Accept one more argument and ignore it.
7057
7058 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7059 adapt data types and code to that.
7060
7061 * dosfns.c:
7062 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7063 which clashes with the gnulib function of the same name.
7064
7065 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7066
7067 * font.c (font_style_to_value, font_style_symbolic)
7068 (font_prop_validate_style): Add type checks for values in
7069 font_style_table.
7070
7071 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7072 argument.
7073 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7074 uses.
7075
7076 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7077
7078 * xdisp.c (try_window_id): Undo last change.
7079
7080 * w32.c (getwd): Adjust commentary about startup_dir.
7081 (init_environment): Always call sys_access, even in non-MSVC
7082 builds. Don't chdir to the directory of the Emacs executable.
7083 This undoes code from 1997 which was justified by the need to
7084 "avoid conflicts when removing and renaming directories". But its
7085 downside was that every relative file name was being interpreted
7086 relative to the directory of the Emacs executable, which can never
7087 be TRT. In particular, it broke sys_access when called with
7088 relative file names.
7089 (sys_access): Map GetLastError to errno.
7090
7091 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7092
7093 * window.h (struct window): Change type of 'fringes_outside_margins'
7094 to bitfield. Fix comment. Adjust users accordingly.
7095 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7096 Adjust comment.
7097 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7098 to ptrdiff_t.
7099
7100 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7101
7102 * gnutls.c (emacs_gnutls_handshake):
7103 Add QUIT to make the loop interruptible.
7104
7105 2012-06-29 Glenn Morris <rgm@gnu.org>
7106
7107 * charset.c (init_charset): Make lack of etc/charsets fatal.
7108
7109 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7110
7111 * editfns.c (region_limit): Fix type mismatch.
7112
7113 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7114
7115 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7116 undefined. Convert from xassert to eassert.
7117 * nsmenu.m: Convert from xassert to eassert.
7118 * nsterm.m: Likewise.
7119
7120 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7121
7122 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7123
7124 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7125
7126 Avoid integer overflow on scroll-left and scroll-right.
7127 * window.c (HSCROLL_MAX): New macro.
7128 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7129 overflow when requested scroll falls outside ptrdiff_t range.
7130
7131 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7132
7133 * window.h (struct window): Change type of 'hscroll',
7134 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7135 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7136 Adjust users accordingly.
7137 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7138 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7139 from EMACS_INT to ptrdiff_t.
7140 (make_window): Omit redundant initialization.
7141
7142 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7143
7144 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7145
7146 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7147
7148 * window.h (struct window): Change type of 'use_time' and
7149 'sequence_number' from Lisp_Object to int.
7150 * frame.c (make_frame): Adjust users accordingly.
7151 * print.c (print_object): Likewise.
7152 * window.c (select_window, Fwindow_use_time, make_parent_window)
7153 (make_window): Likewise.
7154
7155 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7156
7157 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7158 enabled with --enable-checking=[all,glyphs] configure option.
7159 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7160 adjust comments accordingly.
7161 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7162 undefined, adjust comments accordingly.
7163 * image.c: Likewise.
7164 * scroll.c: Likewise.
7165 * w32fns.c: Likewise.
7166 * w32term.c: Likewise.
7167 * xdisp.c: Likewise.
7168 * xfaces.c: Likewise.
7169 * xfns.c: Likewise.
7170 * xterm.c: Likewise.
7171
7172 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7173
7174 Generalize run-time debugging checks.
7175 * dispextern.h (XASSERTS): Remove.
7176 * fontset.c (xassert): Remove.
7177 Convert from xassert to eassert.
7178 * alloc.c: Convert from xassert to eassert.
7179 * bidi.c: Likewise.
7180 * dispnew.c: Likewise.
7181 * fns.c: Likewise.
7182 * fringe.c: Likewise.
7183 * ftfont.c: Likewise.
7184 * gtkutil.c: Likewise.
7185 * image.c: Likewise.
7186 * keyboard.c: Likewise.
7187 * menu.c: Likewise.
7188 * process.c: Likewise.
7189 * scroll.c: Likewise.
7190 * sound.c: Likewise.
7191 * term.c: Likewise.
7192 * w32console.c: Likewise.
7193 * w32fns.c: Likewise.
7194 * w32term.c: Likewise.
7195 * window.c: Likewise.
7196 * xdisp.c: Likewise.
7197 * xfaces.c: Likewise.
7198 * xfns.c: Likewise.
7199 * xselect.c: Likewise.
7200 * xterm.c: Likewise.
7201
7202 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7203
7204 * fns.c (maybe_resize_hash_table): Output message when growing the
7205 purify-hashtable.
7206
7207 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7208
7209 * alloc.c (allocate_string_data): Remove dead code.
7210 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7211 avoid GCC warning about unused macro.
7212
7213 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7214
7215 * alloc.c (allocate_string): Omit intervals initialization.
7216 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7217 as in make_pure_string and make_pure_c_string.
7218
7219 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7220
7221 * alloc.c (allocate_string): Fix last change.
7222
7223 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7224
7225 * alloc.c (allocate_string): Remove two redundant calls
7226 to memset, add explicit initialization where appropriate.
7227
7228 2012-06-27 Glenn Morris <rgm@gnu.org>
7229
7230 * lisp.mk (lisp): Remove paths.elc.
7231
7232 2012-06-27 Chong Yidong <cyd@gnu.org>
7233
7234 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7235
7236 2012-06-26 John Wiegley <johnw@newartisans.com>
7237
7238 * unexmacosx.c (copy_data_segment): Add two section names used
7239 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7240
7241 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7242 when building with Clang.
7243
7244 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7245
7246 * eval.c (Fapply): Allow calling it with a single argument.
7247
7248 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7249
7250 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7251 _stricmp and _strnicmp.
7252 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7253
7254 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7255
7256 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7257 allocated window.
7258 (allocate_process): Likewise for new process.
7259 (allocate_terminal): Change to use offsetof.
7260 (allocate_frame): Likewise.
7261 * frame.c (make_frame): Omit redundant initialization.
7262 * window.c (make_parent_window): Use memset.
7263 (make_window): Omit redundant initialization.
7264 * process.c (make_process): Omit redundant initialization.
7265 * terminal.c (create_terminal): Likewise.
7266
7267 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7268
7269 * term.c (delete_tty): Remove redundant call to memset.
7270
7271 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7272
7273 * alloc.c: Remove build_string.
7274 * lisp.h: Define build_string as static inline. This provides
7275 a better opportunity to optimize away calls to strlen when the
7276 function is called with compile-time constant argument.
7277 * image.c (imagemagick_error): Convert to build_string.
7278 * w32proc.c (sys_spawnve): Likewise.
7279 * xterm.c (x_term_init): Likewise.
7280
7281 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7282
7283 Use sprintf return value instead of invoking strlen on result.
7284 In the old days this wasn't portable, since some sprintf
7285 implementations returned char *. But they died out years ago and
7286 Emacs already assumes sprintf returns int.
7287 Similarly for float_to_string.
7288 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7289 * ccl.c (ccl_driver):
7290 * character.c (string_escape_byte8):
7291 * data.c (Fnumber_to_string):
7292 * doprnt.c (doprnt):
7293 * print.c (print_object):
7294 * xdisp.c (message_dolog):
7295 * xfns.c (syms_of_xfns):
7296 Use sprintf or float_to_string result to avoid need to call strlen.
7297 * data.c (Fnumber_to_string):
7298 Use make_unibyte_string, since the string must be ASCII.
7299 * lisp.h, print.c (float_to_string): Now returns int length.
7300 * term.c (produce_glyphless_glyph):
7301 Use sprintf result rather than recomputing it.
7302
7303 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7304 * Makefile.in (ALL_CFLAGS):
7305 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7306 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7307
7308 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7309
7310 * dispextern.h (xstrcasecmp): Define to library function
7311 strcasecmp if available.
7312 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7313
7314 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7315
7316 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7317 Avoid comma operator.
7318 * menu.c (push_submenu_start, push_submenu_end)
7319 (push_left_right_boundary, push_menu_pane): Likewise.
7320 * msdos.c (dos_rawgetc): Likewise.
7321
7322 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7323
7324 * xfns.c (xic_create_fontsetname): Remove redundant calls
7325 to memset.
7326
7327 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7328
7329 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7330 sprintf already null-terminates its output.
7331
7332 * xfns.c (x_window): Remove redundant cast.
7333
7334 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7335
7336 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7337 `const char *' to `char *' to avoid compiler warning.
7338
7339 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7340
7341 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7342 instead of truncating it to 63 (admittedly a generous limit).
7343
7344 * process.c: Fix spelling and caps in comments.
7345
7346 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7347
7348 * emacs.c (setpgrp): Remove definition, unused.
7349 * sysdep.c (setpgrp): Remove definition, not used in this file.
7350
7351 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7352
7353 * makefile.w32-in: Update dependencies.
7354
7355 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7356
7357 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7358 (SYSTIME_H): Add nt/inc/sys/time.h.
7359
7360 * systime.h [WINDOWSNT]: Include sys/time.h.
7361
7362 * s/ms-w32.h (struct timespec): Definition moved from
7363 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7364
7365 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7366
7367 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7368 * buffer.h (buffer_slot_type_mismatch):
7369 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7370 * eval.c (unwind_to_catch):
7371 * image.c (my_png_error, my_error_exit):
7372 * keyboard.c (quit_throw_to_read_char, user_error)
7373 (Fexit_recursive_edit, Fabort_recursive_edit):
7374 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7375 (wrong_type_argument, buffer_overflow, __executable_start)
7376 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7377 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7378 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7379 (fatal):
7380 (child_setup) [!DOS_NT]:
7381 * lread.c (end_of_file_error, invalid_syntax):
7382 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7383 * puresize.h (pure_write_error):
7384 * search.c (matcher_overflow):
7385 * sound.c (sound_perror, alsa_sound_perror):
7386 * sysdep.c, syssignal.h (croak):
7387 * term.c (maybe_fatal, vfatal):
7388 * textprop.c (text_read_only):
7389 * undo.c (user_error):
7390 * unexmacosx.c (unexec_error):
7391 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7392 Use _Noreturn rather than NO_RETURN.
7393 No need for separate decl merely because of _Noreturn.
7394 * sound.c (sound_warning, parse_sound):
7395 Remove unnecessary forward decls.
7396
7397 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7398
7399 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7400 * lisp.h (WAIT_READING_MAX): New macro.
7401 * dispnew.c (Fsleep_for, sit_for):
7402 * keyboard.c (kbd_buffer_get_event):
7403 * process.c (Faccept_process_output):
7404 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7405 This improves on the previous patch, which introduced a bug
7406 when time_t is unsigned and as wide as intmax_t.
7407 See <http://bugs.gnu.org/9000#51>.
7408
7409 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7410
7411 * dispnew.c (sit_for, Fsleep_for):
7412 * keyboard.c (kbd_buffer_get_event):
7413 * process.c (Faccept_process_output): Avoid compiler warnings when
7414 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7415
7416 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7417
7418 * makefile.w32-in: Update dependencies.
7419
7420 * w32.c (ltime): Add return type and declare static.
7421 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7422
7423 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7424
7425 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7426 Privately reported by Herbert J. Skuhra.
7427 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7428 All uses changed.
7429 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7430 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7431
7432 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7433
7434 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7435 last argument of make_unibyte_string.
7436
7437 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7438 language ID in the event parameters.
7439
7440 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7441 event.code, not the obscure "character set ID".
7442
7443 2012-06-23 Chong Yidong <cyd@gnu.org>
7444
7445 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7446
7447 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7448
7449 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7450 * w32.c (fdutimens): New function.
7451
7452 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7453
7454 * s/ms-w32.h (pselect): Redirect to sys_select.
7455
7456 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7457
7458 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7459 in the logic of incrementing and decrementing the value of
7460 use_relocatable_buffers.
7461
7462 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7463
7464 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7465 Privately reported by Herbert J. Skuhra.
7466 [__FreeBSD__]: Remove "*/" typo after "#include".
7467 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7468 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7469 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7470 Don't assume EMACS_TIME and struct timeval are the same type.
7471
7472 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7473
7474 Support higher-resolution time stamps (Bug#9000).
7475 The time stamps are only nanosecond-resolution at the C level,
7476 since that's the best that any real-world system supports now.
7477 But they are picosecond-resolution at the Lisp level, as that's
7478 easy, and leaves room for future OS improvements.
7479
7480 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7481 (LIBES): Use it.
7482
7483 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7484 Don't get current time unless it's needed.
7485
7486 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7487 now provides it if it's absent.
7488 (start_atimer): Port to higher-res time stamps.
7489 Check for time stamp overflow. Don't get current time more
7490 often than is needed.
7491
7492 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7493 Include systime.h, not time.h.
7494 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7495
7496 * dired.c: Include stat-time.h.
7497 (Ffile-attributes): File times now have higher resolution.
7498
7499 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7500 (struct image): Timestamp now has higher resolution.
7501
7502 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7503 has at least microseconds now. All uses removed.
7504 (update_frame, update_single_window, update_window, update_frame_1)
7505 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7506 (duration_to_sec_usec): Remove; no longer needed.
7507
7508 * editfns.c (time_overflow): Now extern.
7509 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7510 (float-time, Fformat_time_string, Fcurrent_time_string)
7511 (Fcurrent_time_zone): Accept and generate higher-resolution
7512 time stamps.
7513 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7514 (decode_time_components, lisp_seconds_argument): New functions.
7515 (make_time): Now static.
7516 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7517 Report an error if the time is invalid, rather than having the caller
7518 do that.
7519
7520 * fileio.c: Include <stat-time.h>
7521 (Fcopy_file): Copy higher-resolution time stamps.
7522 Prefer to set the time stamp via a file descriptor if that works.
7523 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7524 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7525 (Fvisited_file_modtime, Fset_visited_file_modtime):
7526 Support higher-resolution time stamps.
7527
7528 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7529
7530 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7531
7532 * image.c (prepare_image_for_display, clear_image_cache)
7533 (lookup_image): Port to higer-resolution time stamps.
7534
7535 * keyboard.c (start_polling, bind_polling_period):
7536 Check for time stamp overflow.
7537 (read_char, kbd_buffer_get_event, timer_start_idle)
7538 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7539 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7540 Port to higher-resolution time stamps. Do not assume time_t is signed.
7541 (decode_timer): New function. Timers are now vectors of length 9,
7542 not 8, to accommodate the picosecond component.
7543 (timer_check_2): Use it.
7544
7545 * nsterm.m (select_timeout, timeval_subtract): Remove.
7546 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7547 as they're a bit more accurate and handle overflow better.
7548 (ns_select): Change prototype to be compatible with pselect.
7549 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7550 * nsterm.h (ns_select): Adjust prototype.
7551
7552 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7553 us-resolution time stamps.
7554 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7555
7556 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7557
7558 * lisp.h (time_overflow): New decl.
7559 (wait_reading_process_output): First arg is now intmax_t, not int,
7560 to accommodate larger waits.
7561
7562 * process.h (struct Lisp_Process.read_output_delay):
7563 Now counts nanoseconds, not microseconds.
7564 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7565 EMACS_HAS_USECS.
7566 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7567 (wait_reading_process_output):
7568 Port to ns-resolution time stamps.
7569 (Faccept_process_output, wait_reading_process_output):
7570 Check for time stamp overflow. Do not assume time_t is signed.
7571 (select_wrapper): Remove; we now use pselect.
7572 (Fprocess_attributes): Now generates ns-resolution time stamps.
7573
7574 * sysdep.c: Include utimens.h. Don't include utime.h
7575 or worry about struct utimbuf; gnulib does that for us now.
7576 (gettimeofday): Remove; gnulib provides a substitute.
7577 (make_timeval): New function.
7578 (set_file_times): Now sets ns-resolution time stamps.
7579 New arg FD; all uses changed.
7580 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7581 (system_process_attributes):
7582 Now returns ns-resolution time stamp. All uses changed.
7583 Check for time stamp overflow.
7584
7585 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7586 provides a substitute now.
7587
7588 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7589 since it guarantees struct timespec.
7590 (EMACS_TIME): Now struct timespec, so that we can support
7591 ns-resolution time stamps.
7592 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7593 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7594 (EMACS_USECS): Remove.
7595 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7596 so multiply the arg by 1000 before storing it.
7597 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7598 New macros.
7599 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7600 Port to ns-resolution time stamps.
7601 (EMACS_TIME_NEG_P): Remove; replaced by....
7602 (EMACS_TIME_SIGN): New macro.
7603 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7604 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7605 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7606 (make_timeval, make_lisp_time, decode_time_components): New decls.
7607 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7608 that it mishandled time_t overflow. You can't compare by subtracting!
7609 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7610 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7611
7612 * term.c: Include <sys/time.h>.
7613 (timeval_to_Time): New function, for proper overflow wraparound.
7614 (term_mouse_position, term_mouse_click): Use it.
7615
7616 * undo.c (record_first_change): Support higher-resolution time stamps
7617 in the undo buffer.
7618 (Fprimitive_undo): Use them when restoring time stamps.
7619
7620 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7621 (w32_get_internal_run_time):
7622 Port to higher-resolution Emacs time stamps.
7623 (ltime): Now accepts single 64-bit integer, as that's more convenient
7624 for callers.
7625
7626 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7627
7628 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7629 for compatibility with pselect. Support ns-resolution time stamps.
7630
7631 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7632
7633 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7634 Check for time stamp overflow, and support ns-resolution time stamps.
7635
7636 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7637 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7638 (timeval_subtract): Remove; no longer needed.
7639 (XTflash, XTring_bell, x_wait_for_event):
7640 Port to ns-resolution time stamps. Don't assume time_t is signed.
7641
7642 2012-06-22 Chong Yidong <cyd@gnu.org>
7643
7644 * xdisp.c (x_consider_frame_title): Revert last change.
7645
7646 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7647
7648 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7649 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7650 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7651 staticidx goes up to 1597 out of 1600 = 0x640.)
7652
7653 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7654
7655 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7656 Otherwise, the umask might be mistakenly 0 while handling input signals.
7657
7658 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7659
7660 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7661
7662 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7663
7664 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7665 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7666 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7667 access to `contents' member of Lisp_Vector objects with AREF and ASET
7668 where appropriate.
7669
7670 2012-06-19 Chong Yidong <cyd@gnu.org>
7671
7672 * frame.c (delete_frame): When selecting a frame on a different
7673 text terminal, do not alter the terminal's top-frame.
7674
7675 * xdisp.c (format_mode_line_unwind_data): Record the target
7676 frame's selected window and its terminal's top-frame.
7677 (unwind_format_mode_line): Restore them.
7678 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7679 Callers changed.
7680 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7681 since tty frames can be explicitly named.
7682 (prepare_menu_bars): Likewise.
7683
7684 * term.c (Ftty_top_frame): New function.
7685
7686 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7687
7688 Port byte-code-meter to modern targets.
7689 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7690 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7691 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7692 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7693 (METER_1, METER_2): Simplify.
7694
7695 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7696
7697 * data.c (Fdefalias): Return `symbol' (bug#11686).
7698
7699 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7700
7701 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7702 gets killed during executing of this function (Bug#11665).
7703 Try to always return Qt when the buffer has been actually killed.
7704 (Vkill_buffer_query_functions): In doc-string say that functions
7705 run by this hook should not change the current buffer.
7706
7707 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7708
7709 Fix recently-introduced process.c problems found by static checking.
7710 * process.c (write_queue_push, write_queue_pop, send_process):
7711 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7712 (write_queue_pop): Fix pointer signedness problem.
7713 (send_process): Remove unused local.
7714
7715 2012-06-17 Chong Yidong <cyd@gnu.org>
7716
7717 * xdisp.c (redisplay_internal): No need to redisplay terminal
7718 frames that are not on top.
7719
7720 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7721
7722 * process.c (make_process): Initialize write_queue.
7723 (write_queue_push, write_queue_pop): New functions.
7724 (send_process): Use them to maintain correct ordering of process
7725 writes (Bug#10815).
7726
7727 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7728
7729 * lisp.h (eassert): Assume C89 or later.
7730 This removes the need for CHECK.
7731 (CHECK): Remove. Its comments about always evaluating its
7732 argument were confusing, as 'eassert' typically does not evaluate
7733 its argument.
7734
7735 * coding.c (produce_chars): Use ptrdiff_t, not int.
7736
7737 * xterm.c (x_draw_underwave): Check for integer overflow.
7738 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7739
7740 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7741
7742 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7743 referenced (Bug#11583).
7744
7745 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7746
7747 Implement wave-style variant of underlining.
7748 * dispextern.h (face_underline_type): New enum.
7749 (face): Add field for underline type.
7750 * nsterm.m (ns_draw_underwave): New function.
7751 (ns_draw_text_decoration): Use it.
7752 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7753 New functions.
7754 (x_draw_glyph_string): Use them.
7755 * xfaces.c (Qline, Qwave): New Lisp objects.
7756 (check_lface_attrs, merge_face_ref)
7757 (Finternal_set_lisp_face_attribute, realize_x_face):
7758 Handle wave-style underline face attributes.
7759 * xterm.c (x_draw_underwave): New function.
7760 (x_draw_glyph_string): Use it.
7761
7762 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7763
7764 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7765 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7766 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7767 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7768 ($(BLD)/w32select.$(O)): Update dependencies.
7769
7770 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7771
7772 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7773 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7774 * character.c (_fetch_multibyte_char_p): Remove.
7775 * alloc.c: Include "character.h" before "buffer.h".
7776 * bidi.c: Likewise.
7777 * buffer.c: Likewise.
7778 * bytecode.c: Likewise.
7779 * callint.c: Likewise.
7780 * callproc.c: Likewise.
7781 * casefiddle.c: Likewise.
7782 * casetab.c: Likewise.
7783 * category.c: Likewise.
7784 * cmds.c: Likewise.
7785 * coding.c: Likewise.
7786 * composite.c: Likewise.
7787 * dired.c: Likewise.
7788 * dispnew.c: Likewise.
7789 * doc.c: Likewise.
7790 * dosfns.c: Likewise.
7791 * editfns.c: Likewise.
7792 * emacs.c: Likewise.
7793 * fileio.c: Likewise.
7794 * filelock.c: Likewise.
7795 * font.c: Likewise.
7796 * fontset.c: Likewise.
7797 * fringe.c: Likewise.
7798 * indent.c: Likewise.
7799 * insdel.c: Likewise.
7800 * intervals.c: Likewise.
7801 * keyboard.c: Likewise.
7802 * keymap.c: Likewise.
7803 * lread.c: Likewise.
7804 * macros.c: Likewise.
7805 * marker.c: Likewise.
7806 * minibuf.c: Likewise.
7807 * nsfns.m: Likewise.
7808 * nsmenu.m: Likewise.
7809 * print.c: Likewise.
7810 * process.c: Likewise.
7811 * regex.c: Likewise.
7812 * region-cache.c: Likewise.
7813 * search.c: Likewise.
7814 * syntax.c: Likewise.
7815 * term.c: Likewise.
7816 * textprop.c: Likewise.
7817 * undo.c: Likewise.
7818 * unexsol.c: Likewise.
7819 * w16select.c: Likewise.
7820 * w32fns.c: Likewise.
7821 * w32menu.c: Likewise.
7822 * window.c: Likewise.
7823 * xdisp.c: Likewise.
7824 * xfns.c: Likewise.
7825 * xmenu.c: Likewise.
7826 * xml.c: Likewise.
7827 * xselect.c: Likewise.
7828
7829 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7830
7831 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7832 If all the glyphs of the glyph row came from strings, and we have no
7833 cursor positioning clues, put the cursor on the first glyph of the
7834 row.
7835 (handle_face_prop): Use chunk-relative overlay string index when
7836 indexing into it->string_overlays array. (Bug#11653)
7837 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7838 the rightmost. (Bug#11720)
7839
7840 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7841
7842 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7843 (CATEGORY_MEMBER): Enforce 1/0 value.
7844 * category.c (_temp_category_set): Remove.
7845
7846 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7847
7848 * window.c (Fdelete_other_windows_internal)
7849 (Fdelete_window_internal): Don't access frame's mouse highlight
7850 info of the initial frame. (Bug#11677)
7851
7852 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7853
7854 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7855 Assume USE_2_TAGS_FOR_INTS.
7856 (xreload): Adjust $tagmask width to match recent lisp.h change.
7857
7858 Simplify lisp.h in minor ways that should not affect code.
7859 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7860 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7861 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7862 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7863 (INTTYPEBITS): New macro, for clarity.
7864 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7865 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7866 Simplify now that USE_LSB_TAG is always defined.
7867 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7868 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7869
7870 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7871
7872 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7873
7874 2012-06-13 Glenn Morris <rgm@gnu.org>
7875
7876 * s/bsd-common.h (BSD4_3):
7877 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7878
7879 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7880
7881 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7882 instead of union.
7883 (XLI, XIL): Define.
7884 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7885 Use them.
7886 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7887 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7888 * alloc.c (widen_to_Lisp_Object): Remove.
7889 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7890 * frame.c (delete_frame): Remove outdated comment.
7891 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7892 USE_LISP_UNION_TYPE.
7893 (Fw32_unregister_hot_key): Likewise.
7894 (Fw32_toggle_lock_key): Likewise.
7895 * w32menu.c (add_menu_item): Likewise.
7896 (w32_menu_display_help): Use XIL instead of checking
7897 USE_LISP_UNION_TYPE.
7898 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7899 (init_heap): Likewise.
7900 * w32term.c (w32_read_socket): Update comment.
7901
7902 2012-06-13 Glenn Morris <rgm@gnu.org>
7903
7904 * s/usg5-4-common.h, src/s/unixware.h:
7905 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7906
7907 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7908
7909 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7910
7911 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7912 * alloc.c (make_number) [!defined make_number]:
7913 Remove, as lisp.h always defines this now.
7914 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7915 (roundup_size): Verify that it is a power of 2.
7916 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7917 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7918 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7919 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7920 USE_LSB_TAG now is always defined to be either 0 or 1.
7921 All uses changed.
7922 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7923 code works fine either way, and efficiency is not a concern here,
7924 as the union type is for debugging, not for production.
7925 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7926 Use an inline function on all platforms when using the union type,
7927 since this is simpler and 'static inline' can be used portably
7928 within Emacs now.
7929 (LISP_INITIALLY_ZERO): New macro.
7930 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7931 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7932
7933 2012-06-12 Glenn Morris <rgm@gnu.org>
7934
7935 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7936
7937 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7938
7939 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7940 Move BROKEN_SIGIO to configure.
7941
7942 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7943 Move NO_TERMIO to configure.
7944
7945 2012-06-12 Chong Yidong <cyd@gnu.org>
7946
7947 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7948 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7949 MagickExportImagePixels is undefined.
7950
7951 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7952
7953 * image.c (imagemagick_load_image): Remove unused label.
7954
7955 2012-06-11 Glenn Morris <rgm@gnu.org>
7956
7957 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7958 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7959 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7960 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7961
7962 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7963
7964 * alloc.c (make_byte_code): New function.
7965 (Fmake_byte_code): Use it. Don't purify here.
7966 * lread.c (read1): Use it as well to avoid extra allocation.
7967
7968 2012-06-11 Chong Yidong <cyd@gnu.org>
7969
7970 * image.c (imagemagick_load_image): Implement transparency.
7971
7972 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7973
7974 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7975 account for preceding backslashes. (Bug#11663)
7976
7977 2012-06-09 Chong Yidong <cyd@gnu.org>
7978
7979 * term.c: Support italics in capable terminals (Bug#9652).
7980 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7981 (turn_on_face): Output using TS_enter_italic_mode if available.
7982 Don't handle unused blinking and alt-charset cases.
7983 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7984 and tty_alt_charset_p cases.
7985 (tty_capable_p, init_tty): Support italics.
7986
7987 * termchar.h (struct tty_display_info): Add field for italics.
7988 Remove unused blink field.
7989
7990 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7991 Handle slant.
7992
7993 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7994 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7995 tty_alt_charset_p. Add tty_italic_p.
7996
7997 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7998
7999 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8000 dbus_type_is_basic if available.
8001 (xd_extract_signed, xd_extract_unsigned): Rename from
8002 extract_signed and extract_unsigned, respectively. Adapt callers.
8003
8004 2012-06-09 Chong Yidong <cyd@gnu.org>
8005
8006 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8007
8008 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8009 case (Bug#9752).
8010
8011 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8012
8013 * xdisp.c (vmessage): Treat frame message as multibyte.
8014 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8015 would generate the diagnostic "Making \302\247 buffer-local while
8016 let-bound!".
8017
8018 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8019
8020 * dispnew.c (showing_window_margins_p): Undo last change, which
8021 was done due to an inadvertent commit.
8022 (adjust_frame_glyphs_for_frame_redisplay): Do call
8023 showing_window_margins_p.
8024
8025 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8026
8027 * eval.c (Fmake_var_non_special): New primitive.
8028 (syms_of_eval): Defsubr it.
8029 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8030
8031 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
8032
8033 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8034 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8035
8036 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8037
8038 * alloc.c (allocate_vectorlike): Fix last change.
8039
8040 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8041
8042 Block-based vector allocation of small vectors.
8043 * lisp.h (struct vectorlike_header): New field `nbytes',
8044 adjust comment accordingly.
8045 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8046 to denote vector blocks. Adjust users (live_vector_p,
8047 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8048 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8049 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8050 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8051 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8052 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8053 (roundup_size): New constant.
8054 (struct vector_block): New data type.
8055 (vector_blocks, vector_free_lists, zero_vector): New variables.
8056 (all_vectors): Rename to `large_vectors'.
8057 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8058 (sweep_vectors): New functions.
8059 (allocate_vectorlike): Return `zero_vector' as the only vector of
8060 0 items. Allocate new vector from block if vector size is less than
8061 or equal to VBLOCK_BYTES_MAX.
8062 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8063 (init_alloc_once): Add call to init_vectors.
8064
8065 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8066
8067 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8068
8069 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8070
8071 * doprnt.c (doprnt): Truncate multibyte char correctly.
8072 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8073 would mishandle a string argument "Xc" if X was a multibyte
8074 character of length 2: it would truncate after X's first byte
8075 rather than including all of X.
8076
8077 2012-06-06 Chong Yidong <cyd@gnu.org>
8078
8079 * buffer.c (word_wrap): Doc fix.
8080
8081 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8082
8083 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8084
8085 2012-06-03 Glenn Morris <rgm@gnu.org>
8086
8087 * xdisp.c (tool-bar-style): Doc fix.
8088
8089 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8090
8091 * Makefile.in (PAXCTL): Define.
8092 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8093 binary via PaX flags if the paxctl utility is available.
8094 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8095 Restore PaX flags to their default. (Bug#11398)
8096
8097 2012-06-03 Chong Yidong <cyd@gnu.org>
8098
8099 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8100 buffer (Bug#11226).
8101
8102 2012-06-03 Chong Yidong <cyd@gnu.org>
8103
8104 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8105 (note_mode_line_or_margin_highlight): If there is no help echo,
8106 use mode-line-default-help-echo. Handle the case where the mouse
8107 position is past the end of the mode line string.
8108
8109 * buffer.c (buffer_local_value_1): New function, split from
8110 Fbuffer_local_value; can return Qunbound.
8111 (Fbuffer_local_value): Use it.
8112 (Vmode_line_format): Docstring tweaks.
8113
8114 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8115
8116 * sysdep.c (system_process_attributes): Improve comment.
8117
8118 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8119
8120 * keyboard.c: Export real-this-command to Elisp.
8121 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8122 and DEFVAR it. Update all users.
8123
8124 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8125
8126 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8127
8128 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8129 Convert pctcpu and pctmem to Lisp float properly.
8130 Let the compiler fold better, as 100.0/0x8000 is exact.
8131
8132 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8133
8134 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8135 cons_block.
8136
8137 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8138
8139 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8140
8141 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8142
8143 For a 'struct window', replace some Lisp_Object fields to
8144 bitfields where appropriate, remove unused fields.
8145 * window.h (struct window): Remove unused 'last_mark_x' and
8146 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8147 change its type from Lisp_Object to bitfield.
8148 Change type of 'force_start', 'optional_new_start',
8149 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8150 fields from Lisp_Object to bitfield. Adjust users accordingly.
8151
8152 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8153
8154 Pacify gcc -Wdouble-precision when using Xaw.
8155 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8156 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8157 Use 'float' consistently, rather than 'float' in most places
8158 and 'double' in a couple of places.
8159
8160 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8161
8162 * xdisp.c (handle_stop): Detect whether we have overlay strings
8163 loaded by testing it->current.overlay_string_index to be
8164 non-negative, instead of checking whether n_overlay_strings is
8165 positive. (Bug#11587)
8166
8167 2012-05-31 Chong Yidong <cyd@gnu.org>
8168
8169 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8170
8171 * doc.c (Fsubstitute_command_keys): Doc fix.
8172
8173 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8174
8175 * search.c (search_buffer): Remove calls to
8176 r_alloc_inhibit_buffer_relocation, as it is now called by
8177 maybe_unify_char, which was the cause of relocation of buffer text
8178 in bug#11519.
8179
8180 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8181
8182 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8183 for the duration of call to load_charset, to avoid problems with
8184 callers of maybe_unify_char that access buffer text through C
8185 pointers.
8186
8187 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8188 decrement the inhibition flag, instead of just setting or
8189 resetting it.
8190
8191 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8192
8193 Remove obsolete '#define static' cruft.
8194 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8195 This #undef was "temporary" in 2000; it is no longer needed
8196 now that '#define static' has gone away.
8197 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8198 (gray_bitmap_bits): Remove; no longer needed.
8199 All uses replaced with definiens.
8200 * xterm.c: Include "bitmaps/gray.xbm".
8201
8202 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8203
8204 Clean up __executable_start, monstartup when --enable-profiling.
8205 The following changes affect the code only when profiling.
8206 * dispnew.c (__executable_start): Rename from safe_bcopy.
8207 Define only on platforms that need it.
8208 * emacs.c: Include <sys/gmon.h> when profiling.
8209 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8210 (__executable_start): Remove decl, since lisp.h does it now.
8211 (safe_bcopy): Remove decl; no longer has that name.
8212 (main): Coalesce #if into single bit of code, for simplicity.
8213 Cast pointers to uintptr_t, since standard libraries want integers
8214 and not pointers.
8215 * lisp.h (__executable_start): New decl.
8216
8217 2012-05-31 Glenn Morris <rgm@gnu.org>
8218
8219 * image.c (Fimagemagick_types): Doc fix.
8220
8221 2012-05-30 Jim Meyering <meyering@redhat.com>
8222
8223 * callproc.c (Fcall_process_region): Include directory component
8224 in mkstemp error message (Bug#11586).
8225
8226 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8227
8228 * alloc.c, lisp.h (make_pure_vector): Now static.
8229
8230 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8231
8232 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8233 Move to byte-run.el.
8234 (Fautoload): Do the hash-doc more carefully.
8235 * data.c (Fdefalias): Purify definition, except for keymaps.
8236 (Qdefun): Move from eval.c.
8237 * lisp.h (Qdefun): Remove.
8238 * lread.c (read1): Tiny simplification.
8239
8240 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8241
8242 Do not create empty overlays with the evaporate property (Bug#9642).
8243 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8244 Bug#9642, but explicitly check that the buffer the overlay would
8245 be moved to is live and rearrange lines to make sure that errors
8246 will not put the overlay in an inconsistent state.
8247 (Fdelete_overlay): Cosmetics.
8248
8249 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8250
8251 * w32term.c (my_bring_window_to_top): New function.
8252 (x_raise_frame): Use handle returned by DeferWindowPos, which
8253 could be different from the original one.
8254 Call my_bring_window_to_top instead of my_set_foreground_window.
8255 (Bug#11513)
8256
8257 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8258 by calling BringWindowToTop.
8259
8260 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8261 (WM_EMACS_END): Increase by one.
8262
8263 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8264
8265 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8266 This avoids undefined behavior that might cause the eassert
8267 to not catch an out-of-range value.
8268
8269 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8270
8271 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8272 Update dependencies.
8273
8274 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8275
8276 * bidi.c (bidi_mirror_char): Fix last change.
8277
8278 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8279
8280 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8281 when referring to sectname field in printf format.
8282
8283 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8284
8285 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8286 Only r_alloc_inhibit_buffer_relocation needed to be added;
8287 the others were already declared.
8288
8289 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8290 before checking whether it's out of range. Put the check inside
8291 eassert. See
8292 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8293
8294 2012-05-27 Ken Brown <kbrown@cornell.edu>
8295
8296 * callproc.c (Fcall_process): Restore a line that was accidentally
8297 commented out in the 2011-02-13 change (bug#11547).
8298
8299 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8300
8301 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8302 defined on ralloc.c.
8303
8304 * buffer.c [REL_ALLOC]: Remove prototypes of
8305 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8306 they are now on lisp.h.
8307
8308 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8309
8310 * search.c (search_buffer): Use it to inhibit relocation of buffer
8311 text while re_search_2 is doing its job, because re_search_2 is
8312 passed C pointers to buffer text. (Bug#11519)
8313
8314 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8315 Update value to 24.
8316
8317 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8318 state after an additional call to move_it_in_display_line_to, keep
8319 the values of it->max_ascent and it->max_descent found for the
8320 entire line.
8321 (pos_visible_p): Revert the comparison against bottom_y to what it
8322 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8323 (Bug#11464)
8324
8325 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8326
8327 Fix coding-related core dumps with gcc -ftrapv.
8328 The code was computing A - B, where A and B are pointers, and B is
8329 random garbage. This can lead to core dumps on platforms that
8330 have special pointer registers, and it also leads to core dumps on
8331 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8332 A - B only when B is initialized properly.
8333 * coding.c (coding_set_source, coding_set_destination): Return void.
8334 (coding_change_source, coding_change_destinations): New functions,
8335 with the old behaviors of coding_set_source and coding_set_destination.
8336 All callers that need an offset changed to use these new functions.
8337
8338 2012-05-26 Glenn Morris <rgm@gnu.org>
8339
8340 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8341
8342 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8343
8344 Extend mouse support on W32 text-mode console.
8345 * xdisp.c (draw_row_with_mouse_face):
8346 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8347
8348 * w32console.c: Include window.h.
8349 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8350 New functions.
8351 (initialize_w32_display): Initialize mouse-highlight data.
8352
8353 * w32inevt.c: Include termchar.h and window.h.
8354 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8355 moves, call note_mouse_highlight. If help_echo changed, call
8356 gen_help_event to produce help-echo message in the echo area.
8357 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8358 highlight info.
8359
8360 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8361
8362 * lread.c (read1): Simplify slightly to avoid an overflow warning
8363 with GCC 4.7.0 on x86-64.
8364
8365 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8366
8367 * bidi.c (bidi_mirror_char): Revert last change: an int is
8368 definitely wide enough here.
8369
8370 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8371
8372 Fix integer width and related bugs (Bug#9874).
8373 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8374 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8375 (string_bytes, check_sblock, allocate_string_data):
8376 (compact_small_strings, Fmake_bool_vector, make_string)
8377 (make_unibyte_string, make_multibyte_string)
8378 (make_string_from_bytes, make_specified_string)
8379 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8380 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8381 (mark_vectorlike):
8382 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8383 (allocate_pseudovector):
8384 Use int, not EMACS_INT, where int is wide enough.
8385 (inhibit_garbage_collection, Fgarbage_collect):
8386 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8387 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8388 int might not be wide enough.
8389 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8390 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8391 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8392 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8393 (bidi_level_of_next_char, bidi_move_to_visually_next):
8394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8395 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8396 (Fkill_buffer, Fset_buffer_major_mode)
8397 (advance_to_char_boundary, Fbuffer_swap_text)
8398 (Fset_buffer_multibyte, overlays_at, overlays_in)
8399 (overlay_touches_p, struct sortvec, record_overlay_string)
8400 (overlay_strings, recenter_overlay_lists)
8401 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8402 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8403 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8404 (Foverlay_recenter, last_overlay_modification_hooks_used)
8405 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8407 (validate_region): Omit unnecessary test for b <= e,
8408 since that's guaranteed by the previous test.
8409 (adjust_overlays_for_delete): Avoid pos + length overflow.
8410 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8411 (report_overlay_modification):
8412 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8413 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8414 Omit pointer cast, which isn't needed anyway, and doesn't work
8415 after the EMACS_INT -> ptrdiff_t change.
8416 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8417 * buffer.h: Adjust decls to match defn changes elsewhere.
8418 (struct buffer_text, struct buffer):
8419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8420 Use EMACS_INT, not int, where int might not be wide enough.
8421 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8422 not int, to avoid needless 32-bit limit on 64-bit hosts.
8423 (exec_byte_code): Use tighter memory-full test, one that checks
8424 for alloca overflow. Don't compute the address of the object just
8425 before an array, as that's not portable. Use EMACS_INT, not
8426 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8427 * callint.c (Fcall_interactively):
8428 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8429 * callproc.c (call_process_kill, Fcall_process):
8430 Don't assume pid_t fits into an Emacs fixnum.
8431 (call_process_cleanup, Fcall_process, child_setup):
8432 Don't assume pid_t fits into int.
8433 (call_process_cleanup, Fcall_process, delete_temp_file)
8434 (Fcall_process_region):
8435 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8436 (Fcall_process): Simplify handling of volatile integers.
8437 Use int, not EMACS_INT, where int will do.
8438 * casefiddle.c (casify_object, casify_region, operate_on_word)
8439 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8440 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8441 (casify_object): Avoid integer overflow when overallocating buffer.
8442 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8443 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8444 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8445 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8446 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8447 integers are now checked earlier. All uses replaced with XINT.
8448 (ccl_driver):
8449 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8450 For CCL_MapSingle, check that content and value are in int range.
8451 (ccl_driver, Fregister_code_conversion_map):
8452 Check that Vcode_version_map_vector is a vector.
8453 (resolve_symbol_ccl_program): Check that vector header is in range.
8454 Always copy the vector, so that we can check its contents reliably
8455 now rather than having to recheck each instruction as it's being
8456 executed. Check that vector words fit in 'int'.
8457 (ccl_get_compiled_code, Fregister_ccl_program)
8458 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8459 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8460 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8461 contents are in range.
8462 (Fccl_execute_on_string): Check that status is in range.
8463 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8464 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8465 Accept and return EMACS_INT, not int, because callers can pass values
8466 out of 'int' range.
8467 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8468 (multibyte_chars_in_text, parse_str_as_multibyte)
8469 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8470 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8471 (string_escape_byte8, Fget_byte):
8472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8473 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8474 avoid mishandling large integers.
8475 * character.h: Adjust decls to match defn changes elsewhere.
8476 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8477 (Ffind_charset_region):
8478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8479 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8480 (load_charset_map_from_vector, Fdefine_charset_internal):
8481 Don't assume fixnum fits in int.
8482 (load_charset_map_from_vector, Fmap_charset_chars):
8483 Remove now-unnecessary CHECK_NATNUMs.
8484 (Fdefine_charset_internal): Check ranges here, more carefully.
8485 Don't rely on undefined behavior with signed left shift overflow.
8486 Don't assume unsigned int fits into fixnum, or that fixnum fits
8487 into unsigned int. Don't require max_code to be a valid fixnum;
8488 that's not true for gb10830 4-byte on a 32-bit host. Allow
8489 invalid_code to be a cons, for the same reason. Require code_offset
8490 to be a character. Avoid int overflow if max_char is close
8491 to INT_MAX.
8492 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8493 this is intended anyway and avoids some undefined behavior.
8494 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8495 INDEX_TO_CODE_POINT, as that's what it expects.
8496 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8497 * charset.h (DECODE_CHAR): Return int, not unsigned;
8498 this is what was intended anyway, and it avoids undefined behavior.
8499 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8500 integer-overflow issues.
8501 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8502 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8503 where the argument is EMACS_INT, and this behavior is not intended.
8504 * chartab.c (Fmake_char_table, Fset_char_table_range)
8505 (uniprop_get_decoder, uniprop_get_encoder):
8506 Don't assume fixnum fits in int.
8507 * cmds.c (move_point): New function, that does the gist of
8508 Fforward_char and Fbackward_char, but does so while checking
8509 for integer overflow more accurately.
8510 (Fforward_char, Fbackward_char): Use it.
8511 (Fforward_line, Fend_of_line, internal_self_insert)
8512 (internal_self_insert):
8513 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8514 Fix a FIXME, by checking for integer overflow when calculating
8515 target_clm and actual_clm.
8516 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8517 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8518 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8519 (coding_alloc_by_making_gap, alloc_destination)
8520 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8521 (encode_coding_utf_16, detect_coding_emacs_mule)
8522 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8523 (detect_coding_iso_2022, decode_coding_iso_2022)
8524 (encode_invocation_designation, encode_designation_at_bol)
8525 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8526 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8527 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8528 (encode_coding_ccl, encode_coding_raw_text)
8529 (detect_coding_charset, decode_coding_charset)
8530 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8531 (produce_composition, produce_charset, produce_annotation)
8532 (decode_coding, handle_composition_annotation)
8533 (handle_charset_annotation, consume_chars, decode_coding_gap)
8534 (decode_coding_object, encode_coding_object, detect_coding_system)
8535 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8536 (code_convert_region, code_convert_string)
8537 (Fdefine_coding_system_internal)
8538 (coding_set_source, coding_set_destination):
8539 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8540 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8541 (Fdefine_coding_system_internal):
8542 Don't assume fixnums fit in int.
8543 (decode_coding_gap, decode_coding_object, encode_coding_object)
8544 (Fread_coding_system, Fdetect_coding_region)
8545 (Funencodable_char_position, Fcheck_coding_systems_region)
8546 (get_translation, handle_composition_annotation, consume_chars):
8547 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8548 (consume_chars): Rewrite to not calculate an address outside buffer.
8549 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8550 Don't access memory outside of the args array.
8551 (Fdefine_coding_system_internal): Check for charset-id overflow.
8552 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8553 result of ENCODE_CHAR.
8554 * coding.h: Adjust decls to match defn changes elsewhere.
8555 (struct coding_system):
8556 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8557 * composite.c (get_composition_id, find_composition)
8558 (run_composition_function, update_compositions)
8559 (compose_text, composition_gstring_put_cache)
8560 (composition_gstring_p, composition_gstring_width)
8561 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8562 (composition_compute_stop_pos, composition_reseat_it)
8563 (composition_update_it, struct position_record)
8564 (find_automatic_composition, composition_adjust_point)
8565 (Fcomposition_get_gstring, Ffind_composition_internal):
8566 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8567 (update_compositions):
8568 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8569 * composite.h: Adjust decls to match defn changes elsewhere.
8570 (struct composition):
8571 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8572 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8573 Do not attempt to compute the address of the object just before a
8574 buffer; this is not portable.
8575 (Faref, Faset):
8576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8577 (Faset): Use int, not EMACS_INT, where int is wide enough.
8578 (Fstring_to_number): Don't assume fixnums fit in int.
8579 (Frem): Don't assume arg is nonnegative.
8580 * dbusbind.c (xd_append_arg): Check for integers out of range.
8581 (Fdbus_call_method): Don't overflow the timeout int.
8582 (extract_signed, extract_unsigned): New functions.
8583 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8584 (xd_get_connection_references): Return ptrdiff_t, not int.
8585 All uses changed.
8586 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8587 (xd_read_message_1):
8588 Use int, not unsigned, where the dbus API uses int.
8589 (Fdbus_message_internal): Don't overflow mtype.
8590 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8591 * dired.c (directory_files_internal, file_name_completion, scmp)
8592 (file_name_completion_stat):
8593 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8594 (file_name_completion): Don't overflow matchcount.
8595 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8596 * dispextern.h: Adjust decls to match defn changes elsewhere.
8597 (struct text_pos, struct glyph, struct bidi_saved_info)
8598 (struct bidi_string_data, struct bidi_it, struct composition_it)
8599 (struct it):
8600 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8601 (struct display_pos, struct composition_it, struct it):
8602 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8603 * dispnew.c (increment_matrix_positions)
8604 (increment_row_positions, mode_line_string)
8605 (marginal_area_string):
8606 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8607 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8608 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8609 (duration_to_sec_usec): New function, to check for overflow better.
8610 (Fsleep_for, sit_for): Use it.
8611 * doc.c (get_doc_string, store_function_docstring):
8612 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8613 (get_doc_string, Fsnarf_documentation):
8614 Use int, not EMACS_INT, where int is wide enough.
8615 (get_doc_string):
8616 Use SAFE_ALLOCA, not alloca.
8617 Check for overflow when converting EMACS_INT to off_t.
8618 * doprnt.c (doprnt):
8619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8620 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8621 Don't assume uid_t fits into fixnum.
8622 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8623 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8624 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8625 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8626 (general_insert_function)
8627 (Finsert_char, make_buffer_string, make_buffer_string_both)
8628 (update_buffer_properties, Fbuffer_substring)
8629 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8630 (Fsubst_char_in_region, check_translation)
8631 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8632 (transpose_markers, Ftranspose_regions):
8633 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8634 (clip_to_bounds): Move to lisp.h as an inline function).
8635 (Fconstrain_to_field): Don't assume integers are nonnegative.
8636 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8637 (Fsubst_char_in_region, Fsave_restriction):
8638 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8639 (Femacs_pid): Don't assume pid_t fits into fixnum.
8640 (lo_time): Use int, not EMACS_INT, when int suffices.
8641 (lisp_time_argument): Check for usec out of range.
8642 (Fencode_time): Don't assume fixnum fits in int.
8643 (Fuser_login_name, Fuser_full_name): Signal an error
8644 if a uid argument is out of range, rather than relying on
8645 undefined behavior.
8646 (Fformat_time_string): Remove now-unnecessary check.
8647 lisp_time_argument checks for out-of-range usec now.
8648 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8649 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8650 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8651 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8652 (init_cmdargs, Fdump_emacs):
8653 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8654 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8655 the bottom (typically) 32 bits of the fixnum.
8656 * eval.c (specpdl_size, call_debugger):
8657 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8658 (when_entered_debugger, Fbacktrace_debug):
8659 Don't assume fixnum can fit in int.
8660 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8661 the object just before a buffer; this is not portable.
8662 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8663 (grow_specpdl, unbind_to):
8664 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8665 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8666 (grow_specpdl): Simplify allocation by using xpalloc.
8667 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8668 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8669 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8670 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8671 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8672 (a_write, e_write):
8673 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8674 (Fcopy_file, non_regular_nbytes, read_non_regular)
8675 (Finsert_file_contents):
8676 Use int, not EMACS_INT, where int is wide enough.
8677 (READ_BUF_SIZE): Verify that it fits in int.
8678 (Finsert_file_contents): Check that counts are in proper range,
8679 rather than assuming fixnums fit into ptrdiff_t etc.
8680 Don't assume fixnums fit into int.
8681 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8682 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8683 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8684 (string_char_to_byte, string_byte_to_char)
8685 (string_make_multibyte, string_to_multibyte)
8686 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8687 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8688 (substring_both, Fdelete, internal_equal, Ffillarray)
8689 (Fclear_string, mapcar1)
8690 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8691 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8692 (larger_vector, make_hash_table, maybe_resize_hash_table)
8693 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8694 (Fmaphash, secure_hash):
8695 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8696 (concat): Check for string index and length overflow.
8697 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8698 (Frequire):
8699 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8700 (larger_vector): New API (vec, incr_min, size_max) replaces old
8701 one (vec, new_size, init). This catches size overflow.
8702 INIT was removed because it was always Qnil.
8703 All callers changed.
8704 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8705 the upper bound on a hash table index size.
8706 (make_hash_table, maybe_resize_hash_table): Use it.
8707 (secure_hash): Computer start_byte and end_byte only after
8708 they're known to be in ptrdiff_t range.
8709 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8710 (Ffont_get_glyphs, Ffont_at):
8711 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8712 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8713 (Flist_fonts, Fopen_font):
8714 Don't assume fixnum can fit in int.
8715 (check_gstring): Don't assume index can fit in int.
8716 (font_match_p): Check that fixnum is a character, not a nonnegative
8717 fixnum, since the later code needs to stuff it into an int.
8718 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8719 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8720 conversion overflow issues.
8721 (Fopen_font): Check for integer out of range.
8722 (Ffont_get_glyphs): Don't assume index can fit in int.
8723 * font.h: Adjust decls to match defn changes elsewhere.
8724 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8725 integer overflow.
8726 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8727 printmax_t, where ptrdiff_t is wide enough.
8728 (Finternal_char_font):
8729 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8730 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8731 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8732 (Fset_frame_position, x_set_frame_parameters)
8733 (x_set_line_spacing, x_set_border_width)
8734 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8735 Check that fixnums are in proper range for system types.
8736 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8737 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8738 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8739 Use SAFE_ALLOCA_LISP, not alloca.
8740 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8741 intptr_t is wide enough.
8742 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8743 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8744 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8745 Check for fixnum out of range.
8746 * ftfont.c (ftfont_list): Don't assume index fits in int.
8747 Check that fixnums are in proper range for system types.
8748 (ftfont_shape_by_flt):
8749 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8750 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8752 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8753 Check that fixnums are in proper range for system types.
8754 * gnutls.h: Adjust decls to match defn changes elsewhere.
8755 * gtkutil.c (xg_dialog_run):
8756 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8757 (update_frame_tool_bar):
8758 Check that fixnums are in proper range for system types.
8759 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8760 (lookup_image): Check that fixnums are in range for system types.
8761 * indent.c (last_known_column, last_known_column_point):
8762 (current_column_bol_cache):
8763 (skip_invisible, current_column, check_display_width):
8764 (check_display_width, scan_for_column, current_column_1)
8765 (Findent_to, Fcurrent_indentation, position_indentation)
8766 (indented_beyond_p, Fmove_to_column, compute_motion):
8767 (Fcompute_motion, Fvertical_motion):
8768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8769 (last_known_column_modified): Use EMACS_INT, not int.
8770 (check_display_width):
8771 (Fcompute_motion):
8772 Check that fixnums and floats are in proper range for system types.
8773 (compute_motion): Don't assume index or fixnum fits in int.
8774 (compute_motion, Fcompute_motion):
8775 Use int, not EMACS_INT, when it is wide enough.
8776 (vmotion): Omit local var start_hpos that is always 0; that way
8777 we don't need to worry about overflow in expressions involving it.
8778 * indent.h: Adjust decls to match defn changes elsewhere.
8779 (struct position):
8780 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8781 Use int, not EMACS_INT, where int is wide enough.
8782 Remove unused members ovstring_chars_done and tab_offset;
8783 all uses removed.
8784 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8785 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8786 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8787 (make_gap, copy_text, insert, insert_and_inherit)
8788 (insert_before_markers, insert_before_markers_and_inherit)
8789 (insert_1, count_combining_before, count_combining_after)
8790 (insert_1_both, insert_from_string)
8791 (insert_from_string_before_markers, insert_from_string_1)
8792 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8793 (adjust_after_replace, adjust_after_insert, replace_range)
8794 (replace_range_2, del_range, del_range_1, del_range_byte)
8795 (del_range_both, del_range_2, modify_region)
8796 (prepare_to_modify_buffer, signal_before_change)
8797 (signal_after_change, Fcombine_after_change_execute):
8798 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8799 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8800 (balance_an_interval, split_interval_right, split_interval_left)
8801 (find_interval, next_interval, update_interval)
8802 (adjust_intervals_for_insertion, delete_node, delete_interval)
8803 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8804 (static_offset_intervals, offset_intervals)
8805 (merge_interval_right, merge_interval_left, make_new_interval)
8806 (graft_intervals_into_buffer, temp_set_point_both)
8807 (temp_set_point, set_point, adjust_for_invis_intang)
8808 (set_point_both, move_if_not_intangible, get_property_and_range)
8809 (get_local_map, copy_intervals, copy_intervals_to_string)
8810 (compare_string_intervals, set_intervals_multibyte_1):
8811 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8812 * intervals.h: Adjust decls to match defn changes elsewhere.
8813 (struct interval):
8814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8815 * keyboard.c (this_command_key_count, this_single_command_key_start)
8816 (before_command_key_count, before_command_echo_length, echo_now)
8817 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8818 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8819 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8820 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8821 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8822 (last_non_minibuf_size, last_point_position, echo_truncate)
8823 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8824 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8825 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8826 (stuff_buffered_input):
8827 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8828 (last_auto_save, command_loop_1, read_char):
8829 Use EMACS_INT, not int, to avoid integer overflow.
8830 (record_char): Avoid overflow in total_keys computation.
8831 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8832 * keyboard.h: Adjust decls to match defn changes elsewhere.
8833 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8834 (Fkey_description, Fdescribe_vector, Flookup_key):
8835 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8836 (click_position): New function, to check that positions are in range.
8837 (Fcurrent_active_maps):
8838 (describe_command):
8839 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8840 (Faccessible_keymaps, Fkey_description):
8841 (preferred_sequence_p):
8842 Don't assume fixnum can fit into int.
8843 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8844 Check for integer overflow in size calculations.
8845 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8846 avoid mishandling large integers.
8847 * lisp.h: Adjust decls to match defn changes elsewhere.
8848 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8849 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8850 (struct Lisp_Marker):
8851 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8852 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8853 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8854 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8855 All callers changed.
8856 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8857 Assume the arg has valid form, since it always does.
8858 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8859 unsigned integer system type.
8860 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8861 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8862 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8863 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8864 (duration_to_sec_usec): New decl.
8865 * lread.c (read_from_string_index, read_from_string_index_byte)
8866 (read_from_string_limit, readchar, unreadchar, openp)
8867 (read_internal_start, read1, oblookup):
8868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8869 (Fload, readevalloop, Feval_buffer, Feval_region):
8870 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8871 (openp): Check for out-of-range argument to 'access'.
8872 (read1): Use int, not EMACS_INT, where int is wide enough.
8873 Don't assume fixnum fits into int.
8874 Fix off-by-one error that can read outside a buffer.
8875 (read_filtered_event): Use duration_to_sec_usec
8876 to do proper overflow checking on durations.
8877 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8878 in size calculation.
8879 (Fexecute_kbd_macro):
8880 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8881 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8882 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8883 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8884 (set_marker_both, set_marker_restricted_both, marker_position)
8885 (marker_byte_position, Fbuffer_has_markers_at):
8886 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8887 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8888 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8889 It now merely ensures that the menu is large enough, without
8890 necessarily growing it, as this avoids some integer overflow issues.
8891 All callers changed.
8892 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8893 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8894 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8895 Use SAFE_ALLOCA_LISP, not alloca.
8896 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8897 to EMACS_INT. Check that fixnums are in proper range for system types.
8898 * minibuf.c (minibuf_prompt_width, string_to_object)
8899 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8900 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8901 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8902 (get_minibuffer, read_minibuf_unwind):
8903 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8904 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8905 this simplifies overflow checking. All callers changed.
8906 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8907 (Ftest_completion):
8908 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8909 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8910 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8911 Check that fixnums are in proper range for system types.
8912 (Fx_create_frame, Fx_show_tip):
8913 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8914 * nsfont.m (ns_findfonts, nsfont_list_family):
8915 Don't assume fixnum fits in long.
8916 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8917 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8918 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8919 wide enough.
8920 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8922 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8923 (PRINTDECLARE, PRINTPREPARE):
8924 (strout, print_string):
8925 (print, print_preprocess, print_check_string_charset_prop)
8926 (print_object):
8927 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8928 (PRINTDECLARE):
8929 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8931 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8932 (printchar, strout): Use xpalloc to catch size calculation overflow.
8933 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8934 (print_error_message): Use SAFE_ALLOCA, not alloca.
8935 (print_object): Use int, not EMACS_INT, where int is wide enough.
8936 (print_depth, new_backquote_output, print_number_index):
8937 Use ptrdiff_t, not int, where int might not be wide enough.
8938 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8939 (Fset_process_window_size, Fformat_network_address)
8940 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8941 (sigchld_handler):
8942 Check that fixnums are in proper range for system types.
8943 (Fsignal_process): Simplify by avoiding a goto.
8944 Check for process-ids out of pid_t range rather than relying on
8945 undefined behavior.
8946 (process_tick, update_tick): Use EMACS_INT, not int.
8947 (Fformat_network_address, read_process_output, send_process)
8948 (Fprocess_send_region, status_notify):
8949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8950 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8951 (wait_reading_process_output, read_process_output, exec_sentinel):
8952 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8953 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8954 (Faccept_process_output): Use duration_to_sec_usec to do proper
8955 overflow checking on durations.
8956 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8957 Don't assume pid_t fits in int.
8958 * process.h (struct Lisp_Process): Members tick and update_tick
8959 are now of type EMACS_INT, not int.
8960 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8961 configured --with-wide-int.
8962 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8963 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8964 * search.c (looking_at_1, string_match_1):
8965 (fast_string_match, fast_c_string_match_ignore_case)
8966 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8967 (scan_newline, find_before_next_newline, search_command)
8968 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8969 (set_search_regs, wordify):
8970 (Freplace_match):
8971 (Fmatch_data):
8972 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8973 (string_match_1, search_buffer, set_search_regs):
8974 (Fmatch_data):
8975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8976 (wordify): Check for overflow in size calculation.
8977 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8978 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8979 Check that fixnums are in proper range for system types.
8980 * sound.c (struct sound_device)
8981 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8982 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8983 (Fplay_sound_internal):
8984 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8985 * syntax.c (struct lisp_parse_state, find_start_modiff)
8986 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8987 (Fparse_partial_sexp):
8988 Don't assume fixnums can fit in int.
8989 (struct lisp_parse_state, find_start_pos, find_start_value)
8990 (find_start_value_byte, find_start_begv)
8991 (update_syntax_table, char_quoted, dec_bytepos)
8992 (find_defun_start, prev_char_comend_first, back_comment):
8993 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8994 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8996 (Finternal_describe_syntax_value): Check that match_lisp is a
8997 character, not an integer, since the code stuffs it into int.
8998 (scan_words, scan_sexps_forward):
8999 Check that fixnums are in proper range for system types.
9000 (Fforward_word):
9001 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9002 (scan_sexps_forward):
9003 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9004 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9005 * syntax.h: Adjust decls to match defn changes elsewhere.
9006 (struct gl_state_s):
9007 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9008 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9009 MOST_POSITIVE_FIXNUM.
9010 * sysdep.c (wait_for_termination_1, wait_for_termination)
9011 (interruptible_wait_for_termination, mkdir):
9012 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9013 (emacs_read, emacs_write):
9014 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9015 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9016 and double all fit in int.
9017 * term.c (set_tty_color_mode):
9018 Check that fixnums are in proper range for system types.
9019 * termhooks.h (struct input_event):
9020 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9021 * textprop.c (validate_interval_range, interval_of)
9022 (Fadd_text_properties, set_text_properties_1)
9023 (Fremove_text_properties, Fremove_list_of_text_properties)
9024 (Ftext_property_any, Ftext_property_not_all)
9025 (copy_text_properties, text_property_list, extend_property_ranges)
9026 (verify_interval_modification):
9027 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9028 (Fnext_single_char_property_change)
9029 (Fprevious_single_char_property_change):
9030 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9031 (copy_text_properties):
9032 Check for integer overflow in index calculation.
9033 * undo.c (last_boundary_position, record_point, record_insert)
9034 (record_delete, record_marker_adjustment, record_change)
9035 (record_property_change):
9036 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9037 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9038 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9039 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9040 (Fx_hide_tip, Fx_file_dialog):
9041 * w32menu.c (set_frame_menubar):
9042 Use ptrdiff_t, not int, for consistency with rest of code.
9043 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9044 (select_window, Fdelete_other_windows_internal)
9045 (window_scroll_pixel_based, window_scroll_line_based)
9046 (Frecenter, Fset_window_configuration):
9047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9048 (Fset_window_hscroll, run_window_configuration_change_hook)
9049 (set_window_buffer, temp_output_buffer_show, scroll_command)
9050 (Fscroll_other_window, Frecenter):
9051 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9052 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9053 Don't assume fixnum fits in int.
9054 (Fset_window_scroll_bars):
9055 Check that fixnums are in proper range for system types.
9056 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9057 (string_pos, c_string_pos, number_of_chars, init_iterator)
9058 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9059 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9060 (compute_display_string_end, handle_face_prop)
9061 (face_before_or_after_it_pos, handle_invisible_prop)
9062 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9063 (display_prop_intangible_p, string_buffer_position_lim)
9064 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9065 (get_overlay_strings_1, get_overlay_strings)
9066 (iterate_out_of_display_property, forward_to_next_line_start)
9067 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9068 (get_next_display_element, set_iterator_to_next)
9069 (get_visually_first_element, compute_stop_pos_backwards)
9070 (handle_stop_backwards, next_element_from_buffer)
9071 (move_it_in_display_line_to, move_it_in_display_line)
9072 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9073 (add_to_log, message_dolog, message_log_check_duplicate)
9074 (message2, message2_nolog, message3, message3_nolog
9075 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9076 (current_message_1, truncate_echo_area, truncate_message_1)
9077 (set_message, set_message_1, store_mode_line_noprop)
9078 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9079 (text_outside_line_unchanged_p, check_point_in_composition)
9080 (reconsider_clip_changes)
9081 (redisplay_internal, set_cursor_from_row, try_scrolling)
9082 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9083 (redisplay_window, find_last_unchanged_at_beg_row)
9084 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9085 (trailing_whitespace_p, find_row_edges, display_line)
9086 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9087 (display_mode_element, store_mode_line_string)
9088 (pint2str, pint2hrstr, decode_mode_spec)
9089 (display_count_lines, display_string, draw_glyphs)
9090 (x_produce_glyphs, x_insert_glyphs)
9091 (rows_from_pos_range, mouse_face_from_buffer_pos)
9092 (fast_find_string_pos, mouse_face_from_string_pos)
9093 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9095 (safe_call, init_from_display_pos, handle_fontified_prop)
9096 (handle_single_display_spec, load_overlay_strings)
9097 (with_echo_area_buffer, setup_echo_area_for_printing)
9098 (display_echo_area, echo_area_display)
9099 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9100 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9101 (redisplay_window, dump_glyph_row, display_mode_line)
9102 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9103 (handle_display_spec, display_prop_string_p):
9104 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9105 (handle_single_display_spec, build_desired_tool_bar_string)
9106 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9107 (get_specified_cursor_type):
9108 Check that fixnums are in proper range for system types.
9109 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9110 (Flookup_image_map):
9111 Don't assume fixnums fit in int.
9112 (compare_overlay_entries):
9113 Avoid mishandling comparisons due to subtraction overflow.
9114 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9115 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9116 (handle_tool_bar_click):
9117 Use int, not unsigned, since we prefer signed and the signedness
9118 doesn't matter here.
9119 (get_next_display_element, next_element_from_display_vector):
9120 Use int, not EMACS_INT, when int is wide enough.
9121 (start_hourglass): Use duration_to_sec_usec to do proper
9122 overflow checking on durations.
9123 * xfaces.c (Fbitmap_spec_p):
9124 Check that fixnums are in proper range for system types.
9125 (compare_fonts_by_sort_order):
9126 Avoid mishandling comparisons due to subtraction overflow.
9127 (Fx_family_fonts, realize_basic_faces):
9128 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9129 (Fx_family_fonts):
9130 Don't assume fixnum fits in int.
9131 Use SAFE_ALLOCA_LISP, not alloca.
9132 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9133 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9134 (face_at_buffer_position, face_for_overlay_string)
9135 (face_at_string_position):
9136 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9137 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9138 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9139 (Fx_show_tip):
9140 Check that fixnums are in proper range for system types.
9141 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9142 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9143 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9144 (Fx_change_window_property): Don't assume fixnums fit in int.
9145 * xfont.c (xfont_chars_supported):
9146 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9147 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9148 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9149 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9150 * xml.c (parse_region):
9151 * xrdb.c (magic_file_p):
9152 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9153 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9154 (x_get_local_selection, x_reply_selection_request)
9155 (x_handle_selection_request, wait_for_property_change):
9156 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9157 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9158 short is wide enough.
9159 (x_send_client_event): Don't assume fixnum fits in int.
9160 * xterm.c (x_x_to_emacs_modifiers):
9161 Don't assume EMACS_INT overflows nicely into int.
9162 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9163 may come from Lisp.
9164 (handle_one_xevent): NATNUMP can eval its arg twice.
9165 (x_connection_closed):
9166 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9167 * xterm.h: Adjust decls to match defn changes elsewhere.
9168 (struct scroll_bar): Use struct vectorlike_header
9169 rather than rolling our own approximation.
9170 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9171
9172 2012-05-25 Glenn Morris <rgm@gnu.org>
9173
9174 * lisp.mk (lisp): Update for more files being compiled now.
9175
9176 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9177
9178 * lread.c: Remove `read_pure' which makes no difference.
9179 (read_pure): Remove var.
9180 (unreadpure): Remove function.
9181 (readevalloop): Don't call read_list with -1 flag.
9182 (read1, read_vector): Don't test read_pure any more.
9183 (read_list): Simplify.
9184
9185 * fileio.c, character.h: Minor style tweaks.
9186
9187 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9188
9189 * window.h (clip_changed): Remove useless declaration.
9190
9191 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9192
9193 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9194 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9195
9196 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9197
9198 Remove src/m/*.
9199 This directory predates autoconf and is no longer needed nowadays.
9200 Move its few remaining bits of functionality to where they're needed.
9201 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9202 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9203 * m/template.h: Remove.
9204 * Makefile.in (M_FILE): Remove. All uses removed.
9205 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9206 * lisp.h (USE_LSB_TAG):
9207 * mem-limits.h (EXCEEDS_LISP_PTR):
9208 Use VAL_MAX, not VALBITS, in #if.
9209 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9210 (EMACS_UINT): Define unconditionally now.
9211 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9212 (BITS_PER_EMACS_INT): New constants, replacing
9213 what used to be in config.h, but not useful in #if.
9214 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9215 define them any more.
9216 (VAL_MAX): New macro.
9217 (VALMASK): Use it.
9218 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9219 BITS_PER_EMACS_INT, in #if.
9220 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9221 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9222 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9223 * s/ms-w32.h (DATA_START):
9224 Move here from removed file m/intel386.h.
9225 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9226 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9227
9228 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9229
9230 Assume C89 or later.
9231 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9232 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9233 (xrealloc):
9234 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9235 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9236 * textprop.c, tparam.c (NULL): Remove.
9237 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9238 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9239 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9240 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9241 * xterm.c (input_signal_count): Assume volatile works.
9242
9243 2012-05-21 Ken Brown <kbrown@cornell.edu>
9244
9245 * xgselect.c (xg_select): Fix first argument in call to 'select'
9246 (bug#11508).
9247
9248 2012-05-20 Ken Brown <kbrown@cornell.edu>
9249
9250 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9251 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9252
9253 2012-05-19 Ken Brown <kbrown@cornell.edu>
9254
9255 * xfns.c (x_in_use): Remove `static' qualifier.
9256 * xterm.h (x_in_use): Declare.
9257 * xgselect.c: Include xterm.h.
9258 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9259 and `display_arg' (bug#9754).
9260
9261 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9262
9263 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9264
9265 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9266 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9267
9268 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9269
9270 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9271
9272 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9273 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9274
9275 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9276 reference to image_cache->refcount.
9277 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9278
9279 2012-05-17 Juri Linkov <juri@jurta.org>
9280
9281 * search.c (Fword_search_regexp, Fword_search_backward)
9282 (Fword_search_forward, Fword_search_backward_lax)
9283 (Fword_search_forward_lax): Move functions to isearch.el
9284 (bug#10145, bug#11381).
9285
9286 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9287
9288 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9289
9290 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9291
9292 * lread.c (init_obarray): Declare Qt and Qnil as special.
9293
9294 2012-05-14 Glenn Morris <rgm@gnu.org>
9295
9296 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9297 Put "libexec" before "bin", for the sake of init_callproc_1.
9298
9299 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9300
9301 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9302
9303 * unexaix.c: Port to more-recent AIX compilers.
9304 (report_error, report_error_1, make_hdr, copy_sym)
9305 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9306 Make arguments const char *, not char *, to avoid violations of C
9307 standard and to fix some AIX warnings reported by Gilles Pion.
9308
9309 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9310
9311 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9312 already have overlays loaded.
9313 (handle_single_display_spec): Before returning without displaying
9314 fringe bitmap, synchronize the bidi iterator with the main display
9315 iterator, by calling iterate_out_of_display_property.
9316 (iterate_out_of_display_property): Detect buffer iteration by
9317 testing that it->string is a Lisp string.
9318 (get_next_display_element): When the current object is exhausted,
9319 and there's something on it->stack, call set_iterator_to_next to
9320 proceed with what's on the stack, instead of returning zero.
9321 (set_iterator_to_next): If called at the end of a Lisp string,
9322 proceed to consider_string_end without incrementing string
9323 position. Don't increment display vector index past the end of
9324 the display vector. (Bug#11417)
9325 (pos_visible_p): Don't report a position visible when move_it_to
9326 stopped at the last line of window, which happens to be scanned
9327 backwards by the bidi iteration. (Bug#11464)
9328
9329 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9330
9331 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9332 and right-margin display specs even if the spec is invalid or we
9333 are on a TTY, and thus unable to display on the fringes.
9334 That's because the text with the property will not be displayed anyway,
9335 so we need to signal to the caller that this is a "replacing"
9336 display spec. This fixes display when the spec is invalid or we
9337 are on a TTY.
9338
9339 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9340
9341 * unexaix.c (make_hdr): Fix typo in prototype.
9342 This bug broke the build on AIX. Problem reported by Gilles Pion.
9343
9344 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9345
9346 * keyboard.c (kbd_buffer_get_event): Read special events also in
9347 batch mode. (Bug#11415)
9348
9349 2012-05-12 Glenn Morris <rgm@gnu.org>
9350
9351 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9352
9353 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9354
9355 * lisp.mk (lisp): Add newcomment.elc.
9356
9357 2012-05-12 Glenn Morris <rgm@gnu.org>
9358
9359 * Makefile.in (MKDIR_P): New, set by configure.
9360 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9361
9362 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9363
9364 Remove unused function hourglass_started.
9365 * dispextern.h (hourglass_started):
9366 * w32fns.c (hourglass_started):
9367 * xdisp.c (hourglass_started): Remove.
9368
9369 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9370
9371 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9372 Update dependencies.
9373
9374 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9375
9376 * xgselect.c (xg_select): Put maxfds+1 into a var.
9377 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9378
9379 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9380
9381 2012-05-10 Dave Abrahams <dave@boostpro.com>
9382
9383 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9384 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9385
9386 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9387
9388 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9389 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9390 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9391 Initialize xd_registered_buses.
9392
9393 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9394
9395 Untag more efficiently if USE_LSB_TAG.
9396 This is based on a proposal by YAMAMOTO Mitsuharu in
9397 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9398 For an admittedly artificial (nth 8000 longlist) benchmark on
9399 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9400 Emacs's overall text size by 1%.
9401 * lisp.h (XUNTAG): New macro.
9402 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9403 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9404 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9405 * eval.c (Fautoload):
9406 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9407 * frame.h (XFRAME): Use XUNTAG.
9408
9409 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9410 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9411 Remove unportable assumptions about print widths of types like
9412 dbus_uint32_t.
9413 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9414 intptr_t when converting between pointer and integer, to avoid GCC
9415 warnings about wrong width.
9416
9417 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9418
9419 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9420 stack for each reader_thread, instead of defaulting to 8MB
9421 determined by the linker. This avoids failures in creating
9422 subprocesses on Windows 7, see the discussion in this thread:
9423 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9424
9425 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9426
9427 Fix up display of the *Minibuf-0* buffer in the mini window.
9428 * keyboard.c (read_char): Don't clear the echo area if there's no
9429 message to clear.
9430 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9431 contents of *Minibuf-0*) if there's no message displayed in its stead.
9432
9433 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9434
9435 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9436 batch mode.
9437
9438 2012-05-06 Chong Yidong <cyd@gnu.org>
9439
9440 * lisp.mk (lisp): Update.
9441
9442 2012-05-05 Jim Meyering <meyering@redhat.com>
9443
9444 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9445
9446 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9447
9448 * data.c (PUT_ERROR): New macro.
9449 (syms_of_data): Use it. Add new error type `user-error'.
9450 * undo.c (user_error): New function.
9451 (Fprimitive_undo): Use it.
9452 * print.c (print_error_message): Adjust print style for `user-error'.
9453 * keyboard.c (user_error): New function.
9454 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9455
9456 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9457
9458 Do not limit current-time-string to years 1000..9999.
9459 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9460 (Fcurrent_time_string): Support any year that is supported by the
9461 underlying localtime representation. Don't use asctime, as it
9462 has undefined behavior for years outside the range -999..9999.
9463
9464 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9465
9466 Fix race conditions involving setenv, gmtime, localtime, asctime.
9467 Without this fix, interrupts could mess up code that uses these
9468 nonreentrant functions, since setting TZ invalidates existing
9469 tm_zone or tzname values, and since most of these functions return
9470 pointers to static storage.
9471 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9472 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9473 Grow the critical sections to include not just invoking
9474 localtime/gmtime, but also accessing these functions' results
9475 including their tm_zone values if any, and any related TZ setting.
9476 (format_time_string): Last arg is now struct tm *, not struct tm **,
9477 so that the struct tm is saved in the critical section.
9478 All callers changed. Simplify allocation of initial buffer, partly
9479 motivated by the fact that memory allocation needs to be outside
9480 the critical section.
9481
9482 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9483
9484 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9485 with RESET_INTERVAL.
9486
9487 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9488 Remove duplicated buffer name initialization.
9489
9490 2012-05-02 Jim Meyering <jim@meyering.net>
9491
9492 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9493
9494 * xfns.c (x_window): Use xstrdup (Bug#11375).
9495
9496 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9497
9498 * xdisp.c (pos_visible_p): If already at a newline from the
9499 display string before the 'while' loop, don't walk back the glyphs
9500 from it3.glyph_row. Solves assertion violation when the display
9501 string begins with a newline (egg.el). (Bug#11367)
9502
9503 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9504
9505 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9506 Move to simple.el.
9507
9508 2012-05-01 Glenn Morris <rgm@gnu.org>
9509
9510 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9511 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9512 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9513 All were removed before 23.1.
9514
9515 * dispnew.c: Remove HAVE_LIBNCURSES test;
9516 it is always true on relevant platforms.
9517
9518 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9519 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9520
9521 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9522
9523 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9524
9525 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9526 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9527 Remove.
9528
9529 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9530
9531 Do not avoid creating empty evaporating overlays (Bug#9642).
9532 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9533 That is, do not delete an evaporating overlay if it becomes
9534 empty after its bounds are adjusted to fit within its buffer.
9535 This fix caused other problems, and I'm reverting it until we get
9536 to the bottom of them.
9537
9538 2012-04-27 Chong Yidong <cyd@gnu.org>
9539
9540 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9541
9542 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9543
9544 * xdisp.c (pos_visible_p): If the window start position is beyond
9545 ZV, start the display from buffer beginning. Prevents assertion
9546 violation in init_iterator when the minibuffer window is scrolled
9547 via the scroll bar.
9548
9549 * window.c (window_scroll_pixel_based): Likewise.
9550
9551 2012-04-27 Chong Yidong <cyd@gnu.org>
9552
9553 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9554
9555 2012-04-27 Glenn Morris <rgm@gnu.org>
9556
9557 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9558 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9559
9560 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9561
9562 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9563 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9564
9565 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9566
9567 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9568 display element, check also the underlying string or buffer
9569 character. (Bug#11341)
9570
9571 * w32menu.c: Include w32heap.h.
9572 (add_menu_item): If the call to AppendMenuW (via
9573 unicode_append_menu) fails, disable Unicode menus only if we are
9574 running on Windows 9X/Me.
9575
9576 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9577
9578 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9579 (xgetint): Add missing shift for LSB tags.
9580
9581 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9582
9583 * keyboard.c (read_char): Don't wipe echo area for select window
9584 events: These might get delayed via `mouse-autoselect-window'
9585 (Bug#11304).
9586
9587 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9588
9589 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9590 manipulation of :loaded-from data.
9591
9592 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9593
9594 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9595 now a cons (bug#11311).
9596
9597 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9598
9599 Do not create empty overlays with the evaporate property (Bug#9642).
9600 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9601 if it becomes empty after its bounds are adjusted to fit within
9602 its buffer. Without this fix, in a nonempty buffer (let ((o
9603 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9604 yields an empty overlay that has the evaporate property, which is
9605 not supposed to happen.
9606
9607 Fix minor GTK3 problems found by static checking.
9608 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9609 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9610 (struct _EmacsFixedClass, emacs_fixed_get_type):
9611 Move decls here from emacsgtkfixed.h, since they needn't be public.
9612 (emacs_fixed_get_type): Now static.
9613 (emacs_fixed_class_init): Omit unused local.
9614 (emacs_fixed_child_type): Remove; unused.
9615 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9616 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9617 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9618 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9619 (EMACS_FIXED_GET_CLASS): Remove; unused.
9620 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9621
9622 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9623 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9624
9625 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9626
9627 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9628 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9629 (__malloc_size_t, __malloc_ptrdiff_t):
9630 Remove. All uses removed, replaced by the definiens if needed,
9631 since we can assume C89 or better now.
9632 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9633 (protect_malloc_state, align, get_contiguous_space)
9634 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9635 (malloc_atfork_handler_child, malloc_enable_thread)
9636 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9637 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9638 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9639 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9640 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9641 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9642 Define using prototypes, not old style.
9643 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9644 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9645 (align): Don't assume that signed integer overflow wraps around.
9646 Omit unused local var.
9647 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9648 (_free_internal_nolock, memalign, mallochook, reallochook):
9649 Omit no-longer-needed casts.
9650 (valloc): Use getpagesize, not __getpagesize.
9651 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9652 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9653
9654 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9655
9656 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9657
9658 Move functions from C to Lisp. Make non-blocking method calls
9659 the default. Implement further D-Bus standard interfaces.
9660
9661 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9662 (QCdbus_request_name_allow_replacement)
9663 (QCdbus_request_name_replace_existing)
9664 (QCdbus_request_name_do_not_queue)
9665 (QCdbus_request_name_reply_primary_owner)
9666 (QCdbus_request_name_reply_in_queue)
9667 (QCdbus_request_name_reply_exists)
9668 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9669 (QCdbus_registered_serial, QCdbus_registered_method)
9670 (QCdbus_registered_signal): New Lisp objects.
9671 (XD_DEBUG_MESSAGE): Use sizeof.
9672 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9673 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9674 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9675 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9676 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9677 (xd_signature, xd_append_arg): Allow float for integer types.
9678 (xd_get_connection_references): New function.
9679 (xd_get_connection_address): Rename from xd_initialize.
9680 Return cached address.
9681 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9682 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9683 level.
9684 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9685 Return number of refcounts.
9686 (Fdbus_get_unique_name): Make stronger parameter check.
9687 (Fdbus_message_internal): New defun.
9688 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9689 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9690 (Fdbus_send_signal, Fdbus_register_service)
9691 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9692 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9693 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9694 (Vdbus_compiled_version, Vdbus_runtime_version)
9695 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9696 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9697 (Vdbus_message_type_signal): New defvars.
9698 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9699 Adapt docstring.
9700
9701 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9702
9703 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9704 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9705 Do not assume ptrdiff_t is the same width as 'int'.
9706
9707 * alloc.c: Handle unusual debugging option combinations.
9708 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9709 since the two debugging options are incompatible.
9710 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9711 is defined.
9712 (mem_init, mem_insert, mem_insert_fixup):
9713 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9714 (NEED_MEM_INSERT): Remove; no longer needed.
9715
9716 2012-04-22 Leo Liu <sdl.web@gmail.com>
9717
9718 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9719
9720 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9721
9722 * sysdep.c [__FreeBSD__]: Minor cleanups.
9723 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9724 Use Emacs indenting style more consistently. Avoid some casts.
9725 Use 'double' consistently rather than mixing 'float' and 'double'.
9726
9727 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9728
9729 * sysdep.c (list_system_processes, system_process_attributes):
9730 Add implementation for FreeBSD (Bug#5243).
9731
9732 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9733
9734 * lisp.mk (lisp): Update.
9735
9736 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9737
9738 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9739 It is never used otherwise.
9740
9741 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9742
9743 * print.c (print_preprocess): Only check print_depth if print-circle
9744 is nil.
9745 (print_object): Check for cycles even when print-circle is nil and
9746 print-gensym is t, but only check print_depth if print-circle is nil.
9747
9748 2012-04-20 Chong Yidong <cyd@gnu.org>
9749
9750 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9751 set the status to "failed" and ensure that sentinel is run.
9752
9753 2012-04-20 Glenn Morris <rgm@gnu.org>
9754
9755 * process.c (Fset_process_inherit_coding_system_flag)
9756 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9757 (Fmake_network_process, Fmake_serial_process): Doc fix.
9758
9759 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9760
9761 * xdisp.c (string_buffer_position_lim): Limit starting position to
9762 BEGV.
9763 (set_cursor_from_row): If called for a mode-line or header-line
9764 row, return zero immediately.
9765 (try_cursor_movement): If inside continuation line, don't back up
9766 farther than the first row after the header line, if any.
9767 Don't consider the header-line row as "partially visible", even if
9768 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9769
9770 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9771
9772 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9773 (bug#11238).
9774
9775 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9776 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9777
9778 configure: new option --enable-gcc-warnings (Bug#11207)
9779 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9780 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9781 (ALL_CFLAGS): Use new macros rather than old.
9782 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9783 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9784 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9785 -Wunused-result, -Wunused-variable. This should go away once
9786 the Emacs and Gnulib regex code is merged.
9787 (xmalloc, xrealloc): Now static.
9788
9789 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9790
9791 * dired.c (Fsystem_groups): Remove unused local.
9792
9793 2012-04-17 Glenn Morris <rgm@gnu.org>
9794
9795 * dired.c (Fsystem_users): Doc fix.
9796
9797 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9798
9799 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9800 (syms_of_dired): Add them.
9801
9802 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9803
9804 Fix minor alloc.c problems found by static checking.
9805 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9806 New extern decls, to avoid calling undeclared functions.
9807 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9808 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9809 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9810 (NEED_MEM_INSERT): New macro.
9811 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9812 Remove one incorrect comment and fix another.
9813
9814 Fix minor ralloc.c problems found by static checking.
9815 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9816 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9817 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9818 (r_alloc_sbrk): Now static.
9819
9820 Improve ralloc.c interface checking.
9821 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9822 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9823 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9824 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9825 [REL_ALLOC]: ... to here, to check interface.
9826 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9827 Remove decls. This fixes an "It stinks!".
9828
9829 * alloc.c (which_symbols): Fix alignment issue / type clash.
9830
9831 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9832
9833 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9834 (struct Lisp_Misc_Any): Likewise.
9835 (struct Lisp_Free): Likewise.
9836 * alloc.c (union aligned_Lisp_Symbol): Define.
9837 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9838 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9839 (union aligned_Lisp_Misc): Define.
9840 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9841 aligned_Lisp_Misc instead of union Lisp_Misc.
9842 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9843
9844 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9845
9846 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9847 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9848 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9849 * s/netbsd.h, s/sol2-6.h:
9850 Remove definition of GC_MARK_STACK, since the default now works.
9851 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9852 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9853 no longer the default.
9854 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9855
9856 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9857
9858 * lread.c (lisp_file_lexically_bound_p):
9859 Fix hang at ";-*-\n" (bug#11238).
9860
9861 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9862
9863 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9864 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9865
9866 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9867
9868 * nsterm.m (constrainFrameRect): Always constrain when there is only
9869 one screen (Bug#10962).
9870
9871 2012-04-13 Ken Brown <kbrown@cornell.edu>
9872
9873 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9874
9875 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9876
9877 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9878
9879 2012-04-11 Daniel Colascione <dancol@dancol.org>
9880
9881 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9882 against is gone. It's better to use vfork now so that when Cygwin
9883 gains a new, working vfork, we use it automatically (bug#10398).
9884
9885 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9886
9887 * window.c (save_window_save): Obey window-point-insertion-type.
9888
9889 2012-04-11 Glenn Morris <rgm@gnu.org>
9890
9891 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9892
9893 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9894
9895 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9896
9897 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9898
9899 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9900 (force_quit_count): New var.
9901 (handle_interrupt): Use it.
9902
9903 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9904
9905 * w32.c (w32_delayed_load): Record the full path of the library
9906 being loaded (bug#10424).
9907
9908 2012-04-09 Glenn Morris <rgm@gnu.org>
9909
9910 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9911 not just in the obarray, before snarfing them. (Bug#11036)
9912
9913 * Makefile.in ($(leimdir)/leim-list.el):
9914 Pass EMACS rather than BUILT_EMACS.
9915
9916 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9917
9918 * process.c (make_process):
9919 * process.h: Add integer `gnutls_handshakes_tried' member to
9920 process struct.
9921
9922 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9923 Add convenience `GNUTLS_LOG2i' macro.
9924
9925 * gnutls.c (gnutls_log_function2i): Convenience log function.
9926 (emacs_gnutls_read): Use new log functions,
9927 `gnutls_handshakes_tried' process member, and
9928 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9929 attempts per process (connection).
9930
9931 2012-04-09 Chong Yidong <cyd@gnu.org>
9932
9933 * eval.c (Fuser_variable_p, user_variable_p_eh)
9934 (lisp_indirect_variable): Functions deleted.
9935 (Fdefvar): Caller changed.
9936
9937 * callint.c (Finteractive, Fcall_interactively):
9938 * minibuf.c (Fread_variable): Callers changed.
9939
9940 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9941
9942 * xdisp.c (set_cursor_from_row): If the display string appears in
9943 the buffer at position that is closer to point than the position
9944 after the display string, display the cursor on the first glyph of
9945 the display string. Fixes cursor display when a 'display' text
9946 property immediately follows invisible text. (Bug#11094)
9947
9948 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9949
9950 composite.c: use 'double' consistently
9951 * composite.c (get_composition_id): Use 'double' consistently
9952 instead of converting 'float' to 'double' and vice versa; this is
9953 easier to understand and avoids a GCC warning.
9954
9955 2012-04-09 Glenn Morris <rgm@gnu.org>
9956
9957 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9958 preparation for dumping it with emacs. (Bug#4789)
9959 (leimdir): New variable.
9960 ($(leimdir)/leim-list.el): New rule.
9961 (emacs$(EXEEXT)): Depend on leim-list.el.
9962
9963 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9964 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9965 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9966
9967 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9968
9969 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9970 proper alignment.
9971
9972 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9973
9974 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9975 Remove unused local variable.
9976
9977 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9978
9979 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9980 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9981 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9982 objects, as mark_maybe_pointer will catch them otherwise.
9983 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9984 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9985
9986 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9987
9988 Fix typo that broke non-Windows builds.
9989 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9990
9991 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9992
9993 Support building on MS-Windows with libxml2.
9994
9995 * makefile.w32-in (OBJ2): Add xml.$(O).
9996 (GLOBAL_SOURCES): Add xml.c.
9997 ($(BLD)/xml.$(O)): New dependency list.
9998
9999 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10000 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10001 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10002 [!WINDOWSNT]: New macros.
10003 (init_libxml2_functions, libxml2_loaded_p): New functions.
10004 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10005 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10006 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10007 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10008 linked in).
10009 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10010 Call init_libxml2_functions before calling libxml2 functions.
10011 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10012
10013 * emacs.c: Don't include libxml/parser.h.
10014 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10015 xmlCleanupParser directly.
10016
10017 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10018
10019 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10020
10021 * indent.c (Fvertical_motion): If there is a display string at
10022 point, use it.vpos to compute how many lines to backtrack after
10023 move_it_to point. (Bug#11133)
10024
10025 2012-04-06 Eli Zaretskii <eliz@gnu.org>
10026
10027 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10028 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10029 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10030 macros related to unification of CJK characters. For the details,
10031 see the discussion following the message here:
10032 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10033
10034 2012-04-04 Chong Yidong <cyd@gnu.org>
10035
10036 * keyboard.c (Vdelayed_warnings_list): Doc fix.
10037
10038 2012-04-01 Eli Zaretskii <eliz@gnu.org>
10039
10040 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10041 instead of alloca. (Bug#11138)
10042
10043 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10044
10045 * w32menu.c (is_simple_dialog): Properly check lisp types.
10046 (Bug#11141)
10047
10048 2012-03-31 Eli Zaretskii <eliz@gnu.org>
10049
10050 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10051 position we get to after a call to move_it_to fails the
10052 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10053 only if we wind up in a string from display property. (Bug#11063)
10054
10055 * window.c (Fdelete_other_windows_internal): Invalidate the row
10056 and column information about mouse highlight, so that redisplay
10057 restores it after reallocating the glyph matrices. (Bug#7464)
10058
10059 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10060 string comes from a `display' text property, use the buffer
10061 position of that property as if we actually saw that position in
10062 the row's glyphs.
10063 (move_it_by_lines): Remove the assertion that
10064 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10065 violated when there's a before-string at the beginning of a line.
10066 (Bug#11063)
10067
10068 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10069
10070 * xdisp.c (append_space_for_newline): If the default face was
10071 remapped, use the remapped face for the appended newline.
10072 (extend_face_to_end_of_line): Use the remapped default face for
10073 extending the face to the end of the line.
10074 (display_line): Call extend_face_to_end_of_line when the default
10075 face was remapped. (Bug#11068)
10076
10077 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10078
10079 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10080
10081 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10082
10083 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10084
10085 2012-03-27 Glenn Morris <rgm@gnu.org>
10086
10087 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10088 Doc fixes.
10089
10090 2012-03-26 Kenichi Handa <handa@m17n.org>
10091
10092 * dispextern.h (struct glyph): Fix previous change. Change the
10093 bit length of glyphless.ch to 25 (Bug#11082).
10094
10095 2012-03-26 Chong Yidong <cyd@gnu.org>
10096
10097 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10098 (command_loop_1): Use it; inhibit selection update for
10099 handle-select-window too (Bug#8996).
10100
10101 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10102
10103 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10104
10105 2012-03-25 Kenichi Handa <handa@m17n.org>
10106
10107 * dispextern.h (struct glyph): Change the bit length of
10108 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10109
10110 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10111
10112 * s/ms-w32.h (tzname): Include time.h before redirecting to
10113 _tzname. Fixes the MSVC build. (Bug#9960)
10114
10115 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10116
10117 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10118 characters.
10119
10120 * xterm.c (XTread_socket): Only modify handling_signal if
10121 !SYNC_INPUT. (Bug#11080)
10122
10123 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10124
10125 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10126 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10127 when fetching a multibyte character consumes more bytes than
10128 CHAR_BYTES returns, due to unification of CJK characters in
10129 string_char. (Bug#11073)
10130
10131 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10132
10133 * process.c (wait_reading_process_output): Handle pty disconnect
10134 by refraining from sending oneself a SIGCHLD (bug#10933).
10135
10136 2012-03-22 Chong Yidong <cyd@gnu.org>
10137
10138 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10139
10140 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10141 Mark string as coming from a prefix property.
10142 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10143 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10144
10145 2012-03-21 Chong Yidong <cyd@gnu.org>
10146
10147 * xfaces.c (Vface_remapping_alist): Doc fix.
10148
10149 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10150
10151 * w32proc.c (Fw32_set_console_codepage)
10152 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10153 Doc fixes.
10154
10155 2012-03-20 Chong Yidong <cyd@gnu.org>
10156
10157 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10158 to reflect default non-nil value of redisplay-dont-pause.
10159
10160 2012-03-19 Kenichi Handa <handa@m17n.org>
10161
10162 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10163 it fit in a valid range (Bug#11003).
10164
10165 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10166
10167 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10168 that is not from display property, accept the row as a "cursor
10169 row" if one of the string's character has a non-nil `cursor'
10170 property. Fixes cursor positioning when there are newlines in
10171 overlay strings, e.g. in icomplete.el. (Bug#11035)
10172
10173 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10174
10175 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10176
10177 2012-03-12 Chong Yidong <cyd@gnu.org>
10178
10179 * eval.c (inhibit_lisp_code): Rename from
10180 inhibit_window_configuration_change_hook; move from window.c.
10181
10182 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10183 * window.c (run_window_configuration_change_hook)
10184 (syms_of_window): Callers changed.
10185
10186 2012-03-11 Chong Yidong <cyd@gnu.org>
10187
10188 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10189
10190 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10191
10192 2012-03-10 Chong Yidong <cyd@gnu.org>
10193
10194 * frame.c (other_visible_frames): Don't assume the selected frame
10195 is visible (Bug#10955).
10196
10197 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10198
10199 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10200
10201 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10202
10203 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10204 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10205 zero (Bug#10954).
10206
10207 2012-03-03 Glenn Morris <rgm@gnu.org>
10208
10209 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10210
10211 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10212
10213 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10214 position past the first glyph_row that ends at ZV. (Bug#10902)
10215 (redisplay_window, next_element_from_string): Fix typos in
10216 comments.
10217 (redisplay_window): Pass to move_it_vertically the margin in
10218 pixels, not in screen lines.
10219
10220 2012-03-02 Glenn Morris <rgm@gnu.org>
10221
10222 * buffer.c (buffer-list-update-hook): Doc fix.
10223
10224 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10225
10226 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10227 push_it before setting up the iterator for the first overlay
10228 string, even if we have an empty string loaded.
10229 (next_overlay_string): If there's an empty string on the iterator
10230 stack, pop the stack. (Bug#10903)
10231
10232 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10233
10234 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10235 Suggested by Stefan Monnier in
10236 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10237 * alloc.c (widen_to_Lisp_Object): New static function.
10238 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10239 and widening them to Lisp_Objects. This would work even if
10240 USE_LSB_TAG is defined and wide integers are used, which might
10241 happen in a future version of Emacs.
10242
10243 2012-02-25 Chong Yidong <cyd@gnu.org>
10244
10245 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10246 Doc fix.
10247
10248 * xselect.c (Fx_selection_exists_p): Doc fix.
10249 (x_clipboard_manager_save_all): Print an informative message
10250 before saving to clipboard manager.
10251
10252 2012-02-24 Chong Yidong <cyd@gnu.org>
10253
10254 * keyboard.c (process_special_events): Handle all X selection
10255 requests in kbd_buffer, not just the next one (Bug#8869).
10256
10257 2012-02-23 Chong Yidong <cyd@gnu.org>
10258
10259 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10260 call when setting menu-bar-lines and tool-bar-lines parameters.
10261 (unwind_create_frame_1): New helper function.
10262
10263 * window.c (inhibit_window_configuration_change_hook): New var.
10264 (run_window_configuration_change_hook): Obey it.
10265 (syms_of_window): Initialize it.
10266
10267 2012-02-22 Chong Yidong <cyd@gnu.org>
10268
10269 * xterm.c (x_draw_image_relief): Add missing type check for
10270 Vtool_bar_button_margin (Bug#10743).
10271
10272 2012-02-21 Chong Yidong <cyd@gnu.org>
10273
10274 * fileio.c (Vfile_name_handler_alist): Doc fix.
10275
10276 * buffer.c (Fget_file_buffer): Protect against invalid file
10277 handler return value.
10278
10279 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10280
10281 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10282 when computing $valmask.
10283
10284 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10285 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10286 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10287 It's useless in that case, and it can cause problems on hosts
10288 that allocate halves of EMACS_INT values separately.
10289 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10290 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10291 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10292 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10293 it avoids undefined behavior on hosts where shifting right by more
10294 than the word width has undefined behavior.
10295
10296 2012-02-19 Chong Yidong <cyd@gnu.org>
10297
10298 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10299 (Funhandled_file_name_directory, Ffile_name_as_directory)
10300 (Fdirectory_file_name, Fexpand_file_name)
10301 (Fsubstitute_in_file_name): Protect against invalid file handler
10302 return values (Bug#10845).
10303
10304 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10305
10306 * .gdbinit (pitx): Fix incorrect references to fields of the
10307 iterator stack.
10308
10309 2012-02-17 Chong Yidong <cyd@gnu.org>
10310
10311 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10312
10313 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10314
10315 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10316 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10317
10318 2012-02-15 Chong Yidong <cyd@gnu.org>
10319
10320 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10321 marked as special. Also, starting docstrings with * is obsolete.
10322
10323 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10324
10325 * gnutls.c (emacs_gnutls_write): Fix last change.
10326
10327 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10328
10329 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10330 send_process.
10331
10332 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10333
10334 * keymap.c (Fsingle_key_description): Handle char ranges.
10335
10336 2012-02-12 Chong Yidong <cyd@gnu.org>
10337
10338 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10339 as that creates a dangerous corner case.
10340
10341 * window.c (Fdelete_window_internal): Invalidate the mouse
10342 highlight (Bug#9904).
10343
10344 2012-02-12 Glenn Morris <rgm@gnu.org>
10345
10346 * xselect.c (Fx_own_selection_internal)
10347 (Fx_get_selection_internal, Fx_disown_selection_internal)
10348 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10349 * nsselect.m (Fx_own_selection_internal)
10350 (Fx_disown_selection_internal, Fx_selection_exists_p)
10351 (Fx_selection_owner_p, Fx_get_selection_internal):
10352 Sync docs and argument specs with the xselect.c versions.
10353
10354 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10355
10356 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10357
10358 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10359
10360 * w32select.c (Fx_selection_exists_p): Sync doc string and
10361 argument list with xselect.c. (Bug#10783)
10362
10363 * w16select.c (Fx_selection_exists_p): Sync doc string and
10364 argument list with xselect.c. (Bug#10783)
10365
10366 2012-02-10 Glenn Morris <rgm@gnu.org>
10367
10368 * fns.c (Fsecure_hash): Doc fix.
10369
10370 2012-02-09 Kenichi Handa <handa@m17n.org>
10371
10372 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10373
10374 2012-02-07 Chong Yidong <cyd@gnu.org>
10375
10376 * buffer.c (Fbuffer_local_variables)
10377 (buffer_lisp_local_variables): Handle unbound vars correctly;
10378 don't let Qunbound leak into Lisp.
10379
10380 2012-02-07 Glenn Morris <rgm@gnu.org>
10381
10382 * image.c (Fimagemagick_types): Doc fix.
10383
10384 * image.c (imagemagick-render-type): Change it from a lisp object
10385 to an integer. Move the doc here from the lisp manual.
10386 Treat all values not equal to 0 the same.
10387
10388 2012-02-06 Chong Yidong <cyd@gnu.org>
10389
10390 * doc.c (store_function_docstring): Avoid applying docstring of
10391 alias to base function (Bug#2603).
10392
10393 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10394
10395 * .gdbinit (pp1, pv1): Remove redundant defines.
10396 (pr): Use pp.
10397
10398 2012-02-04 Chong Yidong <cyd@gnu.org>
10399
10400 * nsterm.m: Declare a global (Bug#10694).
10401
10402 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10403
10404 * w32.c (get_emacs_configuration_options):
10405 Include --enable-checking, if specified, in the return value.
10406
10407 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10408
10409 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10410 after rounding frame sizes. (Bug#9723)
10411
10412 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10413
10414 * keyboard.c (adjust_point_for_property): Don't position point
10415 before BEGV. (Bug#10696)
10416
10417 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10418
10419 Handle overflow when computing char display width (Bug#9496).
10420 * character.c (char_width): Return EMACS_INT, not int.
10421 (char_width, c_string_width): Check for overflow when
10422 computing the width; this is possible now that individual
10423 characters can have unbounded width. Problem introduced
10424 by merge from Emacs 23 on 2012-01-19.
10425
10426 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10427
10428 * dbusbind.c (Fdbus_register_method): Mention the return value
10429 :ignore in the docstring.
10430
10431 2012-02-02 Glenn Morris <rgm@gnu.org>
10432
10433 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10434
10435 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10436 Unconditionally set to t. (Bug#10673)
10437 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10438 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10439 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10440
10441 2012-02-02 Kenichi Handa <handa@m17n.org>
10442
10443 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10444 0, do not call append_composite_glyph.
10445
10446 2012-02-02 Kenichi Handa <handa@m17n.org>
10447
10448 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10449 NULL (Bug#6988).
10450 (x_produce_glyphs): If the component of a composition is a null
10451 string, set it->pixel_width to 1 to avoid zero-width glyph.
10452
10453 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10454
10455 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10456 first 2 arguments are identical. This makes inserting large
10457 output from a subprocess an order of magnitude faster on
10458 MS-Windows, where all sbrk'ed memory is always contiguous.
10459
10460 2012-01-31 Glenn Morris <rgm@gnu.org>
10461
10462 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10463 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10464 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10465
10466 2012-01-29 Glenn Morris <rgm@gnu.org>
10467
10468 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10469
10470 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10471
10472 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10473
10474 2012-01-28 Chong Yidong <cyd@gnu.org>
10475
10476 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10477
10478 2012-01-26 Chong Yidong <cyd@gnu.org>
10479
10480 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10481
10482 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10483 repeat counts (Bug#10507).
10484
10485 2012-01-26 Glenn Morris <rgm@gnu.org>
10486
10487 * lread.c (syms_of_lread): Doc fix.
10488
10489 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10490
10491 * coding.c (encode_designation_at_bol): Change return value to
10492 EMACS_INT.
10493
10494 2012-01-25 Chong Yidong <cyd@gnu.org>
10495
10496 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10497
10498 2012-01-21 Chong Yidong <cyd@gnu.org>
10499
10500 * floatfns.c (Fcopysign): Make the second argument non-optional,
10501 since nil is not allowed anyway.
10502
10503 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10504
10505 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10506 (send_process): Likewise.
10507
10508 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10509
10510 * window.c (save_window_save, Fcurrent_window_configuration)
10511 (Vwindow_persistent_parameters): Do not use Qstate.
10512 Rewrite doc-strings.
10513
10514 2012-01-19 Kenichi Handa <handa@m17n.org>
10515
10516 * character.c (char_width): New function.
10517 (Fchar_width, c_string_width, lisp_string_width):
10518 Use char_width (Bug#9496).
10519
10520 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10521
10522 * window.c (Vwindow_persistent_parameters): New variable.
10523 (Fset_window_configuration, save_window_save): Handle persistent
10524 window parameters.
10525
10526 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10527
10528 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10529 thrashing the stack of the thread. (Bug#9087)
10530
10531 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10532
10533 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10534
10535 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10536
10537 * xdisp.c (rows_from_pos_range): Handle the case where the
10538 highlight ends on a newline. (Bug#10464)
10539 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10540 he end column for display of highlight that ends on a newline
10541 before a R2L line.
10542
10543 2012-01-11 Glenn Morris <rgm@gnu.org>
10544
10545 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10546 from load-path also when installation-directory is nil. (Bug#10208)
10547
10548 2012-01-10 Glenn Morris <rgm@gnu.org>
10549
10550 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10551
10552 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10553 Update template values to be closer to their typical values these days.
10554
10555 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10556
10557 * xdisp.c (rows_from_pos_range): Accept additional argument
10558 DISP_STRING, and accept any glyph in a row whose object is that
10559 string as eligible for mouse highlight. Fixes mouse highlight of
10560 display strings from overlays. (Bug#10464)
10561
10562 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10563
10564 emacs: fix an auto-save permissions race condition (Bug#10400)
10565 * fileio.c (auto_saving_dir_umask): New static var.
10566 (Fmake_directory_internal): Use it.
10567 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10568 creating the directory. The old code temporarily assigns
10569 too-generous permissions to the directory.
10570 (do_auto_save_eh): Clear it.
10571 (Fdo_auto_save): Catch all errors, not just file errors, so
10572 that the var is always cleared.
10573
10574 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10575
10576 * search.c (scan_buffer): Pass character positions to
10577 know_region_cache, not byte positions. (Bug#6540)
10578
10579 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10580
10581 * w32.c (sys_rename): Report EXDEV when rename of a directory
10582 fails because the target is on another logical disk. (Bug#10284)
10583
10584 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10585
10586 * xterm.c (x_embed_request_focus): New function.
10587
10588 * xterm.h: Add prototype.
10589
10590 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10591
10592 2012-01-05 Glenn Morris <rgm@gnu.org>
10593
10594 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10595
10596 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10597
10598 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10599 Load gnutls_transport_set_lowat only if GnuTLS version is below
10600 2.11.1.
10601 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10602 GnuTLS versions below 2.11.1.
10603
10604 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10605
10606 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10607 to the doc string advising against its use for altering the way
10608 windows are scrolled.
10609
10610 2011-12-28 Kenichi Handa <handa@m17n.org>
10611
10612 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10613 coding-system ASCII compatible only when it does not produce BOM
10614 on encoding (Bug#10383).
10615
10616 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10617
10618 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10619 can scroll.
10620 (create_and_show_popup_menu): Always use menu_position_func for
10621 Gtk3 (Bug#10361).
10622
10623 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10624
10625 * callint.c (Fcall_interactively): Don't truncate prompt string.
10626
10627 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10628
10629 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10630 property that ends at ZV, so that the bidi iteration could be
10631 resumed from there (after widening). (Bug#10360)
10632
10633 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10634
10635 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10636
10637 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10638
10639 * nsterm.m (x_free_frame_resources):
10640 Release f->output_data.ns->miniimage.
10641 (ns_index_color): Fix indentation. Do not retain
10642 color_table->colors[i].
10643
10644 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10645 before returning.
10646
10647 * nsfns.m (x_set_background_color): Assign return value from
10648 ns_index_color to face-background instead of NSColor*.
10649 (ns_implicitly_set_icon_type): Fix indentation.
10650 Change assignment in for loop to comparison.
10651
10652 * emacs.c (ns_pool): New variable.
10653 (main): Assign ns_pool.
10654 (Fkill_emacs): Call ns_release_autorelease_pool.
10655
10656 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10657 autorelease fdesc, release fdAttrs and tdict.
10658 (ns_get_covering_families): Release charset.
10659 (ns_findfonts): Release NSFontDescriptor created with new.
10660 (ns_uni_to_glyphs): Fix indentation.
10661 (setString): Release attrStr before assigning new value.
10662
10663 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10664
10665 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10666 and NS_IMPL_COCOA.
10667 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10668 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10669
10670 2011-12-18 David Reitter <reitter@cmu.edu>
10671
10672 * nsterm.m (ns_term_init): Subscribe for notifications
10673 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10674 to method trackingNotification in EmacsMenu.
10675
10676 * nsmenu.m (trackingMenu): New variable.
10677 (trackingNotification): New method (from Aquamacs).
10678 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10679 from Aquamacs (Bug#7030).
10680
10681 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10682
10683 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10684 (symbol_to_nsstring): Fix indentation.
10685 (ns_symbol_to_pb): New function.
10686 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10687 (Fns_rotate_cut_buffers_internal): Remove.
10688 (Fns_store_selection_internal): Rename from
10689 Fns_store_cut_buffer_internal.
10690 (ns_get_foreign_selection, Fx_own_selection_internal)
10691 (Fx_disown_selection_internal, Fx_selection_exists_p)
10692 (Fns_get_selection_internal, Fns_store_selection_internal):
10693 Use ns_symbol_to_pb and check if return value is nil.
10694 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10695 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10696 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10697 renamed to Sns_store_selection_internal.
10698 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10699 and remove this function.
10700 (ns_handle_selection_clear): Remove, never used.
10701 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10702 here.
10703
10704 2011-12-17 Ken Brown <kbrown@cornell.edu>
10705
10706 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10707 GID is unknown (Bug#10257).
10708
10709 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10710
10711 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10712 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10713 which caused a build failure on GNU/Linux IA-64. This problem was
10714 introduced by my 2011-10-07 patch.
10715
10716 2011-12-15 Juri Linkov <juri@jurta.org>
10717
10718 * image.c (imagemagick_error): New function. (Bug#10112)
10719 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10720 Use `imagemagick_error' where ImageMagick functions return
10721 `MagickFalse'.
10722 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10723 proper order.
10724
10725 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10726
10727 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10728 fill background (Bug#8992).
10729
10730 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10731
10732 * window.c (Vwindow_combination_resize)
10733 (Vwindow_combination_limit): Use t instead of non-nil in
10734 doc-strings.
10735 (Vrecenter_redisplay): Add first sentence of doc-string on
10736 separate line.
10737 (Frecenter): Fix doc-string typo.
10738
10739 2011-12-11 Kenichi Handa <handa@m17n.org>
10740
10741 * coding.c (Funencodable_char_position): Pay attention to the
10742 buffer text relocation (Bug#9389).
10743
10744 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10745
10746 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10747 gtk_init (Bug#10100).
10748
10749 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10750
10751 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10752 IT->string is nil. (Bug#10263)
10753
10754 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10755
10756 * nsterm.h (x_free_frame_resources): Declare.
10757
10758 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10759 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10760
10761 * nsterm.h (ns_get_defaults_value): Declare.
10762
10763 * nsterm.m (ns_default): Call ns_get_defaults_value.
10764
10765 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10766
10767 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10768 (Bug#10170)
10769
10770 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10771
10772 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10773 that where the value of an _OBJC_* symbol points to is in the .bss
10774 section (Bug#10240).
10775
10776 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10777
10778 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10779 after the loop to call ccl_driver at least once (Bug#8619).
10780
10781 2011-12-08 Kenichi Handa <handa@m17n.org>
10782
10783 * ftfont.c (get_adstyle_property): Fix previous change
10784 (Bug#10233).
10785
10786 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10787
10788 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10789 dirs from the default value of EMACSLOADPATH (bug#10208).
10790
10791 2011-12-07 Glenn Morris <rgm@gnu.org>
10792
10793 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10794 installation and source directories as well. (Bug#10208)
10795
10796 2011-12-06 Chong Yidong <cyd@gnu.org>
10797
10798 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10799
10800 2011-12-06 Glenn Morris <rgm@gnu.org>
10801
10802 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10803 as an error, not just -1. (Bug#10217)
10804
10805 2011-12-05 Chong Yidong <cyd@gnu.org>
10806
10807 * keyboard.c (process_special_events): New function.
10808 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10809
10810 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10811
10812 * coding.c (encode_designation_at_bol): Don't use uninitialized
10813 local variable (Bug#9318).
10814
10815 2011-12-05 Kenichi Handa <handa@m17n.org>
10816
10817 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10818 return Qnil (Bug#8046, Bug#10193).
10819
10820 2011-12-05 Kenichi Handa <handa@m17n.org>
10821
10822 * coding.c (encode_designation_at_bol): New args charbuf_end and
10823 dst. Return the number of produced bytes. Callers changed.
10824 (coding_set_source): Return how many bytes coding->source was
10825 relocated.
10826 (coding_set_destination): Return how many bytes
10827 coding->destination was relocated.
10828 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10829 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10830
10831 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10832
10833 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10834 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10835 macro (Bug#9318).
10836
10837 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10838
10839 The following changes are to fix Bug#9318.
10840
10841 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10842 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10843 (encode_coding_iso_2022, encode_coding_sjis)
10844 (encode_coding_big5, encode_coding_charset): Use the above macros.
10845
10846 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10847
10848 * lisp.h (process_quit_flag): Fix external declaration.
10849
10850 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10851
10852 Don't macro-inline non-performance-critical code.
10853 * eval.c (process_quit_flag): New function.
10854 * lisp.h (QUIT): Use it.
10855
10856 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10857
10858 * nsfns.m (get_geometry_from_preferences): New function.
10859 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10860
10861 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10862
10863 * emacs.c (Qkill_emacs): Define.
10864 (syms_of_emacs): Initialize it.
10865 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10866 Qquit_flag to `kill-emacs' instead.
10867 (quit_throw_to_read_char): Add parameter `from_signal'.
10868 All callers changed. Call Fkill_emacs if requested and safe.
10869 * lisp.h (QUIT): Call Fkill_emacs if requested.
10870
10871 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10872
10873 * widget.c (update_wm_hints): Return if wmshell is null.
10874 (widget_update_wm_size_hints): New function.
10875
10876 * widget.h (widget_update_wm_size_hints): Declare.
10877
10878 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10879 widget_update_wm_size_hints (Bug#10104).
10880
10881 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10882
10883 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10884 before a newline, prepare the bidi iterator for consuming the
10885 newline, and keep the current paragraph direction. (Bug#10183)
10886 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10887
10888 2011-12-02 Juri Linkov <juri@jurta.org>
10889
10890 * search.c (Fword_search_regexp): New Lisp function created from
10891 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10892 (Fword_search_backward, Fword_search_forward)
10893 (Fword_search_backward_lax, Fword_search_forward_lax):
10894 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10895 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10896
10897 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10898
10899 * fileio.c (Finsert_file_contents): Move after-change-function call
10900 to before the "handled:" label, since all "goto handled" appear in
10901 cases where the *-change-functions have already been properly called
10902 (bug#10117).
10903
10904 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10905
10906 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10907 waiting for input. (Bug#10169)
10908
10909 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10910
10911 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10912 verifies glyph row's hash code--we have just reallocated the
10913 glyphs, so their contents can be complete garbage. (Bug#10164)
10914
10915 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10916
10917 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10918
10919 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10920
10921 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10922 attributes are tested _before_ calling verify_row_hash, to protect
10923 against GCC re-ordering of the tests. (Bug#10164)
10924
10925 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10926
10927 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10928
10929 * xterm.c (handle_one_xevent): Only set async_visible and friends
10930 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10931 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10932 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10933
10934 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10935
10936 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10937 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10938 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10939 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10940 All uses changed to use GCPRO1 etc.
10941 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10942 Revert to old implementation (i.e., before 2011-03-11).
10943
10944 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10945
10946 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10947 of scroll runs so as to avoid assigning disabled bogus rows and
10948 unnecessary graphics copy operations.
10949
10950 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10951
10952 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10953 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10954 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10955 (malloc, free, realloc, calloc): Redirect to e_* only when
10956 compiling Emacs.
10957
10958 * lisp.h (GCTYPEBITS): Move before first use.
10959 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10960 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10961 this macro definition.
10962
10963 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10964 _MSC_VER.
10965
10966 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10967
10968 * gtkutil.c (xg_create_frame_widgets):
10969 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10970 present with Gtk+ 2.0.
10971
10972 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10973
10974 * fileio.c (Finsert_file_contents): Undo previous change; see
10975 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10976
10977 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10978
10979 Rename locals to avoid shadowing.
10980 * fileio.c (Finsert_file_contents):
10981 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10982 * process.c (wait_reading_process_output):
10983 Rename inner 'proc' to 'p' to avoid shadowing.
10984 Indent for consistency with usual Emacs style.
10985
10986 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10987
10988 * xdisp.c (redisplay_window): If cursor row is not fully visible
10989 after recentering, and scroll-conservatively is set to a large
10990 number, scroll window by a few more lines to make the cursor fully
10991 visible and out of scroll-margin. (Bug#10105)
10992 (start_display): Don't move to the next line if the display should
10993 start at a newline that is part of a display vector or an overlay
10994 string. (Bug#10119)
10995
10996 2011-11-24 Juri Linkov <juri@jurta.org>
10997
10998 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10999 after the `MagickPingImage' call. (Bug#10112)
11000
11001 2011-11-23 Chong Yidong <cyd@gnu.org>
11002
11003 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11004
11005 2011-11-23 Martin Rudalics <rudalics@gmx.at>
11006
11007 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11008 making another buffer current. (Bug#10114)
11009
11010 2011-11-23 Glenn Morris <rgm@gnu.org>
11011
11012 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11013
11014 2011-11-23 Chong Yidong <cyd@gnu.org>
11015
11016 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11017 using it (Bug#5984).
11018
11019 2011-11-22 Eli Zaretskii <eliz@gnu.org>
11020
11021 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11022 and header-lines, as they don't have one computed for them.
11023 (Bug#10098)
11024
11025 * .gdbinit (prow): Make displayed values more self-explaining.
11026 Add row's hash code.
11027
11028 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11029
11030 * process.c (wait_reading_process_output): Fix asynchrounous
11031 GnuTLS socket handling on some versions of the GnuTLS library.
11032 (wait_reading_process_output): Add comment and URL.
11033
11034 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
11035
11036 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11037
11038 2011-11-21 Chong Yidong <cyd@gnu.org>
11039
11040 * window.c (Fnext_window, Fprevious_window): Doc fix.
11041
11042 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11043
11044 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11045
11046 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11047
11048 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11049
11050 2011-11-20 Martin Rudalics <rudalics@gmx.at>
11051
11052 * window.c (Fset_window_combination_limit): Rename argument
11053 STATUS to LIMIT.
11054 (Vwindow_combination_limit): Remove "status" from doc-string.
11055
11056 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11057
11058 * m/ibms390.h: Remove.
11059 * m/ibms390x.h: Don't include "ibms390.h".
11060
11061 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11062
11063 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11064 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11065
11066 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11067
11068 * casetab.c (Fset_case_table):
11069 * charset.c (Fcharset_after): Fix typos.
11070
11071 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11072
11073 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11074 Otherwise, valgrind does not work on some platforms.
11075 Problem reported by Andreas Schwab in
11076 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11077 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11078 is set, removing the need for VIRT_ADDRESS_VARIES.
11079 (PURE_P): Use a more-efficient implementation that needs just one
11080 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11081 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11082 to 4 (xorl, subq, cmpq, setbe).
11083 * alloc.c (pure): Always extern now, since that's the
11084 VIRT_ADDR_VARIES behavior.
11085 (PURE_POINTER_P): Use a single comparison, not two, for
11086 consistency with the new puresize.h.
11087 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11088 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11089 Remove VIRT_ADDR_VARIES no longer needed.
11090
11091 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11092
11093 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11094 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11095 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11096 behave as if the cursor position were at the window margin.
11097
11098 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11099 and the cursor position is out of bounds, behave as if the cursor
11100 position were at the window margin. (Bug#10075)
11101
11102 2011-11-18 Chong Yidong <cyd@gnu.org>
11103
11104 * window.c (Fwindow_combination_limit): Make first argument
11105 non-optional, since it is meaningless for live windows like the
11106 selected window.
11107
11108 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11109
11110 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11111
11112 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11113
11114 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11115 (graft_intervals_into_buffer): Simplify.
11116
11117 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11118
11119 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11120 hash values of the two rows.
11121 (copy_row_except_pointers): Preserve the used[] arrays and the
11122 hash values of the two rows. (Bug#10035)
11123 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11124
11125 * xdisp.c (row_hash): New function, body extracted from
11126 compute_line_metrics.
11127 (compute_line_metrics): Call row_hash, instead of computing the
11128 hash code inline.
11129
11130 * dispnew.c (verify_row_hash): Call row_hash for computing the
11131 hash code of a row, instead of duplicating code from xdisp.c.
11132
11133 * dispextern.h (row_hash): Add prototype.
11134
11135 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11136
11137 * frame.c (delete_frame): Don't delete the terminal when the last
11138 X frame is closed if emacs is built with GTK toolkit.
11139
11140 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11141
11142 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11143
11144 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11145
11146 * window.c (Vwindow_splits): Rename to
11147 Vwindow_combination_resize. Suggested by Juri Linkov.
11148 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11149 of Vwindow_splits.
11150
11151 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11152
11153 * nsfns.m (Fns_font_name):
11154 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11155
11156 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11157
11158 * window.h (window): Rename slot "nest" to "combination_limit".
11159 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11160 (Fset_window_nest): Rename to Fset_window_combination_limit.
11161 (Vwindow_nest): Rename to Vwindow_combination_limit.
11162 (recombine_windows, make_parent_window, make_window)
11163 (Fsplit_window_internal, saved_window)
11164 (Fset_window_configuration, save_window_save): Rename all
11165 occurrences of window_nest to window_combination_limit.
11166
11167 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11168
11169 * image.c (imagemagick_load_image): Fix typo.
11170
11171 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11172
11173 * xdisp.c (display_line): Move the call to
11174 highlight_trailing_whitespace before the call to
11175 compute_line_metrics, since the latter needs to see the final
11176 faces of all the glyphs to compute ROW's hash value.
11177 Fixes assertion violations in row_equal_p. (Bug#10035)
11178
11179 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11180
11181 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11182 just return (bug#10044).
11183
11184 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11185
11186 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11187 with user-defined heap size. Bump the default size of the temacs
11188 heap to 27MB, to avoid memory warning when running temacs.
11189 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11190
11191 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11192 current_matrix and desired_matrix. (Bug#9990)
11193 (verify_row_hash) [XASSERTS]: New function.
11194 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11195 that the hash value of glyph rows is correct.
11196
11197 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11198
11199 * window.h (window): Remove splits slot.
11200 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11201 (Fdelete_other_windows_internal, make_parent_window)
11202 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11203 (Fset_window_configuration, save_window_save): Don't deal with
11204 split status of windows.
11205 (saved_window): Remove splits slot.
11206 (Vwindow_splits): Rewrite doc-string.
11207
11208 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11209
11210 * xfns.c (unwind_create_frame):
11211 * nsfns.m (unwind_create_frame):
11212 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11213 Vframe_list (Bug#9999).
11214
11215 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11216
11217 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11218
11219 2011-11-11 Kenichi Handa <handa@m17n.org>
11220
11221 * callproc.c (Fcall_process): Set the member dst_multibyte of
11222 process_coding.
11223
11224 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11225
11226 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11227 avoid a crash (bug#9496).
11228
11229 2011-11-09 Chong Yidong <cyd@gnu.org>
11230
11231 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11232 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11233
11234 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11235
11236 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11237
11238 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11239
11240 Avoid some portability problems by eschewing 'extern inline' functions.
11241 The trivial performance wins aren't worth the portability hassles; see
11242 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11243 et seq.
11244 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11245 (window_box_width, window_box_left, window_box_left_offset)
11246 (window_box_right, window_box_right_offset): Undo previous change,
11247 by removing the "extern"s.
11248 * intervals.c (adjust_intervals_for_insertion)
11249 (adjust_intervals_for_deletion): Undo previous change,
11250 making these static again.
11251 (offset_intervals, temp_set_point_both, temp_set_point)
11252 (copy_intervals_to_string): No longer inline.
11253 * xdisp.c (window_text_bottom_y, window_box_width)
11254 (window_box_height, window_box_left_offset)
11255 (window_box_right_offset, window_box_left, window_box_right)
11256 (window_box): No longer inline.
11257
11258 2011-11-08 Chong Yidong <cyd@gnu.org>
11259
11260 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11261 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11262 Signal an error if not a live window.
11263 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11264 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11265
11266 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11267
11268 * lisp.h (syms_of_abbrev): Remove declaration.
11269 Reported by CHENG Gao <chenggao@royau.me>.
11270
11271 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11272
11273 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11274 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11275 of temacs in GUI mode.
11276
11277 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11278
11279 * window.h: Declare delete_all_child_windows instead of
11280 delete_all_subwindows.
11281 * window.c (Fwindow_nest, Fset_window_nest)
11282 (Fset_window_new_total, Fset_window_new_normal)
11283 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11284 (delete_all_subwindows): Rename to delete_all_child_windows.
11285 (Fdelete_other_windows_internal, Fset_window_configuration):
11286 Call delete_all_child_windows instead of delete_all_subwindows.
11287 * frame.c (delete_frame): Call delete_all_child_windows instead
11288 of delete_all_subwindows.
11289
11290 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11291
11292 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11293 This is also needed for porting to any host where GC_MARK_STACK is
11294 not GC_MAKE_GCPROS_NOOPS.
11295 (which_symbols): Use it.
11296
11297 2011-11-07 Kenichi Handa <handa@m17n.org>
11298
11299 * coding.c (coding_set_destination): Check coding->src_pos only
11300 when coding->src_object is a buffer (bug#9910).
11301
11302 * process.c (send_process): Set the member src_multibyte of coding
11303 to 0 (bug#9911) when sending a unibyte text.
11304
11305 * callproc.c (Fcall_process): Set the member src_multibyte of
11306 process_coding to 0 (bug#9912).
11307
11308 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11309
11310 * xmenu.c (cleanup_widget_value_tree): New function.
11311 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11312 calling free_menubar_widget_value_tree directly (Bug#9830).
11313
11314 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11315
11316 Fix some portability problems with 'inline'.
11317 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11318 (window_box_width, window_box_left, window_box_left_offset)
11319 (window_box_right, window_box_right_offset): Declare extern.
11320 Otherwise, these inline functions do not conform to C99 and
11321 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11322 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11323 * intervals.c (adjust_intervals_for_insertion)
11324 (adjust_intervals_for_deletion): Now extern, because otherwise the
11325 extern inline functions 'offset_intervals' couldn't refer to it.
11326 (static_offset_intervals): Remove.
11327 (offset_intervals): Rewrite using the old contents of
11328 static_offset_intervals. The old version didn't conform to C99
11329 because an extern inline function contained a reference to an
11330 identifier with static linkage.
11331
11332 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11333
11334 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11335 GC.
11336
11337 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11338
11339 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11340 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11341 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11342 return Qleft_to_right.
11343
11344 2011-11-06 Chong Yidong <cyd@gnu.org>
11345
11346 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11347 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11348 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11349 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11350 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11351 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11352 (Fwindow_vscroll): Doc fix.
11353 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11354 argument, since it makes no sense to pass a live window and for
11355 consistency with window-child.
11356
11357 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11358
11359 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11360 support MSVC.
11361
11362 2011-11-05 Jason Rumney <jasonr@gnu.org>
11363
11364 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11365 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11366 fonts (Bug#6029).
11367 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11368 bitwise arithmetic preventing use of unicode-sip and non-truetype
11369 opentype fonts.
11370
11371 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11372
11373 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11374 "emacs"-only part.
11375
11376 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11377 initialization code to keep similarity to xfns.c after changes
11378 from 2011-11-05.
11379
11380 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11381
11382 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11383 (unwind_create_frame): New function (Bug#9943).
11384 (Fx_create_frame): Restructure code to be more similar to the one in
11385 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11386 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11387 Move terminal->reference_count++ just before making the frame official
11388 (Bug#9943).
11389
11390 * nsterm.m (x_free_frame_resources): New function.
11391 (x_destroy_window): Move code to x_free_frame_resources.
11392
11393 * xfns.c (unwind_create_frame): Fix comment.
11394 (Fx_create_frame, x_create_tip_frame):
11395 Move terminal->reference_count++ just before making the frame
11396 official. Move initialization of image_cache_refcount and
11397 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11398
11399 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11400
11401 Support MSVC build with newer versions of Visual Studio.
11402 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11403 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11404 nt/gmake.defs.
11405
11406 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11407 which are not supported by MSVC.
11408 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11409 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11410 bitfields.
11411 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11412 types in bitfields.
11413 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11414
11415 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11416
11417 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11418
11419 Support MSVC build with newer versions of Visual Studio.
11420 * w32.c: Don't include w32api.h for MSVC.
11421 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11422
11423 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11424 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11425 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11426 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11427 e_* cousins.
11428 (alloca) [_MSC_VER]: Define to _alloca.
11429
11430 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11431
11432 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11433
11434 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11435
11436 * xdisp.c (note_mouse_highlight): If either of
11437 previous/next-single-property-change returns nil, treat that as
11438 the beginning or the end of the buffer. (Bug#9955)
11439
11440 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11441
11442 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11443 label is not null (Bug#9951).
11444 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11445 may be NULL.
11446
11447 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11448
11449 * window.c (Fwindow_body_size): Mention in the doc string that the
11450 return value is in frame's canonical units. (Bug#9949)
11451
11452 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11453
11454 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11455
11456 * w32fns.c (unwind_create_frame): If needed, free the glyph
11457 matrices of the partially constructed frame. (Bug#9943)
11458 * xfns.c (unwind_create_frame): Likewise.
11459
11460 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11461
11462 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11463 Don't stop backward scan on the continuation glyph, even though
11464 its CHARPOS is positive.
11465 (mouse_face_from_buffer_pos, note_mouse_highlight):
11466 Rename cover_string to disp_string.
11467
11468 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11469
11470 * window.c (temp_output_buffer_show): Don't use
11471 Vtemp_buffer_show_specifiers.
11472 (Vtemp_buffer_show_specifiers): Remove unused variable.
11473
11474 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11475
11476 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11477 past the beginning of the current glyph matrix.
11478
11479 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11480
11481 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11482 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11483 HAVE_GTK3 (Bug#9869).
11484
11485 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11486 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11487
11488 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11489
11490 * xterm.c: Declare x_handle_net_wm_state to return int.
11491 (handle_one_xevent): Check if we are iconified but don't have
11492 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11493 (get_current_wm_state): Return non-zero if not hidden,
11494 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11495 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11496 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11497 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11498
11499 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11500
11501 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11502 so that this new function doesn't get optimized away by a
11503 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11504
11505 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11506
11507 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11508
11509 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11510
11511 Fix the `xbytecode' command.
11512 * .gdbinit (xprintbytestr): New command.
11513 (xwhichsymbols): Rename from `which'; all callers changed.
11514 (xbytecode): Print the byte-code string as well.
11515
11516 2011-10-29 Kim Storm <storm@cua.dk>
11517
11518 * alloc.c (which_symbols): New function.
11519
11520 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11521
11522 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11523 line. (Bug#9903)
11524
11525 2011-10-29 Glenn Morris <rgm@gnu.org>
11526
11527 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11528 Not clear what it was for, and it causes various bugs. (Bug#9839)
11529
11530 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11531
11532 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11533 possible random value that matches one of those tested as
11534 condition to clear the mouse face.
11535
11536 2011-10-28 Chong Yidong <cyd@gnu.org>
11537
11538 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11539
11540 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11541
11542 * window.c (make_window): Initialize phys_cursor_on_p.
11543
11544 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11545
11546 * lisp.h (struct Lisp_Symbol): Update comments.
11547
11548 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11549
11550 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11551
11552 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11553
11554 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11555 <oslsachem@gmail.com> for helping to debug this.
11556
11557 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11558 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11559 (g_b_init_get_glyph_outline_w): New static variables.
11560 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11561 (GetGlyphOutlineW_Proc): New typedefs.
11562 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11563 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11564 New functions.
11565 (w32font_open_internal, compute_metrics):
11566 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11567 instead of calling the "wide" APIs directly.
11568
11569 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11570
11571 * w32.h (syms_of_w32font): Add prototype.
11572
11573 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11574
11575 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11576 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11577 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11578 (Fmove_to_window_line): Doc fix.
11579
11580 2011-10-27 Chong Yidong <cyd@gnu.org>
11581
11582 * process.c (make_process): Set gnutls_state to NULL.
11583
11584 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11585 non-NULL, regardless of GNUTLS_INITSTAGE.
11586 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11587 an error. Set process slots as soon as we allocate them.
11588
11589 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11590
11591 2011-10-27 Chong Yidong <cyd@gnu.org>
11592
11593 * gnutls.c (emacs_gnutls_deinit): New function.
11594 Deallocate credentials structures as well as calling gnutls_deinit.
11595 (Fgnutls_deinit, Fgnutls_boot): Use it.
11596
11597 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11598 (deactivate_process): Call emacs_gnutls_deinit.
11599
11600 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11601
11602 * image.c (x_create_x_image_and_pixmap):
11603 * w32.c (sys_rename, w32_delayed_load):
11604 * w32font.c (fill_in_logfont):
11605 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11606
11607 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11608
11609 * w32fns.c (w32_default_color_map): New function,
11610 extracted from Fw32_default_color_map.
11611 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11612
11613 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11614
11615 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11616
11617 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11618
11619 * keyboard.c (test_undefined): New function (bug#9751).
11620 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11621
11622 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11623
11624 * sysdep.c (init_sys_modes): Fix the check for the controlling
11625 terminal (Bug#6649).
11626
11627 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11628
11629 * dispextern.h (struct bidi_it): New member next_en_type.
11630
11631 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11632 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11633 current character, check also for next_en_type being WEAK_EN.
11634 (bidi_resolve_weak): Don't enter the expensive loop if the current
11635 position is before next_en_pos. Record the bidi type of the first
11636 non-ET, non-BN character we find, in addition to its position.
11637 (bidi_level_of_next_char): Invalidate next_en_type when
11638 next_en_pos is over-stepped.
11639
11640 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11641
11642 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11643 * editfns.c: Rewrite current-time-zone so that it invokes
11644 the equivalent of (format-time-string "%Z") to get the time zone name.
11645 This fixes a bug when the time zone name contains characters that
11646 need converting from the system time locale to Emacs internal format.
11647 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11648 that patch fixed format-time-string to do the conversion, but
11649 I forgot to fix current-time-zone.
11650 (format_time_string): New function, containing most of
11651 what Fformat_time_string used to contain.
11652 (Fformat_time_string): Rewrite in terms of format_time_string.
11653 This doesn't change this function's behavior.
11654 (current-time-zone): Rewrite to use format_time_string.
11655 This fixes the bug reported by Michael Schierl in
11656 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11657 Jason Rumney's 2007-06-07 change worked around this bug, but
11658 didn't fix it.
11659 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11660
11661 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11662
11663 * xdisp.c (start_display): If the character at POS is displayed
11664 via a display vector, reset IT->current.dpvec_index to zero.
11665 (try_window_reusing_current_matrix): If a line ends in a display
11666 vector or the next line starts in a display vector, continue
11667 redrawing the window even though the character position of
11668 start_row was reached.
11669 (Bug#9771, part 2)
11670
11671 2011-10-18 Chong Yidong <cyd@gnu.org>
11672
11673 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11674 with nobreak-char-display too.
11675
11676 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11677
11678 Fix part 3 of bug#9771.
11679 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11680 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11681 non-neutral characters if the current character is a paragraph
11682 separator (a.k.a. Newline). This avoids running the same
11683 expensive loop twice, once when we consume the preceding newline
11684 and the other time when the line actually needs to be displayed.
11685 Avoid the loop when we see neutrals on the base embedding level
11686 following a character whose directionality is the same as the
11687 paragraph's. This avoids running the expensive loop when a line
11688 ends in a long sequence of neutrals, like control characters.
11689 Add assertion against STRONG_AL type. Slightly rearrange code
11690 that determines the type of a neutral given the first non-neutral
11691 that follows it.
11692 (bidi_level_of_next_char): Set next_en_pos to zero when
11693 invalidating its info.
11694
11695 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11696
11697 * xdisp.c (push_display_prop): Determine whether to record string
11698 or buffer position by IT->string, not by IT->method. Allow
11699 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11700 (move_it_vertically_backward): Don't look for character position
11701 immediately after the newline when in a continuation line.
11702 (Bug#9771, part 1)
11703
11704 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11705
11706 * window.c (coordinates_in_window): Rewrite and delabelize
11707 vertical border check. (Bug#5357) (Bug#9618)
11708
11709 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11710
11711 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11712 errors in XSetWindowBorder (bug#9310).
11713
11714 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11715
11716 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11717 avoid crash when xmalloc overrun checking is enabled.
11718
11719 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11720
11721 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11722 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11723 cursor motion with <left> and <right> arrow keys.
11724
11725 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11726 some callers set that themselves.
11727
11728 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11729
11730 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11731 display string and the previous row comes from the same string and
11732 is empty. (Bug#9739) (Bug#9738)
11733
11734 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11735
11736 * doc.c (get_doc_string): Encode file name (bug#9735).
11737
11738 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11739
11740 * bidi.c (bidi_level_of_next_char):
11741 * xdisp.c (get_visually_first_element): Remove old incorrect
11742 comments regarding the Unicode Line Separator character.
11743
11744 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11745
11746 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11747
11748 * alloc.c (Fgc_status): Do not access beyond zombies array
11749 boundary if nzombies > MAX_ZOMBIES.
11750 * alloc.c (dump_zombies): Add missing format specifier.
11751
11752 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11753
11754 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11755 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11756
11757 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11758 Some packages use them to denote characters with modifiers.
11759
11760 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11761
11762 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11763 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11764 matching a pp-number. Rename parameter var to var1.
11765
11766 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11767
11768 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11769
11770 2011-10-08 Glenn Morris <rgm@gnu.org>
11771
11772 * callint.c (Fcall_interactively): Give a more explicit error for the
11773 'c' case with a non-character input. (Bug#8479)
11774
11775 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11776
11777 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11778 lines.
11779 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11780 lines that are hscrolled on the left.
11781
11782 * dispnew.c (buffer_posn_from_coords): Account for a possible
11783 presence of header-line. (Bug#4426)
11784
11785 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11786
11787 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11788 Don't advertise functionality which we discourage or doesn't work.
11789
11790 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11791
11792 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11793 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11794 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11795 this makes Emacs dump core during garbage collection on rare
11796 occasions. sizeof is obviously inferior to offsetof here, so
11797 stick with offsetof.
11798 (GC_POINTER_ALIGNMENT): New macro.
11799 (mark_memory): Omit 3rd (offset) arg; caller changed.
11800 Don't assume EMACS_INT alignment is the same as pointer alignment.
11801
11802 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11803
11804 * keyboard.c (read_key_sequence_remapped): New var.
11805 (read_key_sequence): Compute remapping in the right buffer.
11806 (command_loop_1): Use read_key_sequence's remapping directly.
11807
11808 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11809
11810 * dired.c (file_name_completion): Don't expand file name.
11811 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11812 before checking file name handler.
11813
11814 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11815 they've been requested explicitly (bug#9591).
11816
11817 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11818
11819 * keymap.c (Fsingle_key_description): Use make_specified_string
11820 instead of build_string to build string from push_key_description.
11821 (Bug#5193)
11822
11823 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11824
11825 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11826 This fixes a Y2038 bug on 64-bit hosts.
11827 * buffer.c (reset_buffer):
11828 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11829 (Fclear_buffer_auto_save_failure):
11830 Use 0, not -1, to represent an unset failure time, since time_t
11831 might not be signed.
11832
11833 Remove dependency on glibc malloc internals.
11834 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11835 Move back here from lisp.h, but with their new implementations.
11836 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11837 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11838 * charset.c (charset_table_init): New static var.
11839 (syms_of_charset): Use it instead of xmalloc. This removes a
11840 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11841 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11842 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11843 Move back to alloc.c.
11844 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11845 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11846
11847 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11848
11849 * nsterm.m (windowDidResize): Call x_set_window_size only when
11850 ns_in_resize is true. Otherwise set pixelwidth/height and
11851 call change_frame_size (Bug#9628).
11852
11853 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11854
11855 Port --enable-checking=all to Fedora 14 x86-64.
11856 * charset.c (syms_of_charset): Also account for glibc malloc's
11857 internal overhead when calculating the initial malloc maximum.
11858
11859 Port --enable-checking=all to Fedora 14 x86.
11860 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11861 Move to lisp.h.
11862 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11863 (overrun_check_realloc, overrun_check_free):
11864 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11865 That way, xmalloc returns a properly-aligned pointer even if
11866 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11867 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11868 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11869 into account when calculating the initial malloc maximum.
11870 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11871 Move here from alloc.c, so that charset.c can use it too.
11872 Properly align; the old code wasn't right for common 32-bit hosts
11873 when configured with --enable-checking=all.
11874 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11875 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11876
11877 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11878
11879 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11880 use EDOM.
11881
11882 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11883
11884 * xdisp.c (compute_display_string_end): If there's no display
11885 string at CHARPOS, return -1.
11886
11887 * bidi.c (bidi_fetch_char): When compute_display_string_end
11888 returns a negative value, treat the character as a normal
11889 character not covered by a display string. (Bug#9624)
11890
11891 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11892
11893 * lread.c (Fread_from_string): Fix typo in docstring.
11894
11895 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11896
11897 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11898 newline, reseat the iterator instead of bidi-iterating there one
11899 character at a time. (Bug#9610)
11900 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11901 TO_CHARPOS if the bidi iterator is at base embedding level.
11902
11903 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11904
11905 * lread.c (readevalloop): Use correct code for NBSP.
11906 (read1): Likewise. (Bug#9608)
11907
11908 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11909
11910 * dbusbind.c (Fdbus_register_signal): When service is not
11911 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11912
11913 2011-09-25 Glenn Morris <rgm@gnu.org>
11914
11915 * buffer.c (truncate-lines): Doc fix.
11916
11917 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11918
11919 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11920 (Fset_window_next_buffers): Doc fix.
11921
11922 2011-09-24 Glenn Morris <rgm@gnu.org>
11923
11924 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11925
11926 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11927
11928 Fix minor problems found by static checking.
11929 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11930 * indent.c (Fvertical_motion): Fix == vs = typo.
11931
11932 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11933
11934 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11935 Default value is now t. Doc fix.
11936
11937 * indent.c (Fvertical_motion): Compute and apply the overshoot
11938 logic when moving up, not only when moving down. Fix the
11939 confusing name and values of the it_overshoot_expected variable;
11940 logic changes accordingly. (Bug#9254) (Bug#9549)
11941
11942 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11943 CHARPOS is covered by a display string which includes newlines.
11944 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11945 is covered by a display string with embedded newlines.
11946
11947 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11948
11949 * dbusbind.c (Fdbus_register_signal): Add match rule to
11950 Vdbus_registered_objects_table. (Bug#9581)
11951 (Fdbus_register_method, Vdbus_registered_objects_table):
11952 Fix docstring.
11953
11954 2011-09-24 Jim Meyering <meyering@redhat.com>
11955
11956 do not ignore write error for any output size
11957 The previous change was incomplete.
11958 While it makes emacs --batch detect the vast majority of stdout
11959 write failures, errors were still ignored whenever the output size is
11960 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11961 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11962 && echo FAIL: ignored write error
11963 FAIL: ignored write error
11964 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11965 && echo FAIL: ignored write error
11966 FAIL: ignored write error
11967 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11968
11969 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11970
11971 * emacs.c (Fkill_emacs): In noninteractive mode exit
11972 non-successfully if a write error occurred on stdout. (Bug#9574)
11973
11974 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11975
11976 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11977 the xassert test.
11978
11979 * dispextern.h (struct it): Update the comment documenting what
11980 can it->OBJECT be.
11981
11982 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11983
11984 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11985 a display string, extend search for cursor position to end of row.
11986 (find_row_edges): If the row ends in a newline from a display
11987 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11988 Handle the case of a display string with multiple newlines.
11989 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11990 non-empty line. Fixes confusing cursor motion with arrow keys at
11991 the beginning of a line that starts with whitespace.
11992
11993 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11994
11995 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11996 (bug#9493).
11997
11998 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11999
12000 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12001 boolean (Bug#9154).
12002
12003 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12004
12005 * xdisp.c (display_line): Record maximum and minimum buffer
12006 positions even if no glyphs were produced (e.g., by a zero-width
12007 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12008 buffer positions that will be removed from the glyph row because
12009 they don't fit.
12010 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12011 column is beyond frame width: don't subtract 1 "pixel" when
12012 computing width of the stretch.
12013 (reseat_at_next_visible_line_start): Undo the change made on
12014 2011-09-17 that saved paragraph information and restored it after
12015 the call to `reseat'. (Bug#9545)
12016
12017 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12018
12019 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12020 and turn window cursor on if cleared (Bug#9415).
12021
12022 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
12023
12024 * search.c (boyer_moore): Take unibyte characters from pattern
12025 literally. (Bug#9458)
12026
12027 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12028
12029 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12030
12031 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12032
12033 Fix minor problem found by static checking.
12034 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12035 initialized, to pacify gcc -Wuninitialized.
12036
12037 * fileio.c: Report proper errno when syscall falls.
12038 (Finsert_file_contents): Save and restore errno,
12039 so that report_file_error outputs the correct diagnostic.
12040 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12041
12042 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12043
12044 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12045
12046 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12047
12048 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12049 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12050
12051 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12052
12053 * xdisp.c (reseat_at_next_visible_line_start): Keep information
12054 about the current paragraph and restore it after the call to reseat.
12055
12056 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12057 (bidi_find_paragraph_start): Search back for paragraph beginning
12058 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12059 (bidi_move_to_visually_next): Only trigger paragraph-related
12060 computations when the last character is a newline or at EOB, not
12061 just any NEUTRAL_B. (Bug#9470)
12062
12063 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12064 truncated lines if point is covered by a display string. (Bug#9524)
12065
12066 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12067
12068 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12069 (cons_to_x_long): New function.
12070 (lisp_data_to_selection_data): Use it. Correct the test for
12071 short-versus-long data; it was negated. Break out of vector
12072 loop, for efficiency, when a long datum is discovered.
12073
12074 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12075
12076 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12077
12078 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12079
12080 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12081 GCC PR/17406) by declaring this function with external scope.
12082
12083 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12084
12085 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12086 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12087
12088 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12089
12090 * editfns.c (Fformat): Correctly handle text properties on "%%".
12091
12092 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12093
12094 * xterm.c (x_draw_composite_glyph_string_foreground):
12095 * w32term.c (x_draw_composite_glyph_string_foreground):
12096 * term.c (encode_terminal_code):
12097 * composite.c (composition_update_it, get_composition_id):
12098 * xdisp.c (get_next_display_element)
12099 (fill_composite_glyph_string): Add comments about special meaning
12100 of TAB characters in a composition.
12101
12102 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12103
12104 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12105 This occurs when processing a multibyte format.
12106 Problem reported by Wolfgang Jenker.
12107
12108 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12109
12110 * xdisp.c (try_cursor_movement): Only check for exact match if
12111 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12112
12113 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12114
12115 Remove unused external symbols.
12116 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12117 * xdisp.c (calc_pixel_width_or_height): Now static.
12118 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12119 * indent.c (check_display_width):
12120 * w32term.c: Fix comment to match code.
12121 * xterm.c, xterm.h (x_catching_errors): Remove.
12122
12123 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12124
12125 * xselect.c: Use signed conversions more consistently (Bug#9498).
12126 (selection_data_to_lisp_data): Assume incoming selection data are
12127 signed integers, not unsigned. This is to be consistent with
12128 outgoing selection data, which was modified to use signed integers
12129 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12130 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12131 expects long, not unsigned long.
12132
12133 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12134
12135 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12136 computation of loop end. Reported by Johan Bockgård
12137 <bojohan@gnu.org>.
12138
12139 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12140
12141 * frame.c (Fother_visible_frames_p): Function deleted.
12142
12143 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12144
12145 * indent.c (compute_motion): Process display vector front to back
12146 rather than the other way around. (Bug#2496)
12147
12148 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12149
12150 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12151
12152 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12153
12154 * minibuf.c (Fread_from_minibuffer): Doc fix.
12155
12156 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12157
12158 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12159 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12160
12161 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12162
12163 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12164 value for non-existent files.
12165
12166 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12167
12168 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12169 set its "size" to -1. This will set the modtime_size field of
12170 the corresponding buffer to -1, which is what
12171 verify-visited-file-modtime expects for files that do not exist.
12172 (Bug#9139)
12173
12174 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12175
12176 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12177 here ...
12178 * lisp.h: ... from here. push_key_description is no longer
12179 defined in keyboard.c, so its declaration should not be in
12180 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12181 logically belongs with push_key_description.
12182
12183 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12184
12185 * buffer.h: Include <sys/types.h> instead of <time.h>.
12186 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12187 Problem reported by Herbert J. Skuhra.
12188
12189 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12190
12191 * xml.c (parse_region): Make the parsing work for
12192 non-comment-starting XML files again (bug#9144).
12193
12194 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12195
12196 * image.c (gif_load): Fix calculation of bottom and right corner.
12197 (Bug#9468)
12198
12199 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12200
12201 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12202 redisplay in small windows.
12203
12204 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12205
12206 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12207
12208 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12209
12210 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12211 Operate on live windows only.
12212
12213 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12214
12215 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12216
12217 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12218
12219 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12220 only under bidi iteration.
12221
12222 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12223
12224 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12225
12226 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12227
12228 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12229 Without this fix, the command to link temacs failed due to an
12230 undefined symbol __builtin_isnan. This is because
12231 /usr/include/iso/math_c99.h #defines isnan(x) to
12232 __builtin_isnan(x), but the bundled gcc, which identifies itself
12233 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12234 a __builtin_isnan.
12235 * floatfns.c (isnan): #undef, and then #define to a clone of
12236 what's in data.c.
12237 (Fisnan): Always define, since it's always available now.
12238 (syms_of_floatfns): Always define isnan at the Lisp level.
12239
12240 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12241
12242 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12243
12244 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12245
12246 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12247 The previous code assumed that file offsets (off_t values) fit in
12248 EMACS_INT variables, which is not true on typical 32-bit hosts.
12249 The code messed up by falsely reporting buffer overflow in cases
12250 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12251 when "big" contains more than 2**29 bytes, even though this
12252 inserts just one byte and does not overflow the buffer.
12253 (Finsert_file_contents): Store file offsets as off_t
12254 values, not as EMACS_INT values. Check for overflow when
12255 converting between EMACS_INT and off_t. When checking for
12256 buffer overflow or for overlap, take the offsets into account.
12257 Don't use EMACS_INT for small values where int suffices.
12258 When checking for overlap, fix a typo: ZV was used where
12259 ZV_BYTE was intended.
12260 (Fwrite_region): Don't assume off_t fits into 'long'.
12261 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12262
12263 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12264
12265 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12266
12267 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12268
12269 sprintf-related integer and memory overflow issues (Bug#9412).
12270
12271 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12272 (esprintf, exprintf, evxprintf): New functions.
12273 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12274 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12275 (modify_event_symbol): Do not assume that the length of
12276 name_alist_or_stem is safe to alloca and fits in int.
12277 (Fexecute_extended_command): Likewise for function name and binding.
12278 (Frecursion_depth): Wrap around reliably on integer overflow.
12279 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12280 since some callers pass EMACS_INT values.
12281 (Fsingle_key_description): Don't crash if symbol name contains more
12282 than MAX_ALLOCA bytes.
12283 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12284 (get_minibuffer): Arg is now EMACS_INT, not int.
12285 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12286 (esprintf, exprintf, evxprintf): New decls.
12287 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12288
12289 * dbusbind.c (signature_cat): New function.
12290 (xd_signature, Fdbus_register_signal):
12291 Do not overrun buffer; instead, report string overflow.
12292
12293 * dispnew.c (add_window_display_history): Don't overrun buffer.
12294 Truncate instead; this is OK since it's just a log.
12295
12296 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12297 even if the time zone offset is outlandishly large.
12298 Don't mishandle offset == INT_MIN.
12299
12300 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12301 when creating daemon; the previous buffer-overflow check was incorrect.
12302
12303 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12304 which has the guts of the old verror function.
12305
12306 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12307 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12308
12309 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12310 (font_unparse_xlfd): Don't blindly alloca long strings.
12311 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12312 fits in int, when using sprintf. Use single snprintf to count
12313 length of string rather than counting it via multiple sprintfs;
12314 that's simpler and more reliable.
12315 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12316 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12317 sprintf, in case result does not fit in int.
12318
12319 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12320 (fontset_from_font): Print it.
12321
12322 * frame.c (tty_frame_count): Now printmax_t, not int.
12323 (make_terminal_frame, set_term_frame_name): Print it.
12324 (x_report_frame_params): In X, window IDs are unsigned long,
12325 not signed long, so print them as unsigned.
12326 (validate_x_resource_name): Check for implausibly long names,
12327 and don't assume name length fits in 'int'.
12328 (x_get_resource_string): Don't blindly alloca invocation name;
12329 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12330 not fit in int.
12331
12332 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12333 (xg_check_special_colors, xg_set_geometry):
12334 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12335
12336 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12337 Use esprintf, not sprintf, in case result does not fit in int.
12338
12339 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12340 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12341 it as a large positive number.
12342 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12343 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12344
12345 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12346 in case result does not fit in int.
12347
12348 * print.c (float_to_string): Detect width overflow more reliably.
12349 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12350 buffer overrun. Don't assume list length fits in 'int'. Treat
12351 print length of 0 as 0, not as infinity; to be consistent with other
12352 uses of print length in this function. Don't overflow print length
12353 index. Don't assume hash table size fits in 'long', or that
12354 vectorlike size fits in 'unsigned long'.
12355
12356 * process.c (make_process): Use printmax_t, not int, to format
12357 process-name gensyms.
12358
12359 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12360
12361 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12362 to avoid potential buffer overrun.
12363
12364 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12365 if X resource line is longer than 512 bytes.
12366
12367 * xfns.c (x_window): Make sprintf buffer a bit bigger
12368 to avoid potential buffer overrun.
12369
12370 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12371
12372 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12373
12374 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12375
12376 Integer overflow fixes for scrolling, etc.
12377 Without these, Emacs silently mishandles large integers sometimes.
12378 For example, "C-u 4294967297 M-x recenter" was treated as if
12379 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12380
12381 * xdisp.c (try_window_id): Check Emacs fixnum range before
12382 converting to 'int'.
12383
12384 * window.c (window_scroll_line_based, Frecenter):
12385 Check that an Emacs fixnum is in range before assigning it to 'int'.
12386 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12387 values converted from Emacs fixnums.
12388 (Frecenter): Don't wrap around a line count if it is out of 'int'
12389 range; instead, treat it as an extreme value.
12390 (Fset_window_configuration, compare_window_configurations):
12391 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12392
12393 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12394 that can exceed INT_MAX. Check that EMACS_INT value is in range
12395 before assigning it to the (possibly-narrower) index.
12396 (match_limit): Don't assume that a fixnum can fit in 'int'.
12397
12398 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12399 exceed INT_MAX.
12400
12401 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12402 (Fvertical_motion): Don't wrap around LINES values that don't fit
12403 in 'int'. Instead, treat them as extreme values. This is good
12404 enough for windows, which can't have more than INT_MAX lines anyway.
12405
12406 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12407
12408 * Require libxml/parser.h to avoid compilation warning.
12409
12410 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12411
12412 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12413 since this reportedly can destroy thread storage.
12414
12415 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12416
12417 * syntax.c (find_defun_start): Update all cache variables if
12418 exiting early (Bug#9401).
12419
12420 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12421
12422 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12423
12424 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12425 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12426 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12427
12428 * term.c (tty_append_glyph): New function.
12429 (produce_stretch_glyph): Static function and its prototype deleted.
12430
12431 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12432 Add prototypes.
12433
12434 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12435
12436 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12437 when checking :margin (Bug#9390).
12438 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12439 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12440 so that the name doesn't mislead. All uses changed.
12441
12442 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12443
12444 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12445 set_tty_hooks.
12446
12447 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12448
12449 * xdisp.c (move_it_to): Don't bail out early when reaching
12450 position beyond to_charpos, if we are scanning backwards.
12451 (move_it_vertically_backward): When DY == 0, make sure we get to
12452 the first character in the line after the newline.
12453
12454 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12455
12456 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12457 (ccl_driver): Do not generate an out-of-range pointer.
12458 (Fccl_execute_on_string): Remove unnecessary check for
12459 integer overflow, noted by Stefan Monnier in
12460 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12461 Remove a FIXME that didn't need fixing.
12462 Simplify the newly-introduced buffer reallocation code.
12463
12464 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12465
12466 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12467
12468 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12469
12470 Integer and memory overflow issues (Bug#9196).
12471
12472 * doc.c (get_doc_string): Rework so that
12473 get_doc_string_buffer_size is the actual buffer size, rather than
12474 being 1 less than the actual buffer size; this makes xpalloc more
12475 convenient.
12476
12477 * image.c (x_allocate_bitmap_record, cache_image):
12478 * xselect.c (Fx_register_dnd_atom):
12479 Simplify previous changes by using xpalloc.
12480
12481 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12482 since either will do and ptrdiff_t is convenient with xpalloc.
12483
12484 * charset.c (charset_table_size)
12485 (struct charset_sort_data.priority): Now ptrdiff_t.
12486 (charset_compare): Don't overflow if priorities differ greatly.
12487 (Fsort_charsets): Don't assume list length fits in int.
12488 Check for size-calculation overflow when allocating sort data.
12489 (syms_of_charset): Allocate an initial charset table that is
12490 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12491
12492 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12493
12494 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12495 The actual value is always <= INT_MAX, and leaving it unsigned made
12496 overflow checking harder.
12497
12498 * dispextern.h (struct glyph_matrix.rows_allocated)
12499 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12500 with xpalloc. The values are still always <= INT_MAX.
12501
12502 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12503
12504 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12505 (SAFE_NALLOCA): New macro.
12506
12507 * region-cache.c (struct boundary.pos, find_cache_boundary)
12508 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12509 (set_cache_region, invalidate_region_cache)
12510 (revalidate_region_cache, know_region_cache, region_cache_forward)
12511 (region_cache_backward, pp_cache):
12512 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12513 so that ptrdiff_t * can be passed to xpalloc.
12514 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12515 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12516 (pp_cache): Don't assume cache_len fits in int.
12517 * region-cache.h: Adjust extern decls to match.
12518
12519 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12520 EMACS_INT, since either will do, for xpalloc.
12521
12522 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12523 (xnmalloc, xnrealloc, xpalloc): New functions.
12524
12525 * bidi.c (bidi_shelve_header_size): New constant.
12526 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12527 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12528
12529 * bidi.c (bidi_cache_shrink):
12530 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12531 (overlay_strings):
12532 Don't update size of array until after memory allocation succeeds,
12533 because xmalloc/xrealloc may not return.
12534 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12535 now that we have proper integer overflow checking.
12536 (record_overlay_string, overlay_strings): Catch overflows when
12537 calculating size of overlay_str_buf.
12538
12539 * callproc.c (Fcall_process): Check for size overflow when
12540 calculating size of args2.
12541 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12542 Normally we prefer signed values, but sticking with ptrdiff_t would
12543 require adding more-complicated checks.
12544
12545 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12546 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12547 Redo buffer-overflow calculations to avoid integer overflow.
12548 Add a FIXME comment where memory seems to be over-allocated.
12549
12550 * character.c (Fstring): Check for size-calculation overflow.
12551
12552 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12553 unnecessary integer overflow. Check for size overflow.
12554 (encode_coding_object): Don't update size until xmalloc succeeds.
12555
12556 * composite.c (get_composition_id): Check for overflow in glyph
12557 length calculations.
12558
12559 Integer and memory overflow fixes for display code.
12560 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12561 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12562 (scrolling_window): Check for overflow in size calculations.
12563 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12564 Don't assume glyph table len fits in int.
12565 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12566 (row_table_size): Now ptrdiff_t, not int.
12567 (scrolling_window): Avoid overflow in size calculations.
12568 Don't update size until allocation succeeds.
12569 * fns.c (concat): Check for overflow in size calculations.
12570 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12571 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12572 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12573
12574 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12575 (get_doc_string): Check for size calculation overflow.
12576 Don't update size until allocation succeeds.
12577 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12578 EMACS_INT, where ptrdiff_t will do.
12579 (Fsubstitute_command_keys): Check for string overflow.
12580
12581 * editfns.c (set_time_zone_rule): Don't assume environment length
12582 fits in int.
12583 (message_length): Now ptrdiff_t, not int.
12584 (Fmessage_box): Don't update size until allocation succeeds.
12585 Don't assume message length fits in int.
12586 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12587
12588 * emacs.c (main): Do not reallocate argv, since there is a null at
12589 the end that can be overwritten, and this way there's no need to
12590 worry about size-calculation overflow.
12591 (sort_args): Check for size-calculation overflow.
12592
12593 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12594 alloc succeeds.
12595 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12596
12597 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12598 (x_set_scroll_bar_width, x_figure_window_size):
12599 Check for integer overflow.
12600 (x_set_alpha): Do not assume XINT fits in int.
12601
12602 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12603 This is for the members text_lines, text_cols, total_lines, total_cols,
12604 where the system imposes an 'int' limit.
12605
12606 * fringe.c (Fdefine_fringe_bitmap):
12607 Don't update size until alloc works.
12608
12609 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12610 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12611
12612 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12613 Check for size-calculation overflow.
12614 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12615 do, as we prefer signed integers.
12616 (id_to_widget.max_size, id_to_widget.used)
12617 (xg_store_widget_in_map, xg_remove_widget_from_map)
12618 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12619 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12620 Use and return ptrdiff_t, not int.
12621 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12622 * gtkutil.h: Change prototypes to match the above.
12623
12624 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12625 are duplicate now that they've been promoted to lisp.h.
12626 (x_allocate_bitmap_record, x_alloc_image_color)
12627 (make_image_cache, cache_image, xpm_load):
12628 Don't update size until alloc is done.
12629 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12630 (x_detect_edges):
12631 Check for size calculation overflow.
12632 (ct_colors_allocated_max): New constant.
12633 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12634 overflow.
12635
12636 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12637 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12638 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12639 Use ptrdiff_t, not int, to count maps.
12640 (read_char_minibuf_menu_prompt): Check for overflow in size
12641 calculations. Don't update size until allocation succeeds.
12642 Redo calculations to avoid overflow.
12643 * keyboard.h: Change prototypes to match the above.
12644
12645 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12646 to count maps.
12647 (current_minor_maps): Check for size calculation overflow.
12648 * keymap.h: Change prototypes to match the above.
12649
12650 * lread.c (read1, init_obarray): Don't update size until alloc done.
12651
12652 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12653 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12654
12655 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12656 Now ptrdiff_t, not int.
12657 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12658 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12659
12660 * process.c (Fnetwork_interface_list): Check for overflow
12661 in size calculation.
12662
12663 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12664
12665 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12666 overflow. Don't bother calling xmalloc when xrealloc will do.
12667
12668 * search.c (Freplace_match): Check for size calculation overflow.
12669 (Fset_match_data): Don't assume list lengths fit in 'int'.
12670
12671 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12672 for command line length. Do not attempt to address one before the
12673 beginning of an array, as that's not portable.
12674
12675 * term.c (max_frame_lines): Remove; unused.
12676 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12677 not int.
12678 (encode_terminal_code, calculate_costs): Check for size
12679 calculation overflow.
12680 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12681 table lengths and related sizes. Don't update size until alloc
12682 done. Redo calculations to avoid overflow.
12683 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12684
12685 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12686 subtracting pointers.
12687 (gobble_line): Check for overflow more carefully. Don't update size
12688 until alloc done.
12689
12690 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12691 Don't update size until alloc done.
12692 Redo size calculations to avoid overflow.
12693 Check for size calculation overflow.
12694 (main) [DEBUG]: Fix typo in invoking tparam1.
12695
12696 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12697 Use ptrdiff_t, not int, for sizes.
12698 (store_mode_line_noprop_char): Don't update size until alloc done.
12699
12700 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12701 Use ptrdiff_t, not int, for sizes.
12702 (Finternal_make_lisp_face, cache_face):
12703 Check for size calculation overflow.
12704 (cache_face): Treat size calculation overflows as if they were
12705 memory exhaustion (the usual treatment), rather than aborting.
12706
12707 * xfns.c (x_encode_text, x_set_name_internal)
12708 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12709 sizes, since they can exceed INT_MAX in size. Check for size
12710 calculation overflow.
12711
12712 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12713 (xg_select): Check for size calculation overflow.
12714 Don't update size until alloc done.
12715
12716 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12717 as sprintf is limited to int lengths.
12718
12719 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12720 (X_LONG_MIN): New macros.
12721 Use them to make the following changes clearer.
12722 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12723 This change doesn't affect the value now, but it may help remind
12724 future maintainers not to raise the value too much later.
12725 (SELECTION_QUANTUM): Remove, replacing with ...
12726 (selection_quantum): ... new function, which avoids overflow.
12727 All uses changed.
12728 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12729 assumption that selection length fits in 'int'.
12730 (x_reply_selection_request, x_handle_selection_request)
12731 (x_get_window_property, receive_incremental_selection)
12732 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12733 (lisp_data_to_selection_data, clean_local_selection_data):
12734 Use ptrdiff_t, not int, to record length of selection.
12735 (x_reply_selection_request, x_get_window_property)
12736 (receive_incremental_selection, x_property_data_to_lisp):
12737 Redo calculations to avoid overflow.
12738 (x_reply_selection_request): When sending hint, ceiling it at
12739 X_LONG_MAX rather than relying on wraparound overflow to send
12740 something.
12741 (x_get_window_property, receive_incremental_selection)
12742 (lisp_data_to_selection_data, x_property_data_to_lisp):
12743 Check for size-calculation overflow.
12744 (x_get_window_property, receive_incremental_selection)
12745 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12746 Don't store size until memory allocation succeeds.
12747 (x_get_window_property): Plug memory leak on memory exhaustion.
12748 Don't double-block input; malloc is safe here. Don't assume 2**34
12749 - 4 fits in unsigned long. Add an xassert to check
12750 XGetWindowProperty overflow. Be more careful about overflow
12751 calculations, and distinguish size from memory overflow better.
12752 (receive_incremental_selection): When tracing, don't assume
12753 unsigned int is less than INT_MAX.
12754 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12755 harmful) conversions of unsigned short to int.
12756 (lisp_data_to_selection_data): Don't assume that integers
12757 in the range -65535 through -1 fit in an X unsigned short.
12758 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12759 result parameters unless successful. Rely on cons_to_unsigned
12760 to report problems with elements; the old code wasn't right anyway.
12761 (x_check_property_data): Check for int overflow; we cannot use
12762 a wider type due to X limits.
12763 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12764
12765 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12766
12767 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12768 (x_term_init): Check for size calculation overflow.
12769 (x_color_cells): Don't store size until memory allocation succeeds.
12770 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12771 Don't assume alloca size is less than MAX_ALLOCA.
12772 (x_term_init): Don't assume length fits in int (sprintf is limited
12773 to int size).
12774
12775 Use ptrdiff_t for composition IDs.
12776 * character.c (lisp_string_width):
12777 * composite.c (composition_table_size, n_compositions)
12778 (get_composition_id, composition_gstring_from_id):
12779 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12780 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12781 * window.c (Frecenter):
12782 Use ptrdiff_t, not int, for composition IDs.
12783 * composite.c (get_composition_id): Check for integer overflow.
12784 * composite.h: Adjust prototypes to match the above changes.
12785
12786 Use ptrdiff_t for hash table indexes.
12787 * category.c (hash_get_category_set):
12788 * ccl.c (ccl_driver):
12789 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12790 * coding.c (coding_system_charset_list, detect_coding_system):
12791 * coding.h (struct coding_system.id):
12792 * composite.c (get_composition_id, gstring_lookup_cache):
12793 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12794 * image.c (xpm_get_color_table_h):
12795 * lisp.h (hash_lookup, hash_put):
12796 * minibuf.c (Ftest_completion):
12797 Use ptrdiff_t for hash table indexes, not int (which is too
12798 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12799 32-bit --with-wide-int hosts).
12800
12801 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12802 Add a FIXME comment about memory leaks.
12803 (syms_of_charset): Don't assume xmalloc returns.
12804
12805 Don't assume that stated character widths fit in int.
12806 * character.c (Fchar_width, c_string_width, lisp_string_width):
12807 * character.h (CHAR_WIDTH):
12808 * indent.c (MULTIBYTE_BYTES_WIDTH):
12809 Use sanitize_char_width to avoid undefined and/or bad behavior
12810 with outlandish widths.
12811 * character.h (sanitize_tab_width): Rename from sanitize_width,
12812 now that we have two such functions. All uses changed.
12813 (sanitize_char_width): New inline function.
12814
12815 Don't assume that tab-width fits in int.
12816 * character.h (sanitize_width): New inline function.
12817 (SANE_TAB_WIDTH): New macro.
12818 (ASCII_CHAR_WIDTH): Use it.
12819 * indent.c (sane_tab_width): Remove. All uses replaced by
12820 SANE_TAB_WIDTH (current_buffer).
12821 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12822
12823 * fileio.c: Integer overflow issues with file modes.
12824 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12825
12826 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12827 Remove unreachable code.
12828 (read_hex, load_charset_map_from_file): Check for integer overflow.
12829
12830 * xterm.c: Don't go over XClientMessageEvent limit.
12831 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12832 (x_send_scroll_bar_event): Likewise. Check that the size does not
12833 exceed limits imposed by XClientMessageEvent, as well as the usual
12834 ptrdiff_t and size_t limits.
12835
12836 * keyboard.c: Overflow, signedness and related fixes.
12837 (make_lispy_movement): Use same integer type in forward decl
12838 that is used in the definition.
12839 (read_key_sequence, keyremap_step):
12840 Change bufsize argument back to int, undoing my 2011-03-30 change.
12841 We prefer signed types, and int is wide enough here.
12842 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12843 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12844 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12845 length, not size_t. Use ptrdiff_t for index, not int.
12846 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12847 possibility of integer overflow.
12848
12849 Overflow, signedness and related fixes for images.
12850
12851 * dispextern.h (struct it.stack[0].u.image.image_id)
12852 (struct_it.image_id, struct image.id, struct image_cache.size)
12853 (struct image_cache.used, struct image_cache.ref_count):
12854 * gtkutil.c (update_frame_tool_bar):
12855 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12856 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12857 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12858 * nsmenu.m (update_frame_tool_bar):
12859 * xdisp.c (calc_pixel_width_or_height):
12860 * xfns.c (image_cache_refcount):
12861 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12862 on typical 64-bit hosts.
12863
12864 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12865 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12866 Omit unnecessary casts to int.
12867 (parse_image_spec): Check that integers fall into 'int' range
12868 when the callers expect that.
12869 (image_ascent): Redo ascent calculation to avoid int overflow.
12870 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12871 (lookup_image): Remove unnecessary tests.
12872 (xbm_image_p): Locals are now of int, not EMACS_INT,
12873 since parse_image_check makes sure they fit into int.
12874 (png_load, gif_load, svg_load_image):
12875 Prefer int to unsigned where either will do.
12876 (tiff_handler): New function, combining the cores of the
12877 old tiff_error_handler and tiff_warning_handler.
12878 This function is rewritten to use vsnprintf and thereby avoid
12879 stack buffer overflows. It uses only the features of vsnprintf
12880 that are common to both POSIX and native Microsoft.
12881 (tiff_error_handler, tiff_warning_handler): Use it.
12882 (tiff_load, gif_load, imagemagick_load_image):
12883 Don't assume :index value fits in 'int'.
12884 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12885 (imagemagick_load_image): Check that crop parameters fit into
12886 the integer types that MagickCropImage accepts. Don't assume
12887 Vimagemagick_render_type has a nonnegative value. Don't assume
12888 size_t fits in 'long'.
12889 (gs_load): Use printmax_t to print the widest integers possible.
12890 Check for integer overflow when computing image height and width.
12891
12892 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12893
12894 * xdisp.c (redisplay_window): Don't force window start if point
12895 will be invisible in the resulting window. (Bug#9324)
12896
12897 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12898
12899 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12900 the display spec is of the form `(space ...)'.
12901 (handle_display_spec): Return the value returned by
12902 handle_single_display_spec, not just 1 or zero.
12903 (handle_single_display_spec): If the display spec is of the form
12904 `(space ...)', and specifies display in the text area, return 2
12905 rather than 1.
12906 (try_cursor_movement): Check for the need to scroll more
12907 accurately, and prefer exact match for point under bidi.
12908 Don't advance `row' beyond the last row of the window.
12909
12910 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12911 into disp_prop; all users changed.
12912
12913 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12914 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12915 for the text covered by the display property.
12916
12917 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12918
12919 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12920 Change return value to nil.
12921 (Frecord_buffer): Delete unused function.
12922
12923 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12924
12925 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12926 buffers, return left-to-right.
12927 (set_cursor_from_row): Consider candidate row a win if its glyph
12928 represents a newline and point is on that newline. Fixes cursor
12929 positioning on the newline at EOL of R2L text within L2R
12930 paragraph, and vice versa.
12931 (try_cursor_movement): Check continued rows, in addition to
12932 continuation rows. Fixes unwarranted scroll when point enters a
12933 continued line of R2L text within an L2R paragraph, or vice versa.
12934 (cursor_row_p): Consider the case of point being equal to
12935 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12936 from the end of a short line to the beginning of a continued line
12937 of R2L text within L2R paragraph.
12938 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12939 composed characters.
12940
12941 * bidi.c (bidi_check_type): Use xassert.
12942 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12943 members.
12944
12945 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12946
12947 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12948 a character.
12949
12950 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12951
12952 * nsfont.m (ns_otf_to_script): Fix typo.
12953
12954 2011-08-22 Kenichi Handa <handa@m17n.org>
12955
12956 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12957 extra slot even if the purpose is char-code-property-table.
12958
12959 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12960
12961 * xdisp.c (redisplay_window): When computing centering_position,
12962 account for the height of the header line. (Bug#8874)
12963
12964 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12965 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12966 candidate is selected by the mouse, and that candidate has a
12967 composed character under the mouse.
12968
12969 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12970 coordinates reported by pos-visible-in-window-p for a composed
12971 character in column zero.
12972
12973 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12974
12975 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12976
12977 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12978
12979 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12980 consider it a hit if to_charpos is anywhere in the range of the
12981 composed buffer positions.
12982
12983 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12984
12985 * image.c (gif_load): Don't assume that each subimage has the same
12986 dimensions as the base image. Handle disposal method that is
12987 "undefined" by the gif spec (Bug#9335).
12988
12989 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12990
12991 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12992 (Fcondition_case): Document `debug' symbol in error handler.
12993
12994 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12995
12996 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12997 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12998 from an Org mode buffer to a Speedbar frame.
12999
13000 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13001 a composition, take its buffer position from IT->cmp_it.charpos.
13002 Fixes cursor positioning at the beginning of a line that begins
13003 with a composed character.
13004
13005 2011-08-18 Eli Zaretskii <eliz@gnu.org>
13006
13007 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13008 character bidirectional type, use STRONG_L instead. Fixes crashes
13009 in a buffer produced by `describe-categories'.
13010
13011 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13012 members before the level stack, so they would be saved and
13013 restored when copying iterator state. Fixes incorrect reordering
13014 around TABs covered by display properties.
13015
13016 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13017
13018 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13019
13020 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
13021
13022 * eval.c (internal_condition_case, internal_condition_case_1)
13023 (internal_condition_case_2, internal_condition_case_n):
13024 Remove unnecessary aborts (Bug#9081).
13025
13026 2011-08-17 Eli Zaretskii <eliz@gnu.org>
13027
13028 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13029 has no `load' handler, try opening the file locally. (Bug#9311)
13030
13031 2011-08-16 Ken Brown <kbrown@cornell.edu>
13032
13033 * gmalloc.c: Expand comment.
13034
13035 2011-08-16 Eli Zaretskii <eliz@gnu.org>
13036
13037 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13038 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13039
13040 2011-08-16 Ken Brown <kbrown@cornell.edu>
13041
13042 Fix memory allocation problems in Cygwin build (Bug#9273).
13043
13044 * unexcw.c ( __malloc_initialized): Declare external variable.
13045 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13046
13047 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13048 New variables.
13049 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13050 dumped emacs.
13051 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13052 in the static heap.
13053 [CYGWIN] (special_realloc): New function.
13054 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13055 requests to realloc storage in the static heap.
13056
13057 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13058
13059 * bidi.c (bidi_initialize): Remove unused local.
13060
13061 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13062
13063 * bidimirror.h:
13064 * biditype.h: Remove file.
13065 * makefile.w32-in ($(BLD)/bidi.$(O)):
13066 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13067
13068 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13069
13070 * chartab.c: Improve commentary for the uniprop_table API.
13071
13072 * bidi.c (bidi_paragraph_init): Support zero value of
13073 bidi_ignore_explicit_marks_for_paragraph_level.
13074 (bidi_initialize): Use uniprop_table instead of including
13075 biditype.h and bidimirror.h.
13076
13077 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13078 coordinates of the iterator when restoring from ppos_it.
13079 (Bug#9296)
13080
13081 2011-08-14 Kenichi Handa <handa@m17n.org>
13082
13083 * process.c (create_process): Call setup_process_coding_systems
13084 after the pid of the process is set to -1 (Bug#8162).
13085
13086 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13087
13088 * xdisp.c (move_it_in_display_line_to): Don't invoke
13089 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13090 ppos_it. Fixes vertical cursor motion when line beginning is
13091 covered by an image. (Bug#9296)
13092
13093 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13094
13095 * nsterm.h (ns_run_ascript): Declare.
13096 (NSAPP_DATA2_RUNASSCRIPT): Define.
13097
13098 * nsfns.m (as_script, as_result, as_status): New static variables.
13099 (ns_run_ascript): New function.
13100 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13101 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13102 the event loop. Get status from as_status (Bug#7276).
13103
13104 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13105 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13106 the event loop (Bug#7276).
13107
13108 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13109
13110 * gnutls.c (QCgnutls_bootprop_priority)
13111 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13112 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13113 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13114 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13115 (QCgnutls_bootprop_verify_hostname_error)
13116 (QCgnutls_bootprop_callbacks_verify): Rename from
13117 Qgnutls_bootprop_..., all uses changed.
13118
13119 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13120 uses changed.
13121
13122 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13123
13124 * xfaces.c (Qframe_set_background_mode): Now static.
13125 * dispextern.h (Qframe_set_background_mode): Remove decl.
13126
13127 * process.c (Fnetwork_interface_info): Declare local only if needed.
13128
13129 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13130
13131 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13132 (Fnetwork_interface_list): Allocate in increments of bytes instead
13133 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13134 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13135 sockaddr.
13136 (struct ifflag_def): notrailers is smart on OSX.
13137 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13138 Get hardware address with getifaddrs if available.
13139
13140 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13141
13142 * xdisp.c (iterate_out_of_display_property): xassert that
13143 IT->position is set to within IT->object's boundaries. Break from
13144 the loop as soon as EOB is reached; avoids infloops in redisplay
13145 when IT->position is set up wrongly due to some bug.
13146 Set IT->current to match the bidi iterator unconditionally.
13147 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13148 entry. Force push_it to save on the stack the current
13149 buffer/string position, to be restored by pop_it. Fix flags in
13150 the iterator structure wrt the object coming from a display
13151 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13152 properties. (Bug#9284)
13153
13154 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13155
13156 * fontset.c (fontset_get_font_group): Add proper type checks.
13157 (Bug#9172)
13158
13159 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13160
13161 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13162 and LC_VERSION_MIN_MACOSX.
13163 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13164 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13165
13166 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13167
13168 * xdisp.c (forward_to_next_line_start): Allow to use the
13169 no-display-properties-and-no-overlays under bidi display.
13170 Set disp_pos in the bidi iterator to avoid searches for display
13171 properties and overlays.
13172
13173 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13174
13175 * editfns.c (Fset_time_zone_rule): Document relationship with the
13176 setenv function.
13177
13178 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13179 the font entity extracted from the cache (Bug#8109).
13180
13181 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13182
13183 * composite.c (autocmp_chars): Don't reset point. That is done by
13184 restore_point_unwind (Bug#5984).
13185
13186 2011-08-07 Juri Linkov <juri@jurta.org>
13187
13188 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13189 to show the arg `TIME' instead of `TIMEVAL'.
13190
13191 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13192
13193 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13194 display property strides EOL and includes a newline, as in
13195 longlines-mode. (Bug#9254)
13196 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13197 word-wrap under bidirectional display. (Bug#9224)
13198
13199 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13200 is non-zero, even if the data buffer is NULL. Fixes a crash in
13201 vertical-motion with longlines-mode. (Bug#9254)
13202
13203 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13204
13205 * bidi.c <bidi_cache_total_alloc>: Now static.
13206 (bidi_initialize): Initialize bidi_cache_total_alloc.
13207
13208 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13209 cache. (Bug#9221)
13210
13211 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13212 amount allocated this far in `bidi_cache_total_alloc'.
13213 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13214 non-zero, only free the data buffer without restoring the cache
13215 contents. All callers changed.
13216
13217 * dispextern.h (bidi_unshelve_cache): Update prototype.
13218
13219 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13220 (move_it_in_display_line, move_it_to)
13221 (move_it_vertically_backward, move_it_by_lines): Replace the call
13222 to xfree to an equivalent call to bidi_unshelve_cache.
13223 (move_it_in_display_line_to): Fix logic of returning
13224 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13225
13226 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13227
13228 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13229 came from a string character with a `cursor' property. (Bug#9229)
13230
13231 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13232
13233 * Makefile.in (LIB_PTHREAD): New variable.
13234 (LIBES): Add LIB_PTHREAD (Bug#9216).
13235
13236 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13237 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13238
13239 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13240
13241 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13242
13243 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13244
13245 * xterm.c (x_find_topmost_parent): New function.
13246 (x_set_frame_alpha): Find topmost parent window with
13247 x_find_topmost_parent and set the property there also (bug#9181).
13248 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13249
13250 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13251
13252 * callproc.c (Fcall_process): Avoid vfork clobbering
13253 the local vars buffer, coding_systems, current_dir.
13254
13255 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13256
13257 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13258
13259 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13260
13261 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13262 so that it is not optimized away.
13263
13264 * xdisp.c (compute_display_string_pos): Remove unused local.
13265
13266 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13267
13268 Fix slow cursor motion and scrolling in large buffers with
13269 selective display, like Org Mode buffers. (Bug#9218)
13270
13271 * dispextern.h (struct bidi_it): New member disp_prop_p.
13272
13273 * xdisp.c: Remove one-slot cache of display string positions.
13274 (compute_display_string_pos): Accept an additional argument
13275 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13276 for a display string or property. If found, set DISP_PROP_P
13277 non-zero.
13278
13279 * bidi.c (bidi_fetch_char): Accept an additional argument
13280 DISP_PROP_P, and pass it to compute_display_string_pos.
13281 Only handle text covered by a display string if DISP_PROP_P is returned
13282 non-zero. All callers of bidi_fetch_char changed.
13283
13284 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13285
13286 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13287
13288 2010-12-03 Don March <don@ohspite.net>
13289
13290 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13291 last character M-[char] is translated to ESC [char] (bug#7541).
13292
13293 2011-08-02 Kenichi Handa <handa@m17n.org>
13294
13295 * lisp.h (uniprop_table): Extern it.
13296
13297 * chartab.c (uniprop_table): Make it non-static.
13298
13299 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13300
13301 * xdisp.c (forward_to_next_line_start): Accept additional argument
13302 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13303 on the newline.
13304 (reseat_at_next_visible_line_start): Use the bidi iterator state
13305 returned by forward_to_next_line_start to restore the state of
13306 it->bidi_it after backing up to previous newline. (Bug#9212)
13307
13308 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13309
13310 * regex.c (re_comp): Protoize.
13311 (re_exec): Fix return type.
13312 (regexec): Fix type of `ret'. (Bug#9203)
13313
13314 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13315
13316 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13317 This is needed if max-image-size is a floating-point number.
13318
13319 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13320
13321 * print.c (print_object): Print empty symbol as ##.
13322
13323 * lread.c (read1): Read ## as empty symbol.
13324
13325 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13326
13327 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13328 setting frame foreground color (Bug#9175).
13329 (x_set_background_color): Likewise.
13330
13331 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13332 contents (Bug#9176).
13333 (EmacsTooltip -init): Remove bezels and add shadows to
13334 tooltip windows.
13335
13336 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13337 or scroll bar (Bug#8470).
13338
13339 * nsfont.m (nsfont_open): Remove assignment to voffset and
13340 unnecessary vars hshink, expand, hd, full_height, min_height.
13341 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13342
13343 * nsterm.h (nsfont_info): Remove voffset field.
13344
13345 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13346
13347 Implement strike-through and overline on NextStep (Bug#8863).
13348
13349 * nsfont.m (nsfont_open): Use underline position provided by font,
13350 instead of hard-coded value of 2.
13351 (nsfont_draw): Call ns_draw_text_decoration instead.
13352
13353 * nsterm.h: Add declaration for ns_draw_text_decoration.
13354
13355 * nsterm.m (ns_draw_text_decoration): New function for drawing
13356 underline, overline, and strike-through.
13357 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13358 ns_draw_text_decoration. Change treatment of cursor drawing to
13359 accommodate underlining, etc.
13360
13361 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13362
13363 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13364 default.
13365
13366 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13367
13368 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13369 Without this fix, if a signal arrives just after memory fills up,
13370 'malloc' might be invoked reentrantly.
13371
13372 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13373 In other words, assume that every image size is allowed, on non-X
13374 hosts. This assumption is probably wrong, but it lets Emacs compile.
13375
13376 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13377
13378 * regex.c (re_iswctype): Convert return values to boolean.
13379
13380 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13381
13382 * xdisp.c (compute_display_string_pos): Don't use cached display
13383 string position if the buffer had its restriction changed.
13384 (Bug#9184)
13385
13386 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13387
13388 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13389
13390 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13391
13392 Integer signedness and overflow and related fixes. (Bug#9079)
13393
13394 * bidi.c: Integer size and overflow fixes.
13395 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13396 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13397 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13398 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13399 (bidi_find_other_level_edge):
13400 Use ptrdiff_t instead of EMACS_INT where either will do.
13401 This works better on 32-bit hosts configured --with-wide-int.
13402 (bidi_cache_ensure_space): Check for size-calculation overflow.
13403 Use % rather than repeated addition, for better worst-case speed.
13404 Don't set bidi_cache_size until after xrealloc returns, because it
13405 might not return.
13406 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13407 (bidi_cache_ensure_space): Also check that the bidi cache size
13408 does not exceed that of the largest Lisp string or buffer. See Eli
13409 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13410
13411 * alloc.c (__malloc_size_t): Remove.
13412 All uses replaced by size_t. See Andreas Schwab's note
13413 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13414
13415 * image.c: Improve checking for integer overflow.
13416 (check_image_size): Assume that f is nonnull, since
13417 it is always nonnull in practice. This is one less thing to
13418 worry about when checking for integer overflow later.
13419 (x_check_image_size): New function, which checks for integer
13420 overflow issues inside X.
13421 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13422 This removes the need for a memory_full check.
13423 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13424 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13425 (xbm_read_bitmap_data): Change locals back to 'int', since
13426 their values must fit in 'int'.
13427 (xpm_load_image, png_load, tiff_load):
13428 Invoke x_create_x_image_and_pixmap earlier,
13429 to avoid much needless work if the image is too large.
13430 (tiff_load): Treat overly large images as if
13431 x_create_x_image_and_pixmap failed, not as malloc failures.
13432 (gs_load): Use x_check_image_size.
13433
13434 * gtkutil.c: Omit integer casts.
13435 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13436 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13437
13438 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13439
13440 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13441 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13442 would wrongly return t on a 64-bit host.
13443
13444 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13445 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13446 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13447 and therefore cause GCC to emit a bogus diagnostic in some cases.
13448
13449 * image.c: Integer signedness and overflow and related fixes.
13450 This is not an exhaustive set of fixes, but it's time to
13451 record what I've got.
13452 (lookup_pixel_color, check_image_size): Remove redundant decls.
13453 (check_image_size): Don't assume that arbitrary EMACS_INT values
13454 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13455 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13456 (tiff_load, imagemagick_load_image):
13457 Check for overflow in size calculations.
13458 (x_create_x_image_and_pixmap): Remove unnecessary test for
13459 xmalloc returning NULL; that can't happen.
13460 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13461 (xpm_color_bucket): Use better integer hashing function.
13462 (xpm_cache_color): Don't possibly over-allocate memory.
13463 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13464 (gif_memory_source):
13465 Use ptrdiff_t, not int or size_t, to record sizes.
13466 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13467 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13468 either works, as we prefer signed integers.
13469 (tiff_read_from_memory, tiff_write_from_memory):
13470 Return tsize_t, not size_t, since that's what the TIFF API wants.
13471 (tiff_read_from_memory): Don't fail simply because the read would
13472 go past EOF; instead, return a short read.
13473 (tiff_load): Omit no-longer-needed casts.
13474 (Fimagemagick_types): Don't assume size fits into 'int'.
13475
13476 Improve hashing quality when configured --with-wide-int.
13477 * fns.c (hash_string): New function, taken from sxhash_string.
13478 Do not discard information about ASCII character case; this
13479 discarding is no longer needed.
13480 (sxhash-string): Use it. Change sig to match it. Caller changed.
13481 * lisp.h: Declare it.
13482 * lread.c (hash_string): Remove, since we now use fns.c's version.
13483 The fns.c version returns a wider integer if --with-wide-int is
13484 specified, so this should help the quality of the hashing a bit.
13485
13486 * emacs.c: Integer overflow minor fix.
13487 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13488 Define only if GNU_LINUX.
13489 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13490
13491 * dispnew.c: Integer signedness and overflow fixes.
13492 Remove unnecessary forward decls, that were a maintenance hassle.
13493 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13494 All uses changed.
13495 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13496 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13497 (prepare_desired_row, line_draw_cost):
13498 Use int, not unsigned, where either works.
13499 (save_current_matrix, restore_current_matrix):
13500 Use ptrdiff_t, not size_t, where either works.
13501 (init_display): Check for overflow more accurately, and without
13502 relying on undefined behavior.
13503
13504 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13505 Remove, replacing with the new symbols in lisp.h. All uses changed.
13506 * fileio.c (make_temp_name):
13507 * filelock.c (lock_file_1, lock_file):
13508 * xdisp.c (message_dolog):
13509 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13510 Use pMd etc. instead.
13511 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13512 replacing the pWIDE etc. symbols removed from editfns.c.
13513
13514 * keyboard.h (num_input_events): Now uintmax_t.
13515 This is (very slightly) less likely to mess up due to wraparound.
13516 All uses changed.
13517
13518 * buffer.c: Integer signedness fixes.
13519 (alloc_buffer_text, enlarge_buffer_text):
13520 Use ptrdiff_t rather than size_t when either will do, as we prefer
13521 signed integers.
13522
13523 * alloc.c: Integer signedness and overflow fixes.
13524 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13525 (__malloc_size_t): Default to size_t, not to int.
13526 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13527 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13528 Prefer ptrdiff_t to size_t when either would do, as we prefer
13529 signed integers.
13530 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13531 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13532 Now const. Initialize with values that are in range even if char
13533 is signed.
13534 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13535 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13536 These functions do the right thing with sizes > 2**32.
13537 (check_depth): Now ptrdiff_t, not int.
13538 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13539 Adjust to new way of storing sizes. Check for size overflow bugs
13540 in rest of code.
13541 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13542 slightly wrong anyway, as it missed one instance of
13543 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13544 (refill_memory_reserve): Omit needless cast to size_t.
13545 (mark_object_loop_halt): Mark as externally visible.
13546
13547 * xselect.c: Integer signedness and overflow fixes.
13548 (Fx_register_dnd_atom, x_handle_dnd_message):
13549 Use ptrdiff_t, not size_t, since we prefer signed.
13550 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13551 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13552 x_dnd_atoms_size and x_dnd_atoms_length.
13553
13554 * doprnt.c: Prefer signed to unsigned when either works.
13555 * eval.c (verror):
13556 * doprnt.c (doprnt):
13557 * lisp.h (doprnt):
13558 * xdisp.c (vmessage):
13559 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13560 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13561 prefer signed arithmetic to avoid comparison confusion.
13562 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13563 but is a bit tricky.
13564
13565 Assume freestanding C89 headers, string.h, stdlib.h.
13566 * data.c, doprnt.c, floatfns.c, print.c:
13567 Include float.h unconditionally.
13568 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13569 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13570 * regex.c: Likewise for stddef.h, string.h.
13571 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13572 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13573 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13574 (STDC_HEADERS): Remove obsolete defines.
13575 * sysdep.c: Include limits.h unconditionally.
13576
13577 Assume support for memcmp, memcpy, memmove, memset.
13578 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13579 * regex.c (memcmp, memcpy):
13580 Remove; we assume C89 now.
13581
13582 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13583 (__malloc_safe_bcopy): Remove; no longer needed.
13584
13585 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13586 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13587 well either way, and we prefer signed to unsigned.
13588
13589 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13590
13591 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13592 closes the connection while we're reading (bug#9182).
13593
13594 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13595
13596 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13597 are specified (Bug#9168).
13598
13599 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13600
13601 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13602 Found by GCC static checking and --with-wide-int on a 32-bit host.
13603
13604 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13605
13606 * xdisp.c (compute_display_string_pos): Fix logic of caching
13607 previous display string position. Initialize cached_prev_pos to
13608 -1. Fixes slow-down at the beginning of a buffer.
13609
13610 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13611
13612 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13613 for attrs[LFACE_FONTSET_INDEX].
13614
13615 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13616
13617 * xml.c (parse_region): Remove unused local
13618 that was recently introduced.
13619
13620 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13621
13622 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13623 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13624
13625 * xdisp.c (move_it_in_display_line_to): Record the best matching
13626 position for TO_CHARPOS while scanning the line, and restore it on
13627 exit if none of the characters scanned was an exact match.
13628 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13629 when exact match is impossible due to invisible text, and the
13630 lines are truncated.
13631
13632 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13633
13634 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13635 for OSX >= 10.7.
13636
13637 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13638
13639 Fix a significant slow-down of cursor motion with C-n, C-p,
13640 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13641 auto-repeat under bidi redisplay in fontified buffers.
13642 * xdisp.c (compute_stop_pos_backwards): New function.
13643 (next_element_from_buffer): Call compute_stop_pos_backwards to
13644 find a suitable prev_stop when we find ourselves before
13645 base_level_stop.
13646 (reseat): Don't look for prev_stop, as that could mean a very long
13647 run.
13648 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13649 <cached_disp_overlay_modiff>: Cache for last found display string
13650 position.
13651 (compute_display_string_pos): Return the cached position if asked
13652 about the same buffer in the same area of character positions, and
13653 the buffer wasn't changed since the time the display string
13654 position was cached.
13655
13656 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13657
13658 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13659 is an integer, which is important for empty lines. (Bug#9149)
13660
13661 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13662
13663 * frame.c (Fmodify_frame_parameters): In tty case, update the
13664 default face if necessary (Bug#4238).
13665
13666 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13667
13668 * editfns.c (Fstring_to_char): No need to explain what a character
13669 is in the docstring (Bug#6576).
13670
13671 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13672
13673 * xml.c (parse_region): Make sure we always return a tree.
13674
13675 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13676
13677 * xml.c (parse_region): If a document contains only comments,
13678 return that, too.
13679
13680 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13681
13682 * xml.c (make_dom): Return comments, too.
13683
13684 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13685
13686 Port to OpenBSD.
13687 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13688 and the surrounding thread.
13689 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13690 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13691 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13692 timer goes off.
13693 * s/openbsd.h (BROKEN_SIGIO): Define.
13694 * unexelf.c (unexec) [__OpenBSD__]:
13695 Don't update the .mdebug section of the Alpha COFF symbol table.
13696
13697 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13698
13699 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13700 (bug#8460).
13701
13702 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13703
13704 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13705 This fixes some race conditions on the permissions of any newly
13706 created file.
13707
13708 * alloc.c (valid_pointer_p): Use pipe, not open.
13709 This fixes some permissions issues when debugging.
13710
13711 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13712 If fchown fails to set both uid and gid, try to set just gid,
13713 as that is sometimes allowed. Adjust the file's mode to eliminate
13714 setuid or setgid bits that are inappropriate if fchown fails.
13715
13716 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13717
13718 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13719 to compare Lisp_Objects.
13720 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13721 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13722 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13723
13724 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13725
13726 * lread.c (read_integer): Unread even EOF character.
13727 (read1): Likewise. Properly record start position of symbol.
13728
13729 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13730 symbol character follows.
13731
13732 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13733
13734 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13735 This works around a problem with the previous change to Fcopy_file.
13736 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13737 and without this change, GCC might complain about discarding
13738 fchown's return value.
13739
13740 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13741
13742 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13743
13744 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13745
13746 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13747
13748 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13749
13750 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13751 it's used from the C level.
13752
13753 * process.c: Use the same condition for POLL_FOR_INPUT in both
13754 keyboard.c and process.c (bug#1858).
13755
13756 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13757
13758 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13759 (Fgnutls_boot): Use it.
13760
13761 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13762
13763 * doc.c (Fsubstitute_command_keys): Revert last change.
13764
13765 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13766
13767 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13768 quotes the next character, and doesn't affect other longer
13769 sequences (bug#8935).
13770
13771 * lread.c (syms_of_lread): Clarify that is isn't only
13772 `eval-buffer' and `eval-defun' that's affected by
13773 `lexical-binding' (bug#8460).
13774
13775 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13776
13777 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13778 bidi redisplay when a line includes both an image and is truncated.
13779
13780 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13781
13782 Fix minor problems found by static checking.
13783 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13784 (elsz): Now a signed constant, not a size_t var. We prefer signed
13785 types to unsigned, to avoid integer comparison confusion. Without
13786 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13787 "cannot optimize loop, the loop counter may overflow", a symptom
13788 of the confusion.
13789 * indent.c (Fvertical_motion): Mark locals as initialized.
13790 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13791
13792 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13793
13794 * search.c (Fre_search_backward): Mention `case-fold-search' in
13795 all the re_search_* functions (bug#8138).
13796
13797 * keyboard.c (Fopen_dribble_file): Document when the file is
13798 closed (bug#8056).
13799
13800 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13801
13802 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13803 bidi_cache_idx.
13804
13805 Support bidi reordering of display and overlay strings.
13806 * xdisp.c (compute_display_string_pos)
13807 (compute_display_string_end): Accept additional argument STRING.
13808 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13809 (reseat_to_string): Initialize bidi_it->string.s and
13810 bidi_it->string.schars.
13811 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13812 NULL (avoids a crash in bidi_paragraph_init).
13813 Initialize itb.string.lstring.
13814 (init_iterator): Call bidi_init_it only of a valid
13815 buffer position was specified. Initialize paragraph_embedding to
13816 L2R.
13817 (reseat_to_string): Initialize the bidi iterator.
13818 (display_string): If we need to ignore text properties of
13819 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13820 original value of -1 will not work with bidi.)
13821 (compute_display_string_pos): First arg is now struct
13822 `text_pos *'; all callers changed. Support display properties on
13823 Lisp strings.
13824 (compute_display_string_end): Support display properties on Lisp
13825 strings.
13826 (init_iterator, reseat_1, reseat_to_string): Initialize the
13827 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13828 when iterating on a string not from display properties).
13829 (compute_display_string_pos, compute_display_string_end):
13830 Fix calculation of the object to scan. Fixes an error when using
13831 arrow keys.
13832 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13833 base_level_stop; instead, set base_level_stop to BEGV.
13834 Fixes crashes in vertical-motion.
13835 (next_element_from_buffer): Improve commentary for when
13836 the iterator is before prev_stop.
13837 (init_iterator): Initialize bidi_p from the default value of
13838 bidi-display-reordering, not from buffer-local value. Use the
13839 buffer-local value only if initializing for buffer iteration.
13840 (handle_invisible_prop): Support invisible properties on strings
13841 that are being bidi-reordered.
13842 (set_iterator_to_next): Support bidi reordering of C strings and
13843 Lisp strings.
13844 (next_element_from_string): Support bidi reordering of Lisp
13845 strings.
13846 (handle_stop_backwards): Support Lisp strings as well.
13847 (display_string): Support display of R2L glyph rows.
13848 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13849 (init_iterator): Don't initialize it->bidi_p for strings
13850 here.
13851 (reseat_to_string): Initialize it->bidi_p for strings here.
13852 (next_element_from_string, next_element_from_c_string)
13853 (next_element_from_buffer): Add xassert's for correspondence
13854 between IT's object being iterated and it->bidi_it.string
13855 structure.
13856 (face_before_or_after_it_pos): Support bidi iteration.
13857 (next_element_from_c_string): Handle the case of the first string
13858 character that is not the first one in the visual order.
13859 (get_visually_first_element): New function, refactored from common
13860 parts of next_element_from_buffer, next_element_from_string, and
13861 next_element_from_c_string.
13862 (tool_bar_lines_needed, redisplay_tool_bar)
13863 (display_menu_bar): Force left-to-right direction. Add a FIXME
13864 comment for making that be controlled by a user option.
13865 (push_it, pop_it): Save and restore the state of the
13866 bidi iterator. Save and restore the bidi_p flag.
13867 (pop_it): Iterate out of display property for string iteration as
13868 well.
13869 (iterate_out_of_display_property): Support iteration over strings.
13870 (handle_single_display_spec): Set up it->bidi_it for iteration
13871 over a display string, and call bidi_init_it.
13872 (handle_single_display_spec, next_overlay_string)
13873 (get_overlay_strings_1, push_display_prop): Set up the bidi
13874 iterator for displaying display or overlay strings.
13875 (forward_to_next_line_start): Don't use the shortcut if
13876 bidi-iterating.
13877 (back_to_previous_visible_line_start): If handle_display_prop
13878 pushed the iterator stack, restore the internal state of the bidi
13879 iterator by calling bidi_pop_it same number of times.
13880 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13881 and we are bidi-iterating, don't decrement the iterator position;
13882 instead, set the first_elt flag in the bidi iterator, to produce
13883 the same effect.
13884 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13885 (push_display_prop): xassert that we are iterating a buffer.
13886 (push_it, pop_it): Save and restore paragraph_embedding member.
13887 (handle_single_display_spec, next_overlay_string)
13888 (get_overlay_strings_1, reseat_1, reseat_to_string)
13889 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13890 correctly. Don't assume unibyte strings are not bidi-reordered.
13891 (compute_display_string_pos)
13892 (compute_display_string_end): Fix handling the case of C string.
13893 (push_it, pop_it): Save and restore from_disp_prop_p.
13894 (handle_single_display_spec, push_display_prop): Set the
13895 from_disp_prop_p flag.
13896 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13897 (pop_it): Call iterate_out_of_display_property only if we are
13898 popping after iteration over a string that came from a display
13899 property. Fix a typo in popping stretch info. Add an assertion
13900 for verifying that the iterator position is in sync with the bidi
13901 iterator.
13902 (handle_single_display_spec, get_overlay_strings_1)
13903 (push_display_prop): Fix initialization of paragraph direction for
13904 string when that of the parent object is not yet determined.
13905 (reseat_1): Call bidi_init_it to resync the bidi
13906 iterator with IT's position. (Bug#7616)
13907 (find_row_edges): If ROW->start.pos gives position
13908 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13909 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13910 Reset the from_disp_prop_p flag.
13911 (SAVE_IT, RESTORE_IT): New macros.
13912 (pos_visible_p, face_before_or_after_it_pos)
13913 (back_to_previous_visible_line_start)
13914 (move_it_in_display_line_to, move_it_in_display_line)
13915 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13916 (try_scrolling, redisplay_window, display_line): Use them when
13917 saving a temporary copy of the iterator and restoring it back.
13918 (back_to_previous_visible_line_start, reseat_1)
13919 (init_iterator): Empty the bidi cache "stack".
13920 (move_it_in_display_line_to): If iterator ended up at
13921 EOL, but we never saw any buffer positions smaller than
13922 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13923 motion in bidi-reordered lines.
13924 (move_it_in_display_line_to): Record prev_method and prev_pos
13925 immediately before the call to set_iterator_to_next. Fixes cursor
13926 motion in bidi-reordered lines with stretch glyphs and strings
13927 displayed in margins. (Bug#8133) (Bug#8867)
13928 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13929 TO_CHARPOS.
13930 (pos_visible_p): Support positions in bidi-reordered lines.
13931 Save and restore bidi cache.
13932
13933 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13934 (bidi_paragraph_info): Delete unused struct.
13935 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13936 (bidi_cache_start): New variable.
13937 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13938 to zero.
13939 (bidi_cache_fetch_state, bidi_cache_search)
13940 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13941 (bidi_cache_find, bidi_peek_at_next_level)
13942 (bidi_level_of_next_char, bidi_find_other_level_edge)
13943 (bidi_move_to_visually_next): Compare cache index with
13944 bidi_cache_start rather than with zero.
13945 (bidi_fetch_char): Accept new argument STRING; all callers
13946 changed. Support iteration over a string. Support strings with
13947 display properties. Support unibyte strings. Fix the type of
13948 `len' according to what STRING_CHAR_AND_LENGTH expects.
13949 (bidi_paragraph_init, bidi_resolve_explicit_1)
13950 (bidi_resolve_explicit, bidi_resolve_weak)
13951 (bidi_level_of_next_char, bidi_move_to_visually_next):
13952 Support iteration over a string.
13953 (bidi_set_sor_type, bidi_resolve_explicit_1)
13954 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13955 can now be zero (for strings); special values 0 and -1 were
13956 changed to -1 and -2, respectively.
13957 (bidi_char_at_pos): New function.
13958 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13959 Call it instead of FETCH_MULTIBYTE_CHAR.
13960 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13961 initialized to valid values.
13962 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13963 values.
13964 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13965 the test for valid cached positions. Fix the logic for looking up
13966 the sentinel state in the cache. GCPRO the Lisp string we are
13967 iterating.
13968 (bidi_push_it, bidi_pop_it): New functions.
13969 (bidi_initialize): Initialize the bidi cache start stack pointer.
13970 (bidi_cache_ensure_space): New function, refactored from part of
13971 bidi_cache_iterator_state. Don't assume the required size is just
13972 one BIDI_CACHE_CHUNK away.
13973 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13974 (bidi_count_bytes, bidi_char_at_pos): New functions.
13975 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13976 always valid if bidi_cache_idx is valid.
13977 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13978 is valid if it's going to be used.
13979 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13980 (bidi_cache_fetch_state, bidi_cache_search)
13981 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13982 (bidi_cache_iterator_state, bidi_cache_find)
13983 (bidi_find_other_level_edge, bidi_cache_start_stack):
13984 All variables related to cache indices are now EMACS_INT.
13985
13986 * dispextern.h (struct bidi_string_data): New structure.
13987 (struct bidi_it): New member `string'. Make flag members be 1-bit
13988 fields, and put them last in the struct.
13989 (compute_display_string_pos, compute_display_string_end):
13990 Update prototypes.
13991 (bidi_push_it, bidi_pop_it): Add prototypes.
13992 (struct iterator_stack_entry): New members bidi_p,
13993 paragraph_embedding, and from_disp_prop_p.
13994 (struct it): Member bidi_p is now a bit field 1 bit wide.
13995 (bidi_shelve_cache, bidi_unshelve_cache):
13996 Declare prototypes.
13997
13998 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13999 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14000 and vector-like objects.
14001
14002 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14003 cache around display iteration.
14004
14005 * window.c (Fwindow_end, window_scroll_pixel_based)
14006 (displayed_window_lines, Frecenter): Save and restore the bidi
14007 cache around display iteration.
14008
14009 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14010
14011 * editfns.c (Fdelete_region): Clarify the use of the named
14012 parameters (bug#6788).
14013
14014 2011-07-14 Martin Rudalics <rudalics@gmx.at>
14015
14016 * indent.c (Fvertical_motion): Set and restore w->pointm when
14017 saving and restoring the window's buffer (Bug#9006).
14018
14019 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14020
14021 * editfns.c (Fstring_to_char): Clarify just what is returned
14022 (bug#6576). Text by Eli Zaretskii.
14023
14024 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
14025
14026 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14027
14028 2011-07-13 Eli Zaretskii <eliz@gnu.org>
14029
14030 * buffer.c (mmap_find): Fix a typo.
14031
14032 2011-07-13 Johan Bockgård <bojohan@gnu.org>
14033
14034 Fix execution of x selection hooks.
14035 * xselect.c (Qx_lost_selection_functions)
14036 (Qx_sent_selection_functions): New vars.
14037 (syms_of_xselect): DEFSYM them.
14038 (x_handle_selection_request): Pass Qx_sent_selection_functions
14039 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14040 (x_handle_selection_clear,x_clear_frame_selections):
14041 Pass Qx_lost_selection_functions rather than
14042 Vx_lost_selection_functions to Frun_hook_with_args.
14043
14044 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14045
14046 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14047 The old code sometimes used this field without initializing it.
14048
14049 * alloc.c (gc_sweep): Don't read past end of array.
14050 In theory, the old code could also have corrupted Emacs internals,
14051 though it'd be very unlikely.
14052
14053 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14054
14055 * character.c (Fcharacterp): Don't advertise optional ignored
14056 argument. (Bug#4026)
14057
14058 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14059
14060 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14061 key" (bug#4257).
14062
14063 * window.c (Fset_window_start): Doc fix (bug#4199).
14064 (Fset_window_hscroll): Ditto.
14065
14066 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14067
14068 Fix minor new problems caught by GCC 4.6.1.
14069 * term.c (init_tty): Remove unused local.
14070 * xsettings.c (store_monospaced_changed): Define this function only
14071 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14072 not used otherwise.
14073
14074 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14075
14076 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14077
14078 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14079
14080 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14081 are the mini-buffer and the echo area (bug#3320).
14082
14083 * term.c (init_tty): Remove support for supdup, c10 and perq
14084 terminals, which are no longer supported (bug#1482).
14085
14086 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14087
14088 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14089
14090 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14091
14092 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14093 for non-popups (Bug#3642).
14094
14095 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14096
14097 * alloc.c (reset_malloc_hooks): Protoize.
14098 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14099 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14100 * cm.c (losecursor): Likewise.
14101 * data.c (fmod): Likewise.
14102 * dispnew.c (swap_glyphs_in_rows): Likewise.
14103 * emacs.c (memory_warning_signal): Likewise.
14104 * floatfns.c (float_error): Likewise.
14105 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14106 (otf_open, font_otf_capability, generate_otf_features)
14107 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14108 Likewise.
14109 * image.c (pbm_read_file): Likewise.
14110 * indent.c (string_display_width): Likewise.
14111 * intervals.c (check_for_interval, search_for_interval)
14112 (inc_interval_count, count_intervals, root_interval)
14113 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14114 * lread.c (defalias): Likewise.
14115 * ralloc.c (r_alloc_check): Likewise.
14116 * regex.c (set_image_of_range_1, set_image_of_range)
14117 (regex_grow_registers): Likewise.
14118 * sysdep.c (strerror): Likewise.
14119 * termcap.c (valid_filename_p, tprint, main): Likewise.
14120 * tparam.c (main): Likewise.
14121 * unexhp9k800.c (run_time_remap, save_data_space)
14122 (update_file_ptrs, read_header, write_header, calculate_checksum)
14123 (copy_file, copy_rest, display_header): Likewise.
14124 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14125 Likewise.
14126 * xdisp.c (check_it): Likewise.
14127 * xfaces.c (register_color, unregister_color, unregister_colors):
14128 Likewise.
14129 * xfns.c (print_fontset_result): Likewise.
14130 * xrdb.c (member, fatal, main): Likewise.
14131
14132 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14133
14134 Fix minor problems found by static checking (Bug#9031).
14135 * chartab.c (char_table_set_range, map_sub_char_table):
14136 Remove unused locals.
14137 (uniprop_table): Now static.
14138 * composite.c (_work_char): Remove unused static var.
14139
14140 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14141
14142 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14143
14144 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14145
14146 * gtkutil.c (qttip_cb): Remove code without function.
14147
14148 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14149
14150 * w32.c (pthread_sigmask): New stub.
14151
14152 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14153
14154 Use pthread_sigmask, not sigprocmask (Bug#9010).
14155 sigprocmask is portable only for single-threaded applications, and
14156 Emacs can be multi-threaded when it uses GTK.
14157 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14158 (LIBES): Use it.
14159 * callproc.c (Fcall_process):
14160 * process.c (create_process):
14161 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14162 Use pthread_sigmask, not sigprocmask.
14163
14164 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14165
14166 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14167 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14168 wrong (Bug#8591).
14169
14170 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14171
14172 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14173 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14174 (xg_hide_tooltip): Fix comment.
14175
14176 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14177 in registerServicesMenuSendTypes.
14178 (validRequestorForSendType): Don't check ns_return_types.
14179
14180 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14181 ns_return_type.
14182
14183 2011-07-08 Jason Rumney <jasonr@gnu.org>
14184
14185 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14186 SH_SHOW for hidden windows (Bug#5482).
14187
14188 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14189 frame struct members of non-existent frames (Bug#6284).
14190
14191 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14192
14193 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14194 variable firstTime not needed on OSX >= 10.6.
14195 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14196 >= 10.5. Use setKnobProportion, setDoubleValue.
14197
14198 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14199 (MAC_OS_X_VERSION_10_5): Define if not defined.
14200 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14201 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14202 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14203
14204 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14205 cString and lossyCString on OSX >= 10.4.
14206
14207 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14208 sizeToFit on OSX >= 10.2.
14209
14210 * nsimage.m (allocInitFromFile): Don't use deprecated method
14211 bestRepresentationForDevice on OSX >= 10.6.
14212
14213 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14214 to avoid warning.
14215
14216 * emacs.c: Declare unexec_init_emacs_zone.
14217
14218 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14219
14220 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14221
14222 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14223 on svcsMenu (Bug#8842).
14224
14225 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14226 ns_return_types.
14227 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14228
14229 * nsterm.m (QUTF8_STRING): Declare.
14230 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14231 (validRequestorForSendType): Return type is (id).
14232 Change indexOfObjectIdenticalTo to indexOfObject.
14233 Check if we have local selection before returning self (Bug#8842).
14234 (writeSelectionToPasteboard): Put local selection into paste board
14235 if we have a local selection (Bug#8842).
14236 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14237
14238 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14239 (ns_get_local_selection): Declare.
14240
14241 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14242
14243 * keymap.c (describe_map_tree): Don't insert a double newline at
14244 the end of the buffer (bug#1169) and return whether we inserted
14245 something.
14246
14247 * callint.c (Fcall_interactively): Change "reading args" to
14248 "providing args" to try to clarify what it does (bug#1010).
14249
14250 2011-07-07 Kenichi Handa <handa@m17n.org>
14251
14252 * composite.c (composition_compute_stop_pos): Ignore a static
14253 composition starting before CHARPOS (Bug#8915).
14254
14255 * xdisp.c (handle_composition_prop): Likewise.
14256
14257 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14258
14259 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14260 (Bug#9015)
14261
14262 2011-07-07 Kenichi Handa <handa@m17n.org>
14263
14264 * character.h (unicode_category_t): New enum type.
14265
14266 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14267 (Qchar_code_property_table): New variable.
14268 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14269 (UNIPROP_COMPRESSED_FORM_P): New macros.
14270 (char_table_ascii): Uncompress the compressed values.
14271 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14272 Uncompress the compressed values.
14273 (sub_char_table_ref_and_range): Likewise.
14274 (char_table_ref_and_range): Uncompress the compressed values.
14275 (sub_char_table_set): New arg is_uniprop. Callers changed.
14276 Uncompress the compressed values.
14277 (sub_char_table_set_range): Args changed. Callers changed.
14278 (char_table_set_range): Adjuted for the above change.
14279 (map_sub_char_table): Delete args default_val and parent. Add arg
14280 top. Give decoded values to a Lisp function.
14281 (map_char_table): Adjust for the above change. Give decoded
14282 values to a Lisp function. Gcpro more variables.
14283 (uniprop_table_uncompress)
14284 (uniprop_decode_value_run_length): New functions.
14285 (uniprop_decoder, uniprop_decoder_count): New variables.
14286 (uniprop_get_decoder, uniprop_encode_value_character)
14287 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14288 New functions.
14289 (uniprop_encoder, uniprop_encoder_count): New variables.
14290 (uniprop_get_encoder, uniprop_table)
14291 (Funicode_property_table_internal, Fget_unicode_property_internal)
14292 (Fput_unicode_property_internal): New functions.
14293 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14294 Sunicode_property_table_internal, Sget_unicode_property_internal,
14295 and Sput_unicode_property_internal. Defvar_lisp
14296 char-code-property-alist.
14297
14298 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14299 Vunicode_category_table.
14300
14301 * font.c (font_range): Adjust for the change of
14302 Vunicode_category_table.
14303
14304 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14305
14306 * m/iris4d.h: Remove file, move contents ...
14307 * s/irix6-5.h: ... here.
14308
14309 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14310
14311 Remove unportable assumption about struct layout (Bug#8884).
14312 * alloc.c (mark_buffer):
14313 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14314 (clone_per_buffer_values): Don't assume that
14315 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14316 This isn't true in general, and it's particularly not true
14317 if Emacs is configured with --with-wide-int.
14318 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14319 New macros, used in the buffer.c change.
14320
14321 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14322
14323 * xsettings.c: Use both GConf and GSettings if both are available.
14324 (store_config_changed_event): Add comment.
14325 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14326 (store_tool_bar_style_changed): New functions.
14327 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14328 (struct xsettings): Move font inside HAVE_XFT.
14329 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14330 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14331 Move inside HAVE_XFT.
14332 (something_changed_gsettingsCB): Rename from something_changedCB.
14333 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14334 also.
14335 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14336 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14337 (something_changed_gconfCB): Rename from something_changedCB.
14338 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14339 (parse_settings): Move check for font inside HAVE_XFT.
14340 (read_settings, apply_xft_settings): Add comment.
14341 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14342 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14343 call store_font_name_changed.
14344 (xft_settings_event): Add comment.
14345 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14346 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14347 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14348 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14349 (xsettings_initialize): Call init_gsettings last.
14350 (xsettings_get_system_font, xsettings_get_system_normal_font):
14351 Add comment.
14352
14353 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14354
14355 Random fixes. E.g., (random) never returned negative values.
14356 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14357 subseconds part to the entropy, as that's a bit more random.
14358 Prefer signed to unsigned, since the signedness doesn't matter and
14359 in general we prefer signed. When given a limit, use a
14360 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14361 latter isn't right if USE_2_TAGS_FOR_INTS.
14362 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14363 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14364
14365 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14366
14367 * textprop.c (text_property_stickiness):
14368 Obey Vtext_property_default_nonsticky.
14369 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14370 * w32fns.c (syms_of_w32fns):
14371 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14372
14373 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14374
14375 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14376 This is more efficient than Ffile_directory_p and avoids a minor race.
14377
14378 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14379
14380 * buffer.c (Foverlay_put): Say what the return value is
14381 (bug#7835).
14382
14383 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14384 is a directory before asking whether to use the file name
14385 (bug#7564).
14386 (barf_or_query_if_file_exists): Make the "File is a directory"
14387 error be more correct.
14388
14389 * fns.c (Frequire): Remove the mention of the .gz files, since
14390 that's installation-specific, but keep the mention of
14391 `get-load-suffixes'.
14392
14393 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14394
14395 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14396 Report string overflow if the output is too long.
14397
14398 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14399
14400 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14401 (syms_of_gnutls): Remove duplicate DEFSYM for
14402 Qgnutls_bootprop_verify_hostname_error, an error for
14403 Qgnutls_bootprop_verify_error (which is no longer used).
14404
14405 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14406 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14407 Also (re)move comments that are misplaced or no longer relevant.
14408
14409 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14410
14411 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14412
14413 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14414
14415 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14416 and background color parameters if they have been changed.
14417
14418 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14419
14420 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14421
14422 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14423
14424 * xsettings.c (SYSTEM_FONT): Define only when used.
14425 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14426
14427 * keymap.c (access_keymap_1): Now static.
14428
14429 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14430
14431 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14432 leave any prefix arg for the up event (Bug#1586).
14433
14434 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14435
14436 * lread.c (syms_of_lread): Mention single symbols defined by
14437 `defvar' or `defconst' (bug#7154).
14438
14439 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14440 (Frequire): Mention get-load-suffixes.
14441
14442 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14443
14444 * window.h (window): Remove clone_number slot.
14445 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14446 Remove.
14447 (make_parent_window, make_window, saved_window)
14448 (Fset_window_configuration, save_window_save): Don't deal with
14449 clone numbers.
14450 * buffer.c (Qclone_number): Remove declaration.
14451 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14452
14453 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14454
14455 Add multiple inheritance to keymaps.
14456 * keymap.c (Fmake_composed_keymap): New function.
14457 (Fset_keymap_parent): Simplify.
14458 (fix_submap_inheritance): Remove.
14459 (access_keymap_1): New function extracted from access_keymap to handle
14460 embedded parents and handle lists of maps.
14461 (access_keymap): Use it.
14462 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14463 (Fcopy_keymap): Handle embedded parents.
14464 (Fcommand_remapping, define_as_prefix): Simplify.
14465 (Fkey_binding): Simplify.
14466 (syms_of_keymap): Move minibuffer-local-completion-map,
14467 minibuffer-local-filename-completion-map,
14468 minibuffer-local-must-match-map, and
14469 minibuffer-local-filename-must-match-map to Elisp.
14470 (syms_of_keymap): Defsubr make-composed-keymap.
14471 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14472 (parse_menu_item): Trivial simplification.
14473
14474 2011-07-01 Glenn Morris <rgm@gnu.org>
14475
14476 * Makefile.in (SETTINGS_LIBS): Fix typo.
14477
14478 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14479
14480 * coding.c (Fencode_coding_string): Record the last coding system
14481 used, as the function doc string says (bug#8738).
14482
14483 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14484
14485 * xsettings.c (store_monospaced_changed): Take new font as arg and
14486 check for change against current_mono_font.
14487 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14488 (emacs_settings_constructor, emacs_settings_get_property)
14489 (emacs_settings_set_property, emacs_settings_class_init)
14490 (emacs_settings_init, gsettings_obj): Remove.
14491 (something_changedCB): New function for HAVE_GSETTINGS.
14492 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14493 with value as argument.
14494 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14495 g_settings_new (Bug#8967). Do not create gsettings_obj.
14496 Remove calls to g_settings_bind. Connect something_changedCB to
14497 "changed".
14498
14499 * xgselect.c: Add defined (HAVE_GSETTINGS).
14500 (xgselect_initialize): Ditto.
14501
14502 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14503 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14504 xg_select.
14505
14506 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14507
14508 * eval.c (struct backtrace): Simplify and port the data structure.
14509 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14510 signed bit field, as this assumption is not portable and it makes
14511 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14512 "char debug_on_exit : 1" as this is not portable either; instead,
14513 use the portable "unsigned int debug_on_exit : 1". Remove unused
14514 member evalargs. Remove obsolete comments about cc bombing out.
14515
14516 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14517
14518 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14519 Let HAVE_GSETTINGS override HAVE_GCONF.
14520 (store_monospaced_changed): New function.
14521 (EMACS_SETTINGS): A new type derived from GObject to handle
14522 GSettings notifications.
14523 (emacs_settings_constructor, emacs_settings_get_property)
14524 (emacs_settings_set_property, emacs_settings_class_init):
14525 New functions.
14526 (gsettings_client, gsettings_obj): New variables.
14527 (GSETTINGS_SCHEMA): New define.
14528 (something_changedCB): Call store_monospaced_changed.
14529 (init_gsettings): New function.
14530 (xsettings_initialize): Call init_gsettings.
14531 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14532 to NULL.
14533
14534 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14535 GCONF_CFLAGS/LIBS.
14536
14537 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14538
14539 * window.c (resize_root_window, grow_mini_window)
14540 (shrink_mini_window): Rename Qresize_root_window to
14541 Qwindow_resize_root_window and Qresize_root_window_vertically to
14542 Qwindow_resize_root_window_vertically.
14543
14544 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14545
14546 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14547
14548 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14549
14550 * makefile.w32-in: Redesign dependencies so they reflect more
14551 clearly which files are directly included by each source file,
14552 and not through other includes.
14553
14554 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14555
14556 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14557 (sort_overlays, overlay_strings): When an overlay's clone number
14558 matches the window's clone number process the overlay even if
14559 the overlay's window property doesn't match the current window.
14560
14561 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14562 (Fwindow_hchild): Rename to Fwindow_left_child.
14563 (Fwindow_next): Rename to Fwindow_next_sibling.
14564 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14565 (resize_window_check): Rename to window_resize_check.
14566 (resize_window_apply): Rename to window_resize_apply.
14567 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14568 (Fdelete_other_windows_internal, resize_frame_windows)
14569 (Fsplit_window_internal, Fdelete_window_internal)
14570 (grow_mini_window, shrink_mini_window)
14571 (Fresize_mini_window_internal): Fix callers accordingly.
14572
14573 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14574
14575 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14576 (emacs_fixed_set_min_size): Remove.
14577 (emacs_fixed_new): Take frame as argument.
14578
14579 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14580 (_EmacsFixedPrivate): Remove minwidth/height.
14581 Add struct frame *f.
14582 (emacs_fixed_init): Initialize priv->f.
14583 (get_parent_class, emacs_fixed_set_min_size): Remove.
14584 (emacs_fixed_new): Set priv->f to argument.
14585 (emacs_fixed_get_preferred_width)
14586 (emacs_fixed_get_preferred_height): Use min_width/height from
14587 frames size_hint to set minimum and natural (Bug#8919).
14588 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14589 and use min_width/height from frames size_hint to set
14590 min_width/height (Bug#8919).
14591
14592 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14593 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14594 Fix indentation.
14595
14596 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14597
14598 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14599 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14600 called at ZV.
14601
14602 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14603
14604 * process.c (wait_reading_process_output): Bypass select if
14605 waiting for a cell while ignoring keyboard input, and input is
14606 pending. Suggested by Jan Djärv (Bug#8869).
14607
14608 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14609
14610 Use gnulib's dup2 module instead of rolling our own.
14611 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14612
14613 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14614
14615 * dispnew.c (scrolling_window): Before scrolling, turn off a
14616 mouse-highlight in the window being scrolled.
14617
14618 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14619
14620 Move DEFSYM to lisp.h and use everywhere.
14621
14622 * character.h (DEFSYM): Move declaration...
14623 * lisp.h (DEFSYM): ...here.
14624
14625 * gnutls.c:
14626 * minibuf.c:
14627 * w32menu.c:
14628 * w32proc.c:
14629 * w32select.c: Don't include character.h.
14630
14631 * alloc.c (syms_of_alloc):
14632 * buffer.c (syms_of_buffer):
14633 * bytecode.c (syms_of_bytecode):
14634 * callint.c (syms_of_callint):
14635 * casefiddle.c (syms_of_casefiddle):
14636 * casetab.c (init_casetab_once):
14637 * category.c (init_category_once, syms_of_category):
14638 * ccl.c (syms_of_ccl):
14639 * cmds.c (syms_of_cmds):
14640 * composite.c (syms_of_composite):
14641 * dbusbind.c (syms_of_dbusbind):
14642 * dired.c (syms_of_dired):
14643 * dispnew.c (syms_of_display):
14644 * doc.c (syms_of_doc):
14645 * editfns.c (syms_of_editfns):
14646 * emacs.c (syms_of_emacs):
14647 * eval.c (syms_of_eval):
14648 * fileio.c (syms_of_fileio):
14649 * fns.c (syms_of_fns):
14650 * frame.c (syms_of_frame):
14651 * fringe.c (syms_of_fringe):
14652 * insdel.c (syms_of_insdel):
14653 * keymap.c (syms_of_keymap):
14654 * lread.c (init_obarray, syms_of_lread):
14655 * macros.c (syms_of_macros):
14656 * msdos.c (syms_of_msdos):
14657 * print.c (syms_of_print):
14658 * process.c (syms_of_process):
14659 * search.c (syms_of_search):
14660 * sound.c (syms_of_sound):
14661 * syntax.c (init_syntax_once, syms_of_syntax):
14662 * terminal.c (syms_of_terminal):
14663 * textprop.c (syms_of_textprop):
14664 * undo.c (syms_of_undo):
14665 * w32.c (globals_of_w32):
14666 * window.c (syms_of_window):
14667 * xdisp.c (syms_of_xdisp):
14668 * xfaces.c (syms_of_xfaces):
14669 * xfns.c (syms_of_xfns):
14670 * xmenu.c (syms_of_xmenu):
14671 * xsettings.c (syms_of_xsettings):
14672 * xterm.c (syms_of_xterm): Use DEFSYM.
14673
14674 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14675
14676 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14677
14678 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14679
14680 Integer and buffer overflow fixes (Bug#8873).
14681
14682 * print.c (printchar, strout): Check for string overflow.
14683 (PRINTPREPARE, printchar, strout):
14684 Don't set size unless allocation succeeds.
14685
14686 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14687 for sizes. Check for string overflow more accurately.
14688 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14689
14690 * macros.c: Integer and buffer overflow fixes.
14691 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14692 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14693 Use ptrdiff_t, not int, for sizes.
14694 Don't increment bufsize until after realloc succeeds.
14695 Check for size-calculation overflow.
14696 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14697
14698 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14699
14700 * lread.c: Integer overflow fixes.
14701 (read_integer): Radix is now EMACS_INT, not int,
14702 to improve quality of diagnostics for out-of-range radices.
14703 Calculate buffer size correctly for out-of-range radices.
14704 (read1): Check for integer overflow in radices, and in
14705 read-circle numbers.
14706 (read_escape): Avoid int overflow.
14707 (Fload, openp, read_buffer_size, read1)
14708 (substitute_object_recurse, read_vector, read_list, map_obarray):
14709 Use ptrdiff_t, not int, for sizes.
14710 (read1): Use EMACS_INT, not int, for sizes.
14711 Check for size overflow.
14712
14713 * image.c (cache_image): Check for size arithmetic overflow.
14714
14715 * lread.c: Integer overflow issues.
14716 (saved_doc_string_size, saved_doc_string_length)
14717 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14718 Now ptrdiff_t, not int.
14719 (read1): Don't assume doc string length fits in int. Check for
14720 out-of-range doc string lengths.
14721 (read_list): Don't assume file position fits in int.
14722 (read_escape): Check for hex character overflow.
14723
14724 2011-06-22 Leo Liu <sdl.web@gmail.com>
14725
14726 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14727 Move to minibuffer.el.
14728
14729 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14730
14731 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14732 The following patches are for when GLYPH_DEBUG && !XASSERT.
14733 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14734 * dispnew.c (flush_stdout):
14735 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14736 Mark as externally visible.
14737 * dispnew.c (check_window_matrix_pointers): Now static.
14738 * dispnew.c (window_to_frame_vpos):
14739 * xfns.c (unwind_create_frame):
14740 * xterm.c (x_check_font): Remove unused local.
14741 * scroll.c (CHECK_BOUNDS):
14742 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14743 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14744 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14745 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14746 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14747 Now static.
14748 (debug_method_add): Use va_list and vsprintf rather than relying
14749 on undefined behavior with wrong number of arguments.
14750 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14751 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14752 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14753 since we're not interested in debugging glyphs with old libraries.
14754 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14755 GCC 4.6.0's static checking.
14756
14757 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14758
14759 Integer overflow and signedness fixes (Bug#8873).
14760 A few related buffer overrun fixes, too.
14761
14762 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14763
14764 * dispextern.h (struct face.stipple):
14765 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14766 (x_bitmap_mask, x_allocate_bitmap_record)
14767 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14768 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14769 (x_create_bitmap_from_xpm_data):
14770 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14771 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14772 (.bitmaps_last):
14773 * xfaces.c (load_pixmap):
14774 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14775 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14776 (.bitmaps_last, struct x_output.icon_bitmap):
14777 Use ptrdiff_t, not int, for bitmap indexes.
14778 (x_allocate_bitmap_record): Check for size overflow.
14779 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14780
14781 Use ptrdiff_t, not int, for overlay counts.
14782 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14783 * editfns.c (overlays_around, get_pos_property):
14784 * textprop.c (get_char_property_and_overlay):
14785 * xdisp.c (next_overlay_change, note_mouse_highlight):
14786 * xfaces.c (face_at_buffer_position):
14787 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14788 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14789 (Fnext_overlay_change, Fprevious_overlay_change)
14790 (mouse_face_overlay_overlaps, Foverlays_in):
14791 Use ptrdiff_t, not int, for sizes.
14792 (overlays_at, overlays_in): Check for size-calculation overflow.
14793
14794 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14795
14796 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14797 (x_session_initialize): Do not assume string length fits in int.
14798
14799 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14800 This is unlikely, but can occur if DPI is outlandish.
14801
14802 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14803 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14804
14805 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14806 * xrdb.c (magic_file_p, search_magic_path):
14807 Omit last arg SUFFIX; it was always 0. All callers changed.
14808 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14809
14810 * xfont.c (xfont_match): Avoid need for strlen.
14811
14812 * xfns.c: Don't assume strlen fits in int.
14813 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14814
14815 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14816 not unsigned long, as we prefer signed integers. All callers changed.
14817 Detect integer overflow in repeat count.
14818 (message_dolog): Don't assume print length fits in 39 bytes.
14819 (display_mode_element): Don't assume strlen fits in int.
14820
14821 * termcap.c: Don't assume sizes fit in int and never overflow.
14822 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14823 (gobble_line): Check for size-calculation overflow.
14824
14825 * minibuf.c (Fread_buffer):
14826 * lread.c (intern, intern_c_string):
14827 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14828 Don't assume string length fits in int.
14829
14830 * keyboard.c (parse_tool_bar_item):
14831 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14832
14833 * font.c: Don't assume string length fits in int.
14834 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14835 Use ptrdiff_t, not int.
14836 (font_intern_prop): Don't assume string length fits in int.
14837 Don't assume integer property fits in fixnum.
14838 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14839
14840 * filelock.c: Fix some buffer overrun and integer overflow issues.
14841 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14842 Reformulate so as not to need the command string.
14843 Invoke gzip -cd rather than gunzip, as it's more portable.
14844 (lock_info_type, lock_file_1, lock_file):
14845 Don't assume pid_t and time_t fit in unsigned long.
14846 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14847 (current_lock_owner): Prefer signed type for sizes.
14848 Use memcpy, not strncpy, where memcpy is what is really wanted.
14849 Don't assume (via atoi) that time_t and pid_t fit in int.
14850 Check for time_t and/or pid_t out of range, e.g., via a network share.
14851 Don't alloca where an auto var works fine.
14852
14853 * fileio.c: Fix some integer overflow issues.
14854 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14855 Don't assume string length fits in int.
14856 (directory_file_name): Don't assume string length fits in long.
14857 (make_temp_name): Don't assume pid fits in int, or that its print
14858 length is less than 20.
14859
14860 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14861
14862 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14863
14864 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14865
14866 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14867 We prefer signed integers, even for size calculations.
14868
14869 * emacs.c: Don't assume string length fits in 'int'.
14870 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14871 (main): Don't invoke strlen when not needed.
14872
14873 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14874 (XD_DEBUG_MESSAGE): Don't waste a byte.
14875
14876 * callproc.c (getenv_internal_1, getenv_internal)
14877 (Fgetenv_internal):
14878 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14879
14880 * lread.c (invalid_syntax): Omit length argument.
14881 All uses changed. This doesn't fix a bug, but it simplifies the
14882 code away from its former Hollerith-constant appearance, and it's
14883 one less 'int' to worry about when looking at integer-overflow issues.
14884 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14885
14886 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14887 This didn't break anything, but it didn't help either.
14888 It's confusing to put a bogus integer in a place where the actual
14889 value does not matter.
14890 (LIST_END_P): Remove unused macro and its bogus comment.
14891 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14892
14893 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14894 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14895 implementation.
14896 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14897 We prefer signed types, and the value cannot exceed the EMACS_INT
14898 range anyway (because otherwise the length would not be representable).
14899 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14900 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14901 This avoids a GCC warning when WIDE_EMACS_INT.
14902
14903 * indent.c (sane_tab_width): New function.
14904 (current_column, scan_for_column, Findent_to, position_indentation)
14905 (compute_motion): Use it. This is just for clarity.
14906 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14907
14908 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14909
14910 * lisp.h (lint_assume): New macro.
14911 * composite.c (composition_gstring_put_cache):
14912 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14913
14914 * editfns.c, insdel.c:
14915 Omit unnecessary forward decls, to simplify future changes.
14916
14917 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14918
14919 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14920
14921 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14922 Use much-faster test for byte-length change.
14923 Don't assume string byte-length fits in 'int'.
14924 Check that character arg fits in 'int'.
14925 (mapcar1): Declare byte as byte, for clarity.
14926
14927 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14928
14929 * fns.c (concat): Catch string overflow earlier.
14930 Do not rely on integer wraparound.
14931
14932 * dispextern.h (struct it.overlay_strings_charpos)
14933 (struct it.selective): Now EMACS_INT, not int.
14934 * xdisp.c (forward_to_next_line_start)
14935 (back_to_previous_visible_line_start)
14936 (reseat_at_next_visible_line_start, next_element_from_buffer):
14937 Don't arbitrarily truncate the value of 'selective' to int.
14938
14939 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14940
14941 * composite.c: Don't truncate sizes to 'int'.
14942 (composition_gstring_p, composition_reseat_it)
14943 (composition_adjust_point): Use EMACS_INT, not int.
14944 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14945 not EMACS_UINT, for indexes.
14946
14947 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14948
14949 * buffer.c: Include <verify.h>.
14950 (struct sortvec.priority, struct sortstr.priority):
14951 Now EMACS_INT, not int.
14952 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14953 (struct sortstr.size, record_overlay_string)
14954 (struct sortstrlist.size, struct sortlist.used):
14955 Don't truncate size to int.
14956 (record_overlay_string): Check for size-calculation overflow.
14957 (init_buffer_once): Check at compile-time, not run-time.
14958
14959 2011-06-22 Jim Meyering <meyering@redhat.com>
14960
14961 Don't leak an XBM-image-sized buffer
14962 * image.c (xbm_load): Free the image buffer after using it.
14963
14964 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14965
14966 Port to Sun C.
14967 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14968 that Sun C diagnosed.
14969 * fns.c (secure_hash): Fix pointer signedness issue.
14970 * intervals.c (static_offset_intervals): New function.
14971 (offset_intervals): Use it.
14972
14973 2011-06-21 Leo Liu <sdl.web@gmail.com>
14974
14975 * deps.mk (fns.o):
14976 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14977 sha512.h.
14978
14979 * fns.c (secure_hash): Rename from crypto_hash_function and change
14980 the first arg to accept symbols.
14981 (Fsecure_hash): New primitive.
14982 (syms_of_fns): New symbols.
14983
14984 2011-06-20 Deniz Dogan <deniz@dogan.se>
14985
14986 * process.c (Fset_process_buffer): Clarify return value in
14987 docstring.
14988
14989 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14990
14991 * dispnew.c (add_window_display_history): Use BVAR.
14992
14993 * xdisp.c (debug_method_add): Use BVAR.
14994 (check_window_end, dump_glyph_matrix, dump_glyph)
14995 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14996
14997 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14998 Likewise.
14999
15000 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15001 check till after the cache is created in init_frame_faces.
15002
15003 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15004
15005 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15006
15007 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15008
15009 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15010 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15011 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15012
15013 Improve buffer-overflow checking (Bug#8873).
15014 * fileio.c (Finsert_file_contents):
15015 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15016 Remove the old (too-loose) buffer overflow checks.
15017 They weren't needed, since make_gap checks for buffer overflow.
15018 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15019 The old code merely checked for Emacs fixnum overflow, and relied
15020 on undefined (wraparound) behavior. The new code avoids undefined
15021 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15022
15023 * editfns.c (Finsert_char): Don't dump core with very negative counts.
15024 Tune. Don't use wider integers than needed. Don't use alloca.
15025 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
15026
15027 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15028
15029 * insdel.c, lisp.h (buffer_overflow): New function.
15030 (insert_from_buffer_1, replace_range, replace_range_2):
15031 * insdel.c (make_gap_larger):
15032 * editfns.c (Finsert_char):
15033 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15034
15035 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15036
15037 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
15038
15039 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15040
15041 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15042 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15043
15044 * fileio.c: Don't assume EMACS_INT fits in off_t.
15045 (emacs_lseek): New static function.
15046 (Finsert_file_contents, Fwrite_region): Use it.
15047 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15048
15049 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15050
15051 * fns.c: Don't overflow int when computing a list length.
15052 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15053 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15054 truncation on 64-bit hosts. Check for QUIT every
15055 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15056 faster and is responsive enough.
15057 (Flength): Report an error instead of overflowing an integer.
15058 (Fsafe_length): Return a float if the value is not representable
15059 as a fixnum. This shouldn't happen except in contrived situations.
15060 (Fnthcdr, Fsort): Don't assume list length fits in int.
15061 (Fcopy_sequence): Don't assume vector length fits in int.
15062
15063 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15064 (header_size, word_size): New constants.
15065 (allocate_vectorlike): Don't check size overflow here.
15066 (allocate_vector): Check it here instead, since this is the only
15067 caller of allocate_vectorlike that could cause overflow.
15068 Check that the new vector's length is representable as a fixnum.
15069
15070 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15071 The previous code was bogus. For example, next_almost_prime (32)
15072 returned 39, which is undesirable as it is a multiple of 3; and
15073 next_almost_prime (24) returned 25, which is a multiple of 5 so
15074 why was the code bothering to check for multiples of 7?
15075
15076 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15077
15078 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15079
15080 Variadic C functions now count arguments with ptrdiff_t.
15081 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15082 Back then I didn't know that the Emacs coding style prefers signed int.
15083 Also, in the meantime I found a few more instances where arguments
15084 were being counted with int, which may truncate counts on 64-bit
15085 machines, or EMACS_INT, which may be unnecessarily wide.
15086 * lisp.h (struct Lisp_Subr.function.aMANY)
15087 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15088 Arg counts are now ptrdiff_t, not size_t.
15089 All variadic functions and their callers changed accordingly.
15090 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15091 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15092 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15093 * callint.c (Fcall_interactively): Check arg count for overflow,
15094 to avoid potential buffer overrun. Use signed char, not 'int',
15095 for 'varies' array, so that we needn't bother to check its size
15096 calculation for overflow.
15097 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15098 * eval.c (apply_lambda):
15099 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15100 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15101 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15102
15103 * callint.c (Fcall_interactively): Don't use index var as event count.
15104
15105 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15106 * mem-limits.h (SIZE): Remove; no longer used.
15107
15108 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15109
15110 Remove unnecessary casts.
15111 * xterm.c (x_term_init):
15112 * xfns.c (x_set_border_pixel):
15113 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15114 These aren't needed now that we assume ANSI C.
15115
15116 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15117 It's more likely to cause problems (due to unsigned overflow)
15118 than to cure them.
15119
15120 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15121
15122 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15123
15124 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15125
15126 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15127
15128 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15129
15130 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15131
15132 GLYPH_CODE_FACE returns EMACS_INT, not int.
15133 * dispextern.h (merge_faces):
15134 * xfaces.c (merge_faces):
15135 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15136 Don't assume EMACS_INT fits in int.
15137
15138 * character.h (CHAR_VALID_P): Remove unused parameter.
15139 * fontset.c, lisp.h, xdisp.c: All uses changed.
15140
15141 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15142
15143 * fns.c (concat): Minor tuning based on overflow analysis.
15144 This doesn't fix any bugs. Use int to hold character, instead
15145 of constantly refetching from Emacs object. Use XFASTINT, not
15146 XINT, for value known to be a character. Don't bother comparing
15147 a single byte to 0400, as it's always less.
15148
15149 * floatfns.c (Fexpt):
15150 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15151
15152 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15153 for characters.
15154
15155 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15156
15157 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15158 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15159 incorrectly succeed when S was a string, because 4294967386 was
15160 truncated before it was used.
15161
15162 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15163 Otherwise, an out-of-range integer could cause undefined behavior
15164 on a 64-bit host.
15165
15166 * composite.c: Use int, not EMACS_INT, for characters.
15167 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15168 EMACS_INT, for values that are known to be in character range.
15169 This doesn't fix any bugs but is the usual style inside Emacs and
15170 may generate better code on 32-bit machines.
15171
15172 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15173 This is for reasons similar to the recent CHAR_STRING fix.
15174 * charset.c (Fencode_char): Check that character arg is actually
15175 a character. Pass an int to ENCODE_CHAR.
15176 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15177 wider than 'int', as a compile-time check to prevent future regressions
15178 in this area.
15179
15180 * character.c (char_string): Remove unnecessary casts.
15181
15182 Make sure a 64-bit char is never passed to CHAR_STRING.
15183 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15184 by silently ignoring the top 32 bits, allowing some values
15185 that were far too large to be valid characters.
15186 * character.h: Include <verify.h>.
15187 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15188 arguments are no wider than unsigned, as a compile-time check
15189 to prevent future regressions in this area.
15190 * data.c (Faset):
15191 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15192 (Fsubst_char_in_region):
15193 * fns.c (concat):
15194 * xdisp.c (decode_mode_spec_coding):
15195 Adjust to CHAR_STRING's new requirement.
15196 * editfns.c (Finsert_char, Fsubst_char_in_region):
15197 * fns.c (concat): Check that character args are actually
15198 characters. Without this test, these functions did the wrong
15199 thing with wildly out-of-range values on 64-bit hosts.
15200
15201 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15202 These casts should not be needed on 32-bit hosts, either.
15203 * keyboard.c (read_char):
15204 * lread.c (Fload): Remove casts to unsigned.
15205
15206 * lisp.h (UNSIGNED_CMP): New macro.
15207 This fixes comparison bugs on 64-bit hosts.
15208 (ASCII_CHAR_P): Use it.
15209 * casefiddle.c (casify_object):
15210 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15211 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15212 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15213 * dispextern.h (FACE_FROM_ID):
15214 * keyboard.c (read_char): Use UNSIGNED_CMP.
15215
15216 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15217 not to EMACS_INT, to avoid GCC warning.
15218
15219 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15220
15221 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15222 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15223 isn't needed on 32-bit machines.
15224
15225 * buffer.c (Fgenerate_new_buffer_name):
15226 Use EMACS_INT for count, not int.
15227 (advance_to_char_boundary): Return EMACS_INT, not int.
15228
15229 * data.c (Qcompiled_function): Now static.
15230
15231 * window.c (window_body_lines): Now static.
15232
15233 * image.c (gif_load): Rename local to avoid shadowing.
15234
15235 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15236 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15237 * alloc.c (make_save_value): Integer argument is now of type
15238 ptrdiff_t, not int.
15239 (mark_object): Use ptrdiff_t, not int.
15240 * lisp.h (pD): New macro.
15241 * print.c (print_object): Use it.
15242
15243 * alloc.c: Use EMACS_INT, not int, to count objects.
15244 (total_conses, total_markers, total_symbols, total_vector_size)
15245 (total_free_conses, total_free_markers, total_free_symbols)
15246 (total_free_floats, total_floats, total_free_intervals)
15247 (total_intervals, total_strings, total_free_strings):
15248 Now EMACS_INT, not int. All uses changed.
15249 (Fgarbage_collect): Compute overall total using a double, so that
15250 integer overflow is less likely to be a problem. Check for overflow
15251 when converting back to an integer.
15252 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15253 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15254 These were 'int' variables that could overflow on 64-bit hosts;
15255 they were never used, so remove them instead of repairing them.
15256 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15257 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15258 Previously, this ceilinged at INT_MAX, but that doesn't work on
15259 64-bit machines.
15260 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15261
15262 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15263 (allocate_vectorlike): Check for ptrdiff_t overflow.
15264 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15265 when a (possibly-narrower) signed value would do just as well.
15266 We prefer using signed arithmetic, to avoid comparison confusion.
15267
15268 * alloc.c: Catch some string size overflows that we were missing.
15269 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15270 for convenience in STRING_BYTES_MAX.
15271 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15272 The definition here is exact; the one in lisp.h was approximate.
15273 (allocate_string_data): Check for string overflow. This catches
15274 some instances we weren't catching before. Also, it catches
15275 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15276 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15277 and ptrdiff_t and EMACS_INT are both 64 bits.
15278
15279 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15280 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15281 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15282
15283 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15284
15285 * alloc.c (Fmake_string): Check for out-of-range init.
15286
15287 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15288
15289 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15290
15291 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15292
15293 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15294 xg_get_default_scrollbar_width.
15295
15296 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15297 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15298 (style_changed_cb): Call update_theme_scrollbar_width and call
15299 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15300 all frames (Bug#8505).
15301 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15302 Call gtk_window_set_resizable if HAVE_GTK3.
15303 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15304 and height if HAVE_GTK3 (Bug#8505).
15305 (scroll_bar_width_for_theme): New variable.
15306 (update_theme_scrollbar_width): New function.
15307 (xg_get_default_scrollbar_width): Move code to
15308 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15309 (xg_initialize): Call update_theme_scrollbar_width.
15310
15311 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15312
15313 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15314
15315 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15316
15317 * frame.c (make_frame): Call other_buffer_safely instead of
15318 other_buffer.
15319
15320 * window.c (temp_output_buffer_show): Call display_buffer with
15321 second argument Vtemp_buffer_show_specifiers and reset latter
15322 immediately after the call.
15323 (Vtemp_buffer_show_specifiers): New variable.
15324 (auto_window_vscroll_p, next_screen_context_lines)
15325 (Vscroll_preserve_screen_position): Remove leading asterisks from
15326 doc-strings.
15327
15328 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15329
15330 Fix minor problems found by GCC 4.6.0 static checking.
15331 * buffer.c (Qclone_number): Remove for now, as it's unused.
15332 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15333 (record_buffer): Remove unused local.
15334 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15335 (set_frame_buffer_list): Remove; unused.
15336 * frame.h (other_visible_frames): Remove decl.
15337 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15338 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15339 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15340 if HAVE_GPM.
15341 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15342 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15343 Define only if HAVE_GPM.
15344 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15345 (update_hints_inhibit): Remove; never set. All uses removed.
15346 * widgetprv.h (emacsFrameClassRec): Remove decl.
15347 * window.c (delete_deletable_window): Now returns void, since it
15348 wasn't returning anything.
15349 (compare_window_configurations): Remove unused locals.
15350 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15351 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15352 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15353 the same widths as pointers. This follows up on the 2011-05-06 patch.
15354 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15355 * xterm.h: Likewise.
15356 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15357
15358 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15359
15360 * makefile.w32-in: Update dependencies.
15361 (LISP_H): Add lib/intprops.h.
15362
15363 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15364
15365 * image.c (gif_load): Add animation frame delay to the metadata.
15366 (syms_of_image): Use DEFSYM. New symbol `delay'.
15367
15368 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15369
15370 * window.c (delete_deletable_window): Re-add.
15371 (Fset_window_configuration): Rewrite to handle dead buffers and
15372 consequently deletable windows.
15373 (window_tree, Fwindow_tree): Remove. Supply functionality in
15374 window.el.
15375 (compare_window_configurations): Simplify code.
15376
15377 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15378
15379 * image.c (imagemagick_load_image): Fix type mismatch.
15380 (Fimagemagick_types): Likewise.
15381
15382 * window.h (replace_buffer_in_windows): Declare.
15383
15384 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15385
15386 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15387 Qclone_number. Remove external declaration of Qdelete_window.
15388 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15389 code.
15390 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15391 Run Qbuffer_list_update_hook if allowed.
15392 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15393 buffer list implementation.
15394 (other_buffer_safely): New function.
15395 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15396 calls to replace_buffer_in_windows and
15397 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15398 if allowed.
15399 (record_buffer): Inhibit quitting and rewrite using quittable
15400 functions. Run Qbuffer_list_update_hook if allowed.
15401 (Frecord_buffer, Funrecord_buffer): New functions.
15402 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15403 Move switch-to-buffer to window.el.
15404 (bury-buffer): Move to window.el.
15405 (Vbuffer_list_update_hook): New variable.
15406
15407 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15408 section.
15409
15410 * window.h (resize_frame_windows): Move up in code.
15411 (Fwindow_frame): Remove EXFUN.
15412 (replace_buffer_in_all_windows): Remove prototype.
15413 (replace_buffer_in_windows_safely): Add prototype.
15414
15415 * window.c: Declare Qdelete_window static again. Move down
15416 declaration of select_count.
15417 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15418 (Fother_window): Move to window.el.
15419 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15420 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15421 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15422 window.el.
15423 (replace_buffer_in_windows): Implement by calling
15424 Qreplace_buffer_in_windows.
15425 (replace_buffer_in_all_windows): Remove with some functionality
15426 moved into replace_buffer_in_windows_safely.
15427 (replace_buffer_in_windows_safely): New function.
15428 (select_window_norecord, select_frame_norecord): Move in front
15429 of run_window_configuration_change_hook. Remove now obsolete
15430 declarations.
15431 (Fset_window_buffer): Rewrite doc-string.
15432 Call Qrecord_window_buffer.
15433 (keys_of_window): Move binding for other-window to window.el.
15434
15435 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15436
15437 * dispextern.h (struct image): Replace data member, whose int_val
15438 and ptr_val fields were not used by anything, with a single
15439 lisp_val object.
15440
15441 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15442 (gif_clear_image, gif_load, imagemagick_load_image)
15443 (gs_clear_image, gs_load): Callers changed.
15444
15445 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15446
15447 * buffer.h: Include <time.h>, for time_t.
15448 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15449
15450 Fix minor problems found by static checking.
15451
15452 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15453
15454 Make identifiers static if they are not used in other modules.
15455 * data.c (Qcompiled_function, Qframe, Qvector):
15456 * image.c (QimageMagick, Qsvg):
15457 * minibuf.c (Qmetadata):
15458 * window.c (resize_window_check, resize_root_window): Now static.
15459 * window.h (resize_window_check, resize_root_window): Remove decls.
15460
15461 * window.c (window_deletion_count, delete_deletable_window):
15462 Remove; unused.
15463 (window_body_lines): Now static.
15464 (Fdelete_other_windows_internal): Mark vars as initialized.
15465 Make sure 'resize_failed' is initialized.
15466 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15467 (resize_window_apply): Remove unused local.
15468 * window.h (delete_deletable_window): Remove decl.
15469
15470 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15471 (imagemagick_load_image): Fix pointer signedness problem by changing
15472 last arg from unsigned char * to char *. All uses changed.
15473 Also, fix a local for similar reasons.
15474 Remove unused locals. Remove locals to avoid shadowing.
15475 (fn_rsvg_handle_free): Remove; unused.
15476 (svg_load, svg_load_image): Fix pointer signedness problem.
15477 (imagemagick_load_image): Don't use garbage pointer image_wand.
15478
15479 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15480
15481 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15482
15483 * image.c (gif_load): Fix omitted cast error introduced by
15484 2011-06-06 change.
15485
15486 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15487
15488 * window.h (resize_proportionally, orig_total_lines)
15489 (orig_top_line): Remove from window structure.
15490 (set_window_height, set_window_width, change_window_heights)
15491 (Fdelete_window): Remove prototypes.
15492 (resize_frame_windows): Remove duplicate declaration.
15493
15494 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15495
15496 * window.h (resize_frame_windows, resize_window_check)
15497 (delete_deletable_window, resize_root_window)
15498 (resize_frame_windows): Declare prototypes.
15499
15500 * window.c (resize_window_apply): Make definition be "static" to
15501 match the prototype.
15502
15503 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15504
15505 * window.c: Remove declarations of Qwindow_size_fixed,
15506 window_min_size_1, window_min_size_2, window_min_size,
15507 size_window, window_fixed_size_p, enlarge_window, delete_window.
15508 Remove static from declaration of Qdelete_window, it's
15509 temporarily needed by Fbury_buffer.
15510 (replace_window): Don't assign orig_top_line and
15511 orig_total_lines.
15512 (Fdelete_window, delete_window): Remove. Window deletion is
15513 handled by window.el.
15514 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15515 Replace Fdelete_window calls with calls to Qdelete_window.
15516 (Fdelete_other_windows): Remove. Deleting other windows is
15517 handled by window.el.
15518 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15519 handled in window.el.
15520 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15521 Window minimum sizes are handled in window.el.
15522 (shrink_windows, size_window, set_window_height)
15523 (set_window_width, change_window_heights, window_height)
15524 (window_width, CURBEG, CURSIZE, enlarge_window)
15525 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15526 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15527 handled in window.el.
15528 (make_dummy_parent): Rename to make_parent_window and give it a
15529 second argument horflag.
15530 (make_window): Don't set resize_proportionally any more.
15531 (Fsplit_window): Remove. Windows are split in window.el.
15532 (save_restore_action, save_restore_orig_size)
15533 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15534 Resize mini windows in window.el.
15535 (grow_mini_window, shrink_mini_window): Implement by calling
15536 Qresize_root_window_vertically, resize_window_check and
15537 resize_window_apply.
15538 (saved_window, Fset_window_configuration, save_window_save):
15539 Do not handle orig_top_line, orig_total_lines, and
15540 resize_proportionally.
15541 (window_min_height, window_min_width): Move to window.el.
15542 (keys_of_window): Move bindings for delete-other-windows,
15543 split-window, delete-window and enlarge-window to window.el.
15544
15545 * buffer.c: Temporarily extern Qdelete_window.
15546 (Fbury_buffer): Temporarily call Qdelete_window instead of
15547 Fdelete_window (Fbury_buffer will move to window.el soon).
15548
15549 * frame.c (set_menu_bar_lines_1): Remove code handling
15550 orig_top_line and orig_total_lines.
15551
15552 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15553 set_window_height but set heights directly.
15554 (change_frame_size_1): Use resize_frame_windows.
15555
15556 * xdisp.c (init_xdisp): Don't use set_window_height but set
15557 heights directly.
15558
15559 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15560 Use resize_frame_windows instead of change_window_heights and run
15561 run_window_configuration_change_hook.
15562
15563 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15564 instead of change_window_heights and run
15565 run_window_configuration_change_hook.
15566
15567 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15568
15569 * window.c (replace_window): Rename second argument REPLACEMENT to
15570 NEW. New third argument SETFLAG. Rewrite.
15571 (delete_window, make_dummy_parent): Call replace_window with
15572 third argument 1.
15573 (window_list_1): Move down in code.
15574 (run_window_configuration_change_hook): Move set_buffer part
15575 before select_frame_norecord part in order to unwind correctly.
15576 Rename count1 to count.
15577 (recombine_windows, delete_deletable_window, resize_root_window)
15578 (Fdelete_other_windows_internal)
15579 (Frun_window_configuration_change_hook, make_parent_window)
15580 (resize_window_check, resize_window_apply, Fresize_window_apply)
15581 (resize_frame_windows, Fsplit_window_internal)
15582 (Fdelete_window_internal, Fresize_mini_window_internal):
15583 New functions.
15584 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15585
15586 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15587
15588 * window.h (window): Add some new members to window structure -
15589 normal_lines, normal_cols, new_total, new_normal, clone_number,
15590 splits, nest, prev_buffers, next_buffers.
15591 (WINDOW_TOTAL_SIZE): Move here from window.c.
15592 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15593
15594 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15595 Remove.
15596 (make_dummy_parent): Set new members of windows structure.
15597 (make_window): Move down in code. Handle new members of window
15598 structure.
15599 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15600 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15601 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15602 (Fset_window_prev_buffers, Fwindow_next_buffers)
15603 (Fset_window_next_buffers, Fset_window_clone_number):
15604 New functions.
15605 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15606 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15607 Doc-string fixes.
15608 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15609 Argument WINDOW can be now internal window too.
15610 (Fwindow_use_time): Move up in code.
15611 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15612 Rewrite doc-string.
15613 (Fset_window_configuration, saved_window)
15614 (Fcurrent_window_configuration, save_window_save): Handle new
15615 members of window structure.
15616 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15617 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15618 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15619 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15620 Qget_mru_window, Qresize_root_window,
15621 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15622 Qauto_buffer_name; staticpro them.
15623
15624 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15625
15626 * window.c (Fwindow_total_size, Fwindow_left_column)
15627 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15628 (Fwindow_list_1): New functions.
15629 (window_box_text_cols): Replace with window_body_cols.
15630 (Fwindow_width, Fscroll_left, Fscroll_right):
15631 Use window_body_cols instead of window_box_text_cols.
15632 (delete_window, Fset_window_configuration):
15633 Call delete_all_subwindows with window as argument.
15634 (delete_all_subwindows): Take a window as argument and not a
15635 structure. Rewrite.
15636 (window_loop): Remove handling of GET_LRU_WINDOW and
15637 GET_LARGEST_WINDOW.
15638 (Fget_lru_window, Fget_largest_window): Move to window.el.
15639
15640 * window.h: Extern window_body_cols instead of
15641 window_box_text_cols. delete_all_subwindows now takes a
15642 Lisp_Object as argument.
15643
15644 * indent.c (compute_motion, Fcompute_motion):
15645 Use window_body_cols instead of window_box_text_cols.
15646
15647 * frame.c (delete_frame): Call delete_all_subwindows with root
15648 window as argument.
15649
15650 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15651
15652 * fns.c (Fputhash): Document return value.
15653
15654 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15655
15656 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15657
15658 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15659
15660 Cons<->int and similar integer overflow fixes (Bug#8794).
15661
15662 Check for overflow when converting integer to cons and back.
15663 * charset.c (Fdefine_charset_internal, Fdecode_char):
15664 Use cons_to_unsigned to catch overflow.
15665 (Fencode_char): Use INTEGER_TO_CONS.
15666 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15667 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15668 * data.c (long_to_cons, cons_to_long): Remove.
15669 (cons_to_unsigned, cons_to_signed): New functions.
15670 These signal an error for invalid or out-of-range values.
15671 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15672 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15673 * font.c (Ffont_variation_glyphs):
15674 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15675 * lisp.h: Include <intprops.h>.
15676 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15677 (cons_to_signed, cons_to_unsigned): New decls.
15678 (long_to_cons, cons_to_long): Remove decls.
15679 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15680 (Fprimitive_undo): Use CONS_TO_INTEGER.
15681 * xfns.c (Fx_window_property): Likewise.
15682 * xselect.c: Include <limits.h>.
15683 (x_own_selection, selection_data_to_lisp_data):
15684 Use INTEGER_TO_CONS.
15685 (x_handle_selection_request, x_handle_selection_clear)
15686 (x_get_foreign_selection, Fx_disown_selection_internal)
15687 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15688 (lisp_data_to_selection_data): Use cons_to_unsigned.
15689 (x_fill_property_data): Use cons_to_signed.
15690 Report values out of range.
15691
15692 Check for buffer and string overflow more precisely.
15693 * buffer.h (BUF_BYTES_MAX): New macro.
15694 * lisp.h (STRING_BYTES_MAX): New macro.
15695 * alloc.c (Fmake_string):
15696 * character.c (string_escape_byte8):
15697 * coding.c (coding_alloc_by_realloc):
15698 * doprnt.c (doprnt):
15699 * editfns.c (Fformat):
15700 * eval.c (verror):
15701 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15702 since they may not be the same number.
15703 * editfns.c (Finsert_char):
15704 * fileio.c (Finsert_file_contents):
15705 Likewise for BUF_BYTES_MAX.
15706
15707 * image.c: Use ptrdiff_t, not int, for sizes.
15708 (slurp_file): Switch from int to ptrdiff_t.
15709 All uses changed.
15710 (slurp_file): Check that file size fits in both size_t (for
15711 malloc) and ptrdiff_t (for sanity and safety).
15712
15713 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15714 if b->modtime has its maximal value.
15715
15716 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15717
15718 Don't assume time_t can fit into int.
15719 * buffer.h (struct buffer.modtime): Now time_t, not int.
15720 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15721 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15722
15723 Minor fixes for signed vs unsigned integers.
15724 * character.h (MAYBE_UNIFY_CHAR):
15725 * charset.c (maybe_unify_char):
15726 * keyboard.c (read_char, reorder_modifiers):
15727 XINT -> XFASTINT, since the integer must be nonnegative.
15728 * ftfont.c (ftfont_spec_pattern):
15729 * keymap.c (access_keymap, silly_event_symbol_error):
15730 XUINT -> XFASTINT, since the integer must be nonnegative.
15731 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15732 since it makes no difference and we prefer signed.
15733 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15734 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15735 nonnegative.
15736
15737 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15738
15739 * window.h (Fwindow_frame): Declare.
15740
15741 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15742
15743 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15744 (SPARE_MEMORY): Always define.
15745 (LARGE_REQUEST): Remove.
15746 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15747
15748 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15749
15750 * lisp.h: Move EXFUNS for Fframe_root_window,
15751 Fframe_first_window and Fset_frame_selected_window to window.h.
15752
15753 * window.h: Move EXFUNS for Fframe_root_window,
15754 Fframe_first_window and Fset_frame_selected_window here from
15755 lisp.h.
15756
15757 * frame.c (Fwindow_frame, Fframe_first_window)
15758 (Fframe_root_window, Fframe_selected_window)
15759 (Fset_frame_selected_window): Move to window.c.
15760 (Factive_minibuffer_window): Move to minibuf.c.
15761 (Fother_visible_frames_p): New function.
15762
15763 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15764
15765 * window.c (decode_window, decode_any_window): Move up in code.
15766 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15767 (inhibit_frame_unsplittable): Remove unused variable.
15768 (Fwindow_buffer): Move up and rewrite doc-string.
15769 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15770 (Fwindow_prev): New functions.
15771 (Fwindow_frame): Move here from frame.c. Accept any window as
15772 argument.
15773 (Fframe_root_window, Fframe_first_window)
15774 (Fframe_selected_window): Move here from frame.c. Accept frame
15775 or arbitrary window as argument. Update doc-strings.
15776 (Fminibuffer_window): Move up in code.
15777 (Fwindow_minibuffer_p): Move up in code and simplify.
15778 (Fset_frame_selected_window): Move here from frame.c.
15779 Marginal rewrite.
15780 (Fselected_window, select_window, Fselect_window): Move up in
15781 code. Minor doc-string fixes.
15782
15783 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15784
15785 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15786 Do not assume that spare memory exists; that assumption is valid
15787 only if SYSTEM_MALLOC.
15788 (LARGE_REQUEST): New macro, so that the issue of large requests
15789 is separated from the issue of spare memory.
15790
15791 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15792
15793 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15794 format. (Bug#8806)
15795
15796 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15797
15798 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15799 before statements.
15800
15801 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15802
15803 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15804
15805 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15806
15807 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15808 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15809
15810 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15811
15812 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15813
15814 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15815
15816 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15817 (x_clipboard_manager_save): Add return value.
15818 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15819 New error handlers.
15820 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15821 Obey Vx_select_enable_clipboard_manager. Catch errors in
15822 x_clipboard_manager_save (Bug#8779).
15823 (Vx_select_enable_clipboard_manager): New variable.
15824 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15825
15826 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15827
15828 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15829
15830 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15831
15832 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15833 in the current matrix if keep_current_p is non-zero.
15834
15835 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15836
15837 * bidi.c (bidi_level_of_next_char): Fix last change.
15838
15839 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15840
15841 Support bidi reordering of text covered by display properties.
15842
15843 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15844 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15845 (bidi_cache_search, bidi_cache_iterator_state)
15846 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15847 (bidi_level_of_next_char, bidi_move_to_visually_next):
15848 Support character positions inside a run of characters covered by a
15849 display string.
15850 (bidi_paragraph_init, bidi_resolve_explicit_1)
15851 (bidi_level_of_next_char): Call bidi_fetch_char and
15852 bidi_fetch_char_advance instead of FETCH_CHAR and
15853 FETCH_CHAR_ADVANCE.
15854 (bidi_init_it): Initialize new members.
15855 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15856 definitions.
15857 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15858 instead of using explicit *_CHAR codes.
15859 (bidi_resolve_explicit, bidi_resolve_weak):
15860 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15861 bidirectional text is supported only in multibyte buffers.
15862 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15863 it to initialize the frame_window_p member of struct bidi_it.
15864 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15865 (bidi_resolve_explicit, bidi_resolve_weak)
15866 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15867 bidi_it->nchars is non-positive.
15868 (bidi_level_of_next_char): Don't try to lookup the cache for the
15869 next/previous character if nothing is cached there yet, or if we
15870 were just reseat()'ed to a new position.
15871
15872 * xdisp.c (set_cursor_from_row): Set start and stop points
15873 according to the row's direction when priming the loop that looks
15874 for the glyph on which to display cursor.
15875 (single_display_spec_intangible_p): Function deleted.
15876 (display_prop_intangible_p): Reimplement to call
15877 handle_display_spec instead of single_display_spec_intangible_p.
15878 Accept 3 additional arguments needed by handle_display_spec.
15879 This fixes incorrect cursor motion across display property with complex
15880 values: lists, `(when COND...)' forms, etc.
15881 (single_display_spec_string_p): Support property values that are
15882 lists with the argument STRING its top-level element.
15883 (display_prop_string_p): Fix the condition for processing a
15884 property that is a list to be consistent with handle_display_spec.
15885 (handle_display_spec): New function, refactored from the
15886 last portion of handle_display_prop.
15887 (compute_display_string_pos): Accept additional argument
15888 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15889 value of a `display' property is a "replacing spec".
15890 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15891 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15892 the display property, but just return a value indicating whether
15893 the display property will replace the characters it covers.
15894 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15895 frame_window_p members of struct bidi_it.
15896 (compute_display_string_pos, compute_display_string_end):
15897 New functions.
15898 (push_it): Accept second argument POSITION, where pop_it should
15899 jump to continue iteration.
15900 (reseat_1): Initialize bidi_it.disp_pos.
15901
15902 * keyboard.c (adjust_point_for_property): Adjust the call to
15903 display_prop_intangible_p to its new signature.
15904
15905 * dispextern.h (struct bidi_it): New member frame_window_p.
15906 (bidi_init_it): Update prototypes.
15907 (display_prop_intangible_p): Update prototype.
15908 (compute_display_string_pos, compute_display_string_end):
15909 Declare prototypes.
15910 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15911 EMACS_INT.
15912
15913 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15914
15915 Malloc failure behavior now depends on size of allocation.
15916 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15917 * lisp.h: Change signatures accordingly.
15918 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15919 All callers changed. (Bug#8762)
15920
15921 * gnutls.c: Use Emacs's memory allocators.
15922 Without this change, the gnutls library would invoke malloc etc.
15923 directly, which causes problems on non-SYNC_INPUT hosts, and which
15924 runs afoul of improving memory_full behavior. (Bug#8761)
15925 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15926 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15927 xfree instead of the default malloc, realloc, free.
15928 (Fgnutls_boot): No need to check for memory allocation failure,
15929 since xmalloc does that for us.
15930
15931 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15932 * category.c (hash_get_category_set):
15933 * ccl.c (ccl_driver):
15934 * charset.c (Fdefine_charset_internal):
15935 * charset.h (struct charset.hash_index):
15936 * composite.c (get_composition_id, gstring_lookup_cache)
15937 (composition_gstring_put_cache):
15938 * composite.h (struct composition.hash_index):
15939 * dispextern.h (struct image.hash):
15940 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15941 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15942 (hashfn_equal, hashfn_user_defined, make_hash_table)
15943 (maybe_resize_hash_table, hash_lookup, hash_put)
15944 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15945 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15946 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15947 * image.c (make_image, search_image_cache, lookup_image)
15948 (xpm_put_color_table_h):
15949 * lisp.h (struct Lisp_Hash_Table):
15950 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15951 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15952 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15953 * alloc.c (allocate_vectorlike):
15954 Check for overflow in vector size calculations.
15955 * ccl.c (ccl_driver):
15956 Check for overflow when converting EMACS_INT to int.
15957 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15958 need to be updated by these changes.
15959 * fns.c (make_hash_table, maybe_resize_hash_table):
15960 Check for integer overflow with large hash tables.
15961 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15962 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15963 (SXHASH_REDUCE): New macro.
15964 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15965 Use it instead of discarding useful hash info with large hash values.
15966 (sxhash_float): New function.
15967 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15968 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15969 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15970 Rewrite to use FIXNUM_BITS, as this simplifies things.
15971 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15972 Adjust signatures to match updated version of code.
15973 (consing_since_gc): Now EMACS_INT, since a single hash table can
15974 use more than INT_MAX bytes.
15975
15976 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15977
15978 Make it possible to build with GCC-4.6+ -O2 -flto.
15979
15980 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15981
15982 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15983
15984 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15985 Call minibuffer-inactive-mode.
15986
15987 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15988
15989 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15990 Update dependencies.
15991
15992 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15993
15994 * data.c (init_data): Remove code for UTS, this system is not
15995 supported anymore.
15996
15997 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15998
15999 Don't force ./temacs to start in terminal mode.
16000
16001 * frame.c (make_initial_frame): Initialize faces in all cases, not
16002 only when CANNOT_DUMP is defined.
16003 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16004
16005 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16006
16007 * dispnew.c (add_window_display_history): Use const for the string
16008 pointer. Remove declaration, not needed.
16009
16010 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16011
16012 Use 'inline', not 'INLINE'.
16013 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16014 * alloc.c, fontset.c (INLINE): Remove.
16015 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16016 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16017 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16018 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16019 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16020
16021 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16022
16023 Make it possible to run ./temacs.
16024
16025 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16026 syms_of_callproc does the same thing. Remove test for
16027 "initialized", do it in the caller.
16028 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16029
16030 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16031
16032 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16033 (read_minibuf): Use get_minibuffer.
16034 (syms_of_minibuf): Use DEFSYM.
16035 (Qmetadata): New var.
16036 * data.c (Qbuffer): Don't make it static.
16037 (syms_of_data): Use DEFSYM.
16038
16039 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16040
16041 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16042 (CCL_CODE_MIN): New macro.
16043
16044 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16045
16046 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16047
16048 * eval.c (Qdebug): Now static.
16049 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16050 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16051 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16052
16053 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16054
16055 * image.c: Various fixes to ImageMagick code comments.
16056 (Fimagemagick_types): Doc fix.
16057
16058 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16059
16060 Minor fixes prompted by GCC 4.6.0 warnings.
16061
16062 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16063
16064 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16065 (x_clipboard_manager_save_all): Move extern decl to ...
16066 * xterm.h: ... here, so that it can be checked for consistency.
16067
16068 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16069
16070 * xselect.c (x_clipboard_manager_save_frame)
16071 (x_clipboard_manager_save_all): New functions.
16072 (Fx_clipboard_manager_save): Lisp function deleted.
16073
16074 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16075 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16076
16077 * xterm.h: Update prototype.
16078
16079 2011-05-28 William Xu <william.xwl@gmail.com>
16080
16081 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16082 exiting (Bug#8239).
16083
16084 2011-05-28 Jim Meyering <meyering@redhat.com>
16085
16086 Avoid a sign-extension bug in crypto_hash_function.
16087 * fns.c (to_uchar): Define.
16088 (crypto_hash_function): Use it to convert some newly-signed
16089 variables to unsigned, to avoid sign-extension bugs. For example,
16090 without this change, (md5 "truc") would evaluate to
16091 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16092 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16093 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16094
16095 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16096
16097 Integer overflow fixes.
16098
16099 * dbusbind.c: Serial number integer overflow fixes.
16100 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16101 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16102 to hold a serial number that is too large for a fixnum.
16103 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16104 Check for serial numbers out of range. Decode any serial number
16105 that was so large that it became a float. (Bug#8722)
16106
16107 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16108 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16109 Use XFASTINT rather than XUINT when numbers are nonnegative.
16110 (xd_append_arg, Fdbus_method_return_internal):
16111 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16112 arguments, check that Lisp number is nonnegative, rather than
16113 silently wrapping negative numbers around. (Bug#8722)
16114 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16115 (Bug#8722)
16116
16117 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16118
16119 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16120
16121 ccl: Add integer overflow checks.
16122 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16123 (IN_INT_RANGE): New macros.
16124 (ccl_driver): Use them to check for integer overflow when
16125 decoding a CCL program. Many of the new checks are whether XINT (x)
16126 fits in int; it doesn't always, on 64-bit hosts. The new version
16127 doesn't catch all possible integer overflows, but it's an
16128 improvement. (Bug#8719)
16129
16130 * alloc.c (make_event_array): Use XINT, not XUINT.
16131 There's no need for unsigned here.
16132
16133 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16134 This follows up to the 2011-05-06 change that substituted uintptr_t
16135 for EMACS_INT. This case wasn't caught back then.
16136
16137 Rework Fformat to avoid integer overflow issues.
16138 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16139 now (part of C89). Include <verify.h>.
16140 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16141 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16142 (Fformat): Avoid the prepass trying to compute sizes; it was only
16143 approximate and thus did not catch overflow reliably. Instead, walk
16144 through the format just once, formatting and computing sizes as we go,
16145 checking for integer overflow at every step, and allocating a larger
16146 buffer as needed. Keep track separately whether the format is
16147 multibyte. Keep only the most-recently calculated precision, rather
16148 than them all. Record whether each argument has been converted to
16149 string. Use EMACS_INT, not int, for byte and char and arg counts.
16150 Support field widths and precisions larger than INT_MAX. Avoid
16151 sprintf's undefined behavior with conversion specifications such as %#d
16152 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16153 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16154 formatting out-of-range floating point numbers with int
16155 formats. (Bug#8668)
16156
16157 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16158
16159 * data.c: Avoid integer truncation in expressions involving floats.
16160 * data.c: Include <intprops.h>.
16161 (arith_driver): When there's an integer overflow in an expression
16162 involving floating point, convert the integers to floating point
16163 so that the resulting value does not suffer from catastrophic
16164 integer truncation. For example, on a 64-bit host (* 4
16165 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16166 Do not rely on undefined behavior after integer overflow.
16167
16168 merge count_size_as_multibyte, parse_str_to_multibyte
16169 * character.c, character.h (count_size_as_multibyte):
16170 Rename from parse_str_to_multibyte; all uses changed.
16171 Check for integer overflow.
16172 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16173 since it's now a duplicate of the other. This is more of
16174 a character than a buffer op, so better that it's in character.c.
16175 * fns.c, print.c: Adjust to above changes.
16176
16177 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16178
16179 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16180
16181 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16182
16183 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16184 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16185 (x_clipboard_manager_save): Now static.
16186 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16187
16188 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16189 (crypto_hash_function): Now static.
16190 Fix pointer signedness problems. Avoid unnecessary initializations.
16191
16192 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16193
16194 * termhooks.h (Vselection_alist): Make it terminal-local.
16195
16196 * terminal.c (create_terminal): Initialize it.
16197
16198 * xselect.c: Support for clipboard managers.
16199 (Vselection_alist): Move to termhooks.h as terminal-local var.
16200 (LOCAL_SELECTION): New macro.
16201 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16202 (symbol_to_x_atom): Remove gratuitous arg.
16203 (x_handle_selection_request, lisp_data_to_selection_data)
16204 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16205 (x_own_selection, x_get_local_selection, x_convert_selection):
16206 New arg, specifying work frame. Use terminal-local Vselection_alist.
16207 (some_frame_on_display): Delete unused function.
16208 (Fx_own_selection_internal, Fx_get_selection_internal)
16209 (Fx_disown_selection_internal, Fx_selection_owner_p)
16210 (Fx_selection_exists_p): New optional frame arg.
16211 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16212 (x_handle_selection_clear): Don't treat other terminals with the
16213 same keyboard specially. Use the terminal-local Vselection_alist.
16214 (x_clear_frame_selections): Use Frun_hook_with_args.
16215
16216 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16217
16218 * xterm.h: Add support for those atoms.
16219
16220 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16221
16222 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16223 (converted_selections, conversion_fail_tag): New global variables.
16224 (x_selection_request_lisp_error): Free the above.
16225 (x_get_local_selection): Remove unnecessary code.
16226 (x_reply_selection_request): Args changed; handle arbitrary array
16227 of converted selections stored in converted_selections.
16228 Separate the XChangeProperty and SelectionNotify steps.
16229 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16230 (x_convert_selection): New function.
16231 (x_handle_selection_event): Simplify.
16232 (x_get_foreign_selection): Don't ignore incoming requests while
16233 waiting for an answer; this will fail when we implement
16234 SAVE_TARGETS, and seems unnecessary anyway.
16235 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16236 (Vx_sent_selection_functions): Doc fix.
16237
16238 2011-05-26 Leo Liu <sdl.web@gmail.com>
16239
16240 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16241
16242 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16243
16244 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16245
16246 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16247 for fringe update if it has periodic bitmap.
16248 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16249 and fringe_bitmap_periodic_p.
16250
16251 * fringe.c (get_fringe_bitmap_data): New function.
16252 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16253 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16254 row. Mark glyph row for fringe update if periodicity changed.
16255
16256 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16257 for fringe update unless it has periodic bitmap.
16258
16259 2011-05-25 Kenichi Handa <handa@m17n.org>
16260
16261 * xdisp.c (get_next_display_element): Set correct it->face_id for
16262 a static composition.
16263
16264 2011-05-24 Leo Liu <sdl.web@gmail.com>
16265
16266 * deps.mk (fns.o):
16267 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16268
16269 * fns.c (crypto_hash_function, Fsha1): New function.
16270 (Fmd5): Use crypto_hash_function.
16271 (syms_of_fns): Add Ssha1.
16272
16273 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16274
16275 * gnutls.c: Remove unused macros.
16276 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16277 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16278 Remove macros that are defined and never used.
16279 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16280
16281 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16282
16283 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16284 (Fx_get_selection_internal): Minor cleanup.
16285 (Fx_own_selection_internal): Rename arguments for consistency with
16286 select.el.
16287
16288 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16289
16290 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16291
16292 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16293
16294 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16295
16296 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16297
16298 * dispnew.c (scrolling_window): Don't exclude the case that the
16299 last enabled row in the desired matrix touches the bottom boundary.
16300
16301 2011-05-21 Glenn Morris <rgm@gnu.org>
16302
16303 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16304 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16305 and add some more files.
16306
16307 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16308
16309 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16310 report_file_error introduced by the change from 2011-05-07.
16311
16312 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16313
16314 * systime.h (Time): Define only if emacs is defined.
16315 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16316 where the include path doesn't have X11/X.h by default. See
16317 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16318
16319 2011-05-20 Kenichi Handa <handa@m17n.org>
16320
16321 * composite.c (find_automatic_composition): Fix previous change.
16322
16323 2011-05-20 Glenn Morris <rgm@gnu.org>
16324
16325 * lisp.mk: New file, split from Makefile.in.
16326 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16327 (shortlisp): Remove.
16328 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16329
16330 2011-05-19 Glenn Morris <rgm@gnu.org>
16331
16332 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16333 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16334 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16335 (lisp): Set the order to that of loadup.el.
16336 (shortlisp): Make it a copy of $lisp.
16337 (SOME_MACHINE_LISP): Remove.
16338 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16339 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16340
16341 2011-05-18 Kenichi Handa <handa@m17n.org>
16342
16343 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16344 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16345 (find_automatic_composition): Mostly rewrite for efficiency.
16346
16347 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16348
16349 * makefile.w32-in: Update dependencies.
16350
16351 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16352
16353 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16354 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16355
16356 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16357
16358 Fix some integer overflow issues, such as string length overflow.
16359
16360 * insdel.c (count_size_as_multibyte): Check for string overflow.
16361
16362 * character.c (lisp_string_width): Check for string overflow.
16363 Use EMACS_INT, not int, for string indexes and lengths; in
16364 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16365 the resulting string length overflows an EMACS_INT; instead,
16366 report a string overflow if no precision given. When checking for
16367 precision exhaustion, use a check that cannot possibly have
16368 integer overflow. (Bug#8675)
16369 * character.h (lisp_string_width): Adjust to new signature.
16370
16371 * alloc.c (string_overflow): New function.
16372 (Fmake_string): Use it. This doesn't change behavior, but saves
16373 a few bytes and will simplify future changes.
16374 * character.c (string_escape_byte8): Likewise.
16375 * lisp.h (string_overflow): New decl.
16376
16377 Fixups, following up to the user-interface timestamp change.
16378 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16379 for UI timestamps, instead of unsigned long.
16380 * msdos.c (mouse_get_pos): Likewise.
16381 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16382 * w32gui.h (Time): Define by including "systime.h" rather than by
16383 declaring it ourselves. (Bug#8664)
16384
16385 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16386 * image.c (clear_image_cache): Likewise.
16387
16388 * term.c (term_mouse_position): Don't assume time_t wraparound.
16389
16390 Be more systematic about user-interface timestamps.
16391 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16392 and sometimes 'EMACS_UINT', to represent these timestamps.
16393 This change causes it to use 'Time' uniformly, as that's what X uses.
16394 This makes the code easier to follow, and makes it easier to catch
16395 integer overflow bugs such as Bug#8664.
16396 * frame.c (Fmouse_position, Fmouse_pixel_position):
16397 Use Time, not unsigned long, for user-interface timestamps.
16398 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16399 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16400 * keyboard.h (last_event_timestamp): Likewise.
16401 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16402 * menu.h (xmenu_show): Likewise.
16403 * term.c (term_mouse_position): Likewise.
16404 * termhooks.h (struct input_event.timestamp): Likewise.
16405 (struct terminal.mouse_position_hook): Likewise.
16406 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16407 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16408 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16409 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16410 what it was before.
16411 * menu.h, termhooks.h: Include "systime.h", for Time.
16412
16413 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16414 Don't assume that the difference between two unsigned long values
16415 can fit into an integer. At this point, we know button_down_time
16416 <= event->timestamp, so the difference must be nonnegative, so
16417 there's no need to cast the result if double-click-time is
16418 nonnegative, as it should be; check that it's nonnegative, just in
16419 case. This bug is triggered when events are more than 2**31 ms
16420 apart (about 25 days). (Bug#8664)
16421
16422 * xselect.c (last_event_timestamp): Remove duplicate decl.
16423 (x_own_selection): Remove needless cast to unsigned long.
16424
16425 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16426 that always fit in int. Use a sentinel instead of a counter, to
16427 avoid a temp and to allay GCC's concerns about possible int overflow.
16428 * frame.h (struct frame): Use int for menu_bar_items_used
16429 instead of EMACS_INT, since it always fits in int.
16430
16431 * menu.c (grow_menu_items): Check for int overflow.
16432
16433 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16434
16435 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16436 Before, the code was not consistent. These values cannot exceed
16437 2**31 - 1 so there's no need to make them unsigned.
16438 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16439 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16440 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16441 as modifiers.
16442 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16443
16444 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16445 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16446 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16447 presumably because the widths might not match.
16448
16449 * window.c (size_window): Avoid needless test at loop start.
16450
16451 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16452
16453 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16454
16455 2011-05-12 Drew Adams <drew.adams@oracle.com>
16456
16457 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16458
16459 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16460
16461 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16462 `width' to `bar_area_x' and `bar_area_width', respectively.
16463 (x_scroll_run): Take account of fringe background extension.
16464
16465 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16466 Rename local vars `left' and `width' to `bar_area_x' and
16467 `bar_area_width', respectively.
16468 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16469 background extension.
16470
16471 2011-05-10 Jim Meyering <meyering@redhat.com>
16472
16473 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16474
16475 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16476
16477 * image.c (Finit_image_library): Return t for built-in image types,
16478 like pbm and xbm. (Bug#8640)
16479
16480 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16481
16482 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16483
16484 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16485
16486 * w32console.c (Fset_screen_color): Doc fix.
16487 (Fget_screen_color): New function.
16488 (syms_of_ntterm): Defsubr it.
16489
16490 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16491 unlink the temporary file if Fcall_process didn't create it in the
16492 first place.
16493 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16494 child process will be redirected to a file specified with `:file'.
16495 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16496 cue to call_process_cleanup not to close that handle.
16497
16498 2011-05-07 Ben Key <bkey76@gmail.com>
16499
16500 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16501 one of two shell specific rules, either bootstrap-temacs-CMD or
16502 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16503 to the previous implementation of the bootstrap-temacs rule.
16504 The bootstrap-temacs-CMD rule is similar to the previous
16505 implementation of the bootstrap-temacs rule except that it
16506 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16507 variable.
16508
16509 These changes, along with some changes to nt/configure.bat,
16510 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16511 earlier fix to add support for --cflags and --ldflags options
16512 that include quotes so that it works whether make uses cmd or
16513 sh as the shell.
16514
16515 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16516
16517 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16518 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16519 is a constant.
16520 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16521 a string. Handle both cases.
16522 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16523 (Fdbus_register_method): Use Qinvalid_function.
16524
16525 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16526
16527 * makefile.w32-in: Update dependencies.
16528 (LISP_H): Add inttypes.h and stdin.h.
16529 (PROCESS_H): Add unistd.h.
16530
16531 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16532
16533 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16534 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16535
16536 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16537
16538 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16539
16540 * term.c (vfatal): Remove stray call to va_end.
16541 It's not needed and the C Standard doesn't allow it here anyway.
16542
16543 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16544 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16545
16546 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16547 bytes.
16548
16549 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16550
16551 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16552
16553 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16554
16555 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16556
16557 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16558
16559 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16560 * charset.c (Fdefine_charset_internal): Don't initialize
16561 charset.code_space[15]. The value was garbage, on hosts with
16562 32-bit int (Bug#8600).
16563
16564 * lread.c (read_integer): Be more consistent with string-to-number.
16565 Use string_to_number to do the actual conversion; this avoids
16566 rounding errors and fixes some other screwups. Without this fix,
16567 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16568 (digit_to_number): Move earlier, for benefit of read_integer.
16569 Return -1 if the digit is out of range for the base, -2 if it is
16570 not a digit in any supported base. (Bug#8602)
16571
16572 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16573
16574 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16575 to match comment at start of function. This also removes a
16576 GCC warning about overflow in a 32+64-bit port.
16577
16578 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16579
16580 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16581 Reported by Stefan Monnier in
16582 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16583 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16584 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16585
16586 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16587 (EMACS_UINTPTR): Likewise, with uintptr_t.
16588
16589 * lisp.h: Prefer 64-bit EMACS_INT if available.
16590 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16591 on 32-bit hosts that have 64-bit int, so that they can access
16592 large files.
16593 However, temporarily disable this change unless the temporary
16594 symbol WIDE_EMACS_INT is defined.
16595
16596 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16597
16598 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16599 This removes an assumption that EMACS_INT and long are the same
16600 width as pointers. The assumption is true for Emacs porting targets
16601 now, but we want to make other targets possible.
16602 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16603 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16604 In the rest of the code, change types of integers that hold casted
16605 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16606 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16607 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16608 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16609 No need to cast type when ORing.
16610 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16611 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16612 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16613 assume EMACS_INT is the same width as char *.
16614 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16615 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16616 Remove no-longer-needed casts.
16617 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16618 (xg_tool_bar_help_callback, xg_make_tool_item):
16619 Use EMACS_INTPTR to hold an integer
16620 that will be cast to void *; this can avoid a GCC warning
16621 if EMACS_INT is not the same width as void *.
16622 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16623 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16624 (current_message_1, set_message_1):
16625 Use a local to convert to proper width without a cast.
16626 * xmenu.c (dialog_selection_callback): Likewise.
16627
16628 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16629 Also, don't assume VALBITS / RAND_BITS is less than 5,
16630 and don't rely on undefined behavior when shifting a 1 left into
16631 the sign bit.
16632 * lisp.h (get_random): Change signature to match.
16633
16634 * lread.c (hash_string): Use size_t, not int, for hash computation.
16635 Normally we prefer signed values; but hashing is special, because
16636 it's better to use unsigned division on hash table sizes so that
16637 the remainder is nonnegative. Also, size_t is the natural width
16638 for hashing into memory. The previous code used 'int', which doesn't
16639 retain enough info to hash well into very large tables.
16640 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16641
16642 * dbusbind.c: Don't possibly lose pointer info when converting.
16643 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16644 Use XPNTR rather than XHASH, so that the high-order bits of
16645 the pointer aren't lost when converting through void *.
16646
16647 * eval.c (Fautoload): Don't double-shift a pointer.
16648
16649 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16650
16651 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16652
16653 * gnutls.c (DEF_GNUTLS_FN):
16654 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16655
16656 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16657
16658 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16659 marker. (Bug#8610)
16660
16661 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16662
16663 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16664 New version that can reserve upto 2GB of heap space.
16665
16666 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16667
16668 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16669
16670 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16671
16672 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16673 `gnutls_certificate_set_x509_key_file'.
16674
16675 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16676
16677 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16678 Update dependencies.
16679
16680 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16681
16682 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16683 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16684 Remove unused parameter `fildes'.
16685 * process.c (read_process_output, send_process): Don't pass it.
16686
16687 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16688
16689 Fix previous change: the library cache is defined in w32.c.
16690 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16691 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16692
16693 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16694
16695 Implement dynamic loading of GnuTLS on Windows.
16696
16697 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16698 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16699 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16700 Declare.
16701
16702 * gnutls.c (Qgnutls_dll): Define.
16703 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16704 (gnutls_*): Declare function pointers.
16705 (init_gnutls_functions): New function to initialize function pointers.
16706 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16707 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16708 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16709 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16710 (emacs_gnutls_write, emacs_gnutls_read)
16711 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16712 (Fgnutls_available_p): New function.
16713 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16714 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16715 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16716
16717 * image.c: Include w32.h.
16718 (Vimage_type_cache): Delete.
16719 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16720 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16721 (w32_delayed_load): Move to w32.c.
16722
16723 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16724
16725 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16726 (w32_delayed_load): Move from image.c. When loading a library, record
16727 its filename in the :loaded-from property of the library id.
16728 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16729 Initialize and staticpro them.
16730 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16731
16732 * process.c: Include lisp.h before w32.h, not after.
16733 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16734 instead of gnutls_record_check_pending.
16735
16736 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16737
16738 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16739
16740 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16741 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16742 as passed in.
16743
16744 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16745
16746 * xterm.c (x_set_frame_alpha): Do not set property on anything
16747 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16748
16749 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16750
16751 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16752
16753 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16754
16755 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16756 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16757 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16758 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16759 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16760 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16761 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16762 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16763 (Qgnutls_bootprop_callbacks_verify): Make static.
16764
16765 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16766
16767 * callproc.c: Indentation fixup.
16768
16769 * sysdep.c (wait_for_termination_1): Make static.
16770 (wait_for_termination, interruptible_wait_for_termination):
16771 Move after wait_for_termination_1.
16772
16773 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16774
16775 * sysdep.c (interruptible_wait_for_termination): New function
16776 which is like wait_for_termination, but allows keyboard
16777 interruptions.
16778
16779 * callproc.c (Fcall_process): Add (:file "file") as an option for
16780 the STDOUT buffer.
16781 (Fcall_process_region): Ditto.
16782
16783 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16784
16785 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16786 rather than `XVECTOR (FOO)->size'.
16787
16788 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16789 inttypes.h, as a gnulib replacement is used if it not available in
16790 system headers.
16791
16792 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16793
16794 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16795 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16796 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16797
16798 * coding.c (coding_alloc_by_realloc): Error out if destination
16799 will grow beyond MOST_POSITIVE_FIXNUM.
16800 (decode_coding_emacs_mule): Abort if there isn't enough place in
16801 charbuf for the composition carryover bytes. Reserve an extra
16802 space for up to 2 characters produced in a loop.
16803 (decode_coding_iso_2022): Abort if there isn't enough place in
16804 charbuf for the composition carryover bytes.
16805
16806 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16807
16808 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16809 aborting when %lld or %lll format is passed.
16810 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16811 %llo or %llx format is passed. (Bug#8545)
16812
16813 * window.c (window_scroll_line_based): Use a marker instead of
16814 simple variables to record original value of point. (Bug#7952)
16815
16816 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16817 produced by %s or %c overflows available buffer space. (Bug#8545)
16818
16819 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16820
16821 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16822 (SIZE_MAX): Move defn after all includes, as they might #define it.
16823
16824 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16825
16826 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16827
16828 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16829
16830 * keyboard.c (Qdelayed_warnings_hook): Define.
16831 (command_loop_1): Run `delayed-warnings-hook'
16832 if Vdelayed_warnings_list is non-nil.
16833 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16834 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16835
16836 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16837
16838 * doprnt.c (doprnt): Don't return value smaller than the buffer
16839 size if the message was truncated. (Bug#8545).
16840
16841 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16842
16843 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16844 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16845
16846 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16847
16848 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16849
16850 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16851
16852 * makefile.w32-in: Update dependencies.
16853
16854 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16855
16856 Improve `doprnt' and its usage. (Bug#8545)
16857 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16858 `format_end'. Remove support for %l as a conversion specifier.
16859 Don't use xrealloc. Improve diagnostics when the %l size modifier
16860 is used. Update the commentary.
16861
16862 * eval.c (verror): Simplify calculation of size_t.
16863
16864 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16865 messages.
16866
16867 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16868
16869 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16870 change.
16871
16872 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16873
16874 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16875 This makes this file independent of the recent pseudovector change.
16876
16877 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16878
16879 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16880
16881 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16882 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16883 Remove unused local.
16884 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16885
16886 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16887 GCC 4.6.0 optimizes based on type-based alias analysis.
16888 For example, if b is of type struct buffer * and v of type struct
16889 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16890 != &v->size, and therefore "v->size = 1; b->size = 2; return
16891 v->size;" must therefore return 1. This assumption is incorrect
16892 for Emacs, since it type-puns struct Lisp_Vector * with many other
16893 types. To fix this problem, this patch adds a new type struct
16894 vectorlike_header that documents the constraints on layout of vectors
16895 and pseudovectors, and helps optimizing compilers not get fooled
16896 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16897 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16898 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16899 the size member.
16900 (XSETPVECTYPE): Rewrite in terms of new macro.
16901 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16902 This is a bit clearer, and further avoids the possibility of
16903 undesirable aliasing.
16904 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16905 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16906 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16907 since Lisp_Subr is a special case (no "next" field).
16908 (ASIZE): Now uses header.size rather than size.
16909 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16910 to avoid the hassle of writing XVECTOR (foo)->header.size.
16911 (struct vectorlike_header): New type.
16912 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16913 object, to help avoid aliasing.
16914 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16915 (SUBRP): Likewise, since Lisp_Subr is a special case.
16916 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16917 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16918 (struct Lisp_Hash_Table): Combine first two members into a single
16919 struct vectorlike_header member. All uses of "size" and "next" members
16920 changed to be "header.size" and "header.next".
16921 * buffer.h (struct buffer): Likewise.
16922 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16923 * frame.h (struct frame): Likewise.
16924 * process.h (struct Lisp_Process): Likewise.
16925 * termhooks.h (struct terminal): Likewise.
16926 * window.c (struct save_window_data, struct saved_window): Likewise.
16927 * window.h (struct window): Likewise.
16928 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16929 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16930 * buffer.c (init_buffer_once): Likewise.
16931 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16932 special case.
16933 * process.c (Fformat_network_address): Use local var for size,
16934 for brevity.
16935
16936 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16937
16938 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16939 * data.c (atof): Remove decl; no longer used or needed.
16940 (digit_to_number): Move to lread.c.
16941 (Fstring_to_number): Use new string_to_number function, to be
16942 consistent with how the Lisp reader treats infinities and NaNs.
16943 Do not assume that floating-point numbers represent EMACS_INT
16944 without losing information; this is not true on most 64-bit hosts.
16945 Avoid double-rounding errors, by insisting on integers when
16946 parsing non-base-10 numbers, as the documentation specifies.
16947 * lisp.h (string_to_number): New decl, replacing ...
16948 (isfloat_string): Remove.
16949 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16950 (read1): Do not accept +. and -. as integers; this
16951 appears to have been a coding error. Similarly, do not accept
16952 strings like +-1e0 as floating point numbers. Do not report
16953 overflow for integer overflows unless the base is not 10 which
16954 means we have no simple and reliable way to continue.
16955 Break out the floating-point parsing into a new
16956 function string_to_number, so that Fstring_to_number parses
16957 floating point numbers consistently with the Lisp reader.
16958 (digit_to_number): Move here from data.c. Make it static inline.
16959 (E_CHAR, EXP_INT): Remove, replacing with ...
16960 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16961 (string_to_number): New function, replacing isfloat_string.
16962 This function checks for valid syntax and produces the resulting
16963 Lisp float number too. Rework it so that string-to-number
16964 no longer mishandles examples like "1.0e+". Use strtoumax,
16965 so that overflow for non-base-10 numbers is reported only when
16966 there's no portable and simple way to convert to floating point.
16967
16968 * textprop.c (set_text_properties_1): Rewrite for clarity,
16969 and to avoid GCC warning about integer overflow.
16970
16971 * intervals.h (struct interval): Use EMACS_INT for members
16972 where EMACS_UINT might cause problems. See
16973 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16974 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16975 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16976 All uses changed.
16977 (offset_intervals): Tell GCC not to worry about length overflow
16978 when negating a negative length.
16979
16980 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16981 (overrun_check_free): Likewise.
16982
16983 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16984 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16985 word size.
16986
16987 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16988 (gnutls_make_error): Rename local to avoid shadowing.
16989 (gnutls_emacs_global_deinit): ifdef out; not used.
16990 (Fgnutls_boot): Use const for pointer to readonly storage.
16991 Comment out unused local. Fix pointer signedness problems.
16992
16993 * lread.c (openp): Don't stuff size_t into an 'int'.
16994 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16995 about possible signed overflow.
16996
16997 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16998 (GDK_KEY_g): Don't define if already defined.
16999 (xg_prepare_tooltip): Avoid pointer signedness problem.
17000 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17001
17002 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17003 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17004
17005 * xfns.c (Fx_window_property): Simplify a bit,
17006 to make a bit faster and to avoid GCC 4.6.0 warning.
17007 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17008
17009 * fns.c (internal_equal): Don't assume size_t fits in int.
17010
17011 * alloc.c (compact_small_strings): Tighten assertion a little.
17012
17013 Replace pEd with more-general pI, and fix some printf arg casts.
17014 * lisp.h (pI): New macro, generalizing old pEd macro to other
17015 conversion specifiers. For example, use "...%"pI"d..." rather
17016 than "...%"pEd"...".
17017 (pEd): Remove. All uses replaced with similar uses of pI.
17018 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17019 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17020 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17021 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17022 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17023 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17024 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17025 64-bit hosts.
17026 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17027 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17028 * print.c (safe_debug_print, print_object): Likewise.
17029 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17030 to int.
17031 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17032 avoiding the 0 flag, which is not portable.
17033 * process.c (Fmake_network_process): Use pI to avoid cast.
17034 * region-cache.c (pp_cache): Likewise.
17035 * xdisp.c (decode_mode_spec): Likewise.
17036 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17037 behavior on 64-bit hosts with printf arg.
17038 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17039 (x_stop_queuing_selection_requests): Likewise.
17040 (x_get_window_property): Don't truncate byte count to an 'int'
17041 when tracing.
17042
17043 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17044 here, since it parses constructs like leading '-' and spaces,
17045 which are not wanted; and it overflows with large numbers.
17046 Instead, simply match F[0-9]+, which is what is wanted anyway.
17047
17048 * alloc.c: Remove unportable assumptions about struct layout.
17049 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17050 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17051 (allocate_vectorlike, make_pure_vector): Use the new macros,
17052 plus offsetof, to remove unportable assumptions about struct layout.
17053 These assumptions hold on all porting targets that I know of, but
17054 they are not guaranteed, they're easy to remove, and removing them
17055 makes further changes easier.
17056
17057 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17058 This doesn't fix a bug but makes the code clearer.
17059 (string_overrun_cookie): Now const. Use initializers that
17060 don't formally overflow signed char, to avoid warnings.
17061 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17062 can cause Emacs to crash when string overrun checking is enabled.
17063 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17064 multiple of sizeof (EMACS_INT); it need not be, if
17065 alignof(EMACS_INT) < sizeof (EMACS_INT).
17066 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17067
17068 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17069
17070 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17071
17072 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17073
17074 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17075 supposed to be handshaking. (Bug#8556)
17076 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17077
17078 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17079
17080 * lisp.h (Qdebug): List symbol.
17081 * eval.c (Qdebug): Restore global linkage.
17082 * keyboard.c (debug-on-event): New variable.
17083 (handle_user_signal): Break into debugger when debug-on-event
17084 matches the current signal symbol.
17085
17086 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17087
17088 * alloc.c (check_sblock, check_string_bytes)
17089 (check_string_free_list): Convert to standard C.
17090
17091 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17092
17093 * w32.c (emacs_gnutls_push): Fix typo.
17094
17095 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17096
17097 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17098 "cast to pointer from integer of different size".
17099
17100 Improve doprnt and its use in verror. (Bug#8545)
17101 * doprnt.c (doprnt): Document the set of format control sequences
17102 supported by the function. Use SAFE_ALLOCA instead of always
17103 using `alloca'.
17104
17105 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17106 is one byte too soon. Don't use xrealloc; instead xfree and
17107 xmalloc anew.
17108
17109 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17110
17111 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17112 callbacks stage.
17113
17114 * gnutls.c: Renamed global_initialized to
17115 gnutls_global_initialized. Added internals for the
17116 :verify-hostname-error, :verify-error, and :verify-flags
17117 parameters of `gnutls-boot' and documented those parameters in the
17118 docstring. Start callback support.
17119 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17120 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17121 on error. Return error code.
17122 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17123 (emacs_gnutls_read): Likewise.
17124 (Fgnutls_boot): Return handshake error code.
17125 (emacs_gnutls_handle_error): New function.
17126 (wsaerror_to_errno): Likewise.
17127
17128 * w32.h (emacs_gnutls_pull): Add prototype.
17129 (emacs_gnutls_push): Likewise.
17130
17131 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17132 (emacs_gnutls_push): Likewise.
17133
17134 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17135
17136 * process.c (wait_reading_process_output): Check if GnuTLS
17137 buffered some data internally if no FDs are set for TLS
17138 connections.
17139
17140 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17141 (LIBS): Link to USER_LIBS.
17142 ($(BLD)/gnutls.$(0)): New target.
17143
17144 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17145
17146 * xdisp.c (handle_single_display_spec): Rename the
17147 display_replaced_before_p argument into display_replaced_p, to
17148 make it consistent with the commentary. Fix typos in the
17149 commentary.
17150
17151 * textprop.c (syms_of_textprop): Remove dead code.
17152 (copy_text_properties): Delete obsolete commentary about an
17153 interface that was deleted long ago. Fix typos in the description
17154 of arguments.
17155
17156 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17157 to changes in oldXMenu/XMenu.h from 2011-04-16.
17158 <menu_help_message, prev_menu_help_message>: Constify.
17159 (IT_menu_make_room): menu->help_text is now `const char **';
17160 adjust.
17161
17162 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17163 to changes in oldXMenu/XMenu.h from 2011-04-16.
17164 (struct XMenu): Declare `help_text' `const char **'.
17165
17166 * xfaces.c <Qunspecified>: Make extern again.
17167
17168 * syntax.c: Include sys/types.h before including regex.h, as
17169 required by POSIX.
17170
17171 * doc.c (get_doc_string): Improve the format passed to `error'.
17172
17173 * doprnt.c (doprnt): Improve commentary.
17174
17175 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17176
17177 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17178 them with etags.
17179
17180 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17181 changes in globals.h immediately force recompilation.
17182 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17183 $(CURDIR)/s/ms-w32.h.
17184 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17185
17186 * character.c (Fchar_direction): Function deleted.
17187 (syms_of_character): Don't defsubr it.
17188 <char-direction-table>: Deleted.
17189
17190 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17191
17192 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17193 * doprnt.c: Include limits.h.
17194 (SIZE_MAX): New macro.
17195 (doprnt): Return a size_t value. 2nd arg is now size_t.
17196 Many local variables are now size_t instead of int or unsigned.
17197 Improve overflow protection. Support `l' modifier for integer
17198 conversions. Support %l conversion. Don't assume an EMACS_INT
17199 argument for integer conversions and for %c.
17200
17201 * lisp.h (doprnt): Restore prototype.
17202
17203 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17204 $(SRC)/character.h.
17205
17206 * Makefile.in (base_obj): Add back doprnt.o.
17207
17208 * deps.mk (doprnt.o): Add back prerequisites.
17209 (callint.o): Depend on character.h.
17210
17211 * eval.c (internal_lisp_condition_case): Include the handler
17212 representation in the error message.
17213 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17214 when breaking from the loop.
17215
17216 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17217
17218 * callint.c (Fcall_interactively): When displaying error message
17219 about invalid control letter, pass the character's codepoint, not
17220 a pointer to its multibyte form. Improve display of the character
17221 in octal and display also its hex code.
17222
17223 * character.c (char_string): Use %x to display the (unsigned)
17224 codepoint of an invalid character, to avoid displaying a bogus
17225 negative value.
17226
17227 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17228 `error', not SYMBOL_NAME itself.
17229
17230 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17231 character arguments to `error'.
17232
17233 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17234 to `error' in error message about FINAL_CHAR argument. Make sure
17235 FINAL_CHAR is a character, and use %c when it is passed as
17236 argument to `error'.
17237
17238 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17239
17240 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17241
17242 * w32.c: Include <time.h>.
17243 (sys_localtime): New function.
17244
17245 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17246
17247 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17248
17249 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17250
17251 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17252
17253 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17254 zombies (Bug#8467).
17255
17256 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17257
17258 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17259 gl_state.e_property when gl_state.object is Qt.
17260
17261 * insdel.c (make_gap_larger): Remove limitation of buffer size
17262 to <= INT_MAX.
17263
17264 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17265
17266 * xdisp.c (lookup_glyphless_char_display)
17267 (produce_glyphless_glyph): Handle cons cell entry in
17268 glyphless-char-display.
17269 (Vglyphless_char_display): Document it.
17270
17271 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17272 glyphless-char-display.
17273
17274 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17275
17276 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17277
17278 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17279
17280 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17281 definition for no-X builds.
17282
17283 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17284
17285 Static checks with GCC 4.6.0 and non-default toolkits.
17286
17287 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17288
17289 * process.c (keyboard_bit_set): Define only if SIGIO.
17290 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17291 (send_process): Repair possible setjmp clobbering.
17292
17293 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17294
17295 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17296
17297 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17298
17299 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17300 Define only if needed.
17301
17302 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17303 by pacifying GCC about it. Maybe it's time to retire it?
17304 * xfaces.c (USG, __TIMEVAL__): Likewise.
17305
17306 * dispextern.h (struct redisplay_interface): Rename param
17307 to avoid shadowing.
17308 * termhooks.h (struct terminal): Likewise.
17309 * xterm.c (xembed_send_message): Likewise.
17310
17311 * insdel.c (make_gap_smaller): Define only if
17312 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17313
17314 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17315 it.
17316
17317 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17318 so that we aren't warned about unused symbols.
17319
17320 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17321
17322 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17323
17324 * xfns.c (x_real_positions): Mark locals as initialized.
17325
17326 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17327
17328 * xterm.c: Fix problems found by static analysis with other toolkits.
17329 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17330 (x_dispatch_event): Declare static if USE_GTK, and
17331 define if USE_GTK || USE_X_TOOLKIT.
17332 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17333 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17334 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17335 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17336
17337 * xmenu.c (menu_help_callback): Pointer type fixes.
17338 Use const pointers when pointing at readonly data. Avoid pointer
17339 signedness clashes.
17340 (FALSE): Remove unused macro.
17341 (update_frame_menubar): Remove unused decl.
17342
17343 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17344
17345 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17346 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17347 (single_menu_item): Rename local to avoid shadowing.
17348
17349 * keyboard.c (make_lispy_event): Remove unused local var.
17350
17351 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17352 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17353
17354 * bitmaps: Change bitmaps from unsigned char back to the X11
17355 compatible char. Avoid the old compiler warnings about
17356 out-of-range initializers by using, for example, '\xab' rather
17357 than 0xab.
17358
17359 * xgselect.c (xgselect_initialize): Check vs interface
17360 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17361
17362 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17363
17364 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17365 to read-only memory.
17366
17367 * fns.c (vector): Remove; this old hack is no longer needed.
17368
17369 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17370 Remove unused var.
17371 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17372
17373 * xrdb.c (x_load_resources): Omit unused local.
17374
17375 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17376 (x_window): Rename locals to avoid shadowing.
17377 (USG): Use the kludged USG macro, to pacify gcc.
17378
17379 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17380 (x_term_init): Remove local to avoid shadowing.
17381
17382 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17383
17384 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17385 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17386
17387 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17388
17389 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17390
17391 Fix regex.c, syntax.c and friends for buffers > 2GB.
17392 * syntax.h (struct gl_state_s): Declare character position members
17393 EMACS_INT.
17394
17395 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17396
17397 * textprop.c (verify_interval_modification, interval_of):
17398 Declare arguments EMACS_INT.
17399
17400 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17401 EMACS_INT.
17402
17403 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17404
17405 * indent.c (Fvertical_motion): Local variable it_start is now
17406 EMACS_INT.
17407
17408 * regex.c (re_match, re_match_2, re_match_2_internal)
17409 (bcmp_translate, regcomp, regexec, print_double_string)
17410 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17411 (re_compile_pattern, re_exec): Declare arguments and local
17412 variables `size_t' and `ssize_t' and return values `regoff_t', as
17413 appropriate.
17414 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17415 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17416 <compile_stack_type>: `size' and `avail' are now `size_t'.
17417
17418 * regex.h <regoff_t>: Use ssize_t, not int.
17419 (re_search, re_search_2, re_match, re_match_2): Arguments that
17420 specify buffer/string position and length are now ssize_t and
17421 size_t. Return type is regoff_t.
17422
17423 2011-04-16 Ben Key <bkey76@gmail.com>
17424
17425 * nsfont.m: Fixed bugs in ns_get_family and
17426 ns_descriptor_to_entity that were caused by using free to
17427 deallocate memory blocks that were allocated by xmalloc (via
17428 xstrdup). This caused Emacs to crash when compiled with
17429 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17430 --enable-checking=xmallocoverrun). xfree is now used to
17431 deallocate these memory blocks.
17432
17433 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17434
17435 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17436
17437 emacs_write: Accept and return EMACS_INT for sizes.
17438 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17439 et seq.
17440 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17441 Accept and return EMACS_INT.
17442 (emacs_gnutls_write): Return the number of bytes written on
17443 partial writes.
17444 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17445 (emacs_read, emacs_write): Remove check for negative size, as the
17446 Emacs source code has been audited now.
17447 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17448 (emacs_read, emacs_write): Use it.
17449 * process.c (send_process): Adjust to the new signatures of
17450 emacs_write and emacs_gnutls_write. Do not attempt to store
17451 a byte offset into an 'int'; it might overflow.
17452 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17453
17454 * sound.c: Don't assume sizes fit in 'int'.
17455 (struct sound_device.period_size, alsa_period_size):
17456 Return EMACS_INT, not int.
17457 (struct sound_device.write, vox_write, alsa_write):
17458 Accept EMACS_INT, not int.
17459 (wav_play, au_play): Use EMACS_INT to store sizes and to
17460 record read return values.
17461
17462 2011-04-15 Ben Key <bkey76@gmail.com>
17463
17464 * keyboard.c (Qundefined): Don't declare static since it is used
17465 in nsfns.m.
17466 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17467 static since they are used in nsfont.m.
17468
17469 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17470
17471 * process.c (Qprocessp): Don't declare static.
17472 * lisp.h (Qprocessp): Declare again.
17473
17474 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17475
17476 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17477
17478 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17479
17480 Improve C-level modularity by making more things 'static'.
17481
17482 Don't publish debugger-only interfaces to other modules.
17483 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17484 (verify_bytepos, count_markers): Move decls to the only modules
17485 that need them.
17486 * region-cache.h (pp_cache): Likewise.
17487 * window.h (check_all_windows): Likewise.
17488 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17489
17490 * sysdep.c (croak): Now static, if
17491 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17492 * syssignal.h (croak): Declare only if not static.
17493
17494 * alloc.c (refill_memory_reserve): Now static if
17495 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17496 * lisp.h (refill_memory_reserve): Declare only if not static.
17497
17498 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17499 Define only if USE_LUCID.
17500
17501 * xrdb.c (x_customization_string, x_rm_string): Now static.
17502
17503 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17504 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17505
17506 * xdisp.c (draw_row_with_mouse_face): Now static.
17507 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17508
17509 * window.h (check_all_windows): Mark externally visible.
17510
17511 * window.c (window_deletion_count): Now static.
17512
17513 * undo.c: Make symbols static if they're not exported.
17514 (last_undo_buffer, last_boundary_position, pending_boundary):
17515 Now static.
17516
17517 * textprop.c (interval_insert_behind_hooks): Now static.
17518 (interval_insert_in_front_hooks): Likewise.
17519
17520 * term.c: Make symbols static if they're not exported.
17521 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17522 (max_frame_lines, tty_set_terminal_modes):
17523 (tty_reset_terminal_modes, tty_turn_off_highlight):
17524 (get_tty_terminal): Now static.
17525 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17526 * termhooks.h (term_mouse_moveto): Do not declare if
17527 HAVE_WINDOW_SYSTEM.
17528 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17529 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17530
17531 * sysdep.c: Make symbols static if they're not exported.
17532 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17533 Now static.
17534 (sigprocmask_set, full_mask): Remove; unused.
17535 (wait_debugging): Mark as visible.
17536 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17537 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17538
17539 * syntax.c (syntax_temp): Define only if !__GNUC__.
17540
17541 * sound.c (current_sound_device, current_sound): Now static.
17542
17543 * search.c (searchbufs, searchbuf_head): Now static.
17544
17545 * scroll.c (scroll_cost): Remove; unused.
17546 * dispextern.h (scroll_cost): Remove decl.
17547
17548 * region-cache.h (pp_cache): Mark as externally visible.
17549
17550 * process.c: Make symbols static if they're not exported.
17551 (process_tick, update_tick, create_process, chan_process):
17552 (Vprocess_alist, proc_buffered_char, datagram_access):
17553 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17554 (deactivate_process): Mark defn as static, as well as decl.
17555 * lisp.h (create_process): Remove decl.
17556 * process.h (chan_process, Vprocess_alist): Remove decls.
17557
17558 * print.c: Make symbols static if they're not exported.
17559 (print_depth, new_backquote_output, being_printed, print_buffer):
17560 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17561 (print_interval, print_number_index, initial_stderr_stream):
17562 Now static.
17563 * lisp.h (Fprinc): Remove decl.
17564 (debug_output_compilation_hack): Mark as externally visible.
17565
17566 * sysdep.c (croak): Move decl from here to syssignal.h.
17567 * syssignal.h (croak): Put it here, so the API can be checked when
17568 'croak' is called from dissociate_if_controlling_tty.
17569
17570 * minibuf.c: Make symbols static if they're not exported.
17571 (minibuf_save_list, choose_minibuf_frame): Now static.
17572 * lisp.h (choose_minibuf_frame): Remove decl.
17573
17574 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17575
17576 * lread.c: Make symbols static if they're not exported.
17577 (read_objects, initial_obarray, oblookup_last_bucket_number):
17578 Now static.
17579 (make_symbol): Remove; unused.
17580 * lisp.h (initial_obarray, make_symbol): Remove decls.
17581
17582 * keyboard.c: Make symbols static if they're not exported.
17583 (single_kboard, recent_keys_index, total_keys, recent_keys):
17584 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17585 (this_single_command_key_start, echoing, last_auto_save):
17586 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17587 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17588 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17589 (Vlispy_mouse_stem, double_click_count):
17590 Now static.
17591 (force_auto_save_soon): Define only if SIGDANGER.
17592 (ignore_mouse_drag_p): Now static if
17593 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17594 (print_help): Remove; unused.
17595 (stop_character, last_timer_event): Mark as externally visible.
17596 * keyboard.h (ignore_mouse_drag_p): Declare only if
17597 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17598 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17599 * lisp.h (echoing): Remove decl.
17600 (force_auto_save_soon): Declare only if SIGDANGER.
17601 * xdisp.c (redisplay_window): Simplify code, to make it more
17602 obvious that ignore_mouse_drag_p is not accessed if !defined
17603 USE_GTK && !defined HAVE_NS.
17604
17605 * intervals.c: Make symbols static if they're not exported.
17606 (merge_properties_sticky, merge_interval_right, delete_interval):
17607 Now static.
17608 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17609
17610 * insdel.c: Make symbols static if they're not exported.
17611 However, leave prepare_to_modify_buffer alone. It's never
17612 called from outside this function, but that appears to be a bug.
17613 (combine_after_change_list, combine_after_change_buffer):
17614 (adjust_after_replace, signal_before_change): Now static.
17615 (adjust_after_replace_noundo): Remove; unused.
17616 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17617 (signal_before_change): Remove decls.
17618
17619 * indent.c (val_compute_motion, val_vmotion): Now static.
17620
17621 * image.c: Make symbols static if they're not exported.
17622 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17623 if USE_GTK.
17624 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17625 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17626
17627 * fringe.c (standard_bitmaps): Now static.
17628 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17629
17630 * frame.c: Make symbols static if they're not exported.
17631 (x_report_frame_params, make_terminal_frame): Now static.
17632 (get_frame_param): Now static, unless HAVE_NS.
17633 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17634 (x_get_resource_string): Remove; not used.
17635 * frame.h (make_terminal_frame, x_report_frame_params):
17636 (x_get_resource_string); Remove decls.
17637 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17638 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17639
17640 * font.c, fontset.c: Make symbols static if they're not exported.
17641 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17642 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17643 * font.c (font_close_object): Now static.
17644 * font.h (font_close_object): Remove.
17645 * fontset.c (FONTSET_OBJLIST): Remove.
17646 (free_realized_fontset) #if-0 the body, which does nothing.
17647 (face_suitable_for_char_p): #if-0, as it's never called.
17648 * fontset.h (face_suitable_for_char_p): Remove decl.
17649 * xfaces.c (face_at_string_position):
17650 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17651 since 0 is always ASCII.
17652
17653 * fns.c (weak_hash_tables): Now static.
17654
17655 * fileio.c: Make symbols static if they're not exported.
17656 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17657 (Vwrite_region_annotation_buffers): Now static.
17658
17659 * eval.c: Make symbols static if they're not exported.
17660 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17661 * lisp.h (backtrace_list): Remove decl.
17662
17663 * emacs.c: Make symbols static if they're not exported.
17664 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17665 (fatal_error_code, fatal_error_signal_hook, standard_args):
17666 Now static.
17667 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17668 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17669 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17670 * lisp.h (fatal_error_signal_hook): Remove decl.
17671 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17672
17673 * editfns.c: Move a (normally-unused) function to its only use.
17674 * editfns.c, lisp.h (get_operating_system_release): Remove.
17675 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17676 worth the hassle of breaking this out.
17677
17678 * xterm.c: Make symbols static if they're not exported.
17679 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17680 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17681 (x_destroy_window, x_delete_display):
17682 Now static.
17683 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17684 (x_mouse_leave): Remove; unused.
17685 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17686 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17687 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17688 Remove decls.
17689 (x_mouse_leave): Declare only if WINDOWSNT.
17690 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17691 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17692 USE_X_TOOLKIT.
17693
17694 * ftxfont.c: Make symbols static if they're not exported.
17695 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17696 HAVE_FREETYPE.
17697 * font.h (ftxfont_driver): Likewise.
17698
17699 * xfns.c: Make symbols static if they're not exported.
17700 (x_last_font_name, x_display_info_for_name):
17701 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17702 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17703 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17704 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17705 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17706 (last_show_tip_args): Now static.
17707 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17708 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17709 (x_screen_planes): Remove; unused.
17710 * dispextern.h (x_screen_planes): Remove decl.
17711
17712 * dispnew.c: Make symbols static if they're not exported.
17713 * dispextern.h (redraw_garbaged_frames, scrolling):
17714 (increment_row_positions): Remove.
17715 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17716 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17717 Now static.
17718 (redraw_garbaged_frames): Remove; unused.
17719
17720 * xfaces.c: Make symbols static if they're not exported.
17721 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17722 Remove decls.
17723 * xterm.h (defined_color): Remove decls.
17724 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17725 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17726 (menu_face_changed_default, defined_color, free_realized_face):
17727 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17728 (ascii_face_of_lisp_face): Remove; unused.
17729
17730 * xdisp.c: Make symbols static if they're not exported.
17731 * dispextern.h (scratch_glyph_row, window_box_edges):
17732 (glyph_to_pixel_coords, set_cursor_from_row):
17733 (get_next_display_element, set_iterator_to_next):
17734 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17735 (show_mouse_face): Remove decls
17736 * frame.h (message_buf_print): Likewise.
17737 * lisp.h (pop_message, set_message, check_point_in_composition):
17738 Likewise.
17739 * xterm.h (set_vertical_scroll_bar): Likewise.
17740 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17741 (message_buf_print, scratch_glyph_row, displayed_buffer):
17742 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17743 (get_next_display_element, show_mouse_face, window_box_edges):
17744 (frame_to_window_pixel_xy, check_point_in_composition):
17745 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17746 (glyph_to_pixel_coords): Remove; unused.
17747
17748 * dired.c (file_name_completion): Now static.
17749
17750 * dbusbind.c (xd_in_read_queued_messages): Now static.
17751
17752 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17753 * data.c (circular_list_error): Remove.
17754
17755 * commands.h (last_point_position, last_point_position_buffer):
17756 (last_point_position_window): Remove decls.
17757 * keyboard.c: Make these variables static.
17758
17759 * coding.h (coding, code_convert_region, encode_coding_gap):
17760 Remove decls.
17761 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17762 (iso_code_class, detect_coding, code_convert_region): Now static.
17763 (encode_coding_gap): Remove; unused.
17764
17765 * chartab.c (chartab_chars, chartab_bits): Now static.
17766
17767 * charset.h (charset_iso_8859_1): Remove decl.
17768 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17769 Now static.
17770
17771 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17772 * ccl.c (Vccl_program_table): Now static.
17773 (check_ccl_update): Remove; unused.
17774
17775 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17776 * category.h: ... from here.
17777 * category.c (check_category_table, set_category_set): Now static.
17778
17779 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17780 * lisp.h: Remove these decls.
17781
17782 * buffer.c (buffer_count): Remove unused var.
17783
17784 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17785 so that it's not optimized away.
17786 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17787 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17788 exported only to the debugger.
17789
17790 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17791 * atimer.h (run_all_atimers): Remove; not exported.
17792
17793 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17794 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17795 was inaccessible from Lisp.
17796 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17797 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17798
17799 alloc.c: Import and export fewer symbols, and remove unused items.
17800 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17801 is defined.
17802 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17803 it's not optimized away by whole-program optimization.
17804 (message_enable_multibyte, free_misc): Remove.
17805 (catchlist, handlerlist, mark_backtrace):
17806 Declare only if BYTE_MARK_STACK.
17807 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17808 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17809 (message_enable_multibyte): Remove decl.
17810 (free_misc, interval_free_list, float_block, float_block_index):
17811 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17812 (cons_free_list, last_marked_index):
17813 Now static.
17814 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17815 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17816 (mark_backtrace): Define only if BYTE_MARK_STACK.
17817 * xdisp.c (message_enable_multibyte): Now static.
17818
17819 Declare Lisp_Object Q* variables to be 'static' if not exported.
17820 This makes it easier for human readers (and static analyzers)
17821 to see whether these variables are used from other modules.
17822 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17823 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17824 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17825 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17826 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17827 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17828 * xmenu.c, xselect.c:
17829 Declare Q* vars static if they are not used in other modules.
17830 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17831 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17832 Remove decls of unexported vars.
17833 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17834
17835 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17836
17837 Make Emacs functions such as Fatom 'static' by default.
17838 This makes it easier for human readers (and static analyzers)
17839 to see whether these functions can be called from other modules.
17840 DEFUN now defines a static function. To make the function external
17841 so that it can be used in other C modules, use the new macro DEFUE.
17842 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17843 (Finit_image_library):
17844 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17845 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17846 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17847 Remove decls, since these functions are now static.
17848 (Funintern, Fget_internal_run_time): New decls, since these functions
17849 were already external.
17850
17851 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17852 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17853 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17854 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17855 * keyboard.c, keymap.c, lread.c:
17856 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17857 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17858 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17859 Mark functions with DEFUE instead of DEFUN,
17860 if they are used in other modules.
17861 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17862 decls for now-static functions.
17863 * buffer.h (Fdelete_overlay): Remove decl.
17864 * callproc.c (Fgetenv_internal): Mark as internal.
17865 * composite.c (Fremove_list_of_text_properties): Remove decl.
17866 (Fcomposition_get_gstring): New forward static decl.
17867 * composite.h (Fcomposite_get_gstring): Remove decl.
17868 * dired.c (Ffile_attributes): New forward static decl.
17869 * doc.c (Fdocumntation_property): New forward static decl.
17870 * eval.c (Ffetch_bytecode): New forward static decl.
17871 (Funintern): Remove extern decl; now in .h file where it belongs.
17872 * fileio.c (Fmake_symbolic_link): New forward static decl.
17873 * image.c (Finit_image_library): New forward static decl.
17874 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17875 * intervals.h (Fprevious_property_change):
17876 (Fremove_list_of_text_properties): Remove decls.
17877 * keyboard.c (Fthis_command_keys): Remove decl.
17878 (Fcommand_execute): New forward static decl.
17879 * keymap.c (Flookup_key): New forward static decl.
17880 (Fcopy_keymap): Now static.
17881 * keymap.h (Flookup_key): Remove decl.
17882 * process.c (Fget_process): New forward static decl.
17883 (Fprocess_datagram_address): Mark as internal.
17884 * syntax.c (Fsyntax_table_p): New forward static decl.
17885 (skip_chars): Remove duplicate decl.
17886 * textprop.c (Fprevious_property_change): New forward static decl.
17887 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17888 Now internal.
17889 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17890 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17891
17892 * editfns.c (Fformat): Remove unreachable code.
17893
17894 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17895
17896 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17897 change. (Bug#8496)
17898
17899 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17900
17901 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17902 when at ZV. (Bug#8487)
17903
17904 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17905
17906 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17907 (Bug#8437)
17908 * keyboard.c (parse_tool_bar_item): Likewise.
17909 * sound.c (sound_cleanup, alsa_close): Likewise.
17910 * termcap.c (tgetent): Likewise.
17911 * xfns.c (x_default_font_parameter): Likewise.
17912 * xsettings.c (read_and_apply_settings): Likewise.
17913
17914 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17915 (overrun_check_free): Protoize.
17916
17917 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17918
17919 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17920 since callers should never pass a negative size.
17921 Change the signature to match that of plain 'read' and 'write'; see
17922 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17923 * lisp.h: Update prototypes of emacs_write and emacs_read.
17924
17925 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17926
17927 * xdisp.c (redisplay_window): Don't try to determine the character
17928 position of the scroll margin if the window start point w->startp
17929 is outside the buffer's accessible region. (Bug#8468)
17930
17931 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17932
17933 Fix write-region and its subroutines for buffers > 2GB.
17934 * fileio.c (a_write, e_write): Modify declaration of arguments and
17935 local variables to support buffers larger than 2GB.
17936 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17937
17938 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17939 argument, local variables, and return value.
17940
17941 * lisp.h: Update prototypes of emacs_write and emacs_read.
17942
17943 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17944
17945 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17946
17947 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17948
17949 Fix more problems found by GCC 4.6.0's static checks.
17950
17951 * xdisp.c (vmessage): Use a better test for character truncation.
17952
17953 * charset.c (load_charset_map): <, not <=, for optimization,
17954 and to avoid potential problems with integer overflow.
17955 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17956 * casetab.c (set_identity, shuffle): Likewise.
17957 * editfns.c (Fformat): Likewise.
17958 * syntax.c (skip_chars): Likewise.
17959
17960 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17961 This also lets GCC 4.6.0 generate slightly better loop code.
17962
17963 * callint.c (Fcall_interactively): <, not <=, for optimization.
17964 (Fcall_interactively): Count the number of arguments produced,
17965 not the number of arguments given. This is simpler and lets GCC
17966 4.6.0 generate slightly better code.
17967
17968 * ftfont.c: Distingish more carefully between FcChar8 and char.
17969 The previous code passed unsigned char * to a functions like
17970 strlen and xstrcasecmp that expect char *, which does not
17971 conform to the C standard.
17972 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17973 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17974 char * when the C standard requires it.
17975
17976 * keyboard.c (read_char): Remove unused var.
17977
17978 * eval.c: Port to Windows vsnprintf (Bug#8435).
17979 Include <limits.h>.
17980 (SIZE_MAX): Define if the headers do not.
17981 (verror): Do not give up if vsnprintf returns a negative count.
17982 Instead, grow the buffer. This ports to Windows vsnprintf, which
17983 does not conform to C99. Problem reported by Eli Zaretskii.
17984 Also, simplify the allocation scheme, by avoiding the need for
17985 calling realloc, and removing the ALLOCATED variable.
17986
17987 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17988
17989 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17990 But keep the doprint source code for now, as we might revamp it
17991 and use it again (Bug#8435).
17992 * lisp.h (doprnt): Remove.
17993 * Makefile.in (base_obj): Remove doprnt.o.
17994 * deps.mk (doprnt.o): Remove.
17995
17996 error: Print 32- and 64-bit integers portably (Bug#8435).
17997 Without this change, on typical 64-bit hosts error ("...%d...", N)
17998 was used to print both 32- and 64-bit integers N, which relied on
17999 undefined behavior.
18000 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18001 * lisp.h (error, verror): Mark as printf-like functions.
18002 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18003 Report overflow in size calculations when allocating printf buffer.
18004 Do not truncate output string at its first null byte.
18005 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18006 Truncate the output at a character boundary, since vsnprintf does not
18007 do that.
18008 * charset.c (check_iso_charset_parameter): Convert internal
18009 character to string before calling 'error', since %c now has the
18010 printf meaning.
18011 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18012 overflow when computing char to be passed to 'error'. Do not
18013 pass Lisp_Object to 'error'; pass the integer instead.
18014 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18015 formatted with plain %d.
18016
18017 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18018
18019 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18020
18021 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18022
18023 * xterm.c (x_catch_errors): Remove duplicate declaration.
18024
18025 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18026
18027 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18028
18029 2011-04-10 Jim Meyering <meyering@redhat.com>
18030
18031 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18032 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18033 return ssize_t not "int", and use size_t as the buffer length.
18034 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18035 * gnutls.h: Update declarations.
18036 * process.c (read_process_output): Use ssize_t, to match.
18037 (send_process): Likewise.
18038
18039 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18040
18041 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18042
18043 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18044
18045 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18046 Use unsigned char, to match FcChar8 type definition.
18047
18048 * xterm.c (handle_one_xevent):
18049 * xmenu.c (create_and_show_popup_menu):
18050 * xselect.c (x_decline_selection_request)
18051 (x_reply_selection_request): Avoid type-punned deref of X events.
18052
18053 2011-04-09 Eli Zaretskii <eliz@gnu.org>
18054
18055 Fix some uses of `int' instead of EMACS_INT.
18056 * search.c (string_match_1, fast_string_match)
18057 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18058 (scan_buffer, find_next_newline_no_quit)
18059 (find_before_next_newline, search_command, Freplace_match)
18060 (Fmatch_data): Make some `int' variables be EMACS_INT.
18061
18062 * xdisp.c (display_count_lines): 3rd argument and return value now
18063 EMACS_INT. All callers changed.
18064 (pint2hrstr): Last argument is now EMACS_INT.
18065
18066 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18067 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18068 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18069 (decode_coding_utf_16, decode_coding_emacs_mule)
18070 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18071 (decode_coding_ccl, decode_coding_charset)
18072 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18073 (decode_coding_iso_2022, decode_coding_emacs_mule)
18074 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18075 <char_offset, last_offset>: Declare EMACS_INT.
18076 (encode_coding_utf_8, encode_coding_utf_16)
18077 (encode_coding_emacs_mule, encode_invocation_designation)
18078 (encode_designation_at_bol, encode_coding_iso_2022)
18079 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18080 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18081 Declare EMACS_INT.
18082 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18083 (encode_invocation_designation): Last argument P_NCHARS is now
18084 EMACS_INT.
18085 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18086 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18087
18088 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18089 All users changed.
18090
18091 * ccl.c (Fccl_execute_on_string): Declare some variables
18092 EMACS_INT.
18093
18094 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18095
18096 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18097
18098 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18099
18100 * process.c (Fformat_network_address): Doc fix.
18101
18102 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18103
18104 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18105
18106 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18107
18108 * keyboard.c (read_char): Call Lisp function help-form-show,
18109 instead of using internal_with_output_to_temp_buffer.
18110 (Qhelp_form_show): New var.
18111 (syms_of_keyboard): Use DEFSYM macro.
18112
18113 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18114
18115 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18116
18117 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18118
18119 * process.c (Flist_processes): Remove to Lisp.
18120 (list_processes_1): Delete.
18121
18122 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18123
18124 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18125
18126 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18127
18128 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18129
18130 Fix more problems found by GCC 4.6.0's static checks.
18131
18132 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18133
18134 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18135
18136 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18137
18138 * xdisp.c (vmessage): Mark as a printf-like function.
18139
18140 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18141
18142 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18143
18144 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18145 printf-like functions.
18146 (tiff_load): Add casts to remove these marks before passing them
18147 to system-supplied API.
18148
18149 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18150
18151 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18152 This avoids several warnings with gcc -Wstrict-overflow.
18153 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18154 directly, rather than having caller test rule sign. This avoids
18155 some unnecessary tests.
18156 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18157 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18158 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18159
18160 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18161 (xfont_open): Avoid unnecessary tests.
18162
18163 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18164
18165 * composite.h, composite.c (composition_gstring_put_cache):
18166 Use EMACS_INT, not int, for length.
18167
18168 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18169 breaking out part of COMPOSITION_DECODE_RULE.
18170 (COMPOSITION_DECODE_RULE): Use it.
18171 * composite.c (get_composition_id): Remove unused local vars,
18172 by using the new macro.
18173
18174 * textprop.c (set_text_properties_1): Change while to do-while,
18175 since the condition is always true at first.
18176
18177 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18178 (interval_deletion_adjustment): Return unsigned value.
18179 All uses changed.
18180
18181 * process.c (list_processes_1, create_pty, read_process_output):
18182 (exec_sentinel): Remove vars that were set but not used.
18183 (create_pty): Remove unnecessary "volatile"s.
18184 (Fnetwork_interface_info): Avoid possibility of int overflow.
18185 (read_process_output): Do adaptive read buffering even if carryover.
18186 (read_process_output): Simplify nbytes computation if buffered.
18187
18188 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18189
18190 * syntax.c (scan_words): Remove var that was set but not used.
18191 (update_syntax_table): Use unsigned instead of int.
18192
18193 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18194 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18195 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18196
18197 * print.c (print_error_message): Avoid int overflow.
18198
18199 * font.c (font_list_entities): Redo for clarity,
18200 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18201
18202 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18203 (font_score): Avoid potential overflow in diff calculation.
18204
18205 * fns.c (substring_both): Remove var that is set but not used.
18206 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18207
18208 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18209
18210 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18211 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18212 can always succeed if overflow has undefined behavior.
18213
18214 * search.c (boyer_moore, wordify): Remove vars set but not used.
18215 (wordify): Omit three unnecessary tests.
18216
18217 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18218 All callers changed. This avoids the need for an unused var.
18219
18220 * casefiddle.c (casify_region): Remove var that is set but not used.
18221
18222 * dired.c (file_name_completion): Remove var that is set but not used.
18223
18224 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18225
18226 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18227 (Finsert_file_contents): Remove unnecessary code checking fd.
18228
18229 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18230 Check for integer overflow on size calculations.
18231
18232 * buffer.c (Fprevious_overlay_change): Remove var that is set
18233 but not used.
18234
18235 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18236 Remove vars that are set but not used.
18237 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18238 (timer_check_2): Mark vars as initialized.
18239
18240 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18241
18242 * image.c (lookup_image): Remove var that is set but not used.
18243 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18244
18245 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18246 that are set but not used.
18247
18248 * xfns.c (make_invisible_cursor): Don't return garbage
18249 if XCreateBitmapFromData fails (Bug#8410).
18250
18251 * xselect.c (x_get_local_selection, x_handle_property_notify):
18252 Remove vars that are set but not used.
18253
18254 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18255 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18256
18257 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18258 Remove var that is set but not used.
18259 (scroll_bar_windows_size): Now size_t, not int.
18260 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18261 Check for overflow.
18262
18263 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18264 (map_tty_color) [!defined MSDOS]: Likewise.
18265
18266 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18267
18268 * coding.c: Remove vars that are set but not used.
18269 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18270 All callers changed.
18271 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18272 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18273 (decode_coding_charset): Remove vars that are set but not used.
18274
18275 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18276 that is set but not used.
18277
18278 * print.c (print_object): Remove var that is set but not used.
18279
18280 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18281 The gnulib version avoids calling malloc in the usual case,
18282 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18283 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18284 * filelock.c (current_lock_owner): Likewise.
18285 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18286 * sysdep.c: Include allocator.h, careadlinkat.h.
18287 (emacs_no_realloc_allocator): New static constant.
18288 (emacs_readlink): New function.
18289 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18290 ../lib/careadlinkat.h.
18291
18292 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18293
18294 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18295 first non-nil return value).
18296
18297 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18298
18299 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18300 if not defined (Bug#8403).
18301
18302 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18303
18304 * xdisp.c (display_count_lines): Remove parameter `start',
18305 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18306 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18307 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18308 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18309 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18310 and thereabouts. All callers changed.
18311 (get_per_char_metric): Remove parameter `f', unused since
18312 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18313
18314 2011-04-02 Jim Meyering <meyering@redhat.com>
18315
18316 do not dereference NULL upon failed strdup
18317 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18318 (ns_get_family): Likewise.
18319
18320 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18321
18322 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18323
18324 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18325
18326 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18327 later (Bug#8403).
18328
18329 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18330
18331 Add lexical binding.
18332
18333 * window.c (Ftemp_output_buffer_show): New fun.
18334 (Fsave_window_excursion):
18335 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18336
18337 * lread.c (lisp_file_lexically_bound_p): New function.
18338 (Fload): Bind Qlexical_binding.
18339 (readevalloop): Remove `evalfun' arg.
18340 Bind Qinternal_interpreter_environment.
18341 (Feval_buffer): Bind Qlexical_binding.
18342 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18343 Mark as dynamic.
18344 (syms_of_lread): Declare `lexical-binding'.
18345
18346 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18347
18348 * keyboard.c (eval_dyn): New fun.
18349 (menu_item_eval_property): Use it.
18350
18351 * image.c (parse_image_spec): Use Ffunctionp.
18352
18353 * fns.c (concat, mapcar1): Accept byte-code-functions.
18354
18355 * eval.c (Fsetq): Handle lexical vars.
18356 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18357 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18358 (FletX, Flet): Obey lexical binding.
18359 (Fcommandp): Handle closures.
18360 (Feval): New `lexical' arg.
18361 (eval_sub): New function extracted from Feval. Use it almost
18362 everywhere where Feval was used. Look up vars in lexical env.
18363 Handle closures.
18364 (Ffunctionp): Move from subr.el.
18365 (Ffuncall): Handle closures.
18366 (apply_lambda): Remove `eval_flags'.
18367 (funcall_lambda): Handle closures and new byte-code-functions.
18368 (Fspecial_variable_p): New function.
18369 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18370 but without exporting it to Lisp.
18371
18372 * doc.c (Fdocumentation, store_function_docstring):
18373 * data.c (Finteractive_form): Handle closures.
18374
18375 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18376 interactive spec.
18377
18378 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18379 New byte-codes.
18380 (exec_byte_code): New function extracted from Fbyte_code to handle new
18381 calling convention for byte-code-functions. Add new byte-codes.
18382
18383 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18384
18385 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18386
18387 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18388
18389 * xdisp.c (redisplay_internal): Fix prototype.
18390
18391 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18392
18393 * xdisp.c (SCROLL_LIMIT): New macro.
18394 (try_scrolling): Use it when setting scroll_limit.
18395 Limit scrolling to 100 screen lines.
18396 (redisplay_window): Even when falling back on "recentering",
18397 position point in the window according to scroll-conservatively,
18398 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18399
18400 (try_scrolling): When point is above the window, allow searching
18401 as far as scroll_max, or one screenful, to compute vertical
18402 distance from PT to the scroll margin position. This prevents
18403 try_scrolling from unnecessarily failing when
18404 scroll-conservatively is set to a value slightly larger than the
18405 window height. Clean up the case of PT below the margin at bottom
18406 of window: scroll_max can no longer be INT_MAX. When aggressive
18407 scrolling is in use, don't let point enter the opposite scroll
18408 margin as result of the scroll.
18409 (syms_of_xdisp) <scroll-conservatively>: Document the
18410 threshold of 100 lines for never-recentering scrolling.
18411
18412 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18413
18414 * dispextern.h (move_it_by_lines):
18415 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18416 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18417 (message_log_check_duplicate): Remove parameters `prev_bol' and
18418 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18419 (redisplay_internal): Remove parameter `preserve_echo_area',
18420 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18421
18422 * indent.c (Fvertical_motion):
18423 * window.c (window_scroll_pixel_based, Frecenter):
18424 Don't pass `need_y_p' to `move_it_by_lines'.
18425
18426 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18427
18428 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18429 steal a few bits to be more compact.
18430 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18431 Remove unneeded casts.
18432
18433 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18434
18435 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18436
18437 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18438 binding" message (bug#7967).
18439
18440 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18441
18442 Fix more problems found by GCC 4.6.0's static checks.
18443
18444 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18445 Remove unused local var.
18446
18447 * editfns.c (Fmessage_box): Remove unused local var.
18448
18449 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18450 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18451 Omit unused local vars.
18452 * window.c (shrink_windows): Omit unused local var.
18453 * menu.c (digest_single_submenu): Omit unused local var.
18454 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18455 Omit unused local var.
18456
18457 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18458 Don't assume string length fits in int.
18459 (keyremap_step, read_key_sequence): Use size_t for sizes.
18460 (read_key_sequence): Don't check last_real_key_start redundantly.
18461
18462 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18463 instead of alloca (Bug#8344).
18464
18465 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18466 (Fbacktrace_frame): Don't assume nframes fits in int.
18467
18468 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18469
18470 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18471 concerns.
18472
18473 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18474
18475 * cm.c (calccost): Turn while-do into do-while, for clarity.
18476
18477 * keyboard.c (syms_of_keyboard): Use the same style as later
18478 in this function when indexing through an array. This also
18479 works around GCC bug 48267.
18480
18481 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18482
18483 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18484
18485 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18486 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18487
18488 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18489 This avoids undefined behavior on integer overflow, and is a bit
18490 more convenient anyway since it is compared to a size_t variable.
18491
18492 Variadic C functions now count arguments with size_t, not int.
18493 This avoids an unnecessary limitation on 64-bit machines, which
18494 caused (substring ...) to crash on large vectors (Bug#8344).
18495 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18496 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18497 All variadic functions and their callers changed accordingly.
18498 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18499 * data.c (arith_driver, float_arith_driver): Likewise.
18500 * editfns.c (general_insert_function): Likewise.
18501 * eval.c (struct backtrace.nargs, interactive_p)
18502 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18503 (funcall_lambda, mark_backtrace): Likewise.
18504 * fns.c (concat): Likewise.
18505 * frame.c (x_set_frame_parameters): Likewise.
18506 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18507 0 if not found, not -1. All callers changed.
18508
18509 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18510 (stack_copy_size): Now size_t, not int.
18511 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18512
18513 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18514
18515 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18516 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18517 All callers changed.
18518
18519 * lisp.h (multibyte_char_to_unibyte):
18520 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18521 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18522 * character.h (CHAR_TO_BYTE8):
18523 * cmds.c (internal_self_insert):
18524 * editfns.c (general_insert_function):
18525 * keymap.c (push_key_description):
18526 * search.c (Freplace_match):
18527 * xdisp.c (message_dolog, set_message_1): All callers changed.
18528
18529 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18530
18531 * keyboard.c (safe_run_hook_funcall): New function.
18532 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18533 don't set the hook to nil, but remove the offending function instead.
18534 (Qcommand_hook_internal): Remove, unused.
18535 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18536 Vcommand_hook_internal.
18537
18538 * eval.c (enum run_hooks_condition): Remove.
18539 (funcall_nil, funcall_not): New functions.
18540 (run_hook_with_args): Call each function through a `funcall' argument.
18541 Remove `cond' argument, now redundant.
18542 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18543 (Frun_hook_with_args_until_failure): Adjust accordingly.
18544 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18545
18546 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18547
18548 * dispextern.h (string_buffer_position): Remove declaration.
18549
18550 * print.c (strout): Remove parameter `multibyte', unused since
18551 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18552
18553 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18554 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18555 All callers changed.
18556
18557 * w32.c (_wsa_errlist): Use braces for struct initializers.
18558
18559 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18560 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18561 All callers changed.
18562 (string_buffer_position): Likewise. Also, make static (it's never
18563 used outside xdisp.c).
18564 (cursor_row_p): Remove parameter `w', unused since
18565 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18566 (decode_mode_spec): Remove parameter `precision', introduced during
18567 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18568 All callers changed.
18569
18570 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18571
18572 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18573
18574 2011-03-27 Anders Lindgren <andlind@gmail.com>
18575
18576 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18577 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18578 (ns_update_auto_hide_menu_bar): New functions.
18579 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18580 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18581 ns_constrain_all_frames.
18582 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18583 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18584
18585 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18586
18587 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18588
18589 2011-03-27 Glenn Morris <rgm@gnu.org>
18590
18591 * syssignal.h: Replace RETSIGTYPE with void.
18592 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18593 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18594 Replace SIGTYPE with void everywhere.
18595 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18596 * s/template.h (SIGTYPE): Remove commented out definition.
18597
18598 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18599
18600 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18601 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18602
18603 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18604
18605 * w32.c (read_unc_volume): Use parameter `henum', instead of
18606 global variable `wget_enum_handle'.
18607
18608 * keymap.c (describe_vector): Remove parameters `indices' and
18609 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18610 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18611
18612 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18613
18614 * keyboard.c (timer_check): Remove parameter `do_it_now',
18615 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18616 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18617 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18618
18619 * keyboard.c (read_char):
18620 * w32menu.c (w32_menu_display_help):
18621 * xmenu.c (show_help_event, menu_help_callback):
18622 Adjust calls to `show_help_echo'.
18623
18624 * gtkutil.c (xg_maybe_add_timer):
18625 * keyboard.c (readable_events):
18626 * process.c (wait_reading_process_output):
18627 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18628
18629 * insdel.c (adjust_markers_gap_motion):
18630 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18631 (gap_left, gap_right): Don't call it.
18632
18633 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18634
18635 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18636 incurred during fontification.
18637
18638 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18639
18640 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18641 (DEFVAR_PER_BUFFER): Don't pass it.
18642
18643 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18644 (scrolling_window): Don't pass it.
18645
18646 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18647
18648 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18649
18650 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18651 and `suffix'.
18652 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18653 of variables specific to SELinux and computation of `encoded_absname'.
18654
18655 * image.c (XPutPixel): Remove unused variable `height'.
18656
18657 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18658
18659 * unexw32.c (get_section_info): Remove unused variable `section'.
18660
18661 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18662 (system_process_attributes): Remove unused variable `sess'.
18663 (sys_read): Remove unused variable `err'.
18664
18665 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18666 (w32_wnd_proc): Remove unused variable `isdead'.
18667 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18668 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18669 (x_create_tip_frame): Remove unused variable `tem'.
18670
18671 * w32inevt.c (w32_console_read_socket):
18672 Remove unused variable `no_events'.
18673
18674 * w32term.c (x_draw_composite_glyph_string_foreground):
18675 Remove unused variable `width'.
18676
18677 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18678
18679 * w32term.c (x_set_glyph_string_clipping):
18680 Don't pass uninitialized region to CombineRgn.
18681
18682 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18683
18684 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18685 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18686 (Fx_close_connection): Remove unused variable `i'.
18687
18688 * w32font.c (w32font_draw): Return number of glyphs.
18689 (w32font_open_internal): Remove unused variable `i'.
18690 (w32font_driver): Add missing initializer.
18691
18692 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18693 (fill_in_menu): Remove unused variable `items_added'.
18694
18695 * w32term.c (last_mouse_press_frame): Remove static global variable.
18696 (w32_clip_to_row): Remove unused variable `f'.
18697 (x_delete_terminal): Remove unused variable `i'.
18698
18699 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18700 (NOTHING): Remove unused static global variable.
18701 (uniscribe_check_otf): Remove unused variable `table'.
18702 (uniscribe_font_driver): Add missing initializers.
18703
18704 2011-03-23 Julien Danjou <julien@danjou.info>
18705
18706 * term.c (Fsuspend_tty, Fresume_tty):
18707 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18708 * window.c (temp_output_buffer_show):
18709 * insdel.c (signal_before_change):
18710 * frame.c (Fhandle_switch_frame):
18711 * fileio.c (Fdo_auto_save):
18712 * emacs.c (Fkill_emacs):
18713 * editfns.c (save_excursion_restore):
18714 * cmds.c (internal_self_insert):
18715 * callint.c (Fcall_interactively):
18716 * buffer.c (Fkill_all_local_variables):
18717 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18718 Use Frun_hooks.
18719 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18720 unconditionally since it does the check itself.
18721
18722 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18723
18724 Fix more problems found by GCC 4.5.2's static checks.
18725
18726 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18727 the first time through the loop, since we know p0 < p1 then.
18728 This also avoids a gcc -Wstrict-overflow warning.
18729
18730 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18731 leading to a memory leak, possible in functions like
18732 load_charset_map_from_file that can allocate an unbounded number
18733 of objects (Bug#8318).
18734
18735 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18736 that could (at least in theory) be that large.
18737
18738 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18739 This is less likely to overflow, and avoids undefined behavior if
18740 overflow does occur. All callers changed. Use strtoul to scan
18741 for the unsigned long integer.
18742 (pint2hrstr): Simplify and tune code slightly.
18743 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18744
18745 * scroll.c (do_scrolling): Work around GCC bug 48228.
18746 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18747
18748 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18749 This also avoids a warning with gcc -Wstrict-overflow.
18750 (validate_x_resource_name): Simplify count usage.
18751 This also avoids a warning with gcc -Wstrict-overflow.
18752
18753 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18754 fail (Bug#8306).
18755
18756 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18757
18758 * process.c (Fmake_network_process): Use socklen_t, not int,
18759 where POSIX says socklen_t is required in portable programs.
18760 This fixes a porting bug on hosts like 64-bit HP-UX, where
18761 socklen_t is wider than int (Bug#8277).
18762 (Fmake_network_process, server_accept_connection):
18763 (wait_reading_process_output, read_process_output):
18764 Likewise.
18765
18766 * process.c: Rename or move locals to avoid shadowing.
18767 (list_processes_1, Fmake_network_process):
18768 (read_process_output_error_handler, exec_sentinel_error_handler):
18769 Rename or move locals.
18770 (Fmake_network_process): Define label "retry_connect" only if needed.
18771 (Fnetwork_interface_info): Fix pointer signedness.
18772 (process_send_signal): Add cast to avoid pointer signedness problem.
18773 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18774 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18775
18776 Make tparam.h and terminfo.c consistent.
18777 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18778 Include tparam.h instead, since it declares them.
18779 * cm.h (PC): Remove extern decl; tparam.h now does this.
18780 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18781 * terminfo.c: Include tparam.h, to check interfaces.
18782 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18783 (tparam): Adjust signature to match interface in tparam.h;
18784 this removes some undefined behavior. Check that outstring and len
18785 are zero, which they always are with Emacs.
18786 * tparam.h (PC, BC, UP): New extern decls.
18787
18788 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18789 (xftfont_open): Rename locals to avoid shadowing.
18790
18791 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18792 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18793 (OTF_TAG_SYM): Omit macro if not needed.
18794 (ftfont_list): Remove unused local.
18795 (get_adstyle_property, ftfont_pattern_entity):
18796 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18797 Rename locals to avoid shadowing.
18798
18799 * xfont.c (xfont_list_family): Mark var as initialized.
18800
18801 * xml.c (make_dom): Now static.
18802
18803 * composite.c (composition_compute_stop_pos): Rename local to
18804 avoid shadowing.
18805 (composition_reseat_it): Remove unused locals.
18806 (find_automatic_composition, composition_adjust_point): Likewise.
18807 (composition_update_it): Mark var as initialized.
18808 (find_automatic_composition): Mark vars as initialized,
18809 with a FIXME (Bug#8290).
18810
18811 character.h: Rename locals to avoid shadowing.
18812 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18813 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18814 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18815 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18816 to avoid shadowing.
18817
18818 * textprop.c (property_change_between_p): Remove; unused.
18819
18820 * intervals.c (interval_start_pos): Now static.
18821
18822 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18823
18824 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18825 Rename locals to avoid shadowing.
18826
18827 * sound.c (wav_play, au_play, Fplay_sound_internal):
18828 Fix pointer signedness.
18829 (alsa_choose_format): Remove unused local var.
18830 (wav_play): Initialize a variable to 0, to prevent undefined
18831 behavior (Bug#8278).
18832
18833 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18834
18835 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18836
18837 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18838 clobbering (Bug#8298).
18839 * sysdep.c (sys_subshell): Likewise.
18840 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18841
18842 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18843 This should get cleaned up, so that child_setup has the
18844 same signature on all platforms.
18845
18846 * callproc.c (call_process_cleanup): Now static.
18847 (relocate_fd): Rename locals to avoid shadowing.
18848
18849 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18850
18851 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18852 not to be necessary, and produces flickering.
18853
18854 2011-03-20 Glenn Morris <rgm@gnu.org>
18855
18856 * config.in: Remove file.
18857
18858 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18859
18860 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18861 are now in src/globals.h.
18862 (syms_of_minibuf): Remove spurious & from previous change.
18863
18864 2011-03-20 Leo Liu <sdl.web@gmail.com>
18865
18866 * minibuf.c (completing-read-function): New variable.
18867 (completing-read-default): Rename from completing-read.
18868 (completing-read): Call completing-read-function.
18869
18870 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18871
18872 * xfaces.c (Fx_load_color_file):
18873 Read color file from absolute filename (bug#8250).
18874
18875 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18876
18877 * makefile.w32-in: Update dependencies.
18878
18879 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18880
18881 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18882
18883 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18884
18885 Fix more problems found by GCC 4.5.2's static checks.
18886
18887 * process.c (make_serial_process_unwind, send_process_trap):
18888 (sigchld_handler): Now static.
18889
18890 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18891 That way, the code declares only the vars that it needs.
18892 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18893 * s/cygwin.h (PTY_ITERATION): Likewise.
18894 * s/darwin.h (PTY_ITERATION): Likewise.
18895 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18896
18897 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18898 * process.c (allocate_pty): Don't declare stb unless it's needed.
18899
18900 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18901 (CONSTANTLIM): Remove; unused.
18902 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18903 Define only if needed.
18904
18905 * unexelf.c (unexec): Name an expression,
18906 to avoid gcc -Wbad-function-cast warning.
18907 Use a different way to cause a compilation error if anyone uses
18908 n rather than nn, a way that does not involve shadowing.
18909 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18910
18911 * deps.mk (unexalpha.o): Remove; unused.
18912
18913 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18914 * unexec.h: New file.
18915 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18916 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18917 Depend on unexec.h.
18918 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18919 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18920 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18921 Change as necessary to match prototype in unexec.h.
18922
18923 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18924 shadowing.
18925 (back_comment, skip_chars): Mark vars as initialized.
18926
18927 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18928 Rename locals to avoid shadowing.
18929
18930 * lread.c (read1): Rewrite so as not to use empty "else".
18931 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18932
18933 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18934
18935 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18936 warning when compiling print.c.
18937
18938 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18939 instead of using an uninitialized var.
18940 (font_sort_entities): Mark var as initialized.
18941
18942 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18943
18944 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18945 pointers to constants.
18946 (font_parse_fcname): Remove unused vars.
18947 (font_delete_unmatched): Now static.
18948 (font_get_spec): Remove; unused.
18949 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18950 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18951 Rename or move locals to avoid shadowing.
18952
18953 * fns.c (require_nesting_list, require_unwind): Now static.
18954 (Ffillarray): Rename locals to avoid shadowing.
18955
18956 * floatfns.c (domain_error2): Define only if needed.
18957 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18958
18959 * alloc.c (mark_backtrace): Move decl from here ...
18960 * lisp.h: ... to here, so that it can be checked.
18961
18962 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18963 (Fdefvar): Rewrite so as not to use empty "else".
18964 (lisp_indirect_variable): Name an expression,
18965 to avoid gcc -Wbad-function-cast warning.
18966 (Fdefvar): Rename locals to avoid shadowing.
18967
18968 * callint.c (quotify_arg, quotify_args): Now static.
18969 (Fcall_interactively): Rename locals to avoid shadowing.
18970 Use const pointer when appropriate.
18971
18972 * lisp.h (get_system_name, get_operating_system_release):
18973 Move decls here, to check interfaces.
18974 * process.c (get_operating_system_release): Move decl to lisp.h.
18975 * xrdb.c (get_system_name): Likewise.
18976 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18977 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18978 some of which prompt warnings from gcc -Wbad-function-cast.
18979 (Fformat_time_string, Fencode_time, Finsert_char):
18980 (Ftranslate_region_internal, Fformat):
18981 Rename or remove local vars to avoid shadowing.
18982 (Ftranslate_region_internal): Mark var as initialized.
18983
18984 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18985 avoid shadowing.
18986
18987 * lisp.h (eassert): Check that the argument compiles, even if
18988 ENABLE_CHECKING is not defined.
18989
18990 * data.c (Findirect_variable): Name an expression, to avoid
18991 gcc -Wbad-function-cast warning.
18992 (default_value, arithcompare, arith_driver, arith_error): Now static.
18993 (store_symval_forwarding): Rename local to avoid shadowing.
18994 (Fmake_variable_buffer_local, Fmake_local_variable):
18995 Mark variables as initialized.
18996 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18997
18998 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18999 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19000 Rename locals to avoid shadowing.
19001 (mark_stack): Move local variables into the #ifdef region where
19002 they're used.
19003 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19004 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19005 needed otherwise.
19006 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19007 (GC_STRING_CHARS): Remove; not used.
19008 (Fmemory_limit): Cast sbrk's returned value to char *.
19009
19010 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19011 avoids undefined behavior in theory.
19012
19013 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19014
19015 Use functions, not macros, for up- and down-casing (Bug#8254).
19016 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19017 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19018 to use the following functions instead of these macros.
19019 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19020 EMACS_INT, since callers assume the returned value fits in int.
19021 (upcase1): Likewise, for UPCASE_TABLE.
19022 (uppercasep, lowercasep, upcase): New static inline functions.
19023 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19024 the race-condition problem in the old DOWNCASE.
19025
19026 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19027 Rename locals to avoid shadowing.
19028 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19029 (regex_compile, re_search_2, re_match_2_internal):
19030 Remove unused local vars.
19031 (FREE_VAR): Rewrite so as not to use empty "else",
19032 which gcc can warn about.
19033 (regex_compile, re_match_2_internal): Mark locals as initialized.
19034 (RETALLOC_IF): Define only if needed.
19035 (WORDCHAR_P): Likewise. This one is never needed, but is used
19036 only in a comment talking about a compiler bug, so put inside
19037 the #if 0 of that comment.
19038 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19039 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19040 Remove; unused.
19041
19042 * search.c (boyer_moore): Rename locals to avoid shadowing.
19043 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19044 (PREV_CHAR_BOUNDARY): Likewise.
19045
19046 * search.c (simple_search): Remove unused var.
19047
19048 * dired.c (compile_pattern): Move decl from here ...
19049 * lisp.h: ... to here, so that it can be checked.
19050 (struct re_registers): New forward decl.
19051
19052 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19053
19054 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19055 All uses changed.
19056 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19057 Rename locals to avoid shadowing.
19058 (Fvertical_motion): Mark locals as initialized.
19059
19060 * casefiddle.c (casify_object, casify_region): Now static.
19061 (casify_region): Mark local as initialized.
19062
19063 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19064
19065 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19066 New macros, so that the caller can use some names other than
19067 gcpro1, gcpro2, etc.
19068 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19069 of the new macros.
19070 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19071 argument, for consistency with GCPRO2_VAR, etc: it is now the
19072 prefix of the variable, not the variable itself. All uses
19073 changed.
19074 * dired.c (directory_files_internal, file_name_completion):
19075 Rename locals to avoid shadowing.
19076
19077 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19078 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19079 dired.c's scmp function, had undefined behavior.
19080 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19081 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19082 * buffer.h: ... to here, because these macros use current_buffer,
19083 and the new implementation with inline functions needs to have
19084 current_buffer in scope now, rather than later when the macros
19085 are used.
19086 (downcase, upcase1): New static inline functions.
19087 (DOWNCASE, UPCASE1): Reimplement using these functions.
19088 This avoids undefined behavior in expressions like
19089 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19090 from race conditions in accessing the global variables
19091 case_temp1 and case_temp2.
19092 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19093 * lisp.h (case_temp1, case_temp2): Remove their decls.
19094 * character.h (ASCII_CHAR_P): Move from here ...
19095 * lisp.h: ... to here, so that the inline functions mentioned
19096 above can use them.
19097
19098 * dired.c (directory_files_internal_unwind): Now static.
19099
19100 * fileio.c (file_name_as_directory, directory_file_name):
19101 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19102 Now static.
19103 (file_name_as_directory): Use const pointers when appropriate.
19104 (Fexpand_file_name): Likewise. In particular, newdir might
19105 point at constant storage, so make it a const pointer.
19106 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19107 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19108 signedness issues.
19109 (Fset_file_times, Finsert_file_contents, auto_save_error):
19110 Rename locals to avoid shadowing.
19111
19112 * minibuf.c (choose_minibuf_frame_1): Now static.
19113 (Ftry_completion, Fall_completions): Rename or remove locals
19114 to avoid shadowing.
19115
19116 * marker.c (bytepos_to_charpos): Remove; unused.
19117
19118 * lisp.h (verify_bytepos, count_markers): New decls,
19119 so that gcc does not warn that these functions aren't declared.
19120
19121 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19122 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19123 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19124 (copy_text): Remove unused local var.
19125
19126 * filelock.c (within_one_second): Now static.
19127 (lock_file_1): Rename local to avoid shadowing.
19128
19129 * buffer.c (fix_overlays_before): Mark locals as initialized.
19130 (fix_start_end_in_overlays): Likewise. This function should be
19131 simplified by using pointers-to-pointers, but that's a different
19132 matter.
19133 (switch_to_buffer_1): Now static.
19134 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19135 (report_overlay_modification): Rename locals to avoid shadowing.
19136
19137 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19138 Fix pointer signedness issue.
19139 (sys_subshell): Mark local as volatile if checking for lint,
19140 to suppress a gcc -Wclobbered warning that does not seem to be right.
19141 (MAXPATHLEN): Define only if needed.
19142
19143 * process.c (serial_open, serial_configure): Move decls from here ...
19144 * systty.h: ... to here, so that they can be checked.
19145
19146 * fns.c (get_random, seed_random): Move extern decls from here ...
19147 * lisp.h: ... to here, so that they can be checked.
19148
19149 * sysdep.c (reset_io): Now static.
19150 (wait_for_termination_signal): Remove; unused.
19151
19152 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19153 (copy_keymap_item, append_key, push_text_char_description):
19154 Now static.
19155 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19156 (DENSE_TABLE_SIZE): Remove; unused.
19157 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19158 (describe_map_tree):
19159 Rename locals to avoid shadowing.
19160
19161 * keyboard.c: Declare functions static if they are not used elsewhere.
19162 (echo_char, echo_dash, cmd_error, top_level_2):
19163 (poll_for_input, handle_async_input): Now static.
19164 (read_char, kbd_buffer_get_event, make_lispy_position):
19165 (make_lispy_event, make_lispy_movement, apply_modifiers):
19166 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19167 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19168 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19169 (read_key_sequence, read_char): Mark locals as initialized.
19170 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19171
19172 * keyboard.h (make_ctrl_char): New decl.
19173 (mark_kboards): Move decl here ...
19174 * alloc.c (mark_kboards): ... from here.
19175
19176 * lisp.h (force_auto_save_soon): New decl.
19177
19178 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19179 (DEFINE_DUMMY_FUNCTION): New macro.
19180 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19181 Use it.
19182 (main): Add casts to avoid warnings
19183 if GCC considers string literals to be constants.
19184
19185 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19186
19187 * dbusbind.c: Pointer signedness fixes.
19188 (xd_signature, xd_append_arg, xd_initialize):
19189 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19190 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19191 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19192 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19193
19194 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19195 if GCC considers string literals to be constants.
19196 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19197
19198 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19199
19200 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19201 (print_preprocess, print_object): New macro to fix last change.
19202
19203 * print.c (print_preprocess): Don't forget font objects.
19204
19205 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19206
19207 * emacs.c (USAGE3): Doc fixes.
19208
19209 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19210
19211 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19212 structure.
19213
19214 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19215
19216 * lisp.h (VWindow_system, Qfile_name_history):
19217 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19218 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19219 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19220
19221 * w32select.c: Don't #include "keyboard.h".
19222 (run_protected): Add extern declaration for waiting_for_input.
19223
19224 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19225 * w32console.c (detect_input_pending, read_input_pending)
19226 (encode_terminal_code):
19227 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19228 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19229 (w32_system_caret_y, Qfile_name_history):
19230 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19231 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19232 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19233 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19234 * w32proc.c (Qlocal, report_file_error):
19235 * w32term.c (Vwindow_system, updating_frame):
19236 * w32uniscribe.c (initialized, uniscribe_font_driver):
19237 Remove unneeded extern declarations.
19238
19239 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19240
19241 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19242
19243 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19244
19245 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19246 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19247 These macros can no longer be used for assignment.
19248
19249 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19250 Assign struct members directly, instead of using BUF_BEGV etc.
19251 (record_buffer_markers, fetch_buffer_markers): New functions for
19252 recording and fetching special buffer markers.
19253 (set_buffer_internal_1, set_buffer_temp): Use them.
19254
19255 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19256
19257 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19258
19259 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19260 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19261
19262 * xdisp.c (hscroll_window_tree):
19263 (reconsider_clip_changes): Use PT instead of BUF_PT.
19264
19265 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19266
19267 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19268 $(EMACS_ROOT)/lib/intprops.h.
19269
19270 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19271
19272 Fix more problems found by GCC 4.5.2's static checks.
19273
19274 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19275 to unsigned char * to avoid compiler diagnostic.
19276 (xg_free_frame_widgets): Make it clear that a local variable is
19277 needed only if USE_GTK_TOOLTIP.
19278 (gdk_window_get_screen): Make it clear that this macro is needed
19279 only if USE_GTK_TOOLTIP.
19280 (int_gtk_range_get_value): New function, which avoids a diagnostic
19281 from gcc -Wbad-function-cast.
19282 (xg_set_toolkit_scroll_bar_thumb): Use it.
19283 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19284 diagnostic from gcc -Wbad-function-cast.
19285 (get_utf8_string, xg_get_file_with_chooser):
19286 Rename locals to avoid shadowing.
19287 (create_dialog): Move locals to avoid shadowing.
19288
19289 * xgselect.c (xg_select): Remove unused var.
19290
19291 * image.c (four_corners_best): Mark locals as initialized.
19292 (gif_load): Initialize transparent_p to zero (Bug#8238).
19293 Mark another local as initialized.
19294 (my_png_error, my_error_exit): Mark with NO_RETURN.
19295
19296 * image.c (clear_image_cache): Now static.
19297 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19298 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19299 (x_edge_detection): Remove unnecessary cast that
19300 gcc -Wbad-function-cast diagnoses.
19301 (gif_load): Fix pointer signedness.
19302 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19303 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19304
19305 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19306
19307 Improve quality of tests for time stamp overflow.
19308 For example, without this patch (encode-time 0 0 0 1 1
19309 1152921504606846976) returns the obviously-bogus value (-948597
19310 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19311 reports time overflow. See
19312 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19313 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19314 * editfns.c: Include limits.h and intprops.h.
19315 (TIME_T_MIN, TIME_T_MAX): New macros.
19316 (time_overflow): Move earlier, to before first use.
19317 (hi_time, lo_time): New functions, for an accurate test for
19318 out-of-range times.
19319 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19320 (Fget_internal_run_time): Don't assume time_t fits in int.
19321 (make_time): Use list2 instead of Fcons twice.
19322 (Fdecode_time): More accurate test for out-of-range times.
19323 (check_tm_member): New function.
19324 (Fencode_time): Use it, to test for out-of-range times.
19325 (lisp_time_argument): Don't rely on undefined left-shift and
19326 right-shift behavior when checking for time stamp overflow.
19327
19328 * editfns.c (time_overflow): New function, refactoring common code.
19329 (Fformat_time_string, Fdecode_time, Fencode_time):
19330 (Fcurrent_time_string): Use it.
19331
19332 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19333 * dired.c (make_time): Move to ...
19334 * editfns.c (make_time): ... here.
19335 * systime.h: Note the move.
19336
19337 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19338
19339 * fringe.c (update_window_fringes): Remove unused variables.
19340
19341 * unexmacosx.c (copy_data_segment): Also copy __got section.
19342 (Bug#8223)
19343
19344 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19345
19346 * termcap.c [MSDOS]: Include "msdos.h".
19347 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19348 Constify `char *' arguments and their references according to
19349 prototypes in tparam.h.
19350
19351 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19352
19353 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19354 Adapt all references accordingly.
19355
19356 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19357
19358 2011-03-11 Tom Tromey <tromey@redhat.com>
19359
19360 * buffer.c (syms_of_buffer): Remove obsolete comment.
19361
19362 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19363
19364 * termhooks.h (encode_terminal_code): Declare prototype.
19365
19366 * msdos.c (encode_terminal_code): Don't declare prototype.
19367
19368 * term.c (encode_terminal_code): Now external again, used by
19369 w32console.c and msdos.c.
19370
19371 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19372 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19373
19374 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19375
19376 Fix some minor problems found by GCC 4.5.2's static checks.
19377
19378 * fringe.c (update_window_fringes): Mark locals as initialized
19379 (Bug#8227).
19380 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19381
19382 * alloc.c (mark_fringe_data): Move decl from here ...
19383 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19384 to check its interface.
19385 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19386
19387 * fontset.c (free_realized_fontset): Now static.
19388 (Fset_fontset_font): Rename local to avoid shadowing.
19389 (fontset_font): Mark local as initialized.
19390 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19391
19392 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19393
19394 * xselect.c (x_disown_buffer_selections): Remove; not used.
19395 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19396 (x_own_selection, Fx_disown_selection_internal): Rename locals
19397 to avoid shadowing.
19398 (x_handle_dnd_message): Remove local to avoid shadowing.
19399
19400 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19401 so that the caller can use some name other than gcpro1.
19402 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19403 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19404 (Fx_backspace_delete_keys_p):
19405 Use them to avoid shadowing, and rename vars to avoid shadowing.
19406 (x_decode_color, x_set_name, x_window): Now static.
19407 (Fx_create_frame): Add braces to silence GCC warning.
19408 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19409 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19410 Remove unused locals.
19411 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19412 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19413 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19414 macros.
19415
19416 * xterm.h (x_mouse_leave): New decl.
19417
19418 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19419 Remove unused functions.
19420 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19421 (x_calc_absolute_position): Now static.
19422 (XTread_socket): Don't define label "out" unless it's used.
19423 Don't declare local "event" unless it's used.
19424 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19425 unless they are used.
19426 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19427 (x_fatal_error_signal): Remove; not used.
19428 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19429 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19430 (x_error_catcher, x_connection_closed, x_error_handler):
19431 (x_error_quitter, xembed_send_message, x_iconify_frame):
19432 (my_log_handler): Rename locals to avoid shadowing.
19433 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19434 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19435
19436 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19437 Rename or move locals to avoid shadowing.
19438 (tty_defined_color, merge_face_heights): Now static.
19439 (free_realized_faces_for_fontset): Remove; not used.
19440 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19441 does not deduce is never used uninitialized.
19442 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19443 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19444
19445 * terminal.c (store_terminal_param): Now static.
19446
19447 * xmenu.c (menu_highlight_callback): Now static.
19448 (set_frame_menubar): Remove unused local.
19449 (xmenu_show): Rename parameter to avoid shadowing.
19450 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19451 since they might point to immutable storage.
19452 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19453 since it's unused otherwise.
19454
19455 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19456 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19457 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19458 avoids a gcc -Wuninitialized diagnostic.
19459 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19460 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19461 does not deduce are never used uninitialized.
19462
19463 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19464
19465 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19466 * window.c (window_loop, size_window):
19467 (run_window_configuration_change_hook, enlarge_window): Likewise.
19468
19469 * window.c (display_buffer): Now static.
19470 (size_window): Mark variables that gcc -Wuninitialized
19471 does not deduce are never used uninitialized.
19472 * window.h (check_all_windows): New decl, to forestall
19473 gcc -Wmissing-prototypes diagnostic.
19474 * dispextern.h (bidi_dump_cached_states): Likewise.
19475
19476 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19477 shadowing.
19478 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19479 Include <limits.h>.
19480 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19481 and to avoid gcc -Wuninitialized warning.
19482 (load_charset_map): Mark variables that gcc -Wuninitialized
19483 does not deduce are never used uninitialized.
19484 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19485
19486 * coding.c (coding_set_source, coding_set_destination):
19487 Use "else { /* comment */ }" rather than "else /* comment */;"
19488 for clarity, and to avoid gcc -Wempty-body warning.
19489 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19490 a block, when the outer 'i' will do.
19491 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19492 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19493 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19494 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19495 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19496 Rename locals to avoid shadowing.
19497 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19498 * coding.c (emacs_mule_char, encode_invocation_designation):
19499 Now static, since they're not used elsewhere.
19500 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19501 (decode_coding_object, encode_coding_object, detect_coding_system):
19502 (decode_coding_emacs_mule): Mark variables that gcc
19503 -Wuninitialized does not deduce are never used uninitialized.
19504 (detect_coding_iso_2022): Initialize a local variable that might
19505 be used uninitialized. Leave a FIXME because it's not clear that
19506 this initialization is needed. (Bug#8211)
19507 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19508 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19509 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19510 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19511 Remove unused macros.
19512
19513 * category.c (hash_get_category_set): Remove unused local var.
19514 (copy_category_table): Now static, since it's not used elsewhere.
19515 * character.c (string_count_byte8): Likewise.
19516
19517 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19518 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19519
19520 * chartab.c (copy_sub_char_table): Now static, since it's not used
19521 elsewhere.
19522 (sub_char_table_ref_and_range, char_table_ref_and_range):
19523 Rename locals to avoid shadowing.
19524 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19525
19526 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19527 (BIDI_BOB): Remove unused macro.
19528
19529 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19530 deduce are never used uninitialized.
19531 * term.c (encode_terminal_code): Likewise.
19532
19533 * term.c (encode_terminal_code): Now static. Remove unused local.
19534
19535 * tparam.h: New file.
19536 * term.c, tparam.h: Include it.
19537 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19538 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19539 Move these decls to tparam.h, and make them agree with what
19540 is actually in tparam.c. The previous trick of using incompatible
19541 decls in different modules does not conform to the C standard.
19542 All callers of tparam changed to use tparam's actual API.
19543 * tparam.c (tparam1, tparam, tgoto):
19544 Use const pointers where appropriate.
19545
19546 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19547 * cm.h (struct cm): Likewise.
19548 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19549 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19550 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19551 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19552 (turn_on_face, init_tty): Likewise.
19553 * termchar.h (struct tty_display_info): Likewise.
19554
19555 * term.c (term_mouse_position): Rename local to avoid shadowing.
19556
19557 * alloc.c (mark_ttys): Move decl from here ...
19558 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19559
19560 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19561
19562 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19563
19564 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19565
19566 * search.c (compile_pattern_1): Remove argument regp, unused since
19567 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19568 (compile_pattern): Don't pass it.
19569
19570 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19571
19572 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19573 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19574 for ! HAVE_GTK3.
19575 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19576
19577 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19578
19579 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19580 gdk_window_get_screen, gdk_window_get_geometry,
19581 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19582 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19583 (xg_get_pixbuf_from_pixmap): New function.
19584 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19585 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19586 Call xg_get_pixbuf_from_pixmap instead of
19587 gdk_pixbuf_get_from_drawable.
19588 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19589 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19590 (xg_check_special_colors): Use GtkStyleContext and its functions
19591 for HAVE_GTK3.
19592 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19593 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19594 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19595 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19596 Call gtk_widget_get_preferred_size.
19597 (xg_frame_resized): gdk_window_get_geometry only takes 5
19598 parameters.
19599 (xg_win_to_widget, xg_event_is_for_menubar):
19600 Call gdk_x11_window_lookup_for_display.
19601 (xg_set_widget_bg): New function.
19602 (delete_cb): New function.
19603 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19604 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19605 (xg_set_background_color): Call xg_set_widget_bg.
19606 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19607 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19608 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19609 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19610 if ! HAVE_GTK3.
19611 (update_frame_tool_bar): Call gtk_widget_hide.
19612 (xg_initialize): Use GDK_KEY_g.
19613
19614 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19615 if ! HAVE_GTK3
19616 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19617
19618 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19619 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19620 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19621
19622 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19623
19624 * w32xfns.c (select_palette): Check success of RealizePalette against
19625 GDI_ERROR, not zero.
19626
19627 See ChangeLog.11 for earlier changes.
19628
19629 ;; Local Variables:
19630 ;; coding: utf-8
19631 ;; End:
19632
19633 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19634
19635 This file is part of GNU Emacs.
19636
19637 GNU Emacs is free software: you can redistribute it and/or modify
19638 it under the terms of the GNU General Public License as published by
19639 the Free Software Foundation, either version 3 of the License, or
19640 (at your option) any later version.
19641
19642 GNU Emacs is distributed in the hope that it will be useful,
19643 but WITHOUT ANY WARRANTY; without even the implied warranty of
19644 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19645 GNU General Public License for more details.
19646
19647 You should have received a copy of the GNU General Public License
19648 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.