]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Don't use previous underline thickness or position if previous underline type is...
[gnu-emacs] / src / ChangeLog
1 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * nsterm.m (ns_draw_underwave):
4 * w32term.c (w32_draw_underwave):
5 * xterm.c (x_draw_underwave): Make underwave look more triangular
6 and also degrade gracefully for small fonts. (Bug#13000)
7
8 * nsterm.m (ns_draw_text_decoration):
9 * w32term.c (x_draw_glyph_string):
10 * xterm.c (x_draw_glyph_string): Don't use previous underline
11 thickness and position if previous underline type is underwave.
12
13 2012-12-31 Glenn Morris <rgm@gnu.org>
14
15 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
16
17 2012-12-29 Andreas Schwab <schwab@linux-m68k.org>
18
19 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
20 (LIBS_GNUSTEP): Define.
21 (LIBES): Add $(LIBS_GNUSTEP).
22 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
23
24 2012-12-27 Eli Zaretskii <eliz@gnu.org>
25
26 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
27 continuation glyph on a TTY with an indication of an empty line.
28 (Bug#13277)
29
30 2012-12-27 Glenn Morris <rgm@gnu.org>
31
32 * cygw32.c (Fcygwin_convert_file_name_to_windows)
33 (Fcygwin_convert_file_name_from_windows): Doc fixes.
34
35 2012-12-24 Eli Zaretskii <eliz@gnu.org>
36
37 * fileio.c (file_name_as_directory, directory_file_name): Accept
38 an additional argument MULTIBYTE to indicate whether the input C
39 came from a multibyte or a unibyte Lisp string; all callers
40 adjusted. Don't assume the input string is always multibyte.
41 (Bug#13262)
42 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
43 don't ENCODE_FILE them, and return a unibyte string if the input
44 was unibyte.
45 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
46 don't assume the input strings will always be multibyte. If the
47 input strings are multibyte, decode strings obtained from C
48 library functions.
49
50 2012-12-22 Martin Rudalics <rudalics@gmx.at>
51
52 * window.c (Fselect_window): Reword doc-string (Bug#13248).
53
54 2012-12-21 Eli Zaretskii <eliz@gnu.org>
55
56 * fileio.c (Finsert_file_contents): Doc fix.
57
58 * w32proc.c (new_child, delete_child, find_child_pid): For a
59 subprocess, consider its slot being in use as long as its process
60 handle (procinfo.hProcess) is not NULL. This avoids reusing the
61 slot when a new process is started immediately after killing
62 another one, without waiting enough time for the first process to
63 be reaped and resources allocated for it be orderly freed.
64 (Bug#13086)
65 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
66
67 2012-12-21 Chong Yidong <cyd@gnu.org>
68
69 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
70
71 2012-12-15 Chong Yidong <cyd@gnu.org>
72
73 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
74
75 2012-12-14 Eli Zaretskii <eliz@gnu.org>
76
77 * w32.c (get_name_and_id): Always pass NULL as the first argument
78 of lookup_account_sid. Avoids crashes with UNC file names that
79 refer to DFS domains, not to specific machine names. (Bug#12621)
80 Remove now unused argument FNAME; all callers changed.
81 (get_file_owner_and_group): Remove now unused argument FNAME; all
82 callers changed.
83
84 2012-12-11 Eli Zaretskii <eliz@gnu.org>
85
86 * search.c (search_buffer): Check the inverse translations of each
87 character in pattern when the buffer being searched is unibyte.
88 (Bug#13084)
89
90 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
91
92 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
93 files, fixing a regression from 24.2.
94 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
95
96 2012-12-08 Jan Djärv <jan.h.d@swipnet.se>
97
98 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
99
100 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
101
102 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
103 DWORD_PTR, for compatibility with 64-bit builds.
104
105 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
106 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
107 (system_process_attributes): Use SIZE_T rather than DWORD, for
108 compatibility with 64-bit builds.
109
110 2012-12-08 Christopher Schmidt <christopher@ch.ristopher.com>
111
112 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
113
114 2012-12-07 Eli Zaretskii <eliz@gnu.org>
115
116 * indent.c (Fvertical_motion): If a display string will be
117 displayed on the left or the right margin, don't consider it as a
118 factor in cursor positioning. (Bug#13108)
119
120 2012-12-07 Martin Rudalics <rudalics@gmx.at>
121
122 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
123
124 2012-12-05 Eli Zaretskii <eliz@gnu.org>
125
126 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
127 fails, signal an error instead of continuing with an empty
128 string. (Bug#13079)
129 Encode expanded temp file pattern before passing it to mkstemp or
130 mktemp.
131
132 2012-12-04 Eli Zaretskii <eliz@gnu.org>
133
134 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
135 Encode the file name before passing it to dostounix_filename, in
136 case it will downcase it (under w32-downcase-file-names).
137 (Bug#12933)
138
139 2012-12-01 Chong Yidong <cyd@gnu.org>
140
141 * fileio.c (Vauto_save_list_file_name): Doc fix.
142
143 2012-11-30 Fabrice Popineau <fabrice.popineau@gmail.com>
144
145 * w32fns.c: Remove prototype of atof.
146 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
147 builds.
148 (file_dialog_callback): Declared UINT_PTR.
149
150 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
151 with 64-bit builds.
152
153 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
154 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
155 defined.
156
157 2012-11-27 Glenn Morris <rgm@gnu.org>
158
159 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
160
161 2012-11-26 Eli Zaretskii <eliz@gnu.org>
162
163 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
164 (Bug#11964)
165
166 2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
167
168 Revert recent change for Bug#8855.
169 As reported by Harald Hanche-Olsen in
170 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00445.html>
171 the change introduces a further bug, of creating lots of zombie
172 processes in some cases. Further work is needed to come up with a
173 better fix for Bug#8855.
174
175 2012-11-24 Eli Zaretskii <eliz@gnu.org>
176
177 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
178 highlighting on the frame was cleared. Prevents assertion
179 violations when repeatedly clicking on the "Top" link of the
180 "bread-crumbs" in Info buffers.
181
182 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
183 Eli Zaretskii <eliz@gnu.org>
184
185 Fix a race condition with glib (Bug#8855).
186 The symptom is a diagnostic "GLib-WARNING **: In call to
187 g_spawn_sync(), exit status of a child process was requested but
188 SIGCHLD action was set to SIG_IGN and ECHILD was received by
189 waitpid(), so exit status can't be returned." The diagnostic
190 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
191 The real bug is a race condition between Emacs and glib: Emacs
192 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
193 so that glib can't find it. Work around the bug by invoking
194 waitpid only on subprocesses that Emacs itself creates.
195
196 This is a backport from the trunk, consisting of:
197
198 * w32proc.c (create_child): Don't clip the PID of the child
199 process to fit into an Emacs integer, as this is no longer a
200 restriction.
201 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
202 reaping only the process specified by PID argument, if that is
203 positive. Use PID instead of dead_child to know which process to
204 reap. Wait for the child to die only if WNOHANG is not in
205 OPTIONS.
206 (sys_select): Don't set dead_child.
207
208 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
209 as it is no longer needed.
210
211 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
212 no longer needed.
213 (create_process, record_child_status_change): Don't use special
214 value -1 in pid field, as the caller now must know the pid rather
215 than having the callee infer it. The inference was sometimes
216 incorrect anyway, due to another race.
217 (create_process): Set new 'alive' member if child is created.
218 (process_status_retrieved): New function.
219 (record_child_status_change): Use it.
220 Accept negative 1st argument, which means to wait for the
221 processes that Emacs already knows about. Move special-case code
222 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
223 processes that have already been waited for, by testing and
224 clearing new 'alive' member. Remove the setting of
225 record_at_most_one_child for the !WNOHANG case.
226 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
227 now does this internally.
228 (handle_child_signal): Let record_child_status_change do all
229 the work, since we do not want to reap all exited child processes,
230 only the child processes that Emacs itself created.
231 * process.h (Lisp_Process): New boolean member 'alive'.
232
233 2012-11-23 Eli Zaretskii <eliz@gnu.org>
234
235 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
236 between bpos_covered and bpos_max. This fixes cursor display when
237 several display strings follow each other.
238
239 * .gdbinit (pgx): If the glyph's object is a string, display the
240 pointer to string data, rather than the value of the string object
241 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
242
243 2012-11-21 Eli Zaretskii <eliz@gnu.org>
244
245 * indent.c (Fvertical_motion): If the starting position is covered
246 by a display string, return to one position before that, to avoid
247 overshooting it inside move_it_to. (Bug#12930)
248
249 2012-11-20 Daniel Colascione <dancol@dancol.org>
250
251 * w32fns.c (Fx_file_dialog):
252 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
253 cygwin_convert_file_name*.
254
255 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
256 Rename cygwin_convert_path* to cygwin_convert_file_name*.
257
258 2012-11-20 Ken Brown <kbrown@cornell.edu>
259
260 * emacs.c (main): Set the G_SLICE environment variable for all
261 Cygwin builds, not just GTK builds. See
262 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
263
264 2012-11-19 Eli Zaretskii <eliz@gnu.org>
265
266 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
267 w32_note_current_window with code. (Backport from trunk.)
268
269 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
270 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
271 Define for the MSVC compiler.
272
273 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
274 semi-colon.
275
276 2012-11-18 Eli Zaretskii <eliz@gnu.org>
277
278 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
279 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
280 dostounix_filename. Prevents crashes down the road, because
281 dostounix_filename assumes it gets a unibyte string. Reported by
282 Michel de Ruiter <michel@sentient.nl>, see
283 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
284
285 2012-11-17 Eli Zaretskii <eliz@gnu.org>
286
287 * w32select.c: Include w32common.h before w32term.h, so that
288 windows.h gets included before w32term.h uses some of its
289 features, see below.
290
291 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
292 typedefs.
293 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
294 prototypes.
295 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
296
297 2012-11-17 Jan Djärv <jan.h.d@swipnet.se>
298
299 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
300 (ns_select): Return at once if events are held (Bug#12834).
301
302 2012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
303
304 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
305 Needed following 2012-10-20 change. (Bug#12902)
306
307 2012-11-16 Glenn Morris <rgm@gnu.org>
308
309 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
310
311 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
312
313 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
314
315 2012-11-14 Eli Zaretskii <eliz@gnu.org>
316
317 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
318 use the same value of thread handle.
319 (start_timer_thread): If the timer thread exited (due to error),
320 clean up by closing the two handles it used. Duplicate the caller
321 thread's handle here, so it gets duplicated only once, when
322 launching the timer thread. Set priority of the timer thread, not
323 the caller thread.
324 (getitimer): Don't duplicate the caller thread's handle here.
325 (Bug#12832)
326
327 2012-11-13 Jan Djärv <jan.h.d@swipnet.se>
328
329 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
330 called (Bug#12834).
331
332 2012-11-12 Eli Zaretskii <eliz@gnu.org>
333
334 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
335 passed to pint2str and pint2hrstr to be at most the size of the
336 frame's decode_mode_spec_buffer. This avoids crashes with very
337 large values of FIELD_WIDTH argument to decode_mode_spec.
338 (Bug#12867)
339
340 2012-11-07 Martin Rudalics <rudalics@gmx.at>
341
342 * window.c (Fsplit_window_internal): Set combination limit of
343 new parent window to t iff Vwindow_combination_limit is t;
344 fixing a regression introduced with the change from 2012-09-22.
345 (Fwindow_combination_limit, Fset_window_combination_limit):
346 Fix doc-strings.
347
348 2012-11-06 Eli Zaretskii <eliz@gnu.org>
349
350 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
351 amount when the scroll margins are too large. When scrolling
352 backwards in the buffer, give up if cannot reach point or the
353 scroll margin within a reasonable number of screen lines.
354 Fixes point position in window under scroll-up/down-aggressively when
355 point is positioned many lines beyond the window top/bottom.
356 (Bug#12811)
357
358 2012-11-05 Eli Zaretskii <eliz@gnu.org>
359
360 * ralloc.c (relinquish): If real_morecore fails to return memory
361 to the system, don't crash; instead, leave the last heap
362 unchanged and return. (Bug#12774)
363
364 2012-11-03 Eli Zaretskii <eliz@gnu.org>
365
366 * lisp.mk: Adjust comments to the fact that term/internal is now
367 loaded from loadup.el.
368
369 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
370 (msdos_fatal_signal): New function.
371 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
372 its argument list.
373
374 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
375 for GCC versions before 4.
376 (emacs_raise): Define to call msdos_fatal_signal.
377
378 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
379 iterator when starting in the middle of a display or overlay
380 string. (Bug#12745)
381
382 2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
383
384 * widget.c (resize_cb): New function.
385 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
386 (EmacsFrameResize): Check if all is up to date before changing frame
387 size.
388
389 2012-11-01 Eli Zaretskii <eliz@gnu.org>
390
391 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
392
393 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
394
395 Fix crash when using Emacs as commit editor for git (Bug#12697).
396 * callproc.c (setpgrp): Remove macro, as we now use setpgid
397 and it is configured in conf_post.h.
398 (Fcall_process): Don't invoke both setsid and setpgid; the former
399 is enough, if it exists.
400 * callproc.c (Fcall_process, child_setup):
401 * process.c (create_process): Use setpgid.
402 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
403 for the real thing.
404 * dispnew.c (init_display): Initialize the foreground group
405 if we are running a tty display.
406 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
407 * lisp.h (init_foreground_group): New decl.
408 * sysdep.c (inherited_pgroup): New static var.
409 (init_foreground_group, tcsetpgrp_without_stopping)
410 (narrow_foreground_group, widen_foreground_group): New functions.
411 (init_sys_modes): Narrow foreground group.
412 (reset_sys_modes): Widen foreground group.
413
414 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
415
416 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
417
418 2012-10-31 Martin Rudalics <rudalics@gmx.at>
419
420 * minibuf.c (read_minibuf): Restore current buffer since
421 choose_minibuf_frame calling Fset_frame_selected_window may
422 change it (Bug#12766).
423
424 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
425
426 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
427
428 2012-10-30 Kenichi Handa <handa@gnu.org>
429
430 * font.c (Ffont_at): If WINDOW is specified and it is not
431 displaying the current buffer, signal an error.
432
433 2012-10-29 Daniel Colascione <dancol@dancol.org>
434
435 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
436 In preparation for fixing bug#12739, move these functions from
437 here...
438
439 * coding.h, coding.c: ... to here, and compile them only when
440 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
441 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
442
443 2012-10-28 Eli Zaretskii <eliz@gnu.org>
444
445 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
446 (timer_loop, getitimer, setitimer): Use it instead of
447 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
448 'clock'.
449 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
450 literal 10000.
451
452 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
453
454 * nsterm.m (NO_APPDEFINED_DATA): New define.
455 (last_appdefined_event_data): New variable
456 (last_appdefined_event): Remove.
457 (ns_select): Initialize t from last_appdefined_event_data instead
458 of [last_appdefined_event data1].
459 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
460 remove last_appdefined_event (Bug#12698).
461
462 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
463
464 * frame.c (x_set_font): Catch internal error.
465
466 2012-10-27 Eli Zaretskii <eliz@gnu.org>
467
468 Avoid overflow in w32 implementation of interval timers.
469 When possible, for ITIMER_PROF count only times the main thread
470 actually executes.
471 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
472 'volatile ULONGLONG' types. All the other data which was
473 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
474 (GetThreadTimes_Proc): New typedef.
475 (w32_get_timer_time): New function, returns a suitable time value
476 for the timer.
477 (timer_loop): Enter critical section when accessing ULONGLONG
478 values of the itimer_data struct, as these accesses are no longer
479 atomic. Call 'w32_get_timer_time' instead of 'clock'.
480 Remove unused variable.
481 (init_timers): Initialize s_pfn_Get_Thread_Times.
482 (start_timer_thread): Don't assign itimer->caller_thread here.
483 (getitimer): Assign itimer->caller_thread here.
484 (setitimer): Always call getitimer to get the value of ticks_now.
485 (sys_spawnve): Avoid compiler warning about format mismatch.
486
487 2012-10-26 Eli Zaretskii <eliz@gnu.org>
488
489 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
490 mouse movement events if the menu bar is active. This avoids
491 producing a busy "hour-glass" cursor by Windows if the mouse
492 pointer is positioned over a tooltip shown for some menu item.
493
494 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
495
496 Don't assume process IDs fit in int.
497 * emacs.c (shut_down_emacs) [!DOS_NT]:
498 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
499 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
500 Use pid_t, not int, to store process IDs, as 'int'
501 is not wide enough on a few platforms (e.g., AIX and IRIX).
502
503 2012-10-23 Kenichi Handa <handa@gnu.org>
504
505 The following change is to make face-font-rescale-alist work
506 correctly for non-ASCII fonts.
507
508 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
509 (font_open_for_lface): Handle Vface_font_rescale_alist.
510
511 2012-10-23 Chong Yidong <cyd@gnu.org>
512
513 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
514
515 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
516
517 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
518 for screen font.
519 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
520
521 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
522 event (Bug#12681).
523
524 2012-10-21 Glenn Morris <rgm@gnu.org>
525
526 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
527
528 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
529
530 Port to OpenBSD 5.1.
531 * frame.c (Fmouse_position, Fmouse_pixel_position):
532 * xdisp.c (produce_stretch_glyph):
533 Declare local vars only when they're needed.
534 This is clearer and avoids a warning on OpenBSD about unused vars.
535 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
536 This is safer, and avoids OpenBSD warnings about unused vars.
537 * keyboard.c (record_menu_key): Remove unnecessary decl.
538 (poll_timer): Define only if POLL_FOR_INPUT is defined.
539 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
540 as our definition clashes with OpenBSD's.
541 * xfaces.c (load_face_colors, check_lface_attrs)
542 (get_lface_attributes_no_remap, get_lface_attributes)
543 (lface_fully_specified_p, x_supports_face_attributes_p)
544 (tty_supports_face_attributes_p, face_fontset, realize_face)
545 (realize_x_face, realize_tty_face):
546 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
547 merely Lisp_Object *. This is more informative and avoids
548 a warning on OpenBSD about accessing beyond an object's size.
549
550 2012-10-20 Chong Yidong <cyd@gnu.org>
551
552 * lread.c (Fload): Doc fix (Bug#12592).
553
554 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
555
556 * font.c (Ffont_at): Fix previous change.
557
558 2012-10-19 Eli Zaretskii <eliz@gnu.org>
559
560 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
561 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
562 for the reasons.
563
564 * alloc.c (NSTATICS): Decrease to 0x800.
565
566 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
567
568 * fns.c (Fnreverse): Include the problem element when signalling an
569 error (bug#12677).
570
571 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
572
573 * nsterm.m (ns_select): Check writefds before call to
574 FD_ISSET (Bug#12668).
575
576 2012-10-18 Daniel Colascione <dancol@dancol.org>
577
578 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
579 (staticpro): If we run out of staticpro slots, die with an
580 informative error instead of just calling emacs_abort.
581
582 2012-10-18 Martin Rudalics <rudalics@gmx.at>
583
584 Fix two flaws reported by Dmitry Antipov.
585 * window.c (Ftemp_output_buffer_show): Remove.
586 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
587 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
588
589 2012-10-17 Eli Zaretskii <eliz@gnu.org>
590
591 * makefile.w32-in ($(BLD)/w32.$(O)):
592 ($(BLD)/vm-limit.$(O)):
593 ($(BLD)/term.$(O)):
594 ($(BLD)/unexw32.$(O)):
595 ($(BLD)/fileio.$(O)):
596 ($(BLD)/dispnew.$(O)): Update dependencies.
597
598 * w32term.h (w32_initialize_display_info, initialize_w32_display):
599 Add prototypes.
600
601 * w32proc.c: Include ctype.h.
602
603 * w32.h (init_environment, check_windows_init_file)
604 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
605 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
606 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
607 (sys_link): Add prototypes.
608
609 * w32.c: Include w32select.h.
610 (sys_access, e_malloc, sys_select): Add prototypes.
611 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
612
613 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
614
615 * unexw32.c: Include lisp.h and w32.h.
616
617 * term.c [WINDOWSNT]: Include w32term.h.
618
619 * process.c [WINDOWSNT]: Add prototype of sys_select.
620
621 * fileio.c [WINDOWSNT]: Include w32.h.
622
623 * dispnew.c [WINDOWSNT]: Include w32.h.
624
625 * cygw32.c (Fcygwin_convert_path_to_windows)
626 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
627 Lisp_Object values. (Bug#12661)
628
629 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
630 to Lisp_Object. (Bug#12661)
631
632 2012-10-17 Kenichi Handa <handa@gnu.org>
633
634 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
635 invalidate.
636
637 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
638
639 * buffer.c (Fkill_buffer): When unchaining the marker,
640 reset its buffer pointer to NULL (Bug#12652).
641
642 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
643
644 Do not verify indirection counters of killed buffers (Bug#12579).
645 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
646 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
647
648 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
649
650 * alloc.c (Fmake_byte_code): Fix typo in comment.
651 * print.c (print_interval): Define as static to match prototype.
652 * indent.c (disptab_matches_widthtab, recompute_width_table):
653 Convert to eassert.
654
655 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
656
657 * editfns.c (get_system_name): Remove.
658 * lisp.h (get_system_name): Remove prototype.
659 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
660 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
661
662 2012-10-15 Daniel Colascione <dancol@dancol.org>
663
664 * dbusbind.c: Add comment explaining reason for previous change.
665
666 2012-10-15 Martin Rudalics <rudalics@gmx.at>
667
668 * window.c (Fwindow_end): Rewrite check whether cached position
669 can be used (Bug#12600).
670 (resize_frame_windows, grow_mini_window, shrink_mini_window):
671 Set windows_or_buffers_changed.
672
673 2012-10-15 Daniel Colascione <dancol@dancol.org>
674
675 * dbusbind.c: Fix cygw32 build break when compiling with dbus
676 enabled by undefining the symbol "interface", which the platform
677 headers define to something incompatible.
678
679 2012-10-14 Daniel Colascione <dancol@dancol.org>
680
681 * image.c (init_tiff_functions, init_imagemagick_functions)
682 (init_svg_functions): Fix cygw32 build break by using these
683 functions only when WINDOWSNT _and_ HAVE_NTGUI.
684
685 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
686
687 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
688
689 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
690
691 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
692
693 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
694
695 * coding.c (detect_coding): Set coding->id before calling
696 this->detector.
697
698 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
699
700 * fileio.c: Formatting fixes.
701
702 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
703
704 Fix some stat-related races.
705 * fileio.c (Fwrite_region): Avoid race condition if a file is
706 removed or renamed by some other process immediately after Emacs
707 writes it but before Emacs stats it. Do not assume that stat (or
708 fstat) succeeds.
709 * image.c (slurp_file): Resolve the file name with fopen + fstat
710 rather than stat + fopen.
711 (pbm_read_file) [0]: Remove unused code with stat race.
712 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
713 Remove ineffective code with stat race.
714
715 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
716
717 * doc.c (get_doc_string): Don't signal an error if the file is missing.
718
719 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
720
721 * nsterm.m (hold_event_q): New static variable.
722 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
723 ! q_event_ptr.
724 (hold_event): New function.
725 (ns_read_socket): If hold_event_q have events, store them and
726 return (Bug#12384).
727 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
728 is zero (Bug#12384).
729
730 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
731
732 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
733
734 2012-10-12 Eli Zaretskii <eliz@gnu.org>
735
736 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
737
738 * fileio.c (check_existing): New function.
739 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
740 instead of calling 'stat', when what's needed is to check whether
741 a file exists. This avoids expensive system calls on MS-Windows.
742 (Bug#12587)
743
744 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
745
746 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
747 determine whether a file exists and is not a directory.
748
749 * lisp.h (check_existing): Add prototype.
750
751 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
752
753 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
754
755 2012-10-12 Glenn Morris <rgm@gnu.org>
756
757 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
758
759 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
760
761 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
762
763 * eval.c (Fautoload): Remember previous autoload status in load-history.
764
765 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
766
767 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
768 * lread.c (load_each_byte, new_backquote_flag, readchar)
769 (read_filtered_event, lisp_file_lexically_bound_p)
770 (safe_to_load_version, Fload, complete_filename_p, openp)
771 (build_load_history, readevalloop, read_escape, read1)
772 (string_to_number, read_vector, read_list):
773 * macros.c (Fstart_kbd_macro):
774 * marker.c (CONSIDER):
775 * menu.c (parse_single_submenu, digest_single_submenu)
776 (find_and_return_menu_selection, Fx_popup_menu):
777 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
778 (Ftry_completion):
779 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
780 (ns_menu_show):
781 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
782 (xmenu_show, xdialog_show):
783 Use bool for booleans.
784 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
785 as it's not a predicate. All uses changed. Omit unnecessary
786 buffer termination.
787
788 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
789
790 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
791 (save_excursion_restore): Do not restore mark if it was not saved.
792
793 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
794
795 * marker.c (cached_modiff): EMACS_INT, not int.
796
797 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
798 instead of having a wrong decl.
799 * nsmenu.m (waiting_for_input): Remove wrong decl.
800
801 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
802
803 keyboard.c, keymap.c: Use bool for booleans.
804 * dispnew.c (sit_for): Distinguish between 3-way display_option
805 and boolean do_display.
806 * keyboard.c (single_kboard, this_command_key_count_reset)
807 (waiting_for_input, echoing, immediate_quit, input_pending)
808 (interrupt_input, interrupts_deferred, pop_kboard)
809 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
810 (command_loop_1, adjust_point_for_property)
811 (safe_run_hooks_error, input_polling_used, read_char):
812 (help_char_p, readable_events, kbd_buffer_events_waiting)
813 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
814 (lucid_event_type_list_p, get_input_pending):
815 (gobble_input, menu_separator_name_p, menu_bar_item)
816 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
817 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
818 (keyremap_step, test_undefined, read_key_sequence)
819 (detect_input_pending, detect_input_pending_ignore_squeezables)
820 (detect_input_pending_run_timers, requeued_events_pending_p)
821 (quit_throw_to_read_char, Fset_input_interrupt_mode):
822 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
823 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
824 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
825 (accessible_keymaps_1, Fkey_description, push_key_description):
826 (shadow_lookup, struct where_is_internal_data)
827 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
828 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
829 (describe_map, describe_vector):
830 * menu.c (single_menu_item):
831 * nsmenu.m (ns_update_menubar):
832 * process.c (wait_reading_process_output):
833 * search.c (scan_buffer, scan_newline):
834 Use bool for boolean.
835 * keyboard.c (timers_run, swallow_events)
836 (detect_input_pending_run_timers):
837 * process.c (wait_reading_process_output):
838 Use unsigned for counter where wraparound-on-overflow is desired,
839 since unsigned is guaranteed to have that behavior and signed is not.
840 (read_char): Use ptrdiff_t for string length.
841 (get_input_pending): Remove first argument, since it was always
842 the same pointer-to-int (now pointer-to-boolean) &input_pending,
843 and behave as if it had that value. Return new value of
844 input_pending. All callers changed.
845 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
846 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
847 a string length.
848 * keymap.c (push_key_description): Omit last arg, which was always 1.
849 All callers changed.
850
851 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
852
853 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
854
855 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
856 ($(BLD)/term.$(O)): Update dependencies.
857
858 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
859
860 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
861 * lisp.h (enum pvec_type): Adjust comments and omit explicit
862 initializer for PVEC_NORMAL_VECTOR.
863
864 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
865
866 Clean out old termopts cruft.
867 * termopts.h (flow_control, meta_key): Remove unused decls.
868 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
869 Don't include termopts.h.
870
871 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
872
873 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
874
875 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
876
877 * commands.h (immediate_quit): Remove duplicate decl.
878
879 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
880
881 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
882 caching.
883 (nsfont_open): Remove setting of Vfonts_in_cache.
884 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
885
886 2012-10-09 Eli Zaretskii <eliz@gnu.org>
887
888 * w32fns.c (w32_last_error): Change the return value to DWORD, to
889 match what GetLastError returns. Explain why the function is
890 needed.
891
892 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
893 'is_tooltip_frame', to avoid confusion with its global namesake.
894
895 2012-10-08 Daniel Colascione <dancol@dancol.org>
896
897 * xdisp.c (start_hourglass): Call w32_note_current_window when
898 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
899 build that caused Emacs to display the hourglass cursor forever.
900
901 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
902 which is broken under remote desktop, calculate the number of
903 colors available for a display based on the display's number of
904 planes and number of bits per pixel per plane. (bug#10397).
905
906 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
907
908 * nsfont.m (Vfonts_in_cache): New variable.
909 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
910 are used. Add cached fonts to Vfonts_in_cache.
911 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
912
913 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
914
915 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
916 in nt/config.nt.
917 (FONT_H): Define after FRAME_H.
918 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
919 Update dependencies.
920
921 * w32term.c: Remove leftover declaration of keyboard_codepage.
922
923 2012-10-08 Eli Zaretskii <eliz@gnu.org>
924
925 * makefile.w32-in (FONT_H): Add $(FRAME_H).
926 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
927 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
928 (GLOBAL_SOURCES): Add cygw32.c.
929 ($(BLD)/unexw32.$(O)):
930 ($(BLD)/w32.$(O)):
931 ($(BLD)/w32console.$(O)):
932 ($(BLD)/w32fns.$(O)):
933 ($(BLD)/w32heap.$(O)):
934 ($(BLD)/w32menu.$(O)):
935 ($(BLD)/w32proc.$(O)): Add w32common.h.
936
937 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
938 'const char *'.
939 (x_to_w32_color): Don't modify the argument, modify a copy instead.
940
941 2012-10-08 Daniel Colascione <dancol@dancol.org>
942
943 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
944 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
945 accidental message numbering hole. Change other messages to
946 match.
947
948 * w32select.h (HAVE_W32SELECT): Remove.
949
950 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
951 w32common.h instead of w32heap.h.
952
953 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
954 (get_allocation_unit, get_processor_type, get_w32_major_version)
955 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
956 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
957 (OS_NT, os_subtype, cache_system_info): Move declarations to
958 w32common.
959
960 * w32heap.c: Include w32common.h.
961 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
962 (w32_minor_version, w32_build_number, w32_subtype):
963 Remove duplicate definitions.
964
965 * w32fns.c: Include w32common.h; include w32heap.h only in
966 WINDOWSNT.
967
968 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
969 Use `report_file_error' instead of `error' in order to better
970 inform users of what went wrong. Increase NTGUI_UNICODE file
971 dialog box file name length to 32k, the maximum allowed by the NT
972 kernel.
973
974 * w32common.h: New file.
975 (ROUND_UP, ROUND_DOWN, get_page_size)
976 (get_allocation_unit, get_processor_type, get_w32_major_version)
977 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
978 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
979 (OS_NT, os_subtype, cache_system_info): Move here.
980
981 * unexw32.c, unexcw.c: Include w32common.h.
982
983 * emacs.c (main): Use (defined (WINDOWSNT) || defined
984 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
985 to call syms_of_w32select.
986
987 * cygw32.h: Remove obsolete EXFUN declarations.
988
989 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
990
991 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
992 of w32inevt.o from SOME_MACHINE_OBJECTS.
993
994 2012-10-08 Daniel Colascione <dancol@dancol.org>
995
996 * image.c: Permanent fix for JPEG compilation issue --- limit
997 jpeglib `boolean' redefinition to Cygwin builds.
998
999 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1000
1001 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1002
1003 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1004 Cygwin.
1005
1006 2012-10-08 Daniel Colascione <dancol@dancol.org>
1007
1008 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1009 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1010 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1011 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1012 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1013 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1014 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1015 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1016 now a supported configuration.
1017
1018 * Makefile.in: consolidate image variables into LIBIMAGE; add
1019 W32_OBJ and W32_LIBS. Compile new files.
1020
1021 * conf_post.h:
1022 (_DebPrint) declare tracing facility for W32 debugging. We need
1023 to unify tracing later.
1024
1025 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1026 unconditional use of W32 Unicode functions. Cygwin runs only on
1027 100% Unicode operating systems.
1028
1029 * cygw32.c: New file. Define Cygwin-specific facilities.
1030 (Fcygwin_convert_path_to_windows)
1031 (Fcygwin_convert_path_from_windows): New user functions for
1032 accessing Cygwin path-munging routines.
1033
1034 * cygw32.h: New file.
1035 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1036 UTF-16LE strings temporarily inside non-Lisp-visible string
1037 objects.
1038
1039 (w32_strerror): Just what it says on the tin.
1040
1041 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1042 also run for Cygwin; both systems have the same problem with using
1043 GUI facilities in a forked child. Also call syms_of_cygw32,
1044 syms_of_w32select in correct places.
1045
1046 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1047 needs fork-then-exec for daemon launching.
1048
1049 * font.h: Include frame.h.
1050
1051 * image.c: Use the image library cache machinery only when we're
1052 compiling for native WINDOWSNT; Cygwin can use shared libraries
1053 like any other Unixlike system.
1054
1055 * keyboard.c: Clarify a comment regarding the input loop.
1056
1057 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1058 functions directly instead of trying to detect at runtime that our
1059 host operating system supports them. We make this change for two
1060 reasons: Cygwin lacks support for the multibyte character
1061 conversion functions used by the legacy menu code, and Cygwin
1062 never needs to rely on non-Unicode APIs.
1063
1064 * unexw32.c (hinst): Declare extern.
1065
1066 * w32.c: Change header order;
1067 (w32_strerror): Move to w32fns.c because we need it for
1068 non-WINDOWSNT builds.
1069
1070 * w32.h: Add #error macro to make sure we don't include w32.h for
1071 Cygwin builds. Remove w32select declarations.
1072
1073 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1074 w32fns.c. w32console.c is WINDOWSNT-only.
1075
1076 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1077 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1078 POSIXy alternative.
1079 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1080 (w32_major_version, w32_minor_version, w32_build_number)
1081 (os_subtype, sound_type): Define here
1082 (w32_defined_color): Make color parameter const for consistency
1083 with other _defined_color functions.
1084 (w32_createwindow): Unconditionally call w32_init_class instead of
1085 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1086 through the code is complex and unnecessary because class
1087 registration is practically free.
1088 (w32_name_of_message): New EMACSDEBUG-only function.
1089 (Fset_message_beep): Move here
1090 (Fx_open_connection): Require that the display name for Windows be
1091 "w32" for consistency, emacsclient disambiguation, and maybe, one
1092 day, multi-window-system support.
1093 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1094 Cygwin files for W32 GUI facilities, since these clearly don't
1095 expect Cygwin names.
1096 (_DebPrint): Define.
1097 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1098 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1099 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1100 (w32_last_error): Remove.
1101
1102 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1103
1104 * w32heap.c (syspage_mask): Declare here.
1105 (cache_system_info): Remove.
1106
1107 * w32inevt.c (faked_key): Define globally, not statically.
1108 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1109 (w32_console_toggle_lock_key): Move to w32fns.c.
1110
1111 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1112
1113 * w32proc.c (_DebPrint): Move to w32fns.c.
1114 * w32select.c: Include string.h, stdio.h for Cygwin.
1115 * w32select.h: New File.
1116
1117 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1118 get_osfhandle.
1119 (w32_message_fd): New variable. Under Cygwin, holds the file
1120 descriptor the system used to tell us about pending thread
1121 messages.
1122
1123 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1124 that prevented compilation under non-WINDOWSNT systems.
1125
1126 (w32_initialize): Open /dev/windows and assign it to
1127 w32_message_fd. Provide w32 feature.
1128
1129 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1130 (WM_EMACS_INPUT_READY): add.
1131 (prepend_msg, w32_message_fd): Declare globally.
1132
1133 * w32xfns.c:
1134 (keyboard_handle): Use only when WINDOWSNT.
1135 (notify_msg_ready): New function. Posts a message to the main
1136 thread's message queue under CYGWIN, which wakes up the main
1137 thread from select(2) by making the /dev/windows file descriptor
1138 ready. Under WINDOWSNT, it sets an event the same way the old
1139 code did.
1140
1141 (post, prepend_msg): Actually call notify_msg_ready instead of
1142 setting the input event directly.
1143
1144 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1145
1146 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1147 but it still has blocs in it, don't return it to the system,
1148 instead of aborting. (Bug#12402)
1149
1150 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1151
1152 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1153
1154 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1155 MAC_OS_X_VERSION_10_6.
1156 (syms_of_nsterm): Remove comment about Panther and above for
1157 ns-antialias-text.
1158 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1159 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1160 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1161
1162 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1163 MAC_OS_X_VERSION_10_4.
1164
1165 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1166 MAC_OS_X_VERSION_10_2.
1167
1168 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1169
1170 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1171 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1172
1173 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1174 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1175 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1176 Remove ns_in_resize check.
1177 (ns_clear_frame_area): Remove resize handle code.
1178
1179 * nsfns.m (ns_in_resize): Remove.
1180 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1181 Remove ns_in_resize check.
1182
1183 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1184
1185 Improve sys_siglist detection.
1186 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1187 defined as a macro, as is done in Solaris.
1188 (sys_siglist_entries): New macro.
1189 (save_strsignal): Use it.
1190 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1191 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1192
1193 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1194
1195 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1196 fullscreen/Fullscreen.
1197
1198 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1199 tobar_height is new.
1200
1201 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1202 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1203 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1204 (windowDidResize:): Check for correct window if old style fullscreen.
1205 Capitalize word in comment. Remove incorrect comment.
1206 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1207 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1208 error in drawing background.
1209 (toggleFullScreen:): Remove comment. Rearrange calls.
1210 Set toolbar values to zero, save old height in tobar_height.
1211 Restore tool bar height when leaving fullscreen.
1212 (canBecomeMainWindow): New function.
1213
1214 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1215
1216 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1217
1218 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1219
1220 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1221
1222 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1223 that time stamps of directories could also be changed.
1224 Don't request the too broad GENERIC_WRITE, only the more restrictive
1225 FILE_WRITE_ATTRIBUTES access rights.
1226
1227 * fileio.c (Fset_file_times): Special-case ignoring errors for
1228 directories only on MSDOS, not on MS-Windows.
1229
1230 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1231
1232 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1233
1234 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1235
1236 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1237 see whether CreateFile failed.
1238
1239 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1240
1241 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1242 to avoid similar races.
1243 * keyboard.c (pending_signals): Now bool, not int.
1244
1245 Port timers to OpenBSD, plus check for timer failures.
1246 OpenBSD problem reported by Han Boetes.
1247 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1248 and/or setitimer.
1249 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1250 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1251 like OpenBSD, which has timer_settime but does not declare it.
1252 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1253 whether to use itimerspec-related primitives. All uses of
1254 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1255
1256 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1257
1258 * profiler.c (handle_profiler_signal): Fix a malloc race
1259 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1260
1261 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1262
1263 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1264
1265 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1266
1267 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1268 consistent with the change in return value of 'safe_strsignal'.
1269
1270 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1271
1272 Prefer plain 'static' to 'static inline' (Bug#12541).
1273 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1274 (bidi_set_sor_type, bidi_push_embedding_level)
1275 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1276 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1277 (bidi_cache_search, bidi_cache_ensure_space)
1278 (bidi_cache_iterator_state, bidi_cache_find)
1279 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1280 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1281 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1282 Now 'static', not 'static inline'.
1283
1284 Count overruns when profiling; change units to ns.
1285 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1286 Give extra weight to samples after overruns, to attempt to count
1287 the time more accurately.
1288 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1289 the underlying primitives nominally do ns.
1290 (Fprofiler_cpu_start): Document the change. Mention that
1291 the sampling intervals are only approximate.
1292
1293 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1294
1295 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1296
1297 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1298 case for the special 0 coding-system.
1299
1300 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1301 (Fmake_overlay): Remove redundant tests.
1302 (fix_start_end_in_overlays): Remove redundant recentering.
1303
1304 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1305
1306 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1307 Update dependencies.
1308
1309 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1310
1311 Fix a malloc race condition involving strsignal.
1312 A signal can arrive in the middle of a malloc, and Emacs's signal
1313 handler can invoke strsignal, which can invoke malloc, which is
1314 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1315 Fix it by altering the signal handler so that it does not invoke
1316 strsignal.
1317 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1318 * process.c (status_message): Use const pointer, in case strsignal
1319 is #defined to safe_strsignal.
1320 * sysdep.c (sys_siglist, init_signals): Always define and
1321 initialize a substitute sys_siglist if the system does not define
1322 one, even if HAVE_STRSIGNAL.
1323 (safe_strsignal): Rename from strsignal. Always define,
1324 using sys_siglist. Return a const pointer.
1325 * syssignal.h (safe_strsignal): New decl.
1326 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1327
1328 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1329
1330 * w32proc.c (timer_loop): Fix code that waits for timer
1331 expiration, to avoid high CPU usage.
1332
1333 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1334
1335 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1336 (sweep_weak_table): Remove redundant prototypes.
1337
1338 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1339
1340 * emacs.c: Move the inclusion of TERM_HEADER after including
1341 windows.h on WINDOWSNT. This avoids compilation problems with
1342 MSVC.
1343
1344 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1345
1346 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1347 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1348 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1349 as the previous version used 'void *'.
1350
1351 * ralloc.c (ROUNDUP): Fix last change.
1352 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1353 'size_t'.
1354
1355 * w32proc.c <disable_itimers>: New static flag.
1356 (init_timers): Initialize it to zero, after creating the critical
1357 sections used by the timer threads.
1358 (term_timers): Set to 1 before deleting the critical sections.
1359 (getitimer, setitimer): If disable_itimers is non-zero, return an
1360 error indication without doing anything. Reported by Fabrice
1361 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1362 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1363 return results.
1364 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1365 support timers.
1366
1367 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1368 term_ntproc after all the other bookkeeping, to get timers working
1369 as long as possible.
1370
1371 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1372
1373 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1374 Suggested by Juri Linkov in
1375 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1376
1377 Prefer plain 'static' to 'static inline' (Bug#12541).
1378 With static functions, modern compilers inline pretty well by
1379 themselves; advice from programmers often hurts as much as it helps.
1380 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1381 this change shrinks the text size of the Emacs executable by 1.1%
1382 without affecting CPU significantly in my benchmark.
1383 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1384 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1385 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1386 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1387 (bset_auto_fill_function, bset_auto_save_file_format)
1388 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1389 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1390 (bset_cache_long_line_scans, bset_case_fold_search)
1391 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1392 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1393 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1394 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1395 (bset_header_line_format, bset_indicate_buffer_boundaries)
1396 (bset_indicate_empty_lines, bset_invisibility_spec)
1397 (bset_left_fringe_width, bset_major_mode, bset_mark)
1398 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1399 (bset_name, bset_overwrite_mode, bset_pt_marker)
1400 (bset_right_fringe_width, bset_save_length)
1401 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1402 (bset_scroll_up_aggressively, bset_selective_display)
1403 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1404 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1405 (set_buffer_overlays_after):
1406 * category.c (bset_category_table):
1407 * charset.c (read_hex):
1408 * coding.c (produce_composition, produce_charset)
1409 (handle_composition_annotation, handle_charset_annotation)
1410 (char_encodable_p):
1411 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1412 (assign_row, set_frame_matrix_frame, make_current)
1413 (add_row_entry):
1414 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1415 * fns.c (maybe_resize_hash_table):
1416 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1417 * gmalloc.c (register_heapinfo):
1418 * image.c (lookup_image_type):
1419 * intervals.c (set_interval_object, set_interval_left)
1420 (set_interval_right, copy_interval_parent, rotate_right)
1421 (rotate_left, balance_possible_root_interval):
1422 * keyboard.c (kset_echo_string, kset_kbd_queue)
1423 (kset_keyboard_translate_table, kset_last_prefix_arg)
1424 (kset_last_repeatable_command, kset_local_function_key_map)
1425 (kset_overriding_terminal_local_map, kset_real_last_command)
1426 (kset_system_key_syms, clear_event, set_prop):
1427 * lread.c (digit_to_number):
1428 * marker.c (attach_marker, live_buffer, set_marker_internal):
1429 * nsterm.m (ns_compute_glyph_string_overhangs):
1430 * process.c (pset_buffer, pset_command)
1431 (pset_decode_coding_system, pset_decoding_buf)
1432 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1433 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1434 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1435 * syntax.c (bset_syntax_table, dec_bytepos):
1436 * terminal.c (tset_param_alist):
1437 * textprop.c (interval_has_some_properties)
1438 (interval_has_some_properties_list):
1439 * window.c (wset_combination_limit, wset_dedicated)
1440 (wset_display_table, wset_hchild, wset_left_fringe_width)
1441 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1442 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1443 (wset_right_fringe_width, wset_right_margin_cols)
1444 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1445 (wset_vertical_scroll_bar_type, wset_window_parameters):
1446 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1447 (wset_column_number_displayed, wset_region_showing)
1448 (window_box_edges, run_window_scroll_functions)
1449 (append_glyph_string_lists, prepend_glyph_string_lists)
1450 (append_glyph_string, set_glyph_string_background_width)
1451 (append_glyph, append_composite_glyph)
1452 (take_vertical_position_into_account):
1453 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1454 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1455 (lface_hash, lface_same_font_attributes_p, lookup_face):
1456 * xml.c (libxml2_loaded_p):
1457 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1458 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1459 Now 'static', not 'static inline'.
1460
1461 * bidi.c: Tune.
1462 (bidi_copy_it): Do the whole copy with a single memcpy.
1463 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1464
1465 Revert the FOLLOW-SYMLINKS change for file-attributes.
1466 Doing it right would require several changes to Tramp, and there's
1467 not enough time to get that tested before the freeze today.
1468 * dired.c (directory_files_internal, Ffile_attributes):
1469 Undo last change.
1470
1471 * frame.c (x_report_frame_params): Port better to wider ints.
1472 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1473 or that pointers can be printed in 15 decimal digits.
1474 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1475
1476 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1477
1478 Support x64 build on MS-Windows.
1479 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1480 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1481 compatibility with x64.
1482 (x_get_focus_frame): Add prototype.
1483
1484 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1485 defining an XRectangle structure.
1486
1487 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1488 arithmetics for compatibility with x64.
1489
1490 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1491 compatibility with x64.
1492
1493 * w32heap.h: Adjust prototypes and declarations.
1494
1495 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1496 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1497 DWORD, long, and unsigned long, for compatibility with x64.
1498 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1499 (sbrk): Argument is now of type ptrdiff_t.
1500
1501 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1502 less than 0x0500.
1503 (w32_msg_pump): Use WPARAM type for 'result'.
1504
1505 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1506 architecture.
1507 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1508 compatibility with x64.
1509
1510 * vm-limit.c (lim_data): Now size_t.
1511 (check_memory_limits): Adjust prototypes of real_morecore and
1512 __morecore to receive argument of type ptrdiff_t. Use size_t for
1513 five_percent and data_size.
1514
1515 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1516 variables, for compatibility with x64.
1517 (rva_to_section, offset_to_section, relocate_offset)
1518 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1519 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1520 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1521 for compatibility with x64.
1522
1523 * sysdep.c (STDERR_FILENO): Define if not already defined.
1524
1525 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1526 (__morecore): Argument type is now ptrdiff_t.
1527 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1528 (relinquish): Use ptrdiff_t type for 'excess'.
1529 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1530
1531 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1532 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1533 instead of a literal number.
1534
1535 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1536 (min): Define only if not already defined.
1537
1538 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1539 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1540 hosts.
1541
1542 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1543 'bitmaps' is a pointer.
1544
1545 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1546
1547 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1548
1549 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1550
1551 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1552 * dired.c (directory_files_internal, Ffile_attributes):
1553 New arg follow_symlinks. All uses changed.
1554
1555 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1556
1557 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1558
1559 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1560
1561 Support atimers and CPU profiler via profile.c on MS-Windows.
1562 * w32proc.c (sig_mask, crit_sig): New static variables.
1563 (sys_signal): Support SIGALRM and SIGPROF.
1564 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1565 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1566 sigfillset, and sigprocmask are no longer no-ops.
1567 (sigismember): New function.
1568 (struct itimer_data): New definition.
1569 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1570 (crit_prof): New static variables.
1571 (MAX_SINGLE_SLEEP): New definition.
1572 (timer_loop, stop_timer_thread, term_timers, init_timers)
1573 (start_timer_thread, getitimer, setitimer): New functions.
1574 (alarm): No longer a no-op, calls setitimer.
1575
1576 * w32.c (term_ntproc): Call term_timers.
1577 (init_ntproc): Make sure all signals are unblocked at startup, to
1578 erase any traces of dumping. Call init_timers.
1579
1580 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1581 Windows-specific code to display the hourglass mouse pointer is no
1582 longer used.
1583 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1584 to hourglass timer expiration.
1585 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1586 Remove, no longer used.
1587 (w32_note_current_window, show_hourglass, hide_hourglass):
1588 New functions, in support of hourglass cursor display similar to other
1589 window systems.
1590 (syms_of_w32fns): Don't initialize hourglass_timer.
1591
1592 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1593 WINDOWSNT as well.
1594 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1595
1596 * w32.h (init_timers, term_timers): Add prototypes.
1597
1598 2012-09-30 Kenichi Handa <handa@gnu.org>
1599
1600 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1601 to the buffer relocation which may be caused by ccl_driver.
1602
1603 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1604
1605 * xfns.c (Fx_file_dialog): Update comment.
1606
1607 * w32fns.c (Fx_file_dialog): Update comment.
1608
1609 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1610 Initialize panel name field if OSX >= 10.6.
1611
1612 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1613
1614 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1615
1616 * nsterm.m (NEW_STYLE_FS): New define.
1617 (ns_fullscreen_hook, windowWillEnterFullScreen)
1618 (windowDidEnterFullScreen, windowWillExitFullScreen)
1619 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1620 (setFSValue): New functions.
1621 (EmacsFSWindow): New implementation.
1622 (canBecomeKeyWindow): New function for EmacsFSWindow.
1623 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1624 (dealloc): Release nonfs_window if in fullscreen.
1625 (updateFrameSize:): Call windowDidMove to update top/left.
1626 (windowWillResize:toSize:): Check if frame is still maximized.
1627 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1628 next_maximized, maximized_width, maximized_height and nonfs_window.
1629 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1630 tbar_height.
1631 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1632 fullscreen. Set maximized_width/height. Act on next_maximized.
1633
1634 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1635 (EmacsView): Add variables for fullscreen.
1636 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1637 (EmacsFSWindow): New interface for fullscreen.
1638
1639 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1640
1641 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1642
1643 2012-09-30 Chong Yidong <cyd@gnu.org>
1644
1645 * fns.c (Frandom): Doc fix.
1646
1647 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1648
1649 * window.c (Vwindow_combination_limit): New default value.
1650 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1651
1652 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1653
1654 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1655 Suggested by Eli Zaretskii in
1656 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1657
1658 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1659
1660 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1661 HAVE_TIMER_SETTIME is defined.
1662
1663 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1664
1665 Profiler improvements: more-accurate timers, overflow checks.
1666 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1667 signal.h, setjmp.h. Include systime.h instead.
1668 (saturated_add): New function.
1669 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1670 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1671 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1672 New static vars.
1673 (enum profiler_cpu_running): New enum.
1674 (profiler_cpu_running): Now of that enum type, not bool.
1675 All uses changed to store the new value.
1676 (handle_profiler_signal): Rename from sigprof_handler_1,
1677 for consistency with other handlers. Do not check whether
1678 cpu_log is a hash-table if garbage collecting, since it
1679 doesn't matter in that case.
1680 (deliver_profiler_signal): Rename from sigprof_handler,
1681 for consistency with other handlers.
1682 (setup_cpu_timer): New function, with much of what used to be in
1683 Fprofiler_cpu_start. Check for out-of-range argument.
1684 Prefer timer_settime if available, and prefer
1685 thread cputime clocks, then process cputime clocks, then
1686 monotonic clocks, to the old realtime clock. Use make_timeval
1687 to round more-correctly when falling back to setitimer.
1688 (Fprofiler_cpu_start): Use it.
1689 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1690 Don't assume that passing NULL as the 2nd argument of setitimer
1691 is the same as passing a pointer to all-zero storage.
1692 Ignore SIGPROF afterwards.
1693 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1694 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1695 non-fatal signal handlers. Ignore SIGPROF on startup.
1696 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1697 in profiler.c, since sysdep.c now uses it.
1698
1699 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1700 Suggested by Eli Zaretskii in
1701 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1702
1703 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1704
1705 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1706
1707 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1708
1709 * lisp.h (struct backtrace): Remove indirection for `function' field.
1710 * xdisp.c (redisplay_internal):
1711 * profiler.c (record_backtrace, sigprof_handler_1):
1712 * alloc.c (Fgarbage_collect):
1713 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1714 (Fbacktrace_frame): Adjust accordingly.
1715
1716 2012-09-28 Glenn Morris <rgm@gnu.org>
1717
1718 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1719 (Frun_hook_with_args_until_failure): Doc fixes.
1720
1721 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1722
1723 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1724 Qautomatic_redisplay and change the symbol name. All users changed.
1725
1726 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1727
1728 * profiler.c (sigprof_handler): Fix race condition.
1729
1730 2012-09-28 Glenn Morris <rgm@gnu.org>
1731
1732 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1733
1734 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1735
1736 Check more robustly for timer_settime.
1737 * Makefile.in (LIB_TIMER_TIME): New macro.
1738 (LIBES): Add it.
1739 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1740 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1741 call timer_settime.
1742
1743 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1744
1745 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1746
1747 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1748
1749 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1750
1751 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1752
1753 * character.h (MAYBE_UNIFY_CHAR): Remove.
1754 * charset.c, charset.h (maybe_unify_char): Now static.
1755 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1756 Since this stuff is now private to charset.c, there's no need for
1757 a public macro and no need to inline by hand.
1758
1759 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1760 Stefan Monnier <monnier@iro.umontreal.ca>
1761 Juanma Barranquero <lekktu@gmail.com>
1762
1763 * profiler.c: New file.
1764 * Makefile.in (base_obj): Add profiler.o.
1765 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1766 ($(BLD)/profiler.$(O)): New target.
1767 * emacs.c (main): Call syms_of_profiler.
1768 * alloc.c (Qautomatic_gc): New constant.
1769 (MALLOC_PROBE): New macro.
1770 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1771 (total_bytes_of_live_objects): New function.
1772 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1773 Call malloc_probe for the memory profiler.
1774 (syms_of_alloc): Define Qautomatic_gc.
1775 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1776 race condition.
1777 (struct backtrace): Move definition...
1778 * lisp.h (struct backtrace): ..here.
1779 (Qautomatic_gc, profiler_memory_running): Declare vars.
1780 (malloc_probe, syms_of_profiler): Declare functions.
1781 * xdisp.c (Qautomatic_redisplay): New constant.
1782 (redisplay_internal): Record itself in backtrace_list.
1783 (syms_of_xdisp): Define Qautomatic_redisplay.
1784
1785 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1786 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1787
1788 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1789
1790 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1791
1792 Prefer POSIX timers if available.
1793 They avoid a race if the timer is too close to the current time.
1794 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1795 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1796 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1797
1798 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1799
1800 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1801 CHAR_STRING_ADVANCE.
1802 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1803 STRING_CHAR_ADVANCE.
1804
1805 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1806
1807 Move Vlibrary_cache to emacs.c and reset before dumping.
1808
1809 * lisp.h (reset_image_types): Declare.
1810 [WINDOWSNT] (Vlibrary_cache): Declare.
1811
1812 * image.c (reset_image_types): New function.
1813
1814 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1815 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1816 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1817
1818 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1819 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1820
1821 * w32.h (Vlibrary_cache): Do not declare.
1822
1823 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1824
1825 * w32proc.c (sys_signal): Handle all signals defined by the
1826 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1827 handlers for signals supported by Windows. Don't override
1828 term_ntproc as the handler for SIGABRT.
1829 (sigaction): Rewrite to call sys_signal instead of duplicating its
1830 code.
1831 (sys_kill): Improve commentary.
1832
1833 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1834 consistency with a signature of a signal handler. All callers
1835 changed.
1836 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1837 install term_ntproc as a signal handler for SIGABRT, as that
1838 should be done by the dumped Emacs.
1839
1840 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1841
1842 * w32select.c (term_w32select): Protect against repeated
1843 invocation by setting clipboard_owner to NULL after calling
1844 DestroyWindow.
1845
1846 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1847 and term_ntproc to their modified signatures.
1848
1849 * character.c (char_string, string_char): Remove calls to
1850 MAYBE_UNIFY_CHAR. See the discussion starting at
1851 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1852 for the details.
1853
1854 2012-09-25 Chong Yidong <cyd@gnu.org>
1855
1856 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1857
1858 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1859
1860 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1861 when encountering an unknown bytecode.
1862
1863 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1864
1865 image.c, indent.c: Use bool for booleans.
1866 * dispextern.h (struct image_type): Members valid_p, load, init
1867 now return bool, not int. All uses changed.
1868 * image.c: Omit unnecessary static decls.
1869 (x_create_bitmap_mask, x_build_heuristic_mask):
1870 Return void, not int, since callers don't care about the return value.
1871 (x_create_bitmap_mask, define_image_type, valid_image_p)
1872 (struct image_keyword, parse_image_spec, image_spec_value)
1873 (check_image_size, image_background)
1874 (image_background_transparent, x_clear_image_1)
1875 (postprocess_image, lookup_image, x_check_image_size)
1876 (x_create_x_image_and_pixmap, xbm_image_p)
1877 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1878 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1879 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1880 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1881 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1882 (png_image_p, init_png_functions, png_load_body, png_load)
1883 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1884 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1885 (init_gif_functions, gif_load, imagemagick_image_p)
1886 (imagemagick_load_image, imagemagick_load, svg_image_p)
1887 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1888 (gs_load):
1889 * nsimage.m (ns_load_image):
1890 * nsterm.m (ns_defined_color):
1891 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1892 * xfns.c (x_defined_color):
1893 * xterm.c (x_alloc_lighter_color_for_widget)
1894 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1895 (x_alloc_lighter_color):
1896 * indent.c (disptab_matches_widthtab, current_column)
1897 (scan_for_column, string_display_width, indented_beyond_p)
1898 (compute_motion, vmotion, Fvertical_motion):
1899 Use bool for booleans.
1900
1901 2012-09-24 Chong Yidong <cyd@gnu.org>
1902
1903 * chartab.c (Fset_char_table_default): Obsolete function removed.
1904
1905 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1906
1907 Move pid_t related decls out of lisp.h.
1908 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1909 (interruptible_wait_for_termination):
1910 Move these decls from lisp.h to syswait.h, since they use pid_t.
1911 Needed on FreeBSD; see Herbert J. Skuhra in
1912 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1913 * callproc.c: Include syswait.h.
1914
1915 gnutls.c, gtkutil.c: Use bool for boolean.
1916 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1917 (emacs_gnutls_handle_error):
1918 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1919 (xg_hide_tooltip, xg_create_frame_widgets)
1920 (create_dialog, xg_uses_old_file_dialog)
1921 (xg_get_file_with_chooser, xg_get_file_with_selection)
1922 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1923 (xg_item_label_same_p, xg_update_menubar)
1924 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1925 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1926 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1927 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1928 (update_frame_tool_bar, free_frame_tool_bar):
1929 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1930 * nsmenu.m (ns_update_menubar):
1931 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1932 * xfns.c (Fx_show_tip) [USE_GTK]:
1933 Use bool for boolean.
1934 * gtkutil.c (xg_update_frame_menubar):
1935 * xmenu.c (update_frame_menubar):
1936 Return void, not int, since caller ignores return value.
1937 * gtkutil.c (xg_change_toolbar_position):
1938 Return void, not 1.
1939
1940 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1941
1942 * makefile.w32-in (BLOCKINPUT_H): Remove.
1943 (SYSSIGNAL_H): New macro.
1944 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1945 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1946 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1947 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1948 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1949 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1950 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1951 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1952 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1953 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1954 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1955 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1956 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1957 ($(BLD)/w32xfns.$(O)): Update dependencies.
1958
1959 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1960
1961 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1962 fatal_error_backtrace.
1963
1964 * w32proc.c (sys_kill): Undo last change: don't do anything when
1965 invoked to deliver SIGABRT to our own process. This is now
1966 handled by emacs_raise.
1967
1968 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1969
1970 * w32term.c (w32_read_socket): Remove leftover reference to
1971 interrupt_input_pending.
1972
1973 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1974
1975 Do not use SA_NODEFER.
1976 Problem reported by Dani Moncayo in
1977 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1978 * alloc.c (die):
1979 * sysdep.c (emacs_abort): Do not reset signal handler.
1980 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1981 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1982 wanted even on POSIXish hosts, and it doesn't work on Windows.
1983
1984 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1985
1986 * xterm.c (x_term_init): Call fixup_locale before and after calling
1987 gtk_init (Bug#12392).
1988
1989 2012-09-23 Chong Yidong <cyd@gnu.org>
1990
1991 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1992 Vdynamic_library_alist.
1993
1994 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1995 (Fgnutls_available_p): Caller changed.
1996
1997 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1998 (Flibxml_parse_xml_region): Likewise.
1999
2000 * dispextern.h (struct image_type): Remove arg from init function.
2001
2002 * image.c (Finit_image_library, lookup_image_type)
2003 (define_image_type): Remove now-unneeded second arg.
2004 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2005 (init_tiff_functions, init_gif_functions, init_svg_functions):
2006 Arglist and w32_delayed_load calling convention changed.
2007 (gs_type): Remove init_gs_functions; there is no such function.
2008 (valid_image_p, make_image): Fix caller to lookup_image_type.
2009
2010 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2011
2012 Simplify and avoid signal-handling races (Bug#12471).
2013 * alloc.c (die):
2014 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2015 Avoid recursive loop if there's a fatal error in the function itself.
2016 * atimer.c (pending_atimers):
2017 * blockinput.h: Don't include "atimer.h"; no longer needed.
2018 (interrupt_input_pending): Remove. All uses removed.
2019 pending_signals now counts both atimers and ordinary interrupts.
2020 This is less racy than having three separate pending-signal flags.
2021 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2022 (input_blocked_p):
2023 Rename from their upper-case counterparts BLOCK_INPUT,
2024 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2025 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2026 This makes it easier to access volatile variables more accurately.
2027 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2028 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2029 that's more reliable if the code is buggy and sets
2030 interrupt_input_blocked to a negative value. All uses changed.
2031 * atimer.c (deliver_alarm_signal):
2032 Remove. No need to deliver this to the parent; any thread can
2033 handle this signal now. All uses replaced by underlying handler.
2034 * atimer.c (turn_on_atimers):
2035 * dispnew.c (handle_window_change_signal):
2036 * emacs.c (handle_danger_signal):
2037 * keyboard.c (kbd_buffer_get_event):
2038 Don't reestablish signal handler; not needed with sigaction.
2039 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2040 (UNBLOCK_INPUT_TO):
2041 Rework to avoid unnecessary accesses to volatile variables.
2042 (UNBLOCK_INPUT_TO): Now a function.
2043 (totally_unblock_input, unblock_input): New decls.
2044 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2045 (init_data): Remove. Necessary stuff now done in init_signal.
2046 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2047 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2048 (fatal_error_code): Remove; no longer needed.
2049 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2050 it doesn't always backtrace. All uses changed. No need to reset
2051 signal to default, since sigaction and/or die does that for us now.
2052 Use emacs_raise (FOO), not kill (getpid (), FOO).
2053 (main): Check more-accurately whether we're dumping.
2054 Move fatal-error setup to sysdep.c
2055 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2056 * gtkutil.c (xg_get_file_name, xg_get_font):
2057 Remove no-longer-needed signal-mask manipulation.
2058 * keyboard.c, process.c (POLL_FOR_INPUT):
2059 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2060 * keyboard.c (read_avail_input): Remove.
2061 All uses replaced by gobble_input.
2062 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2063 (kbd_buffer_store_event_hold, gobble_input):
2064 (record_asynch_buffer_change) [USABLE_SIGIO]:
2065 (store_user_signal_events):
2066 No need to mess with signal mask.
2067 (gobble_input): If blocking input and there are terminals, simply
2068 set pending_signals to 1 and return. All hooks changed to not
2069 worry about whether input is blocked.
2070 (process_pending_signals): Clear pending_signals before processing
2071 them, in case a signal comes in while we're processing.
2072 By convention callers now test pending_signals before calling us.
2073 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2074 New functions, to support changes to blockinput.h.
2075 (handle_input_available_signal): Now extern.
2076 (reinvoke_input_signal): Remove. All uses replaced by
2077 handle_async_input.
2078 (quit_count): Now volatile, since a signal handler uses it.
2079 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2080 All callers changed. Block SIGINT only if not already blocked.
2081 Clear sigmask reliably, even if Fsignal returns, which it can.
2082 Omit unnecessary accesses to volatile var.
2083 (quit_throw_to_read_char): No need to restore sigmask.
2084 * keyboard.c (gobble_input, handle_user_signal):
2085 * process.c (wait_reading_process_output):
2086 Call signal-handling code rather than killing ourselves.
2087 * lisp.h: Include <float.h>, for...
2088 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2089 (pending_signals): Now volatile.
2090 (syms_of_data): Now const if IEEE floating point.
2091 (handle_input_available_signal) [USABLE_SIGIO]:
2092 (terminate_due_to_signal, record_child_status_change): New decls.
2093 * process.c (create_process): Avoid disaster if memory is exhausted
2094 while we're processing a vfork, by tightening the critical section
2095 around the vfork.
2096 (send_process_frame, process_sent_to, handle_pipe_signal)
2097 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2098 ignores SIGPIPE.
2099 (send_process): No need for setjmp/longjmp any more, since the
2100 SIGPIPE stuff is now gone. Instead, report an error if errno
2101 is EPIPE.
2102 (record_child_status_change): Now extern. PID and W are now args.
2103 Return void, not bool. All callers changed.
2104 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2105 Remove. All uses removed. This bug should be fixed now in a
2106 different way.
2107 (wait_for_termination_1): Use waitpid rather than sigsuspend,
2108 and record the child status change directly. This avoids the
2109 need to futz with the signal mask.
2110 (process_fatal_action): Move here from emacs.c.
2111 (emacs_sigaction_flags): New function, containing
2112 much of what used to be in emacs_sigaction_init.
2113 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2114 caught by emacs, to make races less likely.
2115 (deliver_process_signal): Rename from handle_on_main_thread.
2116 All uses changed.
2117 (BACKTRACE_LIMIT_MAX): Now at top level.
2118 (thread_backtrace_buffer, threadback_backtrace_pointers):
2119 New static vars.
2120 (deliver_thread_signal, deliver_fatal_thread_signal):
2121 New functions, for more-accurate delivery of thread-specific signals.
2122 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2123 (deliver_arith_signal): Handle in this thread, not
2124 in the main thread, since it's triggered by this thread.
2125 (maybe_fatal_sig): New function.
2126 (init_signals): New arg DUMPING so that we can be more accurate
2127 about whether we're dumping. Caller changed.
2128 Treat thread-specific signals differently from process-general signals.
2129 Block all signals while handling fatal error; that's safer.
2130 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2131 on IEEE hosts.
2132 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2133 Ignore SIGPIPE unless batch.
2134 (emacs_backtrace): Output backtrace for the appropriate thread,
2135 which is not necessarily the main thread.
2136 * syssignal.h: Include <stdbool.h>.
2137 (emacs_raise): New macro.
2138 * xterm.c (x_connection_signal): Remove; no longer needed
2139 now that we use sigaction.
2140 (x_connection_closed): No need to mess with sigmask now.
2141 (x_initialize): No need to reset SIGPIPE handler here, since
2142 init_signals does this for us now.
2143
2144 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2145
2146 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2147 background rect may be larger (Bug#12245).
2148
2149 2012-09-23 Chong Yidong <cyd@gnu.org>
2150
2151 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2152
2153 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2154
2155 * .gdbinit: Just stop at fatal_error_backtrace.
2156 See Stefan Monnier's request in
2157 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2158 Remove no-longer-used query of system type.
2159
2160 2012-09-22 Chong Yidong <cyd@gnu.org>
2161
2162 * search.c (Freplace_match): Doc fix (Bug#12325).
2163
2164 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2165
2166 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2167 (Fline_end_position): Doc fix.
2168
2169 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2170
2171 2012-09-22 Chong Yidong <cyd@gnu.org>
2172
2173 * dispextern.h (struct image_type): Add new slot, storing a type
2174 initialization function.
2175
2176 * image.c (define_image_type): Call the image initializer function
2177 if it is defined. Arguments and return value changed.
2178 (valid_image_p, make_image): Callers changed.
2179 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2180 (gif_type, imagemagick_type, svg_type, gs_type):
2181 Add initialization functions.
2182 (Finit_image_library): Call lookup_image_type.
2183 (CHECK_LIB_AVAILABLE): Macro deleted.
2184 (lookup_image_type): Call define_image_type here, rather than via
2185 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2186 (syms_of_image): Move define_image_type calls for xbm_type and
2187 pbm_type to lookup_image_type.
2188
2189 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2190
2191 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2192 'idle_timers' from here ...
2193 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2194 lists, to avoid infloops when the timer does something stupid,
2195 like reinvoke itself with the same or smaller time-out.
2196 (Bug#12447)
2197
2198 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2199
2200 * window.c (Fsplit_window_internal): Handle only Qt value of
2201 Vwindow_combination_limit separately.
2202 (Qtemp_buffer_resize): New symbol.
2203 (Vwindow_combination_limit): New default value.
2204 Rewrite doc-string.
2205
2206 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2207
2208 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2209 the new overlay string. (Bug#10159)
2210
2211 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2212
2213 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2214 or that fprintf is async-signal-safe. POSIX doesn't require
2215 either assumption.
2216
2217 2012-09-22 Chong Yidong <cyd@gnu.org>
2218
2219 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2220 (Bug#8207).
2221
2222 2012-09-22 Kenichi Handa <handa@gnu.org>
2223
2224 * composite.c (composition_reseat_it): Handle the case that a
2225 grapheme cluster is not covered by a single font (Bug#12352).
2226
2227 2012-09-21 Chong Yidong <cyd@gnu.org>
2228
2229 * image.c (define_image_type): Avoid adding duplicate types to
2230 image_types (Bug#12463). Suggested by Jörg Walter.
2231
2232 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2233
2234 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2235 (print_load_command_name): Add case LC_DATA_IN_CODE.
2236 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2237
2238 2012-09-21 Glenn Morris <rgm@gnu.org>
2239
2240 * eval.c (Frun_hook_with_args_until_success)
2241 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2242
2243 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2244
2245 * fileio.c (Ffile_selinux_context): Only call freecon when
2246 lgetfilecon succeeded.
2247 (Fset_file_selinux_context): Likewise. (Bug#12444)
2248
2249 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2250
2251 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2252 reordering, locate the cursor by calling set_cursor_from_row; if
2253 that fails, clear the desired glyph matrix before returning a
2254 failure indication to the caller. Fixes leaving garbled display
2255 when fast scrolling with a down-key. (Bug#12403)
2256 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2257 scrolling through multibyte text.
2258
2259 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2260
2261 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2262 calling mark_vectorlike since that's the one that marks the window.
2263 (mark_discard_killed_buffers): Mark the final cdr.
2264 * window.h (struct window): Move prev/next_buffers to the
2265 non-standard fields.
2266 * window.c (make_window): Initialize prev/next_buffers manually.
2267
2268 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2269
2270 Omit unused arg EXPECTED from socket hooks.
2271 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2272 * nsterm.m (ns_term_init):
2273 * termhooks.h (struct terminal.read_socket_hook):
2274 * w32inevt.c (w32_console_read_socket):
2275 * w32term.c (w32_read_socket):
2276 * xterm.c (XTread_socket):
2277 Omit unused arg EXPECTED. All callers changed.
2278 (store_user_signal_events): Return void, not int, since callers no
2279 longer care about the return value. All uses changed.
2280
2281 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2282
2283 * w32gui.h (XParseGeometry): Do not declare.
2284
2285 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2286
2287 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2288 Ignore 'expected'. See Eli Zaretskii in
2289 <http://bugs.gnu.org/12471#8> (last line).
2290
2291 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2292 (XParseGeometry): Now static. Substitute extremal values for
2293 values that are out of range.
2294
2295 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2296
2297 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2298
2299 * nsfns.m (XParseGeometry): Remove.
2300 (Fx_create_frame): Call x_set_offset to correctly interpret
2301 top_pos in geometry.
2302
2303 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2304 (Fx_parse_geometry): If there is a space in string, call
2305 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2306
2307 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2308
2309 * search.c (scan_buffer): Use character positions in calls to
2310 region_cache_forward and region_cache_backward, not byte
2311 positions. (Bug#12196)
2312
2313 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2314 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2315
2316 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2317 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2318 emacs_blocked_malloc, now deleted.
2319
2320 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2321
2322 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2323 The workaround was for improving performance on Solaris 2.4, but
2324 is getting in the way now. Emacs will still work if someone is
2325 still running Solaris 2.4 in a museum somewhere; Sun dropped
2326 support for Solaris 2.4 in 2003.
2327 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2328 * process.c (create_process) [HAVE_WORKING_VFORK]:
2329 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2330 since Emacs no longer uses vfork on that platform.
2331
2332 2012-09-17 Glenn Morris <rgm@gnu.org>
2333
2334 * emacs.c: Use COPYRIGHT.
2335
2336 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2337
2338 Remove configure's --without-sync-input option (Bug#12450).
2339 When auditing signal-handling in preparation for cleaning it up,
2340 I found that SYNC_INPUT has race conditions and would be a real
2341 pain to fix. Since it's an undocumented and deprecated
2342 configure-time option, now seems like a good time to remove it.
2343 Also see <http://bugs.gnu.org/11080#16>.
2344 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2345 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2346 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2347 (malloc_hysteresis):
2348 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2349 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2350 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2351 (dont_register_blocks, bytes_used_when_reconsidered)
2352 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2353 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2354 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2355 Remove. All uses removed.
2356 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2357 implementation, one that depends on whether the new macro
2358 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2359 is defined.
2360 * atimer.c (run_timers, handle_alarm_signal):
2361 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2362 (handle_async_input, process_pending_signals)
2363 (handle_input_available_signal, init_keyboard):
2364 * nsterm.m (ns_read_socket):
2365 * process.c (wait_reading_process_output):
2366 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2367 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2368 (emacs_write):
2369 * xterm.c (XTread_socket):
2370 Assume SYNC_INPUT.
2371 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2372 * eval.c (handling_signal): Remove. All uses removed.
2373 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2374 All uses replaced with the SYNC_INPUT version.
2375 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2376 Remove decls.
2377 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2378 Now static.
2379
2380 * font.c (Ffont_shape_gstring): Remove unused local.
2381
2382 2012-09-16 Glenn Morris <rgm@gnu.org>
2383
2384 * Makefile.in (clean): No longer run nextstep's clean.
2385
2386 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2387 (ns_frag): Remove.
2388 (ns-app): Move here from ns.mk, and simplify.
2389 (clean): Simplify nextstep entry.
2390 * ns.mk: Remove file.
2391
2392 2012-09-17 Kenichi Handa <handa@gnu.org>
2393
2394 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2395 not covert the last few charactes.
2396
2397 2012-09-16 Kenichi Handa <handa@gnu.org>
2398
2399 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2400 here, but just check the validity of glyphs in the glyph-string.
2401
2402 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2403
2404 * window.c (Fwindow_parameter, Fset_window_parameter):
2405 Accept any window as argument (Bug#12452).
2406
2407 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2408
2409 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2410 to ns_term_init to avoid memory leak.
2411
2412 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2413 explicit retain/release.
2414 (ns_term_init): Only allow one display. Initialize outerpool and
2415 ns_*_types.
2416
2417 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2418
2419 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2420 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2421 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2422 the Microsoft problem in a different way, by altering ../nt/config.nt.
2423
2424 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2425
2426 * w32xfns.c:
2427 * w32uniscribe.c:
2428 * w32term.c:
2429 * w32select.c:
2430 * w32reg.c:
2431 * w32proc.c:
2432 * w32menu.c:
2433 * w32inevt.c:
2434 * w32heap.c:
2435 * w32font.c:
2436 * w32fns.c:
2437 * w32console.c:
2438 * w32.c:
2439 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2440 by lisp.h. This completes removal of setjmp.h inclusion
2441 erroneously announced in the previous commit. (Bug#12446)
2442
2443 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2444 more accurate.
2445
2446 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2447 not defined as a macro. The latter happens on MS-Windows.
2448 (Bug#12446)
2449
2450 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2451
2452 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2453 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2454 Some instances of '#include <setjmp.h>' removed, if the
2455 only reason for the instance was because "lisp.h" was included.
2456 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2457 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2458 and _longjmp with the new symbols. Emacs already uses _setjmp if
2459 available, so this change affects only POSIXish hosts that have
2460 sigsetjmp but not _setjmp, such as some versions of Solaris and
2461 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2462 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2463 (png_load_body) [HAVE_PNG]:
2464 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2465 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2466 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2467 since PNG requires jmp_buf. This is the only exception to the
2468 general rule that we now use sys_setjmp and sys_longjmp.
2469 This exception is OK since this code does not change the signal
2470 mask or longjmp out of a signal handler.
2471
2472 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2473
2474 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2475 Include "syssignal.h", for 'main_thread'.
2476
2477 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2478
2479 Avoid out-of-range marker position (Bug#12426).
2480 * insdel.c (replace_range, replace_range_2):
2481 Adjust markers before overlays, as suggested by comments.
2482 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2483 Remove redundant check before calling offset_intervals.
2484
2485 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2486
2487 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2488 current buffer (Bug#12387).
2489
2490 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2491
2492 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2493
2494 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2495
2496 Use a more backwards-compatible timer format (Bug#12430).
2497 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2498 vector element, not from the 4th, since PSECS is now at the end.
2499 (Fcurrent_idle_time): Doc fix.
2500
2501 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2502
2503 Function to mark objects and remove killed buffers at once.
2504 * alloc.c (discard_killed_buffers): Rename to ...
2505 (mark_discard_killed buffers) ... new name. Add marking
2506 of remaining objects. Fix comment. Adjust users.
2507 (mark_object): Do not touch frame buffer lists here.
2508 * frame.c (delete_frame): Reset frame buffer lists here.
2509
2510 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2511
2512 Better workaround for GNOME bug when --enable-gcc-warnings.
2513 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2514 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2515 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2516
2517 Simplify SIGIO usage (Bug#12408).
2518 The code that dealt with SIGIO was crufty and confusing, e.g., it
2519 played tricks like "#undef SIGIO" but these tricks were not used
2520 consistently. Simplify mostly by not #undeffing standard symbols,
2521 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2522 or not as we please) rather than "defined SIGIO" (standard symbol
2523 that we probably shouldn't #undef).
2524 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2525 Modules that need it can include it.
2526 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2527 * dispextern.h (ignore_sigio): New decl.
2528 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2529 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2530 * emacs.c (shut_down_emacs):
2531 * keyboard.c (kbd_buffer_store_event_hold):
2532 Use ignore_sigio rather than invoking 'signal' directly.
2533 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2534 for FIONREAD.
2535 (FIONREAD, SIGIO): Do not #undef.
2536 (tty_read_avail_input): Use #error rather than a syntax error.
2537 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2538 for I_PIPE, used by SETUP_SLAVE_PTY.
2539 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2540 * sysdep.c (croak): Remove; no longer needed. This bit of
2541 temporary code, with Fred N. Fish's comment that it's temporary,
2542 has been in Emacs since at least 1992!
2543 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2544 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2545 * syssignal.h (croak): Remove decl.
2546 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2547 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2548 now that we're termios-only.
2549 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2550 * term.c (dissociate_if_controlling_tty): Use #error rather than
2551 a run-time error.
2552
2553 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2554 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2555 to work around GNOME bug 683906.
2556 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2557 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2558 This works around GCC bug 54561.
2559
2560 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2561
2562 More fixes for 'volatile' and setjmp/longjmp.
2563 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2564 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2565 (png_load_body) [HAVE_PNG]:
2566 (jpeg_load_body) [HAVE_JPEG]:
2567 New function, with most of the old parent function's body.
2568 (png_load) [HAVE_PNG]:
2569 (jpeg_load) [HAVE_JPEG]:
2570 Invoke the new function, to avoid longjmp munging our locals.
2571 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2572 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2573 longjmp is passed 2, as the C standard doesn't guarantee this.
2574 Instead, store the failure code into mgr->failure_code.
2575
2576 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2577
2578 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2579 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2580 (syms_of_keyboard): Remove support for unread-command-char.
2581
2582 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2583
2584 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2585 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2586 violation. (Bug#12426)
2587
2588 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2589
2590 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2591
2592 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2593
2594 * eval.c: Add `inhibit-debugger'.
2595 (Qinhibit_debugger): New symbol.
2596 (call_debugger): Bind it instead of Qdebug_on_error.
2597 (maybe_call_debugger): Test Vinhibit_debugger.
2598 (syms_of_eval): Define inhibit-debugger.
2599 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2600 (syms_of_xdisp): Remove inhibit-debug-on-message.
2601
2602 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2603
2604 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2605 If a nonvolatile local variable is written before a _longjmp to
2606 the frame containing the variable, and is read after the _longjmp,
2607 the value read is indeterminate. Some local variables of type
2608 'struct handler' and 'struct catchtag' are used in this way, so
2609 mark each of their slots as volatile if the slot can be set before
2610 _longjmp and read afterwards.
2611 * lisp.h (struct handler): var and chosen_clause are now volatile.
2612 (struct catchtag): val, next, and pdlcount are now volatile.
2613
2614 * bidi.c (bidi_push_it, bidi_pop_it):
2615 * fns.c (copy_hash_table):
2616 * image.c (define_image_type):
2617 * keyboard.c (kbd_buffer_store_event_hold):
2618 * process.c (Fprocess_send_eof):
2619 * xfaces.c (x_create_gc) [HAVE_NS]:
2620 * xgselect.c (xg_select):
2621 Prefer assignment to memcpy when either will do.
2622
2623 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2624 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2625 time an item is removed. No need to mark this function 'inline';
2626 the compiler knows better than we do.
2627
2628 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2629
2630 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2631 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2632 to change_frame_size (Bug#12388).
2633 (windowDidResize:): Pass YES to updateFrameSize.
2634
2635 * nsterm.h: Add delay parameter to updateFrameSize.
2636
2637 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2638
2639 Discard killed buffers from deleted window and frame objects.
2640 This reduces an amount of references to killed buffers and
2641 helps GC to reclaim them faster.
2642 * alloc.c (discard_killed_buffers): New function.
2643 (mark_object): Use it for deleted windows and frames.
2644 (mark_object): If symbol's value is set up for a killed buffer
2645 or deleted frame, restore its global binding.
2646 * data.c (swap_in_global_binding): Add GC notice.
2647 (swap_in_symval_forwarding): Use convenient set_blv_where.
2648 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2649 * window.h: ... to here.
2650
2651 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2652
2653 Convenient macro to check whether the buffer is live.
2654 * buffer.h (BUFFER_LIVE_P): New macro.
2655 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2656 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2657
2658 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2659
2660 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2661 composition cases (Bug#12364).
2662
2663 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2664 overhang of succeeding glyphs overlapping box cursor.
2665
2666 * w32term.c (x_draw_glyph_string): Likewise.
2667
2668 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2669
2670 Simplify, document, and port floating-point (Bug#12381).
2671 The porting part of this patch fixes bugs on non-IEEE platforms
2672 with frexp, ldexp, logb.
2673 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2674 Now static.
2675 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2676 support, by removing commented-out code and briefly listing the
2677 C89 functions excluded. The commented-out stuff was confusing
2678 maintenance, e.g., we thought we needed cbrt but it was commented out.
2679 (logb): Remove decl; no longer needed.
2680 (isfinite): New macro, if not already supplied.
2681 (isnan): Don't replace any existing macro.
2682 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2683 are present on all C89 platforms.
2684 (Ffrexp): Do not special-case zero, as frexp does the right thing
2685 for that case.
2686 (Flogb): Do not use logb, as it doesn't have the desired meaning
2687 on hosts that use non-base-2 floating point. Instead, stick with
2688 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2689 frexp, to avoid getting an unspecified result.
2690
2691 * xdisp.c (Qinhibit_debug_on_message): Now static.
2692
2693 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2694
2695 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2696 NSBezierPath (Bug#12131).
2697
2698 2012-09-10 Chong Yidong <cyd@gnu.org>
2699
2700 * fns.c (Fdelq, Fdelete): Doc fix.
2701
2702 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2703
2704 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2705 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2706
2707 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2708
2709 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2710 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2711 Use it.
2712
2713 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2714
2715 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2716 left fringe if the window has a left margin. This avoids leaving
2717 traces of the cursor because its leftmost pixel is not drawn over.
2718
2719 * dispnew.c (update_window_line): When the left margin area of a
2720 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2721 that screen line. (Bug#12277)
2722
2723 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2724
2725 Assume C89 or later for math functions (Bug#12381).
2726 This simplifies the code, and makes it a bit smaller and faster,
2727 and (most important) makes it easier to clean up signal handling
2728 since we can stop worring about floating-point exceptions in
2729 library code. That was a problem before C89, but the problem
2730 went away many years ago on all practical Emacs targets.
2731 * data.c, image.c, lread.c, print.c:
2732 Don't include <math.h>; no longer needed.
2733 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2734 might be autoconfigured, as that never happens.
2735 * data.c (fmod):
2736 * doprnt.c (DBL_MAX_10_EXP):
2737 * print.c (DBL_DIG):
2738 Remove. C89 or later always defines these.
2739 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2740 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2741 (arith_error, domain_error, domain_error2):
2742 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2743 no longer needed -- we simply return what C returns. All uses removed.
2744 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2745 the wrapped code.
2746 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2747 Remove. All uses expanded, as these macros are no longer used
2748 more than once and are now more trouble than they're worth.
2749 (Ftan): Use tan, not sin / cos.
2750 (Flogb): Assume C89 frexp.
2751 (fmod_float): Assume C89 fmod.
2752 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2753 (init_floatfns): Remove. All uses removed.
2754
2755 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2756
2757 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2758 compositeToPoint for OSX < 10.6 (Bug#12390).
2759
2760 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2761
2762 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2763 This produces more-accurate results.
2764
2765 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2766
2767 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2768 changes (Bug#12088).
2769
2770 2012-09-08 Chong Yidong <cyd@gnu.org>
2771
2772 * syntax.c (Fstring_to_syntax): Doc fix.
2773
2774 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2775
2776 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2777 in the internal border.
2778 (x_set_window_size): Remove static variables and their usage.
2779 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2780 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2781 Remove fringe/internal border adjustment (Bug#11052).
2782 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2783 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2784 (ns_fix_rect_ibw): Remove.
2785 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2786 (ns_dumpglyphs_box_or_relief): Ditto.
2787 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2788 adjustment.
2789 (ns_dumpglyphs_image): Ditto.
2790 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2791 border adjustment.
2792 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2793 their usage. Add fringe_extended_p and its use as in other terms.
2794 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2795 scroll bar was removed.
2796 (updateFrameSize): New function.
2797 (windowDidResize): Move code to updateFrameSize and call it.
2798
2799 * nsterm.h (EmacsView): Add updateFrameSize.
2800
2801 2012-09-07 Chong Yidong <cyd@gnu.org>
2802
2803 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2804
2805 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2806
2807 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2808
2809 More signal-handler cleanup (Bug#12327).
2810 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2811 Problem introduced when merging patches. Noted by Eli Zaretskii in
2812 <http://bugs.gnu.org/12327#67>.
2813 * floatfns.c: Comment fix.
2814 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2815 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2816 and anyway the declaration is harmless even if SIGDANGER is not defined.
2817 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2818 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2819 source files not surprisingly expected syssignal.h to define, or
2820 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2821 Include <sys/ioctl.h>, for FIONREAD.
2822 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2823 This eliminates a problem whereby other files mysteriously had
2824 to include "syssignal.h" before including "systty.h" if they
2825 wanted to use "#ifdef SIGIO".
2826
2827 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2828
2829 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2830
2831 * w32.c (sigemptyset): Empty the set.
2832 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2833
2834 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2835
2836 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2837
2838 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2839 (mark_object): Likewise for frame objects.
2840
2841 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2842
2843 * syssignal.h (handle_on_main_thread): Always declare,
2844 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2845 This ports to platforms without HAVE_PTHREAD.
2846
2847 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2848
2849 Signal-handler cleanup (Bug#12327).
2850 Emacs's signal handlers were written in the old 4.2BSD style with
2851 sigblock and sigmask and so forth, and this led to some
2852 inefficiencies and confusion. Rewrite these to use
2853 pthread_sigmask etc. without copying signal sets around. Also,
2854 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2855 'signal', and instead use functions that do not attempt to take
2856 over the system name space. This patch causes Emacs's text
2857 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2858 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2859 Do not include <signal.h> or "syssignal.h", as these
2860 modules do not use signals.
2861 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2862 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2863 Do not include <signal.h>, as "syssignal.h" does that for us now.
2864 * atimer.c (sigmask_atimers): New function.
2865 (block_atimers, unblock_atimers): New functions,
2866 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2867 All uses replaced.
2868 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2869 no longer needed here.
2870 * emacs.c (main): Inspect existing signal handler with sigaction,
2871 so that there's no need to block and unblock SIGHUP.
2872 * sysdep.c (struct save_signal): New member 'action', replacing
2873 old member 'handler'.
2874 (save_signal_handlers, restore_signal_handlers):
2875 Use sigaction instead of 'signal' to save and restore.
2876 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2877 New function. All users of 'signal' modified to use set_sighandler
2878 if they're writeonly, and to use sys_signal if they're read+write.
2879 (emacs_sigaction_init, forwarded_signal): New functions.
2880 (sys_signal): Remove. All uses replaced by calls to sigaction
2881 and emacs_sigaction_init, or by direct calls to 'signal'.
2882 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2883 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2884 all uses replaced by pthread_sigmask etc. calls.
2885 * syssignal.h: Include <signal.h>.
2886 (emacs_sigaction_init, forwarded_signal): New decls.
2887 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2888 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2889 (sigmask, sys_sigmask): Remove; no longer needed.
2890 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2891 (sigblock, sigunblock, sigfree):
2892 (sigsetmask) [!defined sigsetmask]:
2893 Remove. All uses replaced by pthread_sigmask.
2894 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2895 no longer need to be replaced, and its typical old uses
2896 are now done via emacs_sigaction_init and sigaction.
2897 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2898 (sys_sigdel): Remove; unused.
2899 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2900
2901 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2902
2903 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2904 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2905
2906 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2907
2908 Explicitly mark buffer_defaults and buffer_local_symbols.
2909 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2910 mark_local_symbols here.
2911 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2912 since special buffers aren't marked here any more.
2913 (allocate_buffer): Chain new buffer with all_buffers here...
2914 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2915 not here.
2916 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2917 (syms_of_buffer): Remove staticpro of the above.
2918 (init_buffer_once): Set names for buffer_defaults and
2919 buffer_local_symbols.
2920
2921 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2922
2923 Use bool for booleans in font-related modules.
2924 * font.c (font_intern_prop, font_style_to_value)
2925 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2926 (generate_otf_features, font_check_otf_features, font_check_otf)
2927 (font_match_p, font_list_entities, font_at):
2928 * fontset.c (fontset_id_valid_p, reorder_font_vector
2929 (fontset_find_font, Fset_fontset_font)
2930 (face_suitable_for_char_p) [0]:
2931 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2932 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2933 (m17n_flt_initialized, ftfont_shape_by_flt):
2934 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2935 * nsfont.m (nsfont_draw):
2936 * w32font.c (w32font_draw):
2937 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2938 Use bool for booleans.
2939 * font.h: Adjust to above API changes.
2940 (struct font, struct font_driver, struct font_driver_list):
2941 Use bool for booleans.
2942 (struct font): Remove useless member encoding_type.
2943 All users removed.
2944 * fontset.c, xftfont.c: Omit unnecessary static decls.
2945
2946 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2947
2948 * alloc.c (mark_object): Revert window marking code
2949 since it's unsafe for the Fset_window_configuration.
2950
2951 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2952
2953 Fix race conditions with signal handlers and errno (Bug#12327).
2954 Be more systematic about preserving errno whenever a signal
2955 handler returns, even if it's not in the main thread. Do this by
2956 renaming signal handlers to distinguish between signal delivery
2957 and signal handling. All uses changed.
2958 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2959 * data.c (deliver_arith_signal): Rename from arith_error.
2960 * dispnew.c (deliver_window_change_signal): Rename from
2961 window_change_signal.
2962 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2963 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2964 * keyboard.c (deliver_input_available_signal): Rename from
2965 input_available_signal.
2966 (deliver_user_signal): Rename from handle_user_signal.
2967 (deliver_interrupt_signal): Rename from interrupt_signal.
2968 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2969 (deliver_child_signal): Rename from sigchld_handler.
2970 * atimer.c (handle_alarm_signal):
2971 * data.c (handle_arith_signal):
2972 * dispnew.c (handle_window_change_signal):
2973 * emacs.c (handle_fatal_signal, handle_danger_signal):
2974 * keyboard.c (handle_input_available_signal):
2975 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2976 * process.c (handle_pipe_signal, handle_child_signal):
2977 New functions, with the actual signal-handling code taken from the
2978 original respective signal handlers, sans the sporadic attempts to
2979 preserve errno, since that's now done by handle_on_main_thread.
2980 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2981 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2982 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2983 Move to sysdep.c.
2984 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2985 Move initialization of main_thread to sysdep.c's init_signals.
2986 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2987 our usage, and simplifies the mainline code.
2988 (record_child_status_change): New static function, as a helper
2989 for handle_child_signal, and with most of the old child handler's
2990 contents.
2991 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2992 (handle_child_signal): Use the above.
2993 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2994 Moved here from emacs.c.
2995 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2996 code moved here from emacs.c's main function.
2997 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2998 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2999 This lets callers save and restore errno properly.
3000
3001 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3002
3003 Remove redundant or unused things here and there.
3004 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3005 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3006 * editfns.c (Fcompare_buffer_substrings): Likewise.
3007 * frame.h (struct terminal, struct font_driver_list):
3008 Remove redundant declarations.
3009 * window.h (Qleft, Qright): Likewise.
3010
3011 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3012
3013 Do not mark objects from deleted buffers, windows and frames.
3014 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3015 (mark_object): Likewise for windows and frames.
3016
3017 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3018
3019 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3020 buffer_defaults and buffer_local_symbols as valid objects.
3021 Return special value to denote them.
3022
3023 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3024
3025 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3026 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3027 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3028 (file_name_absolute_p, Fsubstitute_in_file_name):
3029 (check_executable, check_writable, Ffile_accessible_directory_p)
3030 (Fset_file_selinux_context, Fdefault_file_modes)
3031 (Finsert_file_contents, choose_write_coding_system)
3032 (Fwrite_region, build_annotations, a_write, e_write)
3033 (Fdo_auto_save):
3034 * filelock.c (boot_time_initialized, get_boot_time)
3035 (get_boot_time_1, lock_file_1, within_one_second):
3036 * floatfns.c (in_float):
3037 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3038 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3039 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3040 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3041 * window.c (compare_window_configurations):
3042 Use bool for booleans.
3043 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3044 (Fdefault_file_modes): Now mode_t, not int, for modes.
3045 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3046 (internal_delete_file): Now returns void, not a (boolean) int,
3047 since nobody was looking at the return value.
3048 * lisp.h, window.h: Adjust to above API changes.
3049
3050 * xdisp.c (set_message): Simplify and reindent last change.
3051
3052 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3053
3054 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3055
3056 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3057
3058 * eval.c (call_debugger): Make the function non-static so that we
3059 can call it from set_message.
3060
3061 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3062 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3063
3064 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3065
3066 Give more-useful info on a fatal error (Bug#12328).
3067 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3068 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3069 of doing the work ourselves.
3070 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3071 do most of the work.
3072 (fatal_error_backtrace): New function, taken from the guts
3073 of the old fatal_error_signal, but with a new option to output
3074 a backtrace.
3075 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3076 info about the signal than just its number.
3077 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3078 * sysdep.c: Include <execinfo.h>
3079 (emacs_backtrace): New function, taken partly from the previous
3080 code of the 'die' function.
3081 (emacs_abort): Call fatal_error_backtrace rather than abort.
3082
3083 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3084
3085 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3086 eager (load-time) macro-expansion.
3087 * lisp.mk (lisp): Add macroexp.
3088
3089 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3090
3091 Simplify redefinition of 'abort' (Bug#12316).
3092 Do not try to redefine the 'abort' function. Instead, redo
3093 the code so that it calls 'emacs_abort' rather than 'abort'.
3094 This removes the need for the NO_ABORT configure-time macro
3095 and makes it easier to change the abort code to do a backtrace.
3096 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3097 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3098 Remove; sysdep.c's emacs_abort now takes its place.
3099 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3100 'abort' changed to use 'emacs_abort'.
3101 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3102 (abort) [!defined abort]: Rename to ...
3103 (emacs_abort): ... new name.
3104 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3105 the place of the old 'abort' in emacs.c.
3106 * w32.c, w32fns.c (abort): Do not #undef.
3107 * w32.c (emacs_abort): Rename from w32_abort.
3108
3109 2012-09-04 Eli Zaretskii <eliz@gnu.org>
3110
3111 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3112 offsets[j].dv, since the y axis of the screen coordinates points
3113 down, while the y axis of the font definition coordinates points
3114 up. This fixes display of Arabic diacritics such as KASRA and
3115 KASRATAN. (Bug#11860)
3116
3117 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3118
3119 Be more systematic about _setjmp vs setjmp.
3120 * alloc.c (test_setjmp, mark_stack):
3121 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3122 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3123 (png_load, my_error_exit, jpeg_load):
3124 * process.c (send_process_trap, send_process):
3125 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3126 The underscored versions are up to 30x faster on some hosts.
3127 Formerly, the code used setjmp+longjmp sometimes and
3128 _setjmp+_longjmp at other times, with no particular reason to
3129 prefer setjmp+longjmp.
3130
3131 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3132
3133 Fix minor problem found by static checking.
3134 * buffer.c (Fdelete_all_overlays): Return nil.
3135
3136 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3137
3138 * buffer.c (Fdelete_all_overlays): New function.
3139
3140 2012-09-03 Chong Yidong <cyd@gnu.org>
3141
3142 * gtkutil.c: Add extern decl for Qxft.
3143
3144 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3145
3146 * emacs.c, eval.c: Use bool for boolean.
3147 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3148 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3149 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3150 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3151 (main, decode_env_path, Fdaemon_initialized):
3152 * eval.c (call_debugger, Finteractive_p, interactive_p):
3153 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3154 (maybe_call_debugger, Fbacktrace):
3155 * process.c (read_process_output, exec_sentinel):
3156 Use bool for booleans.
3157 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3158 All callers changed.
3159 * eval.c (interactive_p): Omit always-true boolean argument
3160 EXCLUDE_SUBRS_P. All callers changed.
3161 * dispextern.h, lisp.h: Reflect above API changes.
3162 * firstfile.c (dummy): Use the address of 'main', whose signature
3163 won't change, instead of the address of 'initialize', whose
3164 signature just changed from int to bool.
3165 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3166 * msdos.c (fatal_error_in_progress): ... from here.
3167 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3168 of incrementing it.
3169 (redisplay_internal, unwind_redisplay): Simply clear
3170 REDISPLAYING_P when unwinding, instead of saving its previous,
3171 always-false value and then restoring it.
3172
3173 Clean up some extern decls.
3174 Mostly, this hoists extern decls out of .c files and into .h files.
3175 That way, we're more likely to catch errors if the interfaces change.
3176 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3177 declare xg_mark_data.
3178 * dispextern.h (x_frame_parm_handlers):
3179 * font.h (Qxft):
3180 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3181 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3182 (Qultra_bold, Qoblique, Qitalic):
3183 Move extern decl here from .c file.
3184 * alloc.c (xg_mark_data) [USE_GTK]:
3185 * doc.c (Qclosure):
3186 * eval.c (Qlexical_binding):
3187 * fns.c (time) [!HAVE_UNISTD_H]:
3188 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3189 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3190 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3191 * lread.c (Qinternal_interpreter_environment):
3192 * minibuf.c (Qbuffer):
3193 * process.c (QCfamily, QCfilter):
3194 * widget.c (free_frame_faces):
3195 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3196 * xfont.c (x_clear_errors):
3197 * xterm.c (x_frame_parm_handlers):
3198 Remove now-redundant extern decls.
3199 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3200 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3201 Now static.
3202 * xfaces.c: Remove unnecessary static decls.
3203 * xterm.c (updating_frame): Remove decl of nonexistent object.
3204
3205 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3206 when building globals.h, as the objects that are not built on
3207 this host are not needed to compile C files on this host.
3208
3209 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3210
3211 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3212
3213 * frame.h: Add missing prototype for x_wm_set_size_hint.
3214
3215 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3216
3217 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3218 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3219 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3220 (Fsubstitute_command_keys):
3221 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3222 (save_excursion_save, save_excursion_restore)
3223 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3224 (format_time_string, general_insert_function)
3225 (make_buffer_string, make_buffer_string_both)
3226 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3227 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3228 (copy_text, insert_1, insert_1_both, insert_from_string)
3229 (insert_from_string_before_markers, insert_from_string_1)
3230 (insert_from_buffer, insert_from_buffer_1, replace_range)
3231 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3232 (del_range_2, modify_region):
3233 * intervals.c (intervals_equal, balance_possible_root_interval)
3234 (adjust_intervals_for_insertion, merge_properties_sticky)
3235 (graft_intervals_into_buffer, lookup_char_property)
3236 (adjust_for_invis_intang, set_point_both)
3237 (get_property_and_range, compare_string_intervals)
3238 (set_intervals_multibyte_1, set_intervals_multibyte):
3239 * keyboard.c (decode_timer):
3240 Use bool for boolean.
3241 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3242 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3243
3244 2012-09-02 Chong Yidong <cyd@gnu.org>
3245
3246 * keymap.c (push_key_description): Print M-TAB as C-M-i
3247 (Bug#11758).
3248
3249 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3250
3251 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3252 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3253 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3254 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3255 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3256 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3257 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3258
3259 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3260
3261 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3262 more than one grapheme cluster passed to the shaper: compute the
3263 offset adjustment values separately for each cluster. (Bug#11860)
3264
3265 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3266 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3267 about implicit conversions from integer to pointer.
3268
3269 2012-09-01 Daniel Colascione <dancol@dancol.org>
3270
3271 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3272 system used too early.
3273
3274 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3275
3276 Better seed support for (random).
3277 * emacs.c (main): Call init_random.
3278 * fns.c (Frandom): Set the seed from a string argument, if given.
3279 Remove long-obsolete Gentzel cruft.
3280 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3281 (init_random): New function.
3282
3283 2012-09-01 Daniel Colascione <dancol@dancol.org>
3284
3285 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3286 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3287 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3288 x_wm_set_size_hint, x_query_colors, x_real_positions,
3289 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3290 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3291 all of which have been moved to common code.
3292
3293 * xfaces.c: Include TERM_HEADER instead of listing all possible
3294 window-system headers.
3295
3296 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3297 to match header.
3298
3299 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3300 directly accessing frame internals.
3301
3302 * w32font.h: Include font.h. Define syms_of_w32font and
3303 globals_of_w32font.
3304
3305 * process.c: Include TERM_HEADER instead of listing all possible
3306 window-system headers.
3307
3308 * nsterm.h: Remove declarations now in frame.h.
3309 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3310
3311 * menu.c: Include TERM_HEADER instead of listing all possible
3312 window-system headers.
3313
3314 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3315 window system.
3316
3317 * keyboard.c: Include TERM_HEADER instead of listing all possible
3318 window-system headers.
3319
3320 * image.c: Include TERM_HEADER instead of listing all possible
3321 window-system headers. Declare Vlibrary_cache when compiling for
3322 Windows.
3323
3324 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3325 window system declarations.
3326
3327 * frame.h: Move common functions here: set_frame_menubar,
3328 x_set_window_size, x_sync, x_get_focus_frame,
3329 x_set_mouse_position, x_set_mouse_pixel_position,
3330 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3331 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3332 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3333 x_activate_menubar, x_real_positions, x_bitmap_icon,
3334 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3335 and x_query_colors.
3336
3337 * frame.c: Include TERM_HEADER instead of listing all possible
3338 window-system headers.
3339
3340 * font.c: Include TERM_HEADER instead of listing all possible
3341 window-system headers.
3342
3343 * emacs.c: Include TERM_HEADER.
3344
3345 * dispnew.c: Include TERM_HEADER instead of listing all possible
3346 window-system headers.
3347
3348 * ccl.h: Include character.h.
3349
3350 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3351 the current window system; include in list of objects to link into
3352 Emacs.
3353
3354 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3355
3356 Remove mark_ttys function and fix tty_display_info initialization.
3357 * lisp.h (mark_ttys): Remove prototype.
3358 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3359 to mark_ttys because all possible values of 'top_frame' slot are
3360 the frames which are reachable from Vframe_list.
3361 * term.c (mark_ttys): Remove.
3362 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3363
3364 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3365
3366 Change struct frame bitfields from unsigned char to unsigned.
3367 * frame.h (struct frame): Change type of 'display_preempted',
3368 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3369 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3370 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3371 bitfields from unsigned char to unsigned.
3372
3373 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3374
3375 Remove unused member of struct x_output and struct w32_output.
3376 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3377 * w32term.h (struct w32_output): Likewise.
3378
3379 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3380
3381 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3382 does not become zero (Bug#12234).
3383
3384 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3385
3386 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3387 for GCC 4.7.1 x86-64.
3388
3389 2012-08-30 Glenn Morris <rgm@gnu.org>
3390
3391 * lread.c (init_lread): For out-of-tree builds, only add the
3392 source directory's site-lisp dir to the load-path if it exists,
3393 consistent with in-tree builds. (Bug#12302)
3394
3395 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3396
3397 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3398 button_values to NULL. Call setStykeMask so dialogs get a close button.
3399 (windowShouldClose:): Set window_closed.
3400 (dealloc): New member, free button_values.
3401 (process_dialog:): Make member function. Remove window argument,
3402 replace window with self. Count buttons and allocate and store values
3403 in button_values.
3404 (addButton:value:row:): value is int with the name tag. Call setTag
3405 with tag. Remove return self, declare return value as void.
3406 (addString:row:): Remove return self, declare return value as void.
3407 (addSplit): Remove return self, declare return value as void.
3408 (clicked:): Remove return self, declare return value as void.
3409 Set dialog_return to button_values[seltag]. Code formatting change.
3410 (initFromContents:isQuestion:): Adjust call to process_dialog.
3411 Code formatting change.
3412 (timeout_handler:): Set timer_fired to YES.
3413 (runDialogAt:): Set timer_fired to NO.
3414 Handle click on close button as quit.
3415
3416 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3417 Add window_closed and button_values. Add void as return value for
3418 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3419 Add process_dialog as new member.
3420
3421 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3422
3423 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3424 is not one of the heaps we manage. (Bug#12242)
3425
3426 2012-08-28 Glenn Morris <rgm@gnu.org>
3427
3428 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3429
3430 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3431
3432 * window.c (Fset_window_configuration): Remove handling of
3433 auto-buffer-name window parameter. Install revision of reverted
3434 fix.
3435
3436 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3437
3438 Do not allow to set major mode for a dead buffer.
3439 * buffer.c (Fset_buffer_major_mode): Signal an error
3440 if the buffer is dead.
3441 (Fother_buffer, other_buffer_safely): Remove redundant
3442 nested declaration.
3443
3444 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3445
3446 Always use set_buffer_if_live to restore original buffer at unwind.
3447 * buffer.h (record_unwind_current_buffer): New function.
3448 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3449 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3450 * undo.c, window.c: Adjust users.
3451 * buffer.c (set_buffer_if_live): Fix comment.
3452
3453 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3454
3455 Fix usage of set_buffer_internal.
3456 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3457 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3458 * coding.c (decode_coding): Omit redundant test.
3459 * fileio.c (decide_coding_unwind): Likewise.
3460 * fns.c (secure_hash): Likewise.
3461 * insdel.c (modify_region): Likewise.
3462 * keyboard.c (command_loop_1): Likewise.
3463 * print.c (PRINTFINISH): Likewise.
3464 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3465
3466 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3467
3468 * dispnew.c: Use bool for boolean.
3469 (frame_garbaged, display_completed, delayed_size_change)
3470 (fonts_changed_p, add_window_display_history)
3471 (add_frame_display_history, verify_row_hash)
3472 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3473 (row_equal_p, realloc_glyph_pool)
3474 (allocate_matrices_for_frame_redisplay)
3475 (showing_window_margins_p)
3476 (adjust_frame_glyphs_for_frame_redisplay)
3477 (build_frame_matrix_from_leaf_window, make_current)
3478 (mirrored_line_dance, mirror_line_dance, update_frame)
3479 (update_window_tree, update_single_window)
3480 (check_current_matrix_flags, update_window, update_text_area)
3481 (update_window_line, set_window_update_flags, scrolling_window)
3482 (update_frame_1, scrolling, buffer_posn_from_coords)
3483 (do_pending_window_change, change_frame_size)
3484 (change_frame_size_1, sit_for):
3485 Use bool for boolean.
3486 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3487 and remove last int (actually boolean) argument, which was always 0.
3488 All callers changed.
3489 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3490 * dispextern.h (struct composition_it): Use bool for boolean.
3491 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3492 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3493 * dired.c (file_name_completion):
3494 Use bool for boolean. (This was missed in an earlier change.)
3495
3496 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3497
3498 * window.c (Fset_window_configuration): Revert first part of
3499 last change.
3500
3501 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3502
3503 * nsterm.h (NSPanel): New class variable dialog_return.
3504
3505 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3506 Initialize dialog_return.
3507 (windowShouldClose:): Use stop instead of stopModalWithCode.
3508 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3509 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3510 event.
3511 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3512 modal loop returns.
3513
3514 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3515
3516 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3517 * composite.c (find_composition, composition_gstring_p)
3518 (composition_reseat_it, find_automatic_composition):
3519 * data.c (let_shadows_buffer_binding_p)
3520 (let_shadows_global_binding_p, set_internal, make_blv)
3521 (Fmake_variable_buffer_local, Fmake_local_variable)
3522 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3523 (cons_to_signed, arith_driver):
3524 * dbusbind.c (xd_in_read_queued_messages):
3525 * dired.c (directory_files_internal, file_name_completion):
3526 Use bool for booleans.
3527 * dired.c (file_name_completion):
3528 * process.h (fd_callback):
3529 Omit int (actually boolean) argument. It wasn't being used.
3530 All uses changed.
3531 * composite.h, lisp.h: Reflect above API changes.
3532
3533 * cmds.c, coding.c: Use bool for booleans.
3534 * cmds.c (move_point, Fself_insert_command):
3535 * coding.h (struct composition status, struct coding_system):
3536 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3537 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3538 (emacs_mule_char, decode_coding_emacs_mule)
3539 (encode_coding_emacs_mule, detect_coding_iso_2022)
3540 (decode_coding_iso_2022, encode_invocation_designation)
3541 (encode_designation_at_bol, encode_coding_iso_2022)
3542 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3543 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3544 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3545 (encode_coding_raw_text, detect_coding_charset)
3546 (decode_coding_charset, encode_coding_charset, detect_eol)
3547 (detect_coding, get_translation_table, produce_chars)
3548 (consume_chars, reused_workbuf_in_use)
3549 (make_conversion_work_buffer, code_conversion_save)
3550 (decode_coding_object, encode_coding_object)
3551 (detect_coding_system, char_encodable_p)
3552 (Funencodable_char_position, code_convert_region)
3553 (code_convert_string, code_convert_string_norecord)
3554 (Fset_coding_system_priority):
3555 * fileio.c (Finsert_file_contents):
3556 Use bool for booleans.
3557 * coding.h, lisp.h: Reflect above API changes.
3558 * coding.c: Remove unnecessary static function decls.
3559 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3560 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3561 not a boolean 'int', since callers never look at the return value.
3562 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3563 * coding.h (decoding_buffer_size, encoding_buffer_size)
3564 (emacs_mule_string_char): Remove unused extern decls.
3565 (struct iso_2022_spec, struct coding_system):
3566 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3567 (struct emacs_mule_spec): Remove unused field 'full_support'.
3568 All initializations removed.
3569 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3570
3571 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3572
3573 Fix spare memory change (Bug#12286).
3574 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3575 (valid_lisp_object_p): Likewise.
3576
3577 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3578
3579 * window.c (Fset_window_configuration): Record any window's old
3580 buffer if it's replaced (see Bug#8789). If the new current
3581 buffer doesn't appear in the selected window, go to its old
3582 point (Bug#12208).
3583
3584 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3585
3586 Special MEM_TYPE_SPARE to denote reserved memory.
3587 * alloc.c (enum mem_type): New memory type.
3588 (refill_memory_reserve): Use new type for spare memory.
3589 This prevents live_cons_p and live_string_p from incorrect
3590 detection of uninitialized objects from spare memory as live.
3591
3592 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3593
3594 Spelling fixes.
3595 * Makefile.in (.PHONY): versioclean -> versionclean.
3596
3597 Remove unused external symbols.
3598 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3599 * window.c (Qwindow_valid_p, decode_valid_window):
3600 Now static, not extern.
3601 * data.c (Qinterval): Remove; unused.
3602 (syms_of_data): Do not define 'interval'.
3603 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3604 * window.h (decode_valid_window):
3605 Remove decls.
3606
3607 * character.c, charset.c, chartab.c: Use bool for booleans.
3608 * character.c (lisp_string_width, string_count_byte8)
3609 (string_escape_byte8):
3610 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3611 (load_charset_map_from_file, map_charset_chars)
3612 (Fdefine_charset_internal, define_charset_internal)
3613 (Fdeclare_equiv_charset, find_charsets_in_text)
3614 (Ffind_charset_region, char_charset, Fiso_charset):
3615 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3616 (sub_char_table_set, sub_char_table_set_range)
3617 (char_table_set_range, optimize_sub_char_table)
3618 (map_sub_char_table):
3619 Use bool for boolean.
3620 * character.c (str_to_unibyte): Omit last boolean argument; it was
3621 always 0. All callers changed.
3622 * character.h, charset.h: Adjust to match previous changes.
3623 * character.h (char_printable_p): Remove decl of nonexistent function.
3624 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3625 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3626 are all boolean, so make them single-bit bitfields.
3627
3628 * lisp.h (ASET): Remove attempt to detect side effects.
3629 It was meant to be temporary and it often doesn't work,
3630 because when IDX has side effects the behavior of IDX==IDX
3631 is undefined. See Stefan Monnier in
3632 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3633
3634 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3635
3636 * lisp.h (functionp): New function (extracted from Ffunctionp).
3637 (FUNCTIONP): Use it.
3638 * eval.c (Ffunctionp): Use it.
3639
3640 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3641
3642 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3643 as that's faster and simpler than static storage. Don't bother
3644 with the g_main_context_query overhead if g_main_context_pending
3645 says no events are pending.
3646 (gfds, gfds_size): Remove these static vars.
3647 (xgselect_initialize): Remove; no longer needed.
3648 All uses and decls removed.
3649
3650 * emacs.c (fatal_error_signal_hook): Remove.
3651 All uses removed. This leftover from old code was always 0.
3652
3653 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3654 * casefiddle.c (casify_object, casify_region):
3655 * casetab.c (set_case_table):
3656 * category.c, category.h (word_boundary_p):
3657 * category.h (CHAR_HAS_CATEGORY):
3658 Use bool for booleans, instead of int.
3659
3660 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3661
3662 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3663
3664 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3665
3666 On assertion failure, print backtrace if available.
3667 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3668 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3669 * Makefile.in (LIB_EXECINFO): New macro.
3670 (LIBES): Use it.
3671
3672 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3673 * bytecode.c (exec_byte_code):
3674 * callint.c (check_mark, Fcall_interactively):
3675 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3676 (getenv_internal, sync_process_alive, call_process_exited):
3677 * lisp.h (USE_SAFE_ALLOCA):
3678 Use bool for booleans, instead of int.
3679 * lisp.h, process.h: Adjust prototypes to match above changes.
3680 * callint.c (Fcall_interactively): Don't assume the mark's
3681 offset fits in 'int'.
3682
3683 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3684
3685 * buffer.c, buffer.h: Use bool for boolean.
3686 * buffer.c (reset_buffer_local_variables)
3687 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3688 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3689 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3690 (overlay_touches_p, overlay_strings, Foverlay_put)
3691 (report_overlay_modification, call_overlay_mod_hooks):
3692 (mmap_enlarge, mmap_set_vars):
3693 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3694 Use bool for booleans, instead of int.
3695 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3696 since the 1-or-0 return value is always ignored anyway.
3697 (mmap_initialized_p):
3698 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3699 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3700
3701 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3702
3703 * bidi.c: Use bool for boolean.
3704 This is a bit more readable, and makes the text segment of bidi.o
3705 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3706 Presumably it's faster too.
3707 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3708 Now bool.
3709 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3710 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3711 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3712 (bidi_explicit_dir_char, bidi_level_of_next_char)
3713 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3714 Use bool for booleans, instead of int.
3715 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3716 (bidi_unshelve_cache): Adjust decls to match code.
3717
3718 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3719
3720 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3721 argument.
3722
3723 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3724
3725 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3726 * atimer.h: Include <stdbool.h>.
3727
3728 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3729
3730 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3731 compile time tests instead of run time tests on systems that do
3732 not use them.
3733 (FRAME_MAC_P): Remove leftover from deleted code.
3734 * frame.c (syms_of_frame): Remove leftover from deleted code.
3735
3736 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3737
3738 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3739
3740 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3741
3742 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3743 Otherwise, the compiler complains about (A?B:C) where B is void
3744 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3745 (fontset_add): Return void, for FONTSET_ADD.
3746
3747 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3748
3749 * alloc.c: Use bool for booleans.
3750 (gc_in_progress, abort_on_gc)
3751 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3752 (dont_register_blocks) [GC_MALLOC_CHECK]:
3753 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3754 (check_string_bytes, make_specified_string, memory_full)
3755 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3756 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3757 (mark_stack, valid_pointer_p, make_pure_string)
3758 (Fgarbage_collect, survives_gc_p, gc_sweep):
3759 Use bool for booleans, instead of int.
3760 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3761 Remove unused local.
3762 * alloc.c (PURE_POINTER_P):
3763 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3764 * editfns.c (Fformat):
3765 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3766 (Fdo_auto_save):
3767 * fns.c (sweep_weak_table):
3768 * lisp.h (suppress_checking, push_message, survives_gc_p)
3769 (make_pure_string, gc_in_progress, abort_on_gc):
3770 * lread.c (readchar, read1):
3771 * print.c (Fprin1_to_string):
3772 * xdisp.c (push_message):
3773 Use bool for booleans affected directly or indirectly by
3774 alloc.c's changes.
3775
3776 Make recently-introduced setters macros.
3777 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3778 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3779 (set_fontset_default, set_fontset_fallback): Rename from their
3780 upper-case counterparts, and make them functions rather than macros.
3781 This is more consistent with the other recently-introduced setters.
3782 These don't need to be inline, since they're local.
3783
3784 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3785
3786 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3787 the loop (Bug#12247).
3788
3789 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3790
3791 * lisp.h (vcopy): Use memcpy rather than our own loop.
3792 This fixes a performance regression introduced by the recent
3793 addition of vcopy. This means 'vcopy' will need to be modified
3794 for a copying collector, but that's OK. Also, tighten the
3795 checking in the assertion.
3796
3797 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3798
3799 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3800 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3801 non-base glyph for the width of the base character, according to
3802 what x_draw_composite_glyph_string_foreground expects.
3803 Generate WADJUST value according to composition_gstring_width's
3804 expectations, to produce correct width of the composed character.
3805 Reverse the sign of the DU offset produced by ScriptPlace.
3806
3807 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3808
3809 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3810
3811 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3812
3813 Avoid direct writes to contents member of struct Lisp_Vector.
3814 * lisp.h (vcopy): New function to copy data into vector.
3815 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3816 * fns.c (Ffillarray): Use ASET.
3817 * keyboard.c (timer_check_2): Use AREF and ASET.
3818 (append_tool_bar_item, Frecent_keys): Use vcopy.
3819 * lread.c (read_vector): Use ASET.
3820 * msdos.c (Frecent_doskeys): Use vcopy.
3821 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3822 (Finternal_merge_in_global_face): Use ASET and vcopy.
3823 * xfont.c (xfont_list_pattern): Likewise.
3824
3825 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3826
3827 * window.c (Fwindow_point): For the selected window always return
3828 the position of its buffer's point.
3829 (Fset_window_point): For the selected window always go in its
3830 buffer to the specified position.
3831
3832 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3833
3834 Setter macros for fontsets.
3835 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3836 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3837 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3838 Adjust users.
3839
3840 2012-08-20 Glenn Morris <rgm@gnu.org>
3841
3842 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3843 Don't assume that `ln -f' works.
3844
3845 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3846
3847 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3848 and later about non-assignments with no effect. See discussion at
3849 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3850 details.
3851
3852 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3853
3854 Inline setter functions for Lisp_Objects slots of struct specbinding.
3855 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3856 Adjust users.
3857
3858 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3859
3860 * window.c (select_window): Always make selected window's buffer
3861 current.
3862
3863 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3864
3865 Use AREF and ASET for docstrings of category tables.
3866 * category.h (CATEGORY_DOCSTRING): Use AREF.
3867 (SET_CATEGORY_DOCSTRING): Use ASET.
3868 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3869
3870 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3871
3872 Inline setter functions for hash table members.
3873 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3874 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3875 (set_hash_key_and_value, set_hash_index, set_hash_next)
3876 (set_hash_hash): New functions.
3877 * charset.c, fns.c: Adjust users.
3878
3879 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3880
3881 Inline getter and setter functions for per-buffer values.
3882 * buffer.h (per_buffer_default, set_per_buffer_default)
3883 (per_buffer_value, set_per_buffer_value): New functions.
3884 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3885 * buffer.c, data.c: Adjust users.
3886
3887 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3888
3889 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3890
3891 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3892
3893 Rely on <config.h> + <unistd.h> to declare 'environ',
3894 as gnulib does this if the system doesn't.
3895 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3896 Remove declaration. MS-Windows declares it on stdlib.h which is
3897 included by conf_post.h.
3898 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3899 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3900 * vm-limit.c: Include <unistd.h>, for 'environ'.
3901
3902 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3903 (start_of_data): Remove decl; mem-limits.h provides it.
3904
3905 * xdisp.c (handle_invisible_prop): Make it a bit faster
3906 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3907
3908 2012-08-19 Chong Yidong <cyd@gnu.org>
3909
3910 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3911 ends (Bug#3874).
3912
3913 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3914
3915 * .gdbinit: Use call instead of set when calling a function in the
3916 inferior.
3917
3918 * data.c (set_internal): Don't use set_blv_found.
3919 (Fkill_local_variable): Likewise.
3920
3921 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3922
3923 * nsfont.m (ns_ascii_average_width): Ensure the string
3924 ascii_printable is initialized with a null-terminated character
3925 array. Otherwise, it can contain undesired extra characters.
3926
3927 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3928
3929 port new setting code to Sun C 5.8 2005/10/13
3930 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3931 Return void, not Lisp_Object. Otherwise, the compiler
3932 complains about (A?B:C) where B is void and C is Lisp_Object
3933 when compiling CHAR_TABLE_SET, due to the recent change to
3934 the API of sub_char_table_set_contents.
3935
3936 2012-08-18 Chong Yidong <cyd@gnu.org>
3937
3938 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3939 for the string case (Bug#3874).
3940
3941 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3942
3943 * buffer.h (BSET): Remove (Bug#12215).
3944 Replace all uses with calls to new setter functions.
3945 (bset_bidi_paragraph_direction, bset_case_canon_table)
3946 (bset_case_eqv_table, bset_directory, bset_display_count)
3947 (bset_display_time, bset_downcase_table)
3948 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3949 (bset_last_selected_window, bset_local_var_alist)
3950 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3951 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3952 (bset_width_table):
3953 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3954 (bset_auto_fill_function, bset_auto_save_file_format)
3955 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3956 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3957 (bset_cache_long_line_scans, bset_case_fold_search)
3958 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3959 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3960 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3961 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3962 (bset_header_line_format, bset_indicate_buffer_boundaries)
3963 (bset_indicate_empty_lines, bset_invisibility_spec)
3964 (bset_left_fringe_width, bset_major_mode, bset_mark)
3965 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3966 (bset_name, bset_overwrite_mode, bset_pt_marker)
3967 (bset_right_fringe_width, bset_save_length)
3968 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3969 (bset_scroll_up_aggressively, bset_selective_display)
3970 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3971 (bset_word_wrap, bset_zv_marker):
3972 * category.c (bset_category_table):
3973 * syntax.c (bset_syntax_table):
3974 New setter functions.
3975
3976 * process.h (PSET): Remove (Bug#12215).
3977 Replace all uses with calls to new setter functions.
3978 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3979 (PROCESS_INLINE): New macro.
3980 (pset_childp): New setter function.
3981 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3982 * process.c (PROCESS_INLINE):
3983 Define to EXTERN_INLINE, so that the corresponding functions
3984 are compiled into code.
3985 (pset_buffer, pset_command, pset_decode_coding_system)
3986 (pset_decoding_buf, pset_encode_coding_system)
3987 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3988 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3989 (pset_type, pset_write_queue): New setter functions.
3990
3991 * window.h (WSET): Remove (Bug#12215).
3992 Replace all uses with calls to new setter functions.
3993 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3994 (WINDOW_INLINE): New macro.
3995 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3996 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3997 (wset_total_lines, wset_vertical_scroll_bar)
3998 (wset_window_end_pos, wset_window_end_valid)
3999 (wset_window_end_vpos): New setter functions.
4000 * window.c (WINDOW_INLINE):
4001 Define to EXTERN_INLINE, so that the corresponding functions
4002 are compiled into code.
4003 (wset_combination_limit, wset_dedicated, wset_display_table)
4004 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4005 (wset_new_normal, wset_new_total, wset_next_buffers)
4006 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4007 (wset_prev_buffers, wset_right_fringe_width)
4008 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4009 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4010 (wset_window_parameters):
4011 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4012 (wset_column_number_displayed, wset_region_showing):
4013 New setter functions.
4014
4015 * termhooks.h (TSET): Remove (Bug#12215).
4016 Replace all uses with calls to new setter functions.
4017 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4018 (TERMHOOKS_INLINE): New macro.
4019 (tset_charset_list, tset_selection_alist): New setter functions.
4020 * terminal.c (TERMHOOKS_INLINE):
4021 Define to EXTERN_INLINE, so that the corresponding functions
4022 are compiled into code.
4023 (tset_param_alist): New setter function.
4024
4025 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4026
4027 * keyboard.h (KSET): Remove (Bug#12215).
4028 Replace all uses with calls to new setter functions.
4029 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4030 (KEYBOARD_INLINE): New macro.
4031 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4032 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4033 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4034 New setter functions.
4035 * keyboard.c (KEYBOARD_INLINE):
4036 Define to EXTERN_INLINE, so that the corresponding functions
4037 are compiled into code.
4038 (kset_echo_string, kset_kbd_queue)
4039 (kset_keyboard_translate_table, kset_last_prefix_arg)
4040 (kset_last_repeatable_command, kset_local_function_key_map)
4041 (kset_overriding_terminal_local_map, kset_real_last_command)
4042 (kset_system_key_syms): New setter functions.
4043
4044 * frame.h (FSET): Remove (Bug#12215).
4045 Replace all uses with calls to new setter functions.
4046 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4047 (FRAME_INLINE): New macro.
4048 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4049 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4050 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4051 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4052 (fset_param_alist, fset_root_window, fset_scroll_bars)
4053 (fset_selected_window, fset_title, fset_tool_bar_items)
4054 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4055 * frame.c (FRAME_INLINE):
4056 Define to EXTERN_INLINE, so that the corresponding functions
4057 are compiled into code.
4058 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4059
4060 A few more naming-convention fixes for getters and setters.
4061 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4062 and rename from buffer_overlays_set_before.
4063 (set_buffer_overlays_after): Move here from buffer.h, and rename
4064 from buffer_overlays_set_after.
4065 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4066 All uses changed.
4067 (set_buffer_intervals): Rename from buffer_set_intervals.
4068 * intervals.c (set_interval_object): Move here from intervals.h,
4069 and rename from interval_set_object.
4070 (set_interval_left): Move here from intervals.h, and rename from
4071 interval_set_left.
4072 (set_interval_right): Move here from intervals.h, and rename from
4073 interval_set_right.
4074 (copy_interval_parent): Move here from intervals.h, and rename from
4075 interval_copy_parent.
4076 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4077 (set_interval_plist): Rename from interval_set_plist.
4078 Return void, not Lisp_Object, since no caller uses the result.
4079 * lisp.h (string_intervals): Rename from string_get_intervals.
4080 (set_string_intervals): Rename from string_set_intervals.
4081
4082 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4083 (set_char_table_contents): Rename from char_table_set_contents.
4084 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4085 All uses changed. See the end of
4086 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4087
4088 * lisp.h (CSET): Remove (Bug#12215).
4089 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4090 (set_char_table_purpose): New functions,
4091 replacing CSET. All uses changed. For example, replace
4092 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4093 "set_char_table_parent (char_table, parent);".
4094 The old version was confusing because it used the same name
4095 'parent' for two different things.
4096
4097 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4098
4099 Functions to get and set Lisp_Object fields of buffer-local variables.
4100 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4101 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4102 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4103 * data.c, eval.c, frame.c: Adjust users.
4104
4105 2012-08-17 Chong Yidong <cyd@gnu.org>
4106
4107 * xfaces.c (merge_face_vectors): If the target font specfies a
4108 font spec, make the font's attributes take precedence over
4109 directly-specified attributes.
4110 (merge_face_ref): Recognize :font.
4111
4112 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4113
4114 Do not use memcpy for copying intervals.
4115 * intervals.c (reproduce_interval): New function.
4116 (reproduce_tree, reproduce_tree_obj): Use it.
4117 (reproduce_tree_obj): Remove prototype.
4118
4119 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4120
4121 * lisp.h (duration_to_sec_usec): Remove unused decl.
4122
4123 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4124
4125 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4126 to an allocated instance of NSString, not to the class itself.
4127
4128 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4129
4130 * makefile.w32-in (C_CTYPE_H): New macro.
4131 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4132 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4133 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4134
4135 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4136
4137 Use ASCII tests for character types.
4138 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4139 * xfns.c, xterm.c:
4140 Don't include <ctype.h>; was not needed.
4141 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4142 * sysdep.c, xfaces.c:
4143 Include <c-ctype.h> instead of <ctype.h>.
4144 * nsterm.m: Include <c-ctype.h>.
4145 * charset.c (read_hex):
4146 * doc.c (Fsnarf_documentation):
4147 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4148 (DRIVE_LETTER) [DOS_NT]:
4149 (Ffile_name_directory, Fexpand_file_name)
4150 (Fsubstitute_in_file_name):
4151 * font.c (font_parse_xlfd, font_parse_fcname):
4152 * frame.c (x_set_font_backend):
4153 * gtkutil.c (xg_get_font):
4154 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4155 * nsimage.m (hexchar):
4156 * nsterm.m (ns_xlfd_to_fontname):
4157 * sysdep.c (system_process_attributes):
4158 * xfaces.c (hash_string_case_insensitive):
4159 Use C-locale tests instead of locale-specific tests for character
4160 types, since we want the ASCII interpretation here, not the
4161 interpretation suitable for whatever happens to be the current locale.
4162
4163 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4164
4165 Consistently check windows for validity/liveness
4166 (Bug#11984, Bug#12025, Bug#12026).
4167 * lisp.h (CHECK_VALID_WINDOW): New macro.
4168 * window.c (decode_window): Rename to decode_live_window.
4169 (decode_valid_window, Fwindow_valid_p): New functions.
4170 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4171 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4172 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4173 (Fwindow_prev_sibling, Fwindow_combination_limit)
4174 (Fset_window_combination_limit, Fwindow_use_time)
4175 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4176 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4177 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4178 (Fwindow_hscroll, Fset_window_hscroll)
4179 (Fwindow_redisplay_end_trigger)
4180 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4181 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4182 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4183 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4184 (Fwindow_end, Fset_window_point, Fset_window_start)
4185 (Fpos_visible_in_window_p, Fwindow_line_height)
4186 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4187 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4188 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4189 (Fset_window_parameter, Fwindow_display_table)
4190 (Fset_window_display_table, Fdelete_other_windows_internal)
4191 (Fset_window_buffer, Fset_window_new_total)
4192 (Fset_window_new_normal, Fdelete_window_internal)
4193 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4194 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4195 (Fwindow_scroll_bars): Check whether argument window is a valid or
4196 live window. Update doc-strings.
4197 (syms_of_window): New symbol Qwindow_valid_p.
4198 * keyboard.c (Fposn_at_x_y): Check whether argument
4199 frame_or_window denotes a valid window.
4200
4201 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4202
4203 Fix previous char table change.
4204 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4205 * chartab.c (optimize_sub_char_table): Likewise.
4206
4207 2012-08-16 Chong Yidong <cyd@gnu.org>
4208
4209 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4210
4211 * xfont.c (xfont_open):
4212 * xftfont.c (xftfont_open): Set the font's max_width field.
4213
4214 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4215 min_width to space_width and average_width to the average over
4216 printable ASCII characters.
4217 (ns_char_width): Code cleanup.
4218 (ns_ascii_average_width): New utility function.
4219
4220 * font.h (struct font): Update comments.
4221
4222 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4223
4224 Simple interface to set Lisp_Object fields of character tables.
4225 * lisp.h (CSET): New macro.
4226 (char_table_set_extras, char_table_set_contents)
4227 (sub_char_table_set_contents): New function.
4228 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4229 * syntax.c: Adjust users.
4230
4231 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4232
4233 * eval.c (eval_sub): Bind lexical-binding.
4234 * lread.c (Qlexical_binding): Make non-static.
4235
4236 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4237
4238 * nsmenu.m (popupSession): Remove.
4239 (pop_down_menu): Remove endModalSession.
4240 (timeout_handler:): New method.
4241 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4242 Call runModalForWindow. Check timer_fired when it returns.
4243 If not set, cancel timer and break out of loop.
4244 Otherwise loop again, with a new timeout.
4245
4246 * nsterm.m: Include fcntl.h if present.
4247 (fd_entry, t_readfds, inNsSelect): Remove.
4248 (select_writefds, select_valid, select_timeout, selfds)
4249 (select_mutex, apploopnr): Add.
4250 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4251 Otherwise call kbd_buffer_store_event.
4252 (ns_send_appdefined): Remove release of fd_entry.
4253 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4254 Increment and decrement apploopnr.
4255 (ns_select): If no file descriptors, just do a NSTimer.
4256 Otherwise copy read/write masks and start select thread (fd_handler).
4257 Start main loop and wait for application defined event.
4258 Inform select thread to stop selecting after main loop is exited.
4259 (ns_term_init): Create selfds pipe and set non-blocking.
4260 Initialize select_mutex. Start the select thread (fd_handler).
4261 (fd_handler:): Loop forever, wait for info from the main thread
4262 to either start or stop selecting. When select returns, send
4263 and appdefined event.
4264 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4265 If not call kbd_buffer_store_event.
4266
4267 * nsterm.h (EmacsApp): fd_handler takes id argument.
4268 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4269
4270 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4271
4272 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4273
4274 * region-cache.c (move_cache_gap): Update gap_len using the actual
4275 growth of the boundaries array. Do not change cache_len.
4276 (Bug#12196)
4277
4278 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4279
4280 Generalize and cleanup font subsystem checks.
4281 * font.h (FONT_DEBUG, font_assert): Remove.
4282 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4283 Change font_assert to eassert. Use eassert where appropriate.
4284
4285 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4286
4287 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4288
4289 2012-08-15 Chong Yidong <cyd@gnu.org>
4290
4291 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4292 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4293 extract the font descriptor instead of just the font name.
4294 In that case, return a font spec instead of a string.
4295 (x_last_font_name): Move to this file from xfns.c.
4296
4297 * xfns.c (Fx_select_font): The return value can also be a font
4298 spec. Move x_last_font_name management to gtkutil.c.
4299
4300 * xfaces.c: Make font weight and style symbols non-static.
4301
4302 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4303
4304 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4305 (bug#12117).
4306
4307 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4308
4309 * alloc.c (Fgarbage_collect): Use plural form consistently.
4310
4311 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4312
4313 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4314 iteration through the command loop. Fixes a problem whereby mouse
4315 movements are ignored until the first mouse click.
4316
4317 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4318
4319 Use bool, not int, for Lisp booleans.
4320 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4321 makes Emacs a bit smaller and presumably a bit faster.
4322 * lisp.h: Include <stdbool.h>.
4323 (struct Lisp_Boolfwd, defvar_bool):
4324 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4325 * regex.c [!emacs]: Include <stdbool.h>.
4326 (false, true): Remove; <stdbool.h> does this for us now.
4327
4328 2012-08-14 Chong Yidong <cyd@gnu.org>
4329
4330 * character.c (Fcharacterp): Doc fix (Bug#12076).
4331
4332 * data.c (Findirect_variable): Doc fix (Bug#11040).
4333
4334 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4335
4336 * editfns.c (Fformat): Doc fix (Bug#12059).
4337 (Fsave_current_buffer): Doc fix (Bug#11542).
4338
4339 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4340
4341 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4342 (bug#12022).
4343
4344 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4345
4346 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4347 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4348 * minibuf.c (choose_minibuf_frame, read_minibuf):
4349 * w32fns.c (x_create_tip_frame):
4350 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4351 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4352
4353 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4354
4355 * intervals.c (offset_intervals): Remove obsolete comment.
4356
4357 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4358
4359 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4360
4361 2012-08-14 Gergely Risko <gergely@risko.hu>
4362
4363 * coding.c (decode_coding): Record buffer modification before
4364 disabling undo_list (Bug#11773).
4365
4366 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4367
4368 Revert and cleanup some recent overlay changes.
4369 * buffer.h (enum overlay_type): Remove.
4370 (buffer_get_overlays, buffer_set_overlays): Likewise.
4371 (buffer_set_overlays_before, buffer_set_overlays_after):
4372 New function. Adjust users.
4373 (unchain_both): Add eassert.
4374
4375 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4376
4377 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4378
4379 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4380
4381 * gtkutil.c (xg_mark_data): Don't assume C99.
4382
4383 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4384
4385 * gtkutil.c (xg_frame_tb_info): New struct.
4386 (TB_INFO_KEY): New define.
4387 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4388 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4389 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4390 if not present.
4391 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4392 is up to date. Otherwise store new data.
4393 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4394
4395 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4396
4397 Use KSET for write access to Lisp_Object members of struct kboard.
4398 * keyboard.h (KSET): New macro.
4399 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4400 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4401 * xterm.c: Adjust users.
4402
4403 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4404
4405 Use BSET for write access to Lisp_Object members of struct buffer.
4406 * buffer.h (BSET): New macro.
4407 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4408 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4409 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4410 * window.c, xdisp.c, xfns.c: Adjust users.
4411
4412 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4413
4414 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4415
4416 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4417
4418 * nsterm.m (not_in_argv): New function.
4419 (application:openFile, application:openTempFile:):
4420 (application:openFileWithoutUI:, application:openFiles:): Open file
4421 if not_in_argv returns non-zero (bug#12171).
4422
4423 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4424 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4425 Define for Gtk+ versions less than 3.2.
4426 (xg_get_font_name): Use those functions/macros here.
4427 Reported by Frans Oilinki <moilinki@gmail.com>.
4428
4429 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4430
4431 * unexmacosx.c (copy_data_segment): Copy initialized data in
4432 statically linked libraries from input file rather than memory.
4433
4434 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4435 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4436 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4437
4438 2012-08-10 Glenn Morris <rgm@gnu.org>
4439
4440 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4441 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4442
4443 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4444
4445 Fix last change to allow compilation with low optimization levels.
4446 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4447 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4448
4449 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4450
4451 Use common inline syntax in intervals.h.
4452 * intervals.h (INTERVALS_INLINE): New macro.
4453 Change all users from LISP_INLINE.
4454
4455 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4456
4457 Define Qnone once for all platforms.
4458 * frame.c (Qnone): Define here.
4459 (syms_of_frame): DEFSYM it.
4460 * lisp.h (Qnone): New declaration.
4461 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4462 * xfns.c: Remove duplication. Adjust users.
4463
4464 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4465
4466 Remove unused macros from intervals.h.
4467 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4468 * intervals.c: Adjust comment.
4469
4470 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4471
4472 * w32fns.c <w32_unicode_gui>: New static variable.
4473 (globals_of_w32fns): Initialize it according to os_subtype.
4474 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4475 testing os_subtype.
4476
4477 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4478 Eli Zaretskii <eliz@gnu.org>
4479
4480 Fix bug #10299 with Unicode characters sent by customized
4481 keyboards created by MSKLC.
4482 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4483 (w32_init_class): Use it to initialize the Emacs class with either
4484 ANSI or Unicode API calls.
4485 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4486 later.
4487 (w32_wnd_proc): If the character code sent by WM_CHAR or
4488 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4489 original message. Call DefWindowProcW on NT and later.
4490
4491 2012-08-10 Glenn Morris <rgm@gnu.org>
4492
4493 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4494
4495 * lisp.h (DIRECTORY_SEP): Let configure set it.
4496
4497 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4498
4499 Use TSET for write access to Lisp_Object slots of struct terminal.
4500 * termhooks.h (TSET): New macro.
4501 * coding.c, terminal.c, xselect.c: Adjust users.
4502
4503 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4504
4505 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4506 the failing expression, include them in the error message.
4507 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4508 * lisp.h (internal_condition_case_n): Update declaration.
4509
4510 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4511
4512 Inline functions to examine and change buffer overlays.
4513 * buffer.c (unchain_both): New function.
4514 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4515 (buffer_has_overlays): New function.
4516 (enum overlay_type): New enum.
4517 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4518 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4519
4520 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4521
4522 Inline functions to examine and change buffer intervals.
4523 * alloc.c (mark_interval_tree): Remove.
4524 (MARK_INTERVAL_TREE): Simplify.
4525 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4526 * intervals.c (buffer_balance_intervals): New function.
4527 (graft_intervals_into_buffer): Adjust indentation.
4528 (set_intervals_multibyte): Simplify.
4529 * buffer.h (BUF_INTERVALS): Remove.
4530 (buffer_get_intervals, buffer_set_intervals): New function.
4531 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4532 * intervals.c, textprop.c: Adjust users.
4533
4534 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4535
4536 Inline functions to examine and change string intervals.
4537 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4538 (string_get_intervals, string_set_intervals): New function.
4539 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4540 * lread.c, print.c, textprop.c: Adjust users.
4541
4542 2012-08-08 Glenn Morris <rgm@gnu.org>
4543
4544 * lisp.mk (lisp): Remove language/persian.elc.
4545
4546 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4547
4548 Cleanup intervals.
4549 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4550 (NULL_INTERVAL_P): Likewise. Adjust users.
4551 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4552 Adjust comment. Move under #if 0.
4553 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4554 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4555
4556 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4557
4558 Check total length of intervals with eassert.
4559 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4560 * intervals.c: Change all users to eassert.
4561
4562 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4563
4564 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4565 Rename fields to match removal of FGET and WGET and disuse of
4566 INTERNAL_FIELD in Lisp_Cons.
4567
4568 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4569
4570 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4571 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4572 name since all xname users are fixed long time ago. Do not
4573 use INTERNAL_FIELD.
4574 (set_symbol_name, set_symbol_function, set_symbol_plist):
4575 (set_symbol_next, set_overlay_plist): New function.
4576 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4577 (struct Lisp_Overlay): Likewise.
4578 (CVAR, MVAR, SVAR): Remove.
4579 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4580 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4581 * xterm.c: Adjust users.
4582 * .gdbinit: Change to use name field of struct Lisp_Symbol
4583 where appropriate.
4584
4585 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4586
4587 Basic functions to set Lisp_Object and pointer slots of intervals.
4588 * intervals.h (interval_set_parent, interval_set_object):
4589 (interval_set_left, interval_set_right, interval_set_plist):
4590 (interval_copy_parent): New function.
4591 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4592 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4593 Adjust indentation.
4594 (INTERVAL_SIZE): Remove. Adjust users.
4595 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4596
4597 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4598
4599 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4600 * process.h (PGET): Remove.
4601 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4602 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4603
4604 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4605
4606 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4607 * window.h (WGET): Remove.
4608 (struct window): Do not use INTERNAL_FIELD.
4609 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4610 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4611 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4612 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4613 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4614 Adjust users.
4615
4616 2012-08-07 Chong Yidong <cyd@gnu.org>
4617
4618 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4619 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4620 (Fdelete_window_internal): Signal an error if the window is not on
4621 a live frame (Bug#12025).
4622
4623 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4624
4625 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4626 * frame.h (FGET): Remove.
4627 (struct frame): Do not use INTERNAL_FIELD.
4628 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4629 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4630 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4631 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4632
4633 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4634
4635 * w32.c: Silence compiler warnings.
4636 (map_w32_filename): Remove unused variable `is_fat'.
4637 (chase_symlinks): Add parentheses around expression.
4638
4639 2012-08-06 Glenn Morris <rgm@gnu.org>
4640
4641 * sysdep.c: Respect BROKEN_GETWD.
4642
4643 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4644 Let configure handle it.
4645 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4646
4647 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4648
4649 Use GCALIGNMENT where appropriate.
4650 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4651 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4652 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4653
4654 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4655
4656 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4657 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4658
4659 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4660
4661 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4662 that should be sufficient for everyone.
4663
4664 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4665
4666 * keyboard.c (timer_check_2): Add break so timer_check returns next
4667 timeout.
4668
4669 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4670
4671 Fix Windows build errors introduced after converting to WGET and WSET.
4672 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4673 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4674
4675 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4676
4677 * nsterm.m (ns_frame_rehighlight): Use FSET.
4678
4679 * nsmenu.m (ns_update_menubar): Use FSET.
4680
4681 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4682
4683 Separate read and write access to Lisp_Object slots of Lisp_Process.
4684 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4685 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4686
4687 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4688
4689 Separate read and write access to Lisp_Object slots of struct window.
4690 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4691 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4692 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4693 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4694 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4695 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4696 Adjust users.
4697
4698 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4699
4700 Fix Windows build errors introduced after converting to FGET and FSET.
4701 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4702 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4703 (w32_judge_scroll_bars): Change to use FSET.
4704 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4705
4706 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4707
4708 Fix replacement typo.
4709 * window.c (replace_window): Set root_window instead of
4710 selected_window. This fixes a total window subsystem
4711 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4712
4713 2012-08-06 Glenn Morris <rgm@gnu.org>
4714
4715 * lisp.mk (lisp): Add language/persian.elc.
4716
4717 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4718
4719 Separate read and write access to Lisp_Object slots of struct frame.
4720 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4721 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4722 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4723 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4724 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4725
4726 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4727
4728 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4729
4730 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4731
4732 Generalize common compile-time constants.
4733 * lisp.h (header_size, bool_header_size, word_size): Now here.
4734 (struct Lisp_Vector): Add comment.
4735 (struct Lisp_Bool_Vector): Move up to define handy constants.
4736 (VECSIZE, PSEUDOVECSIZE): Simplify.
4737 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4738 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4739 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4740 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4741 * xfont.c, xmenu.c: Use word_size where appropriate.
4742
4743 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4744
4745 * search.c (Freplace_match): Treat \? in the replacement text
4746 literally (Bug#8161).
4747
4748 2012-08-05 Chong Yidong <cyd@gnu.org>
4749
4750 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4751 * frame.c (Vdelete_frame_functions):
4752 * emacs.c (Vkill_emacs_hook): Doc fix.
4753
4754 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4755
4756 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4757 --with-x-toolkit=no builds.
4758 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4759
4760 2012-08-04 Chong Yidong <cyd@gnu.org>
4761
4762 * syntax.c (Fmodify_syntax_entry): Doc fix.
4763
4764 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4765
4766 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4767 * w32.c (init_environment): Change the default values of many
4768 environment variables in dflt_envvars[] to NULL, to avoid pushing
4769 them into environment when they were not already defined.
4770 Remove the code that deletes site-lisp subdirectories from the default
4771 value of EMACSLOADPATH, as it is no longer needed.
4772 (check_windows_init_file): Now external, not static.
4773 Use Vload_path as is, without adding anything, as this function is now
4774 called when Vload_path is already set up.
4775
4776 * w32.h (check_windows_init_file): Add prototype.
4777
4778 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4779 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4780 compatibility with Posix platforms.
4781 (main): Move the call to check_windows_init_file to here from
4782 w32.c.
4783 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4784 any, in the DEFALT argument into the root of the Emacs build or
4785 installation tree, as appropriate.
4786
4787 * callproc.c (init_callproc_1): Call decode_env_path instead of
4788 doing its equivalent by hand.
4789 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4790 the code that sets Vexec_path run on MS-Windows.
4791
4792 * lread.c (init_lread): Add comments to #ifdef's.
4793
4794 * msdos.c (dos_set_window_size, IT_update_begin)
4795 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4796 instead of direct references.
4797
4798 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4799
4800 Export DEFAULT_REHASH_* to GDB.
4801 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4802 Now constants, not macros.
4803
4804 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4805
4806 Remove unnecessary casts involving pointers.
4807 These casts are no longer needed now that we assume C89 or later,
4808 since they involve casting to or from void *.
4809 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4810 (make_pure_float, make_pure_vector):
4811 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4812 * macros.c (Fstart_kbd_macro):
4813 * menu.c (find_and_return_menu_selection):
4814 * minibuf.c (read_minibuf_noninteractive):
4815 * sysdep.c (closedir):
4816 * xdisp.c (x_produce_glyphs):
4817 * xfaces.c (compare_fonts_by_sort_order):
4818 * xfns.c (x_real_positions, select_visual):
4819 * xselect.c (x_stop_queuing_selection_requests)
4820 (x_get_window_property, x_get_window_property_as_lisp_data):
4821 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4822 Remove unnecessary pointer casts.
4823 * alloc.c (record_xmalloc): New function.
4824 * lisp.h (record_xmalloc): New decl.
4825 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4826 more like a function. This is because the pointer cast is not
4827 needed. All uses changed.
4828 * print.c (print_string, print_error_message): Avoid length recalc.
4829
4830 Improve fix for macroexp crash with debugging (Bug#12118).
4831 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4832 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4833 not supposed to be invoked from the garbage collector.
4834 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4835 (gc_aset): New function, which is like ASET but can be
4836 used in the garbage collector.
4837 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4838 (set_hash_index): Use it instead of ASET.
4839
4840 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4841
4842 Support symlinks on latest versions of MS-Windows.
4843 * w32.c: Include winioctl.h and aclapi.h.
4844 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4845 (revert_to_self): Forward declarations of static functions.
4846 <static BOOL g_b_init_get_security_info>:
4847 <g_b_init_create_symbolic_link>: New static flags.
4848 (globals_of_w32): Initialize them to zero.
4849 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4850 (map_w32_filename): Improve commentary. Simplify switch.
4851 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4852 headers (most versions of MinGW w32api don't).
4853 (get_security_info, create_symbolic_link)
4854 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4855 New functions.
4856 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4857 in the argument file name.
4858 (sys_access): Call unc_volume_file_attributes only if
4859 GetFileAttributes fails with network-related error codes.
4860 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4861 have the required privileges.
4862 (get_file_security_desc_by_name): Rename from
4863 get_file_security_desc.
4864 (stat_worker): New function, with most of the guts of 'stat', and
4865 with addition of handling of symlinks and support for 'lstat'.
4866 If possible, get file's attributes and security information by
4867 handle, not by name. Produce S_IFLNK bit for symlinks, when
4868 called from 'lstat'.
4869 (stat, lstat): New functions, call 'stat_worker'.
4870 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4871 symlinks when the underlying filesystem supports them.
4872
4873 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4874
4875 Fix macroexp crash on Windows with debugging (Bug#12118).
4876 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4877 checking subscripts; problem introduced with the recent
4878 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4879 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4880 since it's used in non-static inline functions now.
4881
4882 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4883 Don't assume buffer size fits in 'int'. Remove unused local.
4884
4885 Use C99-style 'extern inline' if available.
4886 * buffer.h (BUFFER_INLINE):
4887 * category.h (CATEGORY_INLINE):
4888 * character.h (CHARACTER_INLINE):
4889 * charset.h (CHARSET_INLINE):
4890 * composite.h (COMPOSITE_INLINE):
4891 * dispextern.h (DISPEXTERN_INLINE):
4892 * lisp.h (LISP_INLINE):
4893 * systime.h (SYSTIME_INLINE):
4894 New macro, replacing 'static inline' in this header.
4895 * buffer.h, category.h, character.h, charset.h, composite.h:
4896 * dispextern.h, lisp.h, systime.h:
4897 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4898 * alloc.c (LISP_INLINE):
4899 * buffer.c (BUFFER_INLINE):
4900 * category.c (CATEGORY_INLINE):
4901 * character.c (CHARACTER_INLINE):
4902 * charset.c (CHARSET_INLINE):
4903 * composite.c (COMPOSITE_INLINE):
4904 * dispnew.c (DISPEXTERN_INLINE):
4905 * sysdep.c (SYSTIME_INLINE):
4906 Define to EXTERN_INLINE, so that the corresponding functions
4907 are compiled into code.
4908 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4909 (INLINE_HEADER_END): New macros.
4910 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4911 since it's used in non-static inline functions now.
4912 (VALMASK) [!USE_LSB_TAG]: Likewise.
4913
4914 2012-08-02 Glenn Morris <rgm@gnu.org>
4915
4916 * s/: Remove empty directory.
4917
4918 * s/ms-w32.h: Move to ../nt/inc.
4919 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4920 Update for new ms-w32.h location.
4921
4922 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4923
4924 Port to Solaris 8.
4925 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4926
4927 2012-08-02 Glenn Morris <rgm@gnu.org>
4928
4929 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4930 hard-coding the path separator.
4931
4932 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4933
4934 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4935 This how ASET and AREF are supposed to work, and makes
4936 it easier to think about future improvements. See
4937 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4938 * charset.h (set_charset_attr): New function.
4939 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4940 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4941 (aref_addr): New function. All uses of &AREF(...) changed.
4942 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4943 (set_hash_index): New functions. All lvalue-style uses of
4944 HASH_KEY etc. changed.
4945 * keyboard.c (set_prop): New function. All lvalue-style uses
4946 of PROP changed.
4947
4948 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4949
4950 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4951 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4952 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4953 * nsfns.m (ns_set_name_as_filename): Likewise.
4954 * nsmenu.m (ns_update_menubar): Likewise.
4955 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4956
4957 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4958
4959 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4960 Adapt to latest changes in field names of the corresponding Lisp
4961 objects.
4962
4963 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4964
4965 2012-08-01 Glenn Morris <rgm@gnu.org>
4966
4967 * s/msdos.h: Remove file.
4968 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4969 * Makefile.in (S_FILE): Remove.
4970 (config_h): Remove S_FILE.
4971
4972 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4973
4974 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4975 Remove; moved to nt/config.nt.
4976
4977 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4978
4979 Use INTERNAL_FIELD for conses and overlays.
4980 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4981 Remove obsolete comment.
4982 (MVAR): New macro.
4983 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4984 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4985
4986 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4987
4988 Use INTERNAL_FIELD for symbols.
4989 * lisp.h (SVAR): New macro. Adjust users.
4990 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4991 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4992
4993 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4994
4995 Use INTERNAL_FIELD for processes.
4996 * process.h (PVAR): New macro. Adjust style.
4997 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4998 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4999
5000 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5001
5002 Use INTERNAL_FIELD for windows.
5003 * window.h (WVAR): New macro.
5004 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5005 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5006 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5007 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5008 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5009 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5010
5011 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5012
5013 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5014
5015 2012-08-01 Glenn Morris <rgm@gnu.org>
5016
5017 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5018 Move to configure.ac.
5019
5020 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5021
5022 * makefile.w32-in (CONFIG_H): Update dependencies.
5023 (CONF_POST_H): New macro.
5024
5025 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5026
5027 2012-07-31 Glenn Morris <rgm@gnu.org>
5028
5029 * Makefile.in (S_FILE): No longer set by configure.
5030
5031 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5032 is available.
5033 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5034
5035 * process.h (NULL_DEVICE):
5036 * emacs.c (SEPCHAR):
5037 * editfns.c (USER_FULL_NAME): Let configure set them.
5038
5039 * s/README, s/template.h: Remove files.
5040
5041 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5042
5043 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5044 Move to configure.ac.
5045
5046 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5047
5048 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5049 resulting renaming of 'struct frame' members.
5050
5051 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5052
5053 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5054 after introduction of FVAR.
5055
5056 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5057
5058 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5059
5060 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5061 instead of compositeToPoint.
5062 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5063
5064 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5065
5066 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5067
5068 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5069 * lisp.h (INTERNAL_FIELD): New macro.
5070 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5071 (BVAR): Change to use INTERNAL_FIELD.
5072 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5073 (KVAR): Change to use INTERNAL_FIELD.
5074 * frame.h (FVAR): New macro.
5075 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5076 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5077 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5078 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5079 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5080
5081 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5082
5083 Miscellaneous fixes for non-default X toolkits.
5084 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5085 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5086 Move under #ifdef USE_LUCID.
5087 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5088 definition and usage to avoid warnings.
5089
5090 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5091
5092 * nsterm.m (openFiles): Fix previous checkin.
5093
5094 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5095
5096 * indent.c (compute_motion): Remove unused local.
5097
5098 2012-07-31 Glenn Morris <rgm@gnu.org>
5099
5100 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5101
5102 * conf_post.h [USG5_4]:
5103 Move remaining contents of s/usg5-4-common.h here.
5104 * s/usg5-4-common.h: Remove file.
5105
5106 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5107 * s/irix6-5.h: Remove file.
5108
5109 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5110 * s/darwin.h: Remove file.
5111
5112 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5113 * s/hpux10-20.h: Remove file, which is now empty.
5114
5115 2012-07-30 Glenn Morris <rgm@gnu.org>
5116
5117 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5118 * Makefile.in (config_h): Add conf_post.h.
5119 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5120
5121 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5122
5123 * nsterm.m (ns_do_open_file): New variable.
5124 (ns_term_init): Set ns_do_open_file to YES after run returns.
5125 (openFile, openTempFile, openFileWithoutUI, openFiles):
5126 Open files only if ns_do_open_file.
5127
5128 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5129
5130 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5131 This no-op macro hasn't been needed for many years.
5132 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5133
5134 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5135 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5136 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5137 gdb_make_enums_visible.
5138 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5139 (DIRECTORY_SEP): Now a constant, not a macro.
5140
5141 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5142
5143 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5144 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5145
5146 * w32term.c <w32_keyboard_codepage>: Renamed from
5147 keyboard_codepage and now external. All users changed.
5148
5149 * w32term.h: Add declaration of w32_keyboard_codepage.
5150
5151 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5152 the codepage to translate keys to Unicode. If this argument is
5153 -1, use the value returned by GetConsoleCP. All callers changed.
5154
5155 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5156
5157 Update .PHONY listings in makefiles.
5158 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5159 bootstrap-clean, distclean, maintainer-clean, versioclean,
5160 extraclean, frc.
5161
5162 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5163 This is a bit clearer. Fix some commentary typos.
5164
5165 2012-07-30 Glenn Morris <rgm@gnu.org>
5166
5167 * s/netbsd.h: Let configure include signal.h if needed.
5168 Remove file, which is now empty.
5169
5170 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5171 Let configure set them.
5172 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5173 No more need to undefine.
5174
5175 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5176
5177 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5178 non-single-byte char when adding meta modifier. (Bug#12090)
5179
5180 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5181
5182 Convert safe_call to use variable number of arguments.
5183 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5184 (safe_call2): Fix comment.
5185 * lisp.h (safe_call): Adjust prototype.
5186 * coding.c (encode_coding_object): Change to use safe_call2.
5187 * xfaces.c (merge_face_heights): Change to use safe_call1.
5188
5189 2012-07-30 Glenn Morris <rgm@gnu.org>
5190
5191 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5192 does that unconditionally. Remove file, which is now empty.
5193
5194 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5195 Remove empty files.
5196
5197 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5198
5199 Export to GDB most of lisp.h's remaining object-like macros.
5200 * lisp.h (min, max): Move earlier, because they're used earlier now.
5201 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5202 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5203 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5204 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5205 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5206 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5207 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5208 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5209 Now constants, for GDB. They need not be macros.
5210 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5211 Now constants, for GDB, as well as macros, for static initializers.
5212 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5213 Move to after the definition of struct Lisp_Char_Table,
5214 since the former now needs that type defined.
5215 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5216 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5217 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5218 New enums, for gdb_make_enums_visible.
5219 (GLYPH_MODE_LINE_FACE): Remove; unused.
5220 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5221 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5222 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5223 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5224 enum maxargs, enum MAX_ALLOCA.
5225 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5226 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5227 no longer needed, now that they are done in lisp.h.
5228
5229 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5230
5231 Cleanup string bytes checking.
5232 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5233 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5234 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5235 (check_sblock, compact_small_strings): Simplify.
5236
5237 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5238
5239 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5240 These macros are confusing and no longer need to be defined, as
5241 the enum values now suffice. All uses replaced with definiens.
5242 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5243
5244 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5245
5246 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5247 ($(BLD)/w32console.$(O)): Update dependencies.
5248
5249 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5250
5251 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5252 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5253 time. Adjust users.
5254 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5255
5256 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5257
5258 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5259 setting sitelisp (Bug#12010).
5260
5261 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5262
5263 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5264
5265 * w32heap.c (cache_system_info):
5266 * w32.c (sys_rename):
5267 * w32proc.c (find_child_console, sys_kill): All users changed.
5268
5269 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5270
5271 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5272
5273 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5274
5275 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5276
5277 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5278
5279 Cleanup statistics calculation in Fgarbage_collect.
5280 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5281 Fix zombies percentage calculation. Simplify elapsed time calculation.
5282
5283 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5284
5285 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5286 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5287 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5288 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5289 (replace_range, replace_range_2, del_range_2): Change to eassert.
5290 * marker.c (byte_char_debug_check): Adjust style.
5291
5292 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5293
5294 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5295 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5296 long-ago-commented-out code that talks about "WIN32".
5297 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5298 All uses changed.
5299
5300 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5301
5302 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5303 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5304 Simplify by using alignof.
5305 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5306 * lisp.h: Include <stdalign.h>.
5307 (GCALIGNMENT): New macro and constant.
5308 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5309 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5310 (stdalign): New macro, if not already defined.
5311
5312 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5313
5314 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5315 * w32inevt.c: Include w32inevt.h.
5316 (w32_read_console_input): New inline function, calls either
5317 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5318 w32_console_unicode_input.
5319 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5320 (w32_kbd_patch_key, key_event): Use the codepage returned by
5321 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5322 (key_event): use uChar.UnicodeChar only if
5323 w32_console_unicode_input is non-zero.
5324
5325 * w32console.c: Include w32heap.h.
5326 <w32_console_unicode_input>: New global variable.
5327 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5328 family of Windows, zero otherwise.
5329
5330 * w32inevt.h: Declare w32_console_unicode_input.
5331
5332 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5333 --without-x. (Bug#11742)
5334
5335 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5336
5337 Adjust GDB to reflect pvec_type changes (Bug#12036).
5338 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5339 2012-07-04 changes to pseudovector representation.
5340 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5341
5342 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5343
5344 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5345 bus address.
5346 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5347
5348 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5349
5350 * alloc.c (listn): Fix the order the arguments are consed onto the
5351 list.
5352
5353 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5354 enumeration constants, as PURE and HEAP are too general, and clash
5355 with other headers and sources, such as gmalloc.c and the
5356 MS-Windows system headers. All users changed.
5357
5358 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5359
5360 Revert last save_excursion_save and save_excursion_restore changes.
5361 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5362 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5363
5364 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5365
5366 Fix recently-introduced typos in Windows port.
5367 Reported by Martin Rudalics <rudalics@gmx.at>.
5368 * w32.c (init_environment): Replace comma with semicolon.
5369 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5370
5371 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5372
5373 Improve GDB symbol export (Bug#12036).
5374 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5375 arms of an 'if', not using conditional expressions; otherwise GDB
5376 complains about the types in the unevaluated arm when the argument
5377 is an integer literal.
5378 (xgetint): Simplify expression.
5379 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5380 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5381 Zaretskii in <http://bugs.gnu.org/12036#13>.
5382 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5383 needed now that we have gdb_make_enums_visible.
5384 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5385 (enum enum_USE_LSB_TAG):
5386 New enum types, packaging up enums that need to be exported to GDB.
5387
5388 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5389
5390 Utility function to make a list from specified amount of objects.
5391 * lisp.h (enum constype): New datatype.
5392 (listn): New prototype.
5393 * alloc.c (listn): New function.
5394 (Fmemory_use_count, syms_of_alloc): Use it.
5395 * buffer.c (syms_of_buffer): Likewise.
5396 * callint.c (syms_of_callint): Likewise.
5397 * charset.c (define_charset_internal): Likewise.
5398 * coding.c (syms_of_coding): Likewise.
5399 * keymap.c (syms_of_keymap): Likewise.
5400 * search.c (syms_of_search): Likewise.
5401 * syntax.c (syms_of_syntax): Likewise.
5402 * w32.c (init_environment): Likewise.
5403 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5404 * xdisp.c (syms_of_xdisp): Likewise.
5405 * xfns.c (syms_of_xfns): Likewise.
5406
5407 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5408
5409 Fast save_excursion_save and save_excursion_restore.
5410 * lisp.h (struct Lisp_Excursion): New data type.
5411 (PVEC_EXCURSION): New pseudovector type.
5412 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5413 to deal with it. Adjust comments.
5414 (init_marker, attach_marker): New prototype.
5415 (unchain_marker): Adjust prototype.
5416 * marker.c (attach_marker): Change to global.
5417 (init_marker): New function.
5418 * alloc.c (Fmake_marker, build_marker): Use it.
5419 (build_marker): More easserts.
5420 (mark_object): Handle struct Lisp_Excursion.
5421 * editfns.c (save_excursion_save, save_excursion_restore):
5422 Reimplement to use struct Lisp_Excursion. Add comments.
5423
5424 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5425
5426 Fix export of symbols to GDB (Bug#12036).
5427 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5428 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5429 emacs.c, as this is a more-suitable home. Had this been done earlier
5430 the fix for 12036 would have avoided some of the problems noted in
5431 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5432 would have been more obvious.
5433 * emacs.c: Do not include <verify.h>; no longer needed.
5434 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5435 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5436 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5437 Remove; now done in lisp.h.
5438 * lisp.h (PUBLISH_TO_GDB): New macro.
5439 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5440 (DATA_SEG_BITS): Use it.
5441 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5442 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5443 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5444 not be usable in #if. This simplifies things.
5445
5446 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5447
5448 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5449
5450 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5451
5452 Simplify export of symbols to GDB (Bug#12036).
5453 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5454 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5455 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5456 Adjust to changes in lisp.h and emacs.c, by using
5457 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5458 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5459 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5460 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5461 instead of gdb_valbits.
5462 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5463 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5464 instead of gdb_array_mark_flag.
5465 (xboolvector): Get size from $->size, not $->header.size.
5466 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5467 (xreload, hook-run, hookpost-run): Remove.
5468 * emacs.c: Include <verify.h>.
5469 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5470 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5471 Remove.
5472 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5473 (gdb_USE_LSB_TAG): New enum constants.
5474 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5475 Also define these as enum constants, so they're visible to GDB.
5476 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5477 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5478 as constants, so they're visible to GDB.
5479 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5480 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5481 Now enum constants, not macros, so they're visible to GDB.
5482 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5483 more convenient now. All uses changed.
5484 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5485 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5486
5487 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5488
5489 Explicitly free restriction data that are not needed anymore.
5490 * editfns.c (save_restriction_restore): Free restriction data.
5491
5492 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5493
5494 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5495 add argument, tune behavior, and adjust all callers.
5496
5497 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5498
5499 Use typedef for EMACS_INT, EMACS_UINT.
5500 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5501 than macros. This simplifies debugging in the usual case, since
5502 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5503 and it allows expressions involving EMACS_INT casts.
5504 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5505
5506 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5507
5508 * nsterm.m (ns_read_socket): Return early if there is a modal
5509 window (Bug#12043).
5510
5511 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5512
5513 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5514 that FOCUS-FRAME can be omitted.
5515
5516 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5517
5518 Adjust buffer text indirection counters at the end of Fkill_buffer.
5519 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5520 buffer is definitely dead. This should really fix an issue reported
5521 by Christoph Scholtes again. (Bug#12007).
5522 (init_buffer_once): Initialize indirection counters of
5523 buffer_defaults and buffer_local_symbols (for sanity and safety).
5524
5525 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5526
5527 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5528 and continuation glyphs on tooltip frames, leave them at zero.
5529 Avoids continued lines in tooltips. (Bug#11832)
5530
5531 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5532
5533 Simplify copy_overlay.
5534 * buffer.c (copy_overlay): Simplify. Use build_marker.
5535 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5536
5537 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5538
5539 * print.c (print_object): Don't crash when a frame's name is nil
5540 or invalid. (Bug#12025)
5541
5542 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5543 it signals an error when a tooltip frame is being created.
5544
5545 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5546
5547 Cleanup miscellaneous objects allocation and initialization.
5548 * alloc.c (allocate_misc): Change to static. Add argument to
5549 specify the subtype. Adjust comment and users.
5550 (build_overlay): New function.
5551 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5552 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5553 (allocate_misc): Remove prototype.
5554 (build_overlay): Add prototype.
5555
5556 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5557
5558 Swap buffer text indirection counters in Fbuffer_swap_text.
5559 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5560 This avoids crash reported by Christoph Scholtes at
5561 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5562
5563 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5564
5565 * nsmenu.m (Popdown_data): New struct.
5566 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5567 free Popdown_data.
5568 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5569 (initWithContentRect): Make imgView and contentView non-static
5570 and autorelease them. Also autorelease img and matrix (Bug#12005).
5571 (dealloc): Remove (Bug#12005).
5572
5573 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5574
5575 Adjust consing_since_gc when objects are explicitly freed.
5576 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5577 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5578 (free_cons, free_misc): Subtract object size from consing_since_gc.
5579
5580 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5581
5582 Simplify and cleanup markers positioning code.
5583 * marker.c (attach_marker): More useful eassert.
5584 (live_buffer, set_marker_internal): New function.
5585 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5586 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5587
5588 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5589
5590 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5591 as it's limited by the amount of memory, not by INT_MAX.
5592
5593 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5594
5595 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5596 in special-event-map. See the discussion at
5597 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5598 for the reasons.
5599
5600 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5601 info.dwItemData. Fixes crashes on 64-bit Windows.
5602 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5603
5604 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5605
5606 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5607 (conversationIdentifier): Return value is NSInteger.
5608 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5609
5610 2012-07-21 Chong Yidong <cyd@gnu.org>
5611
5612 * window.c (decode_any_window): Signal an error if the window is
5613 on a dead frame (Bug#11984).
5614
5615 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5616
5617 Add indirection counting to speed up Fkill_buffer.
5618 * buffer.h (struct buffer): New member.
5619 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5620 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5621 base buffer indirection counter.
5622 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5623 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5624 through buffer list if indirection counter is 0.
5625
5626 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5627
5628 Extend the value returned by Fgarbage_collect with heap statistics.
5629 * alloc.c (Qheap): New symbol.
5630 (syms_of_alloc): DEFSYM it.
5631 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5632 (Fmemory_free): Remove.
5633 (syms_of_alloc): Don't defsubr it.
5634 * buffer.c (Fcompact_buffer): Remove.
5635 (syms_of_buffer): Don't defsubr it.
5636
5637 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5638
5639 Make maybe_gc inline.
5640 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5641 * lisp.h (consing_since_gc, gc_relative_threshold)
5642 (memory_full_cons_threshold): Revert declaration.
5643 (maybe_gc): Remove prototype, define as inline.
5644 * alloc.c: Remove old commented-out code.
5645 (consing_since_gc, gc_relative_threshold)
5646 (memory_full_cons_threshold): Revert to global.
5647 (maybe_gc): Remove.
5648
5649 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5650
5651 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5652 * lisp.h (build_unibyte_string): New function.
5653 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5654 * sysdep.c, w32fns.c, xfns.c: Use it.
5655 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5656 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5657 Adjust users accordingly.
5658 * font.h (font_open_by_name): Adjust prototype.
5659
5660 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5661
5662 Cleanup calls to Fgarbage_collect.
5663 * lisp.h (maybe_gc): New prototype.
5664 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5665 Remove declarations.
5666 * alloc.c (maybe_gc): New function.
5667 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5668 Make them static.
5669 * bytecode.c (MAYBE_GC): Use maybe_gc.
5670 * eval.c (eval_sub, Ffuncall): Likewise.
5671 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5672 to avoid dependency from auto-save feature.
5673
5674 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5675
5676 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5677 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5678 'for_each_per_buffer_object_at'.
5679 All uses changed. It's better to use upper-case for macros that
5680 cannot be implemented as functions, to give the reader a clue
5681 that they're special.
5682
5683 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5684
5685 * alloc.c (Fgarbage_collect): Tweak docstring.
5686
5687 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5688
5689 Tweak the value returned from Fgarbage_collect again.
5690 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5691 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5692 Adjust documentation.
5693 (total_vector_bytes): Rename to total_vector_slots, adjust
5694 accounting.
5695 (total_free_vector_bytes): Rename to total_free_vector_slots,
5696 adjust accounting.
5697 (Qstring_bytes, Qvector_slots): New symbols.
5698 (syms_of_alloc): DEFSYM them.
5699
5700 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5701
5702 Buffer compaction primitive which may be used from Lisp.
5703 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5704 (syms_of_buffer): Register Fcompact_buffer.
5705 * alloc.c (Fgarbage_collect): Use compact_buffer.
5706 * buffer.h (compact_buffer): New prototype.
5707 (struct buffer_text): New member.
5708
5709 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5710
5711 New macro to iterate over all buffers, miscellaneous cleanups.
5712 * lisp.h (all_buffers): Remove declaration.
5713 * buffer.h (all_buffers): Add declaration, with comment.
5714 (for_each_buffer): New macro.
5715 * alloc.c (Fgarbage_collect, mark_object): Use it.
5716 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5717 (init_buffer): Likewise.
5718 * data.c (Fset_default): Likewise.
5719 * coding.c (code_conversion_restore): Remove redundant check
5720 for dead buffer.
5721 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5722
5723 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5724
5725 Fix bug that created negative-length intervals.
5726 * intervals.c (merge_interval_right, merge_interval_left):
5727 Do not zero out this interval if it is absorbed by its children,
5728 as this interval's total length doesn't change in that case. See
5729 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5730
5731 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5732
5733 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5734 when invoking (make-bool-vector N t) and N is a positive
5735 multiple of 8 -- the last 8 bits were mistakenly cleared.
5736
5737 Remove some struct layout assumptions in bool vectors.
5738 * alloc.c (bool_header_size): New constant.
5739 (header_size, word_size): Move earlier, as they're now used earlier.
5740 Use 'word_size' in a few more places, where it's appropriate.
5741 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5742 padding before the data member of a bool vector.
5743 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5744 than doing the check by hand with an abort ().
5745
5746 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5747
5748 * eval.c (Fdefvar): Don't check constants since we only set the var if
5749 it's not yet defined anyway (bug#11904).
5750
5751 * lisp.h (last_undo_boundary): Declare new var.
5752 * keyboard.c (command_loop_1): Set it.
5753 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5754 were auto-added by the command loop (bug#11774).
5755
5756 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5757
5758 * w32font.c (Qsymbol): Remove local definition.
5759 (syms_of_w32font): Don't DEFSYM it.
5760
5761 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5762
5763 Fix sweep_vectors to handle large bool vectors correctly.
5764 * alloc.c (sweep_vectors): Account total_vector_bytes for
5765 bool vectors larger than VBLOCK_BYTES_MAX.
5766
5767 2012-07-18 Chong Yidong <cyd@gnu.org>
5768
5769 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5770 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5771
5772 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5773
5774 Return more descriptive data from Fgarbage_collect.
5775 Suggested by Stefan Monnier in
5776 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5777 * alloc.c (bounded_number): New function.
5778 (total_buffers, total_vectors): New variable.
5779 (total_string_size): Rename to total_string_bytes, adjust users.
5780 (total_vector_size): Rename to total_vector_bytes, adjust users.
5781 (sweep_vectors): Account total_vectors and total_vector_bytes.
5782 (Fgarbage_collect): New return value. Adjust documentation.
5783 (gc_sweep): Account total_buffers.
5784 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5785 (VECTOR_SIZE): Remove.
5786 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5787 (Qinterval, Qmisc): New symbols.
5788 (syms_of_data): Initialize them.
5789 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5790 (Qcons, Qbuffer): New declarations.
5791
5792 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5793
5794 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5795 Round up, not down. Improve doc.
5796
5797 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5798
5799 Restore old code in allocate_string_data to avoid Faset breakage.
5800 Reported by Julien Danjou <julien@danjou.info> in
5801 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5802 * alloc.c (allocate_string_data): Restore old code with minor
5803 adjustments, fix comment to explain this subtle issue.
5804
5805 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5806
5807 Remove FILE_SYSTEM_CASE.
5808 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5809
5810 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5811 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5812 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5813 call-process-region passes it through expand-file-name.
5814
5815 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5816
5817 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5818
5819 Fix crash when creating indirect buffer (Bug#11917)
5820 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5821 Don't handle unbound variables specially if non-zero.
5822 (Fbuffer_local_variables): Pass zero.
5823 (clone_per_buffer_values): Pass non-zero.
5824
5825 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5826
5827 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5828 to make the loop interruptible.
5829
5830 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5831
5832 * gnutls.c (emacs_gnutls_handshake): Only retry if
5833 GNUTLS_E_INTERRUPTED.
5834
5835 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5836
5837 Cleanup and convert miscellaneous checks to eassert.
5838 * alloc.c (mark_interval): Fix comment, partially rephrase
5839 old comment from intervals.h (see below).
5840 * intervals.c (find_interval, adjust_intervals_for_insertion)
5841 (delete_interval, adjust_intervals_for_deletion)
5842 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5843 Convert to eassert.
5844 (adjust_intervals_for_insertion, make_new_interval):
5845 Remove obsolete and unused code.
5846 * intervals.h (struct interval): Remove obsolete comment.
5847 * textprotp.c (erase_properties): Remove unused code.
5848 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5849 (Fremove_list_of_text_properties): Convert to eassert.
5850
5851 2012-07-17 Chong Yidong <cyd@gnu.org>
5852
5853 * editfns.c (Finsert_char): Doc fix.
5854
5855 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5856
5857 Fix previous change to make Fmemory_free always accurate.
5858 * alloc.c (make_interval): Update total_free_intervals.
5859 (make_float): Likewise for total_free_floats.
5860 (free_cons, Fcons): Likewise for total_free_conses.
5861 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5862 Likewise for total_free_vector_bytes.
5863 (Fmake_symbol): Likewise for total_free_symbols.
5864 (bytes_free): Remove.
5865
5866 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5867
5868 Simple free memory accounting feature.
5869 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5870 (sweep_vectors): Accumulate size of free vectors.
5871 (Fgarbage_collect): Setup bytes_free.
5872 (Fmemory_free): New function.
5873 (syms_of_alloc): Register it.
5874
5875 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5876
5877 Cleanup overlays checking.
5878 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5879 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5880 eassert and OVERLAYP.
5881 (sort_overlays): Change to use OVERLAYP.
5882
5883 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5884
5885 * editfns.c (Finsert_char): Make it interactive, and make the
5886 second arg optional. Copy interactive spec and docstring from
5887 ucs-insert.
5888
5889 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5890
5891 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5892 Unlike the other wrapped functions, fabs has an unspecified
5893 effect on errno.
5894
5895 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5896
5897 * nsterm.m (keyDown): Interpret flags without left/right bits
5898 as the left key (Bug#11670).
5899
5900 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5901
5902 Remove empty and useless init functions.
5903 * lisp.h (init_character_once, init_fns, init_image)
5904 (init_filelock, init_sound): Remove prototype.
5905 * character.c (init_character_once): Remove.
5906 * filelock.c (init_filelock): Likewise.
5907 * fns.c (init_fns): Likewise.
5908 * image.c (init_image): Likewise.
5909 * sound.c (init_sound): Likewise.
5910 * emacs.c (main): Adjust accordingly.
5911
5912 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5913
5914 * gtkutil.h: Tiny cleanups.
5915 (use_old_gtk_file_dialog): Remove useless declaration.
5916 (xg_uses_old_file_dialog): Add suggested const attribute.
5917
5918 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5919
5920 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5921 (bidi_paragraph_init): Use it to limit search forward for a strong
5922 directional character in abnormally large paragraphs full of
5923 neutral or weak characters. (Bug#11943)
5924
5925 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5926
5927 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5928 the toolbar (Bug#9451).
5929 (xg_make_tool_item): Give the widget event box a transparent
5930 background.
5931
5932 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5933
5934 Cleanup basic allocation variables and functions.
5935 * alloc.c (ignore_warnings, init_intervals, init_float)
5936 (init_cons, init_symbol, init_marker): Remove.
5937 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5938 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5939 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5940 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5941 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5942 (staticidx, init_alloc_once, init_strings, free_ablock):
5943 Remove redundant initialization.
5944 * fns.c (init_weak_hash_tables): Remove.
5945 * lisp.h (init_weak_hash_tables): Remove prototype.
5946
5947 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5948
5949 Use zero_vector where appropriate.
5950 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5951 accordingly.
5952 * lisp.h (zero_vector): New declaration.
5953 * font.c (null_vector): Remove.
5954 (syms_of_font): Remove initialization and staticpro.
5955 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5956 * keymap.c (Faccessible_keymaps): Likewise.
5957
5958 2012-07-15 Leo Liu <sdl.web@gmail.com>
5959
5960 * fringe.c: Fix typo in comments.
5961
5962 2012-07-14 Leo Liu <sdl.web@gmail.com>
5963
5964 * fringe.c: Add a new bitmap exclamation-mark.
5965
5966 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5967
5968 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5969
5970 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5971 (HAVE_MENUS): Don't define, defined by editing config.in with
5972 msdos/sed2v2.inp.
5973 (GMALLOC_INHIBIT_VALLOC): Don't define.
5974 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5975
5976 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5977
5978 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5979
5980 2012-07-14 Glenn Morris <rgm@gnu.org>
5981
5982 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5983 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5984 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5985
5986 2012-07-13 Glenn Morris <rgm@gnu.org>
5987
5988 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5989
5990 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5991 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5992
5993 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5994
5995 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5996 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5997 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5998 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5999 where appropriate.
6000 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6001 as boolean expression.
6002 (x_set_window_size): Remove unused variable toolbar.
6003 (ns_get_color_default, ns_mod_to_lisp): Remove.
6004 (ns_mouse_position): Remove unused variables xchar and ychar.
6005 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6006 (ns_set_vertical_scroll_bar): Remove unused variable count.
6007 (ns_delete_terminal): Remove unused variable i.
6008 (ns_term_init): Remove unused variables r, g and b.
6009 (mouseDown): Remove unused variable window.
6010 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6011 (initFrameFromEmacs): Remove unused variable vbextra.
6012 (mouseEntered): Remove unused variables p and dpyinfo.
6013 (mouseExited): Remove unused variables p and r.
6014 (ns_define_frame_cursor, ns_clear_frame_area)
6015 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6016 (menuDown): Assign [sender tag] to variable and cast the variable.
6017
6018 * nsterm.h (menuDown): Add id as type to argument sender.
6019 (ns_display_info_for_name): Add Lisp_Object argument.
6020 (ns_term_init): Add Lisp_Object argument.
6021 (ns_map_event_to_object): Add void argument.
6022 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6023 prototype with arguments and only declare if __OBJC__.
6024 (nxatoms_of_nsselect): Add void argument.
6025 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6026 (ns_alloc_autorelease_pool): Add void argument.
6027 (ns_release_autorelease_pool): Add void* argument.
6028 (ns_get_defaults_value): Add const char* argument.
6029
6030 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6031 (initFromContents): Use SSDATA where appropriate.
6032 (ns_update_menubar): Add braces to ambigous if-else.
6033 (initWithTitle): Put () around assignment in if statement.
6034 (ns_menu_show): Remove unused variables window and keymap.
6035 (update_frame_tool_bar): Remove unused variable selected_p.
6036 (initWithContentRect): Remove unused variable this_cmd_name.
6037
6038 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6039 appropriate.
6040 (setXBMColor): Remove unused variable len.
6041 (setPixmapData): Put () around assignment in loop statement.
6042
6043 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6044 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6045 where appropriate.
6046 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6047 around assignment in loop statement.
6048 (nsfont_open): Remove unused variable i.
6049 (nsfont_open): Remove unused variable len.
6050 (nsfont_draw): Remove unused variable cs.
6051
6052 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6053 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6054 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6055 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6056 (Fns_font_name, Fns_perform_service)
6057 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6058 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6059 (ns_set_name): Remove unused variable view.
6060 (x_set_menu_bar_lines): Remove unused variable olines.
6061 (x_set_tool_bar_lines): Remove unused variable root_window.
6062 (Fns_list_colors): Put () around assignment in while statement.
6063 (Fns_perform_service): Remove unused variable len.
6064 (Fns_display_usable_bounds): Remove unused variable top.
6065 (syms_of_nsfns): Remove unused variable i.
6066
6067 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6068 memcpy (Bug#11907).
6069
6070 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
6071
6072 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6073 and free it with DestroyExceptionInfo (Bug#11558).
6074
6075 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
6076
6077 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6078 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6079 Set here, not in nt/config.nt.
6080
6081 2012-07-13 Eli Zaretskii <eliz@gnu.org>
6082
6083 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6084 cursor overflow into the last glyph on display line when the right
6085 fringe is off. (Bug#11832)
6086
6087 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6088
6089 * xdisp.c (produce_special_glyphs): Now static.
6090 * dispextern.h (produce_special_glyphs): Remove decl.
6091
6092 2012-07-13 Glenn Morris <rgm@gnu.org>
6093
6094 * s/bsd-common.h, s/cygwin.h: Remove empty files.
6095 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6096
6097 * s/usg5-4-common.h (USG, USG5):
6098 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6099 * s/sol2-6.h (SOLARIS2):
6100 * s/irix6-5.h (IRIX6_5):
6101 * s/hpux10-20.h (USG, USG5, HPUX):
6102 * s/gnu-linux.h (USG, GNU_LINUX):
6103 * s/freebsd.h (BSD_SYSTEM):
6104 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6105 * s/cygwin.h (CYGWIN):
6106 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6107 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6108
6109 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
6110
6111 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6112
6113 2012-07-13 Glenn Morris <rgm@gnu.org>
6114
6115 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6116
6117 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6118
6119 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6120 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6121
6122 2012-07-12 Glenn Morris <rgm@gnu.org>
6123
6124 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6125
6126 * process.c (init_process_emacs): Rename from init_process.
6127 The old name is also the name of a Mach system call.
6128 * lisp.h, emacs.c: Update for this name change.
6129 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6130 longer needed.
6131
6132 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6133
6134 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6135 memmove call that removes glyphs covered by the left truncation
6136 glyph. Improve commentary.
6137 (display_line): Fix display of continuation glyphs on GUI frames
6138 when the right fringe is turned off and variable-size fonts are
6139 used in the window. Move the code that appends a stretch glyph to
6140 produce_special_glyphs, so that it could be used for truncation
6141 and continuation glyphs alike.
6142 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6143 glyph of a suitably computed width, to align the special glyphs at
6144 the window margin. Code moved from display_line. (Bug#11832)
6145
6146 2012-07-12 Glenn Morris <rgm@gnu.org>
6147
6148 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6149
6150 * s/gnu-linux.h, s/hpux10-20.h:
6151 Do not unconditionally define HAVE_XRMSETDATABASE.
6152
6153 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6154
6155 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6156
6157 Fix typos that broke OS X build.
6158 Reported by Randal L. Schwartz in
6159 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6160 * nsterm.m (ns_timeout): Add missing local decl.
6161 (ns_get_color): snprintf -> sprintf, to fix typo.
6162
6163 2012-07-12 Glenn Morris <rgm@gnu.org>
6164
6165 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6166 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6167 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6168 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6169
6170 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6171 Move PTY_OPEN to configure.
6172
6173 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6174 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6175 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6176
6177 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6178
6179 Use empty_unibyte_string where applicable.
6180 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6181 * lread.c (read1): Likewise.
6182 * xsettings.c (syms_of_xsettings): Likewise.
6183
6184 2012-07-12 Glenn Morris <rgm@gnu.org>
6185
6186 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6187 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6188 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6189 * s/hpux10-20.h (RUN_TIME_REMAP):
6190 * s/bsd-common.h (TABDLY): Move to configure.
6191
6192 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6193
6194 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6195
6196 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6197 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6198
6199 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6200
6201 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6202 * s/template.h: Move NARROWPROTO to configure.
6203
6204 2012-07-11 Glenn Morris <rgm@gnu.org>
6205
6206 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6207 unused since 2011-01-17 change to systty.h.
6208
6209 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6210 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6211 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6212
6213 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6214
6215 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6216
6217 2012-07-11 Glenn Morris <rgm@gnu.org>
6218
6219 * s/darwin.h, s/gnu-linux.h, s/template.h:
6220 Move INTERRUPT_INPUT to configure.
6221
6222 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6223
6224 Minor adjustments to interning code.
6225 * lisp.h (intern, intern_c_string): Redefine as static inline
6226 wrappers for intern_1 and intern_c_string_1, respectively.
6227 (intern_1, intern_c_string_1): Rename prototypes.
6228 * lread.c (intern_1, intern_c_string_1, oblookup):
6229 Simplify Vobarray checking.
6230 * font.c (font_intern_prop): Likewise. Adjust comment.
6231 * w32font.c (intern_font_name): Likewise.
6232
6233 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6234
6235 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6236
6237 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6238 of Fcar/Fcdr if possible.
6239 * font.c (check_otf_features): Likewise.
6240 * fontset.c (Fnew_fontset): Likewise.
6241 * gnutls.c (Fgnutls_boot): Likewise.
6242 * minibuf.c (read_minibuf): Likewise.
6243 * msdos.c (IT_set_frame_parameters): Likewise.
6244 * xmenu.c (Fx_popup_dialog): Likewise.
6245 * w32menu.c (Fx_popup_dialog): Likewise.
6246
6247 2012-07-11 Glenn Morris <rgm@gnu.org>
6248
6249 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6250 since nothing has defined it on these platforms.
6251
6252 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6253 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6254
6255 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6256 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6257 Move CLASH_DETECTION to configure.
6258
6259 * s/gnu.h: Remove file, which is now empty.
6260
6261 * s/gnu.h, s/gnu-linux.h:
6262 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6263
6264 2012-07-11 John Wiegley <johnw@newartisans.com>
6265
6266 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6267 function attribute, so we only use it if it exists in the
6268 compiler.
6269
6270 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6271
6272 Avoid call to strlen in fast_c_string_match_ignore_case.
6273 * search.c (fast_c_string_match_ignore_case): Change to use
6274 length argument. Adjust users accordingly.
6275 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6276
6277 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6278
6279 Assume mkdir, rmdir.
6280 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6281 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6282
6283 Assume rename.
6284 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6285
6286 Assume perror.
6287 * s/hpux10-20.h (HAVE_PERROR): Remove.
6288 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6289 Remove dummy definition, as this problem was obsolete long ago.
6290
6291 Assume strerror.
6292 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6293
6294 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6295
6296 Avoid calls to strlen in font processing functions.
6297 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6298 (font_open_by_name): Change to use length argument.
6299 Adjust users accordingly.
6300 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6301 Adjust prototypes.
6302 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6303 Change to return ptrdiff_t.
6304 (xfont_list_pattern, xfont_match): Use length returned by
6305 xfont_decode_coding_xlfd.
6306 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6307
6308 2012-07-11 Glenn Morris <rgm@gnu.org>
6309
6310 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6311 Move DONT_REOPEN_PTY to configure.
6312
6313 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6314 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6315
6316 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6317
6318 Remove "#define unix" that is no longer needed (Bug#11905).
6319 * s/aix4-2.h (unix): Remove; no longer needed.
6320
6321 EMACS_TIME simplification (Bug#11875).
6322 This replaces macros (which typically do not work in GDB)
6323 with functions, typedefs and enums, making the code easier to debug.
6324 The functional style also makes code easier to read and maintain.
6325 * systime.h: Include <sys/time.h> on all hosts, not just if
6326 WINDOWSNT, since 'struct timeval' is needed in general.
6327 (EMACS_TIME): Now a typedef, not a macro.
6328 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6329 not macros.
6330 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6331 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6332 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6333 (EMACS_TIME_LE): Now functions, not macros.
6334 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6335 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6336 which are not functions. All uses rewritten to use:
6337 (make_emacs_time): New function.
6338 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6339 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6340 not functions. All uses rewritten to use the following, respectively:
6341 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6342 (add_emacs_time, sub_emacs_time): New functions.
6343 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6344 * fileio.c (Fcopy_file):
6345 * xterm.c (XTflash): Get the current time closer to when it's used.
6346 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6347
6348 * bytecode.c (targets): Suppress -Woverride-init warnings.
6349
6350 Simplify by avoiding confusing use of strncpy etc.
6351 * doc.c (Fsnarf_documentation):
6352 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6353 * frame.c (Fmake_terminal_frame):
6354 * gtkutil.c (get_utf8_string):
6355 * lread.c (openp):
6356 * nsmenu.m (ns_update_menubar):
6357 * regex.c (regerror):
6358 Prefer memcpy to strncpy and strncat when either will do.
6359 * fileio.c (Fsubstitute_in_file_name):
6360 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6361 (menu_separator_name_p):
6362 * nsmenu.m (ns_update_menubar):
6363 Prefer memcmp to strncmp when either will do.
6364 * nsterm.m: Include <ftoastr.h>.
6365 (ns_get_color):
6366 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6367 Prefer snprintf to strncpy.
6368 * nsterm.m (ns_term_init):
6369 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6370 * nsterm.m (ns_term_init):
6371 Avoid the need for strncpy, by using build_string or
6372 make_unibyte_string directly. Use dtoastr, not snprintf.
6373 * process.c (Fmake_network_process): Diagnose service names that
6374 are too long, rather than silently truncating them or creating
6375 non-null-terminated names.
6376 (Fnetwork_interface_info): Likewise, for interface names.
6377 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6378 Prefer sprintf to strncat.
6379 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6380 Prefer vsnprintf to vsprintf + strncpy.
6381
6382 2012-07-10 Glenn Morris <rgm@gnu.org>
6383
6384 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6385 Clarify fallback case.
6386
6387 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6388
6389 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6390 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6391 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6392 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6393 where argument type is known to be a Lisp_Cons.
6394
6395 2012-07-10 Tom Tromey <tromey@redhat.com>
6396
6397 * bytecode.c (BYTE_CODE_THREADED): New macro.
6398 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6399 (enum byte_code_op): New type.
6400 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6401 (exec_byte_code): Use them. Use token threading when applicable.
6402
6403 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6404
6405 Optimize pure C strings initialization.
6406 * lisp.h (make_pure_string): Fix prototype.
6407 (build_pure_c_string): New function, defined as static inline. This
6408 provides a better opportunity to optimize away calls to strlen when
6409 the function is called with compile-time constant argument.
6410 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6411 argument, adjust users accordingly. Use build_pure_c_string where
6412 appropriate.
6413 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6414 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6415 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6416
6417 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6418
6419 Avoid calls to strlen in miscellaneous functions.
6420 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6421 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6422 * lread.c (openp): Likewise.
6423
6424 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6425
6426 Avoid calls to strlen in path processing functions.
6427 * fileio.c (file_name_as_directory): Add comment. Change to add
6428 srclen argument and return the length of result. Adjust users
6429 accordingly.
6430 (directory_file_name): Fix comment. Change to add srclen argument,
6431 swap 1st and 2nd arguments to obey the common convention.
6432 Adjust users accordingly.
6433 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6434
6435 2012-07-10 Glenn Morris <rgm@gnu.org>
6436
6437 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6438 Move PENDING_OUTPUT_COUNT definition to configure.
6439
6440 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6441 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6442 * s/gnu.h (DATA_START): Move definitions to configure.
6443
6444 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6445 We include usg5-4-common.h, which defines them both.
6446
6447 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6448 O_RDONLY already includes it).
6449
6450 Stop ns builds setting the EMACSLOADPATH environment variable.
6451 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6452 Now it does not set EMACSLOADPATH, just returns the load-path string.
6453 * nsterm.h: Update accordingly.
6454 * lread.c [HAVE_NS]: Include nsterm.h.
6455 (init_lread) [HAVE_NS]: Use ns_load_path.
6456 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6457
6458 2012-07-09 Glenn Morris <rgm@gnu.org>
6459
6460 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6461 since the included bsd-common.h does so.
6462
6463 Stop ns builds setting the EMACSPATH environment variable.
6464 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6465 (ns_init_paths): Do not set EMACSPATH.
6466 * nsterm.h (ns_exec_path): Add it.
6467 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6468 Use ns_exec_path.
6469
6470 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6471
6472 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6473
6474 * process.c (wait_reading_process_output): 'waitchannels' was unset
6475 when read_kbd || !NILP (wait_for_cell); fix this.
6476
6477 Add GCC-style 'const' attribute to functions that can use it.
6478 * character.h (char_resolve_modifier_mask):
6479 * keyboard.h (make_ctrl_char):
6480 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6481 (init_character_once, next_almost_prime, init_fns, init_image)
6482 (flush_pending_output, init_sound):
6483 * mem-limits.h (start_of_data):
6484 * menu.h (finish_menu_items):
6485 Add ATTRIBUTE_CONST.
6486 * emacs.c (DEFINE_DUMMY_FUNCTION):
6487 Declare the dummy function with ATTRIBUTE_CONST.
6488 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6489 Add decls with ATTRIBUTE_CONST.
6490
6491 Minor improvements to make_formatted_string.
6492 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6493 where int is good enough, as vsprintf returns an int.
6494 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6495
6496 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6497
6498 Use make_formatted_string to avoid double length calculation.
6499 * lisp.h (make_formatted_string): New prototype.
6500 * alloc.c (make_formatted_string): New function.
6501 * buffer.c (Fgenerate_new_buffer_name): Use it.
6502 * dbusbind.c (syms_of_dbusbind): Likewise.
6503 * editfns.c (Fcurrent_time_zone): Likewise.
6504 * filelock.c (get_boot_time): Likewise.
6505 * frame.c (make_terminal_frame, set_term_frame_name)
6506 (x_report_frame_params): Likewise.
6507 * image.c (gs_load): Likewise.
6508 * minibuf.c (get_minibuffer): Likewise.
6509 * msdos.c (dos_set_window_size): Likewise.
6510 * process.c (make_process): Likewise.
6511 * xdisp.c (ensure_echo_area_buffers): Likewise.
6512 * xsettings.c (apply_xft_settings): Likewise.
6513
6514 2012-07-09 Glenn Morris <rgm@gnu.org>
6515
6516 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6517 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6518 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6519 * nsterm.h (ns_etc_directory): Add it.
6520 * callproc.c [HAVE_NS]: Include nsterm.h.
6521 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6522
6523 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6524
6525 Move marker debugging code under MARKER_DEBUG.
6526 * marker.c (MARKER_DEBUG): Move marker debugging code under
6527 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6528 for bootstrap with --enable-checking (~3x slowdown reported
6529 by Juanma Barranquero <lekktu@gmail.com>).
6530 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6531
6532 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6533
6534 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6535 See <http://bugs.gnu.org/11825#29>.
6536
6537 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6538
6539 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6540 has no font, use the frame's font. (Bug#11813)
6541 (display_line): Add commentary about displaying truncation glyphs
6542 on GUI frames.
6543 (produce_special_glyphs): Move here from term.c.
6544
6545 * term.c (produce_special_glyphs): Move to xdisp.c.
6546
6547 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6548 section.
6549
6550 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6551
6552 * xdisp.c (display_line): Avoid warning about implicit declaration
6553 of FRAME_FONT.
6554
6555 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6556
6557 * lisp.h: Remove empty conditional.
6558
6559 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6560
6561 * lread.c (load_path_check): Now static.
6562
6563 Fix some minor --with-ns problems found by static checking.
6564 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6565 (x_set_font) [!HAVE_X_WINDOWS]:
6566 * image.c (xpm_load_image) [HAVE_NS]:
6567 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6568 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6569 Remove unused local.
6570 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6571 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6572 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6573 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6574 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6575 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6576 Fix pointer signedness problem.
6577 * xfaces.c (FRAME_X_FONT_TABLE):
6578 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6579
6580 2012-07-07 Glenn Morris <rgm@gnu.org>
6581
6582 * lread.c (load_path_check): New function, split from init_lread.
6583 (init_lread): Reorganize. Motivation:
6584 If EMACSLOADPATH is set, check/warn about that rather than the
6585 defaults, which we are not going to use. Hence we can remove
6586 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6587 Don't warn if site-lisp directories are missing.
6588 If not installed, start from a blank load-path, since
6589 PATH_LOADSEARCH refers to the eventual installation directories.
6590
6591 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6592
6593 Support truncation and continuation glyphs on GUI frames, when
6594 fringes are disabled. (Bug#11832)
6595 * xdisp.c (init_iterator): Get dimensions of truncation and
6596 continuation glyphs even if on GUI frames.
6597 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6598 or both, are absent.
6599 (start_display, move_it_in_display_line_to): Handle the case of a
6600 GUI frame without a fringe to display continuation or truncation
6601 glyphs.
6602 (insert_left_trunc_glyphs): Support GUI frames: make sure
6603 truncation glyphs overwrite enough glyphs from the current line to
6604 have sufficient space in pixels.
6605 (display_line): Support truncation and continuation glyphs on GUI
6606 frames. If some spare pixels are left on the line after inserting
6607 the truncation glyphs, fill that space with a stretch glyph of a
6608 suitably computed width.
6609
6610 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6611 produce_glyphs, to support GUI sessions.
6612
6613 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6614
6615 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6616
6617 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6618
6619 Do not require float-time's arg to fit in time_t (Bug#11825).
6620 This works better on hosts where time_t is unsigned, and where
6621 float-time is applied to the (negative) difference between two times.
6622 * editfns.c (decode_time_components): Last arg is now double *,
6623 not int *, and means to store all the result as a double, without
6624 worrying about whether the seconds part fits in time_t.
6625 All callers changed.
6626 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6627 All callers changed.
6628 (Ffloat_time): Do not fail merely because the specified time falls
6629 outside of time_t range.
6630
6631 2012-07-07 Glenn Morris <rgm@gnu.org>
6632
6633 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6634 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6635 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6636
6637 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6638
6639 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6640 Update dependencies.
6641
6642 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6643
6644 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6645
6646 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6647 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6648 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6649 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6650 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6651 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6652
6653 * xfont.c (compare_font_names): Redo to omit the need for casts.
6654
6655 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6656
6657 * xfns.c (Fx_change_window_property): Doc fix.
6658 * w32fns.c (Fx_change_window_property): Doc fix.
6659
6660 * w32fns.c (Fx_window_property): Accept the same arguments as the
6661 X Windows version. Doc fix.
6662 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6663
6664 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6665 Eli Zaretskii <eliz@gnu.org>
6666
6667 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6668 Windows-specific code from nt/config.nt moved here.
6669 Obsolete settings removed.
6670
6671 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6672
6673 * process.c: Avoid unnecessary calls to gettime.
6674 (wait_reading_process_output): Don't get the time of day
6675 when gobbling data immediately and not waiting, as there's no need
6676 for it in that case. This removes a FIXME.
6677
6678 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6679
6680 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6681 is defined (Bug#11768).
6682
6683 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6684
6685 Fix marker debugging code.
6686 * marker.c (byte_char_debug_check): Do not perform the check
6687 if buffer is not multibyte.
6688 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6689 Call byte_char_debug_check with correct arguments.
6690
6691 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6692
6693 Compile marker debugging code only if ENABLE_CHECKING is defined.
6694 * marker.c (byte_char_debug_check, count_markers):
6695 Use only if ENABLE_CHECKING is defined.
6696 (byte_debug_flag): Remove.
6697 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6698 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6699
6700 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6701
6702 Avoid code repetition in marker-related functions.
6703 * marker.c (attach_marker): New function.
6704 (Fset_marker, set_marker_restricted, set_marker_both)
6705 (set_marker_restricted_both): Use it.
6706 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6707 Consistently rename charno to charpos.
6708 (marker_position): Add eassert.
6709 (marker_byte_position): Convert to eassert.
6710
6711 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6712
6713 Simplify list operations in unchain_overlay and unchain_marker.
6714 * buffer.c (unchain_overlay): Simplify. Add comment.
6715 * marker.c (unchain_marker): Simplify. Fix comments.
6716
6717 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6718
6719 Introduce fast path for the widely used marker operation.
6720 * alloc.c (build_marker): New function.
6721 * lisp.h (build_marker): New prototype.
6722 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6723 * composite.c (autocmp_chars): Likewise.
6724 * editfns.c (buildmark): Remove.
6725 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6726 (save_restriction_save): Use build_marker.
6727 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6728 * window.c (save_window_save): Likewise.
6729
6730 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6731
6732 Do not use Fdelete_overlay in delete_all_overlays
6733 to avoid redundant calls to unchain_overlay.
6734 * buffer.c (drop_overlay): New function.
6735 (delete_all_overlays, Fdelete_overlay): Use it.
6736 * minibuf.c (get_minibuffer): Fix comment.
6737
6738 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6739
6740 Port to OpenBSD 5.1 amd64.
6741 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6742 This is needed for OpenBSD, and should be harmless on all BSD systems.
6743 Also, include <sys/sysctl.h>, as it should be available on all
6744 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6745 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6746 use p_pid member, not kp_proc.pid.
6747
6748 2012-07-06 Glenn Morris <rgm@gnu.org>
6749
6750 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6751
6752 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6753
6754 More xmalloc and related cleanup.
6755 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6756 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6757 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6758 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6759 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6760 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6761 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6762 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6763 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6764 * xterm.c:
6765 Omit needless casts involving void * pointers and allocation.
6766 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6767 as the former is more robust if P's type is changed.
6768 Prefer xzalloc to xmalloc + memset 0.
6769 Simplify malloc-or-realloc to realloc.
6770 Don't worry about xmalloc returning a null pointer.
6771 Prefer xstrdup to xmalloc + strcpy.
6772 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6773 growing it.
6774 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6775 alloca of a constant.
6776
6777 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6778
6779 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6780 hscroll is larger than the line width. Fixes long and futile
6781 looping inside extend_face_to_end_of_line (on a TTY) producing
6782 glyphs that are not needed and thrown away.
6783
6784 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6785
6786 * marker.c (set_marker_restricted_both): Simplify by using
6787 clip_to_bounds.
6788
6789 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6790
6791 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6792
6793 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6794
6795 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6796 not defined (Bug#11768).
6797 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6798 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6799 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6800 followed by gtk_box_set_homogeneous (Bug#11768).
6801 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6802 (update_theme_scrollbar_width, xg_create_scroll_bar):
6803 Use gtk_scrollbar_new (Bug#11768).
6804 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6805 (is_box_type): New function (Bug#11768).
6806 (xg_tool_item_stale_p): Call is_box_type.
6807 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6808 with default display (Bug#11768).
6809
6810 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6811
6812 * xdisp.c (window_hscroll_limited): New function.
6813 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6814 coordinates when window's hscroll is set to insanely large
6815 values. (Bug#11857)
6816
6817 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6818
6819 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6820 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6821
6822 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6823
6824 Cleanup xmalloc.
6825 * lisp.h (xzalloc): New prototype. Omit needless casts.
6826 * alloc.c (xzalloc): New function. Omit needless casts.
6827 * charset.c: Omit needless casts. Convert all calls to
6828 xmalloc with following memset to xzalloc.
6829 * dispnew.c: Likewise.
6830 * fringe.c: Likewise.
6831 * image.c: Likewise.
6832 * sound.c: Likewise.
6833 * term.c: Likewise.
6834 * w32fns.c: Likewise.
6835 * w32font.c: Likewise.
6836 * w32term.c: Likewise.
6837 * xfaces.c: Likewise.
6838 * xfns.c: Likewise.
6839 * xterm.c: Likewise.
6840 * atimer.c: Omit needless casts.
6841 * buffer.c: Likewise.
6842 * callproc.c: Likewise.
6843 * ccl.c: Likewise.
6844 * coding.c: Likewise.
6845 * composite.c: Likewise.
6846 * doc.c: Likewise.
6847 * doprnt.c: Likewise.
6848 * editfns.c: Likewise.
6849 * emacs.c: Likewise.
6850 * eval.c: Likewise.
6851 * filelock.c: Likewise.
6852 * fns.c: Likewise.
6853 * gtkutil.c: Likewise.
6854 * keyboard.c: Likewise.
6855 * lisp.h: Likewise.
6856 * lread.c: Likewise.
6857 * minibuf.c: Likewise.
6858 * msdos.c: Likewise.
6859 * print.c: Likewise.
6860 * process.c: Likewise.
6861 * region-cache.c: Likewise.
6862 * search.c: Likewise.
6863 * sysdep.c: Likewise.
6864 * termcap.c: Likewise.
6865 * terminal.c: Likewise.
6866 * tparam.c: Likewise.
6867 * w16select.c: Likewise.
6868 * w32.c: Likewise.
6869 * w32reg.c: Likewise.
6870 * w32select.c: Likewise.
6871 * w32uniscribe.c: Likewise.
6872 * widget.c: Likewise.
6873 * xdisp.c: Likewise.
6874 * xmenu.c: Likewise.
6875 * xrdb.c: Likewise.
6876 * xselect.c: Likewise.
6877
6878 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6879
6880 * fileio.c (time_error_value): Check the right error number.
6881 Problem reported by Troels Nielsen in
6882 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6883
6884 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6885
6886 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6887 This should be fixed in a better way; see Eli Zaretskii in
6888 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6889 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6890
6891 * fileio.c (time_error_value): Rename from special_mtime.
6892 The old name's problems were noted by Eli Zaretskii in
6893 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6894
6895 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6896 This variable's comment says Emacs needs at least one GDB-visible
6897 symbol of type enum pvec_type, to work around GDB problems.
6898 The symbol's value doesn't matter.
6899
6900 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6901 that causes compilation to fail on pre-C99 compilers.
6902
6903 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6904
6905 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6906 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6907
6908 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6909
6910 * buffer.c (init_buffer_once): Fix initialization of
6911 headers for buffer_defaults and buffer_local_symbols.
6912 Reported by Juanma Barranquero <lekktu@gmail.com>.
6913
6914 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6915
6916 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6917 * lisp.h (enum pvec_type): Use fewer bits.
6918 (PSEUDOVECTOR_SIZE_BITS): New constant.
6919 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6920 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6921 change in pvec_type.
6922 (PSEUDOVECTOR_TYPEP): New macro.
6923 (TYPED_PSEUDOVECTORP): Use it.
6924 * fns.c (internal_equal): Adapt code to extract pvectype.
6925 * emacs.c (gdb_pvec_type): Update type.
6926 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6927 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6928 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6929 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6930 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6931 abusing vector->header.next.nbytes.
6932 (live_vector_p): Use PVEC_TYPE.
6933 (mark_object): Adapt code to extract pvectype. Use switch.
6934
6935 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6936
6937 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6938 Tighten new eassert a bit.
6939
6940 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6941
6942 Fix compilation with --enable-gcc-warnings and -O1
6943 optimization level.
6944 * doprnt.c (doprnt): Change type of tem to int, initialize
6945 to avoid compiler warning. Add eassert.
6946 * search.c (simple_search): Initialize match_byte to avoid
6947 compiler warning. Add eassert.
6948
6949 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6950
6951 Avoid weird behavior with large horizontal scrolls.
6952 Without this change, for example, large hscroll values would
6953 mess up Emacs's display on Fedora 15 x86, presumably due to
6954 overflows in int calculations in the display code.
6955 Also, if buffers had long lines, Emacs would freeze.
6956 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6957 (set_window_hscroll): New function, containing the old guts of
6958 Fset_window_hscroll. Return the clipped value.
6959 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6960 This avoids the need to check against PTRDIFF_MAX.
6961
6962 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6963
6964 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6965
6966 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6967
6968 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6969
6970 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6971 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6972 since GCC 4.4.6 issues a bogus warning for them.
6973
6974 Fix bugs in file timestamp newness comparisons.
6975 * fileio.c (Ffile_newer_than_file_p):
6976 * lread.c (Fload): Use full timestamp resolution of files,
6977 not just the 1-second resolution, so that files that are only
6978 slightly newer still count as newer.
6979 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6980 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6981
6982 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6983
6984 * fileio.c: Improve handling of file time marker. (Bug#11852)
6985 (special_mtime): New function.
6986 (Finsert_file_contents, Fverify_visited_file_modtime):
6987 Use it to set special mtime values consistently.
6988
6989 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6990
6991 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6992 marker for non-existing file. (Bug#11852)
6993
6994 2012-07-03 Glenn Morris <rgm@gnu.org>
6995
6996 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6997 and did not make it into globals.h).
6998
6999 2012-07-03 Tom Tromey <tromey@redhat.com>
7000
7001 * window.c (Fset_window_margins, Fset_window_fringes)
7002 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7003 * textprop.c (Fprevious_property_change): No longer static.
7004 * syntax.c (Fsyntax_table_p): No longer static.
7005 * process.c (Fget_process, Fprocess_datagram_address): No longer
7006 static.
7007 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7008 * keyboard.c (Fcommand_execute): No longer static.
7009 Remove EXFUN.
7010 * insdel.c (Fcombine_after_change_execute): No longer static.
7011 * image.c (Finit_image_library): No longer static.
7012 * fileio.c (Fmake_symbolic_link): No longer static.
7013 * eval.c (Ffetch_bytecode): No longer static.
7014 * editfns.c (Fuser_full_name): No longer static.
7015 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7016 No longer static.
7017 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7018 static.
7019 * dired.c (Ffile_attributes): No longer static.
7020 * composite.c (Fcomposition_get_gstring): No longer static.
7021 * callproc.c (Fgetenv_internal): No longer static.
7022
7023 * ccl.h: Remove EXFUNs.
7024 * buffer.h: Remove EXFUNs.
7025 * dispextern.h: Remove EXFUNs.
7026 * intervals.h: Remove EXFUNs.
7027 * fontset.h: Remove EXFUN.
7028 * font.h: Remove EXFUNs.
7029 * dosfns.c (system_process_attributes): Remove EXFUN.
7030 * keymap.h: Remove EXFUNs.
7031 * lisp.h: Remove EXFUNs.
7032 * w32term.h: Remove EXFUNs.
7033 * window.h: Remove EXFUNs.
7034 * xsettings.h: Remove EXFUN.
7035 * xterm.h: Remove EXFUN.
7036
7037 2012-07-03 Glenn Morris <rgm@gnu.org>
7038
7039 * lisp.h (Frandom): Make it visible to C.
7040 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7041 buffer for invisible buffers. (Bug#1229)
7042
7043 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7044
7045 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7046 values which aren't power of 2.
7047 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7048 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7049 accordingly.
7050
7051 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7052
7053 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7054
7055 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7056
7057 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7058
7059 * alloc.c (allocate_vector_block): Remove redundant
7060 calls to mallopt if DOUG_LEA_MALLOC is defined.
7061 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7062 avoid calls to mallopt if zero_vector is returned.
7063
7064 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7065
7066 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7067 is enabled, avoid dereferencing NULL current_sblock if
7068 running undumped.
7069
7070 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7071
7072 Cleanup basic buffer management.
7073 * buffer.h (struct buffer): Change layout to use generic vector
7074 marking code. Fix some comments. Change type of 'clip_changed'
7075 to bitfield. Remove unused #ifndef old.
7076 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7077 (GET_OVERLAYS_AT): Fix indentation.
7078 (for_each_per_buffer_object_at): New macro.
7079 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7080 (Fbuffer_local_variables): Use it.
7081 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7082 * alloc.c (allocate_buffer): Adjust to match new layout of
7083 struct buffer. Fix comment.
7084 (mark_overlay): New function.
7085 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7086 Lisp area of struct buffer.
7087 (mark_object): Use it. Adjust marking of misc objects
7088 and related comments.
7089
7090 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7091
7092 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7093 wrapper that is not needed because the wrapped code is a no-op (zero
7094 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7095 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7096
7097 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7098
7099 * alloc.c (mark_buffer): Simplify. Remove prototype.
7100 (mark_object): Add comment. Reorganize marking of vector-like
7101 objects. Use CHECK_LIVE for all vector-like objects except buffers
7102 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7103 Avoid redundant calls to mark_vectorlike for bool vectors.
7104
7105 2012-06-30 Glenn Morris <rgm@gnu.org>
7106
7107 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7108
7109 * epaths.in (PATH_SITELOADSEARCH): New.
7110 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7111 This is rather than relying on --enable-locallisppath elements
7112 having "site-lisp" in their names. (Bug#10208#25, 11658)
7113
7114 2012-06-30 Eli Zaretskii <eliz@gnu.org>
7115
7116 * w32proc.c (sys_select): Accept and ignore one more argument.
7117
7118 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7119
7120 * sysselect.h [DOS_NT]: Don't include sys/select.h.
7121 (pselect) [!MS_DOS]: Redirect to sys_select.
7122
7123 * sysdep.c: Don't include dos.h and dosfns.h.
7124
7125 * process.c (sys_select):
7126 * msdos.c (sys_select): Accept one more argument and ignore it.
7127
7128 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7129 adapt data types and code to that.
7130
7131 * dosfns.c:
7132 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7133 which clashes with the gnulib function of the same name.
7134
7135 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7136
7137 * font.c (font_style_to_value, font_style_symbolic)
7138 (font_prop_validate_style): Add type checks for values in
7139 font_style_table.
7140
7141 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7142 argument.
7143 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7144 uses.
7145
7146 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7147
7148 * xdisp.c (try_window_id): Undo last change.
7149
7150 * w32.c (getwd): Adjust commentary about startup_dir.
7151 (init_environment): Always call sys_access, even in non-MSVC
7152 builds. Don't chdir to the directory of the Emacs executable.
7153 This undoes code from 1997 which was justified by the need to
7154 "avoid conflicts when removing and renaming directories". But its
7155 downside was that every relative file name was being interpreted
7156 relative to the directory of the Emacs executable, which can never
7157 be TRT. In particular, it broke sys_access when called with
7158 relative file names.
7159 (sys_access): Map GetLastError to errno.
7160
7161 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7162
7163 * window.h (struct window): Change type of 'fringes_outside_margins'
7164 to bitfield. Fix comment. Adjust users accordingly.
7165 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7166 Adjust comment.
7167 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7168 to ptrdiff_t.
7169
7170 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7171
7172 * gnutls.c (emacs_gnutls_handshake):
7173 Add QUIT to make the loop interruptible.
7174
7175 2012-06-29 Glenn Morris <rgm@gnu.org>
7176
7177 * charset.c (init_charset): Make lack of etc/charsets fatal.
7178
7179 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7180
7181 * editfns.c (region_limit): Fix type mismatch.
7182
7183 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7184
7185 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7186 undefined. Convert from xassert to eassert.
7187 * nsmenu.m: Convert from xassert to eassert.
7188 * nsterm.m: Likewise.
7189
7190 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7191
7192 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7193
7194 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7195
7196 Avoid integer overflow on scroll-left and scroll-right.
7197 * window.c (HSCROLL_MAX): New macro.
7198 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7199 overflow when requested scroll falls outside ptrdiff_t range.
7200
7201 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7202
7203 * window.h (struct window): Change type of 'hscroll',
7204 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7205 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7206 Adjust users accordingly.
7207 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7208 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7209 from EMACS_INT to ptrdiff_t.
7210 (make_window): Omit redundant initialization.
7211
7212 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7213
7214 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7215
7216 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7217
7218 * window.h (struct window): Change type of 'use_time' and
7219 'sequence_number' from Lisp_Object to int.
7220 * frame.c (make_frame): Adjust users accordingly.
7221 * print.c (print_object): Likewise.
7222 * window.c (select_window, Fwindow_use_time, make_parent_window)
7223 (make_window): Likewise.
7224
7225 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7226
7227 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7228 enabled with --enable-checking=[all,glyphs] configure option.
7229 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7230 adjust comments accordingly.
7231 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7232 undefined, adjust comments accordingly.
7233 * image.c: Likewise.
7234 * scroll.c: Likewise.
7235 * w32fns.c: Likewise.
7236 * w32term.c: Likewise.
7237 * xdisp.c: Likewise.
7238 * xfaces.c: Likewise.
7239 * xfns.c: Likewise.
7240 * xterm.c: Likewise.
7241
7242 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7243
7244 Generalize run-time debugging checks.
7245 * dispextern.h (XASSERTS): Remove.
7246 * fontset.c (xassert): Remove.
7247 Convert from xassert to eassert.
7248 * alloc.c: Convert from xassert to eassert.
7249 * bidi.c: Likewise.
7250 * dispnew.c: Likewise.
7251 * fns.c: Likewise.
7252 * fringe.c: Likewise.
7253 * ftfont.c: Likewise.
7254 * gtkutil.c: Likewise.
7255 * image.c: Likewise.
7256 * keyboard.c: Likewise.
7257 * menu.c: Likewise.
7258 * process.c: Likewise.
7259 * scroll.c: Likewise.
7260 * sound.c: Likewise.
7261 * term.c: Likewise.
7262 * w32console.c: Likewise.
7263 * w32fns.c: Likewise.
7264 * w32term.c: Likewise.
7265 * window.c: Likewise.
7266 * xdisp.c: Likewise.
7267 * xfaces.c: Likewise.
7268 * xfns.c: Likewise.
7269 * xselect.c: Likewise.
7270 * xterm.c: Likewise.
7271
7272 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7273
7274 * fns.c (maybe_resize_hash_table): Output message when growing the
7275 purify-hashtable.
7276
7277 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7278
7279 * alloc.c (allocate_string_data): Remove dead code.
7280 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7281 avoid GCC warning about unused macro.
7282
7283 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7284
7285 * alloc.c (allocate_string): Omit intervals initialization.
7286 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7287 as in make_pure_string and make_pure_c_string.
7288
7289 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7290
7291 * alloc.c (allocate_string): Fix last change.
7292
7293 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7294
7295 * alloc.c (allocate_string): Remove two redundant calls
7296 to memset, add explicit initialization where appropriate.
7297
7298 2012-06-27 Glenn Morris <rgm@gnu.org>
7299
7300 * lisp.mk (lisp): Remove paths.elc.
7301
7302 2012-06-27 Chong Yidong <cyd@gnu.org>
7303
7304 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7305
7306 2012-06-26 John Wiegley <johnw@newartisans.com>
7307
7308 * unexmacosx.c (copy_data_segment): Add two section names used
7309 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7310
7311 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7312 when building with Clang.
7313
7314 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7315
7316 * eval.c (Fapply): Allow calling it with a single argument.
7317
7318 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7319
7320 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7321 _stricmp and _strnicmp.
7322 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7323
7324 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7325
7326 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7327 allocated window.
7328 (allocate_process): Likewise for new process.
7329 (allocate_terminal): Change to use offsetof.
7330 (allocate_frame): Likewise.
7331 * frame.c (make_frame): Omit redundant initialization.
7332 * window.c (make_parent_window): Use memset.
7333 (make_window): Omit redundant initialization.
7334 * process.c (make_process): Omit redundant initialization.
7335 * terminal.c (create_terminal): Likewise.
7336
7337 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7338
7339 * term.c (delete_tty): Remove redundant call to memset.
7340
7341 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7342
7343 * alloc.c: Remove build_string.
7344 * lisp.h: Define build_string as static inline. This provides
7345 a better opportunity to optimize away calls to strlen when the
7346 function is called with compile-time constant argument.
7347 * image.c (imagemagick_error): Convert to build_string.
7348 * w32proc.c (sys_spawnve): Likewise.
7349 * xterm.c (x_term_init): Likewise.
7350
7351 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7352
7353 Use sprintf return value instead of invoking strlen on result.
7354 In the old days this wasn't portable, since some sprintf
7355 implementations returned char *. But they died out years ago and
7356 Emacs already assumes sprintf returns int.
7357 Similarly for float_to_string.
7358 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7359 * ccl.c (ccl_driver):
7360 * character.c (string_escape_byte8):
7361 * data.c (Fnumber_to_string):
7362 * doprnt.c (doprnt):
7363 * print.c (print_object):
7364 * xdisp.c (message_dolog):
7365 * xfns.c (syms_of_xfns):
7366 Use sprintf or float_to_string result to avoid need to call strlen.
7367 * data.c (Fnumber_to_string):
7368 Use make_unibyte_string, since the string must be ASCII.
7369 * lisp.h, print.c (float_to_string): Now returns int length.
7370 * term.c (produce_glyphless_glyph):
7371 Use sprintf result rather than recomputing it.
7372
7373 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7374 * Makefile.in (ALL_CFLAGS):
7375 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7376 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7377
7378 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7379
7380 * dispextern.h (xstrcasecmp): Define to library function
7381 strcasecmp if available.
7382 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7383
7384 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7385
7386 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7387 Avoid comma operator.
7388 * menu.c (push_submenu_start, push_submenu_end)
7389 (push_left_right_boundary, push_menu_pane): Likewise.
7390 * msdos.c (dos_rawgetc): Likewise.
7391
7392 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7393
7394 * xfns.c (xic_create_fontsetname): Remove redundant calls
7395 to memset.
7396
7397 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7398
7399 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7400 sprintf already null-terminates its output.
7401
7402 * xfns.c (x_window): Remove redundant cast.
7403
7404 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7405
7406 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7407 `const char *' to `char *' to avoid compiler warning.
7408
7409 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7410
7411 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7412 instead of truncating it to 63 (admittedly a generous limit).
7413
7414 * process.c: Fix spelling and caps in comments.
7415
7416 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7417
7418 * emacs.c (setpgrp): Remove definition, unused.
7419 * sysdep.c (setpgrp): Remove definition, not used in this file.
7420
7421 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7422
7423 * makefile.w32-in: Update dependencies.
7424
7425 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7426
7427 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7428 (SYSTIME_H): Add nt/inc/sys/time.h.
7429
7430 * systime.h [WINDOWSNT]: Include sys/time.h.
7431
7432 * s/ms-w32.h (struct timespec): Definition moved from
7433 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7434
7435 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7436
7437 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7438 * buffer.h (buffer_slot_type_mismatch):
7439 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7440 * eval.c (unwind_to_catch):
7441 * image.c (my_png_error, my_error_exit):
7442 * keyboard.c (quit_throw_to_read_char, user_error)
7443 (Fexit_recursive_edit, Fabort_recursive_edit):
7444 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7445 (wrong_type_argument, buffer_overflow, __executable_start)
7446 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7447 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7448 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7449 (fatal):
7450 (child_setup) [!DOS_NT]:
7451 * lread.c (end_of_file_error, invalid_syntax):
7452 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7453 * puresize.h (pure_write_error):
7454 * search.c (matcher_overflow):
7455 * sound.c (sound_perror, alsa_sound_perror):
7456 * sysdep.c, syssignal.h (croak):
7457 * term.c (maybe_fatal, vfatal):
7458 * textprop.c (text_read_only):
7459 * undo.c (user_error):
7460 * unexmacosx.c (unexec_error):
7461 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7462 Use _Noreturn rather than NO_RETURN.
7463 No need for separate decl merely because of _Noreturn.
7464 * sound.c (sound_warning, parse_sound):
7465 Remove unnecessary forward decls.
7466
7467 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7468
7469 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7470 * lisp.h (WAIT_READING_MAX): New macro.
7471 * dispnew.c (Fsleep_for, sit_for):
7472 * keyboard.c (kbd_buffer_get_event):
7473 * process.c (Faccept_process_output):
7474 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7475 This improves on the previous patch, which introduced a bug
7476 when time_t is unsigned and as wide as intmax_t.
7477 See <http://bugs.gnu.org/9000#51>.
7478
7479 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7480
7481 * dispnew.c (sit_for, Fsleep_for):
7482 * keyboard.c (kbd_buffer_get_event):
7483 * process.c (Faccept_process_output): Avoid compiler warnings when
7484 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7485
7486 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7487
7488 * makefile.w32-in: Update dependencies.
7489
7490 * w32.c (ltime): Add return type and declare static.
7491 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7492
7493 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7494
7495 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7496 Privately reported by Herbert J. Skuhra.
7497 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7498 All uses changed.
7499 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7500 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7501
7502 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7503
7504 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7505 last argument of make_unibyte_string.
7506
7507 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7508 language ID in the event parameters.
7509
7510 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7511 event.code, not the obscure "character set ID".
7512
7513 2012-06-23 Chong Yidong <cyd@gnu.org>
7514
7515 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7516
7517 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7518
7519 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7520 * w32.c (fdutimens): New function.
7521
7522 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7523
7524 * s/ms-w32.h (pselect): Redirect to sys_select.
7525
7526 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7527
7528 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7529 in the logic of incrementing and decrementing the value of
7530 use_relocatable_buffers.
7531
7532 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7533
7534 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7535 Privately reported by Herbert J. Skuhra.
7536 [__FreeBSD__]: Remove "*/" typo after "#include".
7537 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7538 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7539 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7540 Don't assume EMACS_TIME and struct timeval are the same type.
7541
7542 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7543
7544 Support higher-resolution time stamps (Bug#9000).
7545 The time stamps are only nanosecond-resolution at the C level,
7546 since that's the best that any real-world system supports now.
7547 But they are picosecond-resolution at the Lisp level, as that's
7548 easy, and leaves room for future OS improvements.
7549
7550 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7551 (LIBES): Use it.
7552
7553 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7554 Don't get current time unless it's needed.
7555
7556 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7557 now provides it if it's absent.
7558 (start_atimer): Port to higher-res time stamps.
7559 Check for time stamp overflow. Don't get current time more
7560 often than is needed.
7561
7562 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7563 Include systime.h, not time.h.
7564 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7565
7566 * dired.c: Include stat-time.h.
7567 (Ffile-attributes): File times now have higher resolution.
7568
7569 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7570 (struct image): Timestamp now has higher resolution.
7571
7572 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7573 has at least microseconds now. All uses removed.
7574 (update_frame, update_single_window, update_window, update_frame_1)
7575 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7576 (duration_to_sec_usec): Remove; no longer needed.
7577
7578 * editfns.c (time_overflow): Now extern.
7579 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7580 (float-time, Fformat_time_string, Fcurrent_time_string)
7581 (Fcurrent_time_zone): Accept and generate higher-resolution
7582 time stamps.
7583 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7584 (decode_time_components, lisp_seconds_argument): New functions.
7585 (make_time): Now static.
7586 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7587 Report an error if the time is invalid, rather than having the caller
7588 do that.
7589
7590 * fileio.c: Include <stat-time.h>
7591 (Fcopy_file): Copy higher-resolution time stamps.
7592 Prefer to set the time stamp via a file descriptor if that works.
7593 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7594 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7595 (Fvisited_file_modtime, Fset_visited_file_modtime):
7596 Support higher-resolution time stamps.
7597
7598 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7599
7600 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7601
7602 * image.c (prepare_image_for_display, clear_image_cache)
7603 (lookup_image): Port to higer-resolution time stamps.
7604
7605 * keyboard.c (start_polling, bind_polling_period):
7606 Check for time stamp overflow.
7607 (read_char, kbd_buffer_get_event, timer_start_idle)
7608 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7609 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7610 Port to higher-resolution time stamps. Do not assume time_t is signed.
7611 (decode_timer): New function. Timers are now vectors of length 9,
7612 not 8, to accommodate the picosecond component.
7613 (timer_check_2): Use it.
7614
7615 * nsterm.m (select_timeout, timeval_subtract): Remove.
7616 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7617 as they're a bit more accurate and handle overflow better.
7618 (ns_select): Change prototype to be compatible with pselect.
7619 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7620 * nsterm.h (ns_select): Adjust prototype.
7621
7622 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7623 us-resolution time stamps.
7624 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7625
7626 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7627
7628 * lisp.h (time_overflow): New decl.
7629 (wait_reading_process_output): First arg is now intmax_t, not int,
7630 to accommodate larger waits.
7631
7632 * process.h (struct Lisp_Process.read_output_delay):
7633 Now counts nanoseconds, not microseconds.
7634 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7635 EMACS_HAS_USECS.
7636 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7637 (wait_reading_process_output):
7638 Port to ns-resolution time stamps.
7639 (Faccept_process_output, wait_reading_process_output):
7640 Check for time stamp overflow. Do not assume time_t is signed.
7641 (select_wrapper): Remove; we now use pselect.
7642 (Fprocess_attributes): Now generates ns-resolution time stamps.
7643
7644 * sysdep.c: Include utimens.h. Don't include utime.h
7645 or worry about struct utimbuf; gnulib does that for us now.
7646 (gettimeofday): Remove; gnulib provides a substitute.
7647 (make_timeval): New function.
7648 (set_file_times): Now sets ns-resolution time stamps.
7649 New arg FD; all uses changed.
7650 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7651 (system_process_attributes):
7652 Now returns ns-resolution time stamp. All uses changed.
7653 Check for time stamp overflow.
7654
7655 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7656 provides a substitute now.
7657
7658 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7659 since it guarantees struct timespec.
7660 (EMACS_TIME): Now struct timespec, so that we can support
7661 ns-resolution time stamps.
7662 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7663 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7664 (EMACS_USECS): Remove.
7665 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7666 so multiply the arg by 1000 before storing it.
7667 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7668 New macros.
7669 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7670 Port to ns-resolution time stamps.
7671 (EMACS_TIME_NEG_P): Remove; replaced by....
7672 (EMACS_TIME_SIGN): New macro.
7673 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7674 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7675 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7676 (make_timeval, make_lisp_time, decode_time_components): New decls.
7677 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7678 that it mishandled time_t overflow. You can't compare by subtracting!
7679 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7680 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7681
7682 * term.c: Include <sys/time.h>.
7683 (timeval_to_Time): New function, for proper overflow wraparound.
7684 (term_mouse_position, term_mouse_click): Use it.
7685
7686 * undo.c (record_first_change): Support higher-resolution time stamps
7687 in the undo buffer.
7688 (Fprimitive_undo): Use them when restoring time stamps.
7689
7690 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7691 (w32_get_internal_run_time):
7692 Port to higher-resolution Emacs time stamps.
7693 (ltime): Now accepts single 64-bit integer, as that's more convenient
7694 for callers.
7695
7696 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7697
7698 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7699 for compatibility with pselect. Support ns-resolution time stamps.
7700
7701 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7702
7703 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7704 Check for time stamp overflow, and support ns-resolution time stamps.
7705
7706 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7707 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7708 (timeval_subtract): Remove; no longer needed.
7709 (XTflash, XTring_bell, x_wait_for_event):
7710 Port to ns-resolution time stamps. Don't assume time_t is signed.
7711
7712 2012-06-22 Chong Yidong <cyd@gnu.org>
7713
7714 * xdisp.c (x_consider_frame_title): Revert last change.
7715
7716 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7717
7718 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7719 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7720 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7721 staticidx goes up to 1597 out of 1600 = 0x640.)
7722
7723 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7724
7725 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7726 Otherwise, the umask might be mistakenly 0 while handling input signals.
7727
7728 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7729
7730 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7731
7732 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7733
7734 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7735 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7736 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7737 access to `contents' member of Lisp_Vector objects with AREF and ASET
7738 where appropriate.
7739
7740 2012-06-19 Chong Yidong <cyd@gnu.org>
7741
7742 * frame.c (delete_frame): When selecting a frame on a different
7743 text terminal, do not alter the terminal's top-frame.
7744
7745 * xdisp.c (format_mode_line_unwind_data): Record the target
7746 frame's selected window and its terminal's top-frame.
7747 (unwind_format_mode_line): Restore them.
7748 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7749 Callers changed.
7750 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7751 since tty frames can be explicitly named.
7752 (prepare_menu_bars): Likewise.
7753
7754 * term.c (Ftty_top_frame): New function.
7755
7756 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7757
7758 Port byte-code-meter to modern targets.
7759 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7760 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7761 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7762 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7763 (METER_1, METER_2): Simplify.
7764
7765 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7766
7767 * data.c (Fdefalias): Return `symbol' (bug#11686).
7768
7769 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7770
7771 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7772 gets killed during executing of this function (Bug#11665).
7773 Try to always return Qt when the buffer has been actually killed.
7774 (Vkill_buffer_query_functions): In doc-string say that functions
7775 run by this hook should not change the current buffer.
7776
7777 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7778
7779 Fix recently-introduced process.c problems found by static checking.
7780 * process.c (write_queue_push, write_queue_pop, send_process):
7781 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7782 (write_queue_pop): Fix pointer signedness problem.
7783 (send_process): Remove unused local.
7784
7785 2012-06-17 Chong Yidong <cyd@gnu.org>
7786
7787 * xdisp.c (redisplay_internal): No need to redisplay terminal
7788 frames that are not on top.
7789
7790 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7791
7792 * process.c (make_process): Initialize write_queue.
7793 (write_queue_push, write_queue_pop): New functions.
7794 (send_process): Use them to maintain correct ordering of process
7795 writes (Bug#10815).
7796
7797 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7798
7799 * lisp.h (eassert): Assume C89 or later.
7800 This removes the need for CHECK.
7801 (CHECK): Remove. Its comments about always evaluating its
7802 argument were confusing, as 'eassert' typically does not evaluate
7803 its argument.
7804
7805 * coding.c (produce_chars): Use ptrdiff_t, not int.
7806
7807 * xterm.c (x_draw_underwave): Check for integer overflow.
7808 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7809
7810 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7811
7812 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7813 referenced (Bug#11583).
7814
7815 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7816
7817 Implement wave-style variant of underlining.
7818 * dispextern.h (face_underline_type): New enum.
7819 (face): Add field for underline type.
7820 * nsterm.m (ns_draw_underwave): New function.
7821 (ns_draw_text_decoration): Use it.
7822 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7823 New functions.
7824 (x_draw_glyph_string): Use them.
7825 * xfaces.c (Qline, Qwave): New Lisp objects.
7826 (check_lface_attrs, merge_face_ref)
7827 (Finternal_set_lisp_face_attribute, realize_x_face):
7828 Handle wave-style underline face attributes.
7829 * xterm.c (x_draw_underwave): New function.
7830 (x_draw_glyph_string): Use it.
7831
7832 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7833
7834 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7835 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7836 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7837 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7838 ($(BLD)/w32select.$(O)): Update dependencies.
7839
7840 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7841
7842 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7843 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7844 * character.c (_fetch_multibyte_char_p): Remove.
7845 * alloc.c: Include "character.h" before "buffer.h".
7846 * bidi.c: Likewise.
7847 * buffer.c: Likewise.
7848 * bytecode.c: Likewise.
7849 * callint.c: Likewise.
7850 * callproc.c: Likewise.
7851 * casefiddle.c: Likewise.
7852 * casetab.c: Likewise.
7853 * category.c: Likewise.
7854 * cmds.c: Likewise.
7855 * coding.c: Likewise.
7856 * composite.c: Likewise.
7857 * dired.c: Likewise.
7858 * dispnew.c: Likewise.
7859 * doc.c: Likewise.
7860 * dosfns.c: Likewise.
7861 * editfns.c: Likewise.
7862 * emacs.c: Likewise.
7863 * fileio.c: Likewise.
7864 * filelock.c: Likewise.
7865 * font.c: Likewise.
7866 * fontset.c: Likewise.
7867 * fringe.c: Likewise.
7868 * indent.c: Likewise.
7869 * insdel.c: Likewise.
7870 * intervals.c: Likewise.
7871 * keyboard.c: Likewise.
7872 * keymap.c: Likewise.
7873 * lread.c: Likewise.
7874 * macros.c: Likewise.
7875 * marker.c: Likewise.
7876 * minibuf.c: Likewise.
7877 * nsfns.m: Likewise.
7878 * nsmenu.m: Likewise.
7879 * print.c: Likewise.
7880 * process.c: Likewise.
7881 * regex.c: Likewise.
7882 * region-cache.c: Likewise.
7883 * search.c: Likewise.
7884 * syntax.c: Likewise.
7885 * term.c: Likewise.
7886 * textprop.c: Likewise.
7887 * undo.c: Likewise.
7888 * unexsol.c: Likewise.
7889 * w16select.c: Likewise.
7890 * w32fns.c: Likewise.
7891 * w32menu.c: Likewise.
7892 * window.c: Likewise.
7893 * xdisp.c: Likewise.
7894 * xfns.c: Likewise.
7895 * xmenu.c: Likewise.
7896 * xml.c: Likewise.
7897 * xselect.c: Likewise.
7898
7899 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7900
7901 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7902 If all the glyphs of the glyph row came from strings, and we have no
7903 cursor positioning clues, put the cursor on the first glyph of the
7904 row.
7905 (handle_face_prop): Use chunk-relative overlay string index when
7906 indexing into it->string_overlays array. (Bug#11653)
7907 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7908 the rightmost. (Bug#11720)
7909
7910 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7911
7912 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7913 (CATEGORY_MEMBER): Enforce 1/0 value.
7914 * category.c (_temp_category_set): Remove.
7915
7916 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7917
7918 * window.c (Fdelete_other_windows_internal)
7919 (Fdelete_window_internal): Don't access frame's mouse highlight
7920 info of the initial frame. (Bug#11677)
7921
7922 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7923
7924 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7925 Assume USE_2_TAGS_FOR_INTS.
7926 (xreload): Adjust $tagmask width to match recent lisp.h change.
7927
7928 Simplify lisp.h in minor ways that should not affect code.
7929 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7930 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7931 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7932 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7933 (INTTYPEBITS): New macro, for clarity.
7934 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7935 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7936 Simplify now that USE_LSB_TAG is always defined.
7937 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7938 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7939
7940 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7941
7942 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7943
7944 2012-06-13 Glenn Morris <rgm@gnu.org>
7945
7946 * s/bsd-common.h (BSD4_3):
7947 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7948
7949 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7950
7951 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7952 instead of union.
7953 (XLI, XIL): Define.
7954 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7955 Use them.
7956 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7957 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7958 * alloc.c (widen_to_Lisp_Object): Remove.
7959 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7960 * frame.c (delete_frame): Remove outdated comment.
7961 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7962 USE_LISP_UNION_TYPE.
7963 (Fw32_unregister_hot_key): Likewise.
7964 (Fw32_toggle_lock_key): Likewise.
7965 * w32menu.c (add_menu_item): Likewise.
7966 (w32_menu_display_help): Use XIL instead of checking
7967 USE_LISP_UNION_TYPE.
7968 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7969 (init_heap): Likewise.
7970 * w32term.c (w32_read_socket): Update comment.
7971
7972 2012-06-13 Glenn Morris <rgm@gnu.org>
7973
7974 * s/usg5-4-common.h, src/s/unixware.h:
7975 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7976
7977 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7978
7979 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7980
7981 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7982 * alloc.c (make_number) [!defined make_number]:
7983 Remove, as lisp.h always defines this now.
7984 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7985 (roundup_size): Verify that it is a power of 2.
7986 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7987 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7988 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7989 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7990 USE_LSB_TAG now is always defined to be either 0 or 1.
7991 All uses changed.
7992 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7993 code works fine either way, and efficiency is not a concern here,
7994 as the union type is for debugging, not for production.
7995 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7996 Use an inline function on all platforms when using the union type,
7997 since this is simpler and 'static inline' can be used portably
7998 within Emacs now.
7999 (LISP_INITIALLY_ZERO): New macro.
8000 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8001 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8002
8003 2012-06-12 Glenn Morris <rgm@gnu.org>
8004
8005 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8006
8007 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8008
8009 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8010 Move BROKEN_SIGIO to configure.
8011
8012 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8013 Move NO_TERMIO to configure.
8014
8015 2012-06-12 Chong Yidong <cyd@gnu.org>
8016
8017 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8018 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8019 MagickExportImagePixels is undefined.
8020
8021 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8022
8023 * image.c (imagemagick_load_image): Remove unused label.
8024
8025 2012-06-11 Glenn Morris <rgm@gnu.org>
8026
8027 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8028 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8029 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8030 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8031
8032 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8033
8034 * alloc.c (make_byte_code): New function.
8035 (Fmake_byte_code): Use it. Don't purify here.
8036 * lread.c (read1): Use it as well to avoid extra allocation.
8037
8038 2012-06-11 Chong Yidong <cyd@gnu.org>
8039
8040 * image.c (imagemagick_load_image): Implement transparency.
8041
8042 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8043
8044 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8045 account for preceding backslashes. (Bug#11663)
8046
8047 2012-06-09 Chong Yidong <cyd@gnu.org>
8048
8049 * term.c: Support italics in capable terminals (Bug#9652).
8050 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8051 (turn_on_face): Output using TS_enter_italic_mode if available.
8052 Don't handle unused blinking and alt-charset cases.
8053 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8054 and tty_alt_charset_p cases.
8055 (tty_capable_p, init_tty): Support italics.
8056
8057 * termchar.h (struct tty_display_info): Add field for italics.
8058 Remove unused blink field.
8059
8060 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8061 Handle slant.
8062
8063 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8064 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8065 tty_alt_charset_p. Add tty_italic_p.
8066
8067 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
8068
8069 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8070 dbus_type_is_basic if available.
8071 (xd_extract_signed, xd_extract_unsigned): Rename from
8072 extract_signed and extract_unsigned, respectively. Adapt callers.
8073
8074 2012-06-09 Chong Yidong <cyd@gnu.org>
8075
8076 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8077
8078 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8079 case (Bug#9752).
8080
8081 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8082
8083 * xdisp.c (vmessage): Treat frame message as multibyte.
8084 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8085 would generate the diagnostic "Making \302\247 buffer-local while
8086 let-bound!".
8087
8088 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8089
8090 * dispnew.c (showing_window_margins_p): Undo last change, which
8091 was done due to an inadvertent commit.
8092 (adjust_frame_glyphs_for_frame_redisplay): Do call
8093 showing_window_margins_p.
8094
8095 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8096
8097 * eval.c (Fmake_var_non_special): New primitive.
8098 (syms_of_eval): Defsubr it.
8099 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8100
8101 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
8102
8103 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8104 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8105
8106 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8107
8108 * alloc.c (allocate_vectorlike): Fix last change.
8109
8110 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8111
8112 Block-based vector allocation of small vectors.
8113 * lisp.h (struct vectorlike_header): New field `nbytes',
8114 adjust comment accordingly.
8115 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8116 to denote vector blocks. Adjust users (live_vector_p,
8117 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8118 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8119 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8120 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8121 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8122 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8123 (roundup_size): New constant.
8124 (struct vector_block): New data type.
8125 (vector_blocks, vector_free_lists, zero_vector): New variables.
8126 (all_vectors): Rename to `large_vectors'.
8127 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8128 (sweep_vectors): New functions.
8129 (allocate_vectorlike): Return `zero_vector' as the only vector of
8130 0 items. Allocate new vector from block if vector size is less than
8131 or equal to VBLOCK_BYTES_MAX.
8132 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8133 (init_alloc_once): Add call to init_vectors.
8134
8135 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8136
8137 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8138
8139 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8140
8141 * doprnt.c (doprnt): Truncate multibyte char correctly.
8142 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8143 would mishandle a string argument "Xc" if X was a multibyte
8144 character of length 2: it would truncate after X's first byte
8145 rather than including all of X.
8146
8147 2012-06-06 Chong Yidong <cyd@gnu.org>
8148
8149 * buffer.c (word_wrap): Doc fix.
8150
8151 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8152
8153 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8154
8155 2012-06-03 Glenn Morris <rgm@gnu.org>
8156
8157 * xdisp.c (tool-bar-style): Doc fix.
8158
8159 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8160
8161 * Makefile.in (PAXCTL): Define.
8162 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8163 binary via PaX flags if the paxctl utility is available.
8164 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8165 Restore PaX flags to their default. (Bug#11398)
8166
8167 2012-06-03 Chong Yidong <cyd@gnu.org>
8168
8169 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8170 buffer (Bug#11226).
8171
8172 2012-06-03 Chong Yidong <cyd@gnu.org>
8173
8174 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8175 (note_mode_line_or_margin_highlight): If there is no help echo,
8176 use mode-line-default-help-echo. Handle the case where the mouse
8177 position is past the end of the mode line string.
8178
8179 * buffer.c (buffer_local_value_1): New function, split from
8180 Fbuffer_local_value; can return Qunbound.
8181 (Fbuffer_local_value): Use it.
8182 (Vmode_line_format): Docstring tweaks.
8183
8184 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8185
8186 * sysdep.c (system_process_attributes): Improve comment.
8187
8188 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8189
8190 * keyboard.c: Export real-this-command to Elisp.
8191 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8192 and DEFVAR it. Update all users.
8193
8194 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8195
8196 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8197
8198 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8199 Convert pctcpu and pctmem to Lisp float properly.
8200 Let the compiler fold better, as 100.0/0x8000 is exact.
8201
8202 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8203
8204 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8205 cons_block.
8206
8207 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8208
8209 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8210
8211 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8212
8213 For a 'struct window', replace some Lisp_Object fields to
8214 bitfields where appropriate, remove unused fields.
8215 * window.h (struct window): Remove unused 'last_mark_x' and
8216 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8217 change its type from Lisp_Object to bitfield.
8218 Change type of 'force_start', 'optional_new_start',
8219 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8220 fields from Lisp_Object to bitfield. Adjust users accordingly.
8221
8222 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8223
8224 Pacify gcc -Wdouble-precision when using Xaw.
8225 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8226 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8227 Use 'float' consistently, rather than 'float' in most places
8228 and 'double' in a couple of places.
8229
8230 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8231
8232 * xdisp.c (handle_stop): Detect whether we have overlay strings
8233 loaded by testing it->current.overlay_string_index to be
8234 non-negative, instead of checking whether n_overlay_strings is
8235 positive. (Bug#11587)
8236
8237 2012-05-31 Chong Yidong <cyd@gnu.org>
8238
8239 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8240
8241 * doc.c (Fsubstitute_command_keys): Doc fix.
8242
8243 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8244
8245 * search.c (search_buffer): Remove calls to
8246 r_alloc_inhibit_buffer_relocation, as it is now called by
8247 maybe_unify_char, which was the cause of relocation of buffer text
8248 in bug#11519.
8249
8250 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8251
8252 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8253 for the duration of call to load_charset, to avoid problems with
8254 callers of maybe_unify_char that access buffer text through C
8255 pointers.
8256
8257 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8258 decrement the inhibition flag, instead of just setting or
8259 resetting it.
8260
8261 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8262
8263 Remove obsolete '#define static' cruft.
8264 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8265 This #undef was "temporary" in 2000; it is no longer needed
8266 now that '#define static' has gone away.
8267 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8268 (gray_bitmap_bits): Remove; no longer needed.
8269 All uses replaced with definiens.
8270 * xterm.c: Include "bitmaps/gray.xbm".
8271
8272 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8273
8274 Clean up __executable_start, monstartup when --enable-profiling.
8275 The following changes affect the code only when profiling.
8276 * dispnew.c (__executable_start): Rename from safe_bcopy.
8277 Define only on platforms that need it.
8278 * emacs.c: Include <sys/gmon.h> when profiling.
8279 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8280 (__executable_start): Remove decl, since lisp.h does it now.
8281 (safe_bcopy): Remove decl; no longer has that name.
8282 (main): Coalesce #if into single bit of code, for simplicity.
8283 Cast pointers to uintptr_t, since standard libraries want integers
8284 and not pointers.
8285 * lisp.h (__executable_start): New decl.
8286
8287 2012-05-31 Glenn Morris <rgm@gnu.org>
8288
8289 * image.c (Fimagemagick_types): Doc fix.
8290
8291 2012-05-30 Jim Meyering <meyering@redhat.com>
8292
8293 * callproc.c (Fcall_process_region): Include directory component
8294 in mkstemp error message (Bug#11586).
8295
8296 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8297
8298 * alloc.c, lisp.h (make_pure_vector): Now static.
8299
8300 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8301
8302 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8303 Move to byte-run.el.
8304 (Fautoload): Do the hash-doc more carefully.
8305 * data.c (Fdefalias): Purify definition, except for keymaps.
8306 (Qdefun): Move from eval.c.
8307 * lisp.h (Qdefun): Remove.
8308 * lread.c (read1): Tiny simplification.
8309
8310 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8311
8312 Do not create empty overlays with the evaporate property (Bug#9642).
8313 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8314 Bug#9642, but explicitly check that the buffer the overlay would
8315 be moved to is live and rearrange lines to make sure that errors
8316 will not put the overlay in an inconsistent state.
8317 (Fdelete_overlay): Cosmetics.
8318
8319 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8320
8321 * w32term.c (my_bring_window_to_top): New function.
8322 (x_raise_frame): Use handle returned by DeferWindowPos, which
8323 could be different from the original one.
8324 Call my_bring_window_to_top instead of my_set_foreground_window.
8325 (Bug#11513)
8326
8327 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8328 by calling BringWindowToTop.
8329
8330 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8331 (WM_EMACS_END): Increase by one.
8332
8333 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8334
8335 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8336 This avoids undefined behavior that might cause the eassert
8337 to not catch an out-of-range value.
8338
8339 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8340
8341 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8342 Update dependencies.
8343
8344 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8345
8346 * bidi.c (bidi_mirror_char): Fix last change.
8347
8348 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8349
8350 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8351 when referring to sectname field in printf format.
8352
8353 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8354
8355 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8356 Only r_alloc_inhibit_buffer_relocation needed to be added;
8357 the others were already declared.
8358
8359 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8360 before checking whether it's out of range. Put the check inside
8361 eassert. See
8362 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8363
8364 2012-05-27 Ken Brown <kbrown@cornell.edu>
8365
8366 * callproc.c (Fcall_process): Restore a line that was accidentally
8367 commented out in the 2011-02-13 change (bug#11547).
8368
8369 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8370
8371 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8372 defined on ralloc.c.
8373
8374 * buffer.c [REL_ALLOC]: Remove prototypes of
8375 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8376 they are now on lisp.h.
8377
8378 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8379
8380 * search.c (search_buffer): Use it to inhibit relocation of buffer
8381 text while re_search_2 is doing its job, because re_search_2 is
8382 passed C pointers to buffer text. (Bug#11519)
8383
8384 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8385 Update value to 24.
8386
8387 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8388 state after an additional call to move_it_in_display_line_to, keep
8389 the values of it->max_ascent and it->max_descent found for the
8390 entire line.
8391 (pos_visible_p): Revert the comparison against bottom_y to what it
8392 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8393 (Bug#11464)
8394
8395 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8396
8397 Fix coding-related core dumps with gcc -ftrapv.
8398 The code was computing A - B, where A and B are pointers, and B is
8399 random garbage. This can lead to core dumps on platforms that
8400 have special pointer registers, and it also leads to core dumps on
8401 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8402 A - B only when B is initialized properly.
8403 * coding.c (coding_set_source, coding_set_destination): Return void.
8404 (coding_change_source, coding_change_destinations): New functions,
8405 with the old behaviors of coding_set_source and coding_set_destination.
8406 All callers that need an offset changed to use these new functions.
8407
8408 2012-05-26 Glenn Morris <rgm@gnu.org>
8409
8410 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8411
8412 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8413
8414 Extend mouse support on W32 text-mode console.
8415 * xdisp.c (draw_row_with_mouse_face):
8416 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8417
8418 * w32console.c: Include window.h.
8419 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8420 New functions.
8421 (initialize_w32_display): Initialize mouse-highlight data.
8422
8423 * w32inevt.c: Include termchar.h and window.h.
8424 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8425 moves, call note_mouse_highlight. If help_echo changed, call
8426 gen_help_event to produce help-echo message in the echo area.
8427 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8428 highlight info.
8429
8430 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8431
8432 * lread.c (read1): Simplify slightly to avoid an overflow warning
8433 with GCC 4.7.0 on x86-64.
8434
8435 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8436
8437 * bidi.c (bidi_mirror_char): Revert last change: an int is
8438 definitely wide enough here.
8439
8440 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8441
8442 Fix integer width and related bugs (Bug#9874).
8443 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8444 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8445 (string_bytes, check_sblock, allocate_string_data):
8446 (compact_small_strings, Fmake_bool_vector, make_string)
8447 (make_unibyte_string, make_multibyte_string)
8448 (make_string_from_bytes, make_specified_string)
8449 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8450 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8451 (mark_vectorlike):
8452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8453 (allocate_pseudovector):
8454 Use int, not EMACS_INT, where int is wide enough.
8455 (inhibit_garbage_collection, Fgarbage_collect):
8456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8457 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8458 int might not be wide enough.
8459 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8460 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8461 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8462 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8463 (bidi_level_of_next_char, bidi_move_to_visually_next):
8464 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8465 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8466 (Fkill_buffer, Fset_buffer_major_mode)
8467 (advance_to_char_boundary, Fbuffer_swap_text)
8468 (Fset_buffer_multibyte, overlays_at, overlays_in)
8469 (overlay_touches_p, struct sortvec, record_overlay_string)
8470 (overlay_strings, recenter_overlay_lists)
8471 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8472 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8473 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8474 (Foverlay_recenter, last_overlay_modification_hooks_used)
8475 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8477 (validate_region): Omit unnecessary test for b <= e,
8478 since that's guaranteed by the previous test.
8479 (adjust_overlays_for_delete): Avoid pos + length overflow.
8480 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8481 (report_overlay_modification):
8482 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8483 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8484 Omit pointer cast, which isn't needed anyway, and doesn't work
8485 after the EMACS_INT -> ptrdiff_t change.
8486 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8487 * buffer.h: Adjust decls to match defn changes elsewhere.
8488 (struct buffer_text, struct buffer):
8489 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8490 Use EMACS_INT, not int, where int might not be wide enough.
8491 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8492 not int, to avoid needless 32-bit limit on 64-bit hosts.
8493 (exec_byte_code): Use tighter memory-full test, one that checks
8494 for alloca overflow. Don't compute the address of the object just
8495 before an array, as that's not portable. Use EMACS_INT, not
8496 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8497 * callint.c (Fcall_interactively):
8498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8499 * callproc.c (call_process_kill, Fcall_process):
8500 Don't assume pid_t fits into an Emacs fixnum.
8501 (call_process_cleanup, Fcall_process, child_setup):
8502 Don't assume pid_t fits into int.
8503 (call_process_cleanup, Fcall_process, delete_temp_file)
8504 (Fcall_process_region):
8505 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8506 (Fcall_process): Simplify handling of volatile integers.
8507 Use int, not EMACS_INT, where int will do.
8508 * casefiddle.c (casify_object, casify_region, operate_on_word)
8509 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8510 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8511 (casify_object): Avoid integer overflow when overallocating buffer.
8512 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8513 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8514 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8515 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8516 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8517 integers are now checked earlier. All uses replaced with XINT.
8518 (ccl_driver):
8519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8520 For CCL_MapSingle, check that content and value are in int range.
8521 (ccl_driver, Fregister_code_conversion_map):
8522 Check that Vcode_version_map_vector is a vector.
8523 (resolve_symbol_ccl_program): Check that vector header is in range.
8524 Always copy the vector, so that we can check its contents reliably
8525 now rather than having to recheck each instruction as it's being
8526 executed. Check that vector words fit in 'int'.
8527 (ccl_get_compiled_code, Fregister_ccl_program)
8528 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8529 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8530 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8531 contents are in range.
8532 (Fccl_execute_on_string): Check that status is in range.
8533 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8534 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8535 Accept and return EMACS_INT, not int, because callers can pass values
8536 out of 'int' range.
8537 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8538 (multibyte_chars_in_text, parse_str_as_multibyte)
8539 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8540 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8541 (string_escape_byte8, Fget_byte):
8542 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8543 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8544 avoid mishandling large integers.
8545 * character.h: Adjust decls to match defn changes elsewhere.
8546 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8547 (Ffind_charset_region):
8548 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8549 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8550 (load_charset_map_from_vector, Fdefine_charset_internal):
8551 Don't assume fixnum fits in int.
8552 (load_charset_map_from_vector, Fmap_charset_chars):
8553 Remove now-unnecessary CHECK_NATNUMs.
8554 (Fdefine_charset_internal): Check ranges here, more carefully.
8555 Don't rely on undefined behavior with signed left shift overflow.
8556 Don't assume unsigned int fits into fixnum, or that fixnum fits
8557 into unsigned int. Don't require max_code to be a valid fixnum;
8558 that's not true for gb10830 4-byte on a 32-bit host. Allow
8559 invalid_code to be a cons, for the same reason. Require code_offset
8560 to be a character. Avoid int overflow if max_char is close
8561 to INT_MAX.
8562 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8563 this is intended anyway and avoids some undefined behavior.
8564 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8565 INDEX_TO_CODE_POINT, as that's what it expects.
8566 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8567 * charset.h (DECODE_CHAR): Return int, not unsigned;
8568 this is what was intended anyway, and it avoids undefined behavior.
8569 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8570 integer-overflow issues.
8571 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8572 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8573 where the argument is EMACS_INT, and this behavior is not intended.
8574 * chartab.c (Fmake_char_table, Fset_char_table_range)
8575 (uniprop_get_decoder, uniprop_get_encoder):
8576 Don't assume fixnum fits in int.
8577 * cmds.c (move_point): New function, that does the gist of
8578 Fforward_char and Fbackward_char, but does so while checking
8579 for integer overflow more accurately.
8580 (Fforward_char, Fbackward_char): Use it.
8581 (Fforward_line, Fend_of_line, internal_self_insert)
8582 (internal_self_insert):
8583 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8584 Fix a FIXME, by checking for integer overflow when calculating
8585 target_clm and actual_clm.
8586 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8587 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8588 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8589 (coding_alloc_by_making_gap, alloc_destination)
8590 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8591 (encode_coding_utf_16, detect_coding_emacs_mule)
8592 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8593 (detect_coding_iso_2022, decode_coding_iso_2022)
8594 (encode_invocation_designation, encode_designation_at_bol)
8595 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8596 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8597 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8598 (encode_coding_ccl, encode_coding_raw_text)
8599 (detect_coding_charset, decode_coding_charset)
8600 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8601 (produce_composition, produce_charset, produce_annotation)
8602 (decode_coding, handle_composition_annotation)
8603 (handle_charset_annotation, consume_chars, decode_coding_gap)
8604 (decode_coding_object, encode_coding_object, detect_coding_system)
8605 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8606 (code_convert_region, code_convert_string)
8607 (Fdefine_coding_system_internal)
8608 (coding_set_source, coding_set_destination):
8609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8610 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8611 (Fdefine_coding_system_internal):
8612 Don't assume fixnums fit in int.
8613 (decode_coding_gap, decode_coding_object, encode_coding_object)
8614 (Fread_coding_system, Fdetect_coding_region)
8615 (Funencodable_char_position, Fcheck_coding_systems_region)
8616 (get_translation, handle_composition_annotation, consume_chars):
8617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8618 (consume_chars): Rewrite to not calculate an address outside buffer.
8619 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8620 Don't access memory outside of the args array.
8621 (Fdefine_coding_system_internal): Check for charset-id overflow.
8622 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8623 result of ENCODE_CHAR.
8624 * coding.h: Adjust decls to match defn changes elsewhere.
8625 (struct coding_system):
8626 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8627 * composite.c (get_composition_id, find_composition)
8628 (run_composition_function, update_compositions)
8629 (compose_text, composition_gstring_put_cache)
8630 (composition_gstring_p, composition_gstring_width)
8631 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8632 (composition_compute_stop_pos, composition_reseat_it)
8633 (composition_update_it, struct position_record)
8634 (find_automatic_composition, composition_adjust_point)
8635 (Fcomposition_get_gstring, Ffind_composition_internal):
8636 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8637 (update_compositions):
8638 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8639 * composite.h: Adjust decls to match defn changes elsewhere.
8640 (struct composition):
8641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8642 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8643 Do not attempt to compute the address of the object just before a
8644 buffer; this is not portable.
8645 (Faref, Faset):
8646 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8647 (Faset): Use int, not EMACS_INT, where int is wide enough.
8648 (Fstring_to_number): Don't assume fixnums fit in int.
8649 (Frem): Don't assume arg is nonnegative.
8650 * dbusbind.c (xd_append_arg): Check for integers out of range.
8651 (Fdbus_call_method): Don't overflow the timeout int.
8652 (extract_signed, extract_unsigned): New functions.
8653 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8654 (xd_get_connection_references): Return ptrdiff_t, not int.
8655 All uses changed.
8656 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8657 (xd_read_message_1):
8658 Use int, not unsigned, where the dbus API uses int.
8659 (Fdbus_message_internal): Don't overflow mtype.
8660 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8661 * dired.c (directory_files_internal, file_name_completion, scmp)
8662 (file_name_completion_stat):
8663 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8664 (file_name_completion): Don't overflow matchcount.
8665 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8666 * dispextern.h: Adjust decls to match defn changes elsewhere.
8667 (struct text_pos, struct glyph, struct bidi_saved_info)
8668 (struct bidi_string_data, struct bidi_it, struct composition_it)
8669 (struct it):
8670 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8671 (struct display_pos, struct composition_it, struct it):
8672 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8673 * dispnew.c (increment_matrix_positions)
8674 (increment_row_positions, mode_line_string)
8675 (marginal_area_string):
8676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8677 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8678 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8679 (duration_to_sec_usec): New function, to check for overflow better.
8680 (Fsleep_for, sit_for): Use it.
8681 * doc.c (get_doc_string, store_function_docstring):
8682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8683 (get_doc_string, Fsnarf_documentation):
8684 Use int, not EMACS_INT, where int is wide enough.
8685 (get_doc_string):
8686 Use SAFE_ALLOCA, not alloca.
8687 Check for overflow when converting EMACS_INT to off_t.
8688 * doprnt.c (doprnt):
8689 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8690 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8691 Don't assume uid_t fits into fixnum.
8692 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8693 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8694 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8695 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8696 (general_insert_function)
8697 (Finsert_char, make_buffer_string, make_buffer_string_both)
8698 (update_buffer_properties, Fbuffer_substring)
8699 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8700 (Fsubst_char_in_region, check_translation)
8701 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8702 (transpose_markers, Ftranspose_regions):
8703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8704 (clip_to_bounds): Move to lisp.h as an inline function).
8705 (Fconstrain_to_field): Don't assume integers are nonnegative.
8706 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8707 (Fsubst_char_in_region, Fsave_restriction):
8708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8709 (Femacs_pid): Don't assume pid_t fits into fixnum.
8710 (lo_time): Use int, not EMACS_INT, when int suffices.
8711 (lisp_time_argument): Check for usec out of range.
8712 (Fencode_time): Don't assume fixnum fits in int.
8713 (Fuser_login_name, Fuser_full_name): Signal an error
8714 if a uid argument is out of range, rather than relying on
8715 undefined behavior.
8716 (Fformat_time_string): Remove now-unnecessary check.
8717 lisp_time_argument checks for out-of-range usec now.
8718 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8719 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8720 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8721 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8722 (init_cmdargs, Fdump_emacs):
8723 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8724 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8725 the bottom (typically) 32 bits of the fixnum.
8726 * eval.c (specpdl_size, call_debugger):
8727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8728 (when_entered_debugger, Fbacktrace_debug):
8729 Don't assume fixnum can fit in int.
8730 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8731 the object just before a buffer; this is not portable.
8732 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8733 (grow_specpdl, unbind_to):
8734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8735 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8736 (grow_specpdl): Simplify allocation by using xpalloc.
8737 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8738 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8739 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8741 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8742 (a_write, e_write):
8743 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8744 (Fcopy_file, non_regular_nbytes, read_non_regular)
8745 (Finsert_file_contents):
8746 Use int, not EMACS_INT, where int is wide enough.
8747 (READ_BUF_SIZE): Verify that it fits in int.
8748 (Finsert_file_contents): Check that counts are in proper range,
8749 rather than assuming fixnums fit into ptrdiff_t etc.
8750 Don't assume fixnums fit into int.
8751 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8752 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8753 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8754 (string_char_to_byte, string_byte_to_char)
8755 (string_make_multibyte, string_to_multibyte)
8756 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8757 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8758 (substring_both, Fdelete, internal_equal, Ffillarray)
8759 (Fclear_string, mapcar1)
8760 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8761 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8762 (larger_vector, make_hash_table, maybe_resize_hash_table)
8763 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8764 (Fmaphash, secure_hash):
8765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8766 (concat): Check for string index and length overflow.
8767 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8768 (Frequire):
8769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8770 (larger_vector): New API (vec, incr_min, size_max) replaces old
8771 one (vec, new_size, init). This catches size overflow.
8772 INIT was removed because it was always Qnil.
8773 All callers changed.
8774 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8775 the upper bound on a hash table index size.
8776 (make_hash_table, maybe_resize_hash_table): Use it.
8777 (secure_hash): Computer start_byte and end_byte only after
8778 they're known to be in ptrdiff_t range.
8779 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8780 (Ffont_get_glyphs, Ffont_at):
8781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8782 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8783 (Flist_fonts, Fopen_font):
8784 Don't assume fixnum can fit in int.
8785 (check_gstring): Don't assume index can fit in int.
8786 (font_match_p): Check that fixnum is a character, not a nonnegative
8787 fixnum, since the later code needs to stuff it into an int.
8788 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8789 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8790 conversion overflow issues.
8791 (Fopen_font): Check for integer out of range.
8792 (Ffont_get_glyphs): Don't assume index can fit in int.
8793 * font.h: Adjust decls to match defn changes elsewhere.
8794 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8795 integer overflow.
8796 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8797 printmax_t, where ptrdiff_t is wide enough.
8798 (Finternal_char_font):
8799 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8800 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8801 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8802 (Fset_frame_position, x_set_frame_parameters)
8803 (x_set_line_spacing, x_set_border_width)
8804 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8805 Check that fixnums are in proper range for system types.
8806 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8808 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8809 Use SAFE_ALLOCA_LISP, not alloca.
8810 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8811 intptr_t is wide enough.
8812 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8813 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8814 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8815 Check for fixnum out of range.
8816 * ftfont.c (ftfont_list): Don't assume index fits in int.
8817 Check that fixnums are in proper range for system types.
8818 (ftfont_shape_by_flt):
8819 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8820 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8821 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8822 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8823 Check that fixnums are in proper range for system types.
8824 * gnutls.h: Adjust decls to match defn changes elsewhere.
8825 * gtkutil.c (xg_dialog_run):
8826 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8827 (update_frame_tool_bar):
8828 Check that fixnums are in proper range for system types.
8829 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8830 (lookup_image): Check that fixnums are in range for system types.
8831 * indent.c (last_known_column, last_known_column_point):
8832 (current_column_bol_cache):
8833 (skip_invisible, current_column, check_display_width):
8834 (check_display_width, scan_for_column, current_column_1)
8835 (Findent_to, Fcurrent_indentation, position_indentation)
8836 (indented_beyond_p, Fmove_to_column, compute_motion):
8837 (Fcompute_motion, Fvertical_motion):
8838 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8839 (last_known_column_modified): Use EMACS_INT, not int.
8840 (check_display_width):
8841 (Fcompute_motion):
8842 Check that fixnums and floats are in proper range for system types.
8843 (compute_motion): Don't assume index or fixnum fits in int.
8844 (compute_motion, Fcompute_motion):
8845 Use int, not EMACS_INT, when it is wide enough.
8846 (vmotion): Omit local var start_hpos that is always 0; that way
8847 we don't need to worry about overflow in expressions involving it.
8848 * indent.h: Adjust decls to match defn changes elsewhere.
8849 (struct position):
8850 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8851 Use int, not EMACS_INT, where int is wide enough.
8852 Remove unused members ovstring_chars_done and tab_offset;
8853 all uses removed.
8854 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8855 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8856 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8857 (make_gap, copy_text, insert, insert_and_inherit)
8858 (insert_before_markers, insert_before_markers_and_inherit)
8859 (insert_1, count_combining_before, count_combining_after)
8860 (insert_1_both, insert_from_string)
8861 (insert_from_string_before_markers, insert_from_string_1)
8862 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8863 (adjust_after_replace, adjust_after_insert, replace_range)
8864 (replace_range_2, del_range, del_range_1, del_range_byte)
8865 (del_range_both, del_range_2, modify_region)
8866 (prepare_to_modify_buffer, signal_before_change)
8867 (signal_after_change, Fcombine_after_change_execute):
8868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8869 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8870 (balance_an_interval, split_interval_right, split_interval_left)
8871 (find_interval, next_interval, update_interval)
8872 (adjust_intervals_for_insertion, delete_node, delete_interval)
8873 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8874 (static_offset_intervals, offset_intervals)
8875 (merge_interval_right, merge_interval_left, make_new_interval)
8876 (graft_intervals_into_buffer, temp_set_point_both)
8877 (temp_set_point, set_point, adjust_for_invis_intang)
8878 (set_point_both, move_if_not_intangible, get_property_and_range)
8879 (get_local_map, copy_intervals, copy_intervals_to_string)
8880 (compare_string_intervals, set_intervals_multibyte_1):
8881 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8882 * intervals.h: Adjust decls to match defn changes elsewhere.
8883 (struct interval):
8884 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8885 * keyboard.c (this_command_key_count, this_single_command_key_start)
8886 (before_command_key_count, before_command_echo_length, echo_now)
8887 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8888 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8889 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8890 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8891 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8892 (last_non_minibuf_size, last_point_position, echo_truncate)
8893 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8894 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8895 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8896 (stuff_buffered_input):
8897 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8898 (last_auto_save, command_loop_1, read_char):
8899 Use EMACS_INT, not int, to avoid integer overflow.
8900 (record_char): Avoid overflow in total_keys computation.
8901 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8902 * keyboard.h: Adjust decls to match defn changes elsewhere.
8903 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8904 (Fkey_description, Fdescribe_vector, Flookup_key):
8905 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8906 (click_position): New function, to check that positions are in range.
8907 (Fcurrent_active_maps):
8908 (describe_command):
8909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8910 (Faccessible_keymaps, Fkey_description):
8911 (preferred_sequence_p):
8912 Don't assume fixnum can fit into int.
8913 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8914 Check for integer overflow in size calculations.
8915 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8916 avoid mishandling large integers.
8917 * lisp.h: Adjust decls to match defn changes elsewhere.
8918 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8919 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8920 (struct Lisp_Marker):
8921 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8922 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8923 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8924 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8925 All callers changed.
8926 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8927 Assume the arg has valid form, since it always does.
8928 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8929 unsigned integer system type.
8930 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8931 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8932 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8933 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8934 (duration_to_sec_usec): New decl.
8935 * lread.c (read_from_string_index, read_from_string_index_byte)
8936 (read_from_string_limit, readchar, unreadchar, openp)
8937 (read_internal_start, read1, oblookup):
8938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8939 (Fload, readevalloop, Feval_buffer, Feval_region):
8940 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8941 (openp): Check for out-of-range argument to 'access'.
8942 (read1): Use int, not EMACS_INT, where int is wide enough.
8943 Don't assume fixnum fits into int.
8944 Fix off-by-one error that can read outside a buffer.
8945 (read_filtered_event): Use duration_to_sec_usec
8946 to do proper overflow checking on durations.
8947 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8948 in size calculation.
8949 (Fexecute_kbd_macro):
8950 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8951 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8952 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8953 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8954 (set_marker_both, set_marker_restricted_both, marker_position)
8955 (marker_byte_position, Fbuffer_has_markers_at):
8956 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8957 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8958 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8959 It now merely ensures that the menu is large enough, without
8960 necessarily growing it, as this avoids some integer overflow issues.
8961 All callers changed.
8962 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8963 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8964 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8965 Use SAFE_ALLOCA_LISP, not alloca.
8966 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8967 to EMACS_INT. Check that fixnums are in proper range for system types.
8968 * minibuf.c (minibuf_prompt_width, string_to_object)
8969 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8970 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8971 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8972 (get_minibuffer, read_minibuf_unwind):
8973 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8974 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8975 this simplifies overflow checking. All callers changed.
8976 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8977 (Ftest_completion):
8978 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8979 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8980 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8981 Check that fixnums are in proper range for system types.
8982 (Fx_create_frame, Fx_show_tip):
8983 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8984 * nsfont.m (ns_findfonts, nsfont_list_family):
8985 Don't assume fixnum fits in long.
8986 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8988 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8989 wide enough.
8990 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8992 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8993 (PRINTDECLARE, PRINTPREPARE):
8994 (strout, print_string):
8995 (print, print_preprocess, print_check_string_charset_prop)
8996 (print_object):
8997 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8998 (PRINTDECLARE):
8999 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9001 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9002 (printchar, strout): Use xpalloc to catch size calculation overflow.
9003 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9004 (print_error_message): Use SAFE_ALLOCA, not alloca.
9005 (print_object): Use int, not EMACS_INT, where int is wide enough.
9006 (print_depth, new_backquote_output, print_number_index):
9007 Use ptrdiff_t, not int, where int might not be wide enough.
9008 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9009 (Fset_process_window_size, Fformat_network_address)
9010 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9011 (sigchld_handler):
9012 Check that fixnums are in proper range for system types.
9013 (Fsignal_process): Simplify by avoiding a goto.
9014 Check for process-ids out of pid_t range rather than relying on
9015 undefined behavior.
9016 (process_tick, update_tick): Use EMACS_INT, not int.
9017 (Fformat_network_address, read_process_output, send_process)
9018 (Fprocess_send_region, status_notify):
9019 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9020 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9021 (wait_reading_process_output, read_process_output, exec_sentinel):
9022 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9023 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9024 (Faccept_process_output): Use duration_to_sec_usec to do proper
9025 overflow checking on durations.
9026 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9027 Don't assume pid_t fits in int.
9028 * process.h (struct Lisp_Process): Members tick and update_tick
9029 are now of type EMACS_INT, not int.
9030 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9031 configured --with-wide-int.
9032 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9033 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9034 * search.c (looking_at_1, string_match_1):
9035 (fast_string_match, fast_c_string_match_ignore_case)
9036 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9037 (scan_newline, find_before_next_newline, search_command)
9038 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9039 (set_search_regs, wordify):
9040 (Freplace_match):
9041 (Fmatch_data):
9042 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9043 (string_match_1, search_buffer, set_search_regs):
9044 (Fmatch_data):
9045 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9046 (wordify): Check for overflow in size calculation.
9047 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9048 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9049 Check that fixnums are in proper range for system types.
9050 * sound.c (struct sound_device)
9051 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9052 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9053 (Fplay_sound_internal):
9054 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9055 * syntax.c (struct lisp_parse_state, find_start_modiff)
9056 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9057 (Fparse_partial_sexp):
9058 Don't assume fixnums can fit in int.
9059 (struct lisp_parse_state, find_start_pos, find_start_value)
9060 (find_start_value_byte, find_start_begv)
9061 (update_syntax_table, char_quoted, dec_bytepos)
9062 (find_defun_start, prev_char_comend_first, back_comment):
9063 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9064 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9065 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9066 (Finternal_describe_syntax_value): Check that match_lisp is a
9067 character, not an integer, since the code stuffs it into int.
9068 (scan_words, scan_sexps_forward):
9069 Check that fixnums are in proper range for system types.
9070 (Fforward_word):
9071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9072 (scan_sexps_forward):
9073 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9074 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9075 * syntax.h: Adjust decls to match defn changes elsewhere.
9076 (struct gl_state_s):
9077 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9078 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9079 MOST_POSITIVE_FIXNUM.
9080 * sysdep.c (wait_for_termination_1, wait_for_termination)
9081 (interruptible_wait_for_termination, mkdir):
9082 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9083 (emacs_read, emacs_write):
9084 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9085 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9086 and double all fit in int.
9087 * term.c (set_tty_color_mode):
9088 Check that fixnums are in proper range for system types.
9089 * termhooks.h (struct input_event):
9090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9091 * textprop.c (validate_interval_range, interval_of)
9092 (Fadd_text_properties, set_text_properties_1)
9093 (Fremove_text_properties, Fremove_list_of_text_properties)
9094 (Ftext_property_any, Ftext_property_not_all)
9095 (copy_text_properties, text_property_list, extend_property_ranges)
9096 (verify_interval_modification):
9097 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9098 (Fnext_single_char_property_change)
9099 (Fprevious_single_char_property_change):
9100 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9101 (copy_text_properties):
9102 Check for integer overflow in index calculation.
9103 * undo.c (last_boundary_position, record_point, record_insert)
9104 (record_delete, record_marker_adjustment, record_change)
9105 (record_property_change):
9106 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9107 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9108 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9109 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9110 (Fx_hide_tip, Fx_file_dialog):
9111 * w32menu.c (set_frame_menubar):
9112 Use ptrdiff_t, not int, for consistency with rest of code.
9113 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9114 (select_window, Fdelete_other_windows_internal)
9115 (window_scroll_pixel_based, window_scroll_line_based)
9116 (Frecenter, Fset_window_configuration):
9117 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9118 (Fset_window_hscroll, run_window_configuration_change_hook)
9119 (set_window_buffer, temp_output_buffer_show, scroll_command)
9120 (Fscroll_other_window, Frecenter):
9121 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9122 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9123 Don't assume fixnum fits in int.
9124 (Fset_window_scroll_bars):
9125 Check that fixnums are in proper range for system types.
9126 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9127 (string_pos, c_string_pos, number_of_chars, init_iterator)
9128 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9129 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9130 (compute_display_string_end, handle_face_prop)
9131 (face_before_or_after_it_pos, handle_invisible_prop)
9132 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9133 (display_prop_intangible_p, string_buffer_position_lim)
9134 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9135 (get_overlay_strings_1, get_overlay_strings)
9136 (iterate_out_of_display_property, forward_to_next_line_start)
9137 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9138 (get_next_display_element, set_iterator_to_next)
9139 (get_visually_first_element, compute_stop_pos_backwards)
9140 (handle_stop_backwards, next_element_from_buffer)
9141 (move_it_in_display_line_to, move_it_in_display_line)
9142 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9143 (add_to_log, message_dolog, message_log_check_duplicate)
9144 (message2, message2_nolog, message3, message3_nolog
9145 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9146 (current_message_1, truncate_echo_area, truncate_message_1)
9147 (set_message, set_message_1, store_mode_line_noprop)
9148 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9149 (text_outside_line_unchanged_p, check_point_in_composition)
9150 (reconsider_clip_changes)
9151 (redisplay_internal, set_cursor_from_row, try_scrolling)
9152 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9153 (redisplay_window, find_last_unchanged_at_beg_row)
9154 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9155 (trailing_whitespace_p, find_row_edges, display_line)
9156 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9157 (display_mode_element, store_mode_line_string)
9158 (pint2str, pint2hrstr, decode_mode_spec)
9159 (display_count_lines, display_string, draw_glyphs)
9160 (x_produce_glyphs, x_insert_glyphs)
9161 (rows_from_pos_range, mouse_face_from_buffer_pos)
9162 (fast_find_string_pos, mouse_face_from_string_pos)
9163 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9164 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9165 (safe_call, init_from_display_pos, handle_fontified_prop)
9166 (handle_single_display_spec, load_overlay_strings)
9167 (with_echo_area_buffer, setup_echo_area_for_printing)
9168 (display_echo_area, echo_area_display)
9169 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9170 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9171 (redisplay_window, dump_glyph_row, display_mode_line)
9172 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9173 (handle_display_spec, display_prop_string_p):
9174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9175 (handle_single_display_spec, build_desired_tool_bar_string)
9176 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9177 (get_specified_cursor_type):
9178 Check that fixnums are in proper range for system types.
9179 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9180 (Flookup_image_map):
9181 Don't assume fixnums fit in int.
9182 (compare_overlay_entries):
9183 Avoid mishandling comparisons due to subtraction overflow.
9184 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9185 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9186 (handle_tool_bar_click):
9187 Use int, not unsigned, since we prefer signed and the signedness
9188 doesn't matter here.
9189 (get_next_display_element, next_element_from_display_vector):
9190 Use int, not EMACS_INT, when int is wide enough.
9191 (start_hourglass): Use duration_to_sec_usec to do proper
9192 overflow checking on durations.
9193 * xfaces.c (Fbitmap_spec_p):
9194 Check that fixnums are in proper range for system types.
9195 (compare_fonts_by_sort_order):
9196 Avoid mishandling comparisons due to subtraction overflow.
9197 (Fx_family_fonts, realize_basic_faces):
9198 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9199 (Fx_family_fonts):
9200 Don't assume fixnum fits in int.
9201 Use SAFE_ALLOCA_LISP, not alloca.
9202 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9203 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9204 (face_at_buffer_position, face_for_overlay_string)
9205 (face_at_string_position):
9206 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9207 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9208 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9209 (Fx_show_tip):
9210 Check that fixnums are in proper range for system types.
9211 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9212 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9214 (Fx_change_window_property): Don't assume fixnums fit in int.
9215 * xfont.c (xfont_chars_supported):
9216 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9217 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9218 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9219 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9220 * xml.c (parse_region):
9221 * xrdb.c (magic_file_p):
9222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9223 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9224 (x_get_local_selection, x_reply_selection_request)
9225 (x_handle_selection_request, wait_for_property_change):
9226 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9227 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9228 short is wide enough.
9229 (x_send_client_event): Don't assume fixnum fits in int.
9230 * xterm.c (x_x_to_emacs_modifiers):
9231 Don't assume EMACS_INT overflows nicely into int.
9232 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9233 may come from Lisp.
9234 (handle_one_xevent): NATNUMP can eval its arg twice.
9235 (x_connection_closed):
9236 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9237 * xterm.h: Adjust decls to match defn changes elsewhere.
9238 (struct scroll_bar): Use struct vectorlike_header
9239 rather than rolling our own approximation.
9240 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9241
9242 2012-05-25 Glenn Morris <rgm@gnu.org>
9243
9244 * lisp.mk (lisp): Update for more files being compiled now.
9245
9246 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9247
9248 * lread.c: Remove `read_pure' which makes no difference.
9249 (read_pure): Remove var.
9250 (unreadpure): Remove function.
9251 (readevalloop): Don't call read_list with -1 flag.
9252 (read1, read_vector): Don't test read_pure any more.
9253 (read_list): Simplify.
9254
9255 * fileio.c, character.h: Minor style tweaks.
9256
9257 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9258
9259 * window.h (clip_changed): Remove useless declaration.
9260
9261 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9262
9263 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9264 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9265
9266 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9267
9268 Remove src/m/*.
9269 This directory predates autoconf and is no longer needed nowadays.
9270 Move its few remaining bits of functionality to where they're needed.
9271 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9272 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9273 * m/template.h: Remove.
9274 * Makefile.in (M_FILE): Remove. All uses removed.
9275 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9276 * lisp.h (USE_LSB_TAG):
9277 * mem-limits.h (EXCEEDS_LISP_PTR):
9278 Use VAL_MAX, not VALBITS, in #if.
9279 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9280 (EMACS_UINT): Define unconditionally now.
9281 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9282 (BITS_PER_EMACS_INT): New constants, replacing
9283 what used to be in config.h, but not useful in #if.
9284 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9285 define them any more.
9286 (VAL_MAX): New macro.
9287 (VALMASK): Use it.
9288 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9289 BITS_PER_EMACS_INT, in #if.
9290 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9291 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9292 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9293 * s/ms-w32.h (DATA_START):
9294 Move here from removed file m/intel386.h.
9295 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9296 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9297
9298 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9299
9300 Assume C89 or later.
9301 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9302 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9303 (xrealloc):
9304 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9305 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9306 * textprop.c, tparam.c (NULL): Remove.
9307 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9308 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9309 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9310 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9311 * xterm.c (input_signal_count): Assume volatile works.
9312
9313 2012-05-21 Ken Brown <kbrown@cornell.edu>
9314
9315 * xgselect.c (xg_select): Fix first argument in call to 'select'
9316 (bug#11508).
9317
9318 2012-05-20 Ken Brown <kbrown@cornell.edu>
9319
9320 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9321 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9322
9323 2012-05-19 Ken Brown <kbrown@cornell.edu>
9324
9325 * xfns.c (x_in_use): Remove `static' qualifier.
9326 * xterm.h (x_in_use): Declare.
9327 * xgselect.c: Include xterm.h.
9328 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9329 and `display_arg' (bug#9754).
9330
9331 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9332
9333 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9334
9335 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9336 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9337
9338 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9339
9340 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9341
9342 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9343 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9344
9345 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9346 reference to image_cache->refcount.
9347 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9348
9349 2012-05-17 Juri Linkov <juri@jurta.org>
9350
9351 * search.c (Fword_search_regexp, Fword_search_backward)
9352 (Fword_search_forward, Fword_search_backward_lax)
9353 (Fword_search_forward_lax): Move functions to isearch.el
9354 (bug#10145, bug#11381).
9355
9356 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9357
9358 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9359
9360 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9361
9362 * lread.c (init_obarray): Declare Qt and Qnil as special.
9363
9364 2012-05-14 Glenn Morris <rgm@gnu.org>
9365
9366 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9367 Put "libexec" before "bin", for the sake of init_callproc_1.
9368
9369 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9370
9371 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9372
9373 * unexaix.c: Port to more-recent AIX compilers.
9374 (report_error, report_error_1, make_hdr, copy_sym)
9375 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9376 Make arguments const char *, not char *, to avoid violations of C
9377 standard and to fix some AIX warnings reported by Gilles Pion.
9378
9379 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9380
9381 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9382 already have overlays loaded.
9383 (handle_single_display_spec): Before returning without displaying
9384 fringe bitmap, synchronize the bidi iterator with the main display
9385 iterator, by calling iterate_out_of_display_property.
9386 (iterate_out_of_display_property): Detect buffer iteration by
9387 testing that it->string is a Lisp string.
9388 (get_next_display_element): When the current object is exhausted,
9389 and there's something on it->stack, call set_iterator_to_next to
9390 proceed with what's on the stack, instead of returning zero.
9391 (set_iterator_to_next): If called at the end of a Lisp string,
9392 proceed to consider_string_end without incrementing string
9393 position. Don't increment display vector index past the end of
9394 the display vector. (Bug#11417)
9395 (pos_visible_p): Don't report a position visible when move_it_to
9396 stopped at the last line of window, which happens to be scanned
9397 backwards by the bidi iteration. (Bug#11464)
9398
9399 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9400
9401 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9402 and right-margin display specs even if the spec is invalid or we
9403 are on a TTY, and thus unable to display on the fringes.
9404 That's because the text with the property will not be displayed anyway,
9405 so we need to signal to the caller that this is a "replacing"
9406 display spec. This fixes display when the spec is invalid or we
9407 are on a TTY.
9408
9409 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9410
9411 * unexaix.c (make_hdr): Fix typo in prototype.
9412 This bug broke the build on AIX. Problem reported by Gilles Pion.
9413
9414 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9415
9416 * keyboard.c (kbd_buffer_get_event): Read special events also in
9417 batch mode. (Bug#11415)
9418
9419 2012-05-12 Glenn Morris <rgm@gnu.org>
9420
9421 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9422
9423 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9424
9425 * lisp.mk (lisp): Add newcomment.elc.
9426
9427 2012-05-12 Glenn Morris <rgm@gnu.org>
9428
9429 * Makefile.in (MKDIR_P): New, set by configure.
9430 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9431
9432 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9433
9434 Remove unused function hourglass_started.
9435 * dispextern.h (hourglass_started):
9436 * w32fns.c (hourglass_started):
9437 * xdisp.c (hourglass_started): Remove.
9438
9439 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9440
9441 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9442 Update dependencies.
9443
9444 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9445
9446 * xgselect.c (xg_select): Put maxfds+1 into a var.
9447 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9448
9449 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9450
9451 2012-05-10 Dave Abrahams <dave@boostpro.com>
9452
9453 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9454 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9455
9456 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9457
9458 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9459 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9460 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9461 Initialize xd_registered_buses.
9462
9463 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9464
9465 Untag more efficiently if USE_LSB_TAG.
9466 This is based on a proposal by YAMAMOTO Mitsuharu in
9467 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9468 For an admittedly artificial (nth 8000 longlist) benchmark on
9469 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9470 Emacs's overall text size by 1%.
9471 * lisp.h (XUNTAG): New macro.
9472 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9473 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9474 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9475 * eval.c (Fautoload):
9476 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9477 * frame.h (XFRAME): Use XUNTAG.
9478
9479 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9480 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9481 Remove unportable assumptions about print widths of types like
9482 dbus_uint32_t.
9483 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9484 intptr_t when converting between pointer and integer, to avoid GCC
9485 warnings about wrong width.
9486
9487 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9488
9489 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9490 stack for each reader_thread, instead of defaulting to 8MB
9491 determined by the linker. This avoids failures in creating
9492 subprocesses on Windows 7, see the discussion in this thread:
9493 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9494
9495 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9496
9497 Fix up display of the *Minibuf-0* buffer in the mini window.
9498 * keyboard.c (read_char): Don't clear the echo area if there's no
9499 message to clear.
9500 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9501 contents of *Minibuf-0*) if there's no message displayed in its stead.
9502
9503 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9504
9505 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9506 batch mode.
9507
9508 2012-05-06 Chong Yidong <cyd@gnu.org>
9509
9510 * lisp.mk (lisp): Update.
9511
9512 2012-05-05 Jim Meyering <meyering@redhat.com>
9513
9514 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9515
9516 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9517
9518 * data.c (PUT_ERROR): New macro.
9519 (syms_of_data): Use it. Add new error type `user-error'.
9520 * undo.c (user_error): New function.
9521 (Fprimitive_undo): Use it.
9522 * print.c (print_error_message): Adjust print style for `user-error'.
9523 * keyboard.c (user_error): New function.
9524 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9525
9526 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9527
9528 Do not limit current-time-string to years 1000..9999.
9529 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9530 (Fcurrent_time_string): Support any year that is supported by the
9531 underlying localtime representation. Don't use asctime, as it
9532 has undefined behavior for years outside the range -999..9999.
9533
9534 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9535
9536 Fix race conditions involving setenv, gmtime, localtime, asctime.
9537 Without this fix, interrupts could mess up code that uses these
9538 nonreentrant functions, since setting TZ invalidates existing
9539 tm_zone or tzname values, and since most of these functions return
9540 pointers to static storage.
9541 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9542 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9543 Grow the critical sections to include not just invoking
9544 localtime/gmtime, but also accessing these functions' results
9545 including their tm_zone values if any, and any related TZ setting.
9546 (format_time_string): Last arg is now struct tm *, not struct tm **,
9547 so that the struct tm is saved in the critical section.
9548 All callers changed. Simplify allocation of initial buffer, partly
9549 motivated by the fact that memory allocation needs to be outside
9550 the critical section.
9551
9552 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9553
9554 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9555 with RESET_INTERVAL.
9556
9557 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9558 Remove duplicated buffer name initialization.
9559
9560 2012-05-02 Jim Meyering <jim@meyering.net>
9561
9562 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9563
9564 * xfns.c (x_window): Use xstrdup (Bug#11375).
9565
9566 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9567
9568 * xdisp.c (pos_visible_p): If already at a newline from the
9569 display string before the 'while' loop, don't walk back the glyphs
9570 from it3.glyph_row. Solves assertion violation when the display
9571 string begins with a newline (egg.el). (Bug#11367)
9572
9573 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9574
9575 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9576 Move to simple.el.
9577
9578 2012-05-01 Glenn Morris <rgm@gnu.org>
9579
9580 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9581 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9582 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9583 All were removed before 23.1.
9584
9585 * dispnew.c: Remove HAVE_LIBNCURSES test;
9586 it is always true on relevant platforms.
9587
9588 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9589 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9590
9591 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9592
9593 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9594
9595 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9596 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9597 Remove.
9598
9599 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9600
9601 Do not avoid creating empty evaporating overlays (Bug#9642).
9602 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9603 That is, do not delete an evaporating overlay if it becomes
9604 empty after its bounds are adjusted to fit within its buffer.
9605 This fix caused other problems, and I'm reverting it until we get
9606 to the bottom of them.
9607
9608 2012-04-27 Chong Yidong <cyd@gnu.org>
9609
9610 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9611
9612 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9613
9614 * xdisp.c (pos_visible_p): If the window start position is beyond
9615 ZV, start the display from buffer beginning. Prevents assertion
9616 violation in init_iterator when the minibuffer window is scrolled
9617 via the scroll bar.
9618
9619 * window.c (window_scroll_pixel_based): Likewise.
9620
9621 2012-04-27 Chong Yidong <cyd@gnu.org>
9622
9623 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9624
9625 2012-04-27 Glenn Morris <rgm@gnu.org>
9626
9627 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9628 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9629
9630 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9631
9632 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9633 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9634
9635 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9636
9637 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9638 display element, check also the underlying string or buffer
9639 character. (Bug#11341)
9640
9641 * w32menu.c: Include w32heap.h.
9642 (add_menu_item): If the call to AppendMenuW (via
9643 unicode_append_menu) fails, disable Unicode menus only if we are
9644 running on Windows 9X/Me.
9645
9646 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9647
9648 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9649 (xgetint): Add missing shift for LSB tags.
9650
9651 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9652
9653 * keyboard.c (read_char): Don't wipe echo area for select window
9654 events: These might get delayed via `mouse-autoselect-window'
9655 (Bug#11304).
9656
9657 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9658
9659 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9660 manipulation of :loaded-from data.
9661
9662 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9663
9664 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9665 now a cons (bug#11311).
9666
9667 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9668
9669 Do not create empty overlays with the evaporate property (Bug#9642).
9670 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9671 if it becomes empty after its bounds are adjusted to fit within
9672 its buffer. Without this fix, in a nonempty buffer (let ((o
9673 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9674 yields an empty overlay that has the evaporate property, which is
9675 not supposed to happen.
9676
9677 Fix minor GTK3 problems found by static checking.
9678 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9679 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9680 (struct _EmacsFixedClass, emacs_fixed_get_type):
9681 Move decls here from emacsgtkfixed.h, since they needn't be public.
9682 (emacs_fixed_get_type): Now static.
9683 (emacs_fixed_class_init): Omit unused local.
9684 (emacs_fixed_child_type): Remove; unused.
9685 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9686 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9687 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9688 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9689 (EMACS_FIXED_GET_CLASS): Remove; unused.
9690 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9691
9692 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9693 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9694
9695 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9696
9697 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9698 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9699 (__malloc_size_t, __malloc_ptrdiff_t):
9700 Remove. All uses removed, replaced by the definiens if needed,
9701 since we can assume C89 or better now.
9702 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9703 (protect_malloc_state, align, get_contiguous_space)
9704 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9705 (malloc_atfork_handler_child, malloc_enable_thread)
9706 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9707 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9708 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9709 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9710 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9711 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9712 Define using prototypes, not old style.
9713 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9714 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9715 (align): Don't assume that signed integer overflow wraps around.
9716 Omit unused local var.
9717 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9718 (_free_internal_nolock, memalign, mallochook, reallochook):
9719 Omit no-longer-needed casts.
9720 (valloc): Use getpagesize, not __getpagesize.
9721 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9722 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9723
9724 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9725
9726 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9727
9728 Move functions from C to Lisp. Make non-blocking method calls
9729 the default. Implement further D-Bus standard interfaces.
9730
9731 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9732 (QCdbus_request_name_allow_replacement)
9733 (QCdbus_request_name_replace_existing)
9734 (QCdbus_request_name_do_not_queue)
9735 (QCdbus_request_name_reply_primary_owner)
9736 (QCdbus_request_name_reply_in_queue)
9737 (QCdbus_request_name_reply_exists)
9738 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9739 (QCdbus_registered_serial, QCdbus_registered_method)
9740 (QCdbus_registered_signal): New Lisp objects.
9741 (XD_DEBUG_MESSAGE): Use sizeof.
9742 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9743 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9744 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9745 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9746 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9747 (xd_signature, xd_append_arg): Allow float for integer types.
9748 (xd_get_connection_references): New function.
9749 (xd_get_connection_address): Rename from xd_initialize.
9750 Return cached address.
9751 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9752 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9753 level.
9754 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9755 Return number of refcounts.
9756 (Fdbus_get_unique_name): Make stronger parameter check.
9757 (Fdbus_message_internal): New defun.
9758 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9759 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9760 (Fdbus_send_signal, Fdbus_register_service)
9761 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9762 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9763 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9764 (Vdbus_compiled_version, Vdbus_runtime_version)
9765 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9766 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9767 (Vdbus_message_type_signal): New defvars.
9768 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9769 Adapt docstring.
9770
9771 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9772
9773 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9774 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9775 Do not assume ptrdiff_t is the same width as 'int'.
9776
9777 * alloc.c: Handle unusual debugging option combinations.
9778 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9779 since the two debugging options are incompatible.
9780 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9781 is defined.
9782 (mem_init, mem_insert, mem_insert_fixup):
9783 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9784 (NEED_MEM_INSERT): Remove; no longer needed.
9785
9786 2012-04-22 Leo Liu <sdl.web@gmail.com>
9787
9788 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9789
9790 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9791
9792 * sysdep.c [__FreeBSD__]: Minor cleanups.
9793 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9794 Use Emacs indenting style more consistently. Avoid some casts.
9795 Use 'double' consistently rather than mixing 'float' and 'double'.
9796
9797 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9798
9799 * sysdep.c (list_system_processes, system_process_attributes):
9800 Add implementation for FreeBSD (Bug#5243).
9801
9802 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9803
9804 * lisp.mk (lisp): Update.
9805
9806 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9807
9808 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9809 It is never used otherwise.
9810
9811 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9812
9813 * print.c (print_preprocess): Only check print_depth if print-circle
9814 is nil.
9815 (print_object): Check for cycles even when print-circle is nil and
9816 print-gensym is t, but only check print_depth if print-circle is nil.
9817
9818 2012-04-20 Chong Yidong <cyd@gnu.org>
9819
9820 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9821 set the status to "failed" and ensure that sentinel is run.
9822
9823 2012-04-20 Glenn Morris <rgm@gnu.org>
9824
9825 * process.c (Fset_process_inherit_coding_system_flag)
9826 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9827 (Fmake_network_process, Fmake_serial_process): Doc fix.
9828
9829 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9830
9831 * xdisp.c (string_buffer_position_lim): Limit starting position to
9832 BEGV.
9833 (set_cursor_from_row): If called for a mode-line or header-line
9834 row, return zero immediately.
9835 (try_cursor_movement): If inside continuation line, don't back up
9836 farther than the first row after the header line, if any.
9837 Don't consider the header-line row as "partially visible", even if
9838 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9839
9840 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9841
9842 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9843 (bug#11238).
9844
9845 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9846 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9847
9848 configure: new option --enable-gcc-warnings (Bug#11207)
9849 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9850 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9851 (ALL_CFLAGS): Use new macros rather than old.
9852 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9853 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9854 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9855 -Wunused-result, -Wunused-variable. This should go away once
9856 the Emacs and Gnulib regex code is merged.
9857 (xmalloc, xrealloc): Now static.
9858
9859 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9860
9861 * dired.c (Fsystem_groups): Remove unused local.
9862
9863 2012-04-17 Glenn Morris <rgm@gnu.org>
9864
9865 * dired.c (Fsystem_users): Doc fix.
9866
9867 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9868
9869 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9870 (syms_of_dired): Add them.
9871
9872 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9873
9874 Fix minor alloc.c problems found by static checking.
9875 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9876 New extern decls, to avoid calling undeclared functions.
9877 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9878 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9879 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9880 (NEED_MEM_INSERT): New macro.
9881 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9882 Remove one incorrect comment and fix another.
9883
9884 Fix minor ralloc.c problems found by static checking.
9885 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9886 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9887 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9888 (r_alloc_sbrk): Now static.
9889
9890 Improve ralloc.c interface checking.
9891 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9892 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9893 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9894 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9895 [REL_ALLOC]: ... to here, to check interface.
9896 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9897 Remove decls. This fixes an "It stinks!".
9898
9899 * alloc.c (which_symbols): Fix alignment issue / type clash.
9900
9901 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9902
9903 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9904 (struct Lisp_Misc_Any): Likewise.
9905 (struct Lisp_Free): Likewise.
9906 * alloc.c (union aligned_Lisp_Symbol): Define.
9907 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9908 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9909 (union aligned_Lisp_Misc): Define.
9910 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9911 aligned_Lisp_Misc instead of union Lisp_Misc.
9912 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9913
9914 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9915
9916 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9917 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9918 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9919 * s/netbsd.h, s/sol2-6.h:
9920 Remove definition of GC_MARK_STACK, since the default now works.
9921 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9922 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9923 no longer the default.
9924 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9925
9926 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9927
9928 * lread.c (lisp_file_lexically_bound_p):
9929 Fix hang at ";-*-\n" (bug#11238).
9930
9931 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9932
9933 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9934 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9935
9936 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9937
9938 * nsterm.m (constrainFrameRect): Always constrain when there is only
9939 one screen (Bug#10962).
9940
9941 2012-04-13 Ken Brown <kbrown@cornell.edu>
9942
9943 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9944
9945 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9946
9947 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9948
9949 2012-04-11 Daniel Colascione <dancol@dancol.org>
9950
9951 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9952 against is gone. It's better to use vfork now so that when Cygwin
9953 gains a new, working vfork, we use it automatically (bug#10398).
9954
9955 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9956
9957 * window.c (save_window_save): Obey window-point-insertion-type.
9958
9959 2012-04-11 Glenn Morris <rgm@gnu.org>
9960
9961 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9962
9963 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9964
9965 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9966
9967 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9968
9969 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9970 (force_quit_count): New var.
9971 (handle_interrupt): Use it.
9972
9973 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9974
9975 * w32.c (w32_delayed_load): Record the full path of the library
9976 being loaded (bug#10424).
9977
9978 2012-04-09 Glenn Morris <rgm@gnu.org>
9979
9980 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9981 not just in the obarray, before snarfing them. (Bug#11036)
9982
9983 * Makefile.in ($(leimdir)/leim-list.el):
9984 Pass EMACS rather than BUILT_EMACS.
9985
9986 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9987
9988 * process.c (make_process):
9989 * process.h: Add integer `gnutls_handshakes_tried' member to
9990 process struct.
9991
9992 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9993 Add convenience `GNUTLS_LOG2i' macro.
9994
9995 * gnutls.c (gnutls_log_function2i): Convenience log function.
9996 (emacs_gnutls_read): Use new log functions,
9997 `gnutls_handshakes_tried' process member, and
9998 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9999 attempts per process (connection).
10000
10001 2012-04-09 Chong Yidong <cyd@gnu.org>
10002
10003 * eval.c (Fuser_variable_p, user_variable_p_eh)
10004 (lisp_indirect_variable): Functions deleted.
10005 (Fdefvar): Caller changed.
10006
10007 * callint.c (Finteractive, Fcall_interactively):
10008 * minibuf.c (Fread_variable): Callers changed.
10009
10010 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10011
10012 * xdisp.c (set_cursor_from_row): If the display string appears in
10013 the buffer at position that is closer to point than the position
10014 after the display string, display the cursor on the first glyph of
10015 the display string. Fixes cursor display when a 'display' text
10016 property immediately follows invisible text. (Bug#11094)
10017
10018 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10019
10020 composite.c: use 'double' consistently
10021 * composite.c (get_composition_id): Use 'double' consistently
10022 instead of converting 'float' to 'double' and vice versa; this is
10023 easier to understand and avoids a GCC warning.
10024
10025 2012-04-09 Glenn Morris <rgm@gnu.org>
10026
10027 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10028 preparation for dumping it with emacs. (Bug#4789)
10029 (leimdir): New variable.
10030 ($(leimdir)/leim-list.el): New rule.
10031 (emacs$(EXEEXT)): Depend on leim-list.el.
10032
10033 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10034 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10035 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10036
10037 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10038
10039 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10040 proper alignment.
10041
10042 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10043
10044 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10045 Remove unused local variable.
10046
10047 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10048
10049 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10050 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10051 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10052 objects, as mark_maybe_pointer will catch them otherwise.
10053 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10054 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10055
10056 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10057
10058 Fix typo that broke non-Windows builds.
10059 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10060
10061 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10062
10063 Support building on MS-Windows with libxml2.
10064
10065 * makefile.w32-in (OBJ2): Add xml.$(O).
10066 (GLOBAL_SOURCES): Add xml.c.
10067 ($(BLD)/xml.$(O)): New dependency list.
10068
10069 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10070 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10071 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10072 [!WINDOWSNT]: New macros.
10073 (init_libxml2_functions, libxml2_loaded_p): New functions.
10074 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10075 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10076 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10077 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10078 linked in).
10079 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10080 Call init_libxml2_functions before calling libxml2 functions.
10081 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10082
10083 * emacs.c: Don't include libxml/parser.h.
10084 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10085 xmlCleanupParser directly.
10086
10087 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10088
10089 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10090
10091 * indent.c (Fvertical_motion): If there is a display string at
10092 point, use it.vpos to compute how many lines to backtrack after
10093 move_it_to point. (Bug#11133)
10094
10095 2012-04-06 Eli Zaretskii <eliz@gnu.org>
10096
10097 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10098 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10099 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10100 macros related to unification of CJK characters. For the details,
10101 see the discussion following the message here:
10102 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10103
10104 2012-04-04 Chong Yidong <cyd@gnu.org>
10105
10106 * keyboard.c (Vdelayed_warnings_list): Doc fix.
10107
10108 2012-04-01 Eli Zaretskii <eliz@gnu.org>
10109
10110 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10111 instead of alloca. (Bug#11138)
10112
10113 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10114
10115 * w32menu.c (is_simple_dialog): Properly check lisp types.
10116 (Bug#11141)
10117
10118 2012-03-31 Eli Zaretskii <eliz@gnu.org>
10119
10120 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10121 position we get to after a call to move_it_to fails the
10122 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10123 only if we wind up in a string from display property. (Bug#11063)
10124
10125 * window.c (Fdelete_other_windows_internal): Invalidate the row
10126 and column information about mouse highlight, so that redisplay
10127 restores it after reallocating the glyph matrices. (Bug#7464)
10128
10129 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10130 string comes from a `display' text property, use the buffer
10131 position of that property as if we actually saw that position in
10132 the row's glyphs.
10133 (move_it_by_lines): Remove the assertion that
10134 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10135 violated when there's a before-string at the beginning of a line.
10136 (Bug#11063)
10137
10138 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10139
10140 * xdisp.c (append_space_for_newline): If the default face was
10141 remapped, use the remapped face for the appended newline.
10142 (extend_face_to_end_of_line): Use the remapped default face for
10143 extending the face to the end of the line.
10144 (display_line): Call extend_face_to_end_of_line when the default
10145 face was remapped. (Bug#11068)
10146
10147 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10148
10149 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10150
10151 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10152
10153 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10154
10155 2012-03-27 Glenn Morris <rgm@gnu.org>
10156
10157 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10158 Doc fixes.
10159
10160 2012-03-26 Kenichi Handa <handa@m17n.org>
10161
10162 * dispextern.h (struct glyph): Fix previous change. Change the
10163 bit length of glyphless.ch to 25 (Bug#11082).
10164
10165 2012-03-26 Chong Yidong <cyd@gnu.org>
10166
10167 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10168 (command_loop_1): Use it; inhibit selection update for
10169 handle-select-window too (Bug#8996).
10170
10171 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10172
10173 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10174
10175 2012-03-25 Kenichi Handa <handa@m17n.org>
10176
10177 * dispextern.h (struct glyph): Change the bit length of
10178 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10179
10180 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10181
10182 * s/ms-w32.h (tzname): Include time.h before redirecting to
10183 _tzname. Fixes the MSVC build. (Bug#9960)
10184
10185 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10186
10187 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10188 characters.
10189
10190 * xterm.c (XTread_socket): Only modify handling_signal if
10191 !SYNC_INPUT. (Bug#11080)
10192
10193 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10194
10195 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10196 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10197 when fetching a multibyte character consumes more bytes than
10198 CHAR_BYTES returns, due to unification of CJK characters in
10199 string_char. (Bug#11073)
10200
10201 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10202
10203 * process.c (wait_reading_process_output): Handle pty disconnect
10204 by refraining from sending oneself a SIGCHLD (bug#10933).
10205
10206 2012-03-22 Chong Yidong <cyd@gnu.org>
10207
10208 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10209
10210 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10211 Mark string as coming from a prefix property.
10212 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10213 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10214
10215 2012-03-21 Chong Yidong <cyd@gnu.org>
10216
10217 * xfaces.c (Vface_remapping_alist): Doc fix.
10218
10219 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10220
10221 * w32proc.c (Fw32_set_console_codepage)
10222 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10223 Doc fixes.
10224
10225 2012-03-20 Chong Yidong <cyd@gnu.org>
10226
10227 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10228 to reflect default non-nil value of redisplay-dont-pause.
10229
10230 2012-03-19 Kenichi Handa <handa@m17n.org>
10231
10232 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10233 it fit in a valid range (Bug#11003).
10234
10235 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10236
10237 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10238 that is not from display property, accept the row as a "cursor
10239 row" if one of the string's character has a non-nil `cursor'
10240 property. Fixes cursor positioning when there are newlines in
10241 overlay strings, e.g. in icomplete.el. (Bug#11035)
10242
10243 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10244
10245 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10246
10247 2012-03-12 Chong Yidong <cyd@gnu.org>
10248
10249 * eval.c (inhibit_lisp_code): Rename from
10250 inhibit_window_configuration_change_hook; move from window.c.
10251
10252 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10253 * window.c (run_window_configuration_change_hook)
10254 (syms_of_window): Callers changed.
10255
10256 2012-03-11 Chong Yidong <cyd@gnu.org>
10257
10258 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10259
10260 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10261
10262 2012-03-10 Chong Yidong <cyd@gnu.org>
10263
10264 * frame.c (other_visible_frames): Don't assume the selected frame
10265 is visible (Bug#10955).
10266
10267 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10268
10269 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10270
10271 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10272
10273 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10274 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10275 zero (Bug#10954).
10276
10277 2012-03-03 Glenn Morris <rgm@gnu.org>
10278
10279 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10280
10281 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10282
10283 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10284 position past the first glyph_row that ends at ZV. (Bug#10902)
10285 (redisplay_window, next_element_from_string): Fix typos in
10286 comments.
10287 (redisplay_window): Pass to move_it_vertically the margin in
10288 pixels, not in screen lines.
10289
10290 2012-03-02 Glenn Morris <rgm@gnu.org>
10291
10292 * buffer.c (buffer-list-update-hook): Doc fix.
10293
10294 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10295
10296 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10297 push_it before setting up the iterator for the first overlay
10298 string, even if we have an empty string loaded.
10299 (next_overlay_string): If there's an empty string on the iterator
10300 stack, pop the stack. (Bug#10903)
10301
10302 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10303
10304 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10305 Suggested by Stefan Monnier in
10306 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10307 * alloc.c (widen_to_Lisp_Object): New static function.
10308 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10309 and widening them to Lisp_Objects. This would work even if
10310 USE_LSB_TAG is defined and wide integers are used, which might
10311 happen in a future version of Emacs.
10312
10313 2012-02-25 Chong Yidong <cyd@gnu.org>
10314
10315 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10316 Doc fix.
10317
10318 * xselect.c (Fx_selection_exists_p): Doc fix.
10319 (x_clipboard_manager_save_all): Print an informative message
10320 before saving to clipboard manager.
10321
10322 2012-02-24 Chong Yidong <cyd@gnu.org>
10323
10324 * keyboard.c (process_special_events): Handle all X selection
10325 requests in kbd_buffer, not just the next one (Bug#8869).
10326
10327 2012-02-23 Chong Yidong <cyd@gnu.org>
10328
10329 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10330 call when setting menu-bar-lines and tool-bar-lines parameters.
10331 (unwind_create_frame_1): New helper function.
10332
10333 * window.c (inhibit_window_configuration_change_hook): New var.
10334 (run_window_configuration_change_hook): Obey it.
10335 (syms_of_window): Initialize it.
10336
10337 2012-02-22 Chong Yidong <cyd@gnu.org>
10338
10339 * xterm.c (x_draw_image_relief): Add missing type check for
10340 Vtool_bar_button_margin (Bug#10743).
10341
10342 2012-02-21 Chong Yidong <cyd@gnu.org>
10343
10344 * fileio.c (Vfile_name_handler_alist): Doc fix.
10345
10346 * buffer.c (Fget_file_buffer): Protect against invalid file
10347 handler return value.
10348
10349 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10350
10351 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10352 when computing $valmask.
10353
10354 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10355 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10356 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10357 It's useless in that case, and it can cause problems on hosts
10358 that allocate halves of EMACS_INT values separately.
10359 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10360 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10361 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10362 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10363 it avoids undefined behavior on hosts where shifting right by more
10364 than the word width has undefined behavior.
10365
10366 2012-02-19 Chong Yidong <cyd@gnu.org>
10367
10368 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10369 (Funhandled_file_name_directory, Ffile_name_as_directory)
10370 (Fdirectory_file_name, Fexpand_file_name)
10371 (Fsubstitute_in_file_name): Protect against invalid file handler
10372 return values (Bug#10845).
10373
10374 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10375
10376 * .gdbinit (pitx): Fix incorrect references to fields of the
10377 iterator stack.
10378
10379 2012-02-17 Chong Yidong <cyd@gnu.org>
10380
10381 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10382
10383 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10384
10385 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10386 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10387
10388 2012-02-15 Chong Yidong <cyd@gnu.org>
10389
10390 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10391 marked as special. Also, starting docstrings with * is obsolete.
10392
10393 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10394
10395 * gnutls.c (emacs_gnutls_write): Fix last change.
10396
10397 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10398
10399 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10400 send_process.
10401
10402 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10403
10404 * keymap.c (Fsingle_key_description): Handle char ranges.
10405
10406 2012-02-12 Chong Yidong <cyd@gnu.org>
10407
10408 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10409 as that creates a dangerous corner case.
10410
10411 * window.c (Fdelete_window_internal): Invalidate the mouse
10412 highlight (Bug#9904).
10413
10414 2012-02-12 Glenn Morris <rgm@gnu.org>
10415
10416 * xselect.c (Fx_own_selection_internal)
10417 (Fx_get_selection_internal, Fx_disown_selection_internal)
10418 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10419 * nsselect.m (Fx_own_selection_internal)
10420 (Fx_disown_selection_internal, Fx_selection_exists_p)
10421 (Fx_selection_owner_p, Fx_get_selection_internal):
10422 Sync docs and argument specs with the xselect.c versions.
10423
10424 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10425
10426 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10427
10428 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10429
10430 * w32select.c (Fx_selection_exists_p): Sync doc string and
10431 argument list with xselect.c. (Bug#10783)
10432
10433 * w16select.c (Fx_selection_exists_p): Sync doc string and
10434 argument list with xselect.c. (Bug#10783)
10435
10436 2012-02-10 Glenn Morris <rgm@gnu.org>
10437
10438 * fns.c (Fsecure_hash): Doc fix.
10439
10440 2012-02-09 Kenichi Handa <handa@m17n.org>
10441
10442 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10443
10444 2012-02-07 Chong Yidong <cyd@gnu.org>
10445
10446 * buffer.c (Fbuffer_local_variables)
10447 (buffer_lisp_local_variables): Handle unbound vars correctly;
10448 don't let Qunbound leak into Lisp.
10449
10450 2012-02-07 Glenn Morris <rgm@gnu.org>
10451
10452 * image.c (Fimagemagick_types): Doc fix.
10453
10454 * image.c (imagemagick-render-type): Change it from a lisp object
10455 to an integer. Move the doc here from the lisp manual.
10456 Treat all values not equal to 0 the same.
10457
10458 2012-02-06 Chong Yidong <cyd@gnu.org>
10459
10460 * doc.c (store_function_docstring): Avoid applying docstring of
10461 alias to base function (Bug#2603).
10462
10463 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10464
10465 * .gdbinit (pp1, pv1): Remove redundant defines.
10466 (pr): Use pp.
10467
10468 2012-02-04 Chong Yidong <cyd@gnu.org>
10469
10470 * nsterm.m: Declare a global (Bug#10694).
10471
10472 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10473
10474 * w32.c (get_emacs_configuration_options):
10475 Include --enable-checking, if specified, in the return value.
10476
10477 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10478
10479 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10480 after rounding frame sizes. (Bug#9723)
10481
10482 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10483
10484 * keyboard.c (adjust_point_for_property): Don't position point
10485 before BEGV. (Bug#10696)
10486
10487 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10488
10489 Handle overflow when computing char display width (Bug#9496).
10490 * character.c (char_width): Return EMACS_INT, not int.
10491 (char_width, c_string_width): Check for overflow when
10492 computing the width; this is possible now that individual
10493 characters can have unbounded width. Problem introduced
10494 by merge from Emacs 23 on 2012-01-19.
10495
10496 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10497
10498 * dbusbind.c (Fdbus_register_method): Mention the return value
10499 :ignore in the docstring.
10500
10501 2012-02-02 Glenn Morris <rgm@gnu.org>
10502
10503 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10504
10505 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10506 Unconditionally set to t. (Bug#10673)
10507 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10508 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10509 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10510
10511 2012-02-02 Kenichi Handa <handa@m17n.org>
10512
10513 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10514 0, do not call append_composite_glyph.
10515
10516 2012-02-02 Kenichi Handa <handa@m17n.org>
10517
10518 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10519 NULL (Bug#6988).
10520 (x_produce_glyphs): If the component of a composition is a null
10521 string, set it->pixel_width to 1 to avoid zero-width glyph.
10522
10523 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10524
10525 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10526 first 2 arguments are identical. This makes inserting large
10527 output from a subprocess an order of magnitude faster on
10528 MS-Windows, where all sbrk'ed memory is always contiguous.
10529
10530 2012-01-31 Glenn Morris <rgm@gnu.org>
10531
10532 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10533 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10534 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10535
10536 2012-01-29 Glenn Morris <rgm@gnu.org>
10537
10538 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10539
10540 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10541
10542 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10543
10544 2012-01-28 Chong Yidong <cyd@gnu.org>
10545
10546 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10547
10548 2012-01-26 Chong Yidong <cyd@gnu.org>
10549
10550 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10551
10552 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10553 repeat counts (Bug#10507).
10554
10555 2012-01-26 Glenn Morris <rgm@gnu.org>
10556
10557 * lread.c (syms_of_lread): Doc fix.
10558
10559 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10560
10561 * coding.c (encode_designation_at_bol): Change return value to
10562 EMACS_INT.
10563
10564 2012-01-25 Chong Yidong <cyd@gnu.org>
10565
10566 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10567
10568 2012-01-21 Chong Yidong <cyd@gnu.org>
10569
10570 * floatfns.c (Fcopysign): Make the second argument non-optional,
10571 since nil is not allowed anyway.
10572
10573 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10574
10575 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10576 (send_process): Likewise.
10577
10578 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10579
10580 * window.c (save_window_save, Fcurrent_window_configuration)
10581 (Vwindow_persistent_parameters): Do not use Qstate.
10582 Rewrite doc-strings.
10583
10584 2012-01-19 Kenichi Handa <handa@m17n.org>
10585
10586 * character.c (char_width): New function.
10587 (Fchar_width, c_string_width, lisp_string_width):
10588 Use char_width (Bug#9496).
10589
10590 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10591
10592 * window.c (Vwindow_persistent_parameters): New variable.
10593 (Fset_window_configuration, save_window_save): Handle persistent
10594 window parameters.
10595
10596 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10597
10598 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10599 thrashing the stack of the thread. (Bug#9087)
10600
10601 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10602
10603 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10604
10605 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10606
10607 * xdisp.c (rows_from_pos_range): Handle the case where the
10608 highlight ends on a newline. (Bug#10464)
10609 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10610 he end column for display of highlight that ends on a newline
10611 before a R2L line.
10612
10613 2012-01-11 Glenn Morris <rgm@gnu.org>
10614
10615 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10616 from load-path also when installation-directory is nil. (Bug#10208)
10617
10618 2012-01-10 Glenn Morris <rgm@gnu.org>
10619
10620 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10621
10622 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10623 Update template values to be closer to their typical values these days.
10624
10625 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10626
10627 * xdisp.c (rows_from_pos_range): Accept additional argument
10628 DISP_STRING, and accept any glyph in a row whose object is that
10629 string as eligible for mouse highlight. Fixes mouse highlight of
10630 display strings from overlays. (Bug#10464)
10631
10632 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10633
10634 emacs: fix an auto-save permissions race condition (Bug#10400)
10635 * fileio.c (auto_saving_dir_umask): New static var.
10636 (Fmake_directory_internal): Use it.
10637 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10638 creating the directory. The old code temporarily assigns
10639 too-generous permissions to the directory.
10640 (do_auto_save_eh): Clear it.
10641 (Fdo_auto_save): Catch all errors, not just file errors, so
10642 that the var is always cleared.
10643
10644 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10645
10646 * search.c (scan_buffer): Pass character positions to
10647 know_region_cache, not byte positions. (Bug#6540)
10648
10649 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10650
10651 * w32.c (sys_rename): Report EXDEV when rename of a directory
10652 fails because the target is on another logical disk. (Bug#10284)
10653
10654 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10655
10656 * xterm.c (x_embed_request_focus): New function.
10657
10658 * xterm.h: Add prototype.
10659
10660 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10661
10662 2012-01-05 Glenn Morris <rgm@gnu.org>
10663
10664 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10665
10666 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10667
10668 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10669 Load gnutls_transport_set_lowat only if GnuTLS version is below
10670 2.11.1.
10671 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10672 GnuTLS versions below 2.11.1.
10673
10674 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10675
10676 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10677 to the doc string advising against its use for altering the way
10678 windows are scrolled.
10679
10680 2011-12-28 Kenichi Handa <handa@m17n.org>
10681
10682 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10683 coding-system ASCII compatible only when it does not produce BOM
10684 on encoding (Bug#10383).
10685
10686 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10687
10688 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10689 can scroll.
10690 (create_and_show_popup_menu): Always use menu_position_func for
10691 Gtk3 (Bug#10361).
10692
10693 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10694
10695 * callint.c (Fcall_interactively): Don't truncate prompt string.
10696
10697 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10698
10699 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10700 property that ends at ZV, so that the bidi iteration could be
10701 resumed from there (after widening). (Bug#10360)
10702
10703 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10704
10705 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10706
10707 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10708
10709 * nsterm.m (x_free_frame_resources):
10710 Release f->output_data.ns->miniimage.
10711 (ns_index_color): Fix indentation. Do not retain
10712 color_table->colors[i].
10713
10714 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10715 before returning.
10716
10717 * nsfns.m (x_set_background_color): Assign return value from
10718 ns_index_color to face-background instead of NSColor*.
10719 (ns_implicitly_set_icon_type): Fix indentation.
10720 Change assignment in for loop to comparison.
10721
10722 * emacs.c (ns_pool): New variable.
10723 (main): Assign ns_pool.
10724 (Fkill_emacs): Call ns_release_autorelease_pool.
10725
10726 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10727 autorelease fdesc, release fdAttrs and tdict.
10728 (ns_get_covering_families): Release charset.
10729 (ns_findfonts): Release NSFontDescriptor created with new.
10730 (ns_uni_to_glyphs): Fix indentation.
10731 (setString): Release attrStr before assigning new value.
10732
10733 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10734
10735 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10736 and NS_IMPL_COCOA.
10737 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10738 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10739
10740 2011-12-18 David Reitter <reitter@cmu.edu>
10741
10742 * nsterm.m (ns_term_init): Subscribe for notifications
10743 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10744 to method trackingNotification in EmacsMenu.
10745
10746 * nsmenu.m (trackingMenu): New variable.
10747 (trackingNotification): New method (from Aquamacs).
10748 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10749 from Aquamacs (Bug#7030).
10750
10751 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10752
10753 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10754 (symbol_to_nsstring): Fix indentation.
10755 (ns_symbol_to_pb): New function.
10756 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10757 (Fns_rotate_cut_buffers_internal): Remove.
10758 (Fns_store_selection_internal): Rename from
10759 Fns_store_cut_buffer_internal.
10760 (ns_get_foreign_selection, Fx_own_selection_internal)
10761 (Fx_disown_selection_internal, Fx_selection_exists_p)
10762 (Fns_get_selection_internal, Fns_store_selection_internal):
10763 Use ns_symbol_to_pb and check if return value is nil.
10764 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10765 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10766 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10767 renamed to Sns_store_selection_internal.
10768 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10769 and remove this function.
10770 (ns_handle_selection_clear): Remove, never used.
10771 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10772 here.
10773
10774 2011-12-17 Ken Brown <kbrown@cornell.edu>
10775
10776 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10777 GID is unknown (Bug#10257).
10778
10779 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10780
10781 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10782 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10783 which caused a build failure on GNU/Linux IA-64. This problem was
10784 introduced by my 2011-10-07 patch.
10785
10786 2011-12-15 Juri Linkov <juri@jurta.org>
10787
10788 * image.c (imagemagick_error): New function. (Bug#10112)
10789 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10790 Use `imagemagick_error' where ImageMagick functions return
10791 `MagickFalse'.
10792 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10793 proper order.
10794
10795 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10796
10797 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10798 fill background (Bug#8992).
10799
10800 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10801
10802 * window.c (Vwindow_combination_resize)
10803 (Vwindow_combination_limit): Use t instead of non-nil in
10804 doc-strings.
10805 (Vrecenter_redisplay): Add first sentence of doc-string on
10806 separate line.
10807 (Frecenter): Fix doc-string typo.
10808
10809 2011-12-11 Kenichi Handa <handa@m17n.org>
10810
10811 * coding.c (Funencodable_char_position): Pay attention to the
10812 buffer text relocation (Bug#9389).
10813
10814 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10815
10816 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10817 gtk_init (Bug#10100).
10818
10819 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10820
10821 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10822 IT->string is nil. (Bug#10263)
10823
10824 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10825
10826 * nsterm.h (x_free_frame_resources): Declare.
10827
10828 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10829 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10830
10831 * nsterm.h (ns_get_defaults_value): Declare.
10832
10833 * nsterm.m (ns_default): Call ns_get_defaults_value.
10834
10835 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10836
10837 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10838 (Bug#10170)
10839
10840 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10841
10842 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10843 that where the value of an _OBJC_* symbol points to is in the .bss
10844 section (Bug#10240).
10845
10846 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10847
10848 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10849 after the loop to call ccl_driver at least once (Bug#8619).
10850
10851 2011-12-08 Kenichi Handa <handa@m17n.org>
10852
10853 * ftfont.c (get_adstyle_property): Fix previous change
10854 (Bug#10233).
10855
10856 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10857
10858 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10859 dirs from the default value of EMACSLOADPATH (bug#10208).
10860
10861 2011-12-07 Glenn Morris <rgm@gnu.org>
10862
10863 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10864 installation and source directories as well. (Bug#10208)
10865
10866 2011-12-06 Chong Yidong <cyd@gnu.org>
10867
10868 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10869
10870 2011-12-06 Glenn Morris <rgm@gnu.org>
10871
10872 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10873 as an error, not just -1. (Bug#10217)
10874
10875 2011-12-05 Chong Yidong <cyd@gnu.org>
10876
10877 * keyboard.c (process_special_events): New function.
10878 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10879
10880 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10881
10882 * coding.c (encode_designation_at_bol): Don't use uninitialized
10883 local variable (Bug#9318).
10884
10885 2011-12-05 Kenichi Handa <handa@m17n.org>
10886
10887 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10888 return Qnil (Bug#8046, Bug#10193).
10889
10890 2011-12-05 Kenichi Handa <handa@m17n.org>
10891
10892 * coding.c (encode_designation_at_bol): New args charbuf_end and
10893 dst. Return the number of produced bytes. Callers changed.
10894 (coding_set_source): Return how many bytes coding->source was
10895 relocated.
10896 (coding_set_destination): Return how many bytes
10897 coding->destination was relocated.
10898 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10899 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10900
10901 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10902
10903 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10904 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10905 macro (Bug#9318).
10906
10907 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10908
10909 The following changes are to fix Bug#9318.
10910
10911 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10912 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10913 (encode_coding_iso_2022, encode_coding_sjis)
10914 (encode_coding_big5, encode_coding_charset): Use the above macros.
10915
10916 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10917
10918 * lisp.h (process_quit_flag): Fix external declaration.
10919
10920 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10921
10922 Don't macro-inline non-performance-critical code.
10923 * eval.c (process_quit_flag): New function.
10924 * lisp.h (QUIT): Use it.
10925
10926 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10927
10928 * nsfns.m (get_geometry_from_preferences): New function.
10929 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10930
10931 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10932
10933 * emacs.c (Qkill_emacs): Define.
10934 (syms_of_emacs): Initialize it.
10935 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10936 Qquit_flag to `kill-emacs' instead.
10937 (quit_throw_to_read_char): Add parameter `from_signal'.
10938 All callers changed. Call Fkill_emacs if requested and safe.
10939 * lisp.h (QUIT): Call Fkill_emacs if requested.
10940
10941 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10942
10943 * widget.c (update_wm_hints): Return if wmshell is null.
10944 (widget_update_wm_size_hints): New function.
10945
10946 * widget.h (widget_update_wm_size_hints): Declare.
10947
10948 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10949 widget_update_wm_size_hints (Bug#10104).
10950
10951 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10952
10953 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10954 before a newline, prepare the bidi iterator for consuming the
10955 newline, and keep the current paragraph direction. (Bug#10183)
10956 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10957
10958 2011-12-02 Juri Linkov <juri@jurta.org>
10959
10960 * search.c (Fword_search_regexp): New Lisp function created from
10961 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10962 (Fword_search_backward, Fword_search_forward)
10963 (Fword_search_backward_lax, Fword_search_forward_lax):
10964 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10965 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10966
10967 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10968
10969 * fileio.c (Finsert_file_contents): Move after-change-function call
10970 to before the "handled:" label, since all "goto handled" appear in
10971 cases where the *-change-functions have already been properly called
10972 (bug#10117).
10973
10974 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10975
10976 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10977 waiting for input. (Bug#10169)
10978
10979 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10980
10981 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10982 verifies glyph row's hash code--we have just reallocated the
10983 glyphs, so their contents can be complete garbage. (Bug#10164)
10984
10985 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10986
10987 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10988
10989 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10990
10991 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10992 attributes are tested _before_ calling verify_row_hash, to protect
10993 against GCC re-ordering of the tests. (Bug#10164)
10994
10995 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10996
10997 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10998
10999 * xterm.c (handle_one_xevent): Only set async_visible and friends
11000 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11001 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11002 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11003
11004 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11005
11006 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11007 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11008 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11009 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11010 All uses changed to use GCPRO1 etc.
11011 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11012 Revert to old implementation (i.e., before 2011-03-11).
11013
11014 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11015
11016 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11017 of scroll runs so as to avoid assigning disabled bogus rows and
11018 unnecessary graphics copy operations.
11019
11020 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11021
11022 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11023 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11024 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11025 (malloc, free, realloc, calloc): Redirect to e_* only when
11026 compiling Emacs.
11027
11028 * lisp.h (GCTYPEBITS): Move before first use.
11029 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11030 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11031 this macro definition.
11032
11033 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11034 _MSC_VER.
11035
11036 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11037
11038 * gtkutil.c (xg_create_frame_widgets):
11039 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11040 present with Gtk+ 2.0.
11041
11042 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11043
11044 * fileio.c (Finsert_file_contents): Undo previous change; see
11045 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11046
11047 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11048
11049 Rename locals to avoid shadowing.
11050 * fileio.c (Finsert_file_contents):
11051 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11052 * process.c (wait_reading_process_output):
11053 Rename inner 'proc' to 'p' to avoid shadowing.
11054 Indent for consistency with usual Emacs style.
11055
11056 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11057
11058 * xdisp.c (redisplay_window): If cursor row is not fully visible
11059 after recentering, and scroll-conservatively is set to a large
11060 number, scroll window by a few more lines to make the cursor fully
11061 visible and out of scroll-margin. (Bug#10105)
11062 (start_display): Don't move to the next line if the display should
11063 start at a newline that is part of a display vector or an overlay
11064 string. (Bug#10119)
11065
11066 2011-11-24 Juri Linkov <juri@jurta.org>
11067
11068 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11069 after the `MagickPingImage' call. (Bug#10112)
11070
11071 2011-11-23 Chong Yidong <cyd@gnu.org>
11072
11073 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11074
11075 2011-11-23 Martin Rudalics <rudalics@gmx.at>
11076
11077 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11078 making another buffer current. (Bug#10114)
11079
11080 2011-11-23 Glenn Morris <rgm@gnu.org>
11081
11082 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11083
11084 2011-11-23 Chong Yidong <cyd@gnu.org>
11085
11086 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11087 using it (Bug#5984).
11088
11089 2011-11-22 Eli Zaretskii <eliz@gnu.org>
11090
11091 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11092 and header-lines, as they don't have one computed for them.
11093 (Bug#10098)
11094
11095 * .gdbinit (prow): Make displayed values more self-explaining.
11096 Add row's hash code.
11097
11098 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11099
11100 * process.c (wait_reading_process_output): Fix asynchrounous
11101 GnuTLS socket handling on some versions of the GnuTLS library.
11102 (wait_reading_process_output): Add comment and URL.
11103
11104 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
11105
11106 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11107
11108 2011-11-21 Chong Yidong <cyd@gnu.org>
11109
11110 * window.c (Fnext_window, Fprevious_window): Doc fix.
11111
11112 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11113
11114 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11115
11116 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11117
11118 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11119
11120 2011-11-20 Martin Rudalics <rudalics@gmx.at>
11121
11122 * window.c (Fset_window_combination_limit): Rename argument
11123 STATUS to LIMIT.
11124 (Vwindow_combination_limit): Remove "status" from doc-string.
11125
11126 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11127
11128 * m/ibms390.h: Remove.
11129 * m/ibms390x.h: Don't include "ibms390.h".
11130
11131 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11132
11133 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11134 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11135
11136 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11137
11138 * casetab.c (Fset_case_table):
11139 * charset.c (Fcharset_after): Fix typos.
11140
11141 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11142
11143 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11144 Otherwise, valgrind does not work on some platforms.
11145 Problem reported by Andreas Schwab in
11146 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11147 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11148 is set, removing the need for VIRT_ADDRESS_VARIES.
11149 (PURE_P): Use a more-efficient implementation that needs just one
11150 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11151 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11152 to 4 (xorl, subq, cmpq, setbe).
11153 * alloc.c (pure): Always extern now, since that's the
11154 VIRT_ADDR_VARIES behavior.
11155 (PURE_POINTER_P): Use a single comparison, not two, for
11156 consistency with the new puresize.h.
11157 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11158 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11159 Remove VIRT_ADDR_VARIES no longer needed.
11160
11161 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11162
11163 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11164 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11165 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11166 behave as if the cursor position were at the window margin.
11167
11168 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11169 and the cursor position is out of bounds, behave as if the cursor
11170 position were at the window margin. (Bug#10075)
11171
11172 2011-11-18 Chong Yidong <cyd@gnu.org>
11173
11174 * window.c (Fwindow_combination_limit): Make first argument
11175 non-optional, since it is meaningless for live windows like the
11176 selected window.
11177
11178 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11179
11180 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11181
11182 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11183
11184 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11185 (graft_intervals_into_buffer): Simplify.
11186
11187 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11188
11189 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11190 hash values of the two rows.
11191 (copy_row_except_pointers): Preserve the used[] arrays and the
11192 hash values of the two rows. (Bug#10035)
11193 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11194
11195 * xdisp.c (row_hash): New function, body extracted from
11196 compute_line_metrics.
11197 (compute_line_metrics): Call row_hash, instead of computing the
11198 hash code inline.
11199
11200 * dispnew.c (verify_row_hash): Call row_hash for computing the
11201 hash code of a row, instead of duplicating code from xdisp.c.
11202
11203 * dispextern.h (row_hash): Add prototype.
11204
11205 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11206
11207 * frame.c (delete_frame): Don't delete the terminal when the last
11208 X frame is closed if emacs is built with GTK toolkit.
11209
11210 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11211
11212 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11213
11214 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11215
11216 * window.c (Vwindow_splits): Rename to
11217 Vwindow_combination_resize. Suggested by Juri Linkov.
11218 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11219 of Vwindow_splits.
11220
11221 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11222
11223 * nsfns.m (Fns_font_name):
11224 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11225
11226 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11227
11228 * window.h (window): Rename slot "nest" to "combination_limit".
11229 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11230 (Fset_window_nest): Rename to Fset_window_combination_limit.
11231 (Vwindow_nest): Rename to Vwindow_combination_limit.
11232 (recombine_windows, make_parent_window, make_window)
11233 (Fsplit_window_internal, saved_window)
11234 (Fset_window_configuration, save_window_save): Rename all
11235 occurrences of window_nest to window_combination_limit.
11236
11237 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11238
11239 * image.c (imagemagick_load_image): Fix typo.
11240
11241 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11242
11243 * xdisp.c (display_line): Move the call to
11244 highlight_trailing_whitespace before the call to
11245 compute_line_metrics, since the latter needs to see the final
11246 faces of all the glyphs to compute ROW's hash value.
11247 Fixes assertion violations in row_equal_p. (Bug#10035)
11248
11249 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11250
11251 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11252 just return (bug#10044).
11253
11254 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11255
11256 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11257 with user-defined heap size. Bump the default size of the temacs
11258 heap to 27MB, to avoid memory warning when running temacs.
11259 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11260
11261 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11262 current_matrix and desired_matrix. (Bug#9990)
11263 (verify_row_hash) [XASSERTS]: New function.
11264 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11265 that the hash value of glyph rows is correct.
11266
11267 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11268
11269 * window.h (window): Remove splits slot.
11270 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11271 (Fdelete_other_windows_internal, make_parent_window)
11272 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11273 (Fset_window_configuration, save_window_save): Don't deal with
11274 split status of windows.
11275 (saved_window): Remove splits slot.
11276 (Vwindow_splits): Rewrite doc-string.
11277
11278 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11279
11280 * xfns.c (unwind_create_frame):
11281 * nsfns.m (unwind_create_frame):
11282 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11283 Vframe_list (Bug#9999).
11284
11285 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11286
11287 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11288
11289 2011-11-11 Kenichi Handa <handa@m17n.org>
11290
11291 * callproc.c (Fcall_process): Set the member dst_multibyte of
11292 process_coding.
11293
11294 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11295
11296 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11297 avoid a crash (bug#9496).
11298
11299 2011-11-09 Chong Yidong <cyd@gnu.org>
11300
11301 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11302 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11303
11304 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11305
11306 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11307
11308 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11309
11310 Avoid some portability problems by eschewing 'extern inline' functions.
11311 The trivial performance wins aren't worth the portability hassles; see
11312 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11313 et seq.
11314 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11315 (window_box_width, window_box_left, window_box_left_offset)
11316 (window_box_right, window_box_right_offset): Undo previous change,
11317 by removing the "extern"s.
11318 * intervals.c (adjust_intervals_for_insertion)
11319 (adjust_intervals_for_deletion): Undo previous change,
11320 making these static again.
11321 (offset_intervals, temp_set_point_both, temp_set_point)
11322 (copy_intervals_to_string): No longer inline.
11323 * xdisp.c (window_text_bottom_y, window_box_width)
11324 (window_box_height, window_box_left_offset)
11325 (window_box_right_offset, window_box_left, window_box_right)
11326 (window_box): No longer inline.
11327
11328 2011-11-08 Chong Yidong <cyd@gnu.org>
11329
11330 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11331 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11332 Signal an error if not a live window.
11333 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11334 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11335
11336 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11337
11338 * lisp.h (syms_of_abbrev): Remove declaration.
11339 Reported by CHENG Gao <chenggao@royau.me>.
11340
11341 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11342
11343 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11344 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11345 of temacs in GUI mode.
11346
11347 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11348
11349 * window.h: Declare delete_all_child_windows instead of
11350 delete_all_subwindows.
11351 * window.c (Fwindow_nest, Fset_window_nest)
11352 (Fset_window_new_total, Fset_window_new_normal)
11353 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11354 (delete_all_subwindows): Rename to delete_all_child_windows.
11355 (Fdelete_other_windows_internal, Fset_window_configuration):
11356 Call delete_all_child_windows instead of delete_all_subwindows.
11357 * frame.c (delete_frame): Call delete_all_child_windows instead
11358 of delete_all_subwindows.
11359
11360 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11361
11362 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11363 This is also needed for porting to any host where GC_MARK_STACK is
11364 not GC_MAKE_GCPROS_NOOPS.
11365 (which_symbols): Use it.
11366
11367 2011-11-07 Kenichi Handa <handa@m17n.org>
11368
11369 * coding.c (coding_set_destination): Check coding->src_pos only
11370 when coding->src_object is a buffer (bug#9910).
11371
11372 * process.c (send_process): Set the member src_multibyte of coding
11373 to 0 (bug#9911) when sending a unibyte text.
11374
11375 * callproc.c (Fcall_process): Set the member src_multibyte of
11376 process_coding to 0 (bug#9912).
11377
11378 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11379
11380 * xmenu.c (cleanup_widget_value_tree): New function.
11381 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11382 calling free_menubar_widget_value_tree directly (Bug#9830).
11383
11384 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11385
11386 Fix some portability problems with 'inline'.
11387 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11388 (window_box_width, window_box_left, window_box_left_offset)
11389 (window_box_right, window_box_right_offset): Declare extern.
11390 Otherwise, these inline functions do not conform to C99 and
11391 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11392 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11393 * intervals.c (adjust_intervals_for_insertion)
11394 (adjust_intervals_for_deletion): Now extern, because otherwise the
11395 extern inline functions 'offset_intervals' couldn't refer to it.
11396 (static_offset_intervals): Remove.
11397 (offset_intervals): Rewrite using the old contents of
11398 static_offset_intervals. The old version didn't conform to C99
11399 because an extern inline function contained a reference to an
11400 identifier with static linkage.
11401
11402 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11403
11404 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11405 GC.
11406
11407 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11408
11409 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11410 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11411 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11412 return Qleft_to_right.
11413
11414 2011-11-06 Chong Yidong <cyd@gnu.org>
11415
11416 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11417 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11418 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11419 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11420 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11421 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11422 (Fwindow_vscroll): Doc fix.
11423 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11424 argument, since it makes no sense to pass a live window and for
11425 consistency with window-child.
11426
11427 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11428
11429 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11430 support MSVC.
11431
11432 2011-11-05 Jason Rumney <jasonr@gnu.org>
11433
11434 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11435 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11436 fonts (Bug#6029).
11437 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11438 bitwise arithmetic preventing use of unicode-sip and non-truetype
11439 opentype fonts.
11440
11441 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11442
11443 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11444 "emacs"-only part.
11445
11446 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11447 initialization code to keep similarity to xfns.c after changes
11448 from 2011-11-05.
11449
11450 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11451
11452 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11453 (unwind_create_frame): New function (Bug#9943).
11454 (Fx_create_frame): Restructure code to be more similar to the one in
11455 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11456 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11457 Move terminal->reference_count++ just before making the frame official
11458 (Bug#9943).
11459
11460 * nsterm.m (x_free_frame_resources): New function.
11461 (x_destroy_window): Move code to x_free_frame_resources.
11462
11463 * xfns.c (unwind_create_frame): Fix comment.
11464 (Fx_create_frame, x_create_tip_frame):
11465 Move terminal->reference_count++ just before making the frame
11466 official. Move initialization of image_cache_refcount and
11467 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11468
11469 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11470
11471 Support MSVC build with newer versions of Visual Studio.
11472 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11473 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11474 nt/gmake.defs.
11475
11476 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11477 which are not supported by MSVC.
11478 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11479 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11480 bitfields.
11481 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11482 types in bitfields.
11483 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11484
11485 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11486
11487 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11488
11489 Support MSVC build with newer versions of Visual Studio.
11490 * w32.c: Don't include w32api.h for MSVC.
11491 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11492
11493 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11494 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11495 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11496 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11497 e_* cousins.
11498 (alloca) [_MSC_VER]: Define to _alloca.
11499
11500 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11501
11502 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11503
11504 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11505
11506 * xdisp.c (note_mouse_highlight): If either of
11507 previous/next-single-property-change returns nil, treat that as
11508 the beginning or the end of the buffer. (Bug#9955)
11509
11510 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11511
11512 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11513 label is not null (Bug#9951).
11514 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11515 may be NULL.
11516
11517 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11518
11519 * window.c (Fwindow_body_size): Mention in the doc string that the
11520 return value is in frame's canonical units. (Bug#9949)
11521
11522 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11523
11524 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11525
11526 * w32fns.c (unwind_create_frame): If needed, free the glyph
11527 matrices of the partially constructed frame. (Bug#9943)
11528 * xfns.c (unwind_create_frame): Likewise.
11529
11530 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11531
11532 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11533 Don't stop backward scan on the continuation glyph, even though
11534 its CHARPOS is positive.
11535 (mouse_face_from_buffer_pos, note_mouse_highlight):
11536 Rename cover_string to disp_string.
11537
11538 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11539
11540 * window.c (temp_output_buffer_show): Don't use
11541 Vtemp_buffer_show_specifiers.
11542 (Vtemp_buffer_show_specifiers): Remove unused variable.
11543
11544 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11545
11546 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11547 past the beginning of the current glyph matrix.
11548
11549 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11550
11551 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11552 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11553 HAVE_GTK3 (Bug#9869).
11554
11555 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11556 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11557
11558 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11559
11560 * xterm.c: Declare x_handle_net_wm_state to return int.
11561 (handle_one_xevent): Check if we are iconified but don't have
11562 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11563 (get_current_wm_state): Return non-zero if not hidden,
11564 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11565 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11566 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11567 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11568
11569 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11570
11571 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11572 so that this new function doesn't get optimized away by a
11573 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11574
11575 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11576
11577 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11578
11579 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11580
11581 Fix the `xbytecode' command.
11582 * .gdbinit (xprintbytestr): New command.
11583 (xwhichsymbols): Rename from `which'; all callers changed.
11584 (xbytecode): Print the byte-code string as well.
11585
11586 2011-10-29 Kim Storm <storm@cua.dk>
11587
11588 * alloc.c (which_symbols): New function.
11589
11590 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11591
11592 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11593 line. (Bug#9903)
11594
11595 2011-10-29 Glenn Morris <rgm@gnu.org>
11596
11597 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11598 Not clear what it was for, and it causes various bugs. (Bug#9839)
11599
11600 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11601
11602 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11603 possible random value that matches one of those tested as
11604 condition to clear the mouse face.
11605
11606 2011-10-28 Chong Yidong <cyd@gnu.org>
11607
11608 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11609
11610 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11611
11612 * window.c (make_window): Initialize phys_cursor_on_p.
11613
11614 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11615
11616 * lisp.h (struct Lisp_Symbol): Update comments.
11617
11618 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11619
11620 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11621
11622 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11623
11624 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11625 <oslsachem@gmail.com> for helping to debug this.
11626
11627 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11628 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11629 (g_b_init_get_glyph_outline_w): New static variables.
11630 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11631 (GetGlyphOutlineW_Proc): New typedefs.
11632 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11633 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11634 New functions.
11635 (w32font_open_internal, compute_metrics):
11636 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11637 instead of calling the "wide" APIs directly.
11638
11639 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11640
11641 * w32.h (syms_of_w32font): Add prototype.
11642
11643 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11644
11645 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11646 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11647 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11648 (Fmove_to_window_line): Doc fix.
11649
11650 2011-10-27 Chong Yidong <cyd@gnu.org>
11651
11652 * process.c (make_process): Set gnutls_state to NULL.
11653
11654 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11655 non-NULL, regardless of GNUTLS_INITSTAGE.
11656 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11657 an error. Set process slots as soon as we allocate them.
11658
11659 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11660
11661 2011-10-27 Chong Yidong <cyd@gnu.org>
11662
11663 * gnutls.c (emacs_gnutls_deinit): New function.
11664 Deallocate credentials structures as well as calling gnutls_deinit.
11665 (Fgnutls_deinit, Fgnutls_boot): Use it.
11666
11667 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11668 (deactivate_process): Call emacs_gnutls_deinit.
11669
11670 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11671
11672 * image.c (x_create_x_image_and_pixmap):
11673 * w32.c (sys_rename, w32_delayed_load):
11674 * w32font.c (fill_in_logfont):
11675 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11676
11677 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11678
11679 * w32fns.c (w32_default_color_map): New function,
11680 extracted from Fw32_default_color_map.
11681 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11682
11683 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11684
11685 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11686
11687 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11688
11689 * keyboard.c (test_undefined): New function (bug#9751).
11690 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11691
11692 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11693
11694 * sysdep.c (init_sys_modes): Fix the check for the controlling
11695 terminal (Bug#6649).
11696
11697 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11698
11699 * dispextern.h (struct bidi_it): New member next_en_type.
11700
11701 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11702 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11703 current character, check also for next_en_type being WEAK_EN.
11704 (bidi_resolve_weak): Don't enter the expensive loop if the current
11705 position is before next_en_pos. Record the bidi type of the first
11706 non-ET, non-BN character we find, in addition to its position.
11707 (bidi_level_of_next_char): Invalidate next_en_type when
11708 next_en_pos is over-stepped.
11709
11710 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11711
11712 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11713 * editfns.c: Rewrite current-time-zone so that it invokes
11714 the equivalent of (format-time-string "%Z") to get the time zone name.
11715 This fixes a bug when the time zone name contains characters that
11716 need converting from the system time locale to Emacs internal format.
11717 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11718 that patch fixed format-time-string to do the conversion, but
11719 I forgot to fix current-time-zone.
11720 (format_time_string): New function, containing most of
11721 what Fformat_time_string used to contain.
11722 (Fformat_time_string): Rewrite in terms of format_time_string.
11723 This doesn't change this function's behavior.
11724 (current-time-zone): Rewrite to use format_time_string.
11725 This fixes the bug reported by Michael Schierl in
11726 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11727 Jason Rumney's 2007-06-07 change worked around this bug, but
11728 didn't fix it.
11729 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11730
11731 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11732
11733 * xdisp.c (start_display): If the character at POS is displayed
11734 via a display vector, reset IT->current.dpvec_index to zero.
11735 (try_window_reusing_current_matrix): If a line ends in a display
11736 vector or the next line starts in a display vector, continue
11737 redrawing the window even though the character position of
11738 start_row was reached.
11739 (Bug#9771, part 2)
11740
11741 2011-10-18 Chong Yidong <cyd@gnu.org>
11742
11743 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11744 with nobreak-char-display too.
11745
11746 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11747
11748 Fix part 3 of bug#9771.
11749 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11750 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11751 non-neutral characters if the current character is a paragraph
11752 separator (a.k.a. Newline). This avoids running the same
11753 expensive loop twice, once when we consume the preceding newline
11754 and the other time when the line actually needs to be displayed.
11755 Avoid the loop when we see neutrals on the base embedding level
11756 following a character whose directionality is the same as the
11757 paragraph's. This avoids running the expensive loop when a line
11758 ends in a long sequence of neutrals, like control characters.
11759 Add assertion against STRONG_AL type. Slightly rearrange code
11760 that determines the type of a neutral given the first non-neutral
11761 that follows it.
11762 (bidi_level_of_next_char): Set next_en_pos to zero when
11763 invalidating its info.
11764
11765 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11766
11767 * xdisp.c (push_display_prop): Determine whether to record string
11768 or buffer position by IT->string, not by IT->method. Allow
11769 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11770 (move_it_vertically_backward): Don't look for character position
11771 immediately after the newline when in a continuation line.
11772 (Bug#9771, part 1)
11773
11774 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11775
11776 * window.c (coordinates_in_window): Rewrite and delabelize
11777 vertical border check. (Bug#5357) (Bug#9618)
11778
11779 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11780
11781 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11782 errors in XSetWindowBorder (bug#9310).
11783
11784 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11785
11786 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11787 avoid crash when xmalloc overrun checking is enabled.
11788
11789 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11790
11791 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11792 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11793 cursor motion with <left> and <right> arrow keys.
11794
11795 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11796 some callers set that themselves.
11797
11798 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11799
11800 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11801 display string and the previous row comes from the same string and
11802 is empty. (Bug#9739) (Bug#9738)
11803
11804 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11805
11806 * doc.c (get_doc_string): Encode file name (bug#9735).
11807
11808 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11809
11810 * bidi.c (bidi_level_of_next_char):
11811 * xdisp.c (get_visually_first_element): Remove old incorrect
11812 comments regarding the Unicode Line Separator character.
11813
11814 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11815
11816 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11817
11818 * alloc.c (Fgc_status): Do not access beyond zombies array
11819 boundary if nzombies > MAX_ZOMBIES.
11820 * alloc.c (dump_zombies): Add missing format specifier.
11821
11822 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11823
11824 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11825 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11826
11827 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11828 Some packages use them to denote characters with modifiers.
11829
11830 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11831
11832 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11833 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11834 matching a pp-number. Rename parameter var to var1.
11835
11836 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11837
11838 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11839
11840 2011-10-08 Glenn Morris <rgm@gnu.org>
11841
11842 * callint.c (Fcall_interactively): Give a more explicit error for the
11843 'c' case with a non-character input. (Bug#8479)
11844
11845 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11846
11847 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11848 lines.
11849 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11850 lines that are hscrolled on the left.
11851
11852 * dispnew.c (buffer_posn_from_coords): Account for a possible
11853 presence of header-line. (Bug#4426)
11854
11855 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11856
11857 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11858 Don't advertise functionality which we discourage or doesn't work.
11859
11860 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11861
11862 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11863 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11864 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11865 this makes Emacs dump core during garbage collection on rare
11866 occasions. sizeof is obviously inferior to offsetof here, so
11867 stick with offsetof.
11868 (GC_POINTER_ALIGNMENT): New macro.
11869 (mark_memory): Omit 3rd (offset) arg; caller changed.
11870 Don't assume EMACS_INT alignment is the same as pointer alignment.
11871
11872 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11873
11874 * keyboard.c (read_key_sequence_remapped): New var.
11875 (read_key_sequence): Compute remapping in the right buffer.
11876 (command_loop_1): Use read_key_sequence's remapping directly.
11877
11878 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11879
11880 * dired.c (file_name_completion): Don't expand file name.
11881 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11882 before checking file name handler.
11883
11884 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11885 they've been requested explicitly (bug#9591).
11886
11887 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11888
11889 * keymap.c (Fsingle_key_description): Use make_specified_string
11890 instead of build_string to build string from push_key_description.
11891 (Bug#5193)
11892
11893 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11894
11895 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11896 This fixes a Y2038 bug on 64-bit hosts.
11897 * buffer.c (reset_buffer):
11898 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11899 (Fclear_buffer_auto_save_failure):
11900 Use 0, not -1, to represent an unset failure time, since time_t
11901 might not be signed.
11902
11903 Remove dependency on glibc malloc internals.
11904 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11905 Move back here from lisp.h, but with their new implementations.
11906 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11907 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11908 * charset.c (charset_table_init): New static var.
11909 (syms_of_charset): Use it instead of xmalloc. This removes a
11910 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11911 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11912 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11913 Move back to alloc.c.
11914 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11915 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11916
11917 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11918
11919 * nsterm.m (windowDidResize): Call x_set_window_size only when
11920 ns_in_resize is true. Otherwise set pixelwidth/height and
11921 call change_frame_size (Bug#9628).
11922
11923 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11924
11925 Port --enable-checking=all to Fedora 14 x86-64.
11926 * charset.c (syms_of_charset): Also account for glibc malloc's
11927 internal overhead when calculating the initial malloc maximum.
11928
11929 Port --enable-checking=all to Fedora 14 x86.
11930 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11931 Move to lisp.h.
11932 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11933 (overrun_check_realloc, overrun_check_free):
11934 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11935 That way, xmalloc returns a properly-aligned pointer even if
11936 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11937 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11938 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11939 into account when calculating the initial malloc maximum.
11940 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11941 Move here from alloc.c, so that charset.c can use it too.
11942 Properly align; the old code wasn't right for common 32-bit hosts
11943 when configured with --enable-checking=all.
11944 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11945 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11946
11947 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11948
11949 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11950 use EDOM.
11951
11952 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11953
11954 * xdisp.c (compute_display_string_end): If there's no display
11955 string at CHARPOS, return -1.
11956
11957 * bidi.c (bidi_fetch_char): When compute_display_string_end
11958 returns a negative value, treat the character as a normal
11959 character not covered by a display string. (Bug#9624)
11960
11961 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11962
11963 * lread.c (Fread_from_string): Fix typo in docstring.
11964
11965 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11966
11967 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11968 newline, reseat the iterator instead of bidi-iterating there one
11969 character at a time. (Bug#9610)
11970 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11971 TO_CHARPOS if the bidi iterator is at base embedding level.
11972
11973 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11974
11975 * lread.c (readevalloop): Use correct code for NBSP.
11976 (read1): Likewise. (Bug#9608)
11977
11978 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11979
11980 * dbusbind.c (Fdbus_register_signal): When service is not
11981 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11982
11983 2011-09-25 Glenn Morris <rgm@gnu.org>
11984
11985 * buffer.c (truncate-lines): Doc fix.
11986
11987 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11988
11989 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11990 (Fset_window_next_buffers): Doc fix.
11991
11992 2011-09-24 Glenn Morris <rgm@gnu.org>
11993
11994 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11995
11996 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11997
11998 Fix minor problems found by static checking.
11999 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12000 * indent.c (Fvertical_motion): Fix == vs = typo.
12001
12002 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12003
12004 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12005 Default value is now t. Doc fix.
12006
12007 * indent.c (Fvertical_motion): Compute and apply the overshoot
12008 logic when moving up, not only when moving down. Fix the
12009 confusing name and values of the it_overshoot_expected variable;
12010 logic changes accordingly. (Bug#9254) (Bug#9549)
12011
12012 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12013 CHARPOS is covered by a display string which includes newlines.
12014 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12015 is covered by a display string with embedded newlines.
12016
12017 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12018
12019 * dbusbind.c (Fdbus_register_signal): Add match rule to
12020 Vdbus_registered_objects_table. (Bug#9581)
12021 (Fdbus_register_method, Vdbus_registered_objects_table):
12022 Fix docstring.
12023
12024 2011-09-24 Jim Meyering <meyering@redhat.com>
12025
12026 do not ignore write error for any output size
12027 The previous change was incomplete.
12028 While it makes emacs --batch detect the vast majority of stdout
12029 write failures, errors were still ignored whenever the output size is
12030 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12031 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12032 && echo FAIL: ignored write error
12033 FAIL: ignored write error
12034 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12035 && echo FAIL: ignored write error
12036 FAIL: ignored write error
12037 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12038
12039 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12040
12041 * emacs.c (Fkill_emacs): In noninteractive mode exit
12042 non-successfully if a write error occurred on stdout. (Bug#9574)
12043
12044 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12045
12046 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12047 the xassert test.
12048
12049 * dispextern.h (struct it): Update the comment documenting what
12050 can it->OBJECT be.
12051
12052 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12053
12054 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12055 a display string, extend search for cursor position to end of row.
12056 (find_row_edges): If the row ends in a newline from a display
12057 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12058 Handle the case of a display string with multiple newlines.
12059 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12060 non-empty line. Fixes confusing cursor motion with arrow keys at
12061 the beginning of a line that starts with whitespace.
12062
12063 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12064
12065 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12066 (bug#9493).
12067
12068 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
12069
12070 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12071 boolean (Bug#9154).
12072
12073 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12074
12075 * xdisp.c (display_line): Record maximum and minimum buffer
12076 positions even if no glyphs were produced (e.g., by a zero-width
12077 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12078 buffer positions that will be removed from the glyph row because
12079 they don't fit.
12080 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12081 column is beyond frame width: don't subtract 1 "pixel" when
12082 computing width of the stretch.
12083 (reseat_at_next_visible_line_start): Undo the change made on
12084 2011-09-17 that saved paragraph information and restored it after
12085 the call to `reseat'. (Bug#9545)
12086
12087 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12088
12089 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12090 and turn window cursor on if cleared (Bug#9415).
12091
12092 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
12093
12094 * search.c (boyer_moore): Take unibyte characters from pattern
12095 literally. (Bug#9458)
12096
12097 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12098
12099 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12100
12101 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12102
12103 Fix minor problem found by static checking.
12104 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12105 initialized, to pacify gcc -Wuninitialized.
12106
12107 * fileio.c: Report proper errno when syscall falls.
12108 (Finsert_file_contents): Save and restore errno,
12109 so that report_file_error outputs the correct diagnostic.
12110 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12111
12112 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12113
12114 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12115
12116 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12117
12118 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12119 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12120
12121 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12122
12123 * xdisp.c (reseat_at_next_visible_line_start): Keep information
12124 about the current paragraph and restore it after the call to reseat.
12125
12126 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12127 (bidi_find_paragraph_start): Search back for paragraph beginning
12128 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12129 (bidi_move_to_visually_next): Only trigger paragraph-related
12130 computations when the last character is a newline or at EOB, not
12131 just any NEUTRAL_B. (Bug#9470)
12132
12133 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12134 truncated lines if point is covered by a display string. (Bug#9524)
12135
12136 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12137
12138 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12139 (cons_to_x_long): New function.
12140 (lisp_data_to_selection_data): Use it. Correct the test for
12141 short-versus-long data; it was negated. Break out of vector
12142 loop, for efficiency, when a long datum is discovered.
12143
12144 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12145
12146 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12147
12148 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12149
12150 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12151 GCC PR/17406) by declaring this function with external scope.
12152
12153 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12154
12155 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12156 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12157
12158 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12159
12160 * editfns.c (Fformat): Correctly handle text properties on "%%".
12161
12162 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12163
12164 * xterm.c (x_draw_composite_glyph_string_foreground):
12165 * w32term.c (x_draw_composite_glyph_string_foreground):
12166 * term.c (encode_terminal_code):
12167 * composite.c (composition_update_it, get_composition_id):
12168 * xdisp.c (get_next_display_element)
12169 (fill_composite_glyph_string): Add comments about special meaning
12170 of TAB characters in a composition.
12171
12172 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12173
12174 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12175 This occurs when processing a multibyte format.
12176 Problem reported by Wolfgang Jenker.
12177
12178 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12179
12180 * xdisp.c (try_cursor_movement): Only check for exact match if
12181 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12182
12183 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12184
12185 Remove unused external symbols.
12186 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12187 * xdisp.c (calc_pixel_width_or_height): Now static.
12188 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12189 * indent.c (check_display_width):
12190 * w32term.c: Fix comment to match code.
12191 * xterm.c, xterm.h (x_catching_errors): Remove.
12192
12193 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12194
12195 * xselect.c: Use signed conversions more consistently (Bug#9498).
12196 (selection_data_to_lisp_data): Assume incoming selection data are
12197 signed integers, not unsigned. This is to be consistent with
12198 outgoing selection data, which was modified to use signed integers
12199 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12200 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12201 expects long, not unsigned long.
12202
12203 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12204
12205 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12206 computation of loop end. Reported by Johan Bockgård
12207 <bojohan@gnu.org>.
12208
12209 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12210
12211 * frame.c (Fother_visible_frames_p): Function deleted.
12212
12213 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12214
12215 * indent.c (compute_motion): Process display vector front to back
12216 rather than the other way around. (Bug#2496)
12217
12218 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12219
12220 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12221
12222 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12223
12224 * minibuf.c (Fread_from_minibuffer): Doc fix.
12225
12226 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12227
12228 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12229 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12230
12231 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12232
12233 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12234 value for non-existent files.
12235
12236 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12237
12238 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12239 set its "size" to -1. This will set the modtime_size field of
12240 the corresponding buffer to -1, which is what
12241 verify-visited-file-modtime expects for files that do not exist.
12242 (Bug#9139)
12243
12244 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12245
12246 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12247 here ...
12248 * lisp.h: ... from here. push_key_description is no longer
12249 defined in keyboard.c, so its declaration should not be in
12250 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12251 logically belongs with push_key_description.
12252
12253 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12254
12255 * buffer.h: Include <sys/types.h> instead of <time.h>.
12256 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12257 Problem reported by Herbert J. Skuhra.
12258
12259 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12260
12261 * xml.c (parse_region): Make the parsing work for
12262 non-comment-starting XML files again (bug#9144).
12263
12264 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12265
12266 * image.c (gif_load): Fix calculation of bottom and right corner.
12267 (Bug#9468)
12268
12269 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12270
12271 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12272 redisplay in small windows.
12273
12274 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12275
12276 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12277
12278 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12279
12280 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12281 Operate on live windows only.
12282
12283 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12284
12285 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12286
12287 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12288
12289 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12290 only under bidi iteration.
12291
12292 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12293
12294 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12295
12296 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12297
12298 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12299 Without this fix, the command to link temacs failed due to an
12300 undefined symbol __builtin_isnan. This is because
12301 /usr/include/iso/math_c99.h #defines isnan(x) to
12302 __builtin_isnan(x), but the bundled gcc, which identifies itself
12303 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12304 a __builtin_isnan.
12305 * floatfns.c (isnan): #undef, and then #define to a clone of
12306 what's in data.c.
12307 (Fisnan): Always define, since it's always available now.
12308 (syms_of_floatfns): Always define isnan at the Lisp level.
12309
12310 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12311
12312 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12313
12314 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12315
12316 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12317 The previous code assumed that file offsets (off_t values) fit in
12318 EMACS_INT variables, which is not true on typical 32-bit hosts.
12319 The code messed up by falsely reporting buffer overflow in cases
12320 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12321 when "big" contains more than 2**29 bytes, even though this
12322 inserts just one byte and does not overflow the buffer.
12323 (Finsert_file_contents): Store file offsets as off_t
12324 values, not as EMACS_INT values. Check for overflow when
12325 converting between EMACS_INT and off_t. When checking for
12326 buffer overflow or for overlap, take the offsets into account.
12327 Don't use EMACS_INT for small values where int suffices.
12328 When checking for overlap, fix a typo: ZV was used where
12329 ZV_BYTE was intended.
12330 (Fwrite_region): Don't assume off_t fits into 'long'.
12331 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12332
12333 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12334
12335 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12336
12337 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12338
12339 sprintf-related integer and memory overflow issues (Bug#9412).
12340
12341 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12342 (esprintf, exprintf, evxprintf): New functions.
12343 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12344 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12345 (modify_event_symbol): Do not assume that the length of
12346 name_alist_or_stem is safe to alloca and fits in int.
12347 (Fexecute_extended_command): Likewise for function name and binding.
12348 (Frecursion_depth): Wrap around reliably on integer overflow.
12349 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12350 since some callers pass EMACS_INT values.
12351 (Fsingle_key_description): Don't crash if symbol name contains more
12352 than MAX_ALLOCA bytes.
12353 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12354 (get_minibuffer): Arg is now EMACS_INT, not int.
12355 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12356 (esprintf, exprintf, evxprintf): New decls.
12357 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12358
12359 * dbusbind.c (signature_cat): New function.
12360 (xd_signature, Fdbus_register_signal):
12361 Do not overrun buffer; instead, report string overflow.
12362
12363 * dispnew.c (add_window_display_history): Don't overrun buffer.
12364 Truncate instead; this is OK since it's just a log.
12365
12366 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12367 even if the time zone offset is outlandishly large.
12368 Don't mishandle offset == INT_MIN.
12369
12370 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12371 when creating daemon; the previous buffer-overflow check was incorrect.
12372
12373 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12374 which has the guts of the old verror function.
12375
12376 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12377 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12378
12379 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12380 (font_unparse_xlfd): Don't blindly alloca long strings.
12381 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12382 fits in int, when using sprintf. Use single snprintf to count
12383 length of string rather than counting it via multiple sprintfs;
12384 that's simpler and more reliable.
12385 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12386 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12387 sprintf, in case result does not fit in int.
12388
12389 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12390 (fontset_from_font): Print it.
12391
12392 * frame.c (tty_frame_count): Now printmax_t, not int.
12393 (make_terminal_frame, set_term_frame_name): Print it.
12394 (x_report_frame_params): In X, window IDs are unsigned long,
12395 not signed long, so print them as unsigned.
12396 (validate_x_resource_name): Check for implausibly long names,
12397 and don't assume name length fits in 'int'.
12398 (x_get_resource_string): Don't blindly alloca invocation name;
12399 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12400 not fit in int.
12401
12402 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12403 (xg_check_special_colors, xg_set_geometry):
12404 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12405
12406 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12407 Use esprintf, not sprintf, in case result does not fit in int.
12408
12409 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12410 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12411 it as a large positive number.
12412 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12413 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12414
12415 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12416 in case result does not fit in int.
12417
12418 * print.c (float_to_string): Detect width overflow more reliably.
12419 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12420 buffer overrun. Don't assume list length fits in 'int'. Treat
12421 print length of 0 as 0, not as infinity; to be consistent with other
12422 uses of print length in this function. Don't overflow print length
12423 index. Don't assume hash table size fits in 'long', or that
12424 vectorlike size fits in 'unsigned long'.
12425
12426 * process.c (make_process): Use printmax_t, not int, to format
12427 process-name gensyms.
12428
12429 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12430
12431 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12432 to avoid potential buffer overrun.
12433
12434 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12435 if X resource line is longer than 512 bytes.
12436
12437 * xfns.c (x_window): Make sprintf buffer a bit bigger
12438 to avoid potential buffer overrun.
12439
12440 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12441
12442 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12443
12444 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12445
12446 Integer overflow fixes for scrolling, etc.
12447 Without these, Emacs silently mishandles large integers sometimes.
12448 For example, "C-u 4294967297 M-x recenter" was treated as if
12449 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12450
12451 * xdisp.c (try_window_id): Check Emacs fixnum range before
12452 converting to 'int'.
12453
12454 * window.c (window_scroll_line_based, Frecenter):
12455 Check that an Emacs fixnum is in range before assigning it to 'int'.
12456 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12457 values converted from Emacs fixnums.
12458 (Frecenter): Don't wrap around a line count if it is out of 'int'
12459 range; instead, treat it as an extreme value.
12460 (Fset_window_configuration, compare_window_configurations):
12461 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12462
12463 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12464 that can exceed INT_MAX. Check that EMACS_INT value is in range
12465 before assigning it to the (possibly-narrower) index.
12466 (match_limit): Don't assume that a fixnum can fit in 'int'.
12467
12468 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12469 exceed INT_MAX.
12470
12471 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12472 (Fvertical_motion): Don't wrap around LINES values that don't fit
12473 in 'int'. Instead, treat them as extreme values. This is good
12474 enough for windows, which can't have more than INT_MAX lines anyway.
12475
12476 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12477
12478 * Require libxml/parser.h to avoid compilation warning.
12479
12480 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12481
12482 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12483 since this reportedly can destroy thread storage.
12484
12485 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12486
12487 * syntax.c (find_defun_start): Update all cache variables if
12488 exiting early (Bug#9401).
12489
12490 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12491
12492 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12493
12494 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12495 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12496 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12497
12498 * term.c (tty_append_glyph): New function.
12499 (produce_stretch_glyph): Static function and its prototype deleted.
12500
12501 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12502 Add prototypes.
12503
12504 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12505
12506 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12507 when checking :margin (Bug#9390).
12508 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12509 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12510 so that the name doesn't mislead. All uses changed.
12511
12512 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12513
12514 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12515 set_tty_hooks.
12516
12517 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12518
12519 * xdisp.c (move_it_to): Don't bail out early when reaching
12520 position beyond to_charpos, if we are scanning backwards.
12521 (move_it_vertically_backward): When DY == 0, make sure we get to
12522 the first character in the line after the newline.
12523
12524 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12525
12526 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12527 (ccl_driver): Do not generate an out-of-range pointer.
12528 (Fccl_execute_on_string): Remove unnecessary check for
12529 integer overflow, noted by Stefan Monnier in
12530 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12531 Remove a FIXME that didn't need fixing.
12532 Simplify the newly-introduced buffer reallocation code.
12533
12534 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12535
12536 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12537
12538 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12539
12540 Integer and memory overflow issues (Bug#9196).
12541
12542 * doc.c (get_doc_string): Rework so that
12543 get_doc_string_buffer_size is the actual buffer size, rather than
12544 being 1 less than the actual buffer size; this makes xpalloc more
12545 convenient.
12546
12547 * image.c (x_allocate_bitmap_record, cache_image):
12548 * xselect.c (Fx_register_dnd_atom):
12549 Simplify previous changes by using xpalloc.
12550
12551 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12552 since either will do and ptrdiff_t is convenient with xpalloc.
12553
12554 * charset.c (charset_table_size)
12555 (struct charset_sort_data.priority): Now ptrdiff_t.
12556 (charset_compare): Don't overflow if priorities differ greatly.
12557 (Fsort_charsets): Don't assume list length fits in int.
12558 Check for size-calculation overflow when allocating sort data.
12559 (syms_of_charset): Allocate an initial charset table that is
12560 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12561
12562 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12563
12564 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12565 The actual value is always <= INT_MAX, and leaving it unsigned made
12566 overflow checking harder.
12567
12568 * dispextern.h (struct glyph_matrix.rows_allocated)
12569 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12570 with xpalloc. The values are still always <= INT_MAX.
12571
12572 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12573
12574 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12575 (SAFE_NALLOCA): New macro.
12576
12577 * region-cache.c (struct boundary.pos, find_cache_boundary)
12578 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12579 (set_cache_region, invalidate_region_cache)
12580 (revalidate_region_cache, know_region_cache, region_cache_forward)
12581 (region_cache_backward, pp_cache):
12582 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12583 so that ptrdiff_t * can be passed to xpalloc.
12584 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12585 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12586 (pp_cache): Don't assume cache_len fits in int.
12587 * region-cache.h: Adjust extern decls to match.
12588
12589 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12590 EMACS_INT, since either will do, for xpalloc.
12591
12592 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12593 (xnmalloc, xnrealloc, xpalloc): New functions.
12594
12595 * bidi.c (bidi_shelve_header_size): New constant.
12596 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12597 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12598
12599 * bidi.c (bidi_cache_shrink):
12600 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12601 (overlay_strings):
12602 Don't update size of array until after memory allocation succeeds,
12603 because xmalloc/xrealloc may not return.
12604 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12605 now that we have proper integer overflow checking.
12606 (record_overlay_string, overlay_strings): Catch overflows when
12607 calculating size of overlay_str_buf.
12608
12609 * callproc.c (Fcall_process): Check for size overflow when
12610 calculating size of args2.
12611 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12612 Normally we prefer signed values, but sticking with ptrdiff_t would
12613 require adding more-complicated checks.
12614
12615 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12616 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12617 Redo buffer-overflow calculations to avoid integer overflow.
12618 Add a FIXME comment where memory seems to be over-allocated.
12619
12620 * character.c (Fstring): Check for size-calculation overflow.
12621
12622 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12623 unnecessary integer overflow. Check for size overflow.
12624 (encode_coding_object): Don't update size until xmalloc succeeds.
12625
12626 * composite.c (get_composition_id): Check for overflow in glyph
12627 length calculations.
12628
12629 Integer and memory overflow fixes for display code.
12630 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12631 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12632 (scrolling_window): Check for overflow in size calculations.
12633 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12634 Don't assume glyph table len fits in int.
12635 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12636 (row_table_size): Now ptrdiff_t, not int.
12637 (scrolling_window): Avoid overflow in size calculations.
12638 Don't update size until allocation succeeds.
12639 * fns.c (concat): Check for overflow in size calculations.
12640 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12641 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12642 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12643
12644 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12645 (get_doc_string): Check for size calculation overflow.
12646 Don't update size until allocation succeeds.
12647 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12648 EMACS_INT, where ptrdiff_t will do.
12649 (Fsubstitute_command_keys): Check for string overflow.
12650
12651 * editfns.c (set_time_zone_rule): Don't assume environment length
12652 fits in int.
12653 (message_length): Now ptrdiff_t, not int.
12654 (Fmessage_box): Don't update size until allocation succeeds.
12655 Don't assume message length fits in int.
12656 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12657
12658 * emacs.c (main): Do not reallocate argv, since there is a null at
12659 the end that can be overwritten, and this way there's no need to
12660 worry about size-calculation overflow.
12661 (sort_args): Check for size-calculation overflow.
12662
12663 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12664 alloc succeeds.
12665 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12666
12667 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12668 (x_set_scroll_bar_width, x_figure_window_size):
12669 Check for integer overflow.
12670 (x_set_alpha): Do not assume XINT fits in int.
12671
12672 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12673 This is for the members text_lines, text_cols, total_lines, total_cols,
12674 where the system imposes an 'int' limit.
12675
12676 * fringe.c (Fdefine_fringe_bitmap):
12677 Don't update size until alloc works.
12678
12679 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12680 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12681
12682 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12683 Check for size-calculation overflow.
12684 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12685 do, as we prefer signed integers.
12686 (id_to_widget.max_size, id_to_widget.used)
12687 (xg_store_widget_in_map, xg_remove_widget_from_map)
12688 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12689 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12690 Use and return ptrdiff_t, not int.
12691 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12692 * gtkutil.h: Change prototypes to match the above.
12693
12694 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12695 are duplicate now that they've been promoted to lisp.h.
12696 (x_allocate_bitmap_record, x_alloc_image_color)
12697 (make_image_cache, cache_image, xpm_load):
12698 Don't update size until alloc is done.
12699 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12700 (x_detect_edges):
12701 Check for size calculation overflow.
12702 (ct_colors_allocated_max): New constant.
12703 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12704 overflow.
12705
12706 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12707 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12708 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12709 Use ptrdiff_t, not int, to count maps.
12710 (read_char_minibuf_menu_prompt): Check for overflow in size
12711 calculations. Don't update size until allocation succeeds.
12712 Redo calculations to avoid overflow.
12713 * keyboard.h: Change prototypes to match the above.
12714
12715 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12716 to count maps.
12717 (current_minor_maps): Check for size calculation overflow.
12718 * keymap.h: Change prototypes to match the above.
12719
12720 * lread.c (read1, init_obarray): Don't update size until alloc done.
12721
12722 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12723 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12724
12725 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12726 Now ptrdiff_t, not int.
12727 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12728 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12729
12730 * process.c (Fnetwork_interface_list): Check for overflow
12731 in size calculation.
12732
12733 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12734
12735 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12736 overflow. Don't bother calling xmalloc when xrealloc will do.
12737
12738 * search.c (Freplace_match): Check for size calculation overflow.
12739 (Fset_match_data): Don't assume list lengths fit in 'int'.
12740
12741 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12742 for command line length. Do not attempt to address one before the
12743 beginning of an array, as that's not portable.
12744
12745 * term.c (max_frame_lines): Remove; unused.
12746 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12747 not int.
12748 (encode_terminal_code, calculate_costs): Check for size
12749 calculation overflow.
12750 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12751 table lengths and related sizes. Don't update size until alloc
12752 done. Redo calculations to avoid overflow.
12753 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12754
12755 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12756 subtracting pointers.
12757 (gobble_line): Check for overflow more carefully. Don't update size
12758 until alloc done.
12759
12760 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12761 Don't update size until alloc done.
12762 Redo size calculations to avoid overflow.
12763 Check for size calculation overflow.
12764 (main) [DEBUG]: Fix typo in invoking tparam1.
12765
12766 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12767 Use ptrdiff_t, not int, for sizes.
12768 (store_mode_line_noprop_char): Don't update size until alloc done.
12769
12770 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12771 Use ptrdiff_t, not int, for sizes.
12772 (Finternal_make_lisp_face, cache_face):
12773 Check for size calculation overflow.
12774 (cache_face): Treat size calculation overflows as if they were
12775 memory exhaustion (the usual treatment), rather than aborting.
12776
12777 * xfns.c (x_encode_text, x_set_name_internal)
12778 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12779 sizes, since they can exceed INT_MAX in size. Check for size
12780 calculation overflow.
12781
12782 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12783 (xg_select): Check for size calculation overflow.
12784 Don't update size until alloc done.
12785
12786 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12787 as sprintf is limited to int lengths.
12788
12789 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12790 (X_LONG_MIN): New macros.
12791 Use them to make the following changes clearer.
12792 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12793 This change doesn't affect the value now, but it may help remind
12794 future maintainers not to raise the value too much later.
12795 (SELECTION_QUANTUM): Remove, replacing with ...
12796 (selection_quantum): ... new function, which avoids overflow.
12797 All uses changed.
12798 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12799 assumption that selection length fits in 'int'.
12800 (x_reply_selection_request, x_handle_selection_request)
12801 (x_get_window_property, receive_incremental_selection)
12802 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12803 (lisp_data_to_selection_data, clean_local_selection_data):
12804 Use ptrdiff_t, not int, to record length of selection.
12805 (x_reply_selection_request, x_get_window_property)
12806 (receive_incremental_selection, x_property_data_to_lisp):
12807 Redo calculations to avoid overflow.
12808 (x_reply_selection_request): When sending hint, ceiling it at
12809 X_LONG_MAX rather than relying on wraparound overflow to send
12810 something.
12811 (x_get_window_property, receive_incremental_selection)
12812 (lisp_data_to_selection_data, x_property_data_to_lisp):
12813 Check for size-calculation overflow.
12814 (x_get_window_property, receive_incremental_selection)
12815 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12816 Don't store size until memory allocation succeeds.
12817 (x_get_window_property): Plug memory leak on memory exhaustion.
12818 Don't double-block input; malloc is safe here. Don't assume 2**34
12819 - 4 fits in unsigned long. Add an xassert to check
12820 XGetWindowProperty overflow. Be more careful about overflow
12821 calculations, and distinguish size from memory overflow better.
12822 (receive_incremental_selection): When tracing, don't assume
12823 unsigned int is less than INT_MAX.
12824 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12825 harmful) conversions of unsigned short to int.
12826 (lisp_data_to_selection_data): Don't assume that integers
12827 in the range -65535 through -1 fit in an X unsigned short.
12828 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12829 result parameters unless successful. Rely on cons_to_unsigned
12830 to report problems with elements; the old code wasn't right anyway.
12831 (x_check_property_data): Check for int overflow; we cannot use
12832 a wider type due to X limits.
12833 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12834
12835 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12836
12837 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12838 (x_term_init): Check for size calculation overflow.
12839 (x_color_cells): Don't store size until memory allocation succeeds.
12840 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12841 Don't assume alloca size is less than MAX_ALLOCA.
12842 (x_term_init): Don't assume length fits in int (sprintf is limited
12843 to int size).
12844
12845 Use ptrdiff_t for composition IDs.
12846 * character.c (lisp_string_width):
12847 * composite.c (composition_table_size, n_compositions)
12848 (get_composition_id, composition_gstring_from_id):
12849 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12850 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12851 * window.c (Frecenter):
12852 Use ptrdiff_t, not int, for composition IDs.
12853 * composite.c (get_composition_id): Check for integer overflow.
12854 * composite.h: Adjust prototypes to match the above changes.
12855
12856 Use ptrdiff_t for hash table indexes.
12857 * category.c (hash_get_category_set):
12858 * ccl.c (ccl_driver):
12859 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12860 * coding.c (coding_system_charset_list, detect_coding_system):
12861 * coding.h (struct coding_system.id):
12862 * composite.c (get_composition_id, gstring_lookup_cache):
12863 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12864 * image.c (xpm_get_color_table_h):
12865 * lisp.h (hash_lookup, hash_put):
12866 * minibuf.c (Ftest_completion):
12867 Use ptrdiff_t for hash table indexes, not int (which is too
12868 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12869 32-bit --with-wide-int hosts).
12870
12871 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12872 Add a FIXME comment about memory leaks.
12873 (syms_of_charset): Don't assume xmalloc returns.
12874
12875 Don't assume that stated character widths fit in int.
12876 * character.c (Fchar_width, c_string_width, lisp_string_width):
12877 * character.h (CHAR_WIDTH):
12878 * indent.c (MULTIBYTE_BYTES_WIDTH):
12879 Use sanitize_char_width to avoid undefined and/or bad behavior
12880 with outlandish widths.
12881 * character.h (sanitize_tab_width): Rename from sanitize_width,
12882 now that we have two such functions. All uses changed.
12883 (sanitize_char_width): New inline function.
12884
12885 Don't assume that tab-width fits in int.
12886 * character.h (sanitize_width): New inline function.
12887 (SANE_TAB_WIDTH): New macro.
12888 (ASCII_CHAR_WIDTH): Use it.
12889 * indent.c (sane_tab_width): Remove. All uses replaced by
12890 SANE_TAB_WIDTH (current_buffer).
12891 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12892
12893 * fileio.c: Integer overflow issues with file modes.
12894 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12895
12896 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12897 Remove unreachable code.
12898 (read_hex, load_charset_map_from_file): Check for integer overflow.
12899
12900 * xterm.c: Don't go over XClientMessageEvent limit.
12901 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12902 (x_send_scroll_bar_event): Likewise. Check that the size does not
12903 exceed limits imposed by XClientMessageEvent, as well as the usual
12904 ptrdiff_t and size_t limits.
12905
12906 * keyboard.c: Overflow, signedness and related fixes.
12907 (make_lispy_movement): Use same integer type in forward decl
12908 that is used in the definition.
12909 (read_key_sequence, keyremap_step):
12910 Change bufsize argument back to int, undoing my 2011-03-30 change.
12911 We prefer signed types, and int is wide enough here.
12912 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12913 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12914 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12915 length, not size_t. Use ptrdiff_t for index, not int.
12916 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12917 possibility of integer overflow.
12918
12919 Overflow, signedness and related fixes for images.
12920
12921 * dispextern.h (struct it.stack[0].u.image.image_id)
12922 (struct_it.image_id, struct image.id, struct image_cache.size)
12923 (struct image_cache.used, struct image_cache.ref_count):
12924 * gtkutil.c (update_frame_tool_bar):
12925 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12926 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12927 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12928 * nsmenu.m (update_frame_tool_bar):
12929 * xdisp.c (calc_pixel_width_or_height):
12930 * xfns.c (image_cache_refcount):
12931 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12932 on typical 64-bit hosts.
12933
12934 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12935 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12936 Omit unnecessary casts to int.
12937 (parse_image_spec): Check that integers fall into 'int' range
12938 when the callers expect that.
12939 (image_ascent): Redo ascent calculation to avoid int overflow.
12940 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12941 (lookup_image): Remove unnecessary tests.
12942 (xbm_image_p): Locals are now of int, not EMACS_INT,
12943 since parse_image_check makes sure they fit into int.
12944 (png_load, gif_load, svg_load_image):
12945 Prefer int to unsigned where either will do.
12946 (tiff_handler): New function, combining the cores of the
12947 old tiff_error_handler and tiff_warning_handler.
12948 This function is rewritten to use vsnprintf and thereby avoid
12949 stack buffer overflows. It uses only the features of vsnprintf
12950 that are common to both POSIX and native Microsoft.
12951 (tiff_error_handler, tiff_warning_handler): Use it.
12952 (tiff_load, gif_load, imagemagick_load_image):
12953 Don't assume :index value fits in 'int'.
12954 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12955 (imagemagick_load_image): Check that crop parameters fit into
12956 the integer types that MagickCropImage accepts. Don't assume
12957 Vimagemagick_render_type has a nonnegative value. Don't assume
12958 size_t fits in 'long'.
12959 (gs_load): Use printmax_t to print the widest integers possible.
12960 Check for integer overflow when computing image height and width.
12961
12962 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12963
12964 * xdisp.c (redisplay_window): Don't force window start if point
12965 will be invisible in the resulting window. (Bug#9324)
12966
12967 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12968
12969 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12970 the display spec is of the form `(space ...)'.
12971 (handle_display_spec): Return the value returned by
12972 handle_single_display_spec, not just 1 or zero.
12973 (handle_single_display_spec): If the display spec is of the form
12974 `(space ...)', and specifies display in the text area, return 2
12975 rather than 1.
12976 (try_cursor_movement): Check for the need to scroll more
12977 accurately, and prefer exact match for point under bidi.
12978 Don't advance `row' beyond the last row of the window.
12979
12980 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12981 into disp_prop; all users changed.
12982
12983 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12984 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12985 for the text covered by the display property.
12986
12987 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12988
12989 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12990 Change return value to nil.
12991 (Frecord_buffer): Delete unused function.
12992
12993 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12994
12995 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12996 buffers, return left-to-right.
12997 (set_cursor_from_row): Consider candidate row a win if its glyph
12998 represents a newline and point is on that newline. Fixes cursor
12999 positioning on the newline at EOL of R2L text within L2R
13000 paragraph, and vice versa.
13001 (try_cursor_movement): Check continued rows, in addition to
13002 continuation rows. Fixes unwarranted scroll when point enters a
13003 continued line of R2L text within an L2R paragraph, or vice versa.
13004 (cursor_row_p): Consider the case of point being equal to
13005 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13006 from the end of a short line to the beginning of a continued line
13007 of R2L text within L2R paragraph.
13008 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13009 composed characters.
13010
13011 * bidi.c (bidi_check_type): Use xassert.
13012 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13013 members.
13014
13015 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13016
13017 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13018 a character.
13019
13020 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13021
13022 * nsfont.m (ns_otf_to_script): Fix typo.
13023
13024 2011-08-22 Kenichi Handa <handa@m17n.org>
13025
13026 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13027 extra slot even if the purpose is char-code-property-table.
13028
13029 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13030
13031 * xdisp.c (redisplay_window): When computing centering_position,
13032 account for the height of the header line. (Bug#8874)
13033
13034 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13035 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13036 candidate is selected by the mouse, and that candidate has a
13037 composed character under the mouse.
13038
13039 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13040 coordinates reported by pos-visible-in-window-p for a composed
13041 character in column zero.
13042
13043 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13044
13045 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13046
13047 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13048
13049 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13050 consider it a hit if to_charpos is anywhere in the range of the
13051 composed buffer positions.
13052
13053 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13054
13055 * image.c (gif_load): Don't assume that each subimage has the same
13056 dimensions as the base image. Handle disposal method that is
13057 "undefined" by the gif spec (Bug#9335).
13058
13059 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13060
13061 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13062 (Fcondition_case): Document `debug' symbol in error handler.
13063
13064 2011-08-19 Eli Zaretskii <eliz@gnu.org>
13065
13066 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13067 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13068 from an Org mode buffer to a Speedbar frame.
13069
13070 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13071 a composition, take its buffer position from IT->cmp_it.charpos.
13072 Fixes cursor positioning at the beginning of a line that begins
13073 with a composed character.
13074
13075 2011-08-18 Eli Zaretskii <eliz@gnu.org>
13076
13077 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13078 character bidirectional type, use STRONG_L instead. Fixes crashes
13079 in a buffer produced by `describe-categories'.
13080
13081 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13082 members before the level stack, so they would be saved and
13083 restored when copying iterator state. Fixes incorrect reordering
13084 around TABs covered by display properties.
13085
13086 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13087
13088 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13089
13090 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
13091
13092 * eval.c (internal_condition_case, internal_condition_case_1)
13093 (internal_condition_case_2, internal_condition_case_n):
13094 Remove unnecessary aborts (Bug#9081).
13095
13096 2011-08-17 Eli Zaretskii <eliz@gnu.org>
13097
13098 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13099 has no `load' handler, try opening the file locally. (Bug#9311)
13100
13101 2011-08-16 Ken Brown <kbrown@cornell.edu>
13102
13103 * gmalloc.c: Expand comment.
13104
13105 2011-08-16 Eli Zaretskii <eliz@gnu.org>
13106
13107 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13108 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13109
13110 2011-08-16 Ken Brown <kbrown@cornell.edu>
13111
13112 Fix memory allocation problems in Cygwin build (Bug#9273).
13113
13114 * unexcw.c ( __malloc_initialized): Declare external variable.
13115 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13116
13117 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13118 New variables.
13119 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13120 dumped emacs.
13121 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13122 in the static heap.
13123 [CYGWIN] (special_realloc): New function.
13124 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13125 requests to realloc storage in the static heap.
13126
13127 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13128
13129 * bidi.c (bidi_initialize): Remove unused local.
13130
13131 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13132
13133 * bidimirror.h:
13134 * biditype.h: Remove file.
13135 * makefile.w32-in ($(BLD)/bidi.$(O)):
13136 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13137
13138 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13139
13140 * chartab.c: Improve commentary for the uniprop_table API.
13141
13142 * bidi.c (bidi_paragraph_init): Support zero value of
13143 bidi_ignore_explicit_marks_for_paragraph_level.
13144 (bidi_initialize): Use uniprop_table instead of including
13145 biditype.h and bidimirror.h.
13146
13147 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13148 coordinates of the iterator when restoring from ppos_it.
13149 (Bug#9296)
13150
13151 2011-08-14 Kenichi Handa <handa@m17n.org>
13152
13153 * process.c (create_process): Call setup_process_coding_systems
13154 after the pid of the process is set to -1 (Bug#8162).
13155
13156 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13157
13158 * xdisp.c (move_it_in_display_line_to): Don't invoke
13159 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13160 ppos_it. Fixes vertical cursor motion when line beginning is
13161 covered by an image. (Bug#9296)
13162
13163 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13164
13165 * nsterm.h (ns_run_ascript): Declare.
13166 (NSAPP_DATA2_RUNASSCRIPT): Define.
13167
13168 * nsfns.m (as_script, as_result, as_status): New static variables.
13169 (ns_run_ascript): New function.
13170 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13171 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13172 the event loop. Get status from as_status (Bug#7276).
13173
13174 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13175 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13176 the event loop (Bug#7276).
13177
13178 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13179
13180 * gnutls.c (QCgnutls_bootprop_priority)
13181 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13182 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13183 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13184 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13185 (QCgnutls_bootprop_verify_hostname_error)
13186 (QCgnutls_bootprop_callbacks_verify): Rename from
13187 Qgnutls_bootprop_..., all uses changed.
13188
13189 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13190 uses changed.
13191
13192 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13193
13194 * xfaces.c (Qframe_set_background_mode): Now static.
13195 * dispextern.h (Qframe_set_background_mode): Remove decl.
13196
13197 * process.c (Fnetwork_interface_info): Declare local only if needed.
13198
13199 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13200
13201 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13202 (Fnetwork_interface_list): Allocate in increments of bytes instead
13203 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13204 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13205 sockaddr.
13206 (struct ifflag_def): notrailers is smart on OSX.
13207 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13208 Get hardware address with getifaddrs if available.
13209
13210 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13211
13212 * xdisp.c (iterate_out_of_display_property): xassert that
13213 IT->position is set to within IT->object's boundaries. Break from
13214 the loop as soon as EOB is reached; avoids infloops in redisplay
13215 when IT->position is set up wrongly due to some bug.
13216 Set IT->current to match the bidi iterator unconditionally.
13217 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13218 entry. Force push_it to save on the stack the current
13219 buffer/string position, to be restored by pop_it. Fix flags in
13220 the iterator structure wrt the object coming from a display
13221 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13222 properties. (Bug#9284)
13223
13224 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13225
13226 * fontset.c (fontset_get_font_group): Add proper type checks.
13227 (Bug#9172)
13228
13229 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13230
13231 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13232 and LC_VERSION_MIN_MACOSX.
13233 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13234 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13235
13236 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13237
13238 * xdisp.c (forward_to_next_line_start): Allow to use the
13239 no-display-properties-and-no-overlays under bidi display.
13240 Set disp_pos in the bidi iterator to avoid searches for display
13241 properties and overlays.
13242
13243 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13244
13245 * editfns.c (Fset_time_zone_rule): Document relationship with the
13246 setenv function.
13247
13248 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13249 the font entity extracted from the cache (Bug#8109).
13250
13251 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13252
13253 * composite.c (autocmp_chars): Don't reset point. That is done by
13254 restore_point_unwind (Bug#5984).
13255
13256 2011-08-07 Juri Linkov <juri@jurta.org>
13257
13258 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13259 to show the arg `TIME' instead of `TIMEVAL'.
13260
13261 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13262
13263 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13264 display property strides EOL and includes a newline, as in
13265 longlines-mode. (Bug#9254)
13266 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13267 word-wrap under bidirectional display. (Bug#9224)
13268
13269 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13270 is non-zero, even if the data buffer is NULL. Fixes a crash in
13271 vertical-motion with longlines-mode. (Bug#9254)
13272
13273 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13274
13275 * bidi.c <bidi_cache_total_alloc>: Now static.
13276 (bidi_initialize): Initialize bidi_cache_total_alloc.
13277
13278 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13279 cache. (Bug#9221)
13280
13281 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13282 amount allocated this far in `bidi_cache_total_alloc'.
13283 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13284 non-zero, only free the data buffer without restoring the cache
13285 contents. All callers changed.
13286
13287 * dispextern.h (bidi_unshelve_cache): Update prototype.
13288
13289 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13290 (move_it_in_display_line, move_it_to)
13291 (move_it_vertically_backward, move_it_by_lines): Replace the call
13292 to xfree to an equivalent call to bidi_unshelve_cache.
13293 (move_it_in_display_line_to): Fix logic of returning
13294 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13295
13296 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13297
13298 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13299 came from a string character with a `cursor' property. (Bug#9229)
13300
13301 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13302
13303 * Makefile.in (LIB_PTHREAD): New variable.
13304 (LIBES): Add LIB_PTHREAD (Bug#9216).
13305
13306 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13307 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13308
13309 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13310
13311 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13312
13313 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13314
13315 * xterm.c (x_find_topmost_parent): New function.
13316 (x_set_frame_alpha): Find topmost parent window with
13317 x_find_topmost_parent and set the property there also (bug#9181).
13318 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13319
13320 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13321
13322 * callproc.c (Fcall_process): Avoid vfork clobbering
13323 the local vars buffer, coding_systems, current_dir.
13324
13325 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13326
13327 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13328
13329 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13330
13331 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13332 so that it is not optimized away.
13333
13334 * xdisp.c (compute_display_string_pos): Remove unused local.
13335
13336 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13337
13338 Fix slow cursor motion and scrolling in large buffers with
13339 selective display, like Org Mode buffers. (Bug#9218)
13340
13341 * dispextern.h (struct bidi_it): New member disp_prop_p.
13342
13343 * xdisp.c: Remove one-slot cache of display string positions.
13344 (compute_display_string_pos): Accept an additional argument
13345 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13346 for a display string or property. If found, set DISP_PROP_P
13347 non-zero.
13348
13349 * bidi.c (bidi_fetch_char): Accept an additional argument
13350 DISP_PROP_P, and pass it to compute_display_string_pos.
13351 Only handle text covered by a display string if DISP_PROP_P is returned
13352 non-zero. All callers of bidi_fetch_char changed.
13353
13354 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13355
13356 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13357
13358 2010-12-03 Don March <don@ohspite.net>
13359
13360 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13361 last character M-[char] is translated to ESC [char] (bug#7541).
13362
13363 2011-08-02 Kenichi Handa <handa@m17n.org>
13364
13365 * lisp.h (uniprop_table): Extern it.
13366
13367 * chartab.c (uniprop_table): Make it non-static.
13368
13369 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13370
13371 * xdisp.c (forward_to_next_line_start): Accept additional argument
13372 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13373 on the newline.
13374 (reseat_at_next_visible_line_start): Use the bidi iterator state
13375 returned by forward_to_next_line_start to restore the state of
13376 it->bidi_it after backing up to previous newline. (Bug#9212)
13377
13378 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13379
13380 * regex.c (re_comp): Protoize.
13381 (re_exec): Fix return type.
13382 (regexec): Fix type of `ret'. (Bug#9203)
13383
13384 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13385
13386 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13387 This is needed if max-image-size is a floating-point number.
13388
13389 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13390
13391 * print.c (print_object): Print empty symbol as ##.
13392
13393 * lread.c (read1): Read ## as empty symbol.
13394
13395 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13396
13397 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13398 setting frame foreground color (Bug#9175).
13399 (x_set_background_color): Likewise.
13400
13401 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13402 contents (Bug#9176).
13403 (EmacsTooltip -init): Remove bezels and add shadows to
13404 tooltip windows.
13405
13406 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13407 or scroll bar (Bug#8470).
13408
13409 * nsfont.m (nsfont_open): Remove assignment to voffset and
13410 unnecessary vars hshink, expand, hd, full_height, min_height.
13411 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13412
13413 * nsterm.h (nsfont_info): Remove voffset field.
13414
13415 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13416
13417 Implement strike-through and overline on NextStep (Bug#8863).
13418
13419 * nsfont.m (nsfont_open): Use underline position provided by font,
13420 instead of hard-coded value of 2.
13421 (nsfont_draw): Call ns_draw_text_decoration instead.
13422
13423 * nsterm.h: Add declaration for ns_draw_text_decoration.
13424
13425 * nsterm.m (ns_draw_text_decoration): New function for drawing
13426 underline, overline, and strike-through.
13427 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13428 ns_draw_text_decoration. Change treatment of cursor drawing to
13429 accommodate underlining, etc.
13430
13431 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13432
13433 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13434 default.
13435
13436 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13437
13438 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13439 Without this fix, if a signal arrives just after memory fills up,
13440 'malloc' might be invoked reentrantly.
13441
13442 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13443 In other words, assume that every image size is allowed, on non-X
13444 hosts. This assumption is probably wrong, but it lets Emacs compile.
13445
13446 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13447
13448 * regex.c (re_iswctype): Convert return values to boolean.
13449
13450 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13451
13452 * xdisp.c (compute_display_string_pos): Don't use cached display
13453 string position if the buffer had its restriction changed.
13454 (Bug#9184)
13455
13456 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13457
13458 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13459
13460 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13461
13462 Integer signedness and overflow and related fixes. (Bug#9079)
13463
13464 * bidi.c: Integer size and overflow fixes.
13465 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13466 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13467 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13468 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13469 (bidi_find_other_level_edge):
13470 Use ptrdiff_t instead of EMACS_INT where either will do.
13471 This works better on 32-bit hosts configured --with-wide-int.
13472 (bidi_cache_ensure_space): Check for size-calculation overflow.
13473 Use % rather than repeated addition, for better worst-case speed.
13474 Don't set bidi_cache_size until after xrealloc returns, because it
13475 might not return.
13476 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13477 (bidi_cache_ensure_space): Also check that the bidi cache size
13478 does not exceed that of the largest Lisp string or buffer. See Eli
13479 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13480
13481 * alloc.c (__malloc_size_t): Remove.
13482 All uses replaced by size_t. See Andreas Schwab's note
13483 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13484
13485 * image.c: Improve checking for integer overflow.
13486 (check_image_size): Assume that f is nonnull, since
13487 it is always nonnull in practice. This is one less thing to
13488 worry about when checking for integer overflow later.
13489 (x_check_image_size): New function, which checks for integer
13490 overflow issues inside X.
13491 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13492 This removes the need for a memory_full check.
13493 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13494 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13495 (xbm_read_bitmap_data): Change locals back to 'int', since
13496 their values must fit in 'int'.
13497 (xpm_load_image, png_load, tiff_load):
13498 Invoke x_create_x_image_and_pixmap earlier,
13499 to avoid much needless work if the image is too large.
13500 (tiff_load): Treat overly large images as if
13501 x_create_x_image_and_pixmap failed, not as malloc failures.
13502 (gs_load): Use x_check_image_size.
13503
13504 * gtkutil.c: Omit integer casts.
13505 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13506 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13507
13508 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13509
13510 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13511 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13512 would wrongly return t on a 64-bit host.
13513
13514 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13515 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13516 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13517 and therefore cause GCC to emit a bogus diagnostic in some cases.
13518
13519 * image.c: Integer signedness and overflow and related fixes.
13520 This is not an exhaustive set of fixes, but it's time to
13521 record what I've got.
13522 (lookup_pixel_color, check_image_size): Remove redundant decls.
13523 (check_image_size): Don't assume that arbitrary EMACS_INT values
13524 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13525 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13526 (tiff_load, imagemagick_load_image):
13527 Check for overflow in size calculations.
13528 (x_create_x_image_and_pixmap): Remove unnecessary test for
13529 xmalloc returning NULL; that can't happen.
13530 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13531 (xpm_color_bucket): Use better integer hashing function.
13532 (xpm_cache_color): Don't possibly over-allocate memory.
13533 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13534 (gif_memory_source):
13535 Use ptrdiff_t, not int or size_t, to record sizes.
13536 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13537 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13538 either works, as we prefer signed integers.
13539 (tiff_read_from_memory, tiff_write_from_memory):
13540 Return tsize_t, not size_t, since that's what the TIFF API wants.
13541 (tiff_read_from_memory): Don't fail simply because the read would
13542 go past EOF; instead, return a short read.
13543 (tiff_load): Omit no-longer-needed casts.
13544 (Fimagemagick_types): Don't assume size fits into 'int'.
13545
13546 Improve hashing quality when configured --with-wide-int.
13547 * fns.c (hash_string): New function, taken from sxhash_string.
13548 Do not discard information about ASCII character case; this
13549 discarding is no longer needed.
13550 (sxhash-string): Use it. Change sig to match it. Caller changed.
13551 * lisp.h: Declare it.
13552 * lread.c (hash_string): Remove, since we now use fns.c's version.
13553 The fns.c version returns a wider integer if --with-wide-int is
13554 specified, so this should help the quality of the hashing a bit.
13555
13556 * emacs.c: Integer overflow minor fix.
13557 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13558 Define only if GNU_LINUX.
13559 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13560
13561 * dispnew.c: Integer signedness and overflow fixes.
13562 Remove unnecessary forward decls, that were a maintenance hassle.
13563 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13564 All uses changed.
13565 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13566 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13567 (prepare_desired_row, line_draw_cost):
13568 Use int, not unsigned, where either works.
13569 (save_current_matrix, restore_current_matrix):
13570 Use ptrdiff_t, not size_t, where either works.
13571 (init_display): Check for overflow more accurately, and without
13572 relying on undefined behavior.
13573
13574 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13575 Remove, replacing with the new symbols in lisp.h. All uses changed.
13576 * fileio.c (make_temp_name):
13577 * filelock.c (lock_file_1, lock_file):
13578 * xdisp.c (message_dolog):
13579 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13580 Use pMd etc. instead.
13581 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13582 replacing the pWIDE etc. symbols removed from editfns.c.
13583
13584 * keyboard.h (num_input_events): Now uintmax_t.
13585 This is (very slightly) less likely to mess up due to wraparound.
13586 All uses changed.
13587
13588 * buffer.c: Integer signedness fixes.
13589 (alloc_buffer_text, enlarge_buffer_text):
13590 Use ptrdiff_t rather than size_t when either will do, as we prefer
13591 signed integers.
13592
13593 * alloc.c: Integer signedness and overflow fixes.
13594 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13595 (__malloc_size_t): Default to size_t, not to int.
13596 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13597 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13598 Prefer ptrdiff_t to size_t when either would do, as we prefer
13599 signed integers.
13600 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13601 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13602 Now const. Initialize with values that are in range even if char
13603 is signed.
13604 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13605 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13606 These functions do the right thing with sizes > 2**32.
13607 (check_depth): Now ptrdiff_t, not int.
13608 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13609 Adjust to new way of storing sizes. Check for size overflow bugs
13610 in rest of code.
13611 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13612 slightly wrong anyway, as it missed one instance of
13613 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13614 (refill_memory_reserve): Omit needless cast to size_t.
13615 (mark_object_loop_halt): Mark as externally visible.
13616
13617 * xselect.c: Integer signedness and overflow fixes.
13618 (Fx_register_dnd_atom, x_handle_dnd_message):
13619 Use ptrdiff_t, not size_t, since we prefer signed.
13620 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13621 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13622 x_dnd_atoms_size and x_dnd_atoms_length.
13623
13624 * doprnt.c: Prefer signed to unsigned when either works.
13625 * eval.c (verror):
13626 * doprnt.c (doprnt):
13627 * lisp.h (doprnt):
13628 * xdisp.c (vmessage):
13629 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13630 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13631 prefer signed arithmetic to avoid comparison confusion.
13632 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13633 but is a bit tricky.
13634
13635 Assume freestanding C89 headers, string.h, stdlib.h.
13636 * data.c, doprnt.c, floatfns.c, print.c:
13637 Include float.h unconditionally.
13638 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13639 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13640 * regex.c: Likewise for stddef.h, string.h.
13641 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13642 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13643 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13644 (STDC_HEADERS): Remove obsolete defines.
13645 * sysdep.c: Include limits.h unconditionally.
13646
13647 Assume support for memcmp, memcpy, memmove, memset.
13648 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13649 * regex.c (memcmp, memcpy):
13650 Remove; we assume C89 now.
13651
13652 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13653 (__malloc_safe_bcopy): Remove; no longer needed.
13654
13655 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13656 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13657 well either way, and we prefer signed to unsigned.
13658
13659 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13660
13661 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13662 closes the connection while we're reading (bug#9182).
13663
13664 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13665
13666 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13667 are specified (Bug#9168).
13668
13669 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13670
13671 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13672 Found by GCC static checking and --with-wide-int on a 32-bit host.
13673
13674 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13675
13676 * xdisp.c (compute_display_string_pos): Fix logic of caching
13677 previous display string position. Initialize cached_prev_pos to
13678 -1. Fixes slow-down at the beginning of a buffer.
13679
13680 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13681
13682 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13683 for attrs[LFACE_FONTSET_INDEX].
13684
13685 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13686
13687 * xml.c (parse_region): Remove unused local
13688 that was recently introduced.
13689
13690 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13691
13692 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13693 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13694
13695 * xdisp.c (move_it_in_display_line_to): Record the best matching
13696 position for TO_CHARPOS while scanning the line, and restore it on
13697 exit if none of the characters scanned was an exact match.
13698 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13699 when exact match is impossible due to invisible text, and the
13700 lines are truncated.
13701
13702 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13703
13704 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13705 for OSX >= 10.7.
13706
13707 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13708
13709 Fix a significant slow-down of cursor motion with C-n, C-p,
13710 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13711 auto-repeat under bidi redisplay in fontified buffers.
13712 * xdisp.c (compute_stop_pos_backwards): New function.
13713 (next_element_from_buffer): Call compute_stop_pos_backwards to
13714 find a suitable prev_stop when we find ourselves before
13715 base_level_stop.
13716 (reseat): Don't look for prev_stop, as that could mean a very long
13717 run.
13718 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13719 <cached_disp_overlay_modiff>: Cache for last found display string
13720 position.
13721 (compute_display_string_pos): Return the cached position if asked
13722 about the same buffer in the same area of character positions, and
13723 the buffer wasn't changed since the time the display string
13724 position was cached.
13725
13726 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13727
13728 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13729 is an integer, which is important for empty lines. (Bug#9149)
13730
13731 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13732
13733 * frame.c (Fmodify_frame_parameters): In tty case, update the
13734 default face if necessary (Bug#4238).
13735
13736 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13737
13738 * editfns.c (Fstring_to_char): No need to explain what a character
13739 is in the docstring (Bug#6576).
13740
13741 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13742
13743 * xml.c (parse_region): Make sure we always return a tree.
13744
13745 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13746
13747 * xml.c (parse_region): If a document contains only comments,
13748 return that, too.
13749
13750 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13751
13752 * xml.c (make_dom): Return comments, too.
13753
13754 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13755
13756 Port to OpenBSD.
13757 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13758 and the surrounding thread.
13759 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13760 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13761 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13762 timer goes off.
13763 * s/openbsd.h (BROKEN_SIGIO): Define.
13764 * unexelf.c (unexec) [__OpenBSD__]:
13765 Don't update the .mdebug section of the Alpha COFF symbol table.
13766
13767 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13768
13769 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13770 (bug#8460).
13771
13772 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13773
13774 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13775 This fixes some race conditions on the permissions of any newly
13776 created file.
13777
13778 * alloc.c (valid_pointer_p): Use pipe, not open.
13779 This fixes some permissions issues when debugging.
13780
13781 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13782 If fchown fails to set both uid and gid, try to set just gid,
13783 as that is sometimes allowed. Adjust the file's mode to eliminate
13784 setuid or setgid bits that are inappropriate if fchown fails.
13785
13786 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13787
13788 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13789 to compare Lisp_Objects.
13790 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13791 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13792 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13793
13794 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13795
13796 * lread.c (read_integer): Unread even EOF character.
13797 (read1): Likewise. Properly record start position of symbol.
13798
13799 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13800 symbol character follows.
13801
13802 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13803
13804 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13805 This works around a problem with the previous change to Fcopy_file.
13806 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13807 and without this change, GCC might complain about discarding
13808 fchown's return value.
13809
13810 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13811
13812 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13813
13814 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13815
13816 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13817
13818 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13819
13820 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13821 it's used from the C level.
13822
13823 * process.c: Use the same condition for POLL_FOR_INPUT in both
13824 keyboard.c and process.c (bug#1858).
13825
13826 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13827
13828 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13829 (Fgnutls_boot): Use it.
13830
13831 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13832
13833 * doc.c (Fsubstitute_command_keys): Revert last change.
13834
13835 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13836
13837 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13838 quotes the next character, and doesn't affect other longer
13839 sequences (bug#8935).
13840
13841 * lread.c (syms_of_lread): Clarify that is isn't only
13842 `eval-buffer' and `eval-defun' that's affected by
13843 `lexical-binding' (bug#8460).
13844
13845 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13846
13847 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13848 bidi redisplay when a line includes both an image and is truncated.
13849
13850 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13851
13852 Fix minor problems found by static checking.
13853 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13854 (elsz): Now a signed constant, not a size_t var. We prefer signed
13855 types to unsigned, to avoid integer comparison confusion. Without
13856 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13857 "cannot optimize loop, the loop counter may overflow", a symptom
13858 of the confusion.
13859 * indent.c (Fvertical_motion): Mark locals as initialized.
13860 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13861
13862 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13863
13864 * search.c (Fre_search_backward): Mention `case-fold-search' in
13865 all the re_search_* functions (bug#8138).
13866
13867 * keyboard.c (Fopen_dribble_file): Document when the file is
13868 closed (bug#8056).
13869
13870 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13871
13872 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13873 bidi_cache_idx.
13874
13875 Support bidi reordering of display and overlay strings.
13876 * xdisp.c (compute_display_string_pos)
13877 (compute_display_string_end): Accept additional argument STRING.
13878 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13879 (reseat_to_string): Initialize bidi_it->string.s and
13880 bidi_it->string.schars.
13881 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13882 NULL (avoids a crash in bidi_paragraph_init).
13883 Initialize itb.string.lstring.
13884 (init_iterator): Call bidi_init_it only of a valid
13885 buffer position was specified. Initialize paragraph_embedding to
13886 L2R.
13887 (reseat_to_string): Initialize the bidi iterator.
13888 (display_string): If we need to ignore text properties of
13889 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13890 original value of -1 will not work with bidi.)
13891 (compute_display_string_pos): First arg is now struct
13892 `text_pos *'; all callers changed. Support display properties on
13893 Lisp strings.
13894 (compute_display_string_end): Support display properties on Lisp
13895 strings.
13896 (init_iterator, reseat_1, reseat_to_string): Initialize the
13897 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13898 when iterating on a string not from display properties).
13899 (compute_display_string_pos, compute_display_string_end):
13900 Fix calculation of the object to scan. Fixes an error when using
13901 arrow keys.
13902 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13903 base_level_stop; instead, set base_level_stop to BEGV.
13904 Fixes crashes in vertical-motion.
13905 (next_element_from_buffer): Improve commentary for when
13906 the iterator is before prev_stop.
13907 (init_iterator): Initialize bidi_p from the default value of
13908 bidi-display-reordering, not from buffer-local value. Use the
13909 buffer-local value only if initializing for buffer iteration.
13910 (handle_invisible_prop): Support invisible properties on strings
13911 that are being bidi-reordered.
13912 (set_iterator_to_next): Support bidi reordering of C strings and
13913 Lisp strings.
13914 (next_element_from_string): Support bidi reordering of Lisp
13915 strings.
13916 (handle_stop_backwards): Support Lisp strings as well.
13917 (display_string): Support display of R2L glyph rows.
13918 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13919 (init_iterator): Don't initialize it->bidi_p for strings
13920 here.
13921 (reseat_to_string): Initialize it->bidi_p for strings here.
13922 (next_element_from_string, next_element_from_c_string)
13923 (next_element_from_buffer): Add xassert's for correspondence
13924 between IT's object being iterated and it->bidi_it.string
13925 structure.
13926 (face_before_or_after_it_pos): Support bidi iteration.
13927 (next_element_from_c_string): Handle the case of the first string
13928 character that is not the first one in the visual order.
13929 (get_visually_first_element): New function, refactored from common
13930 parts of next_element_from_buffer, next_element_from_string, and
13931 next_element_from_c_string.
13932 (tool_bar_lines_needed, redisplay_tool_bar)
13933 (display_menu_bar): Force left-to-right direction. Add a FIXME
13934 comment for making that be controlled by a user option.
13935 (push_it, pop_it): Save and restore the state of the
13936 bidi iterator. Save and restore the bidi_p flag.
13937 (pop_it): Iterate out of display property for string iteration as
13938 well.
13939 (iterate_out_of_display_property): Support iteration over strings.
13940 (handle_single_display_spec): Set up it->bidi_it for iteration
13941 over a display string, and call bidi_init_it.
13942 (handle_single_display_spec, next_overlay_string)
13943 (get_overlay_strings_1, push_display_prop): Set up the bidi
13944 iterator for displaying display or overlay strings.
13945 (forward_to_next_line_start): Don't use the shortcut if
13946 bidi-iterating.
13947 (back_to_previous_visible_line_start): If handle_display_prop
13948 pushed the iterator stack, restore the internal state of the bidi
13949 iterator by calling bidi_pop_it same number of times.
13950 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13951 and we are bidi-iterating, don't decrement the iterator position;
13952 instead, set the first_elt flag in the bidi iterator, to produce
13953 the same effect.
13954 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13955 (push_display_prop): xassert that we are iterating a buffer.
13956 (push_it, pop_it): Save and restore paragraph_embedding member.
13957 (handle_single_display_spec, next_overlay_string)
13958 (get_overlay_strings_1, reseat_1, reseat_to_string)
13959 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13960 correctly. Don't assume unibyte strings are not bidi-reordered.
13961 (compute_display_string_pos)
13962 (compute_display_string_end): Fix handling the case of C string.
13963 (push_it, pop_it): Save and restore from_disp_prop_p.
13964 (handle_single_display_spec, push_display_prop): Set the
13965 from_disp_prop_p flag.
13966 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13967 (pop_it): Call iterate_out_of_display_property only if we are
13968 popping after iteration over a string that came from a display
13969 property. Fix a typo in popping stretch info. Add an assertion
13970 for verifying that the iterator position is in sync with the bidi
13971 iterator.
13972 (handle_single_display_spec, get_overlay_strings_1)
13973 (push_display_prop): Fix initialization of paragraph direction for
13974 string when that of the parent object is not yet determined.
13975 (reseat_1): Call bidi_init_it to resync the bidi
13976 iterator with IT's position. (Bug#7616)
13977 (find_row_edges): If ROW->start.pos gives position
13978 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13979 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13980 Reset the from_disp_prop_p flag.
13981 (SAVE_IT, RESTORE_IT): New macros.
13982 (pos_visible_p, face_before_or_after_it_pos)
13983 (back_to_previous_visible_line_start)
13984 (move_it_in_display_line_to, move_it_in_display_line)
13985 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13986 (try_scrolling, redisplay_window, display_line): Use them when
13987 saving a temporary copy of the iterator and restoring it back.
13988 (back_to_previous_visible_line_start, reseat_1)
13989 (init_iterator): Empty the bidi cache "stack".
13990 (move_it_in_display_line_to): If iterator ended up at
13991 EOL, but we never saw any buffer positions smaller than
13992 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13993 motion in bidi-reordered lines.
13994 (move_it_in_display_line_to): Record prev_method and prev_pos
13995 immediately before the call to set_iterator_to_next. Fixes cursor
13996 motion in bidi-reordered lines with stretch glyphs and strings
13997 displayed in margins. (Bug#8133) (Bug#8867)
13998 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13999 TO_CHARPOS.
14000 (pos_visible_p): Support positions in bidi-reordered lines.
14001 Save and restore bidi cache.
14002
14003 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14004 (bidi_paragraph_info): Delete unused struct.
14005 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14006 (bidi_cache_start): New variable.
14007 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14008 to zero.
14009 (bidi_cache_fetch_state, bidi_cache_search)
14010 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14011 (bidi_cache_find, bidi_peek_at_next_level)
14012 (bidi_level_of_next_char, bidi_find_other_level_edge)
14013 (bidi_move_to_visually_next): Compare cache index with
14014 bidi_cache_start rather than with zero.
14015 (bidi_fetch_char): Accept new argument STRING; all callers
14016 changed. Support iteration over a string. Support strings with
14017 display properties. Support unibyte strings. Fix the type of
14018 `len' according to what STRING_CHAR_AND_LENGTH expects.
14019 (bidi_paragraph_init, bidi_resolve_explicit_1)
14020 (bidi_resolve_explicit, bidi_resolve_weak)
14021 (bidi_level_of_next_char, bidi_move_to_visually_next):
14022 Support iteration over a string.
14023 (bidi_set_sor_type, bidi_resolve_explicit_1)
14024 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14025 can now be zero (for strings); special values 0 and -1 were
14026 changed to -1 and -2, respectively.
14027 (bidi_char_at_pos): New function.
14028 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14029 Call it instead of FETCH_MULTIBYTE_CHAR.
14030 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14031 initialized to valid values.
14032 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14033 values.
14034 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14035 the test for valid cached positions. Fix the logic for looking up
14036 the sentinel state in the cache. GCPRO the Lisp string we are
14037 iterating.
14038 (bidi_push_it, bidi_pop_it): New functions.
14039 (bidi_initialize): Initialize the bidi cache start stack pointer.
14040 (bidi_cache_ensure_space): New function, refactored from part of
14041 bidi_cache_iterator_state. Don't assume the required size is just
14042 one BIDI_CACHE_CHUNK away.
14043 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14044 (bidi_count_bytes, bidi_char_at_pos): New functions.
14045 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14046 always valid if bidi_cache_idx is valid.
14047 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14048 is valid if it's going to be used.
14049 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14050 (bidi_cache_fetch_state, bidi_cache_search)
14051 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14052 (bidi_cache_iterator_state, bidi_cache_find)
14053 (bidi_find_other_level_edge, bidi_cache_start_stack):
14054 All variables related to cache indices are now EMACS_INT.
14055
14056 * dispextern.h (struct bidi_string_data): New structure.
14057 (struct bidi_it): New member `string'. Make flag members be 1-bit
14058 fields, and put them last in the struct.
14059 (compute_display_string_pos, compute_display_string_end):
14060 Update prototypes.
14061 (bidi_push_it, bidi_pop_it): Add prototypes.
14062 (struct iterator_stack_entry): New members bidi_p,
14063 paragraph_embedding, and from_disp_prop_p.
14064 (struct it): Member bidi_p is now a bit field 1 bit wide.
14065 (bidi_shelve_cache, bidi_unshelve_cache):
14066 Declare prototypes.
14067
14068 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14069 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14070 and vector-like objects.
14071
14072 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14073 cache around display iteration.
14074
14075 * window.c (Fwindow_end, window_scroll_pixel_based)
14076 (displayed_window_lines, Frecenter): Save and restore the bidi
14077 cache around display iteration.
14078
14079 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14080
14081 * editfns.c (Fdelete_region): Clarify the use of the named
14082 parameters (bug#6788).
14083
14084 2011-07-14 Martin Rudalics <rudalics@gmx.at>
14085
14086 * indent.c (Fvertical_motion): Set and restore w->pointm when
14087 saving and restoring the window's buffer (Bug#9006).
14088
14089 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14090
14091 * editfns.c (Fstring_to_char): Clarify just what is returned
14092 (bug#6576). Text by Eli Zaretskii.
14093
14094 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
14095
14096 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14097
14098 2011-07-13 Eli Zaretskii <eliz@gnu.org>
14099
14100 * buffer.c (mmap_find): Fix a typo.
14101
14102 2011-07-13 Johan Bockgård <bojohan@gnu.org>
14103
14104 Fix execution of x selection hooks.
14105 * xselect.c (Qx_lost_selection_functions)
14106 (Qx_sent_selection_functions): New vars.
14107 (syms_of_xselect): DEFSYM them.
14108 (x_handle_selection_request): Pass Qx_sent_selection_functions
14109 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14110 (x_handle_selection_clear,x_clear_frame_selections):
14111 Pass Qx_lost_selection_functions rather than
14112 Vx_lost_selection_functions to Frun_hook_with_args.
14113
14114 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14115
14116 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14117 The old code sometimes used this field without initializing it.
14118
14119 * alloc.c (gc_sweep): Don't read past end of array.
14120 In theory, the old code could also have corrupted Emacs internals,
14121 though it'd be very unlikely.
14122
14123 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14124
14125 * character.c (Fcharacterp): Don't advertise optional ignored
14126 argument. (Bug#4026)
14127
14128 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14129
14130 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14131 key" (bug#4257).
14132
14133 * window.c (Fset_window_start): Doc fix (bug#4199).
14134 (Fset_window_hscroll): Ditto.
14135
14136 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14137
14138 Fix minor new problems caught by GCC 4.6.1.
14139 * term.c (init_tty): Remove unused local.
14140 * xsettings.c (store_monospaced_changed): Define this function only
14141 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14142 not used otherwise.
14143
14144 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14145
14146 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14147
14148 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14149
14150 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14151 are the mini-buffer and the echo area (bug#3320).
14152
14153 * term.c (init_tty): Remove support for supdup, c10 and perq
14154 terminals, which are no longer supported (bug#1482).
14155
14156 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14157
14158 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14159
14160 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14161
14162 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14163 for non-popups (Bug#3642).
14164
14165 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14166
14167 * alloc.c (reset_malloc_hooks): Protoize.
14168 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14169 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14170 * cm.c (losecursor): Likewise.
14171 * data.c (fmod): Likewise.
14172 * dispnew.c (swap_glyphs_in_rows): Likewise.
14173 * emacs.c (memory_warning_signal): Likewise.
14174 * floatfns.c (float_error): Likewise.
14175 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14176 (otf_open, font_otf_capability, generate_otf_features)
14177 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14178 Likewise.
14179 * image.c (pbm_read_file): Likewise.
14180 * indent.c (string_display_width): Likewise.
14181 * intervals.c (check_for_interval, search_for_interval)
14182 (inc_interval_count, count_intervals, root_interval)
14183 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14184 * lread.c (defalias): Likewise.
14185 * ralloc.c (r_alloc_check): Likewise.
14186 * regex.c (set_image_of_range_1, set_image_of_range)
14187 (regex_grow_registers): Likewise.
14188 * sysdep.c (strerror): Likewise.
14189 * termcap.c (valid_filename_p, tprint, main): Likewise.
14190 * tparam.c (main): Likewise.
14191 * unexhp9k800.c (run_time_remap, save_data_space)
14192 (update_file_ptrs, read_header, write_header, calculate_checksum)
14193 (copy_file, copy_rest, display_header): Likewise.
14194 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14195 Likewise.
14196 * xdisp.c (check_it): Likewise.
14197 * xfaces.c (register_color, unregister_color, unregister_colors):
14198 Likewise.
14199 * xfns.c (print_fontset_result): Likewise.
14200 * xrdb.c (member, fatal, main): Likewise.
14201
14202 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14203
14204 Fix minor problems found by static checking (Bug#9031).
14205 * chartab.c (char_table_set_range, map_sub_char_table):
14206 Remove unused locals.
14207 (uniprop_table): Now static.
14208 * composite.c (_work_char): Remove unused static var.
14209
14210 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14211
14212 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14213
14214 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14215
14216 * gtkutil.c (qttip_cb): Remove code without function.
14217
14218 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14219
14220 * w32.c (pthread_sigmask): New stub.
14221
14222 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14223
14224 Use pthread_sigmask, not sigprocmask (Bug#9010).
14225 sigprocmask is portable only for single-threaded applications, and
14226 Emacs can be multi-threaded when it uses GTK.
14227 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14228 (LIBES): Use it.
14229 * callproc.c (Fcall_process):
14230 * process.c (create_process):
14231 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14232 Use pthread_sigmask, not sigprocmask.
14233
14234 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14235
14236 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14237 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14238 wrong (Bug#8591).
14239
14240 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14241
14242 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14243 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14244 (xg_hide_tooltip): Fix comment.
14245
14246 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14247 in registerServicesMenuSendTypes.
14248 (validRequestorForSendType): Don't check ns_return_types.
14249
14250 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14251 ns_return_type.
14252
14253 2011-07-08 Jason Rumney <jasonr@gnu.org>
14254
14255 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14256 SH_SHOW for hidden windows (Bug#5482).
14257
14258 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14259 frame struct members of non-existent frames (Bug#6284).
14260
14261 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14262
14263 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14264 variable firstTime not needed on OSX >= 10.6.
14265 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14266 >= 10.5. Use setKnobProportion, setDoubleValue.
14267
14268 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14269 (MAC_OS_X_VERSION_10_5): Define if not defined.
14270 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14271 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14272 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14273
14274 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14275 cString and lossyCString on OSX >= 10.4.
14276
14277 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14278 sizeToFit on OSX >= 10.2.
14279
14280 * nsimage.m (allocInitFromFile): Don't use deprecated method
14281 bestRepresentationForDevice on OSX >= 10.6.
14282
14283 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14284 to avoid warning.
14285
14286 * emacs.c: Declare unexec_init_emacs_zone.
14287
14288 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14289
14290 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14291
14292 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14293 on svcsMenu (Bug#8842).
14294
14295 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14296 ns_return_types.
14297 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14298
14299 * nsterm.m (QUTF8_STRING): Declare.
14300 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14301 (validRequestorForSendType): Return type is (id).
14302 Change indexOfObjectIdenticalTo to indexOfObject.
14303 Check if we have local selection before returning self (Bug#8842).
14304 (writeSelectionToPasteboard): Put local selection into paste board
14305 if we have a local selection (Bug#8842).
14306 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14307
14308 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14309 (ns_get_local_selection): Declare.
14310
14311 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14312
14313 * keymap.c (describe_map_tree): Don't insert a double newline at
14314 the end of the buffer (bug#1169) and return whether we inserted
14315 something.
14316
14317 * callint.c (Fcall_interactively): Change "reading args" to
14318 "providing args" to try to clarify what it does (bug#1010).
14319
14320 2011-07-07 Kenichi Handa <handa@m17n.org>
14321
14322 * composite.c (composition_compute_stop_pos): Ignore a static
14323 composition starting before CHARPOS (Bug#8915).
14324
14325 * xdisp.c (handle_composition_prop): Likewise.
14326
14327 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14328
14329 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14330 (Bug#9015)
14331
14332 2011-07-07 Kenichi Handa <handa@m17n.org>
14333
14334 * character.h (unicode_category_t): New enum type.
14335
14336 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14337 (Qchar_code_property_table): New variable.
14338 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14339 (UNIPROP_COMPRESSED_FORM_P): New macros.
14340 (char_table_ascii): Uncompress the compressed values.
14341 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14342 Uncompress the compressed values.
14343 (sub_char_table_ref_and_range): Likewise.
14344 (char_table_ref_and_range): Uncompress the compressed values.
14345 (sub_char_table_set): New arg is_uniprop. Callers changed.
14346 Uncompress the compressed values.
14347 (sub_char_table_set_range): Args changed. Callers changed.
14348 (char_table_set_range): Adjuted for the above change.
14349 (map_sub_char_table): Delete args default_val and parent. Add arg
14350 top. Give decoded values to a Lisp function.
14351 (map_char_table): Adjust for the above change. Give decoded
14352 values to a Lisp function. Gcpro more variables.
14353 (uniprop_table_uncompress)
14354 (uniprop_decode_value_run_length): New functions.
14355 (uniprop_decoder, uniprop_decoder_count): New variables.
14356 (uniprop_get_decoder, uniprop_encode_value_character)
14357 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14358 New functions.
14359 (uniprop_encoder, uniprop_encoder_count): New variables.
14360 (uniprop_get_encoder, uniprop_table)
14361 (Funicode_property_table_internal, Fget_unicode_property_internal)
14362 (Fput_unicode_property_internal): New functions.
14363 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14364 Sunicode_property_table_internal, Sget_unicode_property_internal,
14365 and Sput_unicode_property_internal. Defvar_lisp
14366 char-code-property-alist.
14367
14368 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14369 Vunicode_category_table.
14370
14371 * font.c (font_range): Adjust for the change of
14372 Vunicode_category_table.
14373
14374 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14375
14376 * m/iris4d.h: Remove file, move contents ...
14377 * s/irix6-5.h: ... here.
14378
14379 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14380
14381 Remove unportable assumption about struct layout (Bug#8884).
14382 * alloc.c (mark_buffer):
14383 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14384 (clone_per_buffer_values): Don't assume that
14385 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14386 This isn't true in general, and it's particularly not true
14387 if Emacs is configured with --with-wide-int.
14388 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14389 New macros, used in the buffer.c change.
14390
14391 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14392
14393 * xsettings.c: Use both GConf and GSettings if both are available.
14394 (store_config_changed_event): Add comment.
14395 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14396 (store_tool_bar_style_changed): New functions.
14397 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14398 (struct xsettings): Move font inside HAVE_XFT.
14399 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14400 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14401 Move inside HAVE_XFT.
14402 (something_changed_gsettingsCB): Rename from something_changedCB.
14403 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14404 also.
14405 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14406 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14407 (something_changed_gconfCB): Rename from something_changedCB.
14408 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14409 (parse_settings): Move check for font inside HAVE_XFT.
14410 (read_settings, apply_xft_settings): Add comment.
14411 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14412 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14413 call store_font_name_changed.
14414 (xft_settings_event): Add comment.
14415 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14416 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14417 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14418 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14419 (xsettings_initialize): Call init_gsettings last.
14420 (xsettings_get_system_font, xsettings_get_system_normal_font):
14421 Add comment.
14422
14423 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14424
14425 Random fixes. E.g., (random) never returned negative values.
14426 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14427 subseconds part to the entropy, as that's a bit more random.
14428 Prefer signed to unsigned, since the signedness doesn't matter and
14429 in general we prefer signed. When given a limit, use a
14430 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14431 latter isn't right if USE_2_TAGS_FOR_INTS.
14432 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14433 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14434
14435 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14436
14437 * textprop.c (text_property_stickiness):
14438 Obey Vtext_property_default_nonsticky.
14439 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14440 * w32fns.c (syms_of_w32fns):
14441 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14442
14443 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14444
14445 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14446 This is more efficient than Ffile_directory_p and avoids a minor race.
14447
14448 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14449
14450 * buffer.c (Foverlay_put): Say what the return value is
14451 (bug#7835).
14452
14453 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14454 is a directory before asking whether to use the file name
14455 (bug#7564).
14456 (barf_or_query_if_file_exists): Make the "File is a directory"
14457 error be more correct.
14458
14459 * fns.c (Frequire): Remove the mention of the .gz files, since
14460 that's installation-specific, but keep the mention of
14461 `get-load-suffixes'.
14462
14463 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14464
14465 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14466 Report string overflow if the output is too long.
14467
14468 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14469
14470 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14471 (syms_of_gnutls): Remove duplicate DEFSYM for
14472 Qgnutls_bootprop_verify_hostname_error, an error for
14473 Qgnutls_bootprop_verify_error (which is no longer used).
14474
14475 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14476 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14477 Also (re)move comments that are misplaced or no longer relevant.
14478
14479 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14480
14481 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14482
14483 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14484
14485 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14486 and background color parameters if they have been changed.
14487
14488 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14489
14490 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14491
14492 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14493
14494 * xsettings.c (SYSTEM_FONT): Define only when used.
14495 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14496
14497 * keymap.c (access_keymap_1): Now static.
14498
14499 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14500
14501 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14502 leave any prefix arg for the up event (Bug#1586).
14503
14504 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14505
14506 * lread.c (syms_of_lread): Mention single symbols defined by
14507 `defvar' or `defconst' (bug#7154).
14508
14509 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14510 (Frequire): Mention get-load-suffixes.
14511
14512 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14513
14514 * window.h (window): Remove clone_number slot.
14515 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14516 Remove.
14517 (make_parent_window, make_window, saved_window)
14518 (Fset_window_configuration, save_window_save): Don't deal with
14519 clone numbers.
14520 * buffer.c (Qclone_number): Remove declaration.
14521 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14522
14523 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14524
14525 Add multiple inheritance to keymaps.
14526 * keymap.c (Fmake_composed_keymap): New function.
14527 (Fset_keymap_parent): Simplify.
14528 (fix_submap_inheritance): Remove.
14529 (access_keymap_1): New function extracted from access_keymap to handle
14530 embedded parents and handle lists of maps.
14531 (access_keymap): Use it.
14532 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14533 (Fcopy_keymap): Handle embedded parents.
14534 (Fcommand_remapping, define_as_prefix): Simplify.
14535 (Fkey_binding): Simplify.
14536 (syms_of_keymap): Move minibuffer-local-completion-map,
14537 minibuffer-local-filename-completion-map,
14538 minibuffer-local-must-match-map, and
14539 minibuffer-local-filename-must-match-map to Elisp.
14540 (syms_of_keymap): Defsubr make-composed-keymap.
14541 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14542 (parse_menu_item): Trivial simplification.
14543
14544 2011-07-01 Glenn Morris <rgm@gnu.org>
14545
14546 * Makefile.in (SETTINGS_LIBS): Fix typo.
14547
14548 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14549
14550 * coding.c (Fencode_coding_string): Record the last coding system
14551 used, as the function doc string says (bug#8738).
14552
14553 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14554
14555 * xsettings.c (store_monospaced_changed): Take new font as arg and
14556 check for change against current_mono_font.
14557 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14558 (emacs_settings_constructor, emacs_settings_get_property)
14559 (emacs_settings_set_property, emacs_settings_class_init)
14560 (emacs_settings_init, gsettings_obj): Remove.
14561 (something_changedCB): New function for HAVE_GSETTINGS.
14562 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14563 with value as argument.
14564 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14565 g_settings_new (Bug#8967). Do not create gsettings_obj.
14566 Remove calls to g_settings_bind. Connect something_changedCB to
14567 "changed".
14568
14569 * xgselect.c: Add defined (HAVE_GSETTINGS).
14570 (xgselect_initialize): Ditto.
14571
14572 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14573 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14574 xg_select.
14575
14576 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14577
14578 * eval.c (struct backtrace): Simplify and port the data structure.
14579 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14580 signed bit field, as this assumption is not portable and it makes
14581 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14582 "char debug_on_exit : 1" as this is not portable either; instead,
14583 use the portable "unsigned int debug_on_exit : 1". Remove unused
14584 member evalargs. Remove obsolete comments about cc bombing out.
14585
14586 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14587
14588 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14589 Let HAVE_GSETTINGS override HAVE_GCONF.
14590 (store_monospaced_changed): New function.
14591 (EMACS_SETTINGS): A new type derived from GObject to handle
14592 GSettings notifications.
14593 (emacs_settings_constructor, emacs_settings_get_property)
14594 (emacs_settings_set_property, emacs_settings_class_init):
14595 New functions.
14596 (gsettings_client, gsettings_obj): New variables.
14597 (GSETTINGS_SCHEMA): New define.
14598 (something_changedCB): Call store_monospaced_changed.
14599 (init_gsettings): New function.
14600 (xsettings_initialize): Call init_gsettings.
14601 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14602 to NULL.
14603
14604 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14605 GCONF_CFLAGS/LIBS.
14606
14607 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14608
14609 * window.c (resize_root_window, grow_mini_window)
14610 (shrink_mini_window): Rename Qresize_root_window to
14611 Qwindow_resize_root_window and Qresize_root_window_vertically to
14612 Qwindow_resize_root_window_vertically.
14613
14614 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14615
14616 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14617
14618 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14619
14620 * makefile.w32-in: Redesign dependencies so they reflect more
14621 clearly which files are directly included by each source file,
14622 and not through other includes.
14623
14624 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14625
14626 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14627 (sort_overlays, overlay_strings): When an overlay's clone number
14628 matches the window's clone number process the overlay even if
14629 the overlay's window property doesn't match the current window.
14630
14631 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14632 (Fwindow_hchild): Rename to Fwindow_left_child.
14633 (Fwindow_next): Rename to Fwindow_next_sibling.
14634 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14635 (resize_window_check): Rename to window_resize_check.
14636 (resize_window_apply): Rename to window_resize_apply.
14637 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14638 (Fdelete_other_windows_internal, resize_frame_windows)
14639 (Fsplit_window_internal, Fdelete_window_internal)
14640 (grow_mini_window, shrink_mini_window)
14641 (Fresize_mini_window_internal): Fix callers accordingly.
14642
14643 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14644
14645 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14646 (emacs_fixed_set_min_size): Remove.
14647 (emacs_fixed_new): Take frame as argument.
14648
14649 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14650 (_EmacsFixedPrivate): Remove minwidth/height.
14651 Add struct frame *f.
14652 (emacs_fixed_init): Initialize priv->f.
14653 (get_parent_class, emacs_fixed_set_min_size): Remove.
14654 (emacs_fixed_new): Set priv->f to argument.
14655 (emacs_fixed_get_preferred_width)
14656 (emacs_fixed_get_preferred_height): Use min_width/height from
14657 frames size_hint to set minimum and natural (Bug#8919).
14658 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14659 and use min_width/height from frames size_hint to set
14660 min_width/height (Bug#8919).
14661
14662 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14663 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14664 Fix indentation.
14665
14666 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14667
14668 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14669 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14670 called at ZV.
14671
14672 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14673
14674 * process.c (wait_reading_process_output): Bypass select if
14675 waiting for a cell while ignoring keyboard input, and input is
14676 pending. Suggested by Jan Djärv (Bug#8869).
14677
14678 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14679
14680 Use gnulib's dup2 module instead of rolling our own.
14681 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14682
14683 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14684
14685 * dispnew.c (scrolling_window): Before scrolling, turn off a
14686 mouse-highlight in the window being scrolled.
14687
14688 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14689
14690 Move DEFSYM to lisp.h and use everywhere.
14691
14692 * character.h (DEFSYM): Move declaration...
14693 * lisp.h (DEFSYM): ...here.
14694
14695 * gnutls.c:
14696 * minibuf.c:
14697 * w32menu.c:
14698 * w32proc.c:
14699 * w32select.c: Don't include character.h.
14700
14701 * alloc.c (syms_of_alloc):
14702 * buffer.c (syms_of_buffer):
14703 * bytecode.c (syms_of_bytecode):
14704 * callint.c (syms_of_callint):
14705 * casefiddle.c (syms_of_casefiddle):
14706 * casetab.c (init_casetab_once):
14707 * category.c (init_category_once, syms_of_category):
14708 * ccl.c (syms_of_ccl):
14709 * cmds.c (syms_of_cmds):
14710 * composite.c (syms_of_composite):
14711 * dbusbind.c (syms_of_dbusbind):
14712 * dired.c (syms_of_dired):
14713 * dispnew.c (syms_of_display):
14714 * doc.c (syms_of_doc):
14715 * editfns.c (syms_of_editfns):
14716 * emacs.c (syms_of_emacs):
14717 * eval.c (syms_of_eval):
14718 * fileio.c (syms_of_fileio):
14719 * fns.c (syms_of_fns):
14720 * frame.c (syms_of_frame):
14721 * fringe.c (syms_of_fringe):
14722 * insdel.c (syms_of_insdel):
14723 * keymap.c (syms_of_keymap):
14724 * lread.c (init_obarray, syms_of_lread):
14725 * macros.c (syms_of_macros):
14726 * msdos.c (syms_of_msdos):
14727 * print.c (syms_of_print):
14728 * process.c (syms_of_process):
14729 * search.c (syms_of_search):
14730 * sound.c (syms_of_sound):
14731 * syntax.c (init_syntax_once, syms_of_syntax):
14732 * terminal.c (syms_of_terminal):
14733 * textprop.c (syms_of_textprop):
14734 * undo.c (syms_of_undo):
14735 * w32.c (globals_of_w32):
14736 * window.c (syms_of_window):
14737 * xdisp.c (syms_of_xdisp):
14738 * xfaces.c (syms_of_xfaces):
14739 * xfns.c (syms_of_xfns):
14740 * xmenu.c (syms_of_xmenu):
14741 * xsettings.c (syms_of_xsettings):
14742 * xterm.c (syms_of_xterm): Use DEFSYM.
14743
14744 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14745
14746 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14747
14748 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14749
14750 Integer and buffer overflow fixes (Bug#8873).
14751
14752 * print.c (printchar, strout): Check for string overflow.
14753 (PRINTPREPARE, printchar, strout):
14754 Don't set size unless allocation succeeds.
14755
14756 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14757 for sizes. Check for string overflow more accurately.
14758 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14759
14760 * macros.c: Integer and buffer overflow fixes.
14761 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14762 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14763 Use ptrdiff_t, not int, for sizes.
14764 Don't increment bufsize until after realloc succeeds.
14765 Check for size-calculation overflow.
14766 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14767
14768 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14769
14770 * lread.c: Integer overflow fixes.
14771 (read_integer): Radix is now EMACS_INT, not int,
14772 to improve quality of diagnostics for out-of-range radices.
14773 Calculate buffer size correctly for out-of-range radices.
14774 (read1): Check for integer overflow in radices, and in
14775 read-circle numbers.
14776 (read_escape): Avoid int overflow.
14777 (Fload, openp, read_buffer_size, read1)
14778 (substitute_object_recurse, read_vector, read_list, map_obarray):
14779 Use ptrdiff_t, not int, for sizes.
14780 (read1): Use EMACS_INT, not int, for sizes.
14781 Check for size overflow.
14782
14783 * image.c (cache_image): Check for size arithmetic overflow.
14784
14785 * lread.c: Integer overflow issues.
14786 (saved_doc_string_size, saved_doc_string_length)
14787 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14788 Now ptrdiff_t, not int.
14789 (read1): Don't assume doc string length fits in int. Check for
14790 out-of-range doc string lengths.
14791 (read_list): Don't assume file position fits in int.
14792 (read_escape): Check for hex character overflow.
14793
14794 2011-06-22 Leo Liu <sdl.web@gmail.com>
14795
14796 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14797 Move to minibuffer.el.
14798
14799 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14800
14801 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14802 The following patches are for when GLYPH_DEBUG && !XASSERT.
14803 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14804 * dispnew.c (flush_stdout):
14805 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14806 Mark as externally visible.
14807 * dispnew.c (check_window_matrix_pointers): Now static.
14808 * dispnew.c (window_to_frame_vpos):
14809 * xfns.c (unwind_create_frame):
14810 * xterm.c (x_check_font): Remove unused local.
14811 * scroll.c (CHECK_BOUNDS):
14812 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14813 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14814 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14815 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14816 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14817 Now static.
14818 (debug_method_add): Use va_list and vsprintf rather than relying
14819 on undefined behavior with wrong number of arguments.
14820 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14821 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14822 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14823 since we're not interested in debugging glyphs with old libraries.
14824 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14825 GCC 4.6.0's static checking.
14826
14827 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14828
14829 Integer overflow and signedness fixes (Bug#8873).
14830 A few related buffer overrun fixes, too.
14831
14832 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14833
14834 * dispextern.h (struct face.stipple):
14835 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14836 (x_bitmap_mask, x_allocate_bitmap_record)
14837 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14838 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14839 (x_create_bitmap_from_xpm_data):
14840 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14841 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14842 (.bitmaps_last):
14843 * xfaces.c (load_pixmap):
14844 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14845 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14846 (.bitmaps_last, struct x_output.icon_bitmap):
14847 Use ptrdiff_t, not int, for bitmap indexes.
14848 (x_allocate_bitmap_record): Check for size overflow.
14849 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14850
14851 Use ptrdiff_t, not int, for overlay counts.
14852 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14853 * editfns.c (overlays_around, get_pos_property):
14854 * textprop.c (get_char_property_and_overlay):
14855 * xdisp.c (next_overlay_change, note_mouse_highlight):
14856 * xfaces.c (face_at_buffer_position):
14857 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14858 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14859 (Fnext_overlay_change, Fprevious_overlay_change)
14860 (mouse_face_overlay_overlaps, Foverlays_in):
14861 Use ptrdiff_t, not int, for sizes.
14862 (overlays_at, overlays_in): Check for size-calculation overflow.
14863
14864 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14865
14866 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14867 (x_session_initialize): Do not assume string length fits in int.
14868
14869 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14870 This is unlikely, but can occur if DPI is outlandish.
14871
14872 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14873 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14874
14875 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14876 * xrdb.c (magic_file_p, search_magic_path):
14877 Omit last arg SUFFIX; it was always 0. All callers changed.
14878 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14879
14880 * xfont.c (xfont_match): Avoid need for strlen.
14881
14882 * xfns.c: Don't assume strlen fits in int.
14883 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14884
14885 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14886 not unsigned long, as we prefer signed integers. All callers changed.
14887 Detect integer overflow in repeat count.
14888 (message_dolog): Don't assume print length fits in 39 bytes.
14889 (display_mode_element): Don't assume strlen fits in int.
14890
14891 * termcap.c: Don't assume sizes fit in int and never overflow.
14892 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14893 (gobble_line): Check for size-calculation overflow.
14894
14895 * minibuf.c (Fread_buffer):
14896 * lread.c (intern, intern_c_string):
14897 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14898 Don't assume string length fits in int.
14899
14900 * keyboard.c (parse_tool_bar_item):
14901 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14902
14903 * font.c: Don't assume string length fits in int.
14904 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14905 Use ptrdiff_t, not int.
14906 (font_intern_prop): Don't assume string length fits in int.
14907 Don't assume integer property fits in fixnum.
14908 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14909
14910 * filelock.c: Fix some buffer overrun and integer overflow issues.
14911 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14912 Reformulate so as not to need the command string.
14913 Invoke gzip -cd rather than gunzip, as it's more portable.
14914 (lock_info_type, lock_file_1, lock_file):
14915 Don't assume pid_t and time_t fit in unsigned long.
14916 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14917 (current_lock_owner): Prefer signed type for sizes.
14918 Use memcpy, not strncpy, where memcpy is what is really wanted.
14919 Don't assume (via atoi) that time_t and pid_t fit in int.
14920 Check for time_t and/or pid_t out of range, e.g., via a network share.
14921 Don't alloca where an auto var works fine.
14922
14923 * fileio.c: Fix some integer overflow issues.
14924 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14925 Don't assume string length fits in int.
14926 (directory_file_name): Don't assume string length fits in long.
14927 (make_temp_name): Don't assume pid fits in int, or that its print
14928 length is less than 20.
14929
14930 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14931
14932 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14933
14934 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14935
14936 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14937 We prefer signed integers, even for size calculations.
14938
14939 * emacs.c: Don't assume string length fits in 'int'.
14940 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14941 (main): Don't invoke strlen when not needed.
14942
14943 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14944 (XD_DEBUG_MESSAGE): Don't waste a byte.
14945
14946 * callproc.c (getenv_internal_1, getenv_internal)
14947 (Fgetenv_internal):
14948 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14949
14950 * lread.c (invalid_syntax): Omit length argument.
14951 All uses changed. This doesn't fix a bug, but it simplifies the
14952 code away from its former Hollerith-constant appearance, and it's
14953 one less 'int' to worry about when looking at integer-overflow issues.
14954 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14955
14956 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14957 This didn't break anything, but it didn't help either.
14958 It's confusing to put a bogus integer in a place where the actual
14959 value does not matter.
14960 (LIST_END_P): Remove unused macro and its bogus comment.
14961 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14962
14963 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14964 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14965 implementation.
14966 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14967 We prefer signed types, and the value cannot exceed the EMACS_INT
14968 range anyway (because otherwise the length would not be representable).
14969 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14970 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14971 This avoids a GCC warning when WIDE_EMACS_INT.
14972
14973 * indent.c (sane_tab_width): New function.
14974 (current_column, scan_for_column, Findent_to, position_indentation)
14975 (compute_motion): Use it. This is just for clarity.
14976 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14977
14978 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14979
14980 * lisp.h (lint_assume): New macro.
14981 * composite.c (composition_gstring_put_cache):
14982 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14983
14984 * editfns.c, insdel.c:
14985 Omit unnecessary forward decls, to simplify future changes.
14986
14987 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14988
14989 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14990
14991 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14992 Use much-faster test for byte-length change.
14993 Don't assume string byte-length fits in 'int'.
14994 Check that character arg fits in 'int'.
14995 (mapcar1): Declare byte as byte, for clarity.
14996
14997 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14998
14999 * fns.c (concat): Catch string overflow earlier.
15000 Do not rely on integer wraparound.
15001
15002 * dispextern.h (struct it.overlay_strings_charpos)
15003 (struct it.selective): Now EMACS_INT, not int.
15004 * xdisp.c (forward_to_next_line_start)
15005 (back_to_previous_visible_line_start)
15006 (reseat_at_next_visible_line_start, next_element_from_buffer):
15007 Don't arbitrarily truncate the value of 'selective' to int.
15008
15009 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15010
15011 * composite.c: Don't truncate sizes to 'int'.
15012 (composition_gstring_p, composition_reseat_it)
15013 (composition_adjust_point): Use EMACS_INT, not int.
15014 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15015 not EMACS_UINT, for indexes.
15016
15017 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15018
15019 * buffer.c: Include <verify.h>.
15020 (struct sortvec.priority, struct sortstr.priority):
15021 Now EMACS_INT, not int.
15022 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15023 (struct sortstr.size, record_overlay_string)
15024 (struct sortstrlist.size, struct sortlist.used):
15025 Don't truncate size to int.
15026 (record_overlay_string): Check for size-calculation overflow.
15027 (init_buffer_once): Check at compile-time, not run-time.
15028
15029 2011-06-22 Jim Meyering <meyering@redhat.com>
15030
15031 Don't leak an XBM-image-sized buffer
15032 * image.c (xbm_load): Free the image buffer after using it.
15033
15034 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15035
15036 Port to Sun C.
15037 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15038 that Sun C diagnosed.
15039 * fns.c (secure_hash): Fix pointer signedness issue.
15040 * intervals.c (static_offset_intervals): New function.
15041 (offset_intervals): Use it.
15042
15043 2011-06-21 Leo Liu <sdl.web@gmail.com>
15044
15045 * deps.mk (fns.o):
15046 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15047 sha512.h.
15048
15049 * fns.c (secure_hash): Rename from crypto_hash_function and change
15050 the first arg to accept symbols.
15051 (Fsecure_hash): New primitive.
15052 (syms_of_fns): New symbols.
15053
15054 2011-06-20 Deniz Dogan <deniz@dogan.se>
15055
15056 * process.c (Fset_process_buffer): Clarify return value in
15057 docstring.
15058
15059 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15060
15061 * dispnew.c (add_window_display_history): Use BVAR.
15062
15063 * xdisp.c (debug_method_add): Use BVAR.
15064 (check_window_end, dump_glyph_matrix, dump_glyph)
15065 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15066
15067 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15068 Likewise.
15069
15070 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15071 check till after the cache is created in init_frame_faces.
15072
15073 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15074
15075 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15076
15077 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15078
15079 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15080 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15081 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15082
15083 Improve buffer-overflow checking (Bug#8873).
15084 * fileio.c (Finsert_file_contents):
15085 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15086 Remove the old (too-loose) buffer overflow checks.
15087 They weren't needed, since make_gap checks for buffer overflow.
15088 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15089 The old code merely checked for Emacs fixnum overflow, and relied
15090 on undefined (wraparound) behavior. The new code avoids undefined
15091 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15092
15093 * editfns.c (Finsert_char): Don't dump core with very negative counts.
15094 Tune. Don't use wider integers than needed. Don't use alloca.
15095 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
15096
15097 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15098
15099 * insdel.c, lisp.h (buffer_overflow): New function.
15100 (insert_from_buffer_1, replace_range, replace_range_2):
15101 * insdel.c (make_gap_larger):
15102 * editfns.c (Finsert_char):
15103 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15104
15105 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15106
15107 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
15108
15109 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15110
15111 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15112 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15113
15114 * fileio.c: Don't assume EMACS_INT fits in off_t.
15115 (emacs_lseek): New static function.
15116 (Finsert_file_contents, Fwrite_region): Use it.
15117 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15118
15119 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15120
15121 * fns.c: Don't overflow int when computing a list length.
15122 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15123 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15124 truncation on 64-bit hosts. Check for QUIT every
15125 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15126 faster and is responsive enough.
15127 (Flength): Report an error instead of overflowing an integer.
15128 (Fsafe_length): Return a float if the value is not representable
15129 as a fixnum. This shouldn't happen except in contrived situations.
15130 (Fnthcdr, Fsort): Don't assume list length fits in int.
15131 (Fcopy_sequence): Don't assume vector length fits in int.
15132
15133 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15134 (header_size, word_size): New constants.
15135 (allocate_vectorlike): Don't check size overflow here.
15136 (allocate_vector): Check it here instead, since this is the only
15137 caller of allocate_vectorlike that could cause overflow.
15138 Check that the new vector's length is representable as a fixnum.
15139
15140 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15141 The previous code was bogus. For example, next_almost_prime (32)
15142 returned 39, which is undesirable as it is a multiple of 3; and
15143 next_almost_prime (24) returned 25, which is a multiple of 5 so
15144 why was the code bothering to check for multiples of 7?
15145
15146 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15147
15148 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15149
15150 Variadic C functions now count arguments with ptrdiff_t.
15151 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15152 Back then I didn't know that the Emacs coding style prefers signed int.
15153 Also, in the meantime I found a few more instances where arguments
15154 were being counted with int, which may truncate counts on 64-bit
15155 machines, or EMACS_INT, which may be unnecessarily wide.
15156 * lisp.h (struct Lisp_Subr.function.aMANY)
15157 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15158 Arg counts are now ptrdiff_t, not size_t.
15159 All variadic functions and their callers changed accordingly.
15160 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15161 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15162 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15163 * callint.c (Fcall_interactively): Check arg count for overflow,
15164 to avoid potential buffer overrun. Use signed char, not 'int',
15165 for 'varies' array, so that we needn't bother to check its size
15166 calculation for overflow.
15167 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15168 * eval.c (apply_lambda):
15169 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15170 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15171 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15172
15173 * callint.c (Fcall_interactively): Don't use index var as event count.
15174
15175 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15176 * mem-limits.h (SIZE): Remove; no longer used.
15177
15178 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15179
15180 Remove unnecessary casts.
15181 * xterm.c (x_term_init):
15182 * xfns.c (x_set_border_pixel):
15183 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15184 These aren't needed now that we assume ANSI C.
15185
15186 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15187 It's more likely to cause problems (due to unsigned overflow)
15188 than to cure them.
15189
15190 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15191
15192 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15193
15194 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15195
15196 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15197
15198 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15199
15200 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15201
15202 GLYPH_CODE_FACE returns EMACS_INT, not int.
15203 * dispextern.h (merge_faces):
15204 * xfaces.c (merge_faces):
15205 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15206 Don't assume EMACS_INT fits in int.
15207
15208 * character.h (CHAR_VALID_P): Remove unused parameter.
15209 * fontset.c, lisp.h, xdisp.c: All uses changed.
15210
15211 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15212
15213 * fns.c (concat): Minor tuning based on overflow analysis.
15214 This doesn't fix any bugs. Use int to hold character, instead
15215 of constantly refetching from Emacs object. Use XFASTINT, not
15216 XINT, for value known to be a character. Don't bother comparing
15217 a single byte to 0400, as it's always less.
15218
15219 * floatfns.c (Fexpt):
15220 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15221
15222 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15223 for characters.
15224
15225 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15226
15227 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15228 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15229 incorrectly succeed when S was a string, because 4294967386 was
15230 truncated before it was used.
15231
15232 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15233 Otherwise, an out-of-range integer could cause undefined behavior
15234 on a 64-bit host.
15235
15236 * composite.c: Use int, not EMACS_INT, for characters.
15237 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15238 EMACS_INT, for values that are known to be in character range.
15239 This doesn't fix any bugs but is the usual style inside Emacs and
15240 may generate better code on 32-bit machines.
15241
15242 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15243 This is for reasons similar to the recent CHAR_STRING fix.
15244 * charset.c (Fencode_char): Check that character arg is actually
15245 a character. Pass an int to ENCODE_CHAR.
15246 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15247 wider than 'int', as a compile-time check to prevent future regressions
15248 in this area.
15249
15250 * character.c (char_string): Remove unnecessary casts.
15251
15252 Make sure a 64-bit char is never passed to CHAR_STRING.
15253 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15254 by silently ignoring the top 32 bits, allowing some values
15255 that were far too large to be valid characters.
15256 * character.h: Include <verify.h>.
15257 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15258 arguments are no wider than unsigned, as a compile-time check
15259 to prevent future regressions in this area.
15260 * data.c (Faset):
15261 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15262 (Fsubst_char_in_region):
15263 * fns.c (concat):
15264 * xdisp.c (decode_mode_spec_coding):
15265 Adjust to CHAR_STRING's new requirement.
15266 * editfns.c (Finsert_char, Fsubst_char_in_region):
15267 * fns.c (concat): Check that character args are actually
15268 characters. Without this test, these functions did the wrong
15269 thing with wildly out-of-range values on 64-bit hosts.
15270
15271 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15272 These casts should not be needed on 32-bit hosts, either.
15273 * keyboard.c (read_char):
15274 * lread.c (Fload): Remove casts to unsigned.
15275
15276 * lisp.h (UNSIGNED_CMP): New macro.
15277 This fixes comparison bugs on 64-bit hosts.
15278 (ASCII_CHAR_P): Use it.
15279 * casefiddle.c (casify_object):
15280 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15281 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15282 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15283 * dispextern.h (FACE_FROM_ID):
15284 * keyboard.c (read_char): Use UNSIGNED_CMP.
15285
15286 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15287 not to EMACS_INT, to avoid GCC warning.
15288
15289 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15290
15291 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15292 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15293 isn't needed on 32-bit machines.
15294
15295 * buffer.c (Fgenerate_new_buffer_name):
15296 Use EMACS_INT for count, not int.
15297 (advance_to_char_boundary): Return EMACS_INT, not int.
15298
15299 * data.c (Qcompiled_function): Now static.
15300
15301 * window.c (window_body_lines): Now static.
15302
15303 * image.c (gif_load): Rename local to avoid shadowing.
15304
15305 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15306 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15307 * alloc.c (make_save_value): Integer argument is now of type
15308 ptrdiff_t, not int.
15309 (mark_object): Use ptrdiff_t, not int.
15310 * lisp.h (pD): New macro.
15311 * print.c (print_object): Use it.
15312
15313 * alloc.c: Use EMACS_INT, not int, to count objects.
15314 (total_conses, total_markers, total_symbols, total_vector_size)
15315 (total_free_conses, total_free_markers, total_free_symbols)
15316 (total_free_floats, total_floats, total_free_intervals)
15317 (total_intervals, total_strings, total_free_strings):
15318 Now EMACS_INT, not int. All uses changed.
15319 (Fgarbage_collect): Compute overall total using a double, so that
15320 integer overflow is less likely to be a problem. Check for overflow
15321 when converting back to an integer.
15322 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15323 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15324 These were 'int' variables that could overflow on 64-bit hosts;
15325 they were never used, so remove them instead of repairing them.
15326 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15327 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15328 Previously, this ceilinged at INT_MAX, but that doesn't work on
15329 64-bit machines.
15330 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15331
15332 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15333 (allocate_vectorlike): Check for ptrdiff_t overflow.
15334 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15335 when a (possibly-narrower) signed value would do just as well.
15336 We prefer using signed arithmetic, to avoid comparison confusion.
15337
15338 * alloc.c: Catch some string size overflows that we were missing.
15339 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15340 for convenience in STRING_BYTES_MAX.
15341 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15342 The definition here is exact; the one in lisp.h was approximate.
15343 (allocate_string_data): Check for string overflow. This catches
15344 some instances we weren't catching before. Also, it catches
15345 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15346 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15347 and ptrdiff_t and EMACS_INT are both 64 bits.
15348
15349 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15350 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15351 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15352
15353 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15354
15355 * alloc.c (Fmake_string): Check for out-of-range init.
15356
15357 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15358
15359 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15360
15361 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15362
15363 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15364 xg_get_default_scrollbar_width.
15365
15366 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15367 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15368 (style_changed_cb): Call update_theme_scrollbar_width and call
15369 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15370 all frames (Bug#8505).
15371 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15372 Call gtk_window_set_resizable if HAVE_GTK3.
15373 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15374 and height if HAVE_GTK3 (Bug#8505).
15375 (scroll_bar_width_for_theme): New variable.
15376 (update_theme_scrollbar_width): New function.
15377 (xg_get_default_scrollbar_width): Move code to
15378 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15379 (xg_initialize): Call update_theme_scrollbar_width.
15380
15381 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15382
15383 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15384
15385 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15386
15387 * frame.c (make_frame): Call other_buffer_safely instead of
15388 other_buffer.
15389
15390 * window.c (temp_output_buffer_show): Call display_buffer with
15391 second argument Vtemp_buffer_show_specifiers and reset latter
15392 immediately after the call.
15393 (Vtemp_buffer_show_specifiers): New variable.
15394 (auto_window_vscroll_p, next_screen_context_lines)
15395 (Vscroll_preserve_screen_position): Remove leading asterisks from
15396 doc-strings.
15397
15398 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15399
15400 Fix minor problems found by GCC 4.6.0 static checking.
15401 * buffer.c (Qclone_number): Remove for now, as it's unused.
15402 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15403 (record_buffer): Remove unused local.
15404 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15405 (set_frame_buffer_list): Remove; unused.
15406 * frame.h (other_visible_frames): Remove decl.
15407 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15408 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15409 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15410 if HAVE_GPM.
15411 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15412 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15413 Define only if HAVE_GPM.
15414 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15415 (update_hints_inhibit): Remove; never set. All uses removed.
15416 * widgetprv.h (emacsFrameClassRec): Remove decl.
15417 * window.c (delete_deletable_window): Now returns void, since it
15418 wasn't returning anything.
15419 (compare_window_configurations): Remove unused locals.
15420 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15421 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15422 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15423 the same widths as pointers. This follows up on the 2011-05-06 patch.
15424 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15425 * xterm.h: Likewise.
15426 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15427
15428 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15429
15430 * makefile.w32-in: Update dependencies.
15431 (LISP_H): Add lib/intprops.h.
15432
15433 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15434
15435 * image.c (gif_load): Add animation frame delay to the metadata.
15436 (syms_of_image): Use DEFSYM. New symbol `delay'.
15437
15438 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15439
15440 * window.c (delete_deletable_window): Re-add.
15441 (Fset_window_configuration): Rewrite to handle dead buffers and
15442 consequently deletable windows.
15443 (window_tree, Fwindow_tree): Remove. Supply functionality in
15444 window.el.
15445 (compare_window_configurations): Simplify code.
15446
15447 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15448
15449 * image.c (imagemagick_load_image): Fix type mismatch.
15450 (Fimagemagick_types): Likewise.
15451
15452 * window.h (replace_buffer_in_windows): Declare.
15453
15454 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15455
15456 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15457 Qclone_number. Remove external declaration of Qdelete_window.
15458 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15459 code.
15460 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15461 Run Qbuffer_list_update_hook if allowed.
15462 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15463 buffer list implementation.
15464 (other_buffer_safely): New function.
15465 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15466 calls to replace_buffer_in_windows and
15467 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15468 if allowed.
15469 (record_buffer): Inhibit quitting and rewrite using quittable
15470 functions. Run Qbuffer_list_update_hook if allowed.
15471 (Frecord_buffer, Funrecord_buffer): New functions.
15472 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15473 Move switch-to-buffer to window.el.
15474 (bury-buffer): Move to window.el.
15475 (Vbuffer_list_update_hook): New variable.
15476
15477 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15478 section.
15479
15480 * window.h (resize_frame_windows): Move up in code.
15481 (Fwindow_frame): Remove EXFUN.
15482 (replace_buffer_in_all_windows): Remove prototype.
15483 (replace_buffer_in_windows_safely): Add prototype.
15484
15485 * window.c: Declare Qdelete_window static again. Move down
15486 declaration of select_count.
15487 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15488 (Fother_window): Move to window.el.
15489 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15490 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15491 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15492 window.el.
15493 (replace_buffer_in_windows): Implement by calling
15494 Qreplace_buffer_in_windows.
15495 (replace_buffer_in_all_windows): Remove with some functionality
15496 moved into replace_buffer_in_windows_safely.
15497 (replace_buffer_in_windows_safely): New function.
15498 (select_window_norecord, select_frame_norecord): Move in front
15499 of run_window_configuration_change_hook. Remove now obsolete
15500 declarations.
15501 (Fset_window_buffer): Rewrite doc-string.
15502 Call Qrecord_window_buffer.
15503 (keys_of_window): Move binding for other-window to window.el.
15504
15505 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15506
15507 * dispextern.h (struct image): Replace data member, whose int_val
15508 and ptr_val fields were not used by anything, with a single
15509 lisp_val object.
15510
15511 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15512 (gif_clear_image, gif_load, imagemagick_load_image)
15513 (gs_clear_image, gs_load): Callers changed.
15514
15515 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15516
15517 * buffer.h: Include <time.h>, for time_t.
15518 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15519
15520 Fix minor problems found by static checking.
15521
15522 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15523
15524 Make identifiers static if they are not used in other modules.
15525 * data.c (Qcompiled_function, Qframe, Qvector):
15526 * image.c (QimageMagick, Qsvg):
15527 * minibuf.c (Qmetadata):
15528 * window.c (resize_window_check, resize_root_window): Now static.
15529 * window.h (resize_window_check, resize_root_window): Remove decls.
15530
15531 * window.c (window_deletion_count, delete_deletable_window):
15532 Remove; unused.
15533 (window_body_lines): Now static.
15534 (Fdelete_other_windows_internal): Mark vars as initialized.
15535 Make sure 'resize_failed' is initialized.
15536 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15537 (resize_window_apply): Remove unused local.
15538 * window.h (delete_deletable_window): Remove decl.
15539
15540 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15541 (imagemagick_load_image): Fix pointer signedness problem by changing
15542 last arg from unsigned char * to char *. All uses changed.
15543 Also, fix a local for similar reasons.
15544 Remove unused locals. Remove locals to avoid shadowing.
15545 (fn_rsvg_handle_free): Remove; unused.
15546 (svg_load, svg_load_image): Fix pointer signedness problem.
15547 (imagemagick_load_image): Don't use garbage pointer image_wand.
15548
15549 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15550
15551 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15552
15553 * image.c (gif_load): Fix omitted cast error introduced by
15554 2011-06-06 change.
15555
15556 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15557
15558 * window.h (resize_proportionally, orig_total_lines)
15559 (orig_top_line): Remove from window structure.
15560 (set_window_height, set_window_width, change_window_heights)
15561 (Fdelete_window): Remove prototypes.
15562 (resize_frame_windows): Remove duplicate declaration.
15563
15564 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15565
15566 * window.h (resize_frame_windows, resize_window_check)
15567 (delete_deletable_window, resize_root_window)
15568 (resize_frame_windows): Declare prototypes.
15569
15570 * window.c (resize_window_apply): Make definition be "static" to
15571 match the prototype.
15572
15573 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15574
15575 * window.c: Remove declarations of Qwindow_size_fixed,
15576 window_min_size_1, window_min_size_2, window_min_size,
15577 size_window, window_fixed_size_p, enlarge_window, delete_window.
15578 Remove static from declaration of Qdelete_window, it's
15579 temporarily needed by Fbury_buffer.
15580 (replace_window): Don't assign orig_top_line and
15581 orig_total_lines.
15582 (Fdelete_window, delete_window): Remove. Window deletion is
15583 handled by window.el.
15584 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15585 Replace Fdelete_window calls with calls to Qdelete_window.
15586 (Fdelete_other_windows): Remove. Deleting other windows is
15587 handled by window.el.
15588 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15589 handled in window.el.
15590 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15591 Window minimum sizes are handled in window.el.
15592 (shrink_windows, size_window, set_window_height)
15593 (set_window_width, change_window_heights, window_height)
15594 (window_width, CURBEG, CURSIZE, enlarge_window)
15595 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15596 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15597 handled in window.el.
15598 (make_dummy_parent): Rename to make_parent_window and give it a
15599 second argument horflag.
15600 (make_window): Don't set resize_proportionally any more.
15601 (Fsplit_window): Remove. Windows are split in window.el.
15602 (save_restore_action, save_restore_orig_size)
15603 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15604 Resize mini windows in window.el.
15605 (grow_mini_window, shrink_mini_window): Implement by calling
15606 Qresize_root_window_vertically, resize_window_check and
15607 resize_window_apply.
15608 (saved_window, Fset_window_configuration, save_window_save):
15609 Do not handle orig_top_line, orig_total_lines, and
15610 resize_proportionally.
15611 (window_min_height, window_min_width): Move to window.el.
15612 (keys_of_window): Move bindings for delete-other-windows,
15613 split-window, delete-window and enlarge-window to window.el.
15614
15615 * buffer.c: Temporarily extern Qdelete_window.
15616 (Fbury_buffer): Temporarily call Qdelete_window instead of
15617 Fdelete_window (Fbury_buffer will move to window.el soon).
15618
15619 * frame.c (set_menu_bar_lines_1): Remove code handling
15620 orig_top_line and orig_total_lines.
15621
15622 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15623 set_window_height but set heights directly.
15624 (change_frame_size_1): Use resize_frame_windows.
15625
15626 * xdisp.c (init_xdisp): Don't use set_window_height but set
15627 heights directly.
15628
15629 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15630 Use resize_frame_windows instead of change_window_heights and run
15631 run_window_configuration_change_hook.
15632
15633 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15634 instead of change_window_heights and run
15635 run_window_configuration_change_hook.
15636
15637 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15638
15639 * window.c (replace_window): Rename second argument REPLACEMENT to
15640 NEW. New third argument SETFLAG. Rewrite.
15641 (delete_window, make_dummy_parent): Call replace_window with
15642 third argument 1.
15643 (window_list_1): Move down in code.
15644 (run_window_configuration_change_hook): Move set_buffer part
15645 before select_frame_norecord part in order to unwind correctly.
15646 Rename count1 to count.
15647 (recombine_windows, delete_deletable_window, resize_root_window)
15648 (Fdelete_other_windows_internal)
15649 (Frun_window_configuration_change_hook, make_parent_window)
15650 (resize_window_check, resize_window_apply, Fresize_window_apply)
15651 (resize_frame_windows, Fsplit_window_internal)
15652 (Fdelete_window_internal, Fresize_mini_window_internal):
15653 New functions.
15654 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15655
15656 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15657
15658 * window.h (window): Add some new members to window structure -
15659 normal_lines, normal_cols, new_total, new_normal, clone_number,
15660 splits, nest, prev_buffers, next_buffers.
15661 (WINDOW_TOTAL_SIZE): Move here from window.c.
15662 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15663
15664 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15665 Remove.
15666 (make_dummy_parent): Set new members of windows structure.
15667 (make_window): Move down in code. Handle new members of window
15668 structure.
15669 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15670 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15671 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15672 (Fset_window_prev_buffers, Fwindow_next_buffers)
15673 (Fset_window_next_buffers, Fset_window_clone_number):
15674 New functions.
15675 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15676 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15677 Doc-string fixes.
15678 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15679 Argument WINDOW can be now internal window too.
15680 (Fwindow_use_time): Move up in code.
15681 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15682 Rewrite doc-string.
15683 (Fset_window_configuration, saved_window)
15684 (Fcurrent_window_configuration, save_window_save): Handle new
15685 members of window structure.
15686 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15687 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15688 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15689 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15690 Qget_mru_window, Qresize_root_window,
15691 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15692 Qauto_buffer_name; staticpro them.
15693
15694 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15695
15696 * window.c (Fwindow_total_size, Fwindow_left_column)
15697 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15698 (Fwindow_list_1): New functions.
15699 (window_box_text_cols): Replace with window_body_cols.
15700 (Fwindow_width, Fscroll_left, Fscroll_right):
15701 Use window_body_cols instead of window_box_text_cols.
15702 (delete_window, Fset_window_configuration):
15703 Call delete_all_subwindows with window as argument.
15704 (delete_all_subwindows): Take a window as argument and not a
15705 structure. Rewrite.
15706 (window_loop): Remove handling of GET_LRU_WINDOW and
15707 GET_LARGEST_WINDOW.
15708 (Fget_lru_window, Fget_largest_window): Move to window.el.
15709
15710 * window.h: Extern window_body_cols instead of
15711 window_box_text_cols. delete_all_subwindows now takes a
15712 Lisp_Object as argument.
15713
15714 * indent.c (compute_motion, Fcompute_motion):
15715 Use window_body_cols instead of window_box_text_cols.
15716
15717 * frame.c (delete_frame): Call delete_all_subwindows with root
15718 window as argument.
15719
15720 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15721
15722 * fns.c (Fputhash): Document return value.
15723
15724 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15725
15726 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15727
15728 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15729
15730 Cons<->int and similar integer overflow fixes (Bug#8794).
15731
15732 Check for overflow when converting integer to cons and back.
15733 * charset.c (Fdefine_charset_internal, Fdecode_char):
15734 Use cons_to_unsigned to catch overflow.
15735 (Fencode_char): Use INTEGER_TO_CONS.
15736 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15737 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15738 * data.c (long_to_cons, cons_to_long): Remove.
15739 (cons_to_unsigned, cons_to_signed): New functions.
15740 These signal an error for invalid or out-of-range values.
15741 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15742 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15743 * font.c (Ffont_variation_glyphs):
15744 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15745 * lisp.h: Include <intprops.h>.
15746 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15747 (cons_to_signed, cons_to_unsigned): New decls.
15748 (long_to_cons, cons_to_long): Remove decls.
15749 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15750 (Fprimitive_undo): Use CONS_TO_INTEGER.
15751 * xfns.c (Fx_window_property): Likewise.
15752 * xselect.c: Include <limits.h>.
15753 (x_own_selection, selection_data_to_lisp_data):
15754 Use INTEGER_TO_CONS.
15755 (x_handle_selection_request, x_handle_selection_clear)
15756 (x_get_foreign_selection, Fx_disown_selection_internal)
15757 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15758 (lisp_data_to_selection_data): Use cons_to_unsigned.
15759 (x_fill_property_data): Use cons_to_signed.
15760 Report values out of range.
15761
15762 Check for buffer and string overflow more precisely.
15763 * buffer.h (BUF_BYTES_MAX): New macro.
15764 * lisp.h (STRING_BYTES_MAX): New macro.
15765 * alloc.c (Fmake_string):
15766 * character.c (string_escape_byte8):
15767 * coding.c (coding_alloc_by_realloc):
15768 * doprnt.c (doprnt):
15769 * editfns.c (Fformat):
15770 * eval.c (verror):
15771 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15772 since they may not be the same number.
15773 * editfns.c (Finsert_char):
15774 * fileio.c (Finsert_file_contents):
15775 Likewise for BUF_BYTES_MAX.
15776
15777 * image.c: Use ptrdiff_t, not int, for sizes.
15778 (slurp_file): Switch from int to ptrdiff_t.
15779 All uses changed.
15780 (slurp_file): Check that file size fits in both size_t (for
15781 malloc) and ptrdiff_t (for sanity and safety).
15782
15783 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15784 if b->modtime has its maximal value.
15785
15786 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15787
15788 Don't assume time_t can fit into int.
15789 * buffer.h (struct buffer.modtime): Now time_t, not int.
15790 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15791 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15792
15793 Minor fixes for signed vs unsigned integers.
15794 * character.h (MAYBE_UNIFY_CHAR):
15795 * charset.c (maybe_unify_char):
15796 * keyboard.c (read_char, reorder_modifiers):
15797 XINT -> XFASTINT, since the integer must be nonnegative.
15798 * ftfont.c (ftfont_spec_pattern):
15799 * keymap.c (access_keymap, silly_event_symbol_error):
15800 XUINT -> XFASTINT, since the integer must be nonnegative.
15801 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15802 since it makes no difference and we prefer signed.
15803 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15804 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15805 nonnegative.
15806
15807 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15808
15809 * window.h (Fwindow_frame): Declare.
15810
15811 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15812
15813 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15814 (SPARE_MEMORY): Always define.
15815 (LARGE_REQUEST): Remove.
15816 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15817
15818 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15819
15820 * lisp.h: Move EXFUNS for Fframe_root_window,
15821 Fframe_first_window and Fset_frame_selected_window to window.h.
15822
15823 * window.h: Move EXFUNS for Fframe_root_window,
15824 Fframe_first_window and Fset_frame_selected_window here from
15825 lisp.h.
15826
15827 * frame.c (Fwindow_frame, Fframe_first_window)
15828 (Fframe_root_window, Fframe_selected_window)
15829 (Fset_frame_selected_window): Move to window.c.
15830 (Factive_minibuffer_window): Move to minibuf.c.
15831 (Fother_visible_frames_p): New function.
15832
15833 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15834
15835 * window.c (decode_window, decode_any_window): Move up in code.
15836 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15837 (inhibit_frame_unsplittable): Remove unused variable.
15838 (Fwindow_buffer): Move up and rewrite doc-string.
15839 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15840 (Fwindow_prev): New functions.
15841 (Fwindow_frame): Move here from frame.c. Accept any window as
15842 argument.
15843 (Fframe_root_window, Fframe_first_window)
15844 (Fframe_selected_window): Move here from frame.c. Accept frame
15845 or arbitrary window as argument. Update doc-strings.
15846 (Fminibuffer_window): Move up in code.
15847 (Fwindow_minibuffer_p): Move up in code and simplify.
15848 (Fset_frame_selected_window): Move here from frame.c.
15849 Marginal rewrite.
15850 (Fselected_window, select_window, Fselect_window): Move up in
15851 code. Minor doc-string fixes.
15852
15853 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15854
15855 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15856 Do not assume that spare memory exists; that assumption is valid
15857 only if SYSTEM_MALLOC.
15858 (LARGE_REQUEST): New macro, so that the issue of large requests
15859 is separated from the issue of spare memory.
15860
15861 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15862
15863 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15864 format. (Bug#8806)
15865
15866 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15867
15868 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15869 before statements.
15870
15871 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15872
15873 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15874
15875 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15876
15877 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15878 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15879
15880 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15881
15882 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15883
15884 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15885
15886 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15887 (x_clipboard_manager_save): Add return value.
15888 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15889 New error handlers.
15890 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15891 Obey Vx_select_enable_clipboard_manager. Catch errors in
15892 x_clipboard_manager_save (Bug#8779).
15893 (Vx_select_enable_clipboard_manager): New variable.
15894 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15895
15896 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15897
15898 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15899
15900 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15901
15902 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15903 in the current matrix if keep_current_p is non-zero.
15904
15905 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15906
15907 * bidi.c (bidi_level_of_next_char): Fix last change.
15908
15909 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15910
15911 Support bidi reordering of text covered by display properties.
15912
15913 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15914 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15915 (bidi_cache_search, bidi_cache_iterator_state)
15916 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15917 (bidi_level_of_next_char, bidi_move_to_visually_next):
15918 Support character positions inside a run of characters covered by a
15919 display string.
15920 (bidi_paragraph_init, bidi_resolve_explicit_1)
15921 (bidi_level_of_next_char): Call bidi_fetch_char and
15922 bidi_fetch_char_advance instead of FETCH_CHAR and
15923 FETCH_CHAR_ADVANCE.
15924 (bidi_init_it): Initialize new members.
15925 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15926 definitions.
15927 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15928 instead of using explicit *_CHAR codes.
15929 (bidi_resolve_explicit, bidi_resolve_weak):
15930 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15931 bidirectional text is supported only in multibyte buffers.
15932 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15933 it to initialize the frame_window_p member of struct bidi_it.
15934 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15935 (bidi_resolve_explicit, bidi_resolve_weak)
15936 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15937 bidi_it->nchars is non-positive.
15938 (bidi_level_of_next_char): Don't try to lookup the cache for the
15939 next/previous character if nothing is cached there yet, or if we
15940 were just reseat()'ed to a new position.
15941
15942 * xdisp.c (set_cursor_from_row): Set start and stop points
15943 according to the row's direction when priming the loop that looks
15944 for the glyph on which to display cursor.
15945 (single_display_spec_intangible_p): Function deleted.
15946 (display_prop_intangible_p): Reimplement to call
15947 handle_display_spec instead of single_display_spec_intangible_p.
15948 Accept 3 additional arguments needed by handle_display_spec.
15949 This fixes incorrect cursor motion across display property with complex
15950 values: lists, `(when COND...)' forms, etc.
15951 (single_display_spec_string_p): Support property values that are
15952 lists with the argument STRING its top-level element.
15953 (display_prop_string_p): Fix the condition for processing a
15954 property that is a list to be consistent with handle_display_spec.
15955 (handle_display_spec): New function, refactored from the
15956 last portion of handle_display_prop.
15957 (compute_display_string_pos): Accept additional argument
15958 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15959 value of a `display' property is a "replacing spec".
15960 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15961 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15962 the display property, but just return a value indicating whether
15963 the display property will replace the characters it covers.
15964 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15965 frame_window_p members of struct bidi_it.
15966 (compute_display_string_pos, compute_display_string_end):
15967 New functions.
15968 (push_it): Accept second argument POSITION, where pop_it should
15969 jump to continue iteration.
15970 (reseat_1): Initialize bidi_it.disp_pos.
15971
15972 * keyboard.c (adjust_point_for_property): Adjust the call to
15973 display_prop_intangible_p to its new signature.
15974
15975 * dispextern.h (struct bidi_it): New member frame_window_p.
15976 (bidi_init_it): Update prototypes.
15977 (display_prop_intangible_p): Update prototype.
15978 (compute_display_string_pos, compute_display_string_end):
15979 Declare prototypes.
15980 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15981 EMACS_INT.
15982
15983 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15984
15985 Malloc failure behavior now depends on size of allocation.
15986 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15987 * lisp.h: Change signatures accordingly.
15988 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15989 All callers changed. (Bug#8762)
15990
15991 * gnutls.c: Use Emacs's memory allocators.
15992 Without this change, the gnutls library would invoke malloc etc.
15993 directly, which causes problems on non-SYNC_INPUT hosts, and which
15994 runs afoul of improving memory_full behavior. (Bug#8761)
15995 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15996 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15997 xfree instead of the default malloc, realloc, free.
15998 (Fgnutls_boot): No need to check for memory allocation failure,
15999 since xmalloc does that for us.
16000
16001 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16002 * category.c (hash_get_category_set):
16003 * ccl.c (ccl_driver):
16004 * charset.c (Fdefine_charset_internal):
16005 * charset.h (struct charset.hash_index):
16006 * composite.c (get_composition_id, gstring_lookup_cache)
16007 (composition_gstring_put_cache):
16008 * composite.h (struct composition.hash_index):
16009 * dispextern.h (struct image.hash):
16010 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16011 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16012 (hashfn_equal, hashfn_user_defined, make_hash_table)
16013 (maybe_resize_hash_table, hash_lookup, hash_put)
16014 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16015 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16016 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16017 * image.c (make_image, search_image_cache, lookup_image)
16018 (xpm_put_color_table_h):
16019 * lisp.h (struct Lisp_Hash_Table):
16020 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16021 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16022 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16023 * alloc.c (allocate_vectorlike):
16024 Check for overflow in vector size calculations.
16025 * ccl.c (ccl_driver):
16026 Check for overflow when converting EMACS_INT to int.
16027 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16028 need to be updated by these changes.
16029 * fns.c (make_hash_table, maybe_resize_hash_table):
16030 Check for integer overflow with large hash tables.
16031 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16032 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16033 (SXHASH_REDUCE): New macro.
16034 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16035 Use it instead of discarding useful hash info with large hash values.
16036 (sxhash_float): New function.
16037 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16038 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16039 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16040 Rewrite to use FIXNUM_BITS, as this simplifies things.
16041 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16042 Adjust signatures to match updated version of code.
16043 (consing_since_gc): Now EMACS_INT, since a single hash table can
16044 use more than INT_MAX bytes.
16045
16046 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16047
16048 Make it possible to build with GCC-4.6+ -O2 -flto.
16049
16050 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16051
16052 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16053
16054 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16055 Call minibuffer-inactive-mode.
16056
16057 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16058
16059 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16060 Update dependencies.
16061
16062 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16063
16064 * data.c (init_data): Remove code for UTS, this system is not
16065 supported anymore.
16066
16067 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16068
16069 Don't force ./temacs to start in terminal mode.
16070
16071 * frame.c (make_initial_frame): Initialize faces in all cases, not
16072 only when CANNOT_DUMP is defined.
16073 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16074
16075 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16076
16077 * dispnew.c (add_window_display_history): Use const for the string
16078 pointer. Remove declaration, not needed.
16079
16080 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16081
16082 Use 'inline', not 'INLINE'.
16083 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16084 * alloc.c, fontset.c (INLINE): Remove.
16085 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16086 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16087 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16088 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16089 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16090
16091 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16092
16093 Make it possible to run ./temacs.
16094
16095 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16096 syms_of_callproc does the same thing. Remove test for
16097 "initialized", do it in the caller.
16098 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16099
16100 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16101
16102 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16103 (read_minibuf): Use get_minibuffer.
16104 (syms_of_minibuf): Use DEFSYM.
16105 (Qmetadata): New var.
16106 * data.c (Qbuffer): Don't make it static.
16107 (syms_of_data): Use DEFSYM.
16108
16109 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16110
16111 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16112 (CCL_CODE_MIN): New macro.
16113
16114 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16115
16116 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16117
16118 * eval.c (Qdebug): Now static.
16119 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16120 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16121 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16122
16123 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16124
16125 * image.c: Various fixes to ImageMagick code comments.
16126 (Fimagemagick_types): Doc fix.
16127
16128 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16129
16130 Minor fixes prompted by GCC 4.6.0 warnings.
16131
16132 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16133
16134 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16135 (x_clipboard_manager_save_all): Move extern decl to ...
16136 * xterm.h: ... here, so that it can be checked for consistency.
16137
16138 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16139
16140 * xselect.c (x_clipboard_manager_save_frame)
16141 (x_clipboard_manager_save_all): New functions.
16142 (Fx_clipboard_manager_save): Lisp function deleted.
16143
16144 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16145 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16146
16147 * xterm.h: Update prototype.
16148
16149 2011-05-28 William Xu <william.xwl@gmail.com>
16150
16151 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16152 exiting (Bug#8239).
16153
16154 2011-05-28 Jim Meyering <meyering@redhat.com>
16155
16156 Avoid a sign-extension bug in crypto_hash_function.
16157 * fns.c (to_uchar): Define.
16158 (crypto_hash_function): Use it to convert some newly-signed
16159 variables to unsigned, to avoid sign-extension bugs. For example,
16160 without this change, (md5 "truc") would evaluate to
16161 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16162 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16163 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16164
16165 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16166
16167 Integer overflow fixes.
16168
16169 * dbusbind.c: Serial number integer overflow fixes.
16170 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16171 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16172 to hold a serial number that is too large for a fixnum.
16173 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16174 Check for serial numbers out of range. Decode any serial number
16175 that was so large that it became a float. (Bug#8722)
16176
16177 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16178 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16179 Use XFASTINT rather than XUINT when numbers are nonnegative.
16180 (xd_append_arg, Fdbus_method_return_internal):
16181 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16182 arguments, check that Lisp number is nonnegative, rather than
16183 silently wrapping negative numbers around. (Bug#8722)
16184 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16185 (Bug#8722)
16186
16187 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16188
16189 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16190
16191 ccl: Add integer overflow checks.
16192 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16193 (IN_INT_RANGE): New macros.
16194 (ccl_driver): Use them to check for integer overflow when
16195 decoding a CCL program. Many of the new checks are whether XINT (x)
16196 fits in int; it doesn't always, on 64-bit hosts. The new version
16197 doesn't catch all possible integer overflows, but it's an
16198 improvement. (Bug#8719)
16199
16200 * alloc.c (make_event_array): Use XINT, not XUINT.
16201 There's no need for unsigned here.
16202
16203 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16204 This follows up to the 2011-05-06 change that substituted uintptr_t
16205 for EMACS_INT. This case wasn't caught back then.
16206
16207 Rework Fformat to avoid integer overflow issues.
16208 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16209 now (part of C89). Include <verify.h>.
16210 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16211 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16212 (Fformat): Avoid the prepass trying to compute sizes; it was only
16213 approximate and thus did not catch overflow reliably. Instead, walk
16214 through the format just once, formatting and computing sizes as we go,
16215 checking for integer overflow at every step, and allocating a larger
16216 buffer as needed. Keep track separately whether the format is
16217 multibyte. Keep only the most-recently calculated precision, rather
16218 than them all. Record whether each argument has been converted to
16219 string. Use EMACS_INT, not int, for byte and char and arg counts.
16220 Support field widths and precisions larger than INT_MAX. Avoid
16221 sprintf's undefined behavior with conversion specifications such as %#d
16222 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16223 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16224 formatting out-of-range floating point numbers with int
16225 formats. (Bug#8668)
16226
16227 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16228
16229 * data.c: Avoid integer truncation in expressions involving floats.
16230 * data.c: Include <intprops.h>.
16231 (arith_driver): When there's an integer overflow in an expression
16232 involving floating point, convert the integers to floating point
16233 so that the resulting value does not suffer from catastrophic
16234 integer truncation. For example, on a 64-bit host (* 4
16235 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16236 Do not rely on undefined behavior after integer overflow.
16237
16238 merge count_size_as_multibyte, parse_str_to_multibyte
16239 * character.c, character.h (count_size_as_multibyte):
16240 Rename from parse_str_to_multibyte; all uses changed.
16241 Check for integer overflow.
16242 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16243 since it's now a duplicate of the other. This is more of
16244 a character than a buffer op, so better that it's in character.c.
16245 * fns.c, print.c: Adjust to above changes.
16246
16247 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16248
16249 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16250
16251 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16252
16253 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16254 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16255 (x_clipboard_manager_save): Now static.
16256 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16257
16258 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16259 (crypto_hash_function): Now static.
16260 Fix pointer signedness problems. Avoid unnecessary initializations.
16261
16262 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16263
16264 * termhooks.h (Vselection_alist): Make it terminal-local.
16265
16266 * terminal.c (create_terminal): Initialize it.
16267
16268 * xselect.c: Support for clipboard managers.
16269 (Vselection_alist): Move to termhooks.h as terminal-local var.
16270 (LOCAL_SELECTION): New macro.
16271 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16272 (symbol_to_x_atom): Remove gratuitous arg.
16273 (x_handle_selection_request, lisp_data_to_selection_data)
16274 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16275 (x_own_selection, x_get_local_selection, x_convert_selection):
16276 New arg, specifying work frame. Use terminal-local Vselection_alist.
16277 (some_frame_on_display): Delete unused function.
16278 (Fx_own_selection_internal, Fx_get_selection_internal)
16279 (Fx_disown_selection_internal, Fx_selection_owner_p)
16280 (Fx_selection_exists_p): New optional frame arg.
16281 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16282 (x_handle_selection_clear): Don't treat other terminals with the
16283 same keyboard specially. Use the terminal-local Vselection_alist.
16284 (x_clear_frame_selections): Use Frun_hook_with_args.
16285
16286 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16287
16288 * xterm.h: Add support for those atoms.
16289
16290 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16291
16292 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16293 (converted_selections, conversion_fail_tag): New global variables.
16294 (x_selection_request_lisp_error): Free the above.
16295 (x_get_local_selection): Remove unnecessary code.
16296 (x_reply_selection_request): Args changed; handle arbitrary array
16297 of converted selections stored in converted_selections.
16298 Separate the XChangeProperty and SelectionNotify steps.
16299 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16300 (x_convert_selection): New function.
16301 (x_handle_selection_event): Simplify.
16302 (x_get_foreign_selection): Don't ignore incoming requests while
16303 waiting for an answer; this will fail when we implement
16304 SAVE_TARGETS, and seems unnecessary anyway.
16305 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16306 (Vx_sent_selection_functions): Doc fix.
16307
16308 2011-05-26 Leo Liu <sdl.web@gmail.com>
16309
16310 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16311
16312 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16313
16314 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16315
16316 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16317 for fringe update if it has periodic bitmap.
16318 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16319 and fringe_bitmap_periodic_p.
16320
16321 * fringe.c (get_fringe_bitmap_data): New function.
16322 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16323 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16324 row. Mark glyph row for fringe update if periodicity changed.
16325
16326 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16327 for fringe update unless it has periodic bitmap.
16328
16329 2011-05-25 Kenichi Handa <handa@m17n.org>
16330
16331 * xdisp.c (get_next_display_element): Set correct it->face_id for
16332 a static composition.
16333
16334 2011-05-24 Leo Liu <sdl.web@gmail.com>
16335
16336 * deps.mk (fns.o):
16337 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16338
16339 * fns.c (crypto_hash_function, Fsha1): New function.
16340 (Fmd5): Use crypto_hash_function.
16341 (syms_of_fns): Add Ssha1.
16342
16343 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16344
16345 * gnutls.c: Remove unused macros.
16346 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16347 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16348 Remove macros that are defined and never used.
16349 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16350
16351 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16352
16353 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16354 (Fx_get_selection_internal): Minor cleanup.
16355 (Fx_own_selection_internal): Rename arguments for consistency with
16356 select.el.
16357
16358 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16359
16360 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16361
16362 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16363
16364 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16365
16366 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16367
16368 * dispnew.c (scrolling_window): Don't exclude the case that the
16369 last enabled row in the desired matrix touches the bottom boundary.
16370
16371 2011-05-21 Glenn Morris <rgm@gnu.org>
16372
16373 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16374 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16375 and add some more files.
16376
16377 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16378
16379 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16380 report_file_error introduced by the change from 2011-05-07.
16381
16382 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16383
16384 * systime.h (Time): Define only if emacs is defined.
16385 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16386 where the include path doesn't have X11/X.h by default. See
16387 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16388
16389 2011-05-20 Kenichi Handa <handa@m17n.org>
16390
16391 * composite.c (find_automatic_composition): Fix previous change.
16392
16393 2011-05-20 Glenn Morris <rgm@gnu.org>
16394
16395 * lisp.mk: New file, split from Makefile.in.
16396 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16397 (shortlisp): Remove.
16398 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16399
16400 2011-05-19 Glenn Morris <rgm@gnu.org>
16401
16402 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16403 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16404 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16405 (lisp): Set the order to that of loadup.el.
16406 (shortlisp): Make it a copy of $lisp.
16407 (SOME_MACHINE_LISP): Remove.
16408 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16409 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16410
16411 2011-05-18 Kenichi Handa <handa@m17n.org>
16412
16413 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16414 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16415 (find_automatic_composition): Mostly rewrite for efficiency.
16416
16417 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16418
16419 * makefile.w32-in: Update dependencies.
16420
16421 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16422
16423 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16424 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16425
16426 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16427
16428 Fix some integer overflow issues, such as string length overflow.
16429
16430 * insdel.c (count_size_as_multibyte): Check for string overflow.
16431
16432 * character.c (lisp_string_width): Check for string overflow.
16433 Use EMACS_INT, not int, for string indexes and lengths; in
16434 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16435 the resulting string length overflows an EMACS_INT; instead,
16436 report a string overflow if no precision given. When checking for
16437 precision exhaustion, use a check that cannot possibly have
16438 integer overflow. (Bug#8675)
16439 * character.h (lisp_string_width): Adjust to new signature.
16440
16441 * alloc.c (string_overflow): New function.
16442 (Fmake_string): Use it. This doesn't change behavior, but saves
16443 a few bytes and will simplify future changes.
16444 * character.c (string_escape_byte8): Likewise.
16445 * lisp.h (string_overflow): New decl.
16446
16447 Fixups, following up to the user-interface timestamp change.
16448 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16449 for UI timestamps, instead of unsigned long.
16450 * msdos.c (mouse_get_pos): Likewise.
16451 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16452 * w32gui.h (Time): Define by including "systime.h" rather than by
16453 declaring it ourselves. (Bug#8664)
16454
16455 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16456 * image.c (clear_image_cache): Likewise.
16457
16458 * term.c (term_mouse_position): Don't assume time_t wraparound.
16459
16460 Be more systematic about user-interface timestamps.
16461 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16462 and sometimes 'EMACS_UINT', to represent these timestamps.
16463 This change causes it to use 'Time' uniformly, as that's what X uses.
16464 This makes the code easier to follow, and makes it easier to catch
16465 integer overflow bugs such as Bug#8664.
16466 * frame.c (Fmouse_position, Fmouse_pixel_position):
16467 Use Time, not unsigned long, for user-interface timestamps.
16468 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16469 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16470 * keyboard.h (last_event_timestamp): Likewise.
16471 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16472 * menu.h (xmenu_show): Likewise.
16473 * term.c (term_mouse_position): Likewise.
16474 * termhooks.h (struct input_event.timestamp): Likewise.
16475 (struct terminal.mouse_position_hook): Likewise.
16476 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16477 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16478 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16479 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16480 what it was before.
16481 * menu.h, termhooks.h: Include "systime.h", for Time.
16482
16483 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16484 Don't assume that the difference between two unsigned long values
16485 can fit into an integer. At this point, we know button_down_time
16486 <= event->timestamp, so the difference must be nonnegative, so
16487 there's no need to cast the result if double-click-time is
16488 nonnegative, as it should be; check that it's nonnegative, just in
16489 case. This bug is triggered when events are more than 2**31 ms
16490 apart (about 25 days). (Bug#8664)
16491
16492 * xselect.c (last_event_timestamp): Remove duplicate decl.
16493 (x_own_selection): Remove needless cast to unsigned long.
16494
16495 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16496 that always fit in int. Use a sentinel instead of a counter, to
16497 avoid a temp and to allay GCC's concerns about possible int overflow.
16498 * frame.h (struct frame): Use int for menu_bar_items_used
16499 instead of EMACS_INT, since it always fits in int.
16500
16501 * menu.c (grow_menu_items): Check for int overflow.
16502
16503 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16504
16505 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16506 Before, the code was not consistent. These values cannot exceed
16507 2**31 - 1 so there's no need to make them unsigned.
16508 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16509 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16510 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16511 as modifiers.
16512 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16513
16514 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16515 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16516 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16517 presumably because the widths might not match.
16518
16519 * window.c (size_window): Avoid needless test at loop start.
16520
16521 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16522
16523 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16524
16525 2011-05-12 Drew Adams <drew.adams@oracle.com>
16526
16527 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16528
16529 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16530
16531 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16532 `width' to `bar_area_x' and `bar_area_width', respectively.
16533 (x_scroll_run): Take account of fringe background extension.
16534
16535 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16536 Rename local vars `left' and `width' to `bar_area_x' and
16537 `bar_area_width', respectively.
16538 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16539 background extension.
16540
16541 2011-05-10 Jim Meyering <meyering@redhat.com>
16542
16543 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16544
16545 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16546
16547 * image.c (Finit_image_library): Return t for built-in image types,
16548 like pbm and xbm. (Bug#8640)
16549
16550 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16551
16552 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16553
16554 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16555
16556 * w32console.c (Fset_screen_color): Doc fix.
16557 (Fget_screen_color): New function.
16558 (syms_of_ntterm): Defsubr it.
16559
16560 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16561 unlink the temporary file if Fcall_process didn't create it in the
16562 first place.
16563 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16564 child process will be redirected to a file specified with `:file'.
16565 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16566 cue to call_process_cleanup not to close that handle.
16567
16568 2011-05-07 Ben Key <bkey76@gmail.com>
16569
16570 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16571 one of two shell specific rules, either bootstrap-temacs-CMD or
16572 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16573 to the previous implementation of the bootstrap-temacs rule.
16574 The bootstrap-temacs-CMD rule is similar to the previous
16575 implementation of the bootstrap-temacs rule except that it
16576 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16577 variable.
16578
16579 These changes, along with some changes to nt/configure.bat,
16580 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16581 earlier fix to add support for --cflags and --ldflags options
16582 that include quotes so that it works whether make uses cmd or
16583 sh as the shell.
16584
16585 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16586
16587 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16588 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16589 is a constant.
16590 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16591 a string. Handle both cases.
16592 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16593 (Fdbus_register_method): Use Qinvalid_function.
16594
16595 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16596
16597 * makefile.w32-in: Update dependencies.
16598 (LISP_H): Add inttypes.h and stdin.h.
16599 (PROCESS_H): Add unistd.h.
16600
16601 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16602
16603 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16604 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16605
16606 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16607
16608 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16609
16610 * term.c (vfatal): Remove stray call to va_end.
16611 It's not needed and the C Standard doesn't allow it here anyway.
16612
16613 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16614 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16615
16616 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16617 bytes.
16618
16619 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16620
16621 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16622
16623 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16624
16625 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16626
16627 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16628
16629 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16630 * charset.c (Fdefine_charset_internal): Don't initialize
16631 charset.code_space[15]. The value was garbage, on hosts with
16632 32-bit int (Bug#8600).
16633
16634 * lread.c (read_integer): Be more consistent with string-to-number.
16635 Use string_to_number to do the actual conversion; this avoids
16636 rounding errors and fixes some other screwups. Without this fix,
16637 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16638 (digit_to_number): Move earlier, for benefit of read_integer.
16639 Return -1 if the digit is out of range for the base, -2 if it is
16640 not a digit in any supported base. (Bug#8602)
16641
16642 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16643
16644 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16645 to match comment at start of function. This also removes a
16646 GCC warning about overflow in a 32+64-bit port.
16647
16648 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16649
16650 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16651 Reported by Stefan Monnier in
16652 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16653 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16654 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16655
16656 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16657 (EMACS_UINTPTR): Likewise, with uintptr_t.
16658
16659 * lisp.h: Prefer 64-bit EMACS_INT if available.
16660 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16661 on 32-bit hosts that have 64-bit int, so that they can access
16662 large files.
16663 However, temporarily disable this change unless the temporary
16664 symbol WIDE_EMACS_INT is defined.
16665
16666 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16667
16668 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16669 This removes an assumption that EMACS_INT and long are the same
16670 width as pointers. The assumption is true for Emacs porting targets
16671 now, but we want to make other targets possible.
16672 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16673 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16674 In the rest of the code, change types of integers that hold casted
16675 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16676 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16677 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16678 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16679 No need to cast type when ORing.
16680 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16681 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16682 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16683 assume EMACS_INT is the same width as char *.
16684 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16685 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16686 Remove no-longer-needed casts.
16687 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16688 (xg_tool_bar_help_callback, xg_make_tool_item):
16689 Use EMACS_INTPTR to hold an integer
16690 that will be cast to void *; this can avoid a GCC warning
16691 if EMACS_INT is not the same width as void *.
16692 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16693 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16694 (current_message_1, set_message_1):
16695 Use a local to convert to proper width without a cast.
16696 * xmenu.c (dialog_selection_callback): Likewise.
16697
16698 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16699 Also, don't assume VALBITS / RAND_BITS is less than 5,
16700 and don't rely on undefined behavior when shifting a 1 left into
16701 the sign bit.
16702 * lisp.h (get_random): Change signature to match.
16703
16704 * lread.c (hash_string): Use size_t, not int, for hash computation.
16705 Normally we prefer signed values; but hashing is special, because
16706 it's better to use unsigned division on hash table sizes so that
16707 the remainder is nonnegative. Also, size_t is the natural width
16708 for hashing into memory. The previous code used 'int', which doesn't
16709 retain enough info to hash well into very large tables.
16710 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16711
16712 * dbusbind.c: Don't possibly lose pointer info when converting.
16713 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16714 Use XPNTR rather than XHASH, so that the high-order bits of
16715 the pointer aren't lost when converting through void *.
16716
16717 * eval.c (Fautoload): Don't double-shift a pointer.
16718
16719 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16720
16721 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16722
16723 * gnutls.c (DEF_GNUTLS_FN):
16724 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16725
16726 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16727
16728 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16729 marker. (Bug#8610)
16730
16731 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16732
16733 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16734 New version that can reserve upto 2GB of heap space.
16735
16736 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16737
16738 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16739
16740 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16741
16742 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16743 `gnutls_certificate_set_x509_key_file'.
16744
16745 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16746
16747 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16748 Update dependencies.
16749
16750 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16751
16752 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16753 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16754 Remove unused parameter `fildes'.
16755 * process.c (read_process_output, send_process): Don't pass it.
16756
16757 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16758
16759 Fix previous change: the library cache is defined in w32.c.
16760 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16761 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16762
16763 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16764
16765 Implement dynamic loading of GnuTLS on Windows.
16766
16767 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16768 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16769 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16770 Declare.
16771
16772 * gnutls.c (Qgnutls_dll): Define.
16773 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16774 (gnutls_*): Declare function pointers.
16775 (init_gnutls_functions): New function to initialize function pointers.
16776 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16777 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16778 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16779 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16780 (emacs_gnutls_write, emacs_gnutls_read)
16781 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16782 (Fgnutls_available_p): New function.
16783 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16784 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16785 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16786
16787 * image.c: Include w32.h.
16788 (Vimage_type_cache): Delete.
16789 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16790 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16791 (w32_delayed_load): Move to w32.c.
16792
16793 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16794
16795 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16796 (w32_delayed_load): Move from image.c. When loading a library, record
16797 its filename in the :loaded-from property of the library id.
16798 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16799 Initialize and staticpro them.
16800 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16801
16802 * process.c: Include lisp.h before w32.h, not after.
16803 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16804 instead of gnutls_record_check_pending.
16805
16806 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16807
16808 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16809
16810 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16811 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16812 as passed in.
16813
16814 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16815
16816 * xterm.c (x_set_frame_alpha): Do not set property on anything
16817 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16818
16819 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16820
16821 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16822
16823 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16824
16825 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16826 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16827 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16828 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16829 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16830 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16831 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16832 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16833 (Qgnutls_bootprop_callbacks_verify): Make static.
16834
16835 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16836
16837 * callproc.c: Indentation fixup.
16838
16839 * sysdep.c (wait_for_termination_1): Make static.
16840 (wait_for_termination, interruptible_wait_for_termination):
16841 Move after wait_for_termination_1.
16842
16843 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16844
16845 * sysdep.c (interruptible_wait_for_termination): New function
16846 which is like wait_for_termination, but allows keyboard
16847 interruptions.
16848
16849 * callproc.c (Fcall_process): Add (:file "file") as an option for
16850 the STDOUT buffer.
16851 (Fcall_process_region): Ditto.
16852
16853 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16854
16855 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16856 rather than `XVECTOR (FOO)->size'.
16857
16858 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16859 inttypes.h, as a gnulib replacement is used if it not available in
16860 system headers.
16861
16862 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16863
16864 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16865 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16866 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16867
16868 * coding.c (coding_alloc_by_realloc): Error out if destination
16869 will grow beyond MOST_POSITIVE_FIXNUM.
16870 (decode_coding_emacs_mule): Abort if there isn't enough place in
16871 charbuf for the composition carryover bytes. Reserve an extra
16872 space for up to 2 characters produced in a loop.
16873 (decode_coding_iso_2022): Abort if there isn't enough place in
16874 charbuf for the composition carryover bytes.
16875
16876 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16877
16878 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16879 aborting when %lld or %lll format is passed.
16880 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16881 %llo or %llx format is passed. (Bug#8545)
16882
16883 * window.c (window_scroll_line_based): Use a marker instead of
16884 simple variables to record original value of point. (Bug#7952)
16885
16886 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16887 produced by %s or %c overflows available buffer space. (Bug#8545)
16888
16889 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16890
16891 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16892 (SIZE_MAX): Move defn after all includes, as they might #define it.
16893
16894 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16895
16896 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16897
16898 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16899
16900 * keyboard.c (Qdelayed_warnings_hook): Define.
16901 (command_loop_1): Run `delayed-warnings-hook'
16902 if Vdelayed_warnings_list is non-nil.
16903 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16904 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16905
16906 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16907
16908 * doprnt.c (doprnt): Don't return value smaller than the buffer
16909 size if the message was truncated. (Bug#8545).
16910
16911 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16912
16913 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16914 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16915
16916 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16917
16918 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16919
16920 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16921
16922 * makefile.w32-in: Update dependencies.
16923
16924 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16925
16926 Improve `doprnt' and its usage. (Bug#8545)
16927 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16928 `format_end'. Remove support for %l as a conversion specifier.
16929 Don't use xrealloc. Improve diagnostics when the %l size modifier
16930 is used. Update the commentary.
16931
16932 * eval.c (verror): Simplify calculation of size_t.
16933
16934 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16935 messages.
16936
16937 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16938
16939 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16940 change.
16941
16942 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16943
16944 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16945 This makes this file independent of the recent pseudovector change.
16946
16947 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16948
16949 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16950
16951 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16952 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16953 Remove unused local.
16954 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16955
16956 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16957 GCC 4.6.0 optimizes based on type-based alias analysis.
16958 For example, if b is of type struct buffer * and v of type struct
16959 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16960 != &v->size, and therefore "v->size = 1; b->size = 2; return
16961 v->size;" must therefore return 1. This assumption is incorrect
16962 for Emacs, since it type-puns struct Lisp_Vector * with many other
16963 types. To fix this problem, this patch adds a new type struct
16964 vectorlike_header that documents the constraints on layout of vectors
16965 and pseudovectors, and helps optimizing compilers not get fooled
16966 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16967 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16968 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16969 the size member.
16970 (XSETPVECTYPE): Rewrite in terms of new macro.
16971 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16972 This is a bit clearer, and further avoids the possibility of
16973 undesirable aliasing.
16974 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16975 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16976 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16977 since Lisp_Subr is a special case (no "next" field).
16978 (ASIZE): Now uses header.size rather than size.
16979 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16980 to avoid the hassle of writing XVECTOR (foo)->header.size.
16981 (struct vectorlike_header): New type.
16982 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16983 object, to help avoid aliasing.
16984 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16985 (SUBRP): Likewise, since Lisp_Subr is a special case.
16986 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16987 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16988 (struct Lisp_Hash_Table): Combine first two members into a single
16989 struct vectorlike_header member. All uses of "size" and "next" members
16990 changed to be "header.size" and "header.next".
16991 * buffer.h (struct buffer): Likewise.
16992 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16993 * frame.h (struct frame): Likewise.
16994 * process.h (struct Lisp_Process): Likewise.
16995 * termhooks.h (struct terminal): Likewise.
16996 * window.c (struct save_window_data, struct saved_window): Likewise.
16997 * window.h (struct window): Likewise.
16998 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16999 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17000 * buffer.c (init_buffer_once): Likewise.
17001 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17002 special case.
17003 * process.c (Fformat_network_address): Use local var for size,
17004 for brevity.
17005
17006 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17007
17008 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17009 * data.c (atof): Remove decl; no longer used or needed.
17010 (digit_to_number): Move to lread.c.
17011 (Fstring_to_number): Use new string_to_number function, to be
17012 consistent with how the Lisp reader treats infinities and NaNs.
17013 Do not assume that floating-point numbers represent EMACS_INT
17014 without losing information; this is not true on most 64-bit hosts.
17015 Avoid double-rounding errors, by insisting on integers when
17016 parsing non-base-10 numbers, as the documentation specifies.
17017 * lisp.h (string_to_number): New decl, replacing ...
17018 (isfloat_string): Remove.
17019 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17020 (read1): Do not accept +. and -. as integers; this
17021 appears to have been a coding error. Similarly, do not accept
17022 strings like +-1e0 as floating point numbers. Do not report
17023 overflow for integer overflows unless the base is not 10 which
17024 means we have no simple and reliable way to continue.
17025 Break out the floating-point parsing into a new
17026 function string_to_number, so that Fstring_to_number parses
17027 floating point numbers consistently with the Lisp reader.
17028 (digit_to_number): Move here from data.c. Make it static inline.
17029 (E_CHAR, EXP_INT): Remove, replacing with ...
17030 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17031 (string_to_number): New function, replacing isfloat_string.
17032 This function checks for valid syntax and produces the resulting
17033 Lisp float number too. Rework it so that string-to-number
17034 no longer mishandles examples like "1.0e+". Use strtoumax,
17035 so that overflow for non-base-10 numbers is reported only when
17036 there's no portable and simple way to convert to floating point.
17037
17038 * textprop.c (set_text_properties_1): Rewrite for clarity,
17039 and to avoid GCC warning about integer overflow.
17040
17041 * intervals.h (struct interval): Use EMACS_INT for members
17042 where EMACS_UINT might cause problems. See
17043 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17044 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17045 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17046 All uses changed.
17047 (offset_intervals): Tell GCC not to worry about length overflow
17048 when negating a negative length.
17049
17050 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17051 (overrun_check_free): Likewise.
17052
17053 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17054 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17055 word size.
17056
17057 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17058 (gnutls_make_error): Rename local to avoid shadowing.
17059 (gnutls_emacs_global_deinit): ifdef out; not used.
17060 (Fgnutls_boot): Use const for pointer to readonly storage.
17061 Comment out unused local. Fix pointer signedness problems.
17062
17063 * lread.c (openp): Don't stuff size_t into an 'int'.
17064 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17065 about possible signed overflow.
17066
17067 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17068 (GDK_KEY_g): Don't define if already defined.
17069 (xg_prepare_tooltip): Avoid pointer signedness problem.
17070 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17071
17072 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17073 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17074
17075 * xfns.c (Fx_window_property): Simplify a bit,
17076 to make a bit faster and to avoid GCC 4.6.0 warning.
17077 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17078
17079 * fns.c (internal_equal): Don't assume size_t fits in int.
17080
17081 * alloc.c (compact_small_strings): Tighten assertion a little.
17082
17083 Replace pEd with more-general pI, and fix some printf arg casts.
17084 * lisp.h (pI): New macro, generalizing old pEd macro to other
17085 conversion specifiers. For example, use "...%"pI"d..." rather
17086 than "...%"pEd"...".
17087 (pEd): Remove. All uses replaced with similar uses of pI.
17088 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17089 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17090 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17091 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17092 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17093 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17094 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17095 64-bit hosts.
17096 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17097 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17098 * print.c (safe_debug_print, print_object): Likewise.
17099 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17100 to int.
17101 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17102 avoiding the 0 flag, which is not portable.
17103 * process.c (Fmake_network_process): Use pI to avoid cast.
17104 * region-cache.c (pp_cache): Likewise.
17105 * xdisp.c (decode_mode_spec): Likewise.
17106 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17107 behavior on 64-bit hosts with printf arg.
17108 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17109 (x_stop_queuing_selection_requests): Likewise.
17110 (x_get_window_property): Don't truncate byte count to an 'int'
17111 when tracing.
17112
17113 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17114 here, since it parses constructs like leading '-' and spaces,
17115 which are not wanted; and it overflows with large numbers.
17116 Instead, simply match F[0-9]+, which is what is wanted anyway.
17117
17118 * alloc.c: Remove unportable assumptions about struct layout.
17119 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17120 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17121 (allocate_vectorlike, make_pure_vector): Use the new macros,
17122 plus offsetof, to remove unportable assumptions about struct layout.
17123 These assumptions hold on all porting targets that I know of, but
17124 they are not guaranteed, they're easy to remove, and removing them
17125 makes further changes easier.
17126
17127 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17128 This doesn't fix a bug but makes the code clearer.
17129 (string_overrun_cookie): Now const. Use initializers that
17130 don't formally overflow signed char, to avoid warnings.
17131 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17132 can cause Emacs to crash when string overrun checking is enabled.
17133 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17134 multiple of sizeof (EMACS_INT); it need not be, if
17135 alignof(EMACS_INT) < sizeof (EMACS_INT).
17136 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17137
17138 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17139
17140 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17141
17142 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17143
17144 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17145 supposed to be handshaking. (Bug#8556)
17146 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17147
17148 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17149
17150 * lisp.h (Qdebug): List symbol.
17151 * eval.c (Qdebug): Restore global linkage.
17152 * keyboard.c (debug-on-event): New variable.
17153 (handle_user_signal): Break into debugger when debug-on-event
17154 matches the current signal symbol.
17155
17156 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17157
17158 * alloc.c (check_sblock, check_string_bytes)
17159 (check_string_free_list): Convert to standard C.
17160
17161 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17162
17163 * w32.c (emacs_gnutls_push): Fix typo.
17164
17165 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17166
17167 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17168 "cast to pointer from integer of different size".
17169
17170 Improve doprnt and its use in verror. (Bug#8545)
17171 * doprnt.c (doprnt): Document the set of format control sequences
17172 supported by the function. Use SAFE_ALLOCA instead of always
17173 using `alloca'.
17174
17175 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17176 is one byte too soon. Don't use xrealloc; instead xfree and
17177 xmalloc anew.
17178
17179 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17180
17181 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17182 callbacks stage.
17183
17184 * gnutls.c: Renamed global_initialized to
17185 gnutls_global_initialized. Added internals for the
17186 :verify-hostname-error, :verify-error, and :verify-flags
17187 parameters of `gnutls-boot' and documented those parameters in the
17188 docstring. Start callback support.
17189 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17190 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17191 on error. Return error code.
17192 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17193 (emacs_gnutls_read): Likewise.
17194 (Fgnutls_boot): Return handshake error code.
17195 (emacs_gnutls_handle_error): New function.
17196 (wsaerror_to_errno): Likewise.
17197
17198 * w32.h (emacs_gnutls_pull): Add prototype.
17199 (emacs_gnutls_push): Likewise.
17200
17201 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17202 (emacs_gnutls_push): Likewise.
17203
17204 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17205
17206 * process.c (wait_reading_process_output): Check if GnuTLS
17207 buffered some data internally if no FDs are set for TLS
17208 connections.
17209
17210 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17211 (LIBS): Link to USER_LIBS.
17212 ($(BLD)/gnutls.$(0)): New target.
17213
17214 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17215
17216 * xdisp.c (handle_single_display_spec): Rename the
17217 display_replaced_before_p argument into display_replaced_p, to
17218 make it consistent with the commentary. Fix typos in the
17219 commentary.
17220
17221 * textprop.c (syms_of_textprop): Remove dead code.
17222 (copy_text_properties): Delete obsolete commentary about an
17223 interface that was deleted long ago. Fix typos in the description
17224 of arguments.
17225
17226 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17227 to changes in oldXMenu/XMenu.h from 2011-04-16.
17228 <menu_help_message, prev_menu_help_message>: Constify.
17229 (IT_menu_make_room): menu->help_text is now `const char **';
17230 adjust.
17231
17232 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17233 to changes in oldXMenu/XMenu.h from 2011-04-16.
17234 (struct XMenu): Declare `help_text' `const char **'.
17235
17236 * xfaces.c <Qunspecified>: Make extern again.
17237
17238 * syntax.c: Include sys/types.h before including regex.h, as
17239 required by POSIX.
17240
17241 * doc.c (get_doc_string): Improve the format passed to `error'.
17242
17243 * doprnt.c (doprnt): Improve commentary.
17244
17245 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17246
17247 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17248 them with etags.
17249
17250 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17251 changes in globals.h immediately force recompilation.
17252 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17253 $(CURDIR)/s/ms-w32.h.
17254 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17255
17256 * character.c (Fchar_direction): Function deleted.
17257 (syms_of_character): Don't defsubr it.
17258 <char-direction-table>: Deleted.
17259
17260 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17261
17262 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17263 * doprnt.c: Include limits.h.
17264 (SIZE_MAX): New macro.
17265 (doprnt): Return a size_t value. 2nd arg is now size_t.
17266 Many local variables are now size_t instead of int or unsigned.
17267 Improve overflow protection. Support `l' modifier for integer
17268 conversions. Support %l conversion. Don't assume an EMACS_INT
17269 argument for integer conversions and for %c.
17270
17271 * lisp.h (doprnt): Restore prototype.
17272
17273 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17274 $(SRC)/character.h.
17275
17276 * Makefile.in (base_obj): Add back doprnt.o.
17277
17278 * deps.mk (doprnt.o): Add back prerequisites.
17279 (callint.o): Depend on character.h.
17280
17281 * eval.c (internal_lisp_condition_case): Include the handler
17282 representation in the error message.
17283 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17284 when breaking from the loop.
17285
17286 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17287
17288 * callint.c (Fcall_interactively): When displaying error message
17289 about invalid control letter, pass the character's codepoint, not
17290 a pointer to its multibyte form. Improve display of the character
17291 in octal and display also its hex code.
17292
17293 * character.c (char_string): Use %x to display the (unsigned)
17294 codepoint of an invalid character, to avoid displaying a bogus
17295 negative value.
17296
17297 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17298 `error', not SYMBOL_NAME itself.
17299
17300 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17301 character arguments to `error'.
17302
17303 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17304 to `error' in error message about FINAL_CHAR argument. Make sure
17305 FINAL_CHAR is a character, and use %c when it is passed as
17306 argument to `error'.
17307
17308 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17309
17310 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17311
17312 * w32.c: Include <time.h>.
17313 (sys_localtime): New function.
17314
17315 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17316
17317 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17318
17319 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17320
17321 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17322
17323 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17324 zombies (Bug#8467).
17325
17326 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17327
17328 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17329 gl_state.e_property when gl_state.object is Qt.
17330
17331 * insdel.c (make_gap_larger): Remove limitation of buffer size
17332 to <= INT_MAX.
17333
17334 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17335
17336 * xdisp.c (lookup_glyphless_char_display)
17337 (produce_glyphless_glyph): Handle cons cell entry in
17338 glyphless-char-display.
17339 (Vglyphless_char_display): Document it.
17340
17341 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17342 glyphless-char-display.
17343
17344 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17345
17346 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17347
17348 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17349
17350 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17351 definition for no-X builds.
17352
17353 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17354
17355 Static checks with GCC 4.6.0 and non-default toolkits.
17356
17357 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17358
17359 * process.c (keyboard_bit_set): Define only if SIGIO.
17360 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17361 (send_process): Repair possible setjmp clobbering.
17362
17363 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17364
17365 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17366
17367 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17368
17369 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17370 Define only if needed.
17371
17372 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17373 by pacifying GCC about it. Maybe it's time to retire it?
17374 * xfaces.c (USG, __TIMEVAL__): Likewise.
17375
17376 * dispextern.h (struct redisplay_interface): Rename param
17377 to avoid shadowing.
17378 * termhooks.h (struct terminal): Likewise.
17379 * xterm.c (xembed_send_message): Likewise.
17380
17381 * insdel.c (make_gap_smaller): Define only if
17382 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17383
17384 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17385 it.
17386
17387 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17388 so that we aren't warned about unused symbols.
17389
17390 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17391
17392 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17393
17394 * xfns.c (x_real_positions): Mark locals as initialized.
17395
17396 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17397
17398 * xterm.c: Fix problems found by static analysis with other toolkits.
17399 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17400 (x_dispatch_event): Declare static if USE_GTK, and
17401 define if USE_GTK || USE_X_TOOLKIT.
17402 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17403 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17404 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17405 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17406
17407 * xmenu.c (menu_help_callback): Pointer type fixes.
17408 Use const pointers when pointing at readonly data. Avoid pointer
17409 signedness clashes.
17410 (FALSE): Remove unused macro.
17411 (update_frame_menubar): Remove unused decl.
17412
17413 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17414
17415 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17416 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17417 (single_menu_item): Rename local to avoid shadowing.
17418
17419 * keyboard.c (make_lispy_event): Remove unused local var.
17420
17421 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17422 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17423
17424 * bitmaps: Change bitmaps from unsigned char back to the X11
17425 compatible char. Avoid the old compiler warnings about
17426 out-of-range initializers by using, for example, '\xab' rather
17427 than 0xab.
17428
17429 * xgselect.c (xgselect_initialize): Check vs interface
17430 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17431
17432 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17433
17434 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17435 to read-only memory.
17436
17437 * fns.c (vector): Remove; this old hack is no longer needed.
17438
17439 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17440 Remove unused var.
17441 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17442
17443 * xrdb.c (x_load_resources): Omit unused local.
17444
17445 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17446 (x_window): Rename locals to avoid shadowing.
17447 (USG): Use the kludged USG macro, to pacify gcc.
17448
17449 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17450 (x_term_init): Remove local to avoid shadowing.
17451
17452 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17453
17454 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17455 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17456
17457 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17458
17459 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17460
17461 Fix regex.c, syntax.c and friends for buffers > 2GB.
17462 * syntax.h (struct gl_state_s): Declare character position members
17463 EMACS_INT.
17464
17465 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17466
17467 * textprop.c (verify_interval_modification, interval_of):
17468 Declare arguments EMACS_INT.
17469
17470 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17471 EMACS_INT.
17472
17473 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17474
17475 * indent.c (Fvertical_motion): Local variable it_start is now
17476 EMACS_INT.
17477
17478 * regex.c (re_match, re_match_2, re_match_2_internal)
17479 (bcmp_translate, regcomp, regexec, print_double_string)
17480 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17481 (re_compile_pattern, re_exec): Declare arguments and local
17482 variables `size_t' and `ssize_t' and return values `regoff_t', as
17483 appropriate.
17484 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17485 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17486 <compile_stack_type>: `size' and `avail' are now `size_t'.
17487
17488 * regex.h <regoff_t>: Use ssize_t, not int.
17489 (re_search, re_search_2, re_match, re_match_2): Arguments that
17490 specify buffer/string position and length are now ssize_t and
17491 size_t. Return type is regoff_t.
17492
17493 2011-04-16 Ben Key <bkey76@gmail.com>
17494
17495 * nsfont.m: Fixed bugs in ns_get_family and
17496 ns_descriptor_to_entity that were caused by using free to
17497 deallocate memory blocks that were allocated by xmalloc (via
17498 xstrdup). This caused Emacs to crash when compiled with
17499 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17500 --enable-checking=xmallocoverrun). xfree is now used to
17501 deallocate these memory blocks.
17502
17503 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17504
17505 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17506
17507 emacs_write: Accept and return EMACS_INT for sizes.
17508 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17509 et seq.
17510 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17511 Accept and return EMACS_INT.
17512 (emacs_gnutls_write): Return the number of bytes written on
17513 partial writes.
17514 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17515 (emacs_read, emacs_write): Remove check for negative size, as the
17516 Emacs source code has been audited now.
17517 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17518 (emacs_read, emacs_write): Use it.
17519 * process.c (send_process): Adjust to the new signatures of
17520 emacs_write and emacs_gnutls_write. Do not attempt to store
17521 a byte offset into an 'int'; it might overflow.
17522 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17523
17524 * sound.c: Don't assume sizes fit in 'int'.
17525 (struct sound_device.period_size, alsa_period_size):
17526 Return EMACS_INT, not int.
17527 (struct sound_device.write, vox_write, alsa_write):
17528 Accept EMACS_INT, not int.
17529 (wav_play, au_play): Use EMACS_INT to store sizes and to
17530 record read return values.
17531
17532 2011-04-15 Ben Key <bkey76@gmail.com>
17533
17534 * keyboard.c (Qundefined): Don't declare static since it is used
17535 in nsfns.m.
17536 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17537 static since they are used in nsfont.m.
17538
17539 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17540
17541 * process.c (Qprocessp): Don't declare static.
17542 * lisp.h (Qprocessp): Declare again.
17543
17544 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17545
17546 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17547
17548 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17549
17550 Improve C-level modularity by making more things 'static'.
17551
17552 Don't publish debugger-only interfaces to other modules.
17553 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17554 (verify_bytepos, count_markers): Move decls to the only modules
17555 that need them.
17556 * region-cache.h (pp_cache): Likewise.
17557 * window.h (check_all_windows): Likewise.
17558 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17559
17560 * sysdep.c (croak): Now static, if
17561 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17562 * syssignal.h (croak): Declare only if not static.
17563
17564 * alloc.c (refill_memory_reserve): Now static if
17565 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17566 * lisp.h (refill_memory_reserve): Declare only if not static.
17567
17568 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17569 Define only if USE_LUCID.
17570
17571 * xrdb.c (x_customization_string, x_rm_string): Now static.
17572
17573 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17574 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17575
17576 * xdisp.c (draw_row_with_mouse_face): Now static.
17577 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17578
17579 * window.h (check_all_windows): Mark externally visible.
17580
17581 * window.c (window_deletion_count): Now static.
17582
17583 * undo.c: Make symbols static if they're not exported.
17584 (last_undo_buffer, last_boundary_position, pending_boundary):
17585 Now static.
17586
17587 * textprop.c (interval_insert_behind_hooks): Now static.
17588 (interval_insert_in_front_hooks): Likewise.
17589
17590 * term.c: Make symbols static if they're not exported.
17591 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17592 (max_frame_lines, tty_set_terminal_modes):
17593 (tty_reset_terminal_modes, tty_turn_off_highlight):
17594 (get_tty_terminal): Now static.
17595 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17596 * termhooks.h (term_mouse_moveto): Do not declare if
17597 HAVE_WINDOW_SYSTEM.
17598 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17599 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17600
17601 * sysdep.c: Make symbols static if they're not exported.
17602 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17603 Now static.
17604 (sigprocmask_set, full_mask): Remove; unused.
17605 (wait_debugging): Mark as visible.
17606 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17607 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17608
17609 * syntax.c (syntax_temp): Define only if !__GNUC__.
17610
17611 * sound.c (current_sound_device, current_sound): Now static.
17612
17613 * search.c (searchbufs, searchbuf_head): Now static.
17614
17615 * scroll.c (scroll_cost): Remove; unused.
17616 * dispextern.h (scroll_cost): Remove decl.
17617
17618 * region-cache.h (pp_cache): Mark as externally visible.
17619
17620 * process.c: Make symbols static if they're not exported.
17621 (process_tick, update_tick, create_process, chan_process):
17622 (Vprocess_alist, proc_buffered_char, datagram_access):
17623 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17624 (deactivate_process): Mark defn as static, as well as decl.
17625 * lisp.h (create_process): Remove decl.
17626 * process.h (chan_process, Vprocess_alist): Remove decls.
17627
17628 * print.c: Make symbols static if they're not exported.
17629 (print_depth, new_backquote_output, being_printed, print_buffer):
17630 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17631 (print_interval, print_number_index, initial_stderr_stream):
17632 Now static.
17633 * lisp.h (Fprinc): Remove decl.
17634 (debug_output_compilation_hack): Mark as externally visible.
17635
17636 * sysdep.c (croak): Move decl from here to syssignal.h.
17637 * syssignal.h (croak): Put it here, so the API can be checked when
17638 'croak' is called from dissociate_if_controlling_tty.
17639
17640 * minibuf.c: Make symbols static if they're not exported.
17641 (minibuf_save_list, choose_minibuf_frame): Now static.
17642 * lisp.h (choose_minibuf_frame): Remove decl.
17643
17644 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17645
17646 * lread.c: Make symbols static if they're not exported.
17647 (read_objects, initial_obarray, oblookup_last_bucket_number):
17648 Now static.
17649 (make_symbol): Remove; unused.
17650 * lisp.h (initial_obarray, make_symbol): Remove decls.
17651
17652 * keyboard.c: Make symbols static if they're not exported.
17653 (single_kboard, recent_keys_index, total_keys, recent_keys):
17654 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17655 (this_single_command_key_start, echoing, last_auto_save):
17656 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17657 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17658 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17659 (Vlispy_mouse_stem, double_click_count):
17660 Now static.
17661 (force_auto_save_soon): Define only if SIGDANGER.
17662 (ignore_mouse_drag_p): Now static if
17663 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17664 (print_help): Remove; unused.
17665 (stop_character, last_timer_event): Mark as externally visible.
17666 * keyboard.h (ignore_mouse_drag_p): Declare only if
17667 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17668 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17669 * lisp.h (echoing): Remove decl.
17670 (force_auto_save_soon): Declare only if SIGDANGER.
17671 * xdisp.c (redisplay_window): Simplify code, to make it more
17672 obvious that ignore_mouse_drag_p is not accessed if !defined
17673 USE_GTK && !defined HAVE_NS.
17674
17675 * intervals.c: Make symbols static if they're not exported.
17676 (merge_properties_sticky, merge_interval_right, delete_interval):
17677 Now static.
17678 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17679
17680 * insdel.c: Make symbols static if they're not exported.
17681 However, leave prepare_to_modify_buffer alone. It's never
17682 called from outside this function, but that appears to be a bug.
17683 (combine_after_change_list, combine_after_change_buffer):
17684 (adjust_after_replace, signal_before_change): Now static.
17685 (adjust_after_replace_noundo): Remove; unused.
17686 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17687 (signal_before_change): Remove decls.
17688
17689 * indent.c (val_compute_motion, val_vmotion): Now static.
17690
17691 * image.c: Make symbols static if they're not exported.
17692 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17693 if USE_GTK.
17694 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17695 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17696
17697 * fringe.c (standard_bitmaps): Now static.
17698 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17699
17700 * frame.c: Make symbols static if they're not exported.
17701 (x_report_frame_params, make_terminal_frame): Now static.
17702 (get_frame_param): Now static, unless HAVE_NS.
17703 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17704 (x_get_resource_string): Remove; not used.
17705 * frame.h (make_terminal_frame, x_report_frame_params):
17706 (x_get_resource_string); Remove decls.
17707 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17708 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17709
17710 * font.c, fontset.c: Make symbols static if they're not exported.
17711 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17712 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17713 * font.c (font_close_object): Now static.
17714 * font.h (font_close_object): Remove.
17715 * fontset.c (FONTSET_OBJLIST): Remove.
17716 (free_realized_fontset) #if-0 the body, which does nothing.
17717 (face_suitable_for_char_p): #if-0, as it's never called.
17718 * fontset.h (face_suitable_for_char_p): Remove decl.
17719 * xfaces.c (face_at_string_position):
17720 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17721 since 0 is always ASCII.
17722
17723 * fns.c (weak_hash_tables): Now static.
17724
17725 * fileio.c: Make symbols static if they're not exported.
17726 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17727 (Vwrite_region_annotation_buffers): Now static.
17728
17729 * eval.c: Make symbols static if they're not exported.
17730 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17731 * lisp.h (backtrace_list): Remove decl.
17732
17733 * emacs.c: Make symbols static if they're not exported.
17734 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17735 (fatal_error_code, fatal_error_signal_hook, standard_args):
17736 Now static.
17737 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17738 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17739 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17740 * lisp.h (fatal_error_signal_hook): Remove decl.
17741 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17742
17743 * editfns.c: Move a (normally-unused) function to its only use.
17744 * editfns.c, lisp.h (get_operating_system_release): Remove.
17745 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17746 worth the hassle of breaking this out.
17747
17748 * xterm.c: Make symbols static if they're not exported.
17749 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17750 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17751 (x_destroy_window, x_delete_display):
17752 Now static.
17753 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17754 (x_mouse_leave): Remove; unused.
17755 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17756 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17757 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17758 Remove decls.
17759 (x_mouse_leave): Declare only if WINDOWSNT.
17760 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17761 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17762 USE_X_TOOLKIT.
17763
17764 * ftxfont.c: Make symbols static if they're not exported.
17765 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17766 HAVE_FREETYPE.
17767 * font.h (ftxfont_driver): Likewise.
17768
17769 * xfns.c: Make symbols static if they're not exported.
17770 (x_last_font_name, x_display_info_for_name):
17771 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17772 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17773 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17774 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17775 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17776 (last_show_tip_args): Now static.
17777 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17778 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17779 (x_screen_planes): Remove; unused.
17780 * dispextern.h (x_screen_planes): Remove decl.
17781
17782 * dispnew.c: Make symbols static if they're not exported.
17783 * dispextern.h (redraw_garbaged_frames, scrolling):
17784 (increment_row_positions): Remove.
17785 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17786 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17787 Now static.
17788 (redraw_garbaged_frames): Remove; unused.
17789
17790 * xfaces.c: Make symbols static if they're not exported.
17791 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17792 Remove decls.
17793 * xterm.h (defined_color): Remove decls.
17794 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17795 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17796 (menu_face_changed_default, defined_color, free_realized_face):
17797 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17798 (ascii_face_of_lisp_face): Remove; unused.
17799
17800 * xdisp.c: Make symbols static if they're not exported.
17801 * dispextern.h (scratch_glyph_row, window_box_edges):
17802 (glyph_to_pixel_coords, set_cursor_from_row):
17803 (get_next_display_element, set_iterator_to_next):
17804 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17805 (show_mouse_face): Remove decls
17806 * frame.h (message_buf_print): Likewise.
17807 * lisp.h (pop_message, set_message, check_point_in_composition):
17808 Likewise.
17809 * xterm.h (set_vertical_scroll_bar): Likewise.
17810 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17811 (message_buf_print, scratch_glyph_row, displayed_buffer):
17812 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17813 (get_next_display_element, show_mouse_face, window_box_edges):
17814 (frame_to_window_pixel_xy, check_point_in_composition):
17815 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17816 (glyph_to_pixel_coords): Remove; unused.
17817
17818 * dired.c (file_name_completion): Now static.
17819
17820 * dbusbind.c (xd_in_read_queued_messages): Now static.
17821
17822 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17823 * data.c (circular_list_error): Remove.
17824
17825 * commands.h (last_point_position, last_point_position_buffer):
17826 (last_point_position_window): Remove decls.
17827 * keyboard.c: Make these variables static.
17828
17829 * coding.h (coding, code_convert_region, encode_coding_gap):
17830 Remove decls.
17831 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17832 (iso_code_class, detect_coding, code_convert_region): Now static.
17833 (encode_coding_gap): Remove; unused.
17834
17835 * chartab.c (chartab_chars, chartab_bits): Now static.
17836
17837 * charset.h (charset_iso_8859_1): Remove decl.
17838 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17839 Now static.
17840
17841 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17842 * ccl.c (Vccl_program_table): Now static.
17843 (check_ccl_update): Remove; unused.
17844
17845 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17846 * category.h: ... from here.
17847 * category.c (check_category_table, set_category_set): Now static.
17848
17849 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17850 * lisp.h: Remove these decls.
17851
17852 * buffer.c (buffer_count): Remove unused var.
17853
17854 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17855 so that it's not optimized away.
17856 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17857 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17858 exported only to the debugger.
17859
17860 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17861 * atimer.h (run_all_atimers): Remove; not exported.
17862
17863 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17864 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17865 was inaccessible from Lisp.
17866 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17867 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17868
17869 alloc.c: Import and export fewer symbols, and remove unused items.
17870 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17871 is defined.
17872 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17873 it's not optimized away by whole-program optimization.
17874 (message_enable_multibyte, free_misc): Remove.
17875 (catchlist, handlerlist, mark_backtrace):
17876 Declare only if BYTE_MARK_STACK.
17877 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17878 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17879 (message_enable_multibyte): Remove decl.
17880 (free_misc, interval_free_list, float_block, float_block_index):
17881 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17882 (cons_free_list, last_marked_index):
17883 Now static.
17884 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17885 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17886 (mark_backtrace): Define only if BYTE_MARK_STACK.
17887 * xdisp.c (message_enable_multibyte): Now static.
17888
17889 Declare Lisp_Object Q* variables to be 'static' if not exported.
17890 This makes it easier for human readers (and static analyzers)
17891 to see whether these variables are used from other modules.
17892 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17893 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17894 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17895 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17896 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17897 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17898 * xmenu.c, xselect.c:
17899 Declare Q* vars static if they are not used in other modules.
17900 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17901 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17902 Remove decls of unexported vars.
17903 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17904
17905 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17906
17907 Make Emacs functions such as Fatom 'static' by default.
17908 This makes it easier for human readers (and static analyzers)
17909 to see whether these functions can be called from other modules.
17910 DEFUN now defines a static function. To make the function external
17911 so that it can be used in other C modules, use the new macro DEFUE.
17912 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17913 (Finit_image_library):
17914 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17915 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17916 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17917 Remove decls, since these functions are now static.
17918 (Funintern, Fget_internal_run_time): New decls, since these functions
17919 were already external.
17920
17921 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17922 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17923 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17924 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17925 * keyboard.c, keymap.c, lread.c:
17926 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17927 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17928 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17929 Mark functions with DEFUE instead of DEFUN,
17930 if they are used in other modules.
17931 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17932 decls for now-static functions.
17933 * buffer.h (Fdelete_overlay): Remove decl.
17934 * callproc.c (Fgetenv_internal): Mark as internal.
17935 * composite.c (Fremove_list_of_text_properties): Remove decl.
17936 (Fcomposition_get_gstring): New forward static decl.
17937 * composite.h (Fcomposite_get_gstring): Remove decl.
17938 * dired.c (Ffile_attributes): New forward static decl.
17939 * doc.c (Fdocumntation_property): New forward static decl.
17940 * eval.c (Ffetch_bytecode): New forward static decl.
17941 (Funintern): Remove extern decl; now in .h file where it belongs.
17942 * fileio.c (Fmake_symbolic_link): New forward static decl.
17943 * image.c (Finit_image_library): New forward static decl.
17944 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17945 * intervals.h (Fprevious_property_change):
17946 (Fremove_list_of_text_properties): Remove decls.
17947 * keyboard.c (Fthis_command_keys): Remove decl.
17948 (Fcommand_execute): New forward static decl.
17949 * keymap.c (Flookup_key): New forward static decl.
17950 (Fcopy_keymap): Now static.
17951 * keymap.h (Flookup_key): Remove decl.
17952 * process.c (Fget_process): New forward static decl.
17953 (Fprocess_datagram_address): Mark as internal.
17954 * syntax.c (Fsyntax_table_p): New forward static decl.
17955 (skip_chars): Remove duplicate decl.
17956 * textprop.c (Fprevious_property_change): New forward static decl.
17957 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17958 Now internal.
17959 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17960 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17961
17962 * editfns.c (Fformat): Remove unreachable code.
17963
17964 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17965
17966 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17967 change. (Bug#8496)
17968
17969 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17970
17971 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17972 when at ZV. (Bug#8487)
17973
17974 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17975
17976 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17977 (Bug#8437)
17978 * keyboard.c (parse_tool_bar_item): Likewise.
17979 * sound.c (sound_cleanup, alsa_close): Likewise.
17980 * termcap.c (tgetent): Likewise.
17981 * xfns.c (x_default_font_parameter): Likewise.
17982 * xsettings.c (read_and_apply_settings): Likewise.
17983
17984 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17985 (overrun_check_free): Protoize.
17986
17987 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17988
17989 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17990 since callers should never pass a negative size.
17991 Change the signature to match that of plain 'read' and 'write'; see
17992 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17993 * lisp.h: Update prototypes of emacs_write and emacs_read.
17994
17995 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17996
17997 * xdisp.c (redisplay_window): Don't try to determine the character
17998 position of the scroll margin if the window start point w->startp
17999 is outside the buffer's accessible region. (Bug#8468)
18000
18001 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18002
18003 Fix write-region and its subroutines for buffers > 2GB.
18004 * fileio.c (a_write, e_write): Modify declaration of arguments and
18005 local variables to support buffers larger than 2GB.
18006 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18007
18008 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18009 argument, local variables, and return value.
18010
18011 * lisp.h: Update prototypes of emacs_write and emacs_read.
18012
18013 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18014
18015 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18016
18017 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18018
18019 Fix more problems found by GCC 4.6.0's static checks.
18020
18021 * xdisp.c (vmessage): Use a better test for character truncation.
18022
18023 * charset.c (load_charset_map): <, not <=, for optimization,
18024 and to avoid potential problems with integer overflow.
18025 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18026 * casetab.c (set_identity, shuffle): Likewise.
18027 * editfns.c (Fformat): Likewise.
18028 * syntax.c (skip_chars): Likewise.
18029
18030 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18031 This also lets GCC 4.6.0 generate slightly better loop code.
18032
18033 * callint.c (Fcall_interactively): <, not <=, for optimization.
18034 (Fcall_interactively): Count the number of arguments produced,
18035 not the number of arguments given. This is simpler and lets GCC
18036 4.6.0 generate slightly better code.
18037
18038 * ftfont.c: Distingish more carefully between FcChar8 and char.
18039 The previous code passed unsigned char * to a functions like
18040 strlen and xstrcasecmp that expect char *, which does not
18041 conform to the C standard.
18042 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18043 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18044 char * when the C standard requires it.
18045
18046 * keyboard.c (read_char): Remove unused var.
18047
18048 * eval.c: Port to Windows vsnprintf (Bug#8435).
18049 Include <limits.h>.
18050 (SIZE_MAX): Define if the headers do not.
18051 (verror): Do not give up if vsnprintf returns a negative count.
18052 Instead, grow the buffer. This ports to Windows vsnprintf, which
18053 does not conform to C99. Problem reported by Eli Zaretskii.
18054 Also, simplify the allocation scheme, by avoiding the need for
18055 calling realloc, and removing the ALLOCATED variable.
18056
18057 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18058
18059 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18060 But keep the doprint source code for now, as we might revamp it
18061 and use it again (Bug#8435).
18062 * lisp.h (doprnt): Remove.
18063 * Makefile.in (base_obj): Remove doprnt.o.
18064 * deps.mk (doprnt.o): Remove.
18065
18066 error: Print 32- and 64-bit integers portably (Bug#8435).
18067 Without this change, on typical 64-bit hosts error ("...%d...", N)
18068 was used to print both 32- and 64-bit integers N, which relied on
18069 undefined behavior.
18070 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18071 * lisp.h (error, verror): Mark as printf-like functions.
18072 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18073 Report overflow in size calculations when allocating printf buffer.
18074 Do not truncate output string at its first null byte.
18075 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18076 Truncate the output at a character boundary, since vsnprintf does not
18077 do that.
18078 * charset.c (check_iso_charset_parameter): Convert internal
18079 character to string before calling 'error', since %c now has the
18080 printf meaning.
18081 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18082 overflow when computing char to be passed to 'error'. Do not
18083 pass Lisp_Object to 'error'; pass the integer instead.
18084 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18085 formatted with plain %d.
18086
18087 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18088
18089 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18090
18091 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18092
18093 * xterm.c (x_catch_errors): Remove duplicate declaration.
18094
18095 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18096
18097 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18098
18099 2011-04-10 Jim Meyering <meyering@redhat.com>
18100
18101 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18102 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18103 return ssize_t not "int", and use size_t as the buffer length.
18104 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18105 * gnutls.h: Update declarations.
18106 * process.c (read_process_output): Use ssize_t, to match.
18107 (send_process): Likewise.
18108
18109 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18110
18111 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18112
18113 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18114
18115 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18116 Use unsigned char, to match FcChar8 type definition.
18117
18118 * xterm.c (handle_one_xevent):
18119 * xmenu.c (create_and_show_popup_menu):
18120 * xselect.c (x_decline_selection_request)
18121 (x_reply_selection_request): Avoid type-punned deref of X events.
18122
18123 2011-04-09 Eli Zaretskii <eliz@gnu.org>
18124
18125 Fix some uses of `int' instead of EMACS_INT.
18126 * search.c (string_match_1, fast_string_match)
18127 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18128 (scan_buffer, find_next_newline_no_quit)
18129 (find_before_next_newline, search_command, Freplace_match)
18130 (Fmatch_data): Make some `int' variables be EMACS_INT.
18131
18132 * xdisp.c (display_count_lines): 3rd argument and return value now
18133 EMACS_INT. All callers changed.
18134 (pint2hrstr): Last argument is now EMACS_INT.
18135
18136 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18137 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18138 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18139 (decode_coding_utf_16, decode_coding_emacs_mule)
18140 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18141 (decode_coding_ccl, decode_coding_charset)
18142 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18143 (decode_coding_iso_2022, decode_coding_emacs_mule)
18144 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18145 <char_offset, last_offset>: Declare EMACS_INT.
18146 (encode_coding_utf_8, encode_coding_utf_16)
18147 (encode_coding_emacs_mule, encode_invocation_designation)
18148 (encode_designation_at_bol, encode_coding_iso_2022)
18149 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18150 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18151 Declare EMACS_INT.
18152 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18153 (encode_invocation_designation): Last argument P_NCHARS is now
18154 EMACS_INT.
18155 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18156 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18157
18158 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18159 All users changed.
18160
18161 * ccl.c (Fccl_execute_on_string): Declare some variables
18162 EMACS_INT.
18163
18164 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18165
18166 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18167
18168 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18169
18170 * process.c (Fformat_network_address): Doc fix.
18171
18172 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18173
18174 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18175
18176 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18177
18178 * keyboard.c (read_char): Call Lisp function help-form-show,
18179 instead of using internal_with_output_to_temp_buffer.
18180 (Qhelp_form_show): New var.
18181 (syms_of_keyboard): Use DEFSYM macro.
18182
18183 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18184
18185 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18186
18187 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18188
18189 * process.c (Flist_processes): Remove to Lisp.
18190 (list_processes_1): Delete.
18191
18192 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18193
18194 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18195
18196 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18197
18198 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18199
18200 Fix more problems found by GCC 4.6.0's static checks.
18201
18202 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18203
18204 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18205
18206 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18207
18208 * xdisp.c (vmessage): Mark as a printf-like function.
18209
18210 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18211
18212 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18213
18214 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18215 printf-like functions.
18216 (tiff_load): Add casts to remove these marks before passing them
18217 to system-supplied API.
18218
18219 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18220
18221 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18222 This avoids several warnings with gcc -Wstrict-overflow.
18223 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18224 directly, rather than having caller test rule sign. This avoids
18225 some unnecessary tests.
18226 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18227 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18228 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18229
18230 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18231 (xfont_open): Avoid unnecessary tests.
18232
18233 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18234
18235 * composite.h, composite.c (composition_gstring_put_cache):
18236 Use EMACS_INT, not int, for length.
18237
18238 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18239 breaking out part of COMPOSITION_DECODE_RULE.
18240 (COMPOSITION_DECODE_RULE): Use it.
18241 * composite.c (get_composition_id): Remove unused local vars,
18242 by using the new macro.
18243
18244 * textprop.c (set_text_properties_1): Change while to do-while,
18245 since the condition is always true at first.
18246
18247 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18248 (interval_deletion_adjustment): Return unsigned value.
18249 All uses changed.
18250
18251 * process.c (list_processes_1, create_pty, read_process_output):
18252 (exec_sentinel): Remove vars that were set but not used.
18253 (create_pty): Remove unnecessary "volatile"s.
18254 (Fnetwork_interface_info): Avoid possibility of int overflow.
18255 (read_process_output): Do adaptive read buffering even if carryover.
18256 (read_process_output): Simplify nbytes computation if buffered.
18257
18258 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18259
18260 * syntax.c (scan_words): Remove var that was set but not used.
18261 (update_syntax_table): Use unsigned instead of int.
18262
18263 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18264 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18265 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18266
18267 * print.c (print_error_message): Avoid int overflow.
18268
18269 * font.c (font_list_entities): Redo for clarity,
18270 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18271
18272 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18273 (font_score): Avoid potential overflow in diff calculation.
18274
18275 * fns.c (substring_both): Remove var that is set but not used.
18276 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18277
18278 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18279
18280 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18281 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18282 can always succeed if overflow has undefined behavior.
18283
18284 * search.c (boyer_moore, wordify): Remove vars set but not used.
18285 (wordify): Omit three unnecessary tests.
18286
18287 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18288 All callers changed. This avoids the need for an unused var.
18289
18290 * casefiddle.c (casify_region): Remove var that is set but not used.
18291
18292 * dired.c (file_name_completion): Remove var that is set but not used.
18293
18294 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18295
18296 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18297 (Finsert_file_contents): Remove unnecessary code checking fd.
18298
18299 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18300 Check for integer overflow on size calculations.
18301
18302 * buffer.c (Fprevious_overlay_change): Remove var that is set
18303 but not used.
18304
18305 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18306 Remove vars that are set but not used.
18307 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18308 (timer_check_2): Mark vars as initialized.
18309
18310 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18311
18312 * image.c (lookup_image): Remove var that is set but not used.
18313 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18314
18315 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18316 that are set but not used.
18317
18318 * xfns.c (make_invisible_cursor): Don't return garbage
18319 if XCreateBitmapFromData fails (Bug#8410).
18320
18321 * xselect.c (x_get_local_selection, x_handle_property_notify):
18322 Remove vars that are set but not used.
18323
18324 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18325 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18326
18327 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18328 Remove var that is set but not used.
18329 (scroll_bar_windows_size): Now size_t, not int.
18330 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18331 Check for overflow.
18332
18333 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18334 (map_tty_color) [!defined MSDOS]: Likewise.
18335
18336 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18337
18338 * coding.c: Remove vars that are set but not used.
18339 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18340 All callers changed.
18341 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18342 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18343 (decode_coding_charset): Remove vars that are set but not used.
18344
18345 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18346 that is set but not used.
18347
18348 * print.c (print_object): Remove var that is set but not used.
18349
18350 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18351 The gnulib version avoids calling malloc in the usual case,
18352 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18353 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18354 * filelock.c (current_lock_owner): Likewise.
18355 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18356 * sysdep.c: Include allocator.h, careadlinkat.h.
18357 (emacs_no_realloc_allocator): New static constant.
18358 (emacs_readlink): New function.
18359 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18360 ../lib/careadlinkat.h.
18361
18362 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18363
18364 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18365 first non-nil return value).
18366
18367 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18368
18369 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18370 if not defined (Bug#8403).
18371
18372 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18373
18374 * xdisp.c (display_count_lines): Remove parameter `start',
18375 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18376 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18377 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18378 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18379 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18380 and thereabouts. All callers changed.
18381 (get_per_char_metric): Remove parameter `f', unused since
18382 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18383
18384 2011-04-02 Jim Meyering <meyering@redhat.com>
18385
18386 do not dereference NULL upon failed strdup
18387 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18388 (ns_get_family): Likewise.
18389
18390 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18391
18392 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18393
18394 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18395
18396 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18397 later (Bug#8403).
18398
18399 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18400
18401 Add lexical binding.
18402
18403 * window.c (Ftemp_output_buffer_show): New fun.
18404 (Fsave_window_excursion):
18405 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18406
18407 * lread.c (lisp_file_lexically_bound_p): New function.
18408 (Fload): Bind Qlexical_binding.
18409 (readevalloop): Remove `evalfun' arg.
18410 Bind Qinternal_interpreter_environment.
18411 (Feval_buffer): Bind Qlexical_binding.
18412 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18413 Mark as dynamic.
18414 (syms_of_lread): Declare `lexical-binding'.
18415
18416 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18417
18418 * keyboard.c (eval_dyn): New fun.
18419 (menu_item_eval_property): Use it.
18420
18421 * image.c (parse_image_spec): Use Ffunctionp.
18422
18423 * fns.c (concat, mapcar1): Accept byte-code-functions.
18424
18425 * eval.c (Fsetq): Handle lexical vars.
18426 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18427 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18428 (FletX, Flet): Obey lexical binding.
18429 (Fcommandp): Handle closures.
18430 (Feval): New `lexical' arg.
18431 (eval_sub): New function extracted from Feval. Use it almost
18432 everywhere where Feval was used. Look up vars in lexical env.
18433 Handle closures.
18434 (Ffunctionp): Move from subr.el.
18435 (Ffuncall): Handle closures.
18436 (apply_lambda): Remove `eval_flags'.
18437 (funcall_lambda): Handle closures and new byte-code-functions.
18438 (Fspecial_variable_p): New function.
18439 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18440 but without exporting it to Lisp.
18441
18442 * doc.c (Fdocumentation, store_function_docstring):
18443 * data.c (Finteractive_form): Handle closures.
18444
18445 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18446 interactive spec.
18447
18448 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18449 New byte-codes.
18450 (exec_byte_code): New function extracted from Fbyte_code to handle new
18451 calling convention for byte-code-functions. Add new byte-codes.
18452
18453 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18454
18455 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18456
18457 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18458
18459 * xdisp.c (redisplay_internal): Fix prototype.
18460
18461 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18462
18463 * xdisp.c (SCROLL_LIMIT): New macro.
18464 (try_scrolling): Use it when setting scroll_limit.
18465 Limit scrolling to 100 screen lines.
18466 (redisplay_window): Even when falling back on "recentering",
18467 position point in the window according to scroll-conservatively,
18468 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18469
18470 (try_scrolling): When point is above the window, allow searching
18471 as far as scroll_max, or one screenful, to compute vertical
18472 distance from PT to the scroll margin position. This prevents
18473 try_scrolling from unnecessarily failing when
18474 scroll-conservatively is set to a value slightly larger than the
18475 window height. Clean up the case of PT below the margin at bottom
18476 of window: scroll_max can no longer be INT_MAX. When aggressive
18477 scrolling is in use, don't let point enter the opposite scroll
18478 margin as result of the scroll.
18479 (syms_of_xdisp) <scroll-conservatively>: Document the
18480 threshold of 100 lines for never-recentering scrolling.
18481
18482 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18483
18484 * dispextern.h (move_it_by_lines):
18485 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18486 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18487 (message_log_check_duplicate): Remove parameters `prev_bol' and
18488 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18489 (redisplay_internal): Remove parameter `preserve_echo_area',
18490 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18491
18492 * indent.c (Fvertical_motion):
18493 * window.c (window_scroll_pixel_based, Frecenter):
18494 Don't pass `need_y_p' to `move_it_by_lines'.
18495
18496 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18497
18498 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18499 steal a few bits to be more compact.
18500 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18501 Remove unneeded casts.
18502
18503 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18504
18505 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18506
18507 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18508 binding" message (bug#7967).
18509
18510 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18511
18512 Fix more problems found by GCC 4.6.0's static checks.
18513
18514 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18515 Remove unused local var.
18516
18517 * editfns.c (Fmessage_box): Remove unused local var.
18518
18519 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18520 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18521 Omit unused local vars.
18522 * window.c (shrink_windows): Omit unused local var.
18523 * menu.c (digest_single_submenu): Omit unused local var.
18524 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18525 Omit unused local var.
18526
18527 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18528 Don't assume string length fits in int.
18529 (keyremap_step, read_key_sequence): Use size_t for sizes.
18530 (read_key_sequence): Don't check last_real_key_start redundantly.
18531
18532 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18533 instead of alloca (Bug#8344).
18534
18535 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18536 (Fbacktrace_frame): Don't assume nframes fits in int.
18537
18538 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18539
18540 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18541 concerns.
18542
18543 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18544
18545 * cm.c (calccost): Turn while-do into do-while, for clarity.
18546
18547 * keyboard.c (syms_of_keyboard): Use the same style as later
18548 in this function when indexing through an array. This also
18549 works around GCC bug 48267.
18550
18551 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18552
18553 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18554
18555 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18556 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18557
18558 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18559 This avoids undefined behavior on integer overflow, and is a bit
18560 more convenient anyway since it is compared to a size_t variable.
18561
18562 Variadic C functions now count arguments with size_t, not int.
18563 This avoids an unnecessary limitation on 64-bit machines, which
18564 caused (substring ...) to crash on large vectors (Bug#8344).
18565 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18566 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18567 All variadic functions and their callers changed accordingly.
18568 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18569 * data.c (arith_driver, float_arith_driver): Likewise.
18570 * editfns.c (general_insert_function): Likewise.
18571 * eval.c (struct backtrace.nargs, interactive_p)
18572 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18573 (funcall_lambda, mark_backtrace): Likewise.
18574 * fns.c (concat): Likewise.
18575 * frame.c (x_set_frame_parameters): Likewise.
18576 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18577 0 if not found, not -1. All callers changed.
18578
18579 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18580 (stack_copy_size): Now size_t, not int.
18581 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18582
18583 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18584
18585 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18586 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18587 All callers changed.
18588
18589 * lisp.h (multibyte_char_to_unibyte):
18590 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18591 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18592 * character.h (CHAR_TO_BYTE8):
18593 * cmds.c (internal_self_insert):
18594 * editfns.c (general_insert_function):
18595 * keymap.c (push_key_description):
18596 * search.c (Freplace_match):
18597 * xdisp.c (message_dolog, set_message_1): All callers changed.
18598
18599 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18600
18601 * keyboard.c (safe_run_hook_funcall): New function.
18602 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18603 don't set the hook to nil, but remove the offending function instead.
18604 (Qcommand_hook_internal): Remove, unused.
18605 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18606 Vcommand_hook_internal.
18607
18608 * eval.c (enum run_hooks_condition): Remove.
18609 (funcall_nil, funcall_not): New functions.
18610 (run_hook_with_args): Call each function through a `funcall' argument.
18611 Remove `cond' argument, now redundant.
18612 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18613 (Frun_hook_with_args_until_failure): Adjust accordingly.
18614 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18615
18616 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18617
18618 * dispextern.h (string_buffer_position): Remove declaration.
18619
18620 * print.c (strout): Remove parameter `multibyte', unused since
18621 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18622
18623 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18624 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18625 All callers changed.
18626
18627 * w32.c (_wsa_errlist): Use braces for struct initializers.
18628
18629 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18630 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18631 All callers changed.
18632 (string_buffer_position): Likewise. Also, make static (it's never
18633 used outside xdisp.c).
18634 (cursor_row_p): Remove parameter `w', unused since
18635 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18636 (decode_mode_spec): Remove parameter `precision', introduced during
18637 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18638 All callers changed.
18639
18640 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18641
18642 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18643
18644 2011-03-27 Anders Lindgren <andlind@gmail.com>
18645
18646 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18647 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18648 (ns_update_auto_hide_menu_bar): New functions.
18649 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18650 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18651 ns_constrain_all_frames.
18652 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18653 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18654
18655 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18656
18657 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18658
18659 2011-03-27 Glenn Morris <rgm@gnu.org>
18660
18661 * syssignal.h: Replace RETSIGTYPE with void.
18662 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18663 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18664 Replace SIGTYPE with void everywhere.
18665 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18666 * s/template.h (SIGTYPE): Remove commented out definition.
18667
18668 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18669
18670 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18671 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18672
18673 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18674
18675 * w32.c (read_unc_volume): Use parameter `henum', instead of
18676 global variable `wget_enum_handle'.
18677
18678 * keymap.c (describe_vector): Remove parameters `indices' and
18679 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18680 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18681
18682 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18683
18684 * keyboard.c (timer_check): Remove parameter `do_it_now',
18685 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18686 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18687 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18688
18689 * keyboard.c (read_char):
18690 * w32menu.c (w32_menu_display_help):
18691 * xmenu.c (show_help_event, menu_help_callback):
18692 Adjust calls to `show_help_echo'.
18693
18694 * gtkutil.c (xg_maybe_add_timer):
18695 * keyboard.c (readable_events):
18696 * process.c (wait_reading_process_output):
18697 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18698
18699 * insdel.c (adjust_markers_gap_motion):
18700 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18701 (gap_left, gap_right): Don't call it.
18702
18703 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18704
18705 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18706 incurred during fontification.
18707
18708 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18709
18710 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18711 (DEFVAR_PER_BUFFER): Don't pass it.
18712
18713 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18714 (scrolling_window): Don't pass it.
18715
18716 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18717
18718 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18719
18720 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18721 and `suffix'.
18722 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18723 of variables specific to SELinux and computation of `encoded_absname'.
18724
18725 * image.c (XPutPixel): Remove unused variable `height'.
18726
18727 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18728
18729 * unexw32.c (get_section_info): Remove unused variable `section'.
18730
18731 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18732 (system_process_attributes): Remove unused variable `sess'.
18733 (sys_read): Remove unused variable `err'.
18734
18735 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18736 (w32_wnd_proc): Remove unused variable `isdead'.
18737 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18738 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18739 (x_create_tip_frame): Remove unused variable `tem'.
18740
18741 * w32inevt.c (w32_console_read_socket):
18742 Remove unused variable `no_events'.
18743
18744 * w32term.c (x_draw_composite_glyph_string_foreground):
18745 Remove unused variable `width'.
18746
18747 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18748
18749 * w32term.c (x_set_glyph_string_clipping):
18750 Don't pass uninitialized region to CombineRgn.
18751
18752 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18753
18754 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18755 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18756 (Fx_close_connection): Remove unused variable `i'.
18757
18758 * w32font.c (w32font_draw): Return number of glyphs.
18759 (w32font_open_internal): Remove unused variable `i'.
18760 (w32font_driver): Add missing initializer.
18761
18762 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18763 (fill_in_menu): Remove unused variable `items_added'.
18764
18765 * w32term.c (last_mouse_press_frame): Remove static global variable.
18766 (w32_clip_to_row): Remove unused variable `f'.
18767 (x_delete_terminal): Remove unused variable `i'.
18768
18769 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18770 (NOTHING): Remove unused static global variable.
18771 (uniscribe_check_otf): Remove unused variable `table'.
18772 (uniscribe_font_driver): Add missing initializers.
18773
18774 2011-03-23 Julien Danjou <julien@danjou.info>
18775
18776 * term.c (Fsuspend_tty, Fresume_tty):
18777 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18778 * window.c (temp_output_buffer_show):
18779 * insdel.c (signal_before_change):
18780 * frame.c (Fhandle_switch_frame):
18781 * fileio.c (Fdo_auto_save):
18782 * emacs.c (Fkill_emacs):
18783 * editfns.c (save_excursion_restore):
18784 * cmds.c (internal_self_insert):
18785 * callint.c (Fcall_interactively):
18786 * buffer.c (Fkill_all_local_variables):
18787 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18788 Use Frun_hooks.
18789 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18790 unconditionally since it does the check itself.
18791
18792 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18793
18794 Fix more problems found by GCC 4.5.2's static checks.
18795
18796 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18797 the first time through the loop, since we know p0 < p1 then.
18798 This also avoids a gcc -Wstrict-overflow warning.
18799
18800 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18801 leading to a memory leak, possible in functions like
18802 load_charset_map_from_file that can allocate an unbounded number
18803 of objects (Bug#8318).
18804
18805 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18806 that could (at least in theory) be that large.
18807
18808 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18809 This is less likely to overflow, and avoids undefined behavior if
18810 overflow does occur. All callers changed. Use strtoul to scan
18811 for the unsigned long integer.
18812 (pint2hrstr): Simplify and tune code slightly.
18813 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18814
18815 * scroll.c (do_scrolling): Work around GCC bug 48228.
18816 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18817
18818 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18819 This also avoids a warning with gcc -Wstrict-overflow.
18820 (validate_x_resource_name): Simplify count usage.
18821 This also avoids a warning with gcc -Wstrict-overflow.
18822
18823 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18824 fail (Bug#8306).
18825
18826 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18827
18828 * process.c (Fmake_network_process): Use socklen_t, not int,
18829 where POSIX says socklen_t is required in portable programs.
18830 This fixes a porting bug on hosts like 64-bit HP-UX, where
18831 socklen_t is wider than int (Bug#8277).
18832 (Fmake_network_process, server_accept_connection):
18833 (wait_reading_process_output, read_process_output):
18834 Likewise.
18835
18836 * process.c: Rename or move locals to avoid shadowing.
18837 (list_processes_1, Fmake_network_process):
18838 (read_process_output_error_handler, exec_sentinel_error_handler):
18839 Rename or move locals.
18840 (Fmake_network_process): Define label "retry_connect" only if needed.
18841 (Fnetwork_interface_info): Fix pointer signedness.
18842 (process_send_signal): Add cast to avoid pointer signedness problem.
18843 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18844 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18845
18846 Make tparam.h and terminfo.c consistent.
18847 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18848 Include tparam.h instead, since it declares them.
18849 * cm.h (PC): Remove extern decl; tparam.h now does this.
18850 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18851 * terminfo.c: Include tparam.h, to check interfaces.
18852 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18853 (tparam): Adjust signature to match interface in tparam.h;
18854 this removes some undefined behavior. Check that outstring and len
18855 are zero, which they always are with Emacs.
18856 * tparam.h (PC, BC, UP): New extern decls.
18857
18858 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18859 (xftfont_open): Rename locals to avoid shadowing.
18860
18861 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18862 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18863 (OTF_TAG_SYM): Omit macro if not needed.
18864 (ftfont_list): Remove unused local.
18865 (get_adstyle_property, ftfont_pattern_entity):
18866 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18867 Rename locals to avoid shadowing.
18868
18869 * xfont.c (xfont_list_family): Mark var as initialized.
18870
18871 * xml.c (make_dom): Now static.
18872
18873 * composite.c (composition_compute_stop_pos): Rename local to
18874 avoid shadowing.
18875 (composition_reseat_it): Remove unused locals.
18876 (find_automatic_composition, composition_adjust_point): Likewise.
18877 (composition_update_it): Mark var as initialized.
18878 (find_automatic_composition): Mark vars as initialized,
18879 with a FIXME (Bug#8290).
18880
18881 character.h: Rename locals to avoid shadowing.
18882 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18883 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18884 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18885 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18886 to avoid shadowing.
18887
18888 * textprop.c (property_change_between_p): Remove; unused.
18889
18890 * intervals.c (interval_start_pos): Now static.
18891
18892 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18893
18894 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18895 Rename locals to avoid shadowing.
18896
18897 * sound.c (wav_play, au_play, Fplay_sound_internal):
18898 Fix pointer signedness.
18899 (alsa_choose_format): Remove unused local var.
18900 (wav_play): Initialize a variable to 0, to prevent undefined
18901 behavior (Bug#8278).
18902
18903 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18904
18905 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18906
18907 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18908 clobbering (Bug#8298).
18909 * sysdep.c (sys_subshell): Likewise.
18910 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18911
18912 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18913 This should get cleaned up, so that child_setup has the
18914 same signature on all platforms.
18915
18916 * callproc.c (call_process_cleanup): Now static.
18917 (relocate_fd): Rename locals to avoid shadowing.
18918
18919 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18920
18921 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18922 not to be necessary, and produces flickering.
18923
18924 2011-03-20 Glenn Morris <rgm@gnu.org>
18925
18926 * config.in: Remove file.
18927
18928 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18929
18930 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18931 are now in src/globals.h.
18932 (syms_of_minibuf): Remove spurious & from previous change.
18933
18934 2011-03-20 Leo Liu <sdl.web@gmail.com>
18935
18936 * minibuf.c (completing-read-function): New variable.
18937 (completing-read-default): Rename from completing-read.
18938 (completing-read): Call completing-read-function.
18939
18940 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18941
18942 * xfaces.c (Fx_load_color_file):
18943 Read color file from absolute filename (bug#8250).
18944
18945 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18946
18947 * makefile.w32-in: Update dependencies.
18948
18949 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18950
18951 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18952
18953 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18954
18955 Fix more problems found by GCC 4.5.2's static checks.
18956
18957 * process.c (make_serial_process_unwind, send_process_trap):
18958 (sigchld_handler): Now static.
18959
18960 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18961 That way, the code declares only the vars that it needs.
18962 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18963 * s/cygwin.h (PTY_ITERATION): Likewise.
18964 * s/darwin.h (PTY_ITERATION): Likewise.
18965 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18966
18967 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18968 * process.c (allocate_pty): Don't declare stb unless it's needed.
18969
18970 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18971 (CONSTANTLIM): Remove; unused.
18972 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18973 Define only if needed.
18974
18975 * unexelf.c (unexec): Name an expression,
18976 to avoid gcc -Wbad-function-cast warning.
18977 Use a different way to cause a compilation error if anyone uses
18978 n rather than nn, a way that does not involve shadowing.
18979 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18980
18981 * deps.mk (unexalpha.o): Remove; unused.
18982
18983 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18984 * unexec.h: New file.
18985 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18986 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18987 Depend on unexec.h.
18988 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18989 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18990 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18991 Change as necessary to match prototype in unexec.h.
18992
18993 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18994 shadowing.
18995 (back_comment, skip_chars): Mark vars as initialized.
18996
18997 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18998 Rename locals to avoid shadowing.
18999
19000 * lread.c (read1): Rewrite so as not to use empty "else".
19001 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19002
19003 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19004
19005 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19006 warning when compiling print.c.
19007
19008 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19009 instead of using an uninitialized var.
19010 (font_sort_entities): Mark var as initialized.
19011
19012 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19013
19014 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19015 pointers to constants.
19016 (font_parse_fcname): Remove unused vars.
19017 (font_delete_unmatched): Now static.
19018 (font_get_spec): Remove; unused.
19019 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19020 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19021 Rename or move locals to avoid shadowing.
19022
19023 * fns.c (require_nesting_list, require_unwind): Now static.
19024 (Ffillarray): Rename locals to avoid shadowing.
19025
19026 * floatfns.c (domain_error2): Define only if needed.
19027 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19028
19029 * alloc.c (mark_backtrace): Move decl from here ...
19030 * lisp.h: ... to here, so that it can be checked.
19031
19032 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19033 (Fdefvar): Rewrite so as not to use empty "else".
19034 (lisp_indirect_variable): Name an expression,
19035 to avoid gcc -Wbad-function-cast warning.
19036 (Fdefvar): Rename locals to avoid shadowing.
19037
19038 * callint.c (quotify_arg, quotify_args): Now static.
19039 (Fcall_interactively): Rename locals to avoid shadowing.
19040 Use const pointer when appropriate.
19041
19042 * lisp.h (get_system_name, get_operating_system_release):
19043 Move decls here, to check interfaces.
19044 * process.c (get_operating_system_release): Move decl to lisp.h.
19045 * xrdb.c (get_system_name): Likewise.
19046 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19047 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19048 some of which prompt warnings from gcc -Wbad-function-cast.
19049 (Fformat_time_string, Fencode_time, Finsert_char):
19050 (Ftranslate_region_internal, Fformat):
19051 Rename or remove local vars to avoid shadowing.
19052 (Ftranslate_region_internal): Mark var as initialized.
19053
19054 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19055 avoid shadowing.
19056
19057 * lisp.h (eassert): Check that the argument compiles, even if
19058 ENABLE_CHECKING is not defined.
19059
19060 * data.c (Findirect_variable): Name an expression, to avoid
19061 gcc -Wbad-function-cast warning.
19062 (default_value, arithcompare, arith_driver, arith_error): Now static.
19063 (store_symval_forwarding): Rename local to avoid shadowing.
19064 (Fmake_variable_buffer_local, Fmake_local_variable):
19065 Mark variables as initialized.
19066 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19067
19068 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19069 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19070 Rename locals to avoid shadowing.
19071 (mark_stack): Move local variables into the #ifdef region where
19072 they're used.
19073 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19074 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19075 needed otherwise.
19076 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19077 (GC_STRING_CHARS): Remove; not used.
19078 (Fmemory_limit): Cast sbrk's returned value to char *.
19079
19080 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19081 avoids undefined behavior in theory.
19082
19083 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19084
19085 Use functions, not macros, for up- and down-casing (Bug#8254).
19086 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19087 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19088 to use the following functions instead of these macros.
19089 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19090 EMACS_INT, since callers assume the returned value fits in int.
19091 (upcase1): Likewise, for UPCASE_TABLE.
19092 (uppercasep, lowercasep, upcase): New static inline functions.
19093 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19094 the race-condition problem in the old DOWNCASE.
19095
19096 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19097 Rename locals to avoid shadowing.
19098 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19099 (regex_compile, re_search_2, re_match_2_internal):
19100 Remove unused local vars.
19101 (FREE_VAR): Rewrite so as not to use empty "else",
19102 which gcc can warn about.
19103 (regex_compile, re_match_2_internal): Mark locals as initialized.
19104 (RETALLOC_IF): Define only if needed.
19105 (WORDCHAR_P): Likewise. This one is never needed, but is used
19106 only in a comment talking about a compiler bug, so put inside
19107 the #if 0 of that comment.
19108 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19109 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19110 Remove; unused.
19111
19112 * search.c (boyer_moore): Rename locals to avoid shadowing.
19113 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19114 (PREV_CHAR_BOUNDARY): Likewise.
19115
19116 * search.c (simple_search): Remove unused var.
19117
19118 * dired.c (compile_pattern): Move decl from here ...
19119 * lisp.h: ... to here, so that it can be checked.
19120 (struct re_registers): New forward decl.
19121
19122 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19123
19124 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19125 All uses changed.
19126 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19127 Rename locals to avoid shadowing.
19128 (Fvertical_motion): Mark locals as initialized.
19129
19130 * casefiddle.c (casify_object, casify_region): Now static.
19131 (casify_region): Mark local as initialized.
19132
19133 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19134
19135 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19136 New macros, so that the caller can use some names other than
19137 gcpro1, gcpro2, etc.
19138 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19139 of the new macros.
19140 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19141 argument, for consistency with GCPRO2_VAR, etc: it is now the
19142 prefix of the variable, not the variable itself. All uses
19143 changed.
19144 * dired.c (directory_files_internal, file_name_completion):
19145 Rename locals to avoid shadowing.
19146
19147 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19148 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19149 dired.c's scmp function, had undefined behavior.
19150 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19151 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19152 * buffer.h: ... to here, because these macros use current_buffer,
19153 and the new implementation with inline functions needs to have
19154 current_buffer in scope now, rather than later when the macros
19155 are used.
19156 (downcase, upcase1): New static inline functions.
19157 (DOWNCASE, UPCASE1): Reimplement using these functions.
19158 This avoids undefined behavior in expressions like
19159 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19160 from race conditions in accessing the global variables
19161 case_temp1 and case_temp2.
19162 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19163 * lisp.h (case_temp1, case_temp2): Remove their decls.
19164 * character.h (ASCII_CHAR_P): Move from here ...
19165 * lisp.h: ... to here, so that the inline functions mentioned
19166 above can use them.
19167
19168 * dired.c (directory_files_internal_unwind): Now static.
19169
19170 * fileio.c (file_name_as_directory, directory_file_name):
19171 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19172 Now static.
19173 (file_name_as_directory): Use const pointers when appropriate.
19174 (Fexpand_file_name): Likewise. In particular, newdir might
19175 point at constant storage, so make it a const pointer.
19176 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19177 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19178 signedness issues.
19179 (Fset_file_times, Finsert_file_contents, auto_save_error):
19180 Rename locals to avoid shadowing.
19181
19182 * minibuf.c (choose_minibuf_frame_1): Now static.
19183 (Ftry_completion, Fall_completions): Rename or remove locals
19184 to avoid shadowing.
19185
19186 * marker.c (bytepos_to_charpos): Remove; unused.
19187
19188 * lisp.h (verify_bytepos, count_markers): New decls,
19189 so that gcc does not warn that these functions aren't declared.
19190
19191 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19192 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19193 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19194 (copy_text): Remove unused local var.
19195
19196 * filelock.c (within_one_second): Now static.
19197 (lock_file_1): Rename local to avoid shadowing.
19198
19199 * buffer.c (fix_overlays_before): Mark locals as initialized.
19200 (fix_start_end_in_overlays): Likewise. This function should be
19201 simplified by using pointers-to-pointers, but that's a different
19202 matter.
19203 (switch_to_buffer_1): Now static.
19204 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19205 (report_overlay_modification): Rename locals to avoid shadowing.
19206
19207 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19208 Fix pointer signedness issue.
19209 (sys_subshell): Mark local as volatile if checking for lint,
19210 to suppress a gcc -Wclobbered warning that does not seem to be right.
19211 (MAXPATHLEN): Define only if needed.
19212
19213 * process.c (serial_open, serial_configure): Move decls from here ...
19214 * systty.h: ... to here, so that they can be checked.
19215
19216 * fns.c (get_random, seed_random): Move extern decls from here ...
19217 * lisp.h: ... to here, so that they can be checked.
19218
19219 * sysdep.c (reset_io): Now static.
19220 (wait_for_termination_signal): Remove; unused.
19221
19222 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19223 (copy_keymap_item, append_key, push_text_char_description):
19224 Now static.
19225 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19226 (DENSE_TABLE_SIZE): Remove; unused.
19227 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19228 (describe_map_tree):
19229 Rename locals to avoid shadowing.
19230
19231 * keyboard.c: Declare functions static if they are not used elsewhere.
19232 (echo_char, echo_dash, cmd_error, top_level_2):
19233 (poll_for_input, handle_async_input): Now static.
19234 (read_char, kbd_buffer_get_event, make_lispy_position):
19235 (make_lispy_event, make_lispy_movement, apply_modifiers):
19236 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19237 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19238 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19239 (read_key_sequence, read_char): Mark locals as initialized.
19240 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19241
19242 * keyboard.h (make_ctrl_char): New decl.
19243 (mark_kboards): Move decl here ...
19244 * alloc.c (mark_kboards): ... from here.
19245
19246 * lisp.h (force_auto_save_soon): New decl.
19247
19248 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19249 (DEFINE_DUMMY_FUNCTION): New macro.
19250 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19251 Use it.
19252 (main): Add casts to avoid warnings
19253 if GCC considers string literals to be constants.
19254
19255 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19256
19257 * dbusbind.c: Pointer signedness fixes.
19258 (xd_signature, xd_append_arg, xd_initialize):
19259 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19260 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19261 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19262 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19263
19264 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19265 if GCC considers string literals to be constants.
19266 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19267
19268 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19269
19270 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19271 (print_preprocess, print_object): New macro to fix last change.
19272
19273 * print.c (print_preprocess): Don't forget font objects.
19274
19275 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19276
19277 * emacs.c (USAGE3): Doc fixes.
19278
19279 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19280
19281 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19282 structure.
19283
19284 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19285
19286 * lisp.h (VWindow_system, Qfile_name_history):
19287 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19288 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19289 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19290
19291 * w32select.c: Don't #include "keyboard.h".
19292 (run_protected): Add extern declaration for waiting_for_input.
19293
19294 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19295 * w32console.c (detect_input_pending, read_input_pending)
19296 (encode_terminal_code):
19297 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19298 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19299 (w32_system_caret_y, Qfile_name_history):
19300 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19301 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19302 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19303 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19304 * w32proc.c (Qlocal, report_file_error):
19305 * w32term.c (Vwindow_system, updating_frame):
19306 * w32uniscribe.c (initialized, uniscribe_font_driver):
19307 Remove unneeded extern declarations.
19308
19309 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19310
19311 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19312
19313 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19314
19315 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19316 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19317 These macros can no longer be used for assignment.
19318
19319 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19320 Assign struct members directly, instead of using BUF_BEGV etc.
19321 (record_buffer_markers, fetch_buffer_markers): New functions for
19322 recording and fetching special buffer markers.
19323 (set_buffer_internal_1, set_buffer_temp): Use them.
19324
19325 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19326
19327 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19328
19329 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19330 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19331
19332 * xdisp.c (hscroll_window_tree):
19333 (reconsider_clip_changes): Use PT instead of BUF_PT.
19334
19335 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19336
19337 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19338 $(EMACS_ROOT)/lib/intprops.h.
19339
19340 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19341
19342 Fix more problems found by GCC 4.5.2's static checks.
19343
19344 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19345 to unsigned char * to avoid compiler diagnostic.
19346 (xg_free_frame_widgets): Make it clear that a local variable is
19347 needed only if USE_GTK_TOOLTIP.
19348 (gdk_window_get_screen): Make it clear that this macro is needed
19349 only if USE_GTK_TOOLTIP.
19350 (int_gtk_range_get_value): New function, which avoids a diagnostic
19351 from gcc -Wbad-function-cast.
19352 (xg_set_toolkit_scroll_bar_thumb): Use it.
19353 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19354 diagnostic from gcc -Wbad-function-cast.
19355 (get_utf8_string, xg_get_file_with_chooser):
19356 Rename locals to avoid shadowing.
19357 (create_dialog): Move locals to avoid shadowing.
19358
19359 * xgselect.c (xg_select): Remove unused var.
19360
19361 * image.c (four_corners_best): Mark locals as initialized.
19362 (gif_load): Initialize transparent_p to zero (Bug#8238).
19363 Mark another local as initialized.
19364 (my_png_error, my_error_exit): Mark with NO_RETURN.
19365
19366 * image.c (clear_image_cache): Now static.
19367 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19368 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19369 (x_edge_detection): Remove unnecessary cast that
19370 gcc -Wbad-function-cast diagnoses.
19371 (gif_load): Fix pointer signedness.
19372 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19373 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19374
19375 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19376
19377 Improve quality of tests for time stamp overflow.
19378 For example, without this patch (encode-time 0 0 0 1 1
19379 1152921504606846976) returns the obviously-bogus value (-948597
19380 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19381 reports time overflow. See
19382 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19383 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19384 * editfns.c: Include limits.h and intprops.h.
19385 (TIME_T_MIN, TIME_T_MAX): New macros.
19386 (time_overflow): Move earlier, to before first use.
19387 (hi_time, lo_time): New functions, for an accurate test for
19388 out-of-range times.
19389 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19390 (Fget_internal_run_time): Don't assume time_t fits in int.
19391 (make_time): Use list2 instead of Fcons twice.
19392 (Fdecode_time): More accurate test for out-of-range times.
19393 (check_tm_member): New function.
19394 (Fencode_time): Use it, to test for out-of-range times.
19395 (lisp_time_argument): Don't rely on undefined left-shift and
19396 right-shift behavior when checking for time stamp overflow.
19397
19398 * editfns.c (time_overflow): New function, refactoring common code.
19399 (Fformat_time_string, Fdecode_time, Fencode_time):
19400 (Fcurrent_time_string): Use it.
19401
19402 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19403 * dired.c (make_time): Move to ...
19404 * editfns.c (make_time): ... here.
19405 * systime.h: Note the move.
19406
19407 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19408
19409 * fringe.c (update_window_fringes): Remove unused variables.
19410
19411 * unexmacosx.c (copy_data_segment): Also copy __got section.
19412 (Bug#8223)
19413
19414 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19415
19416 * termcap.c [MSDOS]: Include "msdos.h".
19417 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19418 Constify `char *' arguments and their references according to
19419 prototypes in tparam.h.
19420
19421 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19422
19423 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19424 Adapt all references accordingly.
19425
19426 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19427
19428 2011-03-11 Tom Tromey <tromey@redhat.com>
19429
19430 * buffer.c (syms_of_buffer): Remove obsolete comment.
19431
19432 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19433
19434 * termhooks.h (encode_terminal_code): Declare prototype.
19435
19436 * msdos.c (encode_terminal_code): Don't declare prototype.
19437
19438 * term.c (encode_terminal_code): Now external again, used by
19439 w32console.c and msdos.c.
19440
19441 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19442 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19443
19444 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19445
19446 Fix some minor problems found by GCC 4.5.2's static checks.
19447
19448 * fringe.c (update_window_fringes): Mark locals as initialized
19449 (Bug#8227).
19450 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19451
19452 * alloc.c (mark_fringe_data): Move decl from here ...
19453 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19454 to check its interface.
19455 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19456
19457 * fontset.c (free_realized_fontset): Now static.
19458 (Fset_fontset_font): Rename local to avoid shadowing.
19459 (fontset_font): Mark local as initialized.
19460 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19461
19462 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19463
19464 * xselect.c (x_disown_buffer_selections): Remove; not used.
19465 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19466 (x_own_selection, Fx_disown_selection_internal): Rename locals
19467 to avoid shadowing.
19468 (x_handle_dnd_message): Remove local to avoid shadowing.
19469
19470 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19471 so that the caller can use some name other than gcpro1.
19472 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19473 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19474 (Fx_backspace_delete_keys_p):
19475 Use them to avoid shadowing, and rename vars to avoid shadowing.
19476 (x_decode_color, x_set_name, x_window): Now static.
19477 (Fx_create_frame): Add braces to silence GCC warning.
19478 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19479 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19480 Remove unused locals.
19481 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19482 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19483 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19484 macros.
19485
19486 * xterm.h (x_mouse_leave): New decl.
19487
19488 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19489 Remove unused functions.
19490 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19491 (x_calc_absolute_position): Now static.
19492 (XTread_socket): Don't define label "out" unless it's used.
19493 Don't declare local "event" unless it's used.
19494 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19495 unless they are used.
19496 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19497 (x_fatal_error_signal): Remove; not used.
19498 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19499 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19500 (x_error_catcher, x_connection_closed, x_error_handler):
19501 (x_error_quitter, xembed_send_message, x_iconify_frame):
19502 (my_log_handler): Rename locals to avoid shadowing.
19503 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19504 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19505
19506 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19507 Rename or move locals to avoid shadowing.
19508 (tty_defined_color, merge_face_heights): Now static.
19509 (free_realized_faces_for_fontset): Remove; not used.
19510 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19511 does not deduce is never used uninitialized.
19512 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19513 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19514
19515 * terminal.c (store_terminal_param): Now static.
19516
19517 * xmenu.c (menu_highlight_callback): Now static.
19518 (set_frame_menubar): Remove unused local.
19519 (xmenu_show): Rename parameter to avoid shadowing.
19520 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19521 since they might point to immutable storage.
19522 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19523 since it's unused otherwise.
19524
19525 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19526 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19527 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19528 avoids a gcc -Wuninitialized diagnostic.
19529 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19530 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19531 does not deduce are never used uninitialized.
19532
19533 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19534
19535 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19536 * window.c (window_loop, size_window):
19537 (run_window_configuration_change_hook, enlarge_window): Likewise.
19538
19539 * window.c (display_buffer): Now static.
19540 (size_window): Mark variables that gcc -Wuninitialized
19541 does not deduce are never used uninitialized.
19542 * window.h (check_all_windows): New decl, to forestall
19543 gcc -Wmissing-prototypes diagnostic.
19544 * dispextern.h (bidi_dump_cached_states): Likewise.
19545
19546 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19547 shadowing.
19548 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19549 Include <limits.h>.
19550 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19551 and to avoid gcc -Wuninitialized warning.
19552 (load_charset_map): Mark variables that gcc -Wuninitialized
19553 does not deduce are never used uninitialized.
19554 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19555
19556 * coding.c (coding_set_source, coding_set_destination):
19557 Use "else { /* comment */ }" rather than "else /* comment */;"
19558 for clarity, and to avoid gcc -Wempty-body warning.
19559 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19560 a block, when the outer 'i' will do.
19561 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19562 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19563 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19564 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19565 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19566 Rename locals to avoid shadowing.
19567 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19568 * coding.c (emacs_mule_char, encode_invocation_designation):
19569 Now static, since they're not used elsewhere.
19570 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19571 (decode_coding_object, encode_coding_object, detect_coding_system):
19572 (decode_coding_emacs_mule): Mark variables that gcc
19573 -Wuninitialized does not deduce are never used uninitialized.
19574 (detect_coding_iso_2022): Initialize a local variable that might
19575 be used uninitialized. Leave a FIXME because it's not clear that
19576 this initialization is needed. (Bug#8211)
19577 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19578 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19579 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19580 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19581 Remove unused macros.
19582
19583 * category.c (hash_get_category_set): Remove unused local var.
19584 (copy_category_table): Now static, since it's not used elsewhere.
19585 * character.c (string_count_byte8): Likewise.
19586
19587 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19588 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19589
19590 * chartab.c (copy_sub_char_table): Now static, since it's not used
19591 elsewhere.
19592 (sub_char_table_ref_and_range, char_table_ref_and_range):
19593 Rename locals to avoid shadowing.
19594 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19595
19596 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19597 (BIDI_BOB): Remove unused macro.
19598
19599 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19600 deduce are never used uninitialized.
19601 * term.c (encode_terminal_code): Likewise.
19602
19603 * term.c (encode_terminal_code): Now static. Remove unused local.
19604
19605 * tparam.h: New file.
19606 * term.c, tparam.h: Include it.
19607 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19608 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19609 Move these decls to tparam.h, and make them agree with what
19610 is actually in tparam.c. The previous trick of using incompatible
19611 decls in different modules does not conform to the C standard.
19612 All callers of tparam changed to use tparam's actual API.
19613 * tparam.c (tparam1, tparam, tgoto):
19614 Use const pointers where appropriate.
19615
19616 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19617 * cm.h (struct cm): Likewise.
19618 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19619 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19620 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19621 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19622 (turn_on_face, init_tty): Likewise.
19623 * termchar.h (struct tty_display_info): Likewise.
19624
19625 * term.c (term_mouse_position): Rename local to avoid shadowing.
19626
19627 * alloc.c (mark_ttys): Move decl from here ...
19628 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19629
19630 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19631
19632 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19633
19634 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19635
19636 * search.c (compile_pattern_1): Remove argument regp, unused since
19637 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19638 (compile_pattern): Don't pass it.
19639
19640 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19641
19642 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19643 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19644 for ! HAVE_GTK3.
19645 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19646
19647 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19648
19649 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19650 gdk_window_get_screen, gdk_window_get_geometry,
19651 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19652 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19653 (xg_get_pixbuf_from_pixmap): New function.
19654 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19655 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19656 Call xg_get_pixbuf_from_pixmap instead of
19657 gdk_pixbuf_get_from_drawable.
19658 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19659 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19660 (xg_check_special_colors): Use GtkStyleContext and its functions
19661 for HAVE_GTK3.
19662 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19663 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19664 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19665 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19666 Call gtk_widget_get_preferred_size.
19667 (xg_frame_resized): gdk_window_get_geometry only takes 5
19668 parameters.
19669 (xg_win_to_widget, xg_event_is_for_menubar):
19670 Call gdk_x11_window_lookup_for_display.
19671 (xg_set_widget_bg): New function.
19672 (delete_cb): New function.
19673 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19674 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19675 (xg_set_background_color): Call xg_set_widget_bg.
19676 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19677 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19678 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19679 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19680 if ! HAVE_GTK3.
19681 (update_frame_tool_bar): Call gtk_widget_hide.
19682 (xg_initialize): Use GDK_KEY_g.
19683
19684 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19685 if ! HAVE_GTK3
19686 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19687
19688 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19689 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19690 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19691
19692 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19693
19694 * w32xfns.c (select_palette): Check success of RealizePalette against
19695 GDI_ERROR, not zero.
19696
19697 See ChangeLog.11 for earlier changes.
19698
19699 ;; Local Variables:
19700 ;; coding: utf-8
19701 ;; End:
19702
19703 Copyright (C) 2011-2013 Free Software Foundation, Inc.
19704
19705 This file is part of GNU Emacs.
19706
19707 GNU Emacs is free software: you can redistribute it and/or modify
19708 it under the terms of the GNU General Public License as published by
19709 the Free Software Foundation, either version 3 of the License, or
19710 (at your option) any later version.
19711
19712 GNU Emacs is distributed in the hope that it will be useful,
19713 but WITHOUT ANY WARRANTY; without even the implied warranty of
19714 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19715 GNU General Public License for more details.
19716
19717 You should have received a copy of the GNU General Public License
19718 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.