]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Fix SIGDANGER handlers, for AIX.
[gnu-emacs] / src / ChangeLog
1 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix SIGDANGER handlers, for AIX (Bug#13408).
4 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
5 Move handlers here from emacs.c; they were out of place.
6
7 2013-01-05 Eli Zaretskii <eliz@gnu.org>
8
9 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
10 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
11 digits for buffer positions, before misalignment starts. Display
12 "0" for integer "object" field.
13 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
14 Display the newline glyph more unambiguously.
15
16 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17
18 * nsterm.m (ns_draw_underwave):
19 * w32term.c (w32_draw_underwave):
20 * xterm.c (x_draw_underwave): Make underwave look more triangular
21 and also degrade gracefully for small fonts. (Bug#13000)
22
23 * nsterm.m (ns_draw_text_decoration):
24 * w32term.c (x_draw_glyph_string):
25 * xterm.c (x_draw_glyph_string): Don't use previous underline
26 thickness and position if previous underline type is underwave.
27
28 2012-12-31 Glenn Morris <rgm@gnu.org>
29
30 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
31
32 2012-12-29 Andreas Schwab <schwab@linux-m68k.org>
33
34 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
35 (LIBS_GNUSTEP): Define.
36 (LIBES): Add $(LIBS_GNUSTEP).
37 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
38
39 2012-12-27 Eli Zaretskii <eliz@gnu.org>
40
41 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
42 continuation glyph on a TTY with an indication of an empty line.
43 (Bug#13277)
44
45 2012-12-27 Glenn Morris <rgm@gnu.org>
46
47 * cygw32.c (Fcygwin_convert_file_name_to_windows)
48 (Fcygwin_convert_file_name_from_windows): Doc fixes.
49
50 2012-12-24 Eli Zaretskii <eliz@gnu.org>
51
52 * fileio.c (file_name_as_directory, directory_file_name): Accept
53 an additional argument MULTIBYTE to indicate whether the input C
54 came from a multibyte or a unibyte Lisp string; all callers
55 adjusted. Don't assume the input string is always multibyte.
56 (Bug#13262)
57 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
58 don't ENCODE_FILE them, and return a unibyte string if the input
59 was unibyte.
60 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
61 don't assume the input strings will always be multibyte. If the
62 input strings are multibyte, decode strings obtained from C
63 library functions.
64
65 2012-12-22 Martin Rudalics <rudalics@gmx.at>
66
67 * window.c (Fselect_window): Reword doc-string (Bug#13248).
68
69 2012-12-21 Eli Zaretskii <eliz@gnu.org>
70
71 * fileio.c (Finsert_file_contents): Doc fix.
72
73 * w32proc.c (new_child, delete_child, find_child_pid): For a
74 subprocess, consider its slot being in use as long as its process
75 handle (procinfo.hProcess) is not NULL. This avoids reusing the
76 slot when a new process is started immediately after killing
77 another one, without waiting enough time for the first process to
78 be reaped and resources allocated for it be orderly freed.
79 (Bug#13086)
80 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
81
82 2012-12-21 Chong Yidong <cyd@gnu.org>
83
84 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
85
86 2012-12-15 Chong Yidong <cyd@gnu.org>
87
88 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
89
90 2012-12-14 Eli Zaretskii <eliz@gnu.org>
91
92 * w32.c (get_name_and_id): Always pass NULL as the first argument
93 of lookup_account_sid. Avoids crashes with UNC file names that
94 refer to DFS domains, not to specific machine names. (Bug#12621)
95 Remove now unused argument FNAME; all callers changed.
96 (get_file_owner_and_group): Remove now unused argument FNAME; all
97 callers changed.
98
99 2012-12-11 Eli Zaretskii <eliz@gnu.org>
100
101 * search.c (search_buffer): Check the inverse translations of each
102 character in pattern when the buffer being searched is unibyte.
103 (Bug#13084)
104
105 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
106
107 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
108 files, fixing a regression from 24.2.
109 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
110
111 2012-12-08 Jan Djärv <jan.h.d@swipnet.se>
112
113 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
114
115 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
116
117 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
118 DWORD_PTR, for compatibility with 64-bit builds.
119
120 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
121 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
122 (system_process_attributes): Use SIZE_T rather than DWORD, for
123 compatibility with 64-bit builds.
124
125 2012-12-08 Christopher Schmidt <christopher@ch.ristopher.com>
126
127 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
128
129 2012-12-07 Eli Zaretskii <eliz@gnu.org>
130
131 * indent.c (Fvertical_motion): If a display string will be
132 displayed on the left or the right margin, don't consider it as a
133 factor in cursor positioning. (Bug#13108)
134
135 2012-12-07 Martin Rudalics <rudalics@gmx.at>
136
137 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
138
139 2012-12-05 Eli Zaretskii <eliz@gnu.org>
140
141 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
142 fails, signal an error instead of continuing with an empty
143 string. (Bug#13079)
144 Encode expanded temp file pattern before passing it to mkstemp or
145 mktemp.
146
147 2012-12-04 Eli Zaretskii <eliz@gnu.org>
148
149 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
150 Encode the file name before passing it to dostounix_filename, in
151 case it will downcase it (under w32-downcase-file-names).
152 (Bug#12933)
153
154 2012-12-01 Chong Yidong <cyd@gnu.org>
155
156 * fileio.c (Vauto_save_list_file_name): Doc fix.
157
158 2012-11-30 Fabrice Popineau <fabrice.popineau@gmail.com>
159
160 * w32fns.c: Remove prototype of atof.
161 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
162 builds.
163 (file_dialog_callback): Declared UINT_PTR.
164
165 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
166 with 64-bit builds.
167
168 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
169 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
170 defined.
171
172 2012-11-27 Glenn Morris <rgm@gnu.org>
173
174 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
175
176 2012-11-26 Eli Zaretskii <eliz@gnu.org>
177
178 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
179 (Bug#11964)
180
181 2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
182
183 Revert recent change for Bug#8855.
184 As reported by Harald Hanche-Olsen in
185 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00445.html>
186 the change introduces a further bug, of creating lots of zombie
187 processes in some cases. Further work is needed to come up with a
188 better fix for Bug#8855.
189
190 2012-11-24 Eli Zaretskii <eliz@gnu.org>
191
192 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
193 highlighting on the frame was cleared. Prevents assertion
194 violations when repeatedly clicking on the "Top" link of the
195 "bread-crumbs" in Info buffers.
196
197 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
198 Eli Zaretskii <eliz@gnu.org>
199
200 Fix a race condition with glib (Bug#8855).
201 The symptom is a diagnostic "GLib-WARNING **: In call to
202 g_spawn_sync(), exit status of a child process was requested but
203 SIGCHLD action was set to SIG_IGN and ECHILD was received by
204 waitpid(), so exit status can't be returned." The diagnostic
205 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
206 The real bug is a race condition between Emacs and glib: Emacs
207 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
208 so that glib can't find it. Work around the bug by invoking
209 waitpid only on subprocesses that Emacs itself creates.
210
211 This is a backport from the trunk, consisting of:
212
213 * w32proc.c (create_child): Don't clip the PID of the child
214 process to fit into an Emacs integer, as this is no longer a
215 restriction.
216 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
217 reaping only the process specified by PID argument, if that is
218 positive. Use PID instead of dead_child to know which process to
219 reap. Wait for the child to die only if WNOHANG is not in
220 OPTIONS.
221 (sys_select): Don't set dead_child.
222
223 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
224 as it is no longer needed.
225
226 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
227 no longer needed.
228 (create_process, record_child_status_change): Don't use special
229 value -1 in pid field, as the caller now must know the pid rather
230 than having the callee infer it. The inference was sometimes
231 incorrect anyway, due to another race.
232 (create_process): Set new 'alive' member if child is created.
233 (process_status_retrieved): New function.
234 (record_child_status_change): Use it.
235 Accept negative 1st argument, which means to wait for the
236 processes that Emacs already knows about. Move special-case code
237 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
238 processes that have already been waited for, by testing and
239 clearing new 'alive' member. Remove the setting of
240 record_at_most_one_child for the !WNOHANG case.
241 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
242 now does this internally.
243 (handle_child_signal): Let record_child_status_change do all
244 the work, since we do not want to reap all exited child processes,
245 only the child processes that Emacs itself created.
246 * process.h (Lisp_Process): New boolean member 'alive'.
247
248 2012-11-23 Eli Zaretskii <eliz@gnu.org>
249
250 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
251 between bpos_covered and bpos_max. This fixes cursor display when
252 several display strings follow each other.
253
254 * .gdbinit (pgx): If the glyph's object is a string, display the
255 pointer to string data, rather than the value of the string object
256 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
257
258 2012-11-21 Eli Zaretskii <eliz@gnu.org>
259
260 * indent.c (Fvertical_motion): If the starting position is covered
261 by a display string, return to one position before that, to avoid
262 overshooting it inside move_it_to. (Bug#12930)
263
264 2012-11-20 Daniel Colascione <dancol@dancol.org>
265
266 * w32fns.c (Fx_file_dialog):
267 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
268 cygwin_convert_file_name*.
269
270 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
271 Rename cygwin_convert_path* to cygwin_convert_file_name*.
272
273 2012-11-20 Ken Brown <kbrown@cornell.edu>
274
275 * emacs.c (main): Set the G_SLICE environment variable for all
276 Cygwin builds, not just GTK builds. See
277 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
278
279 2012-11-19 Eli Zaretskii <eliz@gnu.org>
280
281 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
282 w32_note_current_window with code. (Backport from trunk.)
283
284 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
285 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
286 Define for the MSVC compiler.
287
288 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
289 semi-colon.
290
291 2012-11-18 Eli Zaretskii <eliz@gnu.org>
292
293 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
294 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
295 dostounix_filename. Prevents crashes down the road, because
296 dostounix_filename assumes it gets a unibyte string. Reported by
297 Michel de Ruiter <michel@sentient.nl>, see
298 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
299
300 2012-11-17 Eli Zaretskii <eliz@gnu.org>
301
302 * w32select.c: Include w32common.h before w32term.h, so that
303 windows.h gets included before w32term.h uses some of its
304 features, see below.
305
306 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
307 typedefs.
308 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
309 prototypes.
310 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
311
312 2012-11-17 Jan Djärv <jan.h.d@swipnet.se>
313
314 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
315 (ns_select): Return at once if events are held (Bug#12834).
316
317 2012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
318
319 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
320 Needed following 2012-10-20 change. (Bug#12902)
321
322 2012-11-16 Glenn Morris <rgm@gnu.org>
323
324 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
325
326 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
327
328 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
329
330 2012-11-14 Eli Zaretskii <eliz@gnu.org>
331
332 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
333 use the same value of thread handle.
334 (start_timer_thread): If the timer thread exited (due to error),
335 clean up by closing the two handles it used. Duplicate the caller
336 thread's handle here, so it gets duplicated only once, when
337 launching the timer thread. Set priority of the timer thread, not
338 the caller thread.
339 (getitimer): Don't duplicate the caller thread's handle here.
340 (Bug#12832)
341
342 2012-11-13 Jan Djärv <jan.h.d@swipnet.se>
343
344 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
345 called (Bug#12834).
346
347 2012-11-12 Eli Zaretskii <eliz@gnu.org>
348
349 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
350 passed to pint2str and pint2hrstr to be at most the size of the
351 frame's decode_mode_spec_buffer. This avoids crashes with very
352 large values of FIELD_WIDTH argument to decode_mode_spec.
353 (Bug#12867)
354
355 2012-11-07 Martin Rudalics <rudalics@gmx.at>
356
357 * window.c (Fsplit_window_internal): Set combination limit of
358 new parent window to t iff Vwindow_combination_limit is t;
359 fixing a regression introduced with the change from 2012-09-22.
360 (Fwindow_combination_limit, Fset_window_combination_limit):
361 Fix doc-strings.
362
363 2012-11-06 Eli Zaretskii <eliz@gnu.org>
364
365 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
366 amount when the scroll margins are too large. When scrolling
367 backwards in the buffer, give up if cannot reach point or the
368 scroll margin within a reasonable number of screen lines.
369 Fixes point position in window under scroll-up/down-aggressively when
370 point is positioned many lines beyond the window top/bottom.
371 (Bug#12811)
372
373 2012-11-05 Eli Zaretskii <eliz@gnu.org>
374
375 * ralloc.c (relinquish): If real_morecore fails to return memory
376 to the system, don't crash; instead, leave the last heap
377 unchanged and return. (Bug#12774)
378
379 2012-11-03 Eli Zaretskii <eliz@gnu.org>
380
381 * lisp.mk: Adjust comments to the fact that term/internal is now
382 loaded from loadup.el.
383
384 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
385 (msdos_fatal_signal): New function.
386 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
387 its argument list.
388
389 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
390 for GCC versions before 4.
391 (emacs_raise): Define to call msdos_fatal_signal.
392
393 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
394 iterator when starting in the middle of a display or overlay
395 string. (Bug#12745)
396
397 2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
398
399 * widget.c (resize_cb): New function.
400 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
401 (EmacsFrameResize): Check if all is up to date before changing frame
402 size.
403
404 2012-11-01 Eli Zaretskii <eliz@gnu.org>
405
406 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
407
408 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
409
410 Fix crash when using Emacs as commit editor for git (Bug#12697).
411 * callproc.c (setpgrp): Remove macro, as we now use setpgid
412 and it is configured in conf_post.h.
413 (Fcall_process): Don't invoke both setsid and setpgid; the former
414 is enough, if it exists.
415 * callproc.c (Fcall_process, child_setup):
416 * process.c (create_process): Use setpgid.
417 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
418 for the real thing.
419 * dispnew.c (init_display): Initialize the foreground group
420 if we are running a tty display.
421 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
422 * lisp.h (init_foreground_group): New decl.
423 * sysdep.c (inherited_pgroup): New static var.
424 (init_foreground_group, tcsetpgrp_without_stopping)
425 (narrow_foreground_group, widen_foreground_group): New functions.
426 (init_sys_modes): Narrow foreground group.
427 (reset_sys_modes): Widen foreground group.
428
429 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
430
431 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
432
433 2012-10-31 Martin Rudalics <rudalics@gmx.at>
434
435 * minibuf.c (read_minibuf): Restore current buffer since
436 choose_minibuf_frame calling Fset_frame_selected_window may
437 change it (Bug#12766).
438
439 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
440
441 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
442
443 2012-10-30 Kenichi Handa <handa@gnu.org>
444
445 * font.c (Ffont_at): If WINDOW is specified and it is not
446 displaying the current buffer, signal an error.
447
448 2012-10-29 Daniel Colascione <dancol@dancol.org>
449
450 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
451 In preparation for fixing bug#12739, move these functions from
452 here...
453
454 * coding.h, coding.c: ... to here, and compile them only when
455 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
456 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
457
458 2012-10-28 Eli Zaretskii <eliz@gnu.org>
459
460 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
461 (timer_loop, getitimer, setitimer): Use it instead of
462 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
463 'clock'.
464 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
465 literal 10000.
466
467 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
468
469 * nsterm.m (NO_APPDEFINED_DATA): New define.
470 (last_appdefined_event_data): New variable
471 (last_appdefined_event): Remove.
472 (ns_select): Initialize t from last_appdefined_event_data instead
473 of [last_appdefined_event data1].
474 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
475 remove last_appdefined_event (Bug#12698).
476
477 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
478
479 * frame.c (x_set_font): Catch internal error.
480
481 2012-10-27 Eli Zaretskii <eliz@gnu.org>
482
483 Avoid overflow in w32 implementation of interval timers.
484 When possible, for ITIMER_PROF count only times the main thread
485 actually executes.
486 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
487 'volatile ULONGLONG' types. All the other data which was
488 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
489 (GetThreadTimes_Proc): New typedef.
490 (w32_get_timer_time): New function, returns a suitable time value
491 for the timer.
492 (timer_loop): Enter critical section when accessing ULONGLONG
493 values of the itimer_data struct, as these accesses are no longer
494 atomic. Call 'w32_get_timer_time' instead of 'clock'.
495 Remove unused variable.
496 (init_timers): Initialize s_pfn_Get_Thread_Times.
497 (start_timer_thread): Don't assign itimer->caller_thread here.
498 (getitimer): Assign itimer->caller_thread here.
499 (setitimer): Always call getitimer to get the value of ticks_now.
500 (sys_spawnve): Avoid compiler warning about format mismatch.
501
502 2012-10-26 Eli Zaretskii <eliz@gnu.org>
503
504 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
505 mouse movement events if the menu bar is active. This avoids
506 producing a busy "hour-glass" cursor by Windows if the mouse
507 pointer is positioned over a tooltip shown for some menu item.
508
509 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
510
511 Don't assume process IDs fit in int.
512 * emacs.c (shut_down_emacs) [!DOS_NT]:
513 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
514 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
515 Use pid_t, not int, to store process IDs, as 'int'
516 is not wide enough on a few platforms (e.g., AIX and IRIX).
517
518 2012-10-23 Kenichi Handa <handa@gnu.org>
519
520 The following change is to make face-font-rescale-alist work
521 correctly for non-ASCII fonts.
522
523 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
524 (font_open_for_lface): Handle Vface_font_rescale_alist.
525
526 2012-10-23 Chong Yidong <cyd@gnu.org>
527
528 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
529
530 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
531
532 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
533 for screen font.
534 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
535
536 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
537 event (Bug#12681).
538
539 2012-10-21 Glenn Morris <rgm@gnu.org>
540
541 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
542
543 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
544
545 Port to OpenBSD 5.1.
546 * frame.c (Fmouse_position, Fmouse_pixel_position):
547 * xdisp.c (produce_stretch_glyph):
548 Declare local vars only when they're needed.
549 This is clearer and avoids a warning on OpenBSD about unused vars.
550 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
551 This is safer, and avoids OpenBSD warnings about unused vars.
552 * keyboard.c (record_menu_key): Remove unnecessary decl.
553 (poll_timer): Define only if POLL_FOR_INPUT is defined.
554 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
555 as our definition clashes with OpenBSD's.
556 * xfaces.c (load_face_colors, check_lface_attrs)
557 (get_lface_attributes_no_remap, get_lface_attributes)
558 (lface_fully_specified_p, x_supports_face_attributes_p)
559 (tty_supports_face_attributes_p, face_fontset, realize_face)
560 (realize_x_face, realize_tty_face):
561 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
562 merely Lisp_Object *. This is more informative and avoids
563 a warning on OpenBSD about accessing beyond an object's size.
564
565 2012-10-20 Chong Yidong <cyd@gnu.org>
566
567 * lread.c (Fload): Doc fix (Bug#12592).
568
569 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
570
571 * font.c (Ffont_at): Fix previous change.
572
573 2012-10-19 Eli Zaretskii <eliz@gnu.org>
574
575 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
576 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
577 for the reasons.
578
579 * alloc.c (NSTATICS): Decrease to 0x800.
580
581 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
582
583 * fns.c (Fnreverse): Include the problem element when signalling an
584 error (bug#12677).
585
586 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
587
588 * nsterm.m (ns_select): Check writefds before call to
589 FD_ISSET (Bug#12668).
590
591 2012-10-18 Daniel Colascione <dancol@dancol.org>
592
593 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
594 (staticpro): If we run out of staticpro slots, die with an
595 informative error instead of just calling emacs_abort.
596
597 2012-10-18 Martin Rudalics <rudalics@gmx.at>
598
599 Fix two flaws reported by Dmitry Antipov.
600 * window.c (Ftemp_output_buffer_show): Remove.
601 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
602 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
603
604 2012-10-17 Eli Zaretskii <eliz@gnu.org>
605
606 * makefile.w32-in ($(BLD)/w32.$(O)):
607 ($(BLD)/vm-limit.$(O)):
608 ($(BLD)/term.$(O)):
609 ($(BLD)/unexw32.$(O)):
610 ($(BLD)/fileio.$(O)):
611 ($(BLD)/dispnew.$(O)): Update dependencies.
612
613 * w32term.h (w32_initialize_display_info, initialize_w32_display):
614 Add prototypes.
615
616 * w32proc.c: Include ctype.h.
617
618 * w32.h (init_environment, check_windows_init_file)
619 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
620 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
621 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
622 (sys_link): Add prototypes.
623
624 * w32.c: Include w32select.h.
625 (sys_access, e_malloc, sys_select): Add prototypes.
626 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
627
628 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
629
630 * unexw32.c: Include lisp.h and w32.h.
631
632 * term.c [WINDOWSNT]: Include w32term.h.
633
634 * process.c [WINDOWSNT]: Add prototype of sys_select.
635
636 * fileio.c [WINDOWSNT]: Include w32.h.
637
638 * dispnew.c [WINDOWSNT]: Include w32.h.
639
640 * cygw32.c (Fcygwin_convert_path_to_windows)
641 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
642 Lisp_Object values. (Bug#12661)
643
644 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
645 to Lisp_Object. (Bug#12661)
646
647 2012-10-17 Kenichi Handa <handa@gnu.org>
648
649 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
650 invalidate.
651
652 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
653
654 * buffer.c (Fkill_buffer): When unchaining the marker,
655 reset its buffer pointer to NULL (Bug#12652).
656
657 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
658
659 Do not verify indirection counters of killed buffers (Bug#12579).
660 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
661 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
662
663 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
664
665 * alloc.c (Fmake_byte_code): Fix typo in comment.
666 * print.c (print_interval): Define as static to match prototype.
667 * indent.c (disptab_matches_widthtab, recompute_width_table):
668 Convert to eassert.
669
670 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
671
672 * editfns.c (get_system_name): Remove.
673 * lisp.h (get_system_name): Remove prototype.
674 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
675 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
676
677 2012-10-15 Daniel Colascione <dancol@dancol.org>
678
679 * dbusbind.c: Add comment explaining reason for previous change.
680
681 2012-10-15 Martin Rudalics <rudalics@gmx.at>
682
683 * window.c (Fwindow_end): Rewrite check whether cached position
684 can be used (Bug#12600).
685 (resize_frame_windows, grow_mini_window, shrink_mini_window):
686 Set windows_or_buffers_changed.
687
688 2012-10-15 Daniel Colascione <dancol@dancol.org>
689
690 * dbusbind.c: Fix cygw32 build break when compiling with dbus
691 enabled by undefining the symbol "interface", which the platform
692 headers define to something incompatible.
693
694 2012-10-14 Daniel Colascione <dancol@dancol.org>
695
696 * image.c (init_tiff_functions, init_imagemagick_functions)
697 (init_svg_functions): Fix cygw32 build break by using these
698 functions only when WINDOWSNT _and_ HAVE_NTGUI.
699
700 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
701
702 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
703
704 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
705
706 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
707
708 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
709
710 * coding.c (detect_coding): Set coding->id before calling
711 this->detector.
712
713 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
714
715 * fileio.c: Formatting fixes.
716
717 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
718
719 Fix some stat-related races.
720 * fileio.c (Fwrite_region): Avoid race condition if a file is
721 removed or renamed by some other process immediately after Emacs
722 writes it but before Emacs stats it. Do not assume that stat (or
723 fstat) succeeds.
724 * image.c (slurp_file): Resolve the file name with fopen + fstat
725 rather than stat + fopen.
726 (pbm_read_file) [0]: Remove unused code with stat race.
727 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
728 Remove ineffective code with stat race.
729
730 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
731
732 * doc.c (get_doc_string): Don't signal an error if the file is missing.
733
734 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
735
736 * nsterm.m (hold_event_q): New static variable.
737 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
738 ! q_event_ptr.
739 (hold_event): New function.
740 (ns_read_socket): If hold_event_q have events, store them and
741 return (Bug#12384).
742 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
743 is zero (Bug#12384).
744
745 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
746
747 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
748
749 2012-10-12 Eli Zaretskii <eliz@gnu.org>
750
751 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
752
753 * fileio.c (check_existing): New function.
754 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
755 instead of calling 'stat', when what's needed is to check whether
756 a file exists. This avoids expensive system calls on MS-Windows.
757 (Bug#12587)
758
759 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
760
761 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
762 determine whether a file exists and is not a directory.
763
764 * lisp.h (check_existing): Add prototype.
765
766 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
767
768 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
769
770 2012-10-12 Glenn Morris <rgm@gnu.org>
771
772 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
773
774 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
775
776 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
777
778 * eval.c (Fautoload): Remember previous autoload status in load-history.
779
780 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
781
782 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
783 * lread.c (load_each_byte, new_backquote_flag, readchar)
784 (read_filtered_event, lisp_file_lexically_bound_p)
785 (safe_to_load_version, Fload, complete_filename_p, openp)
786 (build_load_history, readevalloop, read_escape, read1)
787 (string_to_number, read_vector, read_list):
788 * macros.c (Fstart_kbd_macro):
789 * marker.c (CONSIDER):
790 * menu.c (parse_single_submenu, digest_single_submenu)
791 (find_and_return_menu_selection, Fx_popup_menu):
792 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
793 (Ftry_completion):
794 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
795 (ns_menu_show):
796 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
797 (xmenu_show, xdialog_show):
798 Use bool for booleans.
799 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
800 as it's not a predicate. All uses changed. Omit unnecessary
801 buffer termination.
802
803 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
804
805 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
806 (save_excursion_restore): Do not restore mark if it was not saved.
807
808 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
809
810 * marker.c (cached_modiff): EMACS_INT, not int.
811
812 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
813 instead of having a wrong decl.
814 * nsmenu.m (waiting_for_input): Remove wrong decl.
815
816 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
817
818 keyboard.c, keymap.c: Use bool for booleans.
819 * dispnew.c (sit_for): Distinguish between 3-way display_option
820 and boolean do_display.
821 * keyboard.c (single_kboard, this_command_key_count_reset)
822 (waiting_for_input, echoing, immediate_quit, input_pending)
823 (interrupt_input, interrupts_deferred, pop_kboard)
824 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
825 (command_loop_1, adjust_point_for_property)
826 (safe_run_hooks_error, input_polling_used, read_char):
827 (help_char_p, readable_events, kbd_buffer_events_waiting)
828 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
829 (lucid_event_type_list_p, get_input_pending):
830 (gobble_input, menu_separator_name_p, menu_bar_item)
831 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
832 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
833 (keyremap_step, test_undefined, read_key_sequence)
834 (detect_input_pending, detect_input_pending_ignore_squeezables)
835 (detect_input_pending_run_timers, requeued_events_pending_p)
836 (quit_throw_to_read_char, Fset_input_interrupt_mode):
837 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
838 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
839 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
840 (accessible_keymaps_1, Fkey_description, push_key_description):
841 (shadow_lookup, struct where_is_internal_data)
842 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
843 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
844 (describe_map, describe_vector):
845 * menu.c (single_menu_item):
846 * nsmenu.m (ns_update_menubar):
847 * process.c (wait_reading_process_output):
848 * search.c (scan_buffer, scan_newline):
849 Use bool for boolean.
850 * keyboard.c (timers_run, swallow_events)
851 (detect_input_pending_run_timers):
852 * process.c (wait_reading_process_output):
853 Use unsigned for counter where wraparound-on-overflow is desired,
854 since unsigned is guaranteed to have that behavior and signed is not.
855 (read_char): Use ptrdiff_t for string length.
856 (get_input_pending): Remove first argument, since it was always
857 the same pointer-to-int (now pointer-to-boolean) &input_pending,
858 and behave as if it had that value. Return new value of
859 input_pending. All callers changed.
860 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
861 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
862 a string length.
863 * keymap.c (push_key_description): Omit last arg, which was always 1.
864 All callers changed.
865
866 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
867
868 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
869
870 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
871 ($(BLD)/term.$(O)): Update dependencies.
872
873 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
874
875 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
876 * lisp.h (enum pvec_type): Adjust comments and omit explicit
877 initializer for PVEC_NORMAL_VECTOR.
878
879 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
880
881 Clean out old termopts cruft.
882 * termopts.h (flow_control, meta_key): Remove unused decls.
883 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
884 Don't include termopts.h.
885
886 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
887
888 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
889
890 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
891
892 * commands.h (immediate_quit): Remove duplicate decl.
893
894 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
895
896 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
897 caching.
898 (nsfont_open): Remove setting of Vfonts_in_cache.
899 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
900
901 2012-10-09 Eli Zaretskii <eliz@gnu.org>
902
903 * w32fns.c (w32_last_error): Change the return value to DWORD, to
904 match what GetLastError returns. Explain why the function is
905 needed.
906
907 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
908 'is_tooltip_frame', to avoid confusion with its global namesake.
909
910 2012-10-08 Daniel Colascione <dancol@dancol.org>
911
912 * xdisp.c (start_hourglass): Call w32_note_current_window when
913 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
914 build that caused Emacs to display the hourglass cursor forever.
915
916 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
917 which is broken under remote desktop, calculate the number of
918 colors available for a display based on the display's number of
919 planes and number of bits per pixel per plane. (bug#10397).
920
921 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
922
923 * nsfont.m (Vfonts_in_cache): New variable.
924 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
925 are used. Add cached fonts to Vfonts_in_cache.
926 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
927
928 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
929
930 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
931 in nt/config.nt.
932 (FONT_H): Define after FRAME_H.
933 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
934 Update dependencies.
935
936 * w32term.c: Remove leftover declaration of keyboard_codepage.
937
938 2012-10-08 Eli Zaretskii <eliz@gnu.org>
939
940 * makefile.w32-in (FONT_H): Add $(FRAME_H).
941 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
942 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
943 (GLOBAL_SOURCES): Add cygw32.c.
944 ($(BLD)/unexw32.$(O)):
945 ($(BLD)/w32.$(O)):
946 ($(BLD)/w32console.$(O)):
947 ($(BLD)/w32fns.$(O)):
948 ($(BLD)/w32heap.$(O)):
949 ($(BLD)/w32menu.$(O)):
950 ($(BLD)/w32proc.$(O)): Add w32common.h.
951
952 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
953 'const char *'.
954 (x_to_w32_color): Don't modify the argument, modify a copy instead.
955
956 2012-10-08 Daniel Colascione <dancol@dancol.org>
957
958 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
959 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
960 accidental message numbering hole. Change other messages to
961 match.
962
963 * w32select.h (HAVE_W32SELECT): Remove.
964
965 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
966 w32common.h instead of w32heap.h.
967
968 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
969 (get_allocation_unit, get_processor_type, get_w32_major_version)
970 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
971 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
972 (OS_NT, os_subtype, cache_system_info): Move declarations to
973 w32common.
974
975 * w32heap.c: Include w32common.h.
976 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
977 (w32_minor_version, w32_build_number, w32_subtype):
978 Remove duplicate definitions.
979
980 * w32fns.c: Include w32common.h; include w32heap.h only in
981 WINDOWSNT.
982
983 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
984 Use `report_file_error' instead of `error' in order to better
985 inform users of what went wrong. Increase NTGUI_UNICODE file
986 dialog box file name length to 32k, the maximum allowed by the NT
987 kernel.
988
989 * w32common.h: New file.
990 (ROUND_UP, ROUND_DOWN, get_page_size)
991 (get_allocation_unit, get_processor_type, get_w32_major_version)
992 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
993 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
994 (OS_NT, os_subtype, cache_system_info): Move here.
995
996 * unexw32.c, unexcw.c: Include w32common.h.
997
998 * emacs.c (main): Use (defined (WINDOWSNT) || defined
999 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1000 to call syms_of_w32select.
1001
1002 * cygw32.h: Remove obsolete EXFUN declarations.
1003
1004 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1005
1006 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1007 of w32inevt.o from SOME_MACHINE_OBJECTS.
1008
1009 2012-10-08 Daniel Colascione <dancol@dancol.org>
1010
1011 * image.c: Permanent fix for JPEG compilation issue --- limit
1012 jpeglib `boolean' redefinition to Cygwin builds.
1013
1014 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1015
1016 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1017
1018 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1019 Cygwin.
1020
1021 2012-10-08 Daniel Colascione <dancol@dancol.org>
1022
1023 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1024 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1025 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1026 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1027 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1028 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1029 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1030 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1031 now a supported configuration.
1032
1033 * Makefile.in: consolidate image variables into LIBIMAGE; add
1034 W32_OBJ and W32_LIBS. Compile new files.
1035
1036 * conf_post.h:
1037 (_DebPrint) declare tracing facility for W32 debugging. We need
1038 to unify tracing later.
1039
1040 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1041 unconditional use of W32 Unicode functions. Cygwin runs only on
1042 100% Unicode operating systems.
1043
1044 * cygw32.c: New file. Define Cygwin-specific facilities.
1045 (Fcygwin_convert_path_to_windows)
1046 (Fcygwin_convert_path_from_windows): New user functions for
1047 accessing Cygwin path-munging routines.
1048
1049 * cygw32.h: New file.
1050 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1051 UTF-16LE strings temporarily inside non-Lisp-visible string
1052 objects.
1053
1054 (w32_strerror): Just what it says on the tin.
1055
1056 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1057 also run for Cygwin; both systems have the same problem with using
1058 GUI facilities in a forked child. Also call syms_of_cygw32,
1059 syms_of_w32select in correct places.
1060
1061 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1062 needs fork-then-exec for daemon launching.
1063
1064 * font.h: Include frame.h.
1065
1066 * image.c: Use the image library cache machinery only when we're
1067 compiling for native WINDOWSNT; Cygwin can use shared libraries
1068 like any other Unixlike system.
1069
1070 * keyboard.c: Clarify a comment regarding the input loop.
1071
1072 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1073 functions directly instead of trying to detect at runtime that our
1074 host operating system supports them. We make this change for two
1075 reasons: Cygwin lacks support for the multibyte character
1076 conversion functions used by the legacy menu code, and Cygwin
1077 never needs to rely on non-Unicode APIs.
1078
1079 * unexw32.c (hinst): Declare extern.
1080
1081 * w32.c: Change header order;
1082 (w32_strerror): Move to w32fns.c because we need it for
1083 non-WINDOWSNT builds.
1084
1085 * w32.h: Add #error macro to make sure we don't include w32.h for
1086 Cygwin builds. Remove w32select declarations.
1087
1088 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1089 w32fns.c. w32console.c is WINDOWSNT-only.
1090
1091 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1092 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1093 POSIXy alternative.
1094 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1095 (w32_major_version, w32_minor_version, w32_build_number)
1096 (os_subtype, sound_type): Define here
1097 (w32_defined_color): Make color parameter const for consistency
1098 with other _defined_color functions.
1099 (w32_createwindow): Unconditionally call w32_init_class instead of
1100 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1101 through the code is complex and unnecessary because class
1102 registration is practically free.
1103 (w32_name_of_message): New EMACSDEBUG-only function.
1104 (Fset_message_beep): Move here
1105 (Fx_open_connection): Require that the display name for Windows be
1106 "w32" for consistency, emacsclient disambiguation, and maybe, one
1107 day, multi-window-system support.
1108 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1109 Cygwin files for W32 GUI facilities, since these clearly don't
1110 expect Cygwin names.
1111 (_DebPrint): Define.
1112 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1113 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1114 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1115 (w32_last_error): Remove.
1116
1117 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1118
1119 * w32heap.c (syspage_mask): Declare here.
1120 (cache_system_info): Remove.
1121
1122 * w32inevt.c (faked_key): Define globally, not statically.
1123 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1124 (w32_console_toggle_lock_key): Move to w32fns.c.
1125
1126 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1127
1128 * w32proc.c (_DebPrint): Move to w32fns.c.
1129 * w32select.c: Include string.h, stdio.h for Cygwin.
1130 * w32select.h: New File.
1131
1132 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1133 get_osfhandle.
1134 (w32_message_fd): New variable. Under Cygwin, holds the file
1135 descriptor the system used to tell us about pending thread
1136 messages.
1137
1138 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1139 that prevented compilation under non-WINDOWSNT systems.
1140
1141 (w32_initialize): Open /dev/windows and assign it to
1142 w32_message_fd. Provide w32 feature.
1143
1144 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1145 (WM_EMACS_INPUT_READY): add.
1146 (prepend_msg, w32_message_fd): Declare globally.
1147
1148 * w32xfns.c:
1149 (keyboard_handle): Use only when WINDOWSNT.
1150 (notify_msg_ready): New function. Posts a message to the main
1151 thread's message queue under CYGWIN, which wakes up the main
1152 thread from select(2) by making the /dev/windows file descriptor
1153 ready. Under WINDOWSNT, it sets an event the same way the old
1154 code did.
1155
1156 (post, prepend_msg): Actually call notify_msg_ready instead of
1157 setting the input event directly.
1158
1159 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1160
1161 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1162 but it still has blocs in it, don't return it to the system,
1163 instead of aborting. (Bug#12402)
1164
1165 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1166
1167 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1168
1169 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1170 MAC_OS_X_VERSION_10_6.
1171 (syms_of_nsterm): Remove comment about Panther and above for
1172 ns-antialias-text.
1173 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1174 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1175 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1176
1177 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1178 MAC_OS_X_VERSION_10_4.
1179
1180 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1181 MAC_OS_X_VERSION_10_2.
1182
1183 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1184
1185 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1186 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1187
1188 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1189 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1190 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1191 Remove ns_in_resize check.
1192 (ns_clear_frame_area): Remove resize handle code.
1193
1194 * nsfns.m (ns_in_resize): Remove.
1195 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1196 Remove ns_in_resize check.
1197
1198 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1199
1200 Improve sys_siglist detection.
1201 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1202 defined as a macro, as is done in Solaris.
1203 (sys_siglist_entries): New macro.
1204 (save_strsignal): Use it.
1205 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1206 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1207
1208 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1209
1210 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1211 fullscreen/Fullscreen.
1212
1213 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1214 tobar_height is new.
1215
1216 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1217 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1218 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1219 (windowDidResize:): Check for correct window if old style fullscreen.
1220 Capitalize word in comment. Remove incorrect comment.
1221 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1222 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1223 error in drawing background.
1224 (toggleFullScreen:): Remove comment. Rearrange calls.
1225 Set toolbar values to zero, save old height in tobar_height.
1226 Restore tool bar height when leaving fullscreen.
1227 (canBecomeMainWindow): New function.
1228
1229 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1230
1231 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1232
1233 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1234
1235 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1236
1237 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1238 that time stamps of directories could also be changed.
1239 Don't request the too broad GENERIC_WRITE, only the more restrictive
1240 FILE_WRITE_ATTRIBUTES access rights.
1241
1242 * fileio.c (Fset_file_times): Special-case ignoring errors for
1243 directories only on MSDOS, not on MS-Windows.
1244
1245 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1246
1247 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1248
1249 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1250
1251 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1252 see whether CreateFile failed.
1253
1254 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1255
1256 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1257 to avoid similar races.
1258 * keyboard.c (pending_signals): Now bool, not int.
1259
1260 Port timers to OpenBSD, plus check for timer failures.
1261 OpenBSD problem reported by Han Boetes.
1262 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1263 and/or setitimer.
1264 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1265 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1266 like OpenBSD, which has timer_settime but does not declare it.
1267 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1268 whether to use itimerspec-related primitives. All uses of
1269 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1270
1271 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1272
1273 * profiler.c (handle_profiler_signal): Fix a malloc race
1274 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1275
1276 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1277
1278 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1279
1280 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1281
1282 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1283 consistent with the change in return value of 'safe_strsignal'.
1284
1285 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1286
1287 Prefer plain 'static' to 'static inline' (Bug#12541).
1288 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1289 (bidi_set_sor_type, bidi_push_embedding_level)
1290 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1291 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1292 (bidi_cache_search, bidi_cache_ensure_space)
1293 (bidi_cache_iterator_state, bidi_cache_find)
1294 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1295 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1296 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1297 Now 'static', not 'static inline'.
1298
1299 Count overruns when profiling; change units to ns.
1300 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1301 Give extra weight to samples after overruns, to attempt to count
1302 the time more accurately.
1303 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1304 the underlying primitives nominally do ns.
1305 (Fprofiler_cpu_start): Document the change. Mention that
1306 the sampling intervals are only approximate.
1307
1308 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1309
1310 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1311
1312 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1313 case for the special 0 coding-system.
1314
1315 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1316 (Fmake_overlay): Remove redundant tests.
1317 (fix_start_end_in_overlays): Remove redundant recentering.
1318
1319 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1320
1321 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1322 Update dependencies.
1323
1324 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1325
1326 Fix a malloc race condition involving strsignal.
1327 A signal can arrive in the middle of a malloc, and Emacs's signal
1328 handler can invoke strsignal, which can invoke malloc, which is
1329 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1330 Fix it by altering the signal handler so that it does not invoke
1331 strsignal.
1332 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1333 * process.c (status_message): Use const pointer, in case strsignal
1334 is #defined to safe_strsignal.
1335 * sysdep.c (sys_siglist, init_signals): Always define and
1336 initialize a substitute sys_siglist if the system does not define
1337 one, even if HAVE_STRSIGNAL.
1338 (safe_strsignal): Rename from strsignal. Always define,
1339 using sys_siglist. Return a const pointer.
1340 * syssignal.h (safe_strsignal): New decl.
1341 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1342
1343 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1344
1345 * w32proc.c (timer_loop): Fix code that waits for timer
1346 expiration, to avoid high CPU usage.
1347
1348 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1349
1350 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1351 (sweep_weak_table): Remove redundant prototypes.
1352
1353 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1354
1355 * emacs.c: Move the inclusion of TERM_HEADER after including
1356 windows.h on WINDOWSNT. This avoids compilation problems with
1357 MSVC.
1358
1359 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1360
1361 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1362 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1363 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1364 as the previous version used 'void *'.
1365
1366 * ralloc.c (ROUNDUP): Fix last change.
1367 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1368 'size_t'.
1369
1370 * w32proc.c <disable_itimers>: New static flag.
1371 (init_timers): Initialize it to zero, after creating the critical
1372 sections used by the timer threads.
1373 (term_timers): Set to 1 before deleting the critical sections.
1374 (getitimer, setitimer): If disable_itimers is non-zero, return an
1375 error indication without doing anything. Reported by Fabrice
1376 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1377 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1378 return results.
1379 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1380 support timers.
1381
1382 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1383 term_ntproc after all the other bookkeeping, to get timers working
1384 as long as possible.
1385
1386 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1387
1388 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1389 Suggested by Juri Linkov in
1390 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1391
1392 Prefer plain 'static' to 'static inline' (Bug#12541).
1393 With static functions, modern compilers inline pretty well by
1394 themselves; advice from programmers often hurts as much as it helps.
1395 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1396 this change shrinks the text size of the Emacs executable by 1.1%
1397 without affecting CPU significantly in my benchmark.
1398 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1399 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1400 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1401 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1402 (bset_auto_fill_function, bset_auto_save_file_format)
1403 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1404 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1405 (bset_cache_long_line_scans, bset_case_fold_search)
1406 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1407 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1408 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1409 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1410 (bset_header_line_format, bset_indicate_buffer_boundaries)
1411 (bset_indicate_empty_lines, bset_invisibility_spec)
1412 (bset_left_fringe_width, bset_major_mode, bset_mark)
1413 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1414 (bset_name, bset_overwrite_mode, bset_pt_marker)
1415 (bset_right_fringe_width, bset_save_length)
1416 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1417 (bset_scroll_up_aggressively, bset_selective_display)
1418 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1419 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1420 (set_buffer_overlays_after):
1421 * category.c (bset_category_table):
1422 * charset.c (read_hex):
1423 * coding.c (produce_composition, produce_charset)
1424 (handle_composition_annotation, handle_charset_annotation)
1425 (char_encodable_p):
1426 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1427 (assign_row, set_frame_matrix_frame, make_current)
1428 (add_row_entry):
1429 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1430 * fns.c (maybe_resize_hash_table):
1431 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1432 * gmalloc.c (register_heapinfo):
1433 * image.c (lookup_image_type):
1434 * intervals.c (set_interval_object, set_interval_left)
1435 (set_interval_right, copy_interval_parent, rotate_right)
1436 (rotate_left, balance_possible_root_interval):
1437 * keyboard.c (kset_echo_string, kset_kbd_queue)
1438 (kset_keyboard_translate_table, kset_last_prefix_arg)
1439 (kset_last_repeatable_command, kset_local_function_key_map)
1440 (kset_overriding_terminal_local_map, kset_real_last_command)
1441 (kset_system_key_syms, clear_event, set_prop):
1442 * lread.c (digit_to_number):
1443 * marker.c (attach_marker, live_buffer, set_marker_internal):
1444 * nsterm.m (ns_compute_glyph_string_overhangs):
1445 * process.c (pset_buffer, pset_command)
1446 (pset_decode_coding_system, pset_decoding_buf)
1447 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1448 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1449 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1450 * syntax.c (bset_syntax_table, dec_bytepos):
1451 * terminal.c (tset_param_alist):
1452 * textprop.c (interval_has_some_properties)
1453 (interval_has_some_properties_list):
1454 * window.c (wset_combination_limit, wset_dedicated)
1455 (wset_display_table, wset_hchild, wset_left_fringe_width)
1456 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1457 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1458 (wset_right_fringe_width, wset_right_margin_cols)
1459 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1460 (wset_vertical_scroll_bar_type, wset_window_parameters):
1461 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1462 (wset_column_number_displayed, wset_region_showing)
1463 (window_box_edges, run_window_scroll_functions)
1464 (append_glyph_string_lists, prepend_glyph_string_lists)
1465 (append_glyph_string, set_glyph_string_background_width)
1466 (append_glyph, append_composite_glyph)
1467 (take_vertical_position_into_account):
1468 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1469 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1470 (lface_hash, lface_same_font_attributes_p, lookup_face):
1471 * xml.c (libxml2_loaded_p):
1472 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1473 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1474 Now 'static', not 'static inline'.
1475
1476 * bidi.c: Tune.
1477 (bidi_copy_it): Do the whole copy with a single memcpy.
1478 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1479
1480 Revert the FOLLOW-SYMLINKS change for file-attributes.
1481 Doing it right would require several changes to Tramp, and there's
1482 not enough time to get that tested before the freeze today.
1483 * dired.c (directory_files_internal, Ffile_attributes):
1484 Undo last change.
1485
1486 * frame.c (x_report_frame_params): Port better to wider ints.
1487 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1488 or that pointers can be printed in 15 decimal digits.
1489 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1490
1491 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1492
1493 Support x64 build on MS-Windows.
1494 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1495 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1496 compatibility with x64.
1497 (x_get_focus_frame): Add prototype.
1498
1499 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1500 defining an XRectangle structure.
1501
1502 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1503 arithmetics for compatibility with x64.
1504
1505 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1506 compatibility with x64.
1507
1508 * w32heap.h: Adjust prototypes and declarations.
1509
1510 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1511 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1512 DWORD, long, and unsigned long, for compatibility with x64.
1513 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1514 (sbrk): Argument is now of type ptrdiff_t.
1515
1516 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1517 less than 0x0500.
1518 (w32_msg_pump): Use WPARAM type for 'result'.
1519
1520 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1521 architecture.
1522 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1523 compatibility with x64.
1524
1525 * vm-limit.c (lim_data): Now size_t.
1526 (check_memory_limits): Adjust prototypes of real_morecore and
1527 __morecore to receive argument of type ptrdiff_t. Use size_t for
1528 five_percent and data_size.
1529
1530 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1531 variables, for compatibility with x64.
1532 (rva_to_section, offset_to_section, relocate_offset)
1533 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1534 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1535 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1536 for compatibility with x64.
1537
1538 * sysdep.c (STDERR_FILENO): Define if not already defined.
1539
1540 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1541 (__morecore): Argument type is now ptrdiff_t.
1542 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1543 (relinquish): Use ptrdiff_t type for 'excess'.
1544 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1545
1546 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1547 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1548 instead of a literal number.
1549
1550 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1551 (min): Define only if not already defined.
1552
1553 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1554 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1555 hosts.
1556
1557 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1558 'bitmaps' is a pointer.
1559
1560 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1561
1562 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1563
1564 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1565
1566 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1567 * dired.c (directory_files_internal, Ffile_attributes):
1568 New arg follow_symlinks. All uses changed.
1569
1570 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1571
1572 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1573
1574 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1575
1576 Support atimers and CPU profiler via profile.c on MS-Windows.
1577 * w32proc.c (sig_mask, crit_sig): New static variables.
1578 (sys_signal): Support SIGALRM and SIGPROF.
1579 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1580 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1581 sigfillset, and sigprocmask are no longer no-ops.
1582 (sigismember): New function.
1583 (struct itimer_data): New definition.
1584 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1585 (crit_prof): New static variables.
1586 (MAX_SINGLE_SLEEP): New definition.
1587 (timer_loop, stop_timer_thread, term_timers, init_timers)
1588 (start_timer_thread, getitimer, setitimer): New functions.
1589 (alarm): No longer a no-op, calls setitimer.
1590
1591 * w32.c (term_ntproc): Call term_timers.
1592 (init_ntproc): Make sure all signals are unblocked at startup, to
1593 erase any traces of dumping. Call init_timers.
1594
1595 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1596 Windows-specific code to display the hourglass mouse pointer is no
1597 longer used.
1598 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1599 to hourglass timer expiration.
1600 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1601 Remove, no longer used.
1602 (w32_note_current_window, show_hourglass, hide_hourglass):
1603 New functions, in support of hourglass cursor display similar to other
1604 window systems.
1605 (syms_of_w32fns): Don't initialize hourglass_timer.
1606
1607 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1608 WINDOWSNT as well.
1609 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1610
1611 * w32.h (init_timers, term_timers): Add prototypes.
1612
1613 2012-09-30 Kenichi Handa <handa@gnu.org>
1614
1615 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1616 to the buffer relocation which may be caused by ccl_driver.
1617
1618 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1619
1620 * xfns.c (Fx_file_dialog): Update comment.
1621
1622 * w32fns.c (Fx_file_dialog): Update comment.
1623
1624 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1625 Initialize panel name field if OSX >= 10.6.
1626
1627 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1628
1629 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1630
1631 * nsterm.m (NEW_STYLE_FS): New define.
1632 (ns_fullscreen_hook, windowWillEnterFullScreen)
1633 (windowDidEnterFullScreen, windowWillExitFullScreen)
1634 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1635 (setFSValue): New functions.
1636 (EmacsFSWindow): New implementation.
1637 (canBecomeKeyWindow): New function for EmacsFSWindow.
1638 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1639 (dealloc): Release nonfs_window if in fullscreen.
1640 (updateFrameSize:): Call windowDidMove to update top/left.
1641 (windowWillResize:toSize:): Check if frame is still maximized.
1642 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1643 next_maximized, maximized_width, maximized_height and nonfs_window.
1644 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1645 tbar_height.
1646 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1647 fullscreen. Set maximized_width/height. Act on next_maximized.
1648
1649 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1650 (EmacsView): Add variables for fullscreen.
1651 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1652 (EmacsFSWindow): New interface for fullscreen.
1653
1654 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1655
1656 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1657
1658 2012-09-30 Chong Yidong <cyd@gnu.org>
1659
1660 * fns.c (Frandom): Doc fix.
1661
1662 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1663
1664 * window.c (Vwindow_combination_limit): New default value.
1665 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1666
1667 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1668
1669 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1670 Suggested by Eli Zaretskii in
1671 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1672
1673 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1674
1675 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1676 HAVE_TIMER_SETTIME is defined.
1677
1678 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1679
1680 Profiler improvements: more-accurate timers, overflow checks.
1681 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1682 signal.h, setjmp.h. Include systime.h instead.
1683 (saturated_add): New function.
1684 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1685 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1686 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1687 New static vars.
1688 (enum profiler_cpu_running): New enum.
1689 (profiler_cpu_running): Now of that enum type, not bool.
1690 All uses changed to store the new value.
1691 (handle_profiler_signal): Rename from sigprof_handler_1,
1692 for consistency with other handlers. Do not check whether
1693 cpu_log is a hash-table if garbage collecting, since it
1694 doesn't matter in that case.
1695 (deliver_profiler_signal): Rename from sigprof_handler,
1696 for consistency with other handlers.
1697 (setup_cpu_timer): New function, with much of what used to be in
1698 Fprofiler_cpu_start. Check for out-of-range argument.
1699 Prefer timer_settime if available, and prefer
1700 thread cputime clocks, then process cputime clocks, then
1701 monotonic clocks, to the old realtime clock. Use make_timeval
1702 to round more-correctly when falling back to setitimer.
1703 (Fprofiler_cpu_start): Use it.
1704 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1705 Don't assume that passing NULL as the 2nd argument of setitimer
1706 is the same as passing a pointer to all-zero storage.
1707 Ignore SIGPROF afterwards.
1708 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1709 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1710 non-fatal signal handlers. Ignore SIGPROF on startup.
1711 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1712 in profiler.c, since sysdep.c now uses it.
1713
1714 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1715 Suggested by Eli Zaretskii in
1716 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1717
1718 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1719
1720 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1721
1722 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1723
1724 * lisp.h (struct backtrace): Remove indirection for `function' field.
1725 * xdisp.c (redisplay_internal):
1726 * profiler.c (record_backtrace, sigprof_handler_1):
1727 * alloc.c (Fgarbage_collect):
1728 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1729 (Fbacktrace_frame): Adjust accordingly.
1730
1731 2012-09-28 Glenn Morris <rgm@gnu.org>
1732
1733 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1734 (Frun_hook_with_args_until_failure): Doc fixes.
1735
1736 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1737
1738 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1739 Qautomatic_redisplay and change the symbol name. All users changed.
1740
1741 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1742
1743 * profiler.c (sigprof_handler): Fix race condition.
1744
1745 2012-09-28 Glenn Morris <rgm@gnu.org>
1746
1747 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1748
1749 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1750
1751 Check more robustly for timer_settime.
1752 * Makefile.in (LIB_TIMER_TIME): New macro.
1753 (LIBES): Add it.
1754 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1755 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1756 call timer_settime.
1757
1758 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1759
1760 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1761
1762 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1763
1764 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1765
1766 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1767
1768 * character.h (MAYBE_UNIFY_CHAR): Remove.
1769 * charset.c, charset.h (maybe_unify_char): Now static.
1770 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1771 Since this stuff is now private to charset.c, there's no need for
1772 a public macro and no need to inline by hand.
1773
1774 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1775 Stefan Monnier <monnier@iro.umontreal.ca>
1776 Juanma Barranquero <lekktu@gmail.com>
1777
1778 * profiler.c: New file.
1779 * Makefile.in (base_obj): Add profiler.o.
1780 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1781 ($(BLD)/profiler.$(O)): New target.
1782 * emacs.c (main): Call syms_of_profiler.
1783 * alloc.c (Qautomatic_gc): New constant.
1784 (MALLOC_PROBE): New macro.
1785 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1786 (total_bytes_of_live_objects): New function.
1787 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1788 Call malloc_probe for the memory profiler.
1789 (syms_of_alloc): Define Qautomatic_gc.
1790 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1791 race condition.
1792 (struct backtrace): Move definition...
1793 * lisp.h (struct backtrace): ..here.
1794 (Qautomatic_gc, profiler_memory_running): Declare vars.
1795 (malloc_probe, syms_of_profiler): Declare functions.
1796 * xdisp.c (Qautomatic_redisplay): New constant.
1797 (redisplay_internal): Record itself in backtrace_list.
1798 (syms_of_xdisp): Define Qautomatic_redisplay.
1799
1800 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1801 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1802
1803 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1804
1805 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1806
1807 Prefer POSIX timers if available.
1808 They avoid a race if the timer is too close to the current time.
1809 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1810 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1811 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1812
1813 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1814
1815 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1816 CHAR_STRING_ADVANCE.
1817 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1818 STRING_CHAR_ADVANCE.
1819
1820 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1821
1822 Move Vlibrary_cache to emacs.c and reset before dumping.
1823
1824 * lisp.h (reset_image_types): Declare.
1825 [WINDOWSNT] (Vlibrary_cache): Declare.
1826
1827 * image.c (reset_image_types): New function.
1828
1829 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1830 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1831 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1832
1833 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1834 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1835
1836 * w32.h (Vlibrary_cache): Do not declare.
1837
1838 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1839
1840 * w32proc.c (sys_signal): Handle all signals defined by the
1841 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1842 handlers for signals supported by Windows. Don't override
1843 term_ntproc as the handler for SIGABRT.
1844 (sigaction): Rewrite to call sys_signal instead of duplicating its
1845 code.
1846 (sys_kill): Improve commentary.
1847
1848 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1849 consistency with a signature of a signal handler. All callers
1850 changed.
1851 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1852 install term_ntproc as a signal handler for SIGABRT, as that
1853 should be done by the dumped Emacs.
1854
1855 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1856
1857 * w32select.c (term_w32select): Protect against repeated
1858 invocation by setting clipboard_owner to NULL after calling
1859 DestroyWindow.
1860
1861 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1862 and term_ntproc to their modified signatures.
1863
1864 * character.c (char_string, string_char): Remove calls to
1865 MAYBE_UNIFY_CHAR. See the discussion starting at
1866 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1867 for the details.
1868
1869 2012-09-25 Chong Yidong <cyd@gnu.org>
1870
1871 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1872
1873 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1874
1875 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1876 when encountering an unknown bytecode.
1877
1878 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1879
1880 image.c, indent.c: Use bool for booleans.
1881 * dispextern.h (struct image_type): Members valid_p, load, init
1882 now return bool, not int. All uses changed.
1883 * image.c: Omit unnecessary static decls.
1884 (x_create_bitmap_mask, x_build_heuristic_mask):
1885 Return void, not int, since callers don't care about the return value.
1886 (x_create_bitmap_mask, define_image_type, valid_image_p)
1887 (struct image_keyword, parse_image_spec, image_spec_value)
1888 (check_image_size, image_background)
1889 (image_background_transparent, x_clear_image_1)
1890 (postprocess_image, lookup_image, x_check_image_size)
1891 (x_create_x_image_and_pixmap, xbm_image_p)
1892 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1893 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1894 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1895 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1896 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1897 (png_image_p, init_png_functions, png_load_body, png_load)
1898 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1899 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1900 (init_gif_functions, gif_load, imagemagick_image_p)
1901 (imagemagick_load_image, imagemagick_load, svg_image_p)
1902 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1903 (gs_load):
1904 * nsimage.m (ns_load_image):
1905 * nsterm.m (ns_defined_color):
1906 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1907 * xfns.c (x_defined_color):
1908 * xterm.c (x_alloc_lighter_color_for_widget)
1909 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1910 (x_alloc_lighter_color):
1911 * indent.c (disptab_matches_widthtab, current_column)
1912 (scan_for_column, string_display_width, indented_beyond_p)
1913 (compute_motion, vmotion, Fvertical_motion):
1914 Use bool for booleans.
1915
1916 2012-09-24 Chong Yidong <cyd@gnu.org>
1917
1918 * chartab.c (Fset_char_table_default): Obsolete function removed.
1919
1920 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1921
1922 Move pid_t related decls out of lisp.h.
1923 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1924 (interruptible_wait_for_termination):
1925 Move these decls from lisp.h to syswait.h, since they use pid_t.
1926 Needed on FreeBSD; see Herbert J. Skuhra in
1927 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1928 * callproc.c: Include syswait.h.
1929
1930 gnutls.c, gtkutil.c: Use bool for boolean.
1931 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1932 (emacs_gnutls_handle_error):
1933 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1934 (xg_hide_tooltip, xg_create_frame_widgets)
1935 (create_dialog, xg_uses_old_file_dialog)
1936 (xg_get_file_with_chooser, xg_get_file_with_selection)
1937 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1938 (xg_item_label_same_p, xg_update_menubar)
1939 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1940 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1941 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1942 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1943 (update_frame_tool_bar, free_frame_tool_bar):
1944 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1945 * nsmenu.m (ns_update_menubar):
1946 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1947 * xfns.c (Fx_show_tip) [USE_GTK]:
1948 Use bool for boolean.
1949 * gtkutil.c (xg_update_frame_menubar):
1950 * xmenu.c (update_frame_menubar):
1951 Return void, not int, since caller ignores return value.
1952 * gtkutil.c (xg_change_toolbar_position):
1953 Return void, not 1.
1954
1955 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1956
1957 * makefile.w32-in (BLOCKINPUT_H): Remove.
1958 (SYSSIGNAL_H): New macro.
1959 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1960 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1961 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1962 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1963 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1964 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1965 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1966 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1967 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1968 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1969 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1970 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1971 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1972 ($(BLD)/w32xfns.$(O)): Update dependencies.
1973
1974 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1975
1976 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1977 fatal_error_backtrace.
1978
1979 * w32proc.c (sys_kill): Undo last change: don't do anything when
1980 invoked to deliver SIGABRT to our own process. This is now
1981 handled by emacs_raise.
1982
1983 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1984
1985 * w32term.c (w32_read_socket): Remove leftover reference to
1986 interrupt_input_pending.
1987
1988 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1989
1990 Do not use SA_NODEFER.
1991 Problem reported by Dani Moncayo in
1992 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1993 * alloc.c (die):
1994 * sysdep.c (emacs_abort): Do not reset signal handler.
1995 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1996 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1997 wanted even on POSIXish hosts, and it doesn't work on Windows.
1998
1999 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2000
2001 * xterm.c (x_term_init): Call fixup_locale before and after calling
2002 gtk_init (Bug#12392).
2003
2004 2012-09-23 Chong Yidong <cyd@gnu.org>
2005
2006 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2007 Vdynamic_library_alist.
2008
2009 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2010 (Fgnutls_available_p): Caller changed.
2011
2012 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2013 (Flibxml_parse_xml_region): Likewise.
2014
2015 * dispextern.h (struct image_type): Remove arg from init function.
2016
2017 * image.c (Finit_image_library, lookup_image_type)
2018 (define_image_type): Remove now-unneeded second arg.
2019 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2020 (init_tiff_functions, init_gif_functions, init_svg_functions):
2021 Arglist and w32_delayed_load calling convention changed.
2022 (gs_type): Remove init_gs_functions; there is no such function.
2023 (valid_image_p, make_image): Fix caller to lookup_image_type.
2024
2025 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2026
2027 Simplify and avoid signal-handling races (Bug#12471).
2028 * alloc.c (die):
2029 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2030 Avoid recursive loop if there's a fatal error in the function itself.
2031 * atimer.c (pending_atimers):
2032 * blockinput.h: Don't include "atimer.h"; no longer needed.
2033 (interrupt_input_pending): Remove. All uses removed.
2034 pending_signals now counts both atimers and ordinary interrupts.
2035 This is less racy than having three separate pending-signal flags.
2036 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2037 (input_blocked_p):
2038 Rename from their upper-case counterparts BLOCK_INPUT,
2039 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2040 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2041 This makes it easier to access volatile variables more accurately.
2042 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2043 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2044 that's more reliable if the code is buggy and sets
2045 interrupt_input_blocked to a negative value. All uses changed.
2046 * atimer.c (deliver_alarm_signal):
2047 Remove. No need to deliver this to the parent; any thread can
2048 handle this signal now. All uses replaced by underlying handler.
2049 * atimer.c (turn_on_atimers):
2050 * dispnew.c (handle_window_change_signal):
2051 * emacs.c (handle_danger_signal):
2052 * keyboard.c (kbd_buffer_get_event):
2053 Don't reestablish signal handler; not needed with sigaction.
2054 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2055 (UNBLOCK_INPUT_TO):
2056 Rework to avoid unnecessary accesses to volatile variables.
2057 (UNBLOCK_INPUT_TO): Now a function.
2058 (totally_unblock_input, unblock_input): New decls.
2059 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2060 (init_data): Remove. Necessary stuff now done in init_signal.
2061 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2062 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2063 (fatal_error_code): Remove; no longer needed.
2064 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2065 it doesn't always backtrace. All uses changed. No need to reset
2066 signal to default, since sigaction and/or die does that for us now.
2067 Use emacs_raise (FOO), not kill (getpid (), FOO).
2068 (main): Check more-accurately whether we're dumping.
2069 Move fatal-error setup to sysdep.c
2070 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2071 * gtkutil.c (xg_get_file_name, xg_get_font):
2072 Remove no-longer-needed signal-mask manipulation.
2073 * keyboard.c, process.c (POLL_FOR_INPUT):
2074 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2075 * keyboard.c (read_avail_input): Remove.
2076 All uses replaced by gobble_input.
2077 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2078 (kbd_buffer_store_event_hold, gobble_input):
2079 (record_asynch_buffer_change) [USABLE_SIGIO]:
2080 (store_user_signal_events):
2081 No need to mess with signal mask.
2082 (gobble_input): If blocking input and there are terminals, simply
2083 set pending_signals to 1 and return. All hooks changed to not
2084 worry about whether input is blocked.
2085 (process_pending_signals): Clear pending_signals before processing
2086 them, in case a signal comes in while we're processing.
2087 By convention callers now test pending_signals before calling us.
2088 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2089 New functions, to support changes to blockinput.h.
2090 (handle_input_available_signal): Now extern.
2091 (reinvoke_input_signal): Remove. All uses replaced by
2092 handle_async_input.
2093 (quit_count): Now volatile, since a signal handler uses it.
2094 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2095 All callers changed. Block SIGINT only if not already blocked.
2096 Clear sigmask reliably, even if Fsignal returns, which it can.
2097 Omit unnecessary accesses to volatile var.
2098 (quit_throw_to_read_char): No need to restore sigmask.
2099 * keyboard.c (gobble_input, handle_user_signal):
2100 * process.c (wait_reading_process_output):
2101 Call signal-handling code rather than killing ourselves.
2102 * lisp.h: Include <float.h>, for...
2103 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2104 (pending_signals): Now volatile.
2105 (syms_of_data): Now const if IEEE floating point.
2106 (handle_input_available_signal) [USABLE_SIGIO]:
2107 (terminate_due_to_signal, record_child_status_change): New decls.
2108 * process.c (create_process): Avoid disaster if memory is exhausted
2109 while we're processing a vfork, by tightening the critical section
2110 around the vfork.
2111 (send_process_frame, process_sent_to, handle_pipe_signal)
2112 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2113 ignores SIGPIPE.
2114 (send_process): No need for setjmp/longjmp any more, since the
2115 SIGPIPE stuff is now gone. Instead, report an error if errno
2116 is EPIPE.
2117 (record_child_status_change): Now extern. PID and W are now args.
2118 Return void, not bool. All callers changed.
2119 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2120 Remove. All uses removed. This bug should be fixed now in a
2121 different way.
2122 (wait_for_termination_1): Use waitpid rather than sigsuspend,
2123 and record the child status change directly. This avoids the
2124 need to futz with the signal mask.
2125 (process_fatal_action): Move here from emacs.c.
2126 (emacs_sigaction_flags): New function, containing
2127 much of what used to be in emacs_sigaction_init.
2128 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2129 caught by emacs, to make races less likely.
2130 (deliver_process_signal): Rename from handle_on_main_thread.
2131 All uses changed.
2132 (BACKTRACE_LIMIT_MAX): Now at top level.
2133 (thread_backtrace_buffer, threadback_backtrace_pointers):
2134 New static vars.
2135 (deliver_thread_signal, deliver_fatal_thread_signal):
2136 New functions, for more-accurate delivery of thread-specific signals.
2137 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2138 (deliver_arith_signal): Handle in this thread, not
2139 in the main thread, since it's triggered by this thread.
2140 (maybe_fatal_sig): New function.
2141 (init_signals): New arg DUMPING so that we can be more accurate
2142 about whether we're dumping. Caller changed.
2143 Treat thread-specific signals differently from process-general signals.
2144 Block all signals while handling fatal error; that's safer.
2145 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2146 on IEEE hosts.
2147 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2148 Ignore SIGPIPE unless batch.
2149 (emacs_backtrace): Output backtrace for the appropriate thread,
2150 which is not necessarily the main thread.
2151 * syssignal.h: Include <stdbool.h>.
2152 (emacs_raise): New macro.
2153 * xterm.c (x_connection_signal): Remove; no longer needed
2154 now that we use sigaction.
2155 (x_connection_closed): No need to mess with sigmask now.
2156 (x_initialize): No need to reset SIGPIPE handler here, since
2157 init_signals does this for us now.
2158
2159 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2160
2161 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2162 background rect may be larger (Bug#12245).
2163
2164 2012-09-23 Chong Yidong <cyd@gnu.org>
2165
2166 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2167
2168 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2169
2170 * .gdbinit: Just stop at fatal_error_backtrace.
2171 See Stefan Monnier's request in
2172 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2173 Remove no-longer-used query of system type.
2174
2175 2012-09-22 Chong Yidong <cyd@gnu.org>
2176
2177 * search.c (Freplace_match): Doc fix (Bug#12325).
2178
2179 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2180
2181 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2182 (Fline_end_position): Doc fix.
2183
2184 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2185
2186 2012-09-22 Chong Yidong <cyd@gnu.org>
2187
2188 * dispextern.h (struct image_type): Add new slot, storing a type
2189 initialization function.
2190
2191 * image.c (define_image_type): Call the image initializer function
2192 if it is defined. Arguments and return value changed.
2193 (valid_image_p, make_image): Callers changed.
2194 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2195 (gif_type, imagemagick_type, svg_type, gs_type):
2196 Add initialization functions.
2197 (Finit_image_library): Call lookup_image_type.
2198 (CHECK_LIB_AVAILABLE): Macro deleted.
2199 (lookup_image_type): Call define_image_type here, rather than via
2200 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2201 (syms_of_image): Move define_image_type calls for xbm_type and
2202 pbm_type to lookup_image_type.
2203
2204 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2205
2206 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2207 'idle_timers' from here ...
2208 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2209 lists, to avoid infloops when the timer does something stupid,
2210 like reinvoke itself with the same or smaller time-out.
2211 (Bug#12447)
2212
2213 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2214
2215 * window.c (Fsplit_window_internal): Handle only Qt value of
2216 Vwindow_combination_limit separately.
2217 (Qtemp_buffer_resize): New symbol.
2218 (Vwindow_combination_limit): New default value.
2219 Rewrite doc-string.
2220
2221 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2222
2223 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2224 the new overlay string. (Bug#10159)
2225
2226 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2227
2228 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2229 or that fprintf is async-signal-safe. POSIX doesn't require
2230 either assumption.
2231
2232 2012-09-22 Chong Yidong <cyd@gnu.org>
2233
2234 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2235 (Bug#8207).
2236
2237 2012-09-22 Kenichi Handa <handa@gnu.org>
2238
2239 * composite.c (composition_reseat_it): Handle the case that a
2240 grapheme cluster is not covered by a single font (Bug#12352).
2241
2242 2012-09-21 Chong Yidong <cyd@gnu.org>
2243
2244 * image.c (define_image_type): Avoid adding duplicate types to
2245 image_types (Bug#12463). Suggested by Jörg Walter.
2246
2247 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2248
2249 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2250 (print_load_command_name): Add case LC_DATA_IN_CODE.
2251 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2252
2253 2012-09-21 Glenn Morris <rgm@gnu.org>
2254
2255 * eval.c (Frun_hook_with_args_until_success)
2256 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2257
2258 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2259
2260 * fileio.c (Ffile_selinux_context): Only call freecon when
2261 lgetfilecon succeeded.
2262 (Fset_file_selinux_context): Likewise. (Bug#12444)
2263
2264 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2265
2266 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2267 reordering, locate the cursor by calling set_cursor_from_row; if
2268 that fails, clear the desired glyph matrix before returning a
2269 failure indication to the caller. Fixes leaving garbled display
2270 when fast scrolling with a down-key. (Bug#12403)
2271 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2272 scrolling through multibyte text.
2273
2274 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2275
2276 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2277 calling mark_vectorlike since that's the one that marks the window.
2278 (mark_discard_killed_buffers): Mark the final cdr.
2279 * window.h (struct window): Move prev/next_buffers to the
2280 non-standard fields.
2281 * window.c (make_window): Initialize prev/next_buffers manually.
2282
2283 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2284
2285 Omit unused arg EXPECTED from socket hooks.
2286 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2287 * nsterm.m (ns_term_init):
2288 * termhooks.h (struct terminal.read_socket_hook):
2289 * w32inevt.c (w32_console_read_socket):
2290 * w32term.c (w32_read_socket):
2291 * xterm.c (XTread_socket):
2292 Omit unused arg EXPECTED. All callers changed.
2293 (store_user_signal_events): Return void, not int, since callers no
2294 longer care about the return value. All uses changed.
2295
2296 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2297
2298 * w32gui.h (XParseGeometry): Do not declare.
2299
2300 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2301
2302 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2303 Ignore 'expected'. See Eli Zaretskii in
2304 <http://bugs.gnu.org/12471#8> (last line).
2305
2306 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2307 (XParseGeometry): Now static. Substitute extremal values for
2308 values that are out of range.
2309
2310 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2311
2312 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2313
2314 * nsfns.m (XParseGeometry): Remove.
2315 (Fx_create_frame): Call x_set_offset to correctly interpret
2316 top_pos in geometry.
2317
2318 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2319 (Fx_parse_geometry): If there is a space in string, call
2320 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2321
2322 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2323
2324 * search.c (scan_buffer): Use character positions in calls to
2325 region_cache_forward and region_cache_backward, not byte
2326 positions. (Bug#12196)
2327
2328 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2329 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2330
2331 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2332 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2333 emacs_blocked_malloc, now deleted.
2334
2335 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2336
2337 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2338 The workaround was for improving performance on Solaris 2.4, but
2339 is getting in the way now. Emacs will still work if someone is
2340 still running Solaris 2.4 in a museum somewhere; Sun dropped
2341 support for Solaris 2.4 in 2003.
2342 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2343 * process.c (create_process) [HAVE_WORKING_VFORK]:
2344 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2345 since Emacs no longer uses vfork on that platform.
2346
2347 2012-09-17 Glenn Morris <rgm@gnu.org>
2348
2349 * emacs.c: Use COPYRIGHT.
2350
2351 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2352
2353 Remove configure's --without-sync-input option (Bug#12450).
2354 When auditing signal-handling in preparation for cleaning it up,
2355 I found that SYNC_INPUT has race conditions and would be a real
2356 pain to fix. Since it's an undocumented and deprecated
2357 configure-time option, now seems like a good time to remove it.
2358 Also see <http://bugs.gnu.org/11080#16>.
2359 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2360 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2361 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2362 (malloc_hysteresis):
2363 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2364 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2365 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2366 (dont_register_blocks, bytes_used_when_reconsidered)
2367 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2368 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2369 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2370 Remove. All uses removed.
2371 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2372 implementation, one that depends on whether the new macro
2373 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2374 is defined.
2375 * atimer.c (run_timers, handle_alarm_signal):
2376 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2377 (handle_async_input, process_pending_signals)
2378 (handle_input_available_signal, init_keyboard):
2379 * nsterm.m (ns_read_socket):
2380 * process.c (wait_reading_process_output):
2381 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2382 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2383 (emacs_write):
2384 * xterm.c (XTread_socket):
2385 Assume SYNC_INPUT.
2386 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2387 * eval.c (handling_signal): Remove. All uses removed.
2388 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2389 All uses replaced with the SYNC_INPUT version.
2390 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2391 Remove decls.
2392 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2393 Now static.
2394
2395 * font.c (Ffont_shape_gstring): Remove unused local.
2396
2397 2012-09-16 Glenn Morris <rgm@gnu.org>
2398
2399 * Makefile.in (clean): No longer run nextstep's clean.
2400
2401 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2402 (ns_frag): Remove.
2403 (ns-app): Move here from ns.mk, and simplify.
2404 (clean): Simplify nextstep entry.
2405 * ns.mk: Remove file.
2406
2407 2012-09-17 Kenichi Handa <handa@gnu.org>
2408
2409 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2410 not covert the last few charactes.
2411
2412 2012-09-16 Kenichi Handa <handa@gnu.org>
2413
2414 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2415 here, but just check the validity of glyphs in the glyph-string.
2416
2417 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2418
2419 * window.c (Fwindow_parameter, Fset_window_parameter):
2420 Accept any window as argument (Bug#12452).
2421
2422 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2423
2424 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2425 to ns_term_init to avoid memory leak.
2426
2427 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2428 explicit retain/release.
2429 (ns_term_init): Only allow one display. Initialize outerpool and
2430 ns_*_types.
2431
2432 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2433
2434 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2435 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2436 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2437 the Microsoft problem in a different way, by altering ../nt/config.nt.
2438
2439 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2440
2441 * w32xfns.c:
2442 * w32uniscribe.c:
2443 * w32term.c:
2444 * w32select.c:
2445 * w32reg.c:
2446 * w32proc.c:
2447 * w32menu.c:
2448 * w32inevt.c:
2449 * w32heap.c:
2450 * w32font.c:
2451 * w32fns.c:
2452 * w32console.c:
2453 * w32.c:
2454 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2455 by lisp.h. This completes removal of setjmp.h inclusion
2456 erroneously announced in the previous commit. (Bug#12446)
2457
2458 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2459 more accurate.
2460
2461 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2462 not defined as a macro. The latter happens on MS-Windows.
2463 (Bug#12446)
2464
2465 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2466
2467 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2468 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2469 Some instances of '#include <setjmp.h>' removed, if the
2470 only reason for the instance was because "lisp.h" was included.
2471 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2472 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2473 and _longjmp with the new symbols. Emacs already uses _setjmp if
2474 available, so this change affects only POSIXish hosts that have
2475 sigsetjmp but not _setjmp, such as some versions of Solaris and
2476 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2477 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2478 (png_load_body) [HAVE_PNG]:
2479 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2480 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2481 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2482 since PNG requires jmp_buf. This is the only exception to the
2483 general rule that we now use sys_setjmp and sys_longjmp.
2484 This exception is OK since this code does not change the signal
2485 mask or longjmp out of a signal handler.
2486
2487 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2488
2489 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2490 Include "syssignal.h", for 'main_thread'.
2491
2492 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2493
2494 Avoid out-of-range marker position (Bug#12426).
2495 * insdel.c (replace_range, replace_range_2):
2496 Adjust markers before overlays, as suggested by comments.
2497 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2498 Remove redundant check before calling offset_intervals.
2499
2500 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2501
2502 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2503 current buffer (Bug#12387).
2504
2505 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2506
2507 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2508
2509 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2510
2511 Use a more backwards-compatible timer format (Bug#12430).
2512 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2513 vector element, not from the 4th, since PSECS is now at the end.
2514 (Fcurrent_idle_time): Doc fix.
2515
2516 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2517
2518 Function to mark objects and remove killed buffers at once.
2519 * alloc.c (discard_killed_buffers): Rename to ...
2520 (mark_discard_killed buffers) ... new name. Add marking
2521 of remaining objects. Fix comment. Adjust users.
2522 (mark_object): Do not touch frame buffer lists here.
2523 * frame.c (delete_frame): Reset frame buffer lists here.
2524
2525 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2526
2527 Better workaround for GNOME bug when --enable-gcc-warnings.
2528 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2529 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2530 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2531
2532 Simplify SIGIO usage (Bug#12408).
2533 The code that dealt with SIGIO was crufty and confusing, e.g., it
2534 played tricks like "#undef SIGIO" but these tricks were not used
2535 consistently. Simplify mostly by not #undeffing standard symbols,
2536 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2537 or not as we please) rather than "defined SIGIO" (standard symbol
2538 that we probably shouldn't #undef).
2539 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2540 Modules that need it can include it.
2541 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2542 * dispextern.h (ignore_sigio): New decl.
2543 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2544 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2545 * emacs.c (shut_down_emacs):
2546 * keyboard.c (kbd_buffer_store_event_hold):
2547 Use ignore_sigio rather than invoking 'signal' directly.
2548 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2549 for FIONREAD.
2550 (FIONREAD, SIGIO): Do not #undef.
2551 (tty_read_avail_input): Use #error rather than a syntax error.
2552 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2553 for I_PIPE, used by SETUP_SLAVE_PTY.
2554 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2555 * sysdep.c (croak): Remove; no longer needed. This bit of
2556 temporary code, with Fred N. Fish's comment that it's temporary,
2557 has been in Emacs since at least 1992!
2558 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2559 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2560 * syssignal.h (croak): Remove decl.
2561 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2562 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2563 now that we're termios-only.
2564 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2565 * term.c (dissociate_if_controlling_tty): Use #error rather than
2566 a run-time error.
2567
2568 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2569 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2570 to work around GNOME bug 683906.
2571 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2572 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2573 This works around GCC bug 54561.
2574
2575 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2576
2577 More fixes for 'volatile' and setjmp/longjmp.
2578 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2579 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2580 (png_load_body) [HAVE_PNG]:
2581 (jpeg_load_body) [HAVE_JPEG]:
2582 New function, with most of the old parent function's body.
2583 (png_load) [HAVE_PNG]:
2584 (jpeg_load) [HAVE_JPEG]:
2585 Invoke the new function, to avoid longjmp munging our locals.
2586 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2587 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2588 longjmp is passed 2, as the C standard doesn't guarantee this.
2589 Instead, store the failure code into mgr->failure_code.
2590
2591 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2592
2593 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2594 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2595 (syms_of_keyboard): Remove support for unread-command-char.
2596
2597 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2598
2599 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2600 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2601 violation. (Bug#12426)
2602
2603 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2604
2605 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2606
2607 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2608
2609 * eval.c: Add `inhibit-debugger'.
2610 (Qinhibit_debugger): New symbol.
2611 (call_debugger): Bind it instead of Qdebug_on_error.
2612 (maybe_call_debugger): Test Vinhibit_debugger.
2613 (syms_of_eval): Define inhibit-debugger.
2614 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2615 (syms_of_xdisp): Remove inhibit-debug-on-message.
2616
2617 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2618
2619 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2620 If a nonvolatile local variable is written before a _longjmp to
2621 the frame containing the variable, and is read after the _longjmp,
2622 the value read is indeterminate. Some local variables of type
2623 'struct handler' and 'struct catchtag' are used in this way, so
2624 mark each of their slots as volatile if the slot can be set before
2625 _longjmp and read afterwards.
2626 * lisp.h (struct handler): var and chosen_clause are now volatile.
2627 (struct catchtag): val, next, and pdlcount are now volatile.
2628
2629 * bidi.c (bidi_push_it, bidi_pop_it):
2630 * fns.c (copy_hash_table):
2631 * image.c (define_image_type):
2632 * keyboard.c (kbd_buffer_store_event_hold):
2633 * process.c (Fprocess_send_eof):
2634 * xfaces.c (x_create_gc) [HAVE_NS]:
2635 * xgselect.c (xg_select):
2636 Prefer assignment to memcpy when either will do.
2637
2638 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2639 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2640 time an item is removed. No need to mark this function 'inline';
2641 the compiler knows better than we do.
2642
2643 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2644
2645 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2646 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2647 to change_frame_size (Bug#12388).
2648 (windowDidResize:): Pass YES to updateFrameSize.
2649
2650 * nsterm.h: Add delay parameter to updateFrameSize.
2651
2652 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2653
2654 Discard killed buffers from deleted window and frame objects.
2655 This reduces an amount of references to killed buffers and
2656 helps GC to reclaim them faster.
2657 * alloc.c (discard_killed_buffers): New function.
2658 (mark_object): Use it for deleted windows and frames.
2659 (mark_object): If symbol's value is set up for a killed buffer
2660 or deleted frame, restore its global binding.
2661 * data.c (swap_in_global_binding): Add GC notice.
2662 (swap_in_symval_forwarding): Use convenient set_blv_where.
2663 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2664 * window.h: ... to here.
2665
2666 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2667
2668 Convenient macro to check whether the buffer is live.
2669 * buffer.h (BUFFER_LIVE_P): New macro.
2670 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2671 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2672
2673 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2674
2675 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2676 composition cases (Bug#12364).
2677
2678 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2679 overhang of succeeding glyphs overlapping box cursor.
2680
2681 * w32term.c (x_draw_glyph_string): Likewise.
2682
2683 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2684
2685 Simplify, document, and port floating-point (Bug#12381).
2686 The porting part of this patch fixes bugs on non-IEEE platforms
2687 with frexp, ldexp, logb.
2688 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2689 Now static.
2690 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2691 support, by removing commented-out code and briefly listing the
2692 C89 functions excluded. The commented-out stuff was confusing
2693 maintenance, e.g., we thought we needed cbrt but it was commented out.
2694 (logb): Remove decl; no longer needed.
2695 (isfinite): New macro, if not already supplied.
2696 (isnan): Don't replace any existing macro.
2697 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2698 are present on all C89 platforms.
2699 (Ffrexp): Do not special-case zero, as frexp does the right thing
2700 for that case.
2701 (Flogb): Do not use logb, as it doesn't have the desired meaning
2702 on hosts that use non-base-2 floating point. Instead, stick with
2703 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2704 frexp, to avoid getting an unspecified result.
2705
2706 * xdisp.c (Qinhibit_debug_on_message): Now static.
2707
2708 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2709
2710 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2711 NSBezierPath (Bug#12131).
2712
2713 2012-09-10 Chong Yidong <cyd@gnu.org>
2714
2715 * fns.c (Fdelq, Fdelete): Doc fix.
2716
2717 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2718
2719 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2720 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2721
2722 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2723
2724 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2725 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2726 Use it.
2727
2728 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2729
2730 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2731 left fringe if the window has a left margin. This avoids leaving
2732 traces of the cursor because its leftmost pixel is not drawn over.
2733
2734 * dispnew.c (update_window_line): When the left margin area of a
2735 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2736 that screen line. (Bug#12277)
2737
2738 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2739
2740 Assume C89 or later for math functions (Bug#12381).
2741 This simplifies the code, and makes it a bit smaller and faster,
2742 and (most important) makes it easier to clean up signal handling
2743 since we can stop worring about floating-point exceptions in
2744 library code. That was a problem before C89, but the problem
2745 went away many years ago on all practical Emacs targets.
2746 * data.c, image.c, lread.c, print.c:
2747 Don't include <math.h>; no longer needed.
2748 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2749 might be autoconfigured, as that never happens.
2750 * data.c (fmod):
2751 * doprnt.c (DBL_MAX_10_EXP):
2752 * print.c (DBL_DIG):
2753 Remove. C89 or later always defines these.
2754 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2755 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2756 (arith_error, domain_error, domain_error2):
2757 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2758 no longer needed -- we simply return what C returns. All uses removed.
2759 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2760 the wrapped code.
2761 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2762 Remove. All uses expanded, as these macros are no longer used
2763 more than once and are now more trouble than they're worth.
2764 (Ftan): Use tan, not sin / cos.
2765 (Flogb): Assume C89 frexp.
2766 (fmod_float): Assume C89 fmod.
2767 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2768 (init_floatfns): Remove. All uses removed.
2769
2770 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2771
2772 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2773 compositeToPoint for OSX < 10.6 (Bug#12390).
2774
2775 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2776
2777 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2778 This produces more-accurate results.
2779
2780 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2781
2782 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2783 changes (Bug#12088).
2784
2785 2012-09-08 Chong Yidong <cyd@gnu.org>
2786
2787 * syntax.c (Fstring_to_syntax): Doc fix.
2788
2789 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2790
2791 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2792 in the internal border.
2793 (x_set_window_size): Remove static variables and their usage.
2794 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2795 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2796 Remove fringe/internal border adjustment (Bug#11052).
2797 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2798 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2799 (ns_fix_rect_ibw): Remove.
2800 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2801 (ns_dumpglyphs_box_or_relief): Ditto.
2802 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2803 adjustment.
2804 (ns_dumpglyphs_image): Ditto.
2805 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2806 border adjustment.
2807 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2808 their usage. Add fringe_extended_p and its use as in other terms.
2809 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2810 scroll bar was removed.
2811 (updateFrameSize): New function.
2812 (windowDidResize): Move code to updateFrameSize and call it.
2813
2814 * nsterm.h (EmacsView): Add updateFrameSize.
2815
2816 2012-09-07 Chong Yidong <cyd@gnu.org>
2817
2818 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2819
2820 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2821
2822 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2823
2824 More signal-handler cleanup (Bug#12327).
2825 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2826 Problem introduced when merging patches. Noted by Eli Zaretskii in
2827 <http://bugs.gnu.org/12327#67>.
2828 * floatfns.c: Comment fix.
2829 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2830 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2831 and anyway the declaration is harmless even if SIGDANGER is not defined.
2832 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2833 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2834 source files not surprisingly expected syssignal.h to define, or
2835 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2836 Include <sys/ioctl.h>, for FIONREAD.
2837 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2838 This eliminates a problem whereby other files mysteriously had
2839 to include "syssignal.h" before including "systty.h" if they
2840 wanted to use "#ifdef SIGIO".
2841
2842 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2843
2844 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2845
2846 * w32.c (sigemptyset): Empty the set.
2847 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2848
2849 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2850
2851 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2852
2853 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2854 (mark_object): Likewise for frame objects.
2855
2856 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2857
2858 * syssignal.h (handle_on_main_thread): Always declare,
2859 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2860 This ports to platforms without HAVE_PTHREAD.
2861
2862 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2863
2864 Signal-handler cleanup (Bug#12327).
2865 Emacs's signal handlers were written in the old 4.2BSD style with
2866 sigblock and sigmask and so forth, and this led to some
2867 inefficiencies and confusion. Rewrite these to use
2868 pthread_sigmask etc. without copying signal sets around. Also,
2869 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2870 'signal', and instead use functions that do not attempt to take
2871 over the system name space. This patch causes Emacs's text
2872 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2873 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2874 Do not include <signal.h> or "syssignal.h", as these
2875 modules do not use signals.
2876 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2877 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2878 Do not include <signal.h>, as "syssignal.h" does that for us now.
2879 * atimer.c (sigmask_atimers): New function.
2880 (block_atimers, unblock_atimers): New functions,
2881 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2882 All uses replaced.
2883 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2884 no longer needed here.
2885 * emacs.c (main): Inspect existing signal handler with sigaction,
2886 so that there's no need to block and unblock SIGHUP.
2887 * sysdep.c (struct save_signal): New member 'action', replacing
2888 old member 'handler'.
2889 (save_signal_handlers, restore_signal_handlers):
2890 Use sigaction instead of 'signal' to save and restore.
2891 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2892 New function. All users of 'signal' modified to use set_sighandler
2893 if they're writeonly, and to use sys_signal if they're read+write.
2894 (emacs_sigaction_init, forwarded_signal): New functions.
2895 (sys_signal): Remove. All uses replaced by calls to sigaction
2896 and emacs_sigaction_init, or by direct calls to 'signal'.
2897 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2898 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2899 all uses replaced by pthread_sigmask etc. calls.
2900 * syssignal.h: Include <signal.h>.
2901 (emacs_sigaction_init, forwarded_signal): New decls.
2902 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2903 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2904 (sigmask, sys_sigmask): Remove; no longer needed.
2905 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2906 (sigblock, sigunblock, sigfree):
2907 (sigsetmask) [!defined sigsetmask]:
2908 Remove. All uses replaced by pthread_sigmask.
2909 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2910 no longer need to be replaced, and its typical old uses
2911 are now done via emacs_sigaction_init and sigaction.
2912 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2913 (sys_sigdel): Remove; unused.
2914 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2915
2916 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2917
2918 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2919 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2920
2921 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2922
2923 Explicitly mark buffer_defaults and buffer_local_symbols.
2924 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2925 mark_local_symbols here.
2926 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2927 since special buffers aren't marked here any more.
2928 (allocate_buffer): Chain new buffer with all_buffers here...
2929 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2930 not here.
2931 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2932 (syms_of_buffer): Remove staticpro of the above.
2933 (init_buffer_once): Set names for buffer_defaults and
2934 buffer_local_symbols.
2935
2936 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2937
2938 Use bool for booleans in font-related modules.
2939 * font.c (font_intern_prop, font_style_to_value)
2940 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2941 (generate_otf_features, font_check_otf_features, font_check_otf)
2942 (font_match_p, font_list_entities, font_at):
2943 * fontset.c (fontset_id_valid_p, reorder_font_vector
2944 (fontset_find_font, Fset_fontset_font)
2945 (face_suitable_for_char_p) [0]:
2946 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2947 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2948 (m17n_flt_initialized, ftfont_shape_by_flt):
2949 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2950 * nsfont.m (nsfont_draw):
2951 * w32font.c (w32font_draw):
2952 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2953 Use bool for booleans.
2954 * font.h: Adjust to above API changes.
2955 (struct font, struct font_driver, struct font_driver_list):
2956 Use bool for booleans.
2957 (struct font): Remove useless member encoding_type.
2958 All users removed.
2959 * fontset.c, xftfont.c: Omit unnecessary static decls.
2960
2961 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2962
2963 * alloc.c (mark_object): Revert window marking code
2964 since it's unsafe for the Fset_window_configuration.
2965
2966 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2967
2968 Fix race conditions with signal handlers and errno (Bug#12327).
2969 Be more systematic about preserving errno whenever a signal
2970 handler returns, even if it's not in the main thread. Do this by
2971 renaming signal handlers to distinguish between signal delivery
2972 and signal handling. All uses changed.
2973 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2974 * data.c (deliver_arith_signal): Rename from arith_error.
2975 * dispnew.c (deliver_window_change_signal): Rename from
2976 window_change_signal.
2977 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2978 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2979 * keyboard.c (deliver_input_available_signal): Rename from
2980 input_available_signal.
2981 (deliver_user_signal): Rename from handle_user_signal.
2982 (deliver_interrupt_signal): Rename from interrupt_signal.
2983 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2984 (deliver_child_signal): Rename from sigchld_handler.
2985 * atimer.c (handle_alarm_signal):
2986 * data.c (handle_arith_signal):
2987 * dispnew.c (handle_window_change_signal):
2988 * emacs.c (handle_fatal_signal, handle_danger_signal):
2989 * keyboard.c (handle_input_available_signal):
2990 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2991 * process.c (handle_pipe_signal, handle_child_signal):
2992 New functions, with the actual signal-handling code taken from the
2993 original respective signal handlers, sans the sporadic attempts to
2994 preserve errno, since that's now done by handle_on_main_thread.
2995 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2996 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2997 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2998 Move to sysdep.c.
2999 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3000 Move initialization of main_thread to sysdep.c's init_signals.
3001 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3002 our usage, and simplifies the mainline code.
3003 (record_child_status_change): New static function, as a helper
3004 for handle_child_signal, and with most of the old child handler's
3005 contents.
3006 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3007 (handle_child_signal): Use the above.
3008 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3009 Moved here from emacs.c.
3010 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3011 code moved here from emacs.c's main function.
3012 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3013 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3014 This lets callers save and restore errno properly.
3015
3016 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3017
3018 Remove redundant or unused things here and there.
3019 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3020 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3021 * editfns.c (Fcompare_buffer_substrings): Likewise.
3022 * frame.h (struct terminal, struct font_driver_list):
3023 Remove redundant declarations.
3024 * window.h (Qleft, Qright): Likewise.
3025
3026 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3027
3028 Do not mark objects from deleted buffers, windows and frames.
3029 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3030 (mark_object): Likewise for windows and frames.
3031
3032 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3033
3034 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3035 buffer_defaults and buffer_local_symbols as valid objects.
3036 Return special value to denote them.
3037
3038 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3039
3040 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3041 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3042 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3043 (file_name_absolute_p, Fsubstitute_in_file_name):
3044 (check_executable, check_writable, Ffile_accessible_directory_p)
3045 (Fset_file_selinux_context, Fdefault_file_modes)
3046 (Finsert_file_contents, choose_write_coding_system)
3047 (Fwrite_region, build_annotations, a_write, e_write)
3048 (Fdo_auto_save):
3049 * filelock.c (boot_time_initialized, get_boot_time)
3050 (get_boot_time_1, lock_file_1, within_one_second):
3051 * floatfns.c (in_float):
3052 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3053 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3054 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3055 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3056 * window.c (compare_window_configurations):
3057 Use bool for booleans.
3058 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3059 (Fdefault_file_modes): Now mode_t, not int, for modes.
3060 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3061 (internal_delete_file): Now returns void, not a (boolean) int,
3062 since nobody was looking at the return value.
3063 * lisp.h, window.h: Adjust to above API changes.
3064
3065 * xdisp.c (set_message): Simplify and reindent last change.
3066
3067 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3068
3069 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3070
3071 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3072
3073 * eval.c (call_debugger): Make the function non-static so that we
3074 can call it from set_message.
3075
3076 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3077 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3078
3079 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3080
3081 Give more-useful info on a fatal error (Bug#12328).
3082 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3083 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3084 of doing the work ourselves.
3085 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3086 do most of the work.
3087 (fatal_error_backtrace): New function, taken from the guts
3088 of the old fatal_error_signal, but with a new option to output
3089 a backtrace.
3090 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3091 info about the signal than just its number.
3092 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3093 * sysdep.c: Include <execinfo.h>
3094 (emacs_backtrace): New function, taken partly from the previous
3095 code of the 'die' function.
3096 (emacs_abort): Call fatal_error_backtrace rather than abort.
3097
3098 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3099
3100 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3101 eager (load-time) macro-expansion.
3102 * lisp.mk (lisp): Add macroexp.
3103
3104 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3105
3106 Simplify redefinition of 'abort' (Bug#12316).
3107 Do not try to redefine the 'abort' function. Instead, redo
3108 the code so that it calls 'emacs_abort' rather than 'abort'.
3109 This removes the need for the NO_ABORT configure-time macro
3110 and makes it easier to change the abort code to do a backtrace.
3111 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3112 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3113 Remove; sysdep.c's emacs_abort now takes its place.
3114 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3115 'abort' changed to use 'emacs_abort'.
3116 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3117 (abort) [!defined abort]: Rename to ...
3118 (emacs_abort): ... new name.
3119 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3120 the place of the old 'abort' in emacs.c.
3121 * w32.c, w32fns.c (abort): Do not #undef.
3122 * w32.c (emacs_abort): Rename from w32_abort.
3123
3124 2012-09-04 Eli Zaretskii <eliz@gnu.org>
3125
3126 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3127 offsets[j].dv, since the y axis of the screen coordinates points
3128 down, while the y axis of the font definition coordinates points
3129 up. This fixes display of Arabic diacritics such as KASRA and
3130 KASRATAN. (Bug#11860)
3131
3132 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3133
3134 Be more systematic about _setjmp vs setjmp.
3135 * alloc.c (test_setjmp, mark_stack):
3136 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3137 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3138 (png_load, my_error_exit, jpeg_load):
3139 * process.c (send_process_trap, send_process):
3140 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3141 The underscored versions are up to 30x faster on some hosts.
3142 Formerly, the code used setjmp+longjmp sometimes and
3143 _setjmp+_longjmp at other times, with no particular reason to
3144 prefer setjmp+longjmp.
3145
3146 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3147
3148 Fix minor problem found by static checking.
3149 * buffer.c (Fdelete_all_overlays): Return nil.
3150
3151 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3152
3153 * buffer.c (Fdelete_all_overlays): New function.
3154
3155 2012-09-03 Chong Yidong <cyd@gnu.org>
3156
3157 * gtkutil.c: Add extern decl for Qxft.
3158
3159 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3160
3161 * emacs.c, eval.c: Use bool for boolean.
3162 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3163 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3164 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3165 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3166 (main, decode_env_path, Fdaemon_initialized):
3167 * eval.c (call_debugger, Finteractive_p, interactive_p):
3168 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3169 (maybe_call_debugger, Fbacktrace):
3170 * process.c (read_process_output, exec_sentinel):
3171 Use bool for booleans.
3172 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3173 All callers changed.
3174 * eval.c (interactive_p): Omit always-true boolean argument
3175 EXCLUDE_SUBRS_P. All callers changed.
3176 * dispextern.h, lisp.h: Reflect above API changes.
3177 * firstfile.c (dummy): Use the address of 'main', whose signature
3178 won't change, instead of the address of 'initialize', whose
3179 signature just changed from int to bool.
3180 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3181 * msdos.c (fatal_error_in_progress): ... from here.
3182 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3183 of incrementing it.
3184 (redisplay_internal, unwind_redisplay): Simply clear
3185 REDISPLAYING_P when unwinding, instead of saving its previous,
3186 always-false value and then restoring it.
3187
3188 Clean up some extern decls.
3189 Mostly, this hoists extern decls out of .c files and into .h files.
3190 That way, we're more likely to catch errors if the interfaces change.
3191 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3192 declare xg_mark_data.
3193 * dispextern.h (x_frame_parm_handlers):
3194 * font.h (Qxft):
3195 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3196 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3197 (Qultra_bold, Qoblique, Qitalic):
3198 Move extern decl here from .c file.
3199 * alloc.c (xg_mark_data) [USE_GTK]:
3200 * doc.c (Qclosure):
3201 * eval.c (Qlexical_binding):
3202 * fns.c (time) [!HAVE_UNISTD_H]:
3203 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3204 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3205 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3206 * lread.c (Qinternal_interpreter_environment):
3207 * minibuf.c (Qbuffer):
3208 * process.c (QCfamily, QCfilter):
3209 * widget.c (free_frame_faces):
3210 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3211 * xfont.c (x_clear_errors):
3212 * xterm.c (x_frame_parm_handlers):
3213 Remove now-redundant extern decls.
3214 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3215 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3216 Now static.
3217 * xfaces.c: Remove unnecessary static decls.
3218 * xterm.c (updating_frame): Remove decl of nonexistent object.
3219
3220 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3221 when building globals.h, as the objects that are not built on
3222 this host are not needed to compile C files on this host.
3223
3224 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3225
3226 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3227
3228 * frame.h: Add missing prototype for x_wm_set_size_hint.
3229
3230 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3231
3232 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3233 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3234 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3235 (Fsubstitute_command_keys):
3236 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3237 (save_excursion_save, save_excursion_restore)
3238 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3239 (format_time_string, general_insert_function)
3240 (make_buffer_string, make_buffer_string_both)
3241 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3242 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3243 (copy_text, insert_1, insert_1_both, insert_from_string)
3244 (insert_from_string_before_markers, insert_from_string_1)
3245 (insert_from_buffer, insert_from_buffer_1, replace_range)
3246 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3247 (del_range_2, modify_region):
3248 * intervals.c (intervals_equal, balance_possible_root_interval)
3249 (adjust_intervals_for_insertion, merge_properties_sticky)
3250 (graft_intervals_into_buffer, lookup_char_property)
3251 (adjust_for_invis_intang, set_point_both)
3252 (get_property_and_range, compare_string_intervals)
3253 (set_intervals_multibyte_1, set_intervals_multibyte):
3254 * keyboard.c (decode_timer):
3255 Use bool for boolean.
3256 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3257 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3258
3259 2012-09-02 Chong Yidong <cyd@gnu.org>
3260
3261 * keymap.c (push_key_description): Print M-TAB as C-M-i
3262 (Bug#11758).
3263
3264 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3265
3266 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3267 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3268 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3269 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3270 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3271 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3272 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3273
3274 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3275
3276 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3277 more than one grapheme cluster passed to the shaper: compute the
3278 offset adjustment values separately for each cluster. (Bug#11860)
3279
3280 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3281 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3282 about implicit conversions from integer to pointer.
3283
3284 2012-09-01 Daniel Colascione <dancol@dancol.org>
3285
3286 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3287 system used too early.
3288
3289 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3290
3291 Better seed support for (random).
3292 * emacs.c (main): Call init_random.
3293 * fns.c (Frandom): Set the seed from a string argument, if given.
3294 Remove long-obsolete Gentzel cruft.
3295 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3296 (init_random): New function.
3297
3298 2012-09-01 Daniel Colascione <dancol@dancol.org>
3299
3300 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3301 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3302 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3303 x_wm_set_size_hint, x_query_colors, x_real_positions,
3304 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3305 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3306 all of which have been moved to common code.
3307
3308 * xfaces.c: Include TERM_HEADER instead of listing all possible
3309 window-system headers.
3310
3311 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3312 to match header.
3313
3314 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3315 directly accessing frame internals.
3316
3317 * w32font.h: Include font.h. Define syms_of_w32font and
3318 globals_of_w32font.
3319
3320 * process.c: Include TERM_HEADER instead of listing all possible
3321 window-system headers.
3322
3323 * nsterm.h: Remove declarations now in frame.h.
3324 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3325
3326 * menu.c: Include TERM_HEADER instead of listing all possible
3327 window-system headers.
3328
3329 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3330 window system.
3331
3332 * keyboard.c: Include TERM_HEADER instead of listing all possible
3333 window-system headers.
3334
3335 * image.c: Include TERM_HEADER instead of listing all possible
3336 window-system headers. Declare Vlibrary_cache when compiling for
3337 Windows.
3338
3339 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3340 window system declarations.
3341
3342 * frame.h: Move common functions here: set_frame_menubar,
3343 x_set_window_size, x_sync, x_get_focus_frame,
3344 x_set_mouse_position, x_set_mouse_pixel_position,
3345 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3346 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3347 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3348 x_activate_menubar, x_real_positions, x_bitmap_icon,
3349 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3350 and x_query_colors.
3351
3352 * frame.c: Include TERM_HEADER instead of listing all possible
3353 window-system headers.
3354
3355 * font.c: Include TERM_HEADER instead of listing all possible
3356 window-system headers.
3357
3358 * emacs.c: Include TERM_HEADER.
3359
3360 * dispnew.c: Include TERM_HEADER instead of listing all possible
3361 window-system headers.
3362
3363 * ccl.h: Include character.h.
3364
3365 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3366 the current window system; include in list of objects to link into
3367 Emacs.
3368
3369 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3370
3371 Remove mark_ttys function and fix tty_display_info initialization.
3372 * lisp.h (mark_ttys): Remove prototype.
3373 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3374 to mark_ttys because all possible values of 'top_frame' slot are
3375 the frames which are reachable from Vframe_list.
3376 * term.c (mark_ttys): Remove.
3377 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3378
3379 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3380
3381 Change struct frame bitfields from unsigned char to unsigned.
3382 * frame.h (struct frame): Change type of 'display_preempted',
3383 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3384 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3385 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3386 bitfields from unsigned char to unsigned.
3387
3388 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3389
3390 Remove unused member of struct x_output and struct w32_output.
3391 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3392 * w32term.h (struct w32_output): Likewise.
3393
3394 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3395
3396 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3397 does not become zero (Bug#12234).
3398
3399 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3400
3401 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3402 for GCC 4.7.1 x86-64.
3403
3404 2012-08-30 Glenn Morris <rgm@gnu.org>
3405
3406 * lread.c (init_lread): For out-of-tree builds, only add the
3407 source directory's site-lisp dir to the load-path if it exists,
3408 consistent with in-tree builds. (Bug#12302)
3409
3410 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3411
3412 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3413 button_values to NULL. Call setStykeMask so dialogs get a close button.
3414 (windowShouldClose:): Set window_closed.
3415 (dealloc): New member, free button_values.
3416 (process_dialog:): Make member function. Remove window argument,
3417 replace window with self. Count buttons and allocate and store values
3418 in button_values.
3419 (addButton:value:row:): value is int with the name tag. Call setTag
3420 with tag. Remove return self, declare return value as void.
3421 (addString:row:): Remove return self, declare return value as void.
3422 (addSplit): Remove return self, declare return value as void.
3423 (clicked:): Remove return self, declare return value as void.
3424 Set dialog_return to button_values[seltag]. Code formatting change.
3425 (initFromContents:isQuestion:): Adjust call to process_dialog.
3426 Code formatting change.
3427 (timeout_handler:): Set timer_fired to YES.
3428 (runDialogAt:): Set timer_fired to NO.
3429 Handle click on close button as quit.
3430
3431 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3432 Add window_closed and button_values. Add void as return value for
3433 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3434 Add process_dialog as new member.
3435
3436 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3437
3438 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3439 is not one of the heaps we manage. (Bug#12242)
3440
3441 2012-08-28 Glenn Morris <rgm@gnu.org>
3442
3443 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3444
3445 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3446
3447 * window.c (Fset_window_configuration): Remove handling of
3448 auto-buffer-name window parameter. Install revision of reverted
3449 fix.
3450
3451 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3452
3453 Do not allow to set major mode for a dead buffer.
3454 * buffer.c (Fset_buffer_major_mode): Signal an error
3455 if the buffer is dead.
3456 (Fother_buffer, other_buffer_safely): Remove redundant
3457 nested declaration.
3458
3459 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3460
3461 Always use set_buffer_if_live to restore original buffer at unwind.
3462 * buffer.h (record_unwind_current_buffer): New function.
3463 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3464 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3465 * undo.c, window.c: Adjust users.
3466 * buffer.c (set_buffer_if_live): Fix comment.
3467
3468 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3469
3470 Fix usage of set_buffer_internal.
3471 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3472 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3473 * coding.c (decode_coding): Omit redundant test.
3474 * fileio.c (decide_coding_unwind): Likewise.
3475 * fns.c (secure_hash): Likewise.
3476 * insdel.c (modify_region): Likewise.
3477 * keyboard.c (command_loop_1): Likewise.
3478 * print.c (PRINTFINISH): Likewise.
3479 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3480
3481 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3482
3483 * dispnew.c: Use bool for boolean.
3484 (frame_garbaged, display_completed, delayed_size_change)
3485 (fonts_changed_p, add_window_display_history)
3486 (add_frame_display_history, verify_row_hash)
3487 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3488 (row_equal_p, realloc_glyph_pool)
3489 (allocate_matrices_for_frame_redisplay)
3490 (showing_window_margins_p)
3491 (adjust_frame_glyphs_for_frame_redisplay)
3492 (build_frame_matrix_from_leaf_window, make_current)
3493 (mirrored_line_dance, mirror_line_dance, update_frame)
3494 (update_window_tree, update_single_window)
3495 (check_current_matrix_flags, update_window, update_text_area)
3496 (update_window_line, set_window_update_flags, scrolling_window)
3497 (update_frame_1, scrolling, buffer_posn_from_coords)
3498 (do_pending_window_change, change_frame_size)
3499 (change_frame_size_1, sit_for):
3500 Use bool for boolean.
3501 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3502 and remove last int (actually boolean) argument, which was always 0.
3503 All callers changed.
3504 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3505 * dispextern.h (struct composition_it): Use bool for boolean.
3506 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3507 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3508 * dired.c (file_name_completion):
3509 Use bool for boolean. (This was missed in an earlier change.)
3510
3511 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3512
3513 * window.c (Fset_window_configuration): Revert first part of
3514 last change.
3515
3516 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3517
3518 * nsterm.h (NSPanel): New class variable dialog_return.
3519
3520 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3521 Initialize dialog_return.
3522 (windowShouldClose:): Use stop instead of stopModalWithCode.
3523 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3524 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3525 event.
3526 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3527 modal loop returns.
3528
3529 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3530
3531 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3532 * composite.c (find_composition, composition_gstring_p)
3533 (composition_reseat_it, find_automatic_composition):
3534 * data.c (let_shadows_buffer_binding_p)
3535 (let_shadows_global_binding_p, set_internal, make_blv)
3536 (Fmake_variable_buffer_local, Fmake_local_variable)
3537 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3538 (cons_to_signed, arith_driver):
3539 * dbusbind.c (xd_in_read_queued_messages):
3540 * dired.c (directory_files_internal, file_name_completion):
3541 Use bool for booleans.
3542 * dired.c (file_name_completion):
3543 * process.h (fd_callback):
3544 Omit int (actually boolean) argument. It wasn't being used.
3545 All uses changed.
3546 * composite.h, lisp.h: Reflect above API changes.
3547
3548 * cmds.c, coding.c: Use bool for booleans.
3549 * cmds.c (move_point, Fself_insert_command):
3550 * coding.h (struct composition status, struct coding_system):
3551 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3552 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3553 (emacs_mule_char, decode_coding_emacs_mule)
3554 (encode_coding_emacs_mule, detect_coding_iso_2022)
3555 (decode_coding_iso_2022, encode_invocation_designation)
3556 (encode_designation_at_bol, encode_coding_iso_2022)
3557 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3558 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3559 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3560 (encode_coding_raw_text, detect_coding_charset)
3561 (decode_coding_charset, encode_coding_charset, detect_eol)
3562 (detect_coding, get_translation_table, produce_chars)
3563 (consume_chars, reused_workbuf_in_use)
3564 (make_conversion_work_buffer, code_conversion_save)
3565 (decode_coding_object, encode_coding_object)
3566 (detect_coding_system, char_encodable_p)
3567 (Funencodable_char_position, code_convert_region)
3568 (code_convert_string, code_convert_string_norecord)
3569 (Fset_coding_system_priority):
3570 * fileio.c (Finsert_file_contents):
3571 Use bool for booleans.
3572 * coding.h, lisp.h: Reflect above API changes.
3573 * coding.c: Remove unnecessary static function decls.
3574 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3575 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3576 not a boolean 'int', since callers never look at the return value.
3577 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3578 * coding.h (decoding_buffer_size, encoding_buffer_size)
3579 (emacs_mule_string_char): Remove unused extern decls.
3580 (struct iso_2022_spec, struct coding_system):
3581 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3582 (struct emacs_mule_spec): Remove unused field 'full_support'.
3583 All initializations removed.
3584 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3585
3586 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3587
3588 Fix spare memory change (Bug#12286).
3589 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3590 (valid_lisp_object_p): Likewise.
3591
3592 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3593
3594 * window.c (Fset_window_configuration): Record any window's old
3595 buffer if it's replaced (see Bug#8789). If the new current
3596 buffer doesn't appear in the selected window, go to its old
3597 point (Bug#12208).
3598
3599 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3600
3601 Special MEM_TYPE_SPARE to denote reserved memory.
3602 * alloc.c (enum mem_type): New memory type.
3603 (refill_memory_reserve): Use new type for spare memory.
3604 This prevents live_cons_p and live_string_p from incorrect
3605 detection of uninitialized objects from spare memory as live.
3606
3607 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3608
3609 Spelling fixes.
3610 * Makefile.in (.PHONY): versioclean -> versionclean.
3611
3612 Remove unused external symbols.
3613 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3614 * window.c (Qwindow_valid_p, decode_valid_window):
3615 Now static, not extern.
3616 * data.c (Qinterval): Remove; unused.
3617 (syms_of_data): Do not define 'interval'.
3618 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3619 * window.h (decode_valid_window):
3620 Remove decls.
3621
3622 * character.c, charset.c, chartab.c: Use bool for booleans.
3623 * character.c (lisp_string_width, string_count_byte8)
3624 (string_escape_byte8):
3625 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3626 (load_charset_map_from_file, map_charset_chars)
3627 (Fdefine_charset_internal, define_charset_internal)
3628 (Fdeclare_equiv_charset, find_charsets_in_text)
3629 (Ffind_charset_region, char_charset, Fiso_charset):
3630 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3631 (sub_char_table_set, sub_char_table_set_range)
3632 (char_table_set_range, optimize_sub_char_table)
3633 (map_sub_char_table):
3634 Use bool for boolean.
3635 * character.c (str_to_unibyte): Omit last boolean argument; it was
3636 always 0. All callers changed.
3637 * character.h, charset.h: Adjust to match previous changes.
3638 * character.h (char_printable_p): Remove decl of nonexistent function.
3639 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3640 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3641 are all boolean, so make them single-bit bitfields.
3642
3643 * lisp.h (ASET): Remove attempt to detect side effects.
3644 It was meant to be temporary and it often doesn't work,
3645 because when IDX has side effects the behavior of IDX==IDX
3646 is undefined. See Stefan Monnier in
3647 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3648
3649 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3650
3651 * lisp.h (functionp): New function (extracted from Ffunctionp).
3652 (FUNCTIONP): Use it.
3653 * eval.c (Ffunctionp): Use it.
3654
3655 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3656
3657 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3658 as that's faster and simpler than static storage. Don't bother
3659 with the g_main_context_query overhead if g_main_context_pending
3660 says no events are pending.
3661 (gfds, gfds_size): Remove these static vars.
3662 (xgselect_initialize): Remove; no longer needed.
3663 All uses and decls removed.
3664
3665 * emacs.c (fatal_error_signal_hook): Remove.
3666 All uses removed. This leftover from old code was always 0.
3667
3668 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3669 * casefiddle.c (casify_object, casify_region):
3670 * casetab.c (set_case_table):
3671 * category.c, category.h (word_boundary_p):
3672 * category.h (CHAR_HAS_CATEGORY):
3673 Use bool for booleans, instead of int.
3674
3675 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3676
3677 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3678
3679 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3680
3681 On assertion failure, print backtrace if available.
3682 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3683 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3684 * Makefile.in (LIB_EXECINFO): New macro.
3685 (LIBES): Use it.
3686
3687 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3688 * bytecode.c (exec_byte_code):
3689 * callint.c (check_mark, Fcall_interactively):
3690 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3691 (getenv_internal, sync_process_alive, call_process_exited):
3692 * lisp.h (USE_SAFE_ALLOCA):
3693 Use bool for booleans, instead of int.
3694 * lisp.h, process.h: Adjust prototypes to match above changes.
3695 * callint.c (Fcall_interactively): Don't assume the mark's
3696 offset fits in 'int'.
3697
3698 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3699
3700 * buffer.c, buffer.h: Use bool for boolean.
3701 * buffer.c (reset_buffer_local_variables)
3702 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3703 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3704 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3705 (overlay_touches_p, overlay_strings, Foverlay_put)
3706 (report_overlay_modification, call_overlay_mod_hooks):
3707 (mmap_enlarge, mmap_set_vars):
3708 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3709 Use bool for booleans, instead of int.
3710 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3711 since the 1-or-0 return value is always ignored anyway.
3712 (mmap_initialized_p):
3713 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3714 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3715
3716 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3717
3718 * bidi.c: Use bool for boolean.
3719 This is a bit more readable, and makes the text segment of bidi.o
3720 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3721 Presumably it's faster too.
3722 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3723 Now bool.
3724 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3725 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3726 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3727 (bidi_explicit_dir_char, bidi_level_of_next_char)
3728 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3729 Use bool for booleans, instead of int.
3730 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3731 (bidi_unshelve_cache): Adjust decls to match code.
3732
3733 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3734
3735 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3736 argument.
3737
3738 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3739
3740 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3741 * atimer.h: Include <stdbool.h>.
3742
3743 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3744
3745 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3746 compile time tests instead of run time tests on systems that do
3747 not use them.
3748 (FRAME_MAC_P): Remove leftover from deleted code.
3749 * frame.c (syms_of_frame): Remove leftover from deleted code.
3750
3751 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3752
3753 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3754
3755 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3756
3757 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3758 Otherwise, the compiler complains about (A?B:C) where B is void
3759 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3760 (fontset_add): Return void, for FONTSET_ADD.
3761
3762 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3763
3764 * alloc.c: Use bool for booleans.
3765 (gc_in_progress, abort_on_gc)
3766 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3767 (dont_register_blocks) [GC_MALLOC_CHECK]:
3768 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3769 (check_string_bytes, make_specified_string, memory_full)
3770 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3771 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3772 (mark_stack, valid_pointer_p, make_pure_string)
3773 (Fgarbage_collect, survives_gc_p, gc_sweep):
3774 Use bool for booleans, instead of int.
3775 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3776 Remove unused local.
3777 * alloc.c (PURE_POINTER_P):
3778 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3779 * editfns.c (Fformat):
3780 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3781 (Fdo_auto_save):
3782 * fns.c (sweep_weak_table):
3783 * lisp.h (suppress_checking, push_message, survives_gc_p)
3784 (make_pure_string, gc_in_progress, abort_on_gc):
3785 * lread.c (readchar, read1):
3786 * print.c (Fprin1_to_string):
3787 * xdisp.c (push_message):
3788 Use bool for booleans affected directly or indirectly by
3789 alloc.c's changes.
3790
3791 Make recently-introduced setters macros.
3792 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3793 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3794 (set_fontset_default, set_fontset_fallback): Rename from their
3795 upper-case counterparts, and make them functions rather than macros.
3796 This is more consistent with the other recently-introduced setters.
3797 These don't need to be inline, since they're local.
3798
3799 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3800
3801 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3802 the loop (Bug#12247).
3803
3804 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3805
3806 * lisp.h (vcopy): Use memcpy rather than our own loop.
3807 This fixes a performance regression introduced by the recent
3808 addition of vcopy. This means 'vcopy' will need to be modified
3809 for a copying collector, but that's OK. Also, tighten the
3810 checking in the assertion.
3811
3812 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3813
3814 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3815 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3816 non-base glyph for the width of the base character, according to
3817 what x_draw_composite_glyph_string_foreground expects.
3818 Generate WADJUST value according to composition_gstring_width's
3819 expectations, to produce correct width of the composed character.
3820 Reverse the sign of the DU offset produced by ScriptPlace.
3821
3822 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3823
3824 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3825
3826 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3827
3828 Avoid direct writes to contents member of struct Lisp_Vector.
3829 * lisp.h (vcopy): New function to copy data into vector.
3830 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3831 * fns.c (Ffillarray): Use ASET.
3832 * keyboard.c (timer_check_2): Use AREF and ASET.
3833 (append_tool_bar_item, Frecent_keys): Use vcopy.
3834 * lread.c (read_vector): Use ASET.
3835 * msdos.c (Frecent_doskeys): Use vcopy.
3836 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3837 (Finternal_merge_in_global_face): Use ASET and vcopy.
3838 * xfont.c (xfont_list_pattern): Likewise.
3839
3840 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3841
3842 * window.c (Fwindow_point): For the selected window always return
3843 the position of its buffer's point.
3844 (Fset_window_point): For the selected window always go in its
3845 buffer to the specified position.
3846
3847 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3848
3849 Setter macros for fontsets.
3850 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3851 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3852 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3853 Adjust users.
3854
3855 2012-08-20 Glenn Morris <rgm@gnu.org>
3856
3857 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3858 Don't assume that `ln -f' works.
3859
3860 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3861
3862 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3863 and later about non-assignments with no effect. See discussion at
3864 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3865 details.
3866
3867 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3868
3869 Inline setter functions for Lisp_Objects slots of struct specbinding.
3870 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3871 Adjust users.
3872
3873 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3874
3875 * window.c (select_window): Always make selected window's buffer
3876 current.
3877
3878 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3879
3880 Use AREF and ASET for docstrings of category tables.
3881 * category.h (CATEGORY_DOCSTRING): Use AREF.
3882 (SET_CATEGORY_DOCSTRING): Use ASET.
3883 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3884
3885 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3886
3887 Inline setter functions for hash table members.
3888 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3889 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3890 (set_hash_key_and_value, set_hash_index, set_hash_next)
3891 (set_hash_hash): New functions.
3892 * charset.c, fns.c: Adjust users.
3893
3894 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3895
3896 Inline getter and setter functions for per-buffer values.
3897 * buffer.h (per_buffer_default, set_per_buffer_default)
3898 (per_buffer_value, set_per_buffer_value): New functions.
3899 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3900 * buffer.c, data.c: Adjust users.
3901
3902 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3903
3904 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3905
3906 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3907
3908 Rely on <config.h> + <unistd.h> to declare 'environ',
3909 as gnulib does this if the system doesn't.
3910 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3911 Remove declaration. MS-Windows declares it on stdlib.h which is
3912 included by conf_post.h.
3913 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3914 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3915 * vm-limit.c: Include <unistd.h>, for 'environ'.
3916
3917 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3918 (start_of_data): Remove decl; mem-limits.h provides it.
3919
3920 * xdisp.c (handle_invisible_prop): Make it a bit faster
3921 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3922
3923 2012-08-19 Chong Yidong <cyd@gnu.org>
3924
3925 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3926 ends (Bug#3874).
3927
3928 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3929
3930 * .gdbinit: Use call instead of set when calling a function in the
3931 inferior.
3932
3933 * data.c (set_internal): Don't use set_blv_found.
3934 (Fkill_local_variable): Likewise.
3935
3936 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3937
3938 * nsfont.m (ns_ascii_average_width): Ensure the string
3939 ascii_printable is initialized with a null-terminated character
3940 array. Otherwise, it can contain undesired extra characters.
3941
3942 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3943
3944 port new setting code to Sun C 5.8 2005/10/13
3945 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3946 Return void, not Lisp_Object. Otherwise, the compiler
3947 complains about (A?B:C) where B is void and C is Lisp_Object
3948 when compiling CHAR_TABLE_SET, due to the recent change to
3949 the API of sub_char_table_set_contents.
3950
3951 2012-08-18 Chong Yidong <cyd@gnu.org>
3952
3953 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3954 for the string case (Bug#3874).
3955
3956 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3957
3958 * buffer.h (BSET): Remove (Bug#12215).
3959 Replace all uses with calls to new setter functions.
3960 (bset_bidi_paragraph_direction, bset_case_canon_table)
3961 (bset_case_eqv_table, bset_directory, bset_display_count)
3962 (bset_display_time, bset_downcase_table)
3963 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3964 (bset_last_selected_window, bset_local_var_alist)
3965 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3966 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3967 (bset_width_table):
3968 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3969 (bset_auto_fill_function, bset_auto_save_file_format)
3970 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3971 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3972 (bset_cache_long_line_scans, bset_case_fold_search)
3973 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3974 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3975 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3976 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3977 (bset_header_line_format, bset_indicate_buffer_boundaries)
3978 (bset_indicate_empty_lines, bset_invisibility_spec)
3979 (bset_left_fringe_width, bset_major_mode, bset_mark)
3980 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3981 (bset_name, bset_overwrite_mode, bset_pt_marker)
3982 (bset_right_fringe_width, bset_save_length)
3983 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3984 (bset_scroll_up_aggressively, bset_selective_display)
3985 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3986 (bset_word_wrap, bset_zv_marker):
3987 * category.c (bset_category_table):
3988 * syntax.c (bset_syntax_table):
3989 New setter functions.
3990
3991 * process.h (PSET): Remove (Bug#12215).
3992 Replace all uses with calls to new setter functions.
3993 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3994 (PROCESS_INLINE): New macro.
3995 (pset_childp): New setter function.
3996 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3997 * process.c (PROCESS_INLINE):
3998 Define to EXTERN_INLINE, so that the corresponding functions
3999 are compiled into code.
4000 (pset_buffer, pset_command, pset_decode_coding_system)
4001 (pset_decoding_buf, pset_encode_coding_system)
4002 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4003 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4004 (pset_type, pset_write_queue): New setter functions.
4005
4006 * window.h (WSET): Remove (Bug#12215).
4007 Replace all uses with calls to new setter functions.
4008 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4009 (WINDOW_INLINE): New macro.
4010 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4011 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4012 (wset_total_lines, wset_vertical_scroll_bar)
4013 (wset_window_end_pos, wset_window_end_valid)
4014 (wset_window_end_vpos): New setter functions.
4015 * window.c (WINDOW_INLINE):
4016 Define to EXTERN_INLINE, so that the corresponding functions
4017 are compiled into code.
4018 (wset_combination_limit, wset_dedicated, wset_display_table)
4019 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4020 (wset_new_normal, wset_new_total, wset_next_buffers)
4021 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4022 (wset_prev_buffers, wset_right_fringe_width)
4023 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4024 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4025 (wset_window_parameters):
4026 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4027 (wset_column_number_displayed, wset_region_showing):
4028 New setter functions.
4029
4030 * termhooks.h (TSET): Remove (Bug#12215).
4031 Replace all uses with calls to new setter functions.
4032 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4033 (TERMHOOKS_INLINE): New macro.
4034 (tset_charset_list, tset_selection_alist): New setter functions.
4035 * terminal.c (TERMHOOKS_INLINE):
4036 Define to EXTERN_INLINE, so that the corresponding functions
4037 are compiled into code.
4038 (tset_param_alist): New setter function.
4039
4040 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4041
4042 * keyboard.h (KSET): Remove (Bug#12215).
4043 Replace all uses with calls to new setter functions.
4044 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4045 (KEYBOARD_INLINE): New macro.
4046 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4047 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4048 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4049 New setter functions.
4050 * keyboard.c (KEYBOARD_INLINE):
4051 Define to EXTERN_INLINE, so that the corresponding functions
4052 are compiled into code.
4053 (kset_echo_string, kset_kbd_queue)
4054 (kset_keyboard_translate_table, kset_last_prefix_arg)
4055 (kset_last_repeatable_command, kset_local_function_key_map)
4056 (kset_overriding_terminal_local_map, kset_real_last_command)
4057 (kset_system_key_syms): New setter functions.
4058
4059 * frame.h (FSET): Remove (Bug#12215).
4060 Replace all uses with calls to new setter functions.
4061 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4062 (FRAME_INLINE): New macro.
4063 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4064 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4065 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4066 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4067 (fset_param_alist, fset_root_window, fset_scroll_bars)
4068 (fset_selected_window, fset_title, fset_tool_bar_items)
4069 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4070 * frame.c (FRAME_INLINE):
4071 Define to EXTERN_INLINE, so that the corresponding functions
4072 are compiled into code.
4073 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4074
4075 A few more naming-convention fixes for getters and setters.
4076 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4077 and rename from buffer_overlays_set_before.
4078 (set_buffer_overlays_after): Move here from buffer.h, and rename
4079 from buffer_overlays_set_after.
4080 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4081 All uses changed.
4082 (set_buffer_intervals): Rename from buffer_set_intervals.
4083 * intervals.c (set_interval_object): Move here from intervals.h,
4084 and rename from interval_set_object.
4085 (set_interval_left): Move here from intervals.h, and rename from
4086 interval_set_left.
4087 (set_interval_right): Move here from intervals.h, and rename from
4088 interval_set_right.
4089 (copy_interval_parent): Move here from intervals.h, and rename from
4090 interval_copy_parent.
4091 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4092 (set_interval_plist): Rename from interval_set_plist.
4093 Return void, not Lisp_Object, since no caller uses the result.
4094 * lisp.h (string_intervals): Rename from string_get_intervals.
4095 (set_string_intervals): Rename from string_set_intervals.
4096
4097 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4098 (set_char_table_contents): Rename from char_table_set_contents.
4099 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4100 All uses changed. See the end of
4101 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4102
4103 * lisp.h (CSET): Remove (Bug#12215).
4104 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4105 (set_char_table_purpose): New functions,
4106 replacing CSET. All uses changed. For example, replace
4107 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4108 "set_char_table_parent (char_table, parent);".
4109 The old version was confusing because it used the same name
4110 'parent' for two different things.
4111
4112 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4113
4114 Functions to get and set Lisp_Object fields of buffer-local variables.
4115 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4116 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4117 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4118 * data.c, eval.c, frame.c: Adjust users.
4119
4120 2012-08-17 Chong Yidong <cyd@gnu.org>
4121
4122 * xfaces.c (merge_face_vectors): If the target font specfies a
4123 font spec, make the font's attributes take precedence over
4124 directly-specified attributes.
4125 (merge_face_ref): Recognize :font.
4126
4127 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4128
4129 Do not use memcpy for copying intervals.
4130 * intervals.c (reproduce_interval): New function.
4131 (reproduce_tree, reproduce_tree_obj): Use it.
4132 (reproduce_tree_obj): Remove prototype.
4133
4134 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4135
4136 * lisp.h (duration_to_sec_usec): Remove unused decl.
4137
4138 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4139
4140 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4141 to an allocated instance of NSString, not to the class itself.
4142
4143 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4144
4145 * makefile.w32-in (C_CTYPE_H): New macro.
4146 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4147 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4148 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4149
4150 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4151
4152 Use ASCII tests for character types.
4153 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4154 * xfns.c, xterm.c:
4155 Don't include <ctype.h>; was not needed.
4156 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4157 * sysdep.c, xfaces.c:
4158 Include <c-ctype.h> instead of <ctype.h>.
4159 * nsterm.m: Include <c-ctype.h>.
4160 * charset.c (read_hex):
4161 * doc.c (Fsnarf_documentation):
4162 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4163 (DRIVE_LETTER) [DOS_NT]:
4164 (Ffile_name_directory, Fexpand_file_name)
4165 (Fsubstitute_in_file_name):
4166 * font.c (font_parse_xlfd, font_parse_fcname):
4167 * frame.c (x_set_font_backend):
4168 * gtkutil.c (xg_get_font):
4169 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4170 * nsimage.m (hexchar):
4171 * nsterm.m (ns_xlfd_to_fontname):
4172 * sysdep.c (system_process_attributes):
4173 * xfaces.c (hash_string_case_insensitive):
4174 Use C-locale tests instead of locale-specific tests for character
4175 types, since we want the ASCII interpretation here, not the
4176 interpretation suitable for whatever happens to be the current locale.
4177
4178 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4179
4180 Consistently check windows for validity/liveness
4181 (Bug#11984, Bug#12025, Bug#12026).
4182 * lisp.h (CHECK_VALID_WINDOW): New macro.
4183 * window.c (decode_window): Rename to decode_live_window.
4184 (decode_valid_window, Fwindow_valid_p): New functions.
4185 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4186 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4187 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4188 (Fwindow_prev_sibling, Fwindow_combination_limit)
4189 (Fset_window_combination_limit, Fwindow_use_time)
4190 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4191 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4192 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4193 (Fwindow_hscroll, Fset_window_hscroll)
4194 (Fwindow_redisplay_end_trigger)
4195 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4196 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4197 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4198 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4199 (Fwindow_end, Fset_window_point, Fset_window_start)
4200 (Fpos_visible_in_window_p, Fwindow_line_height)
4201 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4202 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4203 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4204 (Fset_window_parameter, Fwindow_display_table)
4205 (Fset_window_display_table, Fdelete_other_windows_internal)
4206 (Fset_window_buffer, Fset_window_new_total)
4207 (Fset_window_new_normal, Fdelete_window_internal)
4208 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4209 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4210 (Fwindow_scroll_bars): Check whether argument window is a valid or
4211 live window. Update doc-strings.
4212 (syms_of_window): New symbol Qwindow_valid_p.
4213 * keyboard.c (Fposn_at_x_y): Check whether argument
4214 frame_or_window denotes a valid window.
4215
4216 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4217
4218 Fix previous char table change.
4219 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4220 * chartab.c (optimize_sub_char_table): Likewise.
4221
4222 2012-08-16 Chong Yidong <cyd@gnu.org>
4223
4224 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4225
4226 * xfont.c (xfont_open):
4227 * xftfont.c (xftfont_open): Set the font's max_width field.
4228
4229 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4230 min_width to space_width and average_width to the average over
4231 printable ASCII characters.
4232 (ns_char_width): Code cleanup.
4233 (ns_ascii_average_width): New utility function.
4234
4235 * font.h (struct font): Update comments.
4236
4237 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4238
4239 Simple interface to set Lisp_Object fields of character tables.
4240 * lisp.h (CSET): New macro.
4241 (char_table_set_extras, char_table_set_contents)
4242 (sub_char_table_set_contents): New function.
4243 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4244 * syntax.c: Adjust users.
4245
4246 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4247
4248 * eval.c (eval_sub): Bind lexical-binding.
4249 * lread.c (Qlexical_binding): Make non-static.
4250
4251 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4252
4253 * nsmenu.m (popupSession): Remove.
4254 (pop_down_menu): Remove endModalSession.
4255 (timeout_handler:): New method.
4256 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4257 Call runModalForWindow. Check timer_fired when it returns.
4258 If not set, cancel timer and break out of loop.
4259 Otherwise loop again, with a new timeout.
4260
4261 * nsterm.m: Include fcntl.h if present.
4262 (fd_entry, t_readfds, inNsSelect): Remove.
4263 (select_writefds, select_valid, select_timeout, selfds)
4264 (select_mutex, apploopnr): Add.
4265 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4266 Otherwise call kbd_buffer_store_event.
4267 (ns_send_appdefined): Remove release of fd_entry.
4268 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4269 Increment and decrement apploopnr.
4270 (ns_select): If no file descriptors, just do a NSTimer.
4271 Otherwise copy read/write masks and start select thread (fd_handler).
4272 Start main loop and wait for application defined event.
4273 Inform select thread to stop selecting after main loop is exited.
4274 (ns_term_init): Create selfds pipe and set non-blocking.
4275 Initialize select_mutex. Start the select thread (fd_handler).
4276 (fd_handler:): Loop forever, wait for info from the main thread
4277 to either start or stop selecting. When select returns, send
4278 and appdefined event.
4279 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4280 If not call kbd_buffer_store_event.
4281
4282 * nsterm.h (EmacsApp): fd_handler takes id argument.
4283 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4284
4285 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4286
4287 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4288
4289 * region-cache.c (move_cache_gap): Update gap_len using the actual
4290 growth of the boundaries array. Do not change cache_len.
4291 (Bug#12196)
4292
4293 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4294
4295 Generalize and cleanup font subsystem checks.
4296 * font.h (FONT_DEBUG, font_assert): Remove.
4297 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4298 Change font_assert to eassert. Use eassert where appropriate.
4299
4300 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4301
4302 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4303
4304 2012-08-15 Chong Yidong <cyd@gnu.org>
4305
4306 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4307 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4308 extract the font descriptor instead of just the font name.
4309 In that case, return a font spec instead of a string.
4310 (x_last_font_name): Move to this file from xfns.c.
4311
4312 * xfns.c (Fx_select_font): The return value can also be a font
4313 spec. Move x_last_font_name management to gtkutil.c.
4314
4315 * xfaces.c: Make font weight and style symbols non-static.
4316
4317 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4318
4319 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4320 (bug#12117).
4321
4322 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4323
4324 * alloc.c (Fgarbage_collect): Use plural form consistently.
4325
4326 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4327
4328 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4329 iteration through the command loop. Fixes a problem whereby mouse
4330 movements are ignored until the first mouse click.
4331
4332 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4333
4334 Use bool, not int, for Lisp booleans.
4335 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4336 makes Emacs a bit smaller and presumably a bit faster.
4337 * lisp.h: Include <stdbool.h>.
4338 (struct Lisp_Boolfwd, defvar_bool):
4339 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4340 * regex.c [!emacs]: Include <stdbool.h>.
4341 (false, true): Remove; <stdbool.h> does this for us now.
4342
4343 2012-08-14 Chong Yidong <cyd@gnu.org>
4344
4345 * character.c (Fcharacterp): Doc fix (Bug#12076).
4346
4347 * data.c (Findirect_variable): Doc fix (Bug#11040).
4348
4349 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4350
4351 * editfns.c (Fformat): Doc fix (Bug#12059).
4352 (Fsave_current_buffer): Doc fix (Bug#11542).
4353
4354 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4355
4356 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4357 (bug#12022).
4358
4359 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4360
4361 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4362 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4363 * minibuf.c (choose_minibuf_frame, read_minibuf):
4364 * w32fns.c (x_create_tip_frame):
4365 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4366 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4367
4368 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4369
4370 * intervals.c (offset_intervals): Remove obsolete comment.
4371
4372 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4373
4374 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4375
4376 2012-08-14 Gergely Risko <gergely@risko.hu>
4377
4378 * coding.c (decode_coding): Record buffer modification before
4379 disabling undo_list (Bug#11773).
4380
4381 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4382
4383 Revert and cleanup some recent overlay changes.
4384 * buffer.h (enum overlay_type): Remove.
4385 (buffer_get_overlays, buffer_set_overlays): Likewise.
4386 (buffer_set_overlays_before, buffer_set_overlays_after):
4387 New function. Adjust users.
4388 (unchain_both): Add eassert.
4389
4390 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4391
4392 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4393
4394 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4395
4396 * gtkutil.c (xg_mark_data): Don't assume C99.
4397
4398 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4399
4400 * gtkutil.c (xg_frame_tb_info): New struct.
4401 (TB_INFO_KEY): New define.
4402 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4403 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4404 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4405 if not present.
4406 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4407 is up to date. Otherwise store new data.
4408 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4409
4410 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4411
4412 Use KSET for write access to Lisp_Object members of struct kboard.
4413 * keyboard.h (KSET): New macro.
4414 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4415 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4416 * xterm.c: Adjust users.
4417
4418 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4419
4420 Use BSET for write access to Lisp_Object members of struct buffer.
4421 * buffer.h (BSET): New macro.
4422 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4423 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4424 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4425 * window.c, xdisp.c, xfns.c: Adjust users.
4426
4427 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4428
4429 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4430
4431 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4432
4433 * nsterm.m (not_in_argv): New function.
4434 (application:openFile, application:openTempFile:):
4435 (application:openFileWithoutUI:, application:openFiles:): Open file
4436 if not_in_argv returns non-zero (bug#12171).
4437
4438 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4439 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4440 Define for Gtk+ versions less than 3.2.
4441 (xg_get_font_name): Use those functions/macros here.
4442 Reported by Frans Oilinki <moilinki@gmail.com>.
4443
4444 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4445
4446 * unexmacosx.c (copy_data_segment): Copy initialized data in
4447 statically linked libraries from input file rather than memory.
4448
4449 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4450 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4451 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4452
4453 2012-08-10 Glenn Morris <rgm@gnu.org>
4454
4455 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4456 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4457
4458 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4459
4460 Fix last change to allow compilation with low optimization levels.
4461 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4462 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4463
4464 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4465
4466 Use common inline syntax in intervals.h.
4467 * intervals.h (INTERVALS_INLINE): New macro.
4468 Change all users from LISP_INLINE.
4469
4470 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4471
4472 Define Qnone once for all platforms.
4473 * frame.c (Qnone): Define here.
4474 (syms_of_frame): DEFSYM it.
4475 * lisp.h (Qnone): New declaration.
4476 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4477 * xfns.c: Remove duplication. Adjust users.
4478
4479 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4480
4481 Remove unused macros from intervals.h.
4482 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4483 * intervals.c: Adjust comment.
4484
4485 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4486
4487 * w32fns.c <w32_unicode_gui>: New static variable.
4488 (globals_of_w32fns): Initialize it according to os_subtype.
4489 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4490 testing os_subtype.
4491
4492 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4493 Eli Zaretskii <eliz@gnu.org>
4494
4495 Fix bug #10299 with Unicode characters sent by customized
4496 keyboards created by MSKLC.
4497 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4498 (w32_init_class): Use it to initialize the Emacs class with either
4499 ANSI or Unicode API calls.
4500 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4501 later.
4502 (w32_wnd_proc): If the character code sent by WM_CHAR or
4503 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4504 original message. Call DefWindowProcW on NT and later.
4505
4506 2012-08-10 Glenn Morris <rgm@gnu.org>
4507
4508 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4509
4510 * lisp.h (DIRECTORY_SEP): Let configure set it.
4511
4512 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4513
4514 Use TSET for write access to Lisp_Object slots of struct terminal.
4515 * termhooks.h (TSET): New macro.
4516 * coding.c, terminal.c, xselect.c: Adjust users.
4517
4518 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4519
4520 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4521 the failing expression, include them in the error message.
4522 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4523 * lisp.h (internal_condition_case_n): Update declaration.
4524
4525 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4526
4527 Inline functions to examine and change buffer overlays.
4528 * buffer.c (unchain_both): New function.
4529 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4530 (buffer_has_overlays): New function.
4531 (enum overlay_type): New enum.
4532 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4533 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4534
4535 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4536
4537 Inline functions to examine and change buffer intervals.
4538 * alloc.c (mark_interval_tree): Remove.
4539 (MARK_INTERVAL_TREE): Simplify.
4540 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4541 * intervals.c (buffer_balance_intervals): New function.
4542 (graft_intervals_into_buffer): Adjust indentation.
4543 (set_intervals_multibyte): Simplify.
4544 * buffer.h (BUF_INTERVALS): Remove.
4545 (buffer_get_intervals, buffer_set_intervals): New function.
4546 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4547 * intervals.c, textprop.c: Adjust users.
4548
4549 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4550
4551 Inline functions to examine and change string intervals.
4552 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4553 (string_get_intervals, string_set_intervals): New function.
4554 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4555 * lread.c, print.c, textprop.c: Adjust users.
4556
4557 2012-08-08 Glenn Morris <rgm@gnu.org>
4558
4559 * lisp.mk (lisp): Remove language/persian.elc.
4560
4561 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4562
4563 Cleanup intervals.
4564 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4565 (NULL_INTERVAL_P): Likewise. Adjust users.
4566 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4567 Adjust comment. Move under #if 0.
4568 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4569 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4570
4571 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4572
4573 Check total length of intervals with eassert.
4574 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4575 * intervals.c: Change all users to eassert.
4576
4577 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4578
4579 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4580 Rename fields to match removal of FGET and WGET and disuse of
4581 INTERNAL_FIELD in Lisp_Cons.
4582
4583 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4584
4585 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4586 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4587 name since all xname users are fixed long time ago. Do not
4588 use INTERNAL_FIELD.
4589 (set_symbol_name, set_symbol_function, set_symbol_plist):
4590 (set_symbol_next, set_overlay_plist): New function.
4591 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4592 (struct Lisp_Overlay): Likewise.
4593 (CVAR, MVAR, SVAR): Remove.
4594 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4595 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4596 * xterm.c: Adjust users.
4597 * .gdbinit: Change to use name field of struct Lisp_Symbol
4598 where appropriate.
4599
4600 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4601
4602 Basic functions to set Lisp_Object and pointer slots of intervals.
4603 * intervals.h (interval_set_parent, interval_set_object):
4604 (interval_set_left, interval_set_right, interval_set_plist):
4605 (interval_copy_parent): New function.
4606 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4607 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4608 Adjust indentation.
4609 (INTERVAL_SIZE): Remove. Adjust users.
4610 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4611
4612 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4613
4614 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4615 * process.h (PGET): Remove.
4616 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4617 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4618
4619 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4620
4621 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4622 * window.h (WGET): Remove.
4623 (struct window): Do not use INTERNAL_FIELD.
4624 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4625 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4626 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4627 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4628 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4629 Adjust users.
4630
4631 2012-08-07 Chong Yidong <cyd@gnu.org>
4632
4633 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4634 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4635 (Fdelete_window_internal): Signal an error if the window is not on
4636 a live frame (Bug#12025).
4637
4638 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4639
4640 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4641 * frame.h (FGET): Remove.
4642 (struct frame): Do not use INTERNAL_FIELD.
4643 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4644 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4645 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4646 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4647
4648 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4649
4650 * w32.c: Silence compiler warnings.
4651 (map_w32_filename): Remove unused variable `is_fat'.
4652 (chase_symlinks): Add parentheses around expression.
4653
4654 2012-08-06 Glenn Morris <rgm@gnu.org>
4655
4656 * sysdep.c: Respect BROKEN_GETWD.
4657
4658 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4659 Let configure handle it.
4660 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4661
4662 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4663
4664 Use GCALIGNMENT where appropriate.
4665 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4666 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4667 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4668
4669 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4670
4671 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4672 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4673
4674 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4675
4676 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4677 that should be sufficient for everyone.
4678
4679 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4680
4681 * keyboard.c (timer_check_2): Add break so timer_check returns next
4682 timeout.
4683
4684 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4685
4686 Fix Windows build errors introduced after converting to WGET and WSET.
4687 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4688 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4689
4690 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4691
4692 * nsterm.m (ns_frame_rehighlight): Use FSET.
4693
4694 * nsmenu.m (ns_update_menubar): Use FSET.
4695
4696 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4697
4698 Separate read and write access to Lisp_Object slots of Lisp_Process.
4699 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4700 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4701
4702 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4703
4704 Separate read and write access to Lisp_Object slots of struct window.
4705 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4706 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4707 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4708 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4709 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4710 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4711 Adjust users.
4712
4713 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4714
4715 Fix Windows build errors introduced after converting to FGET and FSET.
4716 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4717 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4718 (w32_judge_scroll_bars): Change to use FSET.
4719 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4720
4721 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4722
4723 Fix replacement typo.
4724 * window.c (replace_window): Set root_window instead of
4725 selected_window. This fixes a total window subsystem
4726 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4727
4728 2012-08-06 Glenn Morris <rgm@gnu.org>
4729
4730 * lisp.mk (lisp): Add language/persian.elc.
4731
4732 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4733
4734 Separate read and write access to Lisp_Object slots of struct frame.
4735 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4736 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4737 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4738 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4739 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4740
4741 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4742
4743 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4744
4745 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4746
4747 Generalize common compile-time constants.
4748 * lisp.h (header_size, bool_header_size, word_size): Now here.
4749 (struct Lisp_Vector): Add comment.
4750 (struct Lisp_Bool_Vector): Move up to define handy constants.
4751 (VECSIZE, PSEUDOVECSIZE): Simplify.
4752 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4753 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4754 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4755 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4756 * xfont.c, xmenu.c: Use word_size where appropriate.
4757
4758 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4759
4760 * search.c (Freplace_match): Treat \? in the replacement text
4761 literally (Bug#8161).
4762
4763 2012-08-05 Chong Yidong <cyd@gnu.org>
4764
4765 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4766 * frame.c (Vdelete_frame_functions):
4767 * emacs.c (Vkill_emacs_hook): Doc fix.
4768
4769 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4770
4771 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4772 --with-x-toolkit=no builds.
4773 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4774
4775 2012-08-04 Chong Yidong <cyd@gnu.org>
4776
4777 * syntax.c (Fmodify_syntax_entry): Doc fix.
4778
4779 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4780
4781 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4782 * w32.c (init_environment): Change the default values of many
4783 environment variables in dflt_envvars[] to NULL, to avoid pushing
4784 them into environment when they were not already defined.
4785 Remove the code that deletes site-lisp subdirectories from the default
4786 value of EMACSLOADPATH, as it is no longer needed.
4787 (check_windows_init_file): Now external, not static.
4788 Use Vload_path as is, without adding anything, as this function is now
4789 called when Vload_path is already set up.
4790
4791 * w32.h (check_windows_init_file): Add prototype.
4792
4793 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4794 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4795 compatibility with Posix platforms.
4796 (main): Move the call to check_windows_init_file to here from
4797 w32.c.
4798 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4799 any, in the DEFALT argument into the root of the Emacs build or
4800 installation tree, as appropriate.
4801
4802 * callproc.c (init_callproc_1): Call decode_env_path instead of
4803 doing its equivalent by hand.
4804 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4805 the code that sets Vexec_path run on MS-Windows.
4806
4807 * lread.c (init_lread): Add comments to #ifdef's.
4808
4809 * msdos.c (dos_set_window_size, IT_update_begin)
4810 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4811 instead of direct references.
4812
4813 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4814
4815 Export DEFAULT_REHASH_* to GDB.
4816 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4817 Now constants, not macros.
4818
4819 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4820
4821 Remove unnecessary casts involving pointers.
4822 These casts are no longer needed now that we assume C89 or later,
4823 since they involve casting to or from void *.
4824 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4825 (make_pure_float, make_pure_vector):
4826 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4827 * macros.c (Fstart_kbd_macro):
4828 * menu.c (find_and_return_menu_selection):
4829 * minibuf.c (read_minibuf_noninteractive):
4830 * sysdep.c (closedir):
4831 * xdisp.c (x_produce_glyphs):
4832 * xfaces.c (compare_fonts_by_sort_order):
4833 * xfns.c (x_real_positions, select_visual):
4834 * xselect.c (x_stop_queuing_selection_requests)
4835 (x_get_window_property, x_get_window_property_as_lisp_data):
4836 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4837 Remove unnecessary pointer casts.
4838 * alloc.c (record_xmalloc): New function.
4839 * lisp.h (record_xmalloc): New decl.
4840 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4841 more like a function. This is because the pointer cast is not
4842 needed. All uses changed.
4843 * print.c (print_string, print_error_message): Avoid length recalc.
4844
4845 Improve fix for macroexp crash with debugging (Bug#12118).
4846 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4847 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4848 not supposed to be invoked from the garbage collector.
4849 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4850 (gc_aset): New function, which is like ASET but can be
4851 used in the garbage collector.
4852 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4853 (set_hash_index): Use it instead of ASET.
4854
4855 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4856
4857 Support symlinks on latest versions of MS-Windows.
4858 * w32.c: Include winioctl.h and aclapi.h.
4859 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4860 (revert_to_self): Forward declarations of static functions.
4861 <static BOOL g_b_init_get_security_info>:
4862 <g_b_init_create_symbolic_link>: New static flags.
4863 (globals_of_w32): Initialize them to zero.
4864 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4865 (map_w32_filename): Improve commentary. Simplify switch.
4866 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4867 headers (most versions of MinGW w32api don't).
4868 (get_security_info, create_symbolic_link)
4869 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4870 New functions.
4871 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4872 in the argument file name.
4873 (sys_access): Call unc_volume_file_attributes only if
4874 GetFileAttributes fails with network-related error codes.
4875 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4876 have the required privileges.
4877 (get_file_security_desc_by_name): Rename from
4878 get_file_security_desc.
4879 (stat_worker): New function, with most of the guts of 'stat', and
4880 with addition of handling of symlinks and support for 'lstat'.
4881 If possible, get file's attributes and security information by
4882 handle, not by name. Produce S_IFLNK bit for symlinks, when
4883 called from 'lstat'.
4884 (stat, lstat): New functions, call 'stat_worker'.
4885 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4886 symlinks when the underlying filesystem supports them.
4887
4888 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4889
4890 Fix macroexp crash on Windows with debugging (Bug#12118).
4891 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4892 checking subscripts; problem introduced with the recent
4893 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4894 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4895 since it's used in non-static inline functions now.
4896
4897 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4898 Don't assume buffer size fits in 'int'. Remove unused local.
4899
4900 Use C99-style 'extern inline' if available.
4901 * buffer.h (BUFFER_INLINE):
4902 * category.h (CATEGORY_INLINE):
4903 * character.h (CHARACTER_INLINE):
4904 * charset.h (CHARSET_INLINE):
4905 * composite.h (COMPOSITE_INLINE):
4906 * dispextern.h (DISPEXTERN_INLINE):
4907 * lisp.h (LISP_INLINE):
4908 * systime.h (SYSTIME_INLINE):
4909 New macro, replacing 'static inline' in this header.
4910 * buffer.h, category.h, character.h, charset.h, composite.h:
4911 * dispextern.h, lisp.h, systime.h:
4912 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4913 * alloc.c (LISP_INLINE):
4914 * buffer.c (BUFFER_INLINE):
4915 * category.c (CATEGORY_INLINE):
4916 * character.c (CHARACTER_INLINE):
4917 * charset.c (CHARSET_INLINE):
4918 * composite.c (COMPOSITE_INLINE):
4919 * dispnew.c (DISPEXTERN_INLINE):
4920 * sysdep.c (SYSTIME_INLINE):
4921 Define to EXTERN_INLINE, so that the corresponding functions
4922 are compiled into code.
4923 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4924 (INLINE_HEADER_END): New macros.
4925 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4926 since it's used in non-static inline functions now.
4927 (VALMASK) [!USE_LSB_TAG]: Likewise.
4928
4929 2012-08-02 Glenn Morris <rgm@gnu.org>
4930
4931 * s/: Remove empty directory.
4932
4933 * s/ms-w32.h: Move to ../nt/inc.
4934 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4935 Update for new ms-w32.h location.
4936
4937 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4938
4939 Port to Solaris 8.
4940 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4941
4942 2012-08-02 Glenn Morris <rgm@gnu.org>
4943
4944 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4945 hard-coding the path separator.
4946
4947 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4948
4949 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4950 This how ASET and AREF are supposed to work, and makes
4951 it easier to think about future improvements. See
4952 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4953 * charset.h (set_charset_attr): New function.
4954 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4955 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4956 (aref_addr): New function. All uses of &AREF(...) changed.
4957 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4958 (set_hash_index): New functions. All lvalue-style uses of
4959 HASH_KEY etc. changed.
4960 * keyboard.c (set_prop): New function. All lvalue-style uses
4961 of PROP changed.
4962
4963 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4964
4965 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4966 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4967 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4968 * nsfns.m (ns_set_name_as_filename): Likewise.
4969 * nsmenu.m (ns_update_menubar): Likewise.
4970 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4971
4972 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4973
4974 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4975 Adapt to latest changes in field names of the corresponding Lisp
4976 objects.
4977
4978 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4979
4980 2012-08-01 Glenn Morris <rgm@gnu.org>
4981
4982 * s/msdos.h: Remove file.
4983 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4984 * Makefile.in (S_FILE): Remove.
4985 (config_h): Remove S_FILE.
4986
4987 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4988
4989 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4990 Remove; moved to nt/config.nt.
4991
4992 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4993
4994 Use INTERNAL_FIELD for conses and overlays.
4995 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4996 Remove obsolete comment.
4997 (MVAR): New macro.
4998 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4999 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5000
5001 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5002
5003 Use INTERNAL_FIELD for symbols.
5004 * lisp.h (SVAR): New macro. Adjust users.
5005 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5006 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5007
5008 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5009
5010 Use INTERNAL_FIELD for processes.
5011 * process.h (PVAR): New macro. Adjust style.
5012 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5013 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5014
5015 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5016
5017 Use INTERNAL_FIELD for windows.
5018 * window.h (WVAR): New macro.
5019 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5020 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5021 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5022 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5023 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5024 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5025
5026 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5027
5028 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5029
5030 2012-08-01 Glenn Morris <rgm@gnu.org>
5031
5032 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5033 Move to configure.ac.
5034
5035 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5036
5037 * makefile.w32-in (CONFIG_H): Update dependencies.
5038 (CONF_POST_H): New macro.
5039
5040 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5041
5042 2012-07-31 Glenn Morris <rgm@gnu.org>
5043
5044 * Makefile.in (S_FILE): No longer set by configure.
5045
5046 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5047 is available.
5048 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5049
5050 * process.h (NULL_DEVICE):
5051 * emacs.c (SEPCHAR):
5052 * editfns.c (USER_FULL_NAME): Let configure set them.
5053
5054 * s/README, s/template.h: Remove files.
5055
5056 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5057
5058 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5059 Move to configure.ac.
5060
5061 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5062
5063 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5064 resulting renaming of 'struct frame' members.
5065
5066 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5067
5068 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5069 after introduction of FVAR.
5070
5071 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5072
5073 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5074
5075 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5076 instead of compositeToPoint.
5077 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5078
5079 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5080
5081 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5082
5083 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5084 * lisp.h (INTERNAL_FIELD): New macro.
5085 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5086 (BVAR): Change to use INTERNAL_FIELD.
5087 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5088 (KVAR): Change to use INTERNAL_FIELD.
5089 * frame.h (FVAR): New macro.
5090 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5091 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5092 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5093 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5094 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5095
5096 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5097
5098 Miscellaneous fixes for non-default X toolkits.
5099 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5100 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5101 Move under #ifdef USE_LUCID.
5102 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5103 definition and usage to avoid warnings.
5104
5105 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5106
5107 * nsterm.m (openFiles): Fix previous checkin.
5108
5109 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5110
5111 * indent.c (compute_motion): Remove unused local.
5112
5113 2012-07-31 Glenn Morris <rgm@gnu.org>
5114
5115 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5116
5117 * conf_post.h [USG5_4]:
5118 Move remaining contents of s/usg5-4-common.h here.
5119 * s/usg5-4-common.h: Remove file.
5120
5121 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5122 * s/irix6-5.h: Remove file.
5123
5124 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5125 * s/darwin.h: Remove file.
5126
5127 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5128 * s/hpux10-20.h: Remove file, which is now empty.
5129
5130 2012-07-30 Glenn Morris <rgm@gnu.org>
5131
5132 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5133 * Makefile.in (config_h): Add conf_post.h.
5134 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5135
5136 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5137
5138 * nsterm.m (ns_do_open_file): New variable.
5139 (ns_term_init): Set ns_do_open_file to YES after run returns.
5140 (openFile, openTempFile, openFileWithoutUI, openFiles):
5141 Open files only if ns_do_open_file.
5142
5143 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5144
5145 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5146 This no-op macro hasn't been needed for many years.
5147 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5148
5149 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5150 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5151 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5152 gdb_make_enums_visible.
5153 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5154 (DIRECTORY_SEP): Now a constant, not a macro.
5155
5156 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5157
5158 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5159 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5160
5161 * w32term.c <w32_keyboard_codepage>: Renamed from
5162 keyboard_codepage and now external. All users changed.
5163
5164 * w32term.h: Add declaration of w32_keyboard_codepage.
5165
5166 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5167 the codepage to translate keys to Unicode. If this argument is
5168 -1, use the value returned by GetConsoleCP. All callers changed.
5169
5170 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5171
5172 Update .PHONY listings in makefiles.
5173 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5174 bootstrap-clean, distclean, maintainer-clean, versioclean,
5175 extraclean, frc.
5176
5177 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5178 This is a bit clearer. Fix some commentary typos.
5179
5180 2012-07-30 Glenn Morris <rgm@gnu.org>
5181
5182 * s/netbsd.h: Let configure include signal.h if needed.
5183 Remove file, which is now empty.
5184
5185 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5186 Let configure set them.
5187 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5188 No more need to undefine.
5189
5190 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5191
5192 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5193 non-single-byte char when adding meta modifier. (Bug#12090)
5194
5195 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5196
5197 Convert safe_call to use variable number of arguments.
5198 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5199 (safe_call2): Fix comment.
5200 * lisp.h (safe_call): Adjust prototype.
5201 * coding.c (encode_coding_object): Change to use safe_call2.
5202 * xfaces.c (merge_face_heights): Change to use safe_call1.
5203
5204 2012-07-30 Glenn Morris <rgm@gnu.org>
5205
5206 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5207 does that unconditionally. Remove file, which is now empty.
5208
5209 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5210 Remove empty files.
5211
5212 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5213
5214 Export to GDB most of lisp.h's remaining object-like macros.
5215 * lisp.h (min, max): Move earlier, because they're used earlier now.
5216 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5217 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5218 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5219 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5220 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5221 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5222 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5223 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5224 Now constants, for GDB. They need not be macros.
5225 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5226 Now constants, for GDB, as well as macros, for static initializers.
5227 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5228 Move to after the definition of struct Lisp_Char_Table,
5229 since the former now needs that type defined.
5230 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5231 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5232 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5233 New enums, for gdb_make_enums_visible.
5234 (GLYPH_MODE_LINE_FACE): Remove; unused.
5235 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5236 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5237 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5238 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5239 enum maxargs, enum MAX_ALLOCA.
5240 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5241 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5242 no longer needed, now that they are done in lisp.h.
5243
5244 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5245
5246 Cleanup string bytes checking.
5247 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5248 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5249 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5250 (check_sblock, compact_small_strings): Simplify.
5251
5252 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5253
5254 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5255 These macros are confusing and no longer need to be defined, as
5256 the enum values now suffice. All uses replaced with definiens.
5257 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5258
5259 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5260
5261 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5262 ($(BLD)/w32console.$(O)): Update dependencies.
5263
5264 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5265
5266 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5267 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5268 time. Adjust users.
5269 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5270
5271 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5272
5273 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5274 setting sitelisp (Bug#12010).
5275
5276 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5277
5278 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5279
5280 * w32heap.c (cache_system_info):
5281 * w32.c (sys_rename):
5282 * w32proc.c (find_child_console, sys_kill): All users changed.
5283
5284 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5285
5286 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5287
5288 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5289
5290 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5291
5292 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5293
5294 Cleanup statistics calculation in Fgarbage_collect.
5295 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5296 Fix zombies percentage calculation. Simplify elapsed time calculation.
5297
5298 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5299
5300 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5301 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5302 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5303 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5304 (replace_range, replace_range_2, del_range_2): Change to eassert.
5305 * marker.c (byte_char_debug_check): Adjust style.
5306
5307 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5308
5309 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5310 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5311 long-ago-commented-out code that talks about "WIN32".
5312 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5313 All uses changed.
5314
5315 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5316
5317 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5318 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5319 Simplify by using alignof.
5320 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5321 * lisp.h: Include <stdalign.h>.
5322 (GCALIGNMENT): New macro and constant.
5323 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5324 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5325 (stdalign): New macro, if not already defined.
5326
5327 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5328
5329 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5330 * w32inevt.c: Include w32inevt.h.
5331 (w32_read_console_input): New inline function, calls either
5332 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5333 w32_console_unicode_input.
5334 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5335 (w32_kbd_patch_key, key_event): Use the codepage returned by
5336 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5337 (key_event): use uChar.UnicodeChar only if
5338 w32_console_unicode_input is non-zero.
5339
5340 * w32console.c: Include w32heap.h.
5341 <w32_console_unicode_input>: New global variable.
5342 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5343 family of Windows, zero otherwise.
5344
5345 * w32inevt.h: Declare w32_console_unicode_input.
5346
5347 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5348 --without-x. (Bug#11742)
5349
5350 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5351
5352 Adjust GDB to reflect pvec_type changes (Bug#12036).
5353 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5354 2012-07-04 changes to pseudovector representation.
5355 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5356
5357 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5358
5359 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5360 bus address.
5361 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5362
5363 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5364
5365 * alloc.c (listn): Fix the order the arguments are consed onto the
5366 list.
5367
5368 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5369 enumeration constants, as PURE and HEAP are too general, and clash
5370 with other headers and sources, such as gmalloc.c and the
5371 MS-Windows system headers. All users changed.
5372
5373 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5374
5375 Revert last save_excursion_save and save_excursion_restore changes.
5376 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5377 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5378
5379 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5380
5381 Fix recently-introduced typos in Windows port.
5382 Reported by Martin Rudalics <rudalics@gmx.at>.
5383 * w32.c (init_environment): Replace comma with semicolon.
5384 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5385
5386 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5387
5388 Improve GDB symbol export (Bug#12036).
5389 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5390 arms of an 'if', not using conditional expressions; otherwise GDB
5391 complains about the types in the unevaluated arm when the argument
5392 is an integer literal.
5393 (xgetint): Simplify expression.
5394 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5395 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5396 Zaretskii in <http://bugs.gnu.org/12036#13>.
5397 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5398 needed now that we have gdb_make_enums_visible.
5399 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5400 (enum enum_USE_LSB_TAG):
5401 New enum types, packaging up enums that need to be exported to GDB.
5402
5403 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5404
5405 Utility function to make a list from specified amount of objects.
5406 * lisp.h (enum constype): New datatype.
5407 (listn): New prototype.
5408 * alloc.c (listn): New function.
5409 (Fmemory_use_count, syms_of_alloc): Use it.
5410 * buffer.c (syms_of_buffer): Likewise.
5411 * callint.c (syms_of_callint): Likewise.
5412 * charset.c (define_charset_internal): Likewise.
5413 * coding.c (syms_of_coding): Likewise.
5414 * keymap.c (syms_of_keymap): Likewise.
5415 * search.c (syms_of_search): Likewise.
5416 * syntax.c (syms_of_syntax): Likewise.
5417 * w32.c (init_environment): Likewise.
5418 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5419 * xdisp.c (syms_of_xdisp): Likewise.
5420 * xfns.c (syms_of_xfns): Likewise.
5421
5422 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5423
5424 Fast save_excursion_save and save_excursion_restore.
5425 * lisp.h (struct Lisp_Excursion): New data type.
5426 (PVEC_EXCURSION): New pseudovector type.
5427 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5428 to deal with it. Adjust comments.
5429 (init_marker, attach_marker): New prototype.
5430 (unchain_marker): Adjust prototype.
5431 * marker.c (attach_marker): Change to global.
5432 (init_marker): New function.
5433 * alloc.c (Fmake_marker, build_marker): Use it.
5434 (build_marker): More easserts.
5435 (mark_object): Handle struct Lisp_Excursion.
5436 * editfns.c (save_excursion_save, save_excursion_restore):
5437 Reimplement to use struct Lisp_Excursion. Add comments.
5438
5439 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5440
5441 Fix export of symbols to GDB (Bug#12036).
5442 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5443 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5444 emacs.c, as this is a more-suitable home. Had this been done earlier
5445 the fix for 12036 would have avoided some of the problems noted in
5446 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5447 would have been more obvious.
5448 * emacs.c: Do not include <verify.h>; no longer needed.
5449 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5450 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5451 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5452 Remove; now done in lisp.h.
5453 * lisp.h (PUBLISH_TO_GDB): New macro.
5454 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5455 (DATA_SEG_BITS): Use it.
5456 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5457 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5458 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5459 not be usable in #if. This simplifies things.
5460
5461 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5462
5463 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5464
5465 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5466
5467 Simplify export of symbols to GDB (Bug#12036).
5468 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5469 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5470 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5471 Adjust to changes in lisp.h and emacs.c, by using
5472 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5473 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5474 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5475 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5476 instead of gdb_valbits.
5477 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5478 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5479 instead of gdb_array_mark_flag.
5480 (xboolvector): Get size from $->size, not $->header.size.
5481 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5482 (xreload, hook-run, hookpost-run): Remove.
5483 * emacs.c: Include <verify.h>.
5484 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5485 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5486 Remove.
5487 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5488 (gdb_USE_LSB_TAG): New enum constants.
5489 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5490 Also define these as enum constants, so they're visible to GDB.
5491 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5492 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5493 as constants, so they're visible to GDB.
5494 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5495 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5496 Now enum constants, not macros, so they're visible to GDB.
5497 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5498 more convenient now. All uses changed.
5499 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5500 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5501
5502 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5503
5504 Explicitly free restriction data that are not needed anymore.
5505 * editfns.c (save_restriction_restore): Free restriction data.
5506
5507 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5508
5509 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5510 add argument, tune behavior, and adjust all callers.
5511
5512 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5513
5514 Use typedef for EMACS_INT, EMACS_UINT.
5515 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5516 than macros. This simplifies debugging in the usual case, since
5517 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5518 and it allows expressions involving EMACS_INT casts.
5519 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5520
5521 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5522
5523 * nsterm.m (ns_read_socket): Return early if there is a modal
5524 window (Bug#12043).
5525
5526 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5527
5528 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5529 that FOCUS-FRAME can be omitted.
5530
5531 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5532
5533 Adjust buffer text indirection counters at the end of Fkill_buffer.
5534 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5535 buffer is definitely dead. This should really fix an issue reported
5536 by Christoph Scholtes again. (Bug#12007).
5537 (init_buffer_once): Initialize indirection counters of
5538 buffer_defaults and buffer_local_symbols (for sanity and safety).
5539
5540 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5541
5542 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5543 and continuation glyphs on tooltip frames, leave them at zero.
5544 Avoids continued lines in tooltips. (Bug#11832)
5545
5546 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5547
5548 Simplify copy_overlay.
5549 * buffer.c (copy_overlay): Simplify. Use build_marker.
5550 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5551
5552 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5553
5554 * print.c (print_object): Don't crash when a frame's name is nil
5555 or invalid. (Bug#12025)
5556
5557 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5558 it signals an error when a tooltip frame is being created.
5559
5560 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5561
5562 Cleanup miscellaneous objects allocation and initialization.
5563 * alloc.c (allocate_misc): Change to static. Add argument to
5564 specify the subtype. Adjust comment and users.
5565 (build_overlay): New function.
5566 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5567 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5568 (allocate_misc): Remove prototype.
5569 (build_overlay): Add prototype.
5570
5571 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5572
5573 Swap buffer text indirection counters in Fbuffer_swap_text.
5574 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5575 This avoids crash reported by Christoph Scholtes at
5576 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5577
5578 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5579
5580 * nsmenu.m (Popdown_data): New struct.
5581 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5582 free Popdown_data.
5583 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5584 (initWithContentRect): Make imgView and contentView non-static
5585 and autorelease them. Also autorelease img and matrix (Bug#12005).
5586 (dealloc): Remove (Bug#12005).
5587
5588 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5589
5590 Adjust consing_since_gc when objects are explicitly freed.
5591 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5592 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5593 (free_cons, free_misc): Subtract object size from consing_since_gc.
5594
5595 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5596
5597 Simplify and cleanup markers positioning code.
5598 * marker.c (attach_marker): More useful eassert.
5599 (live_buffer, set_marker_internal): New function.
5600 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5601 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5602
5603 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5604
5605 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5606 as it's limited by the amount of memory, not by INT_MAX.
5607
5608 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5609
5610 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5611 in special-event-map. See the discussion at
5612 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5613 for the reasons.
5614
5615 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5616 info.dwItemData. Fixes crashes on 64-bit Windows.
5617 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5618
5619 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5620
5621 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5622 (conversationIdentifier): Return value is NSInteger.
5623 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5624
5625 2012-07-21 Chong Yidong <cyd@gnu.org>
5626
5627 * window.c (decode_any_window): Signal an error if the window is
5628 on a dead frame (Bug#11984).
5629
5630 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5631
5632 Add indirection counting to speed up Fkill_buffer.
5633 * buffer.h (struct buffer): New member.
5634 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5635 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5636 base buffer indirection counter.
5637 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5638 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5639 through buffer list if indirection counter is 0.
5640
5641 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5642
5643 Extend the value returned by Fgarbage_collect with heap statistics.
5644 * alloc.c (Qheap): New symbol.
5645 (syms_of_alloc): DEFSYM it.
5646 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5647 (Fmemory_free): Remove.
5648 (syms_of_alloc): Don't defsubr it.
5649 * buffer.c (Fcompact_buffer): Remove.
5650 (syms_of_buffer): Don't defsubr it.
5651
5652 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5653
5654 Make maybe_gc inline.
5655 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5656 * lisp.h (consing_since_gc, gc_relative_threshold)
5657 (memory_full_cons_threshold): Revert declaration.
5658 (maybe_gc): Remove prototype, define as inline.
5659 * alloc.c: Remove old commented-out code.
5660 (consing_since_gc, gc_relative_threshold)
5661 (memory_full_cons_threshold): Revert to global.
5662 (maybe_gc): Remove.
5663
5664 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5665
5666 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5667 * lisp.h (build_unibyte_string): New function.
5668 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5669 * sysdep.c, w32fns.c, xfns.c: Use it.
5670 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5671 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5672 Adjust users accordingly.
5673 * font.h (font_open_by_name): Adjust prototype.
5674
5675 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5676
5677 Cleanup calls to Fgarbage_collect.
5678 * lisp.h (maybe_gc): New prototype.
5679 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5680 Remove declarations.
5681 * alloc.c (maybe_gc): New function.
5682 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5683 Make them static.
5684 * bytecode.c (MAYBE_GC): Use maybe_gc.
5685 * eval.c (eval_sub, Ffuncall): Likewise.
5686 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5687 to avoid dependency from auto-save feature.
5688
5689 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5690
5691 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5692 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5693 'for_each_per_buffer_object_at'.
5694 All uses changed. It's better to use upper-case for macros that
5695 cannot be implemented as functions, to give the reader a clue
5696 that they're special.
5697
5698 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5699
5700 * alloc.c (Fgarbage_collect): Tweak docstring.
5701
5702 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5703
5704 Tweak the value returned from Fgarbage_collect again.
5705 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5706 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5707 Adjust documentation.
5708 (total_vector_bytes): Rename to total_vector_slots, adjust
5709 accounting.
5710 (total_free_vector_bytes): Rename to total_free_vector_slots,
5711 adjust accounting.
5712 (Qstring_bytes, Qvector_slots): New symbols.
5713 (syms_of_alloc): DEFSYM them.
5714
5715 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5716
5717 Buffer compaction primitive which may be used from Lisp.
5718 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5719 (syms_of_buffer): Register Fcompact_buffer.
5720 * alloc.c (Fgarbage_collect): Use compact_buffer.
5721 * buffer.h (compact_buffer): New prototype.
5722 (struct buffer_text): New member.
5723
5724 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5725
5726 New macro to iterate over all buffers, miscellaneous cleanups.
5727 * lisp.h (all_buffers): Remove declaration.
5728 * buffer.h (all_buffers): Add declaration, with comment.
5729 (for_each_buffer): New macro.
5730 * alloc.c (Fgarbage_collect, mark_object): Use it.
5731 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5732 (init_buffer): Likewise.
5733 * data.c (Fset_default): Likewise.
5734 * coding.c (code_conversion_restore): Remove redundant check
5735 for dead buffer.
5736 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5737
5738 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5739
5740 Fix bug that created negative-length intervals.
5741 * intervals.c (merge_interval_right, merge_interval_left):
5742 Do not zero out this interval if it is absorbed by its children,
5743 as this interval's total length doesn't change in that case. See
5744 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5745
5746 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5747
5748 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5749 when invoking (make-bool-vector N t) and N is a positive
5750 multiple of 8 -- the last 8 bits were mistakenly cleared.
5751
5752 Remove some struct layout assumptions in bool vectors.
5753 * alloc.c (bool_header_size): New constant.
5754 (header_size, word_size): Move earlier, as they're now used earlier.
5755 Use 'word_size' in a few more places, where it's appropriate.
5756 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5757 padding before the data member of a bool vector.
5758 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5759 than doing the check by hand with an abort ().
5760
5761 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5762
5763 * eval.c (Fdefvar): Don't check constants since we only set the var if
5764 it's not yet defined anyway (bug#11904).
5765
5766 * lisp.h (last_undo_boundary): Declare new var.
5767 * keyboard.c (command_loop_1): Set it.
5768 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5769 were auto-added by the command loop (bug#11774).
5770
5771 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5772
5773 * w32font.c (Qsymbol): Remove local definition.
5774 (syms_of_w32font): Don't DEFSYM it.
5775
5776 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5777
5778 Fix sweep_vectors to handle large bool vectors correctly.
5779 * alloc.c (sweep_vectors): Account total_vector_bytes for
5780 bool vectors larger than VBLOCK_BYTES_MAX.
5781
5782 2012-07-18 Chong Yidong <cyd@gnu.org>
5783
5784 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5785 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5786
5787 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5788
5789 Return more descriptive data from Fgarbage_collect.
5790 Suggested by Stefan Monnier in
5791 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5792 * alloc.c (bounded_number): New function.
5793 (total_buffers, total_vectors): New variable.
5794 (total_string_size): Rename to total_string_bytes, adjust users.
5795 (total_vector_size): Rename to total_vector_bytes, adjust users.
5796 (sweep_vectors): Account total_vectors and total_vector_bytes.
5797 (Fgarbage_collect): New return value. Adjust documentation.
5798 (gc_sweep): Account total_buffers.
5799 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5800 (VECTOR_SIZE): Remove.
5801 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5802 (Qinterval, Qmisc): New symbols.
5803 (syms_of_data): Initialize them.
5804 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5805 (Qcons, Qbuffer): New declarations.
5806
5807 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5808
5809 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5810 Round up, not down. Improve doc.
5811
5812 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5813
5814 Restore old code in allocate_string_data to avoid Faset breakage.
5815 Reported by Julien Danjou <julien@danjou.info> in
5816 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5817 * alloc.c (allocate_string_data): Restore old code with minor
5818 adjustments, fix comment to explain this subtle issue.
5819
5820 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5821
5822 Remove FILE_SYSTEM_CASE.
5823 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5824
5825 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5826 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5827 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5828 call-process-region passes it through expand-file-name.
5829
5830 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5831
5832 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5833
5834 Fix crash when creating indirect buffer (Bug#11917)
5835 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5836 Don't handle unbound variables specially if non-zero.
5837 (Fbuffer_local_variables): Pass zero.
5838 (clone_per_buffer_values): Pass non-zero.
5839
5840 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5841
5842 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5843 to make the loop interruptible.
5844
5845 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5846
5847 * gnutls.c (emacs_gnutls_handshake): Only retry if
5848 GNUTLS_E_INTERRUPTED.
5849
5850 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5851
5852 Cleanup and convert miscellaneous checks to eassert.
5853 * alloc.c (mark_interval): Fix comment, partially rephrase
5854 old comment from intervals.h (see below).
5855 * intervals.c (find_interval, adjust_intervals_for_insertion)
5856 (delete_interval, adjust_intervals_for_deletion)
5857 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5858 Convert to eassert.
5859 (adjust_intervals_for_insertion, make_new_interval):
5860 Remove obsolete and unused code.
5861 * intervals.h (struct interval): Remove obsolete comment.
5862 * textprotp.c (erase_properties): Remove unused code.
5863 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5864 (Fremove_list_of_text_properties): Convert to eassert.
5865
5866 2012-07-17 Chong Yidong <cyd@gnu.org>
5867
5868 * editfns.c (Finsert_char): Doc fix.
5869
5870 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5871
5872 Fix previous change to make Fmemory_free always accurate.
5873 * alloc.c (make_interval): Update total_free_intervals.
5874 (make_float): Likewise for total_free_floats.
5875 (free_cons, Fcons): Likewise for total_free_conses.
5876 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5877 Likewise for total_free_vector_bytes.
5878 (Fmake_symbol): Likewise for total_free_symbols.
5879 (bytes_free): Remove.
5880
5881 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5882
5883 Simple free memory accounting feature.
5884 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5885 (sweep_vectors): Accumulate size of free vectors.
5886 (Fgarbage_collect): Setup bytes_free.
5887 (Fmemory_free): New function.
5888 (syms_of_alloc): Register it.
5889
5890 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5891
5892 Cleanup overlays checking.
5893 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5894 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5895 eassert and OVERLAYP.
5896 (sort_overlays): Change to use OVERLAYP.
5897
5898 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5899
5900 * editfns.c (Finsert_char): Make it interactive, and make the
5901 second arg optional. Copy interactive spec and docstring from
5902 ucs-insert.
5903
5904 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5905
5906 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5907 Unlike the other wrapped functions, fabs has an unspecified
5908 effect on errno.
5909
5910 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5911
5912 * nsterm.m (keyDown): Interpret flags without left/right bits
5913 as the left key (Bug#11670).
5914
5915 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5916
5917 Remove empty and useless init functions.
5918 * lisp.h (init_character_once, init_fns, init_image)
5919 (init_filelock, init_sound): Remove prototype.
5920 * character.c (init_character_once): Remove.
5921 * filelock.c (init_filelock): Likewise.
5922 * fns.c (init_fns): Likewise.
5923 * image.c (init_image): Likewise.
5924 * sound.c (init_sound): Likewise.
5925 * emacs.c (main): Adjust accordingly.
5926
5927 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5928
5929 * gtkutil.h: Tiny cleanups.
5930 (use_old_gtk_file_dialog): Remove useless declaration.
5931 (xg_uses_old_file_dialog): Add suggested const attribute.
5932
5933 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5934
5935 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5936 (bidi_paragraph_init): Use it to limit search forward for a strong
5937 directional character in abnormally large paragraphs full of
5938 neutral or weak characters. (Bug#11943)
5939
5940 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5941
5942 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5943 the toolbar (Bug#9451).
5944 (xg_make_tool_item): Give the widget event box a transparent
5945 background.
5946
5947 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5948
5949 Cleanup basic allocation variables and functions.
5950 * alloc.c (ignore_warnings, init_intervals, init_float)
5951 (init_cons, init_symbol, init_marker): Remove.
5952 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5953 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5954 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5955 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5956 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5957 (staticidx, init_alloc_once, init_strings, free_ablock):
5958 Remove redundant initialization.
5959 * fns.c (init_weak_hash_tables): Remove.
5960 * lisp.h (init_weak_hash_tables): Remove prototype.
5961
5962 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5963
5964 Use zero_vector where appropriate.
5965 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5966 accordingly.
5967 * lisp.h (zero_vector): New declaration.
5968 * font.c (null_vector): Remove.
5969 (syms_of_font): Remove initialization and staticpro.
5970 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5971 * keymap.c (Faccessible_keymaps): Likewise.
5972
5973 2012-07-15 Leo Liu <sdl.web@gmail.com>
5974
5975 * fringe.c: Fix typo in comments.
5976
5977 2012-07-14 Leo Liu <sdl.web@gmail.com>
5978
5979 * fringe.c: Add a new bitmap exclamation-mark.
5980
5981 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5982
5983 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5984
5985 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5986 (HAVE_MENUS): Don't define, defined by editing config.in with
5987 msdos/sed2v2.inp.
5988 (GMALLOC_INHIBIT_VALLOC): Don't define.
5989 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5990
5991 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5992
5993 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5994
5995 2012-07-14 Glenn Morris <rgm@gnu.org>
5996
5997 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5998 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5999 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6000
6001 2012-07-13 Glenn Morris <rgm@gnu.org>
6002
6003 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6004
6005 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6006 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6007
6008 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6009
6010 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6011 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6012 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6013 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6014 where appropriate.
6015 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6016 as boolean expression.
6017 (x_set_window_size): Remove unused variable toolbar.
6018 (ns_get_color_default, ns_mod_to_lisp): Remove.
6019 (ns_mouse_position): Remove unused variables xchar and ychar.
6020 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6021 (ns_set_vertical_scroll_bar): Remove unused variable count.
6022 (ns_delete_terminal): Remove unused variable i.
6023 (ns_term_init): Remove unused variables r, g and b.
6024 (mouseDown): Remove unused variable window.
6025 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6026 (initFrameFromEmacs): Remove unused variable vbextra.
6027 (mouseEntered): Remove unused variables p and dpyinfo.
6028 (mouseExited): Remove unused variables p and r.
6029 (ns_define_frame_cursor, ns_clear_frame_area)
6030 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6031 (menuDown): Assign [sender tag] to variable and cast the variable.
6032
6033 * nsterm.h (menuDown): Add id as type to argument sender.
6034 (ns_display_info_for_name): Add Lisp_Object argument.
6035 (ns_term_init): Add Lisp_Object argument.
6036 (ns_map_event_to_object): Add void argument.
6037 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6038 prototype with arguments and only declare if __OBJC__.
6039 (nxatoms_of_nsselect): Add void argument.
6040 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6041 (ns_alloc_autorelease_pool): Add void argument.
6042 (ns_release_autorelease_pool): Add void* argument.
6043 (ns_get_defaults_value): Add const char* argument.
6044
6045 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6046 (initFromContents): Use SSDATA where appropriate.
6047 (ns_update_menubar): Add braces to ambigous if-else.
6048 (initWithTitle): Put () around assignment in if statement.
6049 (ns_menu_show): Remove unused variables window and keymap.
6050 (update_frame_tool_bar): Remove unused variable selected_p.
6051 (initWithContentRect): Remove unused variable this_cmd_name.
6052
6053 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6054 appropriate.
6055 (setXBMColor): Remove unused variable len.
6056 (setPixmapData): Put () around assignment in loop statement.
6057
6058 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6059 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6060 where appropriate.
6061 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6062 around assignment in loop statement.
6063 (nsfont_open): Remove unused variable i.
6064 (nsfont_open): Remove unused variable len.
6065 (nsfont_draw): Remove unused variable cs.
6066
6067 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6068 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6069 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6070 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6071 (Fns_font_name, Fns_perform_service)
6072 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6073 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6074 (ns_set_name): Remove unused variable view.
6075 (x_set_menu_bar_lines): Remove unused variable olines.
6076 (x_set_tool_bar_lines): Remove unused variable root_window.
6077 (Fns_list_colors): Put () around assignment in while statement.
6078 (Fns_perform_service): Remove unused variable len.
6079 (Fns_display_usable_bounds): Remove unused variable top.
6080 (syms_of_nsfns): Remove unused variable i.
6081
6082 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6083 memcpy (Bug#11907).
6084
6085 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
6086
6087 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6088 and free it with DestroyExceptionInfo (Bug#11558).
6089
6090 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
6091
6092 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6093 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6094 Set here, not in nt/config.nt.
6095
6096 2012-07-13 Eli Zaretskii <eliz@gnu.org>
6097
6098 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6099 cursor overflow into the last glyph on display line when the right
6100 fringe is off. (Bug#11832)
6101
6102 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6103
6104 * xdisp.c (produce_special_glyphs): Now static.
6105 * dispextern.h (produce_special_glyphs): Remove decl.
6106
6107 2012-07-13 Glenn Morris <rgm@gnu.org>
6108
6109 * s/bsd-common.h, s/cygwin.h: Remove empty files.
6110 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6111
6112 * s/usg5-4-common.h (USG, USG5):
6113 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6114 * s/sol2-6.h (SOLARIS2):
6115 * s/irix6-5.h (IRIX6_5):
6116 * s/hpux10-20.h (USG, USG5, HPUX):
6117 * s/gnu-linux.h (USG, GNU_LINUX):
6118 * s/freebsd.h (BSD_SYSTEM):
6119 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6120 * s/cygwin.h (CYGWIN):
6121 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6122 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6123
6124 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
6125
6126 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6127
6128 2012-07-13 Glenn Morris <rgm@gnu.org>
6129
6130 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6131
6132 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6133
6134 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6135 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6136
6137 2012-07-12 Glenn Morris <rgm@gnu.org>
6138
6139 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6140
6141 * process.c (init_process_emacs): Rename from init_process.
6142 The old name is also the name of a Mach system call.
6143 * lisp.h, emacs.c: Update for this name change.
6144 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6145 longer needed.
6146
6147 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6148
6149 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6150 memmove call that removes glyphs covered by the left truncation
6151 glyph. Improve commentary.
6152 (display_line): Fix display of continuation glyphs on GUI frames
6153 when the right fringe is turned off and variable-size fonts are
6154 used in the window. Move the code that appends a stretch glyph to
6155 produce_special_glyphs, so that it could be used for truncation
6156 and continuation glyphs alike.
6157 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6158 glyph of a suitably computed width, to align the special glyphs at
6159 the window margin. Code moved from display_line. (Bug#11832)
6160
6161 2012-07-12 Glenn Morris <rgm@gnu.org>
6162
6163 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6164
6165 * s/gnu-linux.h, s/hpux10-20.h:
6166 Do not unconditionally define HAVE_XRMSETDATABASE.
6167
6168 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6169
6170 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6171
6172 Fix typos that broke OS X build.
6173 Reported by Randal L. Schwartz in
6174 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6175 * nsterm.m (ns_timeout): Add missing local decl.
6176 (ns_get_color): snprintf -> sprintf, to fix typo.
6177
6178 2012-07-12 Glenn Morris <rgm@gnu.org>
6179
6180 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6181 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6182 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6183 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6184
6185 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6186 Move PTY_OPEN to configure.
6187
6188 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6189 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6190 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6191
6192 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6193
6194 Use empty_unibyte_string where applicable.
6195 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6196 * lread.c (read1): Likewise.
6197 * xsettings.c (syms_of_xsettings): Likewise.
6198
6199 2012-07-12 Glenn Morris <rgm@gnu.org>
6200
6201 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6202 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6203 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6204 * s/hpux10-20.h (RUN_TIME_REMAP):
6205 * s/bsd-common.h (TABDLY): Move to configure.
6206
6207 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6208
6209 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6210
6211 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6212 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6213
6214 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6215
6216 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6217 * s/template.h: Move NARROWPROTO to configure.
6218
6219 2012-07-11 Glenn Morris <rgm@gnu.org>
6220
6221 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6222 unused since 2011-01-17 change to systty.h.
6223
6224 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6225 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6226 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6227
6228 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6229
6230 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6231
6232 2012-07-11 Glenn Morris <rgm@gnu.org>
6233
6234 * s/darwin.h, s/gnu-linux.h, s/template.h:
6235 Move INTERRUPT_INPUT to configure.
6236
6237 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6238
6239 Minor adjustments to interning code.
6240 * lisp.h (intern, intern_c_string): Redefine as static inline
6241 wrappers for intern_1 and intern_c_string_1, respectively.
6242 (intern_1, intern_c_string_1): Rename prototypes.
6243 * lread.c (intern_1, intern_c_string_1, oblookup):
6244 Simplify Vobarray checking.
6245 * font.c (font_intern_prop): Likewise. Adjust comment.
6246 * w32font.c (intern_font_name): Likewise.
6247
6248 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6249
6250 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6251
6252 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6253 of Fcar/Fcdr if possible.
6254 * font.c (check_otf_features): Likewise.
6255 * fontset.c (Fnew_fontset): Likewise.
6256 * gnutls.c (Fgnutls_boot): Likewise.
6257 * minibuf.c (read_minibuf): Likewise.
6258 * msdos.c (IT_set_frame_parameters): Likewise.
6259 * xmenu.c (Fx_popup_dialog): Likewise.
6260 * w32menu.c (Fx_popup_dialog): Likewise.
6261
6262 2012-07-11 Glenn Morris <rgm@gnu.org>
6263
6264 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6265 since nothing has defined it on these platforms.
6266
6267 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6268 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6269
6270 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6271 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6272 Move CLASH_DETECTION to configure.
6273
6274 * s/gnu.h: Remove file, which is now empty.
6275
6276 * s/gnu.h, s/gnu-linux.h:
6277 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6278
6279 2012-07-11 John Wiegley <johnw@newartisans.com>
6280
6281 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6282 function attribute, so we only use it if it exists in the
6283 compiler.
6284
6285 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6286
6287 Avoid call to strlen in fast_c_string_match_ignore_case.
6288 * search.c (fast_c_string_match_ignore_case): Change to use
6289 length argument. Adjust users accordingly.
6290 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6291
6292 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6293
6294 Assume mkdir, rmdir.
6295 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6296 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6297
6298 Assume rename.
6299 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6300
6301 Assume perror.
6302 * s/hpux10-20.h (HAVE_PERROR): Remove.
6303 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6304 Remove dummy definition, as this problem was obsolete long ago.
6305
6306 Assume strerror.
6307 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6308
6309 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6310
6311 Avoid calls to strlen in font processing functions.
6312 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6313 (font_open_by_name): Change to use length argument.
6314 Adjust users accordingly.
6315 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6316 Adjust prototypes.
6317 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6318 Change to return ptrdiff_t.
6319 (xfont_list_pattern, xfont_match): Use length returned by
6320 xfont_decode_coding_xlfd.
6321 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6322
6323 2012-07-11 Glenn Morris <rgm@gnu.org>
6324
6325 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6326 Move DONT_REOPEN_PTY to configure.
6327
6328 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6329 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6330
6331 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6332
6333 Remove "#define unix" that is no longer needed (Bug#11905).
6334 * s/aix4-2.h (unix): Remove; no longer needed.
6335
6336 EMACS_TIME simplification (Bug#11875).
6337 This replaces macros (which typically do not work in GDB)
6338 with functions, typedefs and enums, making the code easier to debug.
6339 The functional style also makes code easier to read and maintain.
6340 * systime.h: Include <sys/time.h> on all hosts, not just if
6341 WINDOWSNT, since 'struct timeval' is needed in general.
6342 (EMACS_TIME): Now a typedef, not a macro.
6343 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6344 not macros.
6345 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6346 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6347 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6348 (EMACS_TIME_LE): Now functions, not macros.
6349 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6350 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6351 which are not functions. All uses rewritten to use:
6352 (make_emacs_time): New function.
6353 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6354 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6355 not functions. All uses rewritten to use the following, respectively:
6356 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6357 (add_emacs_time, sub_emacs_time): New functions.
6358 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6359 * fileio.c (Fcopy_file):
6360 * xterm.c (XTflash): Get the current time closer to when it's used.
6361 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6362
6363 * bytecode.c (targets): Suppress -Woverride-init warnings.
6364
6365 Simplify by avoiding confusing use of strncpy etc.
6366 * doc.c (Fsnarf_documentation):
6367 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6368 * frame.c (Fmake_terminal_frame):
6369 * gtkutil.c (get_utf8_string):
6370 * lread.c (openp):
6371 * nsmenu.m (ns_update_menubar):
6372 * regex.c (regerror):
6373 Prefer memcpy to strncpy and strncat when either will do.
6374 * fileio.c (Fsubstitute_in_file_name):
6375 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6376 (menu_separator_name_p):
6377 * nsmenu.m (ns_update_menubar):
6378 Prefer memcmp to strncmp when either will do.
6379 * nsterm.m: Include <ftoastr.h>.
6380 (ns_get_color):
6381 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6382 Prefer snprintf to strncpy.
6383 * nsterm.m (ns_term_init):
6384 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6385 * nsterm.m (ns_term_init):
6386 Avoid the need for strncpy, by using build_string or
6387 make_unibyte_string directly. Use dtoastr, not snprintf.
6388 * process.c (Fmake_network_process): Diagnose service names that
6389 are too long, rather than silently truncating them or creating
6390 non-null-terminated names.
6391 (Fnetwork_interface_info): Likewise, for interface names.
6392 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6393 Prefer sprintf to strncat.
6394 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6395 Prefer vsnprintf to vsprintf + strncpy.
6396
6397 2012-07-10 Glenn Morris <rgm@gnu.org>
6398
6399 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6400 Clarify fallback case.
6401
6402 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6403
6404 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6405 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6406 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6407 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6408 where argument type is known to be a Lisp_Cons.
6409
6410 2012-07-10 Tom Tromey <tromey@redhat.com>
6411
6412 * bytecode.c (BYTE_CODE_THREADED): New macro.
6413 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6414 (enum byte_code_op): New type.
6415 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6416 (exec_byte_code): Use them. Use token threading when applicable.
6417
6418 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6419
6420 Optimize pure C strings initialization.
6421 * lisp.h (make_pure_string): Fix prototype.
6422 (build_pure_c_string): New function, defined as static inline. This
6423 provides a better opportunity to optimize away calls to strlen when
6424 the function is called with compile-time constant argument.
6425 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6426 argument, adjust users accordingly. Use build_pure_c_string where
6427 appropriate.
6428 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6429 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6430 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6431
6432 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6433
6434 Avoid calls to strlen in miscellaneous functions.
6435 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6436 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6437 * lread.c (openp): Likewise.
6438
6439 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6440
6441 Avoid calls to strlen in path processing functions.
6442 * fileio.c (file_name_as_directory): Add comment. Change to add
6443 srclen argument and return the length of result. Adjust users
6444 accordingly.
6445 (directory_file_name): Fix comment. Change to add srclen argument,
6446 swap 1st and 2nd arguments to obey the common convention.
6447 Adjust users accordingly.
6448 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6449
6450 2012-07-10 Glenn Morris <rgm@gnu.org>
6451
6452 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6453 Move PENDING_OUTPUT_COUNT definition to configure.
6454
6455 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6456 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6457 * s/gnu.h (DATA_START): Move definitions to configure.
6458
6459 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6460 We include usg5-4-common.h, which defines them both.
6461
6462 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6463 O_RDONLY already includes it).
6464
6465 Stop ns builds setting the EMACSLOADPATH environment variable.
6466 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6467 Now it does not set EMACSLOADPATH, just returns the load-path string.
6468 * nsterm.h: Update accordingly.
6469 * lread.c [HAVE_NS]: Include nsterm.h.
6470 (init_lread) [HAVE_NS]: Use ns_load_path.
6471 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6472
6473 2012-07-09 Glenn Morris <rgm@gnu.org>
6474
6475 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6476 since the included bsd-common.h does so.
6477
6478 Stop ns builds setting the EMACSPATH environment variable.
6479 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6480 (ns_init_paths): Do not set EMACSPATH.
6481 * nsterm.h (ns_exec_path): Add it.
6482 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6483 Use ns_exec_path.
6484
6485 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6486
6487 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6488
6489 * process.c (wait_reading_process_output): 'waitchannels' was unset
6490 when read_kbd || !NILP (wait_for_cell); fix this.
6491
6492 Add GCC-style 'const' attribute to functions that can use it.
6493 * character.h (char_resolve_modifier_mask):
6494 * keyboard.h (make_ctrl_char):
6495 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6496 (init_character_once, next_almost_prime, init_fns, init_image)
6497 (flush_pending_output, init_sound):
6498 * mem-limits.h (start_of_data):
6499 * menu.h (finish_menu_items):
6500 Add ATTRIBUTE_CONST.
6501 * emacs.c (DEFINE_DUMMY_FUNCTION):
6502 Declare the dummy function with ATTRIBUTE_CONST.
6503 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6504 Add decls with ATTRIBUTE_CONST.
6505
6506 Minor improvements to make_formatted_string.
6507 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6508 where int is good enough, as vsprintf returns an int.
6509 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6510
6511 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6512
6513 Use make_formatted_string to avoid double length calculation.
6514 * lisp.h (make_formatted_string): New prototype.
6515 * alloc.c (make_formatted_string): New function.
6516 * buffer.c (Fgenerate_new_buffer_name): Use it.
6517 * dbusbind.c (syms_of_dbusbind): Likewise.
6518 * editfns.c (Fcurrent_time_zone): Likewise.
6519 * filelock.c (get_boot_time): Likewise.
6520 * frame.c (make_terminal_frame, set_term_frame_name)
6521 (x_report_frame_params): Likewise.
6522 * image.c (gs_load): Likewise.
6523 * minibuf.c (get_minibuffer): Likewise.
6524 * msdos.c (dos_set_window_size): Likewise.
6525 * process.c (make_process): Likewise.
6526 * xdisp.c (ensure_echo_area_buffers): Likewise.
6527 * xsettings.c (apply_xft_settings): Likewise.
6528
6529 2012-07-09 Glenn Morris <rgm@gnu.org>
6530
6531 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6532 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6533 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6534 * nsterm.h (ns_etc_directory): Add it.
6535 * callproc.c [HAVE_NS]: Include nsterm.h.
6536 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6537
6538 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6539
6540 Move marker debugging code under MARKER_DEBUG.
6541 * marker.c (MARKER_DEBUG): Move marker debugging code under
6542 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6543 for bootstrap with --enable-checking (~3x slowdown reported
6544 by Juanma Barranquero <lekktu@gmail.com>).
6545 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6546
6547 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6548
6549 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6550 See <http://bugs.gnu.org/11825#29>.
6551
6552 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6553
6554 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6555 has no font, use the frame's font. (Bug#11813)
6556 (display_line): Add commentary about displaying truncation glyphs
6557 on GUI frames.
6558 (produce_special_glyphs): Move here from term.c.
6559
6560 * term.c (produce_special_glyphs): Move to xdisp.c.
6561
6562 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6563 section.
6564
6565 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6566
6567 * xdisp.c (display_line): Avoid warning about implicit declaration
6568 of FRAME_FONT.
6569
6570 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6571
6572 * lisp.h: Remove empty conditional.
6573
6574 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6575
6576 * lread.c (load_path_check): Now static.
6577
6578 Fix some minor --with-ns problems found by static checking.
6579 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6580 (x_set_font) [!HAVE_X_WINDOWS]:
6581 * image.c (xpm_load_image) [HAVE_NS]:
6582 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6583 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6584 Remove unused local.
6585 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6586 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6587 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6588 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6589 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6590 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6591 Fix pointer signedness problem.
6592 * xfaces.c (FRAME_X_FONT_TABLE):
6593 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6594
6595 2012-07-07 Glenn Morris <rgm@gnu.org>
6596
6597 * lread.c (load_path_check): New function, split from init_lread.
6598 (init_lread): Reorganize. Motivation:
6599 If EMACSLOADPATH is set, check/warn about that rather than the
6600 defaults, which we are not going to use. Hence we can remove
6601 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6602 Don't warn if site-lisp directories are missing.
6603 If not installed, start from a blank load-path, since
6604 PATH_LOADSEARCH refers to the eventual installation directories.
6605
6606 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6607
6608 Support truncation and continuation glyphs on GUI frames, when
6609 fringes are disabled. (Bug#11832)
6610 * xdisp.c (init_iterator): Get dimensions of truncation and
6611 continuation glyphs even if on GUI frames.
6612 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6613 or both, are absent.
6614 (start_display, move_it_in_display_line_to): Handle the case of a
6615 GUI frame without a fringe to display continuation or truncation
6616 glyphs.
6617 (insert_left_trunc_glyphs): Support GUI frames: make sure
6618 truncation glyphs overwrite enough glyphs from the current line to
6619 have sufficient space in pixels.
6620 (display_line): Support truncation and continuation glyphs on GUI
6621 frames. If some spare pixels are left on the line after inserting
6622 the truncation glyphs, fill that space with a stretch glyph of a
6623 suitably computed width.
6624
6625 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6626 produce_glyphs, to support GUI sessions.
6627
6628 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6629
6630 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6631
6632 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6633
6634 Do not require float-time's arg to fit in time_t (Bug#11825).
6635 This works better on hosts where time_t is unsigned, and where
6636 float-time is applied to the (negative) difference between two times.
6637 * editfns.c (decode_time_components): Last arg is now double *,
6638 not int *, and means to store all the result as a double, without
6639 worrying about whether the seconds part fits in time_t.
6640 All callers changed.
6641 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6642 All callers changed.
6643 (Ffloat_time): Do not fail merely because the specified time falls
6644 outside of time_t range.
6645
6646 2012-07-07 Glenn Morris <rgm@gnu.org>
6647
6648 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6649 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6650 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6651
6652 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6653
6654 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6655 Update dependencies.
6656
6657 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6658
6659 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6660
6661 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6662 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6663 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6664 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6665 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6666 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6667
6668 * xfont.c (compare_font_names): Redo to omit the need for casts.
6669
6670 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6671
6672 * xfns.c (Fx_change_window_property): Doc fix.
6673 * w32fns.c (Fx_change_window_property): Doc fix.
6674
6675 * w32fns.c (Fx_window_property): Accept the same arguments as the
6676 X Windows version. Doc fix.
6677 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6678
6679 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6680 Eli Zaretskii <eliz@gnu.org>
6681
6682 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6683 Windows-specific code from nt/config.nt moved here.
6684 Obsolete settings removed.
6685
6686 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6687
6688 * process.c: Avoid unnecessary calls to gettime.
6689 (wait_reading_process_output): Don't get the time of day
6690 when gobbling data immediately and not waiting, as there's no need
6691 for it in that case. This removes a FIXME.
6692
6693 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6694
6695 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6696 is defined (Bug#11768).
6697
6698 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6699
6700 Fix marker debugging code.
6701 * marker.c (byte_char_debug_check): Do not perform the check
6702 if buffer is not multibyte.
6703 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6704 Call byte_char_debug_check with correct arguments.
6705
6706 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6707
6708 Compile marker debugging code only if ENABLE_CHECKING is defined.
6709 * marker.c (byte_char_debug_check, count_markers):
6710 Use only if ENABLE_CHECKING is defined.
6711 (byte_debug_flag): Remove.
6712 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6713 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6714
6715 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6716
6717 Avoid code repetition in marker-related functions.
6718 * marker.c (attach_marker): New function.
6719 (Fset_marker, set_marker_restricted, set_marker_both)
6720 (set_marker_restricted_both): Use it.
6721 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6722 Consistently rename charno to charpos.
6723 (marker_position): Add eassert.
6724 (marker_byte_position): Convert to eassert.
6725
6726 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6727
6728 Simplify list operations in unchain_overlay and unchain_marker.
6729 * buffer.c (unchain_overlay): Simplify. Add comment.
6730 * marker.c (unchain_marker): Simplify. Fix comments.
6731
6732 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6733
6734 Introduce fast path for the widely used marker operation.
6735 * alloc.c (build_marker): New function.
6736 * lisp.h (build_marker): New prototype.
6737 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6738 * composite.c (autocmp_chars): Likewise.
6739 * editfns.c (buildmark): Remove.
6740 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6741 (save_restriction_save): Use build_marker.
6742 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6743 * window.c (save_window_save): Likewise.
6744
6745 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6746
6747 Do not use Fdelete_overlay in delete_all_overlays
6748 to avoid redundant calls to unchain_overlay.
6749 * buffer.c (drop_overlay): New function.
6750 (delete_all_overlays, Fdelete_overlay): Use it.
6751 * minibuf.c (get_minibuffer): Fix comment.
6752
6753 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6754
6755 Port to OpenBSD 5.1 amd64.
6756 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6757 This is needed for OpenBSD, and should be harmless on all BSD systems.
6758 Also, include <sys/sysctl.h>, as it should be available on all
6759 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6760 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6761 use p_pid member, not kp_proc.pid.
6762
6763 2012-07-06 Glenn Morris <rgm@gnu.org>
6764
6765 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6766
6767 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6768
6769 More xmalloc and related cleanup.
6770 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6771 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6772 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6773 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6774 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6775 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6776 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6777 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6778 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6779 * xterm.c:
6780 Omit needless casts involving void * pointers and allocation.
6781 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6782 as the former is more robust if P's type is changed.
6783 Prefer xzalloc to xmalloc + memset 0.
6784 Simplify malloc-or-realloc to realloc.
6785 Don't worry about xmalloc returning a null pointer.
6786 Prefer xstrdup to xmalloc + strcpy.
6787 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6788 growing it.
6789 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6790 alloca of a constant.
6791
6792 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6793
6794 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6795 hscroll is larger than the line width. Fixes long and futile
6796 looping inside extend_face_to_end_of_line (on a TTY) producing
6797 glyphs that are not needed and thrown away.
6798
6799 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6800
6801 * marker.c (set_marker_restricted_both): Simplify by using
6802 clip_to_bounds.
6803
6804 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6805
6806 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6807
6808 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6809
6810 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6811 not defined (Bug#11768).
6812 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6813 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6814 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6815 followed by gtk_box_set_homogeneous (Bug#11768).
6816 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6817 (update_theme_scrollbar_width, xg_create_scroll_bar):
6818 Use gtk_scrollbar_new (Bug#11768).
6819 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6820 (is_box_type): New function (Bug#11768).
6821 (xg_tool_item_stale_p): Call is_box_type.
6822 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6823 with default display (Bug#11768).
6824
6825 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6826
6827 * xdisp.c (window_hscroll_limited): New function.
6828 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6829 coordinates when window's hscroll is set to insanely large
6830 values. (Bug#11857)
6831
6832 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6833
6834 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6835 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6836
6837 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6838
6839 Cleanup xmalloc.
6840 * lisp.h (xzalloc): New prototype. Omit needless casts.
6841 * alloc.c (xzalloc): New function. Omit needless casts.
6842 * charset.c: Omit needless casts. Convert all calls to
6843 xmalloc with following memset to xzalloc.
6844 * dispnew.c: Likewise.
6845 * fringe.c: Likewise.
6846 * image.c: Likewise.
6847 * sound.c: Likewise.
6848 * term.c: Likewise.
6849 * w32fns.c: Likewise.
6850 * w32font.c: Likewise.
6851 * w32term.c: Likewise.
6852 * xfaces.c: Likewise.
6853 * xfns.c: Likewise.
6854 * xterm.c: Likewise.
6855 * atimer.c: Omit needless casts.
6856 * buffer.c: Likewise.
6857 * callproc.c: Likewise.
6858 * ccl.c: Likewise.
6859 * coding.c: Likewise.
6860 * composite.c: Likewise.
6861 * doc.c: Likewise.
6862 * doprnt.c: Likewise.
6863 * editfns.c: Likewise.
6864 * emacs.c: Likewise.
6865 * eval.c: Likewise.
6866 * filelock.c: Likewise.
6867 * fns.c: Likewise.
6868 * gtkutil.c: Likewise.
6869 * keyboard.c: Likewise.
6870 * lisp.h: Likewise.
6871 * lread.c: Likewise.
6872 * minibuf.c: Likewise.
6873 * msdos.c: Likewise.
6874 * print.c: Likewise.
6875 * process.c: Likewise.
6876 * region-cache.c: Likewise.
6877 * search.c: Likewise.
6878 * sysdep.c: Likewise.
6879 * termcap.c: Likewise.
6880 * terminal.c: Likewise.
6881 * tparam.c: Likewise.
6882 * w16select.c: Likewise.
6883 * w32.c: Likewise.
6884 * w32reg.c: Likewise.
6885 * w32select.c: Likewise.
6886 * w32uniscribe.c: Likewise.
6887 * widget.c: Likewise.
6888 * xdisp.c: Likewise.
6889 * xmenu.c: Likewise.
6890 * xrdb.c: Likewise.
6891 * xselect.c: Likewise.
6892
6893 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6894
6895 * fileio.c (time_error_value): Check the right error number.
6896 Problem reported by Troels Nielsen in
6897 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6898
6899 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6900
6901 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6902 This should be fixed in a better way; see Eli Zaretskii in
6903 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6904 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6905
6906 * fileio.c (time_error_value): Rename from special_mtime.
6907 The old name's problems were noted by Eli Zaretskii in
6908 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6909
6910 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6911 This variable's comment says Emacs needs at least one GDB-visible
6912 symbol of type enum pvec_type, to work around GDB problems.
6913 The symbol's value doesn't matter.
6914
6915 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6916 that causes compilation to fail on pre-C99 compilers.
6917
6918 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6919
6920 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6921 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6922
6923 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6924
6925 * buffer.c (init_buffer_once): Fix initialization of
6926 headers for buffer_defaults and buffer_local_symbols.
6927 Reported by Juanma Barranquero <lekktu@gmail.com>.
6928
6929 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6930
6931 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6932 * lisp.h (enum pvec_type): Use fewer bits.
6933 (PSEUDOVECTOR_SIZE_BITS): New constant.
6934 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6935 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6936 change in pvec_type.
6937 (PSEUDOVECTOR_TYPEP): New macro.
6938 (TYPED_PSEUDOVECTORP): Use it.
6939 * fns.c (internal_equal): Adapt code to extract pvectype.
6940 * emacs.c (gdb_pvec_type): Update type.
6941 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6942 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6943 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6944 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6945 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6946 abusing vector->header.next.nbytes.
6947 (live_vector_p): Use PVEC_TYPE.
6948 (mark_object): Adapt code to extract pvectype. Use switch.
6949
6950 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6951
6952 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6953 Tighten new eassert a bit.
6954
6955 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6956
6957 Fix compilation with --enable-gcc-warnings and -O1
6958 optimization level.
6959 * doprnt.c (doprnt): Change type of tem to int, initialize
6960 to avoid compiler warning. Add eassert.
6961 * search.c (simple_search): Initialize match_byte to avoid
6962 compiler warning. Add eassert.
6963
6964 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6965
6966 Avoid weird behavior with large horizontal scrolls.
6967 Without this change, for example, large hscroll values would
6968 mess up Emacs's display on Fedora 15 x86, presumably due to
6969 overflows in int calculations in the display code.
6970 Also, if buffers had long lines, Emacs would freeze.
6971 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6972 (set_window_hscroll): New function, containing the old guts of
6973 Fset_window_hscroll. Return the clipped value.
6974 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6975 This avoids the need to check against PTRDIFF_MAX.
6976
6977 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6978
6979 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6980
6981 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6982
6983 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6984
6985 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6986 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6987 since GCC 4.4.6 issues a bogus warning for them.
6988
6989 Fix bugs in file timestamp newness comparisons.
6990 * fileio.c (Ffile_newer_than_file_p):
6991 * lread.c (Fload): Use full timestamp resolution of files,
6992 not just the 1-second resolution, so that files that are only
6993 slightly newer still count as newer.
6994 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6995 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6996
6997 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6998
6999 * fileio.c: Improve handling of file time marker. (Bug#11852)
7000 (special_mtime): New function.
7001 (Finsert_file_contents, Fverify_visited_file_modtime):
7002 Use it to set special mtime values consistently.
7003
7004 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7005
7006 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7007 marker for non-existing file. (Bug#11852)
7008
7009 2012-07-03 Glenn Morris <rgm@gnu.org>
7010
7011 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7012 and did not make it into globals.h).
7013
7014 2012-07-03 Tom Tromey <tromey@redhat.com>
7015
7016 * window.c (Fset_window_margins, Fset_window_fringes)
7017 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7018 * textprop.c (Fprevious_property_change): No longer static.
7019 * syntax.c (Fsyntax_table_p): No longer static.
7020 * process.c (Fget_process, Fprocess_datagram_address): No longer
7021 static.
7022 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7023 * keyboard.c (Fcommand_execute): No longer static.
7024 Remove EXFUN.
7025 * insdel.c (Fcombine_after_change_execute): No longer static.
7026 * image.c (Finit_image_library): No longer static.
7027 * fileio.c (Fmake_symbolic_link): No longer static.
7028 * eval.c (Ffetch_bytecode): No longer static.
7029 * editfns.c (Fuser_full_name): No longer static.
7030 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7031 No longer static.
7032 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7033 static.
7034 * dired.c (Ffile_attributes): No longer static.
7035 * composite.c (Fcomposition_get_gstring): No longer static.
7036 * callproc.c (Fgetenv_internal): No longer static.
7037
7038 * ccl.h: Remove EXFUNs.
7039 * buffer.h: Remove EXFUNs.
7040 * dispextern.h: Remove EXFUNs.
7041 * intervals.h: Remove EXFUNs.
7042 * fontset.h: Remove EXFUN.
7043 * font.h: Remove EXFUNs.
7044 * dosfns.c (system_process_attributes): Remove EXFUN.
7045 * keymap.h: Remove EXFUNs.
7046 * lisp.h: Remove EXFUNs.
7047 * w32term.h: Remove EXFUNs.
7048 * window.h: Remove EXFUNs.
7049 * xsettings.h: Remove EXFUN.
7050 * xterm.h: Remove EXFUN.
7051
7052 2012-07-03 Glenn Morris <rgm@gnu.org>
7053
7054 * lisp.h (Frandom): Make it visible to C.
7055 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7056 buffer for invisible buffers. (Bug#1229)
7057
7058 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7059
7060 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7061 values which aren't power of 2.
7062 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7063 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7064 accordingly.
7065
7066 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7067
7068 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7069
7070 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7071
7072 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7073
7074 * alloc.c (allocate_vector_block): Remove redundant
7075 calls to mallopt if DOUG_LEA_MALLOC is defined.
7076 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7077 avoid calls to mallopt if zero_vector is returned.
7078
7079 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7080
7081 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7082 is enabled, avoid dereferencing NULL current_sblock if
7083 running undumped.
7084
7085 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7086
7087 Cleanup basic buffer management.
7088 * buffer.h (struct buffer): Change layout to use generic vector
7089 marking code. Fix some comments. Change type of 'clip_changed'
7090 to bitfield. Remove unused #ifndef old.
7091 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7092 (GET_OVERLAYS_AT): Fix indentation.
7093 (for_each_per_buffer_object_at): New macro.
7094 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7095 (Fbuffer_local_variables): Use it.
7096 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7097 * alloc.c (allocate_buffer): Adjust to match new layout of
7098 struct buffer. Fix comment.
7099 (mark_overlay): New function.
7100 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7101 Lisp area of struct buffer.
7102 (mark_object): Use it. Adjust marking of misc objects
7103 and related comments.
7104
7105 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7106
7107 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7108 wrapper that is not needed because the wrapped code is a no-op (zero
7109 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7110 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7111
7112 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7113
7114 * alloc.c (mark_buffer): Simplify. Remove prototype.
7115 (mark_object): Add comment. Reorganize marking of vector-like
7116 objects. Use CHECK_LIVE for all vector-like objects except buffers
7117 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7118 Avoid redundant calls to mark_vectorlike for bool vectors.
7119
7120 2012-06-30 Glenn Morris <rgm@gnu.org>
7121
7122 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7123
7124 * epaths.in (PATH_SITELOADSEARCH): New.
7125 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7126 This is rather than relying on --enable-locallisppath elements
7127 having "site-lisp" in their names. (Bug#10208#25, 11658)
7128
7129 2012-06-30 Eli Zaretskii <eliz@gnu.org>
7130
7131 * w32proc.c (sys_select): Accept and ignore one more argument.
7132
7133 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7134
7135 * sysselect.h [DOS_NT]: Don't include sys/select.h.
7136 (pselect) [!MS_DOS]: Redirect to sys_select.
7137
7138 * sysdep.c: Don't include dos.h and dosfns.h.
7139
7140 * process.c (sys_select):
7141 * msdos.c (sys_select): Accept one more argument and ignore it.
7142
7143 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7144 adapt data types and code to that.
7145
7146 * dosfns.c:
7147 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7148 which clashes with the gnulib function of the same name.
7149
7150 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7151
7152 * font.c (font_style_to_value, font_style_symbolic)
7153 (font_prop_validate_style): Add type checks for values in
7154 font_style_table.
7155
7156 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7157 argument.
7158 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7159 uses.
7160
7161 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7162
7163 * xdisp.c (try_window_id): Undo last change.
7164
7165 * w32.c (getwd): Adjust commentary about startup_dir.
7166 (init_environment): Always call sys_access, even in non-MSVC
7167 builds. Don't chdir to the directory of the Emacs executable.
7168 This undoes code from 1997 which was justified by the need to
7169 "avoid conflicts when removing and renaming directories". But its
7170 downside was that every relative file name was being interpreted
7171 relative to the directory of the Emacs executable, which can never
7172 be TRT. In particular, it broke sys_access when called with
7173 relative file names.
7174 (sys_access): Map GetLastError to errno.
7175
7176 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7177
7178 * window.h (struct window): Change type of 'fringes_outside_margins'
7179 to bitfield. Fix comment. Adjust users accordingly.
7180 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7181 Adjust comment.
7182 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7183 to ptrdiff_t.
7184
7185 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7186
7187 * gnutls.c (emacs_gnutls_handshake):
7188 Add QUIT to make the loop interruptible.
7189
7190 2012-06-29 Glenn Morris <rgm@gnu.org>
7191
7192 * charset.c (init_charset): Make lack of etc/charsets fatal.
7193
7194 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7195
7196 * editfns.c (region_limit): Fix type mismatch.
7197
7198 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7199
7200 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7201 undefined. Convert from xassert to eassert.
7202 * nsmenu.m: Convert from xassert to eassert.
7203 * nsterm.m: Likewise.
7204
7205 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7206
7207 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7208
7209 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7210
7211 Avoid integer overflow on scroll-left and scroll-right.
7212 * window.c (HSCROLL_MAX): New macro.
7213 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7214 overflow when requested scroll falls outside ptrdiff_t range.
7215
7216 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7217
7218 * window.h (struct window): Change type of 'hscroll',
7219 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7220 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7221 Adjust users accordingly.
7222 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7223 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7224 from EMACS_INT to ptrdiff_t.
7225 (make_window): Omit redundant initialization.
7226
7227 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7228
7229 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7230
7231 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7232
7233 * window.h (struct window): Change type of 'use_time' and
7234 'sequence_number' from Lisp_Object to int.
7235 * frame.c (make_frame): Adjust users accordingly.
7236 * print.c (print_object): Likewise.
7237 * window.c (select_window, Fwindow_use_time, make_parent_window)
7238 (make_window): Likewise.
7239
7240 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7241
7242 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7243 enabled with --enable-checking=[all,glyphs] configure option.
7244 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7245 adjust comments accordingly.
7246 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7247 undefined, adjust comments accordingly.
7248 * image.c: Likewise.
7249 * scroll.c: Likewise.
7250 * w32fns.c: Likewise.
7251 * w32term.c: Likewise.
7252 * xdisp.c: Likewise.
7253 * xfaces.c: Likewise.
7254 * xfns.c: Likewise.
7255 * xterm.c: Likewise.
7256
7257 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7258
7259 Generalize run-time debugging checks.
7260 * dispextern.h (XASSERTS): Remove.
7261 * fontset.c (xassert): Remove.
7262 Convert from xassert to eassert.
7263 * alloc.c: Convert from xassert to eassert.
7264 * bidi.c: Likewise.
7265 * dispnew.c: Likewise.
7266 * fns.c: Likewise.
7267 * fringe.c: Likewise.
7268 * ftfont.c: Likewise.
7269 * gtkutil.c: Likewise.
7270 * image.c: Likewise.
7271 * keyboard.c: Likewise.
7272 * menu.c: Likewise.
7273 * process.c: Likewise.
7274 * scroll.c: Likewise.
7275 * sound.c: Likewise.
7276 * term.c: Likewise.
7277 * w32console.c: Likewise.
7278 * w32fns.c: Likewise.
7279 * w32term.c: Likewise.
7280 * window.c: Likewise.
7281 * xdisp.c: Likewise.
7282 * xfaces.c: Likewise.
7283 * xfns.c: Likewise.
7284 * xselect.c: Likewise.
7285 * xterm.c: Likewise.
7286
7287 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7288
7289 * fns.c (maybe_resize_hash_table): Output message when growing the
7290 purify-hashtable.
7291
7292 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7293
7294 * alloc.c (allocate_string_data): Remove dead code.
7295 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7296 avoid GCC warning about unused macro.
7297
7298 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7299
7300 * alloc.c (allocate_string): Omit intervals initialization.
7301 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7302 as in make_pure_string and make_pure_c_string.
7303
7304 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7305
7306 * alloc.c (allocate_string): Fix last change.
7307
7308 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7309
7310 * alloc.c (allocate_string): Remove two redundant calls
7311 to memset, add explicit initialization where appropriate.
7312
7313 2012-06-27 Glenn Morris <rgm@gnu.org>
7314
7315 * lisp.mk (lisp): Remove paths.elc.
7316
7317 2012-06-27 Chong Yidong <cyd@gnu.org>
7318
7319 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7320
7321 2012-06-26 John Wiegley <johnw@newartisans.com>
7322
7323 * unexmacosx.c (copy_data_segment): Add two section names used
7324 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7325
7326 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7327 when building with Clang.
7328
7329 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7330
7331 * eval.c (Fapply): Allow calling it with a single argument.
7332
7333 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7334
7335 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7336 _stricmp and _strnicmp.
7337 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7338
7339 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7340
7341 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7342 allocated window.
7343 (allocate_process): Likewise for new process.
7344 (allocate_terminal): Change to use offsetof.
7345 (allocate_frame): Likewise.
7346 * frame.c (make_frame): Omit redundant initialization.
7347 * window.c (make_parent_window): Use memset.
7348 (make_window): Omit redundant initialization.
7349 * process.c (make_process): Omit redundant initialization.
7350 * terminal.c (create_terminal): Likewise.
7351
7352 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7353
7354 * term.c (delete_tty): Remove redundant call to memset.
7355
7356 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7357
7358 * alloc.c: Remove build_string.
7359 * lisp.h: Define build_string as static inline. This provides
7360 a better opportunity to optimize away calls to strlen when the
7361 function is called with compile-time constant argument.
7362 * image.c (imagemagick_error): Convert to build_string.
7363 * w32proc.c (sys_spawnve): Likewise.
7364 * xterm.c (x_term_init): Likewise.
7365
7366 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7367
7368 Use sprintf return value instead of invoking strlen on result.
7369 In the old days this wasn't portable, since some sprintf
7370 implementations returned char *. But they died out years ago and
7371 Emacs already assumes sprintf returns int.
7372 Similarly for float_to_string.
7373 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7374 * ccl.c (ccl_driver):
7375 * character.c (string_escape_byte8):
7376 * data.c (Fnumber_to_string):
7377 * doprnt.c (doprnt):
7378 * print.c (print_object):
7379 * xdisp.c (message_dolog):
7380 * xfns.c (syms_of_xfns):
7381 Use sprintf or float_to_string result to avoid need to call strlen.
7382 * data.c (Fnumber_to_string):
7383 Use make_unibyte_string, since the string must be ASCII.
7384 * lisp.h, print.c (float_to_string): Now returns int length.
7385 * term.c (produce_glyphless_glyph):
7386 Use sprintf result rather than recomputing it.
7387
7388 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7389 * Makefile.in (ALL_CFLAGS):
7390 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7391 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7392
7393 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7394
7395 * dispextern.h (xstrcasecmp): Define to library function
7396 strcasecmp if available.
7397 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7398
7399 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7400
7401 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7402 Avoid comma operator.
7403 * menu.c (push_submenu_start, push_submenu_end)
7404 (push_left_right_boundary, push_menu_pane): Likewise.
7405 * msdos.c (dos_rawgetc): Likewise.
7406
7407 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7408
7409 * xfns.c (xic_create_fontsetname): Remove redundant calls
7410 to memset.
7411
7412 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7413
7414 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7415 sprintf already null-terminates its output.
7416
7417 * xfns.c (x_window): Remove redundant cast.
7418
7419 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7420
7421 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7422 `const char *' to `char *' to avoid compiler warning.
7423
7424 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7425
7426 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7427 instead of truncating it to 63 (admittedly a generous limit).
7428
7429 * process.c: Fix spelling and caps in comments.
7430
7431 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7432
7433 * emacs.c (setpgrp): Remove definition, unused.
7434 * sysdep.c (setpgrp): Remove definition, not used in this file.
7435
7436 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7437
7438 * makefile.w32-in: Update dependencies.
7439
7440 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7441
7442 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7443 (SYSTIME_H): Add nt/inc/sys/time.h.
7444
7445 * systime.h [WINDOWSNT]: Include sys/time.h.
7446
7447 * s/ms-w32.h (struct timespec): Definition moved from
7448 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7449
7450 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7451
7452 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7453 * buffer.h (buffer_slot_type_mismatch):
7454 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7455 * eval.c (unwind_to_catch):
7456 * image.c (my_png_error, my_error_exit):
7457 * keyboard.c (quit_throw_to_read_char, user_error)
7458 (Fexit_recursive_edit, Fabort_recursive_edit):
7459 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7460 (wrong_type_argument, buffer_overflow, __executable_start)
7461 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7462 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7463 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7464 (fatal):
7465 (child_setup) [!DOS_NT]:
7466 * lread.c (end_of_file_error, invalid_syntax):
7467 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7468 * puresize.h (pure_write_error):
7469 * search.c (matcher_overflow):
7470 * sound.c (sound_perror, alsa_sound_perror):
7471 * sysdep.c, syssignal.h (croak):
7472 * term.c (maybe_fatal, vfatal):
7473 * textprop.c (text_read_only):
7474 * undo.c (user_error):
7475 * unexmacosx.c (unexec_error):
7476 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7477 Use _Noreturn rather than NO_RETURN.
7478 No need for separate decl merely because of _Noreturn.
7479 * sound.c (sound_warning, parse_sound):
7480 Remove unnecessary forward decls.
7481
7482 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7483
7484 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7485 * lisp.h (WAIT_READING_MAX): New macro.
7486 * dispnew.c (Fsleep_for, sit_for):
7487 * keyboard.c (kbd_buffer_get_event):
7488 * process.c (Faccept_process_output):
7489 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7490 This improves on the previous patch, which introduced a bug
7491 when time_t is unsigned and as wide as intmax_t.
7492 See <http://bugs.gnu.org/9000#51>.
7493
7494 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7495
7496 * dispnew.c (sit_for, Fsleep_for):
7497 * keyboard.c (kbd_buffer_get_event):
7498 * process.c (Faccept_process_output): Avoid compiler warnings when
7499 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7500
7501 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7502
7503 * makefile.w32-in: Update dependencies.
7504
7505 * w32.c (ltime): Add return type and declare static.
7506 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7507
7508 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7509
7510 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7511 Privately reported by Herbert J. Skuhra.
7512 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7513 All uses changed.
7514 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7515 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7516
7517 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7518
7519 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7520 last argument of make_unibyte_string.
7521
7522 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7523 language ID in the event parameters.
7524
7525 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7526 event.code, not the obscure "character set ID".
7527
7528 2012-06-23 Chong Yidong <cyd@gnu.org>
7529
7530 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7531
7532 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7533
7534 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7535 * w32.c (fdutimens): New function.
7536
7537 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7538
7539 * s/ms-w32.h (pselect): Redirect to sys_select.
7540
7541 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7542
7543 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7544 in the logic of incrementing and decrementing the value of
7545 use_relocatable_buffers.
7546
7547 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7548
7549 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7550 Privately reported by Herbert J. Skuhra.
7551 [__FreeBSD__]: Remove "*/" typo after "#include".
7552 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7553 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7554 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7555 Don't assume EMACS_TIME and struct timeval are the same type.
7556
7557 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7558
7559 Support higher-resolution time stamps (Bug#9000).
7560 The time stamps are only nanosecond-resolution at the C level,
7561 since that's the best that any real-world system supports now.
7562 But they are picosecond-resolution at the Lisp level, as that's
7563 easy, and leaves room for future OS improvements.
7564
7565 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7566 (LIBES): Use it.
7567
7568 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7569 Don't get current time unless it's needed.
7570
7571 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7572 now provides it if it's absent.
7573 (start_atimer): Port to higher-res time stamps.
7574 Check for time stamp overflow. Don't get current time more
7575 often than is needed.
7576
7577 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7578 Include systime.h, not time.h.
7579 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7580
7581 * dired.c: Include stat-time.h.
7582 (Ffile-attributes): File times now have higher resolution.
7583
7584 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7585 (struct image): Timestamp now has higher resolution.
7586
7587 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7588 has at least microseconds now. All uses removed.
7589 (update_frame, update_single_window, update_window, update_frame_1)
7590 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7591 (duration_to_sec_usec): Remove; no longer needed.
7592
7593 * editfns.c (time_overflow): Now extern.
7594 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7595 (float-time, Fformat_time_string, Fcurrent_time_string)
7596 (Fcurrent_time_zone): Accept and generate higher-resolution
7597 time stamps.
7598 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7599 (decode_time_components, lisp_seconds_argument): New functions.
7600 (make_time): Now static.
7601 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7602 Report an error if the time is invalid, rather than having the caller
7603 do that.
7604
7605 * fileio.c: Include <stat-time.h>
7606 (Fcopy_file): Copy higher-resolution time stamps.
7607 Prefer to set the time stamp via a file descriptor if that works.
7608 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7609 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7610 (Fvisited_file_modtime, Fset_visited_file_modtime):
7611 Support higher-resolution time stamps.
7612
7613 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7614
7615 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7616
7617 * image.c (prepare_image_for_display, clear_image_cache)
7618 (lookup_image): Port to higer-resolution time stamps.
7619
7620 * keyboard.c (start_polling, bind_polling_period):
7621 Check for time stamp overflow.
7622 (read_char, kbd_buffer_get_event, timer_start_idle)
7623 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7624 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7625 Port to higher-resolution time stamps. Do not assume time_t is signed.
7626 (decode_timer): New function. Timers are now vectors of length 9,
7627 not 8, to accommodate the picosecond component.
7628 (timer_check_2): Use it.
7629
7630 * nsterm.m (select_timeout, timeval_subtract): Remove.
7631 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7632 as they're a bit more accurate and handle overflow better.
7633 (ns_select): Change prototype to be compatible with pselect.
7634 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7635 * nsterm.h (ns_select): Adjust prototype.
7636
7637 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7638 us-resolution time stamps.
7639 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7640
7641 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7642
7643 * lisp.h (time_overflow): New decl.
7644 (wait_reading_process_output): First arg is now intmax_t, not int,
7645 to accommodate larger waits.
7646
7647 * process.h (struct Lisp_Process.read_output_delay):
7648 Now counts nanoseconds, not microseconds.
7649 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7650 EMACS_HAS_USECS.
7651 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7652 (wait_reading_process_output):
7653 Port to ns-resolution time stamps.
7654 (Faccept_process_output, wait_reading_process_output):
7655 Check for time stamp overflow. Do not assume time_t is signed.
7656 (select_wrapper): Remove; we now use pselect.
7657 (Fprocess_attributes): Now generates ns-resolution time stamps.
7658
7659 * sysdep.c: Include utimens.h. Don't include utime.h
7660 or worry about struct utimbuf; gnulib does that for us now.
7661 (gettimeofday): Remove; gnulib provides a substitute.
7662 (make_timeval): New function.
7663 (set_file_times): Now sets ns-resolution time stamps.
7664 New arg FD; all uses changed.
7665 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7666 (system_process_attributes):
7667 Now returns ns-resolution time stamp. All uses changed.
7668 Check for time stamp overflow.
7669
7670 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7671 provides a substitute now.
7672
7673 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7674 since it guarantees struct timespec.
7675 (EMACS_TIME): Now struct timespec, so that we can support
7676 ns-resolution time stamps.
7677 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7678 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7679 (EMACS_USECS): Remove.
7680 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7681 so multiply the arg by 1000 before storing it.
7682 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7683 New macros.
7684 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7685 Port to ns-resolution time stamps.
7686 (EMACS_TIME_NEG_P): Remove; replaced by....
7687 (EMACS_TIME_SIGN): New macro.
7688 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7689 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7690 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7691 (make_timeval, make_lisp_time, decode_time_components): New decls.
7692 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7693 that it mishandled time_t overflow. You can't compare by subtracting!
7694 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7695 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7696
7697 * term.c: Include <sys/time.h>.
7698 (timeval_to_Time): New function, for proper overflow wraparound.
7699 (term_mouse_position, term_mouse_click): Use it.
7700
7701 * undo.c (record_first_change): Support higher-resolution time stamps
7702 in the undo buffer.
7703 (Fprimitive_undo): Use them when restoring time stamps.
7704
7705 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7706 (w32_get_internal_run_time):
7707 Port to higher-resolution Emacs time stamps.
7708 (ltime): Now accepts single 64-bit integer, as that's more convenient
7709 for callers.
7710
7711 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7712
7713 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7714 for compatibility with pselect. Support ns-resolution time stamps.
7715
7716 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7717
7718 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7719 Check for time stamp overflow, and support ns-resolution time stamps.
7720
7721 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7722 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7723 (timeval_subtract): Remove; no longer needed.
7724 (XTflash, XTring_bell, x_wait_for_event):
7725 Port to ns-resolution time stamps. Don't assume time_t is signed.
7726
7727 2012-06-22 Chong Yidong <cyd@gnu.org>
7728
7729 * xdisp.c (x_consider_frame_title): Revert last change.
7730
7731 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7732
7733 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7734 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7735 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7736 staticidx goes up to 1597 out of 1600 = 0x640.)
7737
7738 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7739
7740 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7741 Otherwise, the umask might be mistakenly 0 while handling input signals.
7742
7743 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7744
7745 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7746
7747 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7748
7749 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7750 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7751 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7752 access to `contents' member of Lisp_Vector objects with AREF and ASET
7753 where appropriate.
7754
7755 2012-06-19 Chong Yidong <cyd@gnu.org>
7756
7757 * frame.c (delete_frame): When selecting a frame on a different
7758 text terminal, do not alter the terminal's top-frame.
7759
7760 * xdisp.c (format_mode_line_unwind_data): Record the target
7761 frame's selected window and its terminal's top-frame.
7762 (unwind_format_mode_line): Restore them.
7763 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7764 Callers changed.
7765 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7766 since tty frames can be explicitly named.
7767 (prepare_menu_bars): Likewise.
7768
7769 * term.c (Ftty_top_frame): New function.
7770
7771 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7772
7773 Port byte-code-meter to modern targets.
7774 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7775 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7776 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7777 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7778 (METER_1, METER_2): Simplify.
7779
7780 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7781
7782 * data.c (Fdefalias): Return `symbol' (bug#11686).
7783
7784 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7785
7786 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7787 gets killed during executing of this function (Bug#11665).
7788 Try to always return Qt when the buffer has been actually killed.
7789 (Vkill_buffer_query_functions): In doc-string say that functions
7790 run by this hook should not change the current buffer.
7791
7792 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7793
7794 Fix recently-introduced process.c problems found by static checking.
7795 * process.c (write_queue_push, write_queue_pop, send_process):
7796 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7797 (write_queue_pop): Fix pointer signedness problem.
7798 (send_process): Remove unused local.
7799
7800 2012-06-17 Chong Yidong <cyd@gnu.org>
7801
7802 * xdisp.c (redisplay_internal): No need to redisplay terminal
7803 frames that are not on top.
7804
7805 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7806
7807 * process.c (make_process): Initialize write_queue.
7808 (write_queue_push, write_queue_pop): New functions.
7809 (send_process): Use them to maintain correct ordering of process
7810 writes (Bug#10815).
7811
7812 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7813
7814 * lisp.h (eassert): Assume C89 or later.
7815 This removes the need for CHECK.
7816 (CHECK): Remove. Its comments about always evaluating its
7817 argument were confusing, as 'eassert' typically does not evaluate
7818 its argument.
7819
7820 * coding.c (produce_chars): Use ptrdiff_t, not int.
7821
7822 * xterm.c (x_draw_underwave): Check for integer overflow.
7823 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7824
7825 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7826
7827 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7828 referenced (Bug#11583).
7829
7830 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7831
7832 Implement wave-style variant of underlining.
7833 * dispextern.h (face_underline_type): New enum.
7834 (face): Add field for underline type.
7835 * nsterm.m (ns_draw_underwave): New function.
7836 (ns_draw_text_decoration): Use it.
7837 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7838 New functions.
7839 (x_draw_glyph_string): Use them.
7840 * xfaces.c (Qline, Qwave): New Lisp objects.
7841 (check_lface_attrs, merge_face_ref)
7842 (Finternal_set_lisp_face_attribute, realize_x_face):
7843 Handle wave-style underline face attributes.
7844 * xterm.c (x_draw_underwave): New function.
7845 (x_draw_glyph_string): Use it.
7846
7847 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7848
7849 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7850 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7851 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7852 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7853 ($(BLD)/w32select.$(O)): Update dependencies.
7854
7855 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7856
7857 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7858 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7859 * character.c (_fetch_multibyte_char_p): Remove.
7860 * alloc.c: Include "character.h" before "buffer.h".
7861 * bidi.c: Likewise.
7862 * buffer.c: Likewise.
7863 * bytecode.c: Likewise.
7864 * callint.c: Likewise.
7865 * callproc.c: Likewise.
7866 * casefiddle.c: Likewise.
7867 * casetab.c: Likewise.
7868 * category.c: Likewise.
7869 * cmds.c: Likewise.
7870 * coding.c: Likewise.
7871 * composite.c: Likewise.
7872 * dired.c: Likewise.
7873 * dispnew.c: Likewise.
7874 * doc.c: Likewise.
7875 * dosfns.c: Likewise.
7876 * editfns.c: Likewise.
7877 * emacs.c: Likewise.
7878 * fileio.c: Likewise.
7879 * filelock.c: Likewise.
7880 * font.c: Likewise.
7881 * fontset.c: Likewise.
7882 * fringe.c: Likewise.
7883 * indent.c: Likewise.
7884 * insdel.c: Likewise.
7885 * intervals.c: Likewise.
7886 * keyboard.c: Likewise.
7887 * keymap.c: Likewise.
7888 * lread.c: Likewise.
7889 * macros.c: Likewise.
7890 * marker.c: Likewise.
7891 * minibuf.c: Likewise.
7892 * nsfns.m: Likewise.
7893 * nsmenu.m: Likewise.
7894 * print.c: Likewise.
7895 * process.c: Likewise.
7896 * regex.c: Likewise.
7897 * region-cache.c: Likewise.
7898 * search.c: Likewise.
7899 * syntax.c: Likewise.
7900 * term.c: Likewise.
7901 * textprop.c: Likewise.
7902 * undo.c: Likewise.
7903 * unexsol.c: Likewise.
7904 * w16select.c: Likewise.
7905 * w32fns.c: Likewise.
7906 * w32menu.c: Likewise.
7907 * window.c: Likewise.
7908 * xdisp.c: Likewise.
7909 * xfns.c: Likewise.
7910 * xmenu.c: Likewise.
7911 * xml.c: Likewise.
7912 * xselect.c: Likewise.
7913
7914 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7915
7916 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7917 If all the glyphs of the glyph row came from strings, and we have no
7918 cursor positioning clues, put the cursor on the first glyph of the
7919 row.
7920 (handle_face_prop): Use chunk-relative overlay string index when
7921 indexing into it->string_overlays array. (Bug#11653)
7922 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7923 the rightmost. (Bug#11720)
7924
7925 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7926
7927 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7928 (CATEGORY_MEMBER): Enforce 1/0 value.
7929 * category.c (_temp_category_set): Remove.
7930
7931 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7932
7933 * window.c (Fdelete_other_windows_internal)
7934 (Fdelete_window_internal): Don't access frame's mouse highlight
7935 info of the initial frame. (Bug#11677)
7936
7937 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7938
7939 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7940 Assume USE_2_TAGS_FOR_INTS.
7941 (xreload): Adjust $tagmask width to match recent lisp.h change.
7942
7943 Simplify lisp.h in minor ways that should not affect code.
7944 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7945 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7946 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7947 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7948 (INTTYPEBITS): New macro, for clarity.
7949 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7950 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7951 Simplify now that USE_LSB_TAG is always defined.
7952 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7953 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7954
7955 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7956
7957 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7958
7959 2012-06-13 Glenn Morris <rgm@gnu.org>
7960
7961 * s/bsd-common.h (BSD4_3):
7962 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7963
7964 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7965
7966 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7967 instead of union.
7968 (XLI, XIL): Define.
7969 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7970 Use them.
7971 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7972 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7973 * alloc.c (widen_to_Lisp_Object): Remove.
7974 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7975 * frame.c (delete_frame): Remove outdated comment.
7976 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7977 USE_LISP_UNION_TYPE.
7978 (Fw32_unregister_hot_key): Likewise.
7979 (Fw32_toggle_lock_key): Likewise.
7980 * w32menu.c (add_menu_item): Likewise.
7981 (w32_menu_display_help): Use XIL instead of checking
7982 USE_LISP_UNION_TYPE.
7983 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7984 (init_heap): Likewise.
7985 * w32term.c (w32_read_socket): Update comment.
7986
7987 2012-06-13 Glenn Morris <rgm@gnu.org>
7988
7989 * s/usg5-4-common.h, src/s/unixware.h:
7990 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7991
7992 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7993
7994 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7995
7996 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7997 * alloc.c (make_number) [!defined make_number]:
7998 Remove, as lisp.h always defines this now.
7999 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8000 (roundup_size): Verify that it is a power of 2.
8001 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8002 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8003 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8004 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8005 USE_LSB_TAG now is always defined to be either 0 or 1.
8006 All uses changed.
8007 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8008 code works fine either way, and efficiency is not a concern here,
8009 as the union type is for debugging, not for production.
8010 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8011 Use an inline function on all platforms when using the union type,
8012 since this is simpler and 'static inline' can be used portably
8013 within Emacs now.
8014 (LISP_INITIALLY_ZERO): New macro.
8015 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8016 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8017
8018 2012-06-12 Glenn Morris <rgm@gnu.org>
8019
8020 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8021
8022 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8023
8024 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8025 Move BROKEN_SIGIO to configure.
8026
8027 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8028 Move NO_TERMIO to configure.
8029
8030 2012-06-12 Chong Yidong <cyd@gnu.org>
8031
8032 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8033 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8034 MagickExportImagePixels is undefined.
8035
8036 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8037
8038 * image.c (imagemagick_load_image): Remove unused label.
8039
8040 2012-06-11 Glenn Morris <rgm@gnu.org>
8041
8042 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8043 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8044 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8045 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8046
8047 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8048
8049 * alloc.c (make_byte_code): New function.
8050 (Fmake_byte_code): Use it. Don't purify here.
8051 * lread.c (read1): Use it as well to avoid extra allocation.
8052
8053 2012-06-11 Chong Yidong <cyd@gnu.org>
8054
8055 * image.c (imagemagick_load_image): Implement transparency.
8056
8057 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8058
8059 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8060 account for preceding backslashes. (Bug#11663)
8061
8062 2012-06-09 Chong Yidong <cyd@gnu.org>
8063
8064 * term.c: Support italics in capable terminals (Bug#9652).
8065 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8066 (turn_on_face): Output using TS_enter_italic_mode if available.
8067 Don't handle unused blinking and alt-charset cases.
8068 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8069 and tty_alt_charset_p cases.
8070 (tty_capable_p, init_tty): Support italics.
8071
8072 * termchar.h (struct tty_display_info): Add field for italics.
8073 Remove unused blink field.
8074
8075 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8076 Handle slant.
8077
8078 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8079 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8080 tty_alt_charset_p. Add tty_italic_p.
8081
8082 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
8083
8084 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8085 dbus_type_is_basic if available.
8086 (xd_extract_signed, xd_extract_unsigned): Rename from
8087 extract_signed and extract_unsigned, respectively. Adapt callers.
8088
8089 2012-06-09 Chong Yidong <cyd@gnu.org>
8090
8091 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8092
8093 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8094 case (Bug#9752).
8095
8096 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8097
8098 * xdisp.c (vmessage): Treat frame message as multibyte.
8099 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8100 would generate the diagnostic "Making \302\247 buffer-local while
8101 let-bound!".
8102
8103 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8104
8105 * dispnew.c (showing_window_margins_p): Undo last change, which
8106 was done due to an inadvertent commit.
8107 (adjust_frame_glyphs_for_frame_redisplay): Do call
8108 showing_window_margins_p.
8109
8110 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8111
8112 * eval.c (Fmake_var_non_special): New primitive.
8113 (syms_of_eval): Defsubr it.
8114 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8115
8116 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
8117
8118 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8119 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8120
8121 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8122
8123 * alloc.c (allocate_vectorlike): Fix last change.
8124
8125 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8126
8127 Block-based vector allocation of small vectors.
8128 * lisp.h (struct vectorlike_header): New field `nbytes',
8129 adjust comment accordingly.
8130 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8131 to denote vector blocks. Adjust users (live_vector_p,
8132 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8133 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8134 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8135 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8136 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8137 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8138 (roundup_size): New constant.
8139 (struct vector_block): New data type.
8140 (vector_blocks, vector_free_lists, zero_vector): New variables.
8141 (all_vectors): Rename to `large_vectors'.
8142 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8143 (sweep_vectors): New functions.
8144 (allocate_vectorlike): Return `zero_vector' as the only vector of
8145 0 items. Allocate new vector from block if vector size is less than
8146 or equal to VBLOCK_BYTES_MAX.
8147 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8148 (init_alloc_once): Add call to init_vectors.
8149
8150 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8151
8152 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8153
8154 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8155
8156 * doprnt.c (doprnt): Truncate multibyte char correctly.
8157 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8158 would mishandle a string argument "Xc" if X was a multibyte
8159 character of length 2: it would truncate after X's first byte
8160 rather than including all of X.
8161
8162 2012-06-06 Chong Yidong <cyd@gnu.org>
8163
8164 * buffer.c (word_wrap): Doc fix.
8165
8166 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8167
8168 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8169
8170 2012-06-03 Glenn Morris <rgm@gnu.org>
8171
8172 * xdisp.c (tool-bar-style): Doc fix.
8173
8174 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8175
8176 * Makefile.in (PAXCTL): Define.
8177 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8178 binary via PaX flags if the paxctl utility is available.
8179 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8180 Restore PaX flags to their default. (Bug#11398)
8181
8182 2012-06-03 Chong Yidong <cyd@gnu.org>
8183
8184 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8185 buffer (Bug#11226).
8186
8187 2012-06-03 Chong Yidong <cyd@gnu.org>
8188
8189 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8190 (note_mode_line_or_margin_highlight): If there is no help echo,
8191 use mode-line-default-help-echo. Handle the case where the mouse
8192 position is past the end of the mode line string.
8193
8194 * buffer.c (buffer_local_value_1): New function, split from
8195 Fbuffer_local_value; can return Qunbound.
8196 (Fbuffer_local_value): Use it.
8197 (Vmode_line_format): Docstring tweaks.
8198
8199 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8200
8201 * sysdep.c (system_process_attributes): Improve comment.
8202
8203 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8204
8205 * keyboard.c: Export real-this-command to Elisp.
8206 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8207 and DEFVAR it. Update all users.
8208
8209 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8210
8211 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8212
8213 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8214 Convert pctcpu and pctmem to Lisp float properly.
8215 Let the compiler fold better, as 100.0/0x8000 is exact.
8216
8217 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8218
8219 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8220 cons_block.
8221
8222 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8223
8224 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8225
8226 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8227
8228 For a 'struct window', replace some Lisp_Object fields to
8229 bitfields where appropriate, remove unused fields.
8230 * window.h (struct window): Remove unused 'last_mark_x' and
8231 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8232 change its type from Lisp_Object to bitfield.
8233 Change type of 'force_start', 'optional_new_start',
8234 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8235 fields from Lisp_Object to bitfield. Adjust users accordingly.
8236
8237 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8238
8239 Pacify gcc -Wdouble-precision when using Xaw.
8240 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8241 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8242 Use 'float' consistently, rather than 'float' in most places
8243 and 'double' in a couple of places.
8244
8245 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8246
8247 * xdisp.c (handle_stop): Detect whether we have overlay strings
8248 loaded by testing it->current.overlay_string_index to be
8249 non-negative, instead of checking whether n_overlay_strings is
8250 positive. (Bug#11587)
8251
8252 2012-05-31 Chong Yidong <cyd@gnu.org>
8253
8254 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8255
8256 * doc.c (Fsubstitute_command_keys): Doc fix.
8257
8258 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8259
8260 * search.c (search_buffer): Remove calls to
8261 r_alloc_inhibit_buffer_relocation, as it is now called by
8262 maybe_unify_char, which was the cause of relocation of buffer text
8263 in bug#11519.
8264
8265 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8266
8267 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8268 for the duration of call to load_charset, to avoid problems with
8269 callers of maybe_unify_char that access buffer text through C
8270 pointers.
8271
8272 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8273 decrement the inhibition flag, instead of just setting or
8274 resetting it.
8275
8276 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8277
8278 Remove obsolete '#define static' cruft.
8279 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8280 This #undef was "temporary" in 2000; it is no longer needed
8281 now that '#define static' has gone away.
8282 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8283 (gray_bitmap_bits): Remove; no longer needed.
8284 All uses replaced with definiens.
8285 * xterm.c: Include "bitmaps/gray.xbm".
8286
8287 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8288
8289 Clean up __executable_start, monstartup when --enable-profiling.
8290 The following changes affect the code only when profiling.
8291 * dispnew.c (__executable_start): Rename from safe_bcopy.
8292 Define only on platforms that need it.
8293 * emacs.c: Include <sys/gmon.h> when profiling.
8294 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8295 (__executable_start): Remove decl, since lisp.h does it now.
8296 (safe_bcopy): Remove decl; no longer has that name.
8297 (main): Coalesce #if into single bit of code, for simplicity.
8298 Cast pointers to uintptr_t, since standard libraries want integers
8299 and not pointers.
8300 * lisp.h (__executable_start): New decl.
8301
8302 2012-05-31 Glenn Morris <rgm@gnu.org>
8303
8304 * image.c (Fimagemagick_types): Doc fix.
8305
8306 2012-05-30 Jim Meyering <meyering@redhat.com>
8307
8308 * callproc.c (Fcall_process_region): Include directory component
8309 in mkstemp error message (Bug#11586).
8310
8311 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8312
8313 * alloc.c, lisp.h (make_pure_vector): Now static.
8314
8315 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8316
8317 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8318 Move to byte-run.el.
8319 (Fautoload): Do the hash-doc more carefully.
8320 * data.c (Fdefalias): Purify definition, except for keymaps.
8321 (Qdefun): Move from eval.c.
8322 * lisp.h (Qdefun): Remove.
8323 * lread.c (read1): Tiny simplification.
8324
8325 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8326
8327 Do not create empty overlays with the evaporate property (Bug#9642).
8328 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8329 Bug#9642, but explicitly check that the buffer the overlay would
8330 be moved to is live and rearrange lines to make sure that errors
8331 will not put the overlay in an inconsistent state.
8332 (Fdelete_overlay): Cosmetics.
8333
8334 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8335
8336 * w32term.c (my_bring_window_to_top): New function.
8337 (x_raise_frame): Use handle returned by DeferWindowPos, which
8338 could be different from the original one.
8339 Call my_bring_window_to_top instead of my_set_foreground_window.
8340 (Bug#11513)
8341
8342 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8343 by calling BringWindowToTop.
8344
8345 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8346 (WM_EMACS_END): Increase by one.
8347
8348 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8349
8350 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8351 This avoids undefined behavior that might cause the eassert
8352 to not catch an out-of-range value.
8353
8354 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8355
8356 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8357 Update dependencies.
8358
8359 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8360
8361 * bidi.c (bidi_mirror_char): Fix last change.
8362
8363 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8364
8365 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8366 when referring to sectname field in printf format.
8367
8368 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8369
8370 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8371 Only r_alloc_inhibit_buffer_relocation needed to be added;
8372 the others were already declared.
8373
8374 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8375 before checking whether it's out of range. Put the check inside
8376 eassert. See
8377 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8378
8379 2012-05-27 Ken Brown <kbrown@cornell.edu>
8380
8381 * callproc.c (Fcall_process): Restore a line that was accidentally
8382 commented out in the 2011-02-13 change (bug#11547).
8383
8384 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8385
8386 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8387 defined on ralloc.c.
8388
8389 * buffer.c [REL_ALLOC]: Remove prototypes of
8390 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8391 they are now on lisp.h.
8392
8393 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8394
8395 * search.c (search_buffer): Use it to inhibit relocation of buffer
8396 text while re_search_2 is doing its job, because re_search_2 is
8397 passed C pointers to buffer text. (Bug#11519)
8398
8399 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8400 Update value to 24.
8401
8402 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8403 state after an additional call to move_it_in_display_line_to, keep
8404 the values of it->max_ascent and it->max_descent found for the
8405 entire line.
8406 (pos_visible_p): Revert the comparison against bottom_y to what it
8407 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8408 (Bug#11464)
8409
8410 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8411
8412 Fix coding-related core dumps with gcc -ftrapv.
8413 The code was computing A - B, where A and B are pointers, and B is
8414 random garbage. This can lead to core dumps on platforms that
8415 have special pointer registers, and it also leads to core dumps on
8416 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8417 A - B only when B is initialized properly.
8418 * coding.c (coding_set_source, coding_set_destination): Return void.
8419 (coding_change_source, coding_change_destinations): New functions,
8420 with the old behaviors of coding_set_source and coding_set_destination.
8421 All callers that need an offset changed to use these new functions.
8422
8423 2012-05-26 Glenn Morris <rgm@gnu.org>
8424
8425 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8426
8427 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8428
8429 Extend mouse support on W32 text-mode console.
8430 * xdisp.c (draw_row_with_mouse_face):
8431 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8432
8433 * w32console.c: Include window.h.
8434 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8435 New functions.
8436 (initialize_w32_display): Initialize mouse-highlight data.
8437
8438 * w32inevt.c: Include termchar.h and window.h.
8439 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8440 moves, call note_mouse_highlight. If help_echo changed, call
8441 gen_help_event to produce help-echo message in the echo area.
8442 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8443 highlight info.
8444
8445 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8446
8447 * lread.c (read1): Simplify slightly to avoid an overflow warning
8448 with GCC 4.7.0 on x86-64.
8449
8450 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8451
8452 * bidi.c (bidi_mirror_char): Revert last change: an int is
8453 definitely wide enough here.
8454
8455 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8456
8457 Fix integer width and related bugs (Bug#9874).
8458 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8459 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8460 (string_bytes, check_sblock, allocate_string_data):
8461 (compact_small_strings, Fmake_bool_vector, make_string)
8462 (make_unibyte_string, make_multibyte_string)
8463 (make_string_from_bytes, make_specified_string)
8464 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8465 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8466 (mark_vectorlike):
8467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8468 (allocate_pseudovector):
8469 Use int, not EMACS_INT, where int is wide enough.
8470 (inhibit_garbage_collection, Fgarbage_collect):
8471 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8472 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8473 int might not be wide enough.
8474 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8475 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8476 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8477 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8478 (bidi_level_of_next_char, bidi_move_to_visually_next):
8479 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8480 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8481 (Fkill_buffer, Fset_buffer_major_mode)
8482 (advance_to_char_boundary, Fbuffer_swap_text)
8483 (Fset_buffer_multibyte, overlays_at, overlays_in)
8484 (overlay_touches_p, struct sortvec, record_overlay_string)
8485 (overlay_strings, recenter_overlay_lists)
8486 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8487 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8488 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8489 (Foverlay_recenter, last_overlay_modification_hooks_used)
8490 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8491 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8492 (validate_region): Omit unnecessary test for b <= e,
8493 since that's guaranteed by the previous test.
8494 (adjust_overlays_for_delete): Avoid pos + length overflow.
8495 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8496 (report_overlay_modification):
8497 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8498 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8499 Omit pointer cast, which isn't needed anyway, and doesn't work
8500 after the EMACS_INT -> ptrdiff_t change.
8501 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8502 * buffer.h: Adjust decls to match defn changes elsewhere.
8503 (struct buffer_text, struct buffer):
8504 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8505 Use EMACS_INT, not int, where int might not be wide enough.
8506 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8507 not int, to avoid needless 32-bit limit on 64-bit hosts.
8508 (exec_byte_code): Use tighter memory-full test, one that checks
8509 for alloca overflow. Don't compute the address of the object just
8510 before an array, as that's not portable. Use EMACS_INT, not
8511 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8512 * callint.c (Fcall_interactively):
8513 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8514 * callproc.c (call_process_kill, Fcall_process):
8515 Don't assume pid_t fits into an Emacs fixnum.
8516 (call_process_cleanup, Fcall_process, child_setup):
8517 Don't assume pid_t fits into int.
8518 (call_process_cleanup, Fcall_process, delete_temp_file)
8519 (Fcall_process_region):
8520 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8521 (Fcall_process): Simplify handling of volatile integers.
8522 Use int, not EMACS_INT, where int will do.
8523 * casefiddle.c (casify_object, casify_region, operate_on_word)
8524 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8526 (casify_object): Avoid integer overflow when overallocating buffer.
8527 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8528 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8529 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8530 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8531 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8532 integers are now checked earlier. All uses replaced with XINT.
8533 (ccl_driver):
8534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8535 For CCL_MapSingle, check that content and value are in int range.
8536 (ccl_driver, Fregister_code_conversion_map):
8537 Check that Vcode_version_map_vector is a vector.
8538 (resolve_symbol_ccl_program): Check that vector header is in range.
8539 Always copy the vector, so that we can check its contents reliably
8540 now rather than having to recheck each instruction as it's being
8541 executed. Check that vector words fit in 'int'.
8542 (ccl_get_compiled_code, Fregister_ccl_program)
8543 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8544 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8545 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8546 contents are in range.
8547 (Fccl_execute_on_string): Check that status is in range.
8548 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8549 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8550 Accept and return EMACS_INT, not int, because callers can pass values
8551 out of 'int' range.
8552 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8553 (multibyte_chars_in_text, parse_str_as_multibyte)
8554 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8555 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8556 (string_escape_byte8, Fget_byte):
8557 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8558 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8559 avoid mishandling large integers.
8560 * character.h: Adjust decls to match defn changes elsewhere.
8561 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8562 (Ffind_charset_region):
8563 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8564 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8565 (load_charset_map_from_vector, Fdefine_charset_internal):
8566 Don't assume fixnum fits in int.
8567 (load_charset_map_from_vector, Fmap_charset_chars):
8568 Remove now-unnecessary CHECK_NATNUMs.
8569 (Fdefine_charset_internal): Check ranges here, more carefully.
8570 Don't rely on undefined behavior with signed left shift overflow.
8571 Don't assume unsigned int fits into fixnum, or that fixnum fits
8572 into unsigned int. Don't require max_code to be a valid fixnum;
8573 that's not true for gb10830 4-byte on a 32-bit host. Allow
8574 invalid_code to be a cons, for the same reason. Require code_offset
8575 to be a character. Avoid int overflow if max_char is close
8576 to INT_MAX.
8577 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8578 this is intended anyway and avoids some undefined behavior.
8579 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8580 INDEX_TO_CODE_POINT, as that's what it expects.
8581 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8582 * charset.h (DECODE_CHAR): Return int, not unsigned;
8583 this is what was intended anyway, and it avoids undefined behavior.
8584 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8585 integer-overflow issues.
8586 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8587 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8588 where the argument is EMACS_INT, and this behavior is not intended.
8589 * chartab.c (Fmake_char_table, Fset_char_table_range)
8590 (uniprop_get_decoder, uniprop_get_encoder):
8591 Don't assume fixnum fits in int.
8592 * cmds.c (move_point): New function, that does the gist of
8593 Fforward_char and Fbackward_char, but does so while checking
8594 for integer overflow more accurately.
8595 (Fforward_char, Fbackward_char): Use it.
8596 (Fforward_line, Fend_of_line, internal_self_insert)
8597 (internal_self_insert):
8598 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8599 Fix a FIXME, by checking for integer overflow when calculating
8600 target_clm and actual_clm.
8601 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8602 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8603 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8604 (coding_alloc_by_making_gap, alloc_destination)
8605 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8606 (encode_coding_utf_16, detect_coding_emacs_mule)
8607 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8608 (detect_coding_iso_2022, decode_coding_iso_2022)
8609 (encode_invocation_designation, encode_designation_at_bol)
8610 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8611 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8612 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8613 (encode_coding_ccl, encode_coding_raw_text)
8614 (detect_coding_charset, decode_coding_charset)
8615 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8616 (produce_composition, produce_charset, produce_annotation)
8617 (decode_coding, handle_composition_annotation)
8618 (handle_charset_annotation, consume_chars, decode_coding_gap)
8619 (decode_coding_object, encode_coding_object, detect_coding_system)
8620 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8621 (code_convert_region, code_convert_string)
8622 (Fdefine_coding_system_internal)
8623 (coding_set_source, coding_set_destination):
8624 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8625 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8626 (Fdefine_coding_system_internal):
8627 Don't assume fixnums fit in int.
8628 (decode_coding_gap, decode_coding_object, encode_coding_object)
8629 (Fread_coding_system, Fdetect_coding_region)
8630 (Funencodable_char_position, Fcheck_coding_systems_region)
8631 (get_translation, handle_composition_annotation, consume_chars):
8632 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8633 (consume_chars): Rewrite to not calculate an address outside buffer.
8634 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8635 Don't access memory outside of the args array.
8636 (Fdefine_coding_system_internal): Check for charset-id overflow.
8637 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8638 result of ENCODE_CHAR.
8639 * coding.h: Adjust decls to match defn changes elsewhere.
8640 (struct coding_system):
8641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8642 * composite.c (get_composition_id, find_composition)
8643 (run_composition_function, update_compositions)
8644 (compose_text, composition_gstring_put_cache)
8645 (composition_gstring_p, composition_gstring_width)
8646 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8647 (composition_compute_stop_pos, composition_reseat_it)
8648 (composition_update_it, struct position_record)
8649 (find_automatic_composition, composition_adjust_point)
8650 (Fcomposition_get_gstring, Ffind_composition_internal):
8651 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8652 (update_compositions):
8653 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8654 * composite.h: Adjust decls to match defn changes elsewhere.
8655 (struct composition):
8656 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8657 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8658 Do not attempt to compute the address of the object just before a
8659 buffer; this is not portable.
8660 (Faref, Faset):
8661 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8662 (Faset): Use int, not EMACS_INT, where int is wide enough.
8663 (Fstring_to_number): Don't assume fixnums fit in int.
8664 (Frem): Don't assume arg is nonnegative.
8665 * dbusbind.c (xd_append_arg): Check for integers out of range.
8666 (Fdbus_call_method): Don't overflow the timeout int.
8667 (extract_signed, extract_unsigned): New functions.
8668 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8669 (xd_get_connection_references): Return ptrdiff_t, not int.
8670 All uses changed.
8671 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8672 (xd_read_message_1):
8673 Use int, not unsigned, where the dbus API uses int.
8674 (Fdbus_message_internal): Don't overflow mtype.
8675 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8676 * dired.c (directory_files_internal, file_name_completion, scmp)
8677 (file_name_completion_stat):
8678 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8679 (file_name_completion): Don't overflow matchcount.
8680 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8681 * dispextern.h: Adjust decls to match defn changes elsewhere.
8682 (struct text_pos, struct glyph, struct bidi_saved_info)
8683 (struct bidi_string_data, struct bidi_it, struct composition_it)
8684 (struct it):
8685 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8686 (struct display_pos, struct composition_it, struct it):
8687 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8688 * dispnew.c (increment_matrix_positions)
8689 (increment_row_positions, mode_line_string)
8690 (marginal_area_string):
8691 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8692 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8693 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8694 (duration_to_sec_usec): New function, to check for overflow better.
8695 (Fsleep_for, sit_for): Use it.
8696 * doc.c (get_doc_string, store_function_docstring):
8697 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8698 (get_doc_string, Fsnarf_documentation):
8699 Use int, not EMACS_INT, where int is wide enough.
8700 (get_doc_string):
8701 Use SAFE_ALLOCA, not alloca.
8702 Check for overflow when converting EMACS_INT to off_t.
8703 * doprnt.c (doprnt):
8704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8705 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8706 Don't assume uid_t fits into fixnum.
8707 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8708 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8709 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8710 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8711 (general_insert_function)
8712 (Finsert_char, make_buffer_string, make_buffer_string_both)
8713 (update_buffer_properties, Fbuffer_substring)
8714 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8715 (Fsubst_char_in_region, check_translation)
8716 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8717 (transpose_markers, Ftranspose_regions):
8718 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8719 (clip_to_bounds): Move to lisp.h as an inline function).
8720 (Fconstrain_to_field): Don't assume integers are nonnegative.
8721 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8722 (Fsubst_char_in_region, Fsave_restriction):
8723 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8724 (Femacs_pid): Don't assume pid_t fits into fixnum.
8725 (lo_time): Use int, not EMACS_INT, when int suffices.
8726 (lisp_time_argument): Check for usec out of range.
8727 (Fencode_time): Don't assume fixnum fits in int.
8728 (Fuser_login_name, Fuser_full_name): Signal an error
8729 if a uid argument is out of range, rather than relying on
8730 undefined behavior.
8731 (Fformat_time_string): Remove now-unnecessary check.
8732 lisp_time_argument checks for out-of-range usec now.
8733 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8734 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8735 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8736 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8737 (init_cmdargs, Fdump_emacs):
8738 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8739 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8740 the bottom (typically) 32 bits of the fixnum.
8741 * eval.c (specpdl_size, call_debugger):
8742 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8743 (when_entered_debugger, Fbacktrace_debug):
8744 Don't assume fixnum can fit in int.
8745 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8746 the object just before a buffer; this is not portable.
8747 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8748 (grow_specpdl, unbind_to):
8749 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8750 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8751 (grow_specpdl): Simplify allocation by using xpalloc.
8752 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8753 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8754 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8755 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8756 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8757 (a_write, e_write):
8758 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8759 (Fcopy_file, non_regular_nbytes, read_non_regular)
8760 (Finsert_file_contents):
8761 Use int, not EMACS_INT, where int is wide enough.
8762 (READ_BUF_SIZE): Verify that it fits in int.
8763 (Finsert_file_contents): Check that counts are in proper range,
8764 rather than assuming fixnums fit into ptrdiff_t etc.
8765 Don't assume fixnums fit into int.
8766 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8767 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8768 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8769 (string_char_to_byte, string_byte_to_char)
8770 (string_make_multibyte, string_to_multibyte)
8771 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8772 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8773 (substring_both, Fdelete, internal_equal, Ffillarray)
8774 (Fclear_string, mapcar1)
8775 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8776 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8777 (larger_vector, make_hash_table, maybe_resize_hash_table)
8778 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8779 (Fmaphash, secure_hash):
8780 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8781 (concat): Check for string index and length overflow.
8782 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8783 (Frequire):
8784 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8785 (larger_vector): New API (vec, incr_min, size_max) replaces old
8786 one (vec, new_size, init). This catches size overflow.
8787 INIT was removed because it was always Qnil.
8788 All callers changed.
8789 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8790 the upper bound on a hash table index size.
8791 (make_hash_table, maybe_resize_hash_table): Use it.
8792 (secure_hash): Computer start_byte and end_byte only after
8793 they're known to be in ptrdiff_t range.
8794 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8795 (Ffont_get_glyphs, Ffont_at):
8796 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8797 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8798 (Flist_fonts, Fopen_font):
8799 Don't assume fixnum can fit in int.
8800 (check_gstring): Don't assume index can fit in int.
8801 (font_match_p): Check that fixnum is a character, not a nonnegative
8802 fixnum, since the later code needs to stuff it into an int.
8803 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8804 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8805 conversion overflow issues.
8806 (Fopen_font): Check for integer out of range.
8807 (Ffont_get_glyphs): Don't assume index can fit in int.
8808 * font.h: Adjust decls to match defn changes elsewhere.
8809 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8810 integer overflow.
8811 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8812 printmax_t, where ptrdiff_t is wide enough.
8813 (Finternal_char_font):
8814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8815 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8816 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8817 (Fset_frame_position, x_set_frame_parameters)
8818 (x_set_line_spacing, x_set_border_width)
8819 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8820 Check that fixnums are in proper range for system types.
8821 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8822 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8823 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8824 Use SAFE_ALLOCA_LISP, not alloca.
8825 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8826 intptr_t is wide enough.
8827 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8828 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8829 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8830 Check for fixnum out of range.
8831 * ftfont.c (ftfont_list): Don't assume index fits in int.
8832 Check that fixnums are in proper range for system types.
8833 (ftfont_shape_by_flt):
8834 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8835 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8836 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8837 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8838 Check that fixnums are in proper range for system types.
8839 * gnutls.h: Adjust decls to match defn changes elsewhere.
8840 * gtkutil.c (xg_dialog_run):
8841 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8842 (update_frame_tool_bar):
8843 Check that fixnums are in proper range for system types.
8844 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8845 (lookup_image): Check that fixnums are in range for system types.
8846 * indent.c (last_known_column, last_known_column_point):
8847 (current_column_bol_cache):
8848 (skip_invisible, current_column, check_display_width):
8849 (check_display_width, scan_for_column, current_column_1)
8850 (Findent_to, Fcurrent_indentation, position_indentation)
8851 (indented_beyond_p, Fmove_to_column, compute_motion):
8852 (Fcompute_motion, Fvertical_motion):
8853 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8854 (last_known_column_modified): Use EMACS_INT, not int.
8855 (check_display_width):
8856 (Fcompute_motion):
8857 Check that fixnums and floats are in proper range for system types.
8858 (compute_motion): Don't assume index or fixnum fits in int.
8859 (compute_motion, Fcompute_motion):
8860 Use int, not EMACS_INT, when it is wide enough.
8861 (vmotion): Omit local var start_hpos that is always 0; that way
8862 we don't need to worry about overflow in expressions involving it.
8863 * indent.h: Adjust decls to match defn changes elsewhere.
8864 (struct position):
8865 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8866 Use int, not EMACS_INT, where int is wide enough.
8867 Remove unused members ovstring_chars_done and tab_offset;
8868 all uses removed.
8869 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8870 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8871 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8872 (make_gap, copy_text, insert, insert_and_inherit)
8873 (insert_before_markers, insert_before_markers_and_inherit)
8874 (insert_1, count_combining_before, count_combining_after)
8875 (insert_1_both, insert_from_string)
8876 (insert_from_string_before_markers, insert_from_string_1)
8877 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8878 (adjust_after_replace, adjust_after_insert, replace_range)
8879 (replace_range_2, del_range, del_range_1, del_range_byte)
8880 (del_range_both, del_range_2, modify_region)
8881 (prepare_to_modify_buffer, signal_before_change)
8882 (signal_after_change, Fcombine_after_change_execute):
8883 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8884 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8885 (balance_an_interval, split_interval_right, split_interval_left)
8886 (find_interval, next_interval, update_interval)
8887 (adjust_intervals_for_insertion, delete_node, delete_interval)
8888 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8889 (static_offset_intervals, offset_intervals)
8890 (merge_interval_right, merge_interval_left, make_new_interval)
8891 (graft_intervals_into_buffer, temp_set_point_both)
8892 (temp_set_point, set_point, adjust_for_invis_intang)
8893 (set_point_both, move_if_not_intangible, get_property_and_range)
8894 (get_local_map, copy_intervals, copy_intervals_to_string)
8895 (compare_string_intervals, set_intervals_multibyte_1):
8896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8897 * intervals.h: Adjust decls to match defn changes elsewhere.
8898 (struct interval):
8899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8900 * keyboard.c (this_command_key_count, this_single_command_key_start)
8901 (before_command_key_count, before_command_echo_length, echo_now)
8902 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8903 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8904 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8905 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8906 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8907 (last_non_minibuf_size, last_point_position, echo_truncate)
8908 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8909 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8910 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8911 (stuff_buffered_input):
8912 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8913 (last_auto_save, command_loop_1, read_char):
8914 Use EMACS_INT, not int, to avoid integer overflow.
8915 (record_char): Avoid overflow in total_keys computation.
8916 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8917 * keyboard.h: Adjust decls to match defn changes elsewhere.
8918 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8919 (Fkey_description, Fdescribe_vector, Flookup_key):
8920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8921 (click_position): New function, to check that positions are in range.
8922 (Fcurrent_active_maps):
8923 (describe_command):
8924 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8925 (Faccessible_keymaps, Fkey_description):
8926 (preferred_sequence_p):
8927 Don't assume fixnum can fit into int.
8928 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8929 Check for integer overflow in size calculations.
8930 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8931 avoid mishandling large integers.
8932 * lisp.h: Adjust decls to match defn changes elsewhere.
8933 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8934 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8935 (struct Lisp_Marker):
8936 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8937 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8938 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8939 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8940 All callers changed.
8941 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8942 Assume the arg has valid form, since it always does.
8943 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8944 unsigned integer system type.
8945 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8946 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8947 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8948 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8949 (duration_to_sec_usec): New decl.
8950 * lread.c (read_from_string_index, read_from_string_index_byte)
8951 (read_from_string_limit, readchar, unreadchar, openp)
8952 (read_internal_start, read1, oblookup):
8953 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8954 (Fload, readevalloop, Feval_buffer, Feval_region):
8955 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8956 (openp): Check for out-of-range argument to 'access'.
8957 (read1): Use int, not EMACS_INT, where int is wide enough.
8958 Don't assume fixnum fits into int.
8959 Fix off-by-one error that can read outside a buffer.
8960 (read_filtered_event): Use duration_to_sec_usec
8961 to do proper overflow checking on durations.
8962 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8963 in size calculation.
8964 (Fexecute_kbd_macro):
8965 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8966 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8967 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8968 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8969 (set_marker_both, set_marker_restricted_both, marker_position)
8970 (marker_byte_position, Fbuffer_has_markers_at):
8971 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8972 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8973 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8974 It now merely ensures that the menu is large enough, without
8975 necessarily growing it, as this avoids some integer overflow issues.
8976 All callers changed.
8977 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8978 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8979 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8980 Use SAFE_ALLOCA_LISP, not alloca.
8981 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8982 to EMACS_INT. Check that fixnums are in proper range for system types.
8983 * minibuf.c (minibuf_prompt_width, string_to_object)
8984 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8985 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8987 (get_minibuffer, read_minibuf_unwind):
8988 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8989 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8990 this simplifies overflow checking. All callers changed.
8991 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8992 (Ftest_completion):
8993 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8994 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8995 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8996 Check that fixnums are in proper range for system types.
8997 (Fx_create_frame, Fx_show_tip):
8998 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8999 * nsfont.m (ns_findfonts, nsfont_list_family):
9000 Don't assume fixnum fits in long.
9001 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9002 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9003 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9004 wide enough.
9005 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9006 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9007 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9008 (PRINTDECLARE, PRINTPREPARE):
9009 (strout, print_string):
9010 (print, print_preprocess, print_check_string_charset_prop)
9011 (print_object):
9012 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9013 (PRINTDECLARE):
9014 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9015 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9016 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9017 (printchar, strout): Use xpalloc to catch size calculation overflow.
9018 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9019 (print_error_message): Use SAFE_ALLOCA, not alloca.
9020 (print_object): Use int, not EMACS_INT, where int is wide enough.
9021 (print_depth, new_backquote_output, print_number_index):
9022 Use ptrdiff_t, not int, where int might not be wide enough.
9023 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9024 (Fset_process_window_size, Fformat_network_address)
9025 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9026 (sigchld_handler):
9027 Check that fixnums are in proper range for system types.
9028 (Fsignal_process): Simplify by avoiding a goto.
9029 Check for process-ids out of pid_t range rather than relying on
9030 undefined behavior.
9031 (process_tick, update_tick): Use EMACS_INT, not int.
9032 (Fformat_network_address, read_process_output, send_process)
9033 (Fprocess_send_region, status_notify):
9034 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9035 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9036 (wait_reading_process_output, read_process_output, exec_sentinel):
9037 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9038 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9039 (Faccept_process_output): Use duration_to_sec_usec to do proper
9040 overflow checking on durations.
9041 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9042 Don't assume pid_t fits in int.
9043 * process.h (struct Lisp_Process): Members tick and update_tick
9044 are now of type EMACS_INT, not int.
9045 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9046 configured --with-wide-int.
9047 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9048 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9049 * search.c (looking_at_1, string_match_1):
9050 (fast_string_match, fast_c_string_match_ignore_case)
9051 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9052 (scan_newline, find_before_next_newline, search_command)
9053 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9054 (set_search_regs, wordify):
9055 (Freplace_match):
9056 (Fmatch_data):
9057 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9058 (string_match_1, search_buffer, set_search_regs):
9059 (Fmatch_data):
9060 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9061 (wordify): Check for overflow in size calculation.
9062 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9063 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9064 Check that fixnums are in proper range for system types.
9065 * sound.c (struct sound_device)
9066 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9067 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9068 (Fplay_sound_internal):
9069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9070 * syntax.c (struct lisp_parse_state, find_start_modiff)
9071 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9072 (Fparse_partial_sexp):
9073 Don't assume fixnums can fit in int.
9074 (struct lisp_parse_state, find_start_pos, find_start_value)
9075 (find_start_value_byte, find_start_begv)
9076 (update_syntax_table, char_quoted, dec_bytepos)
9077 (find_defun_start, prev_char_comend_first, back_comment):
9078 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9079 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9080 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9081 (Finternal_describe_syntax_value): Check that match_lisp is a
9082 character, not an integer, since the code stuffs it into int.
9083 (scan_words, scan_sexps_forward):
9084 Check that fixnums are in proper range for system types.
9085 (Fforward_word):
9086 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9087 (scan_sexps_forward):
9088 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9089 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9090 * syntax.h: Adjust decls to match defn changes elsewhere.
9091 (struct gl_state_s):
9092 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9093 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9094 MOST_POSITIVE_FIXNUM.
9095 * sysdep.c (wait_for_termination_1, wait_for_termination)
9096 (interruptible_wait_for_termination, mkdir):
9097 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9098 (emacs_read, emacs_write):
9099 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9100 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9101 and double all fit in int.
9102 * term.c (set_tty_color_mode):
9103 Check that fixnums are in proper range for system types.
9104 * termhooks.h (struct input_event):
9105 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9106 * textprop.c (validate_interval_range, interval_of)
9107 (Fadd_text_properties, set_text_properties_1)
9108 (Fremove_text_properties, Fremove_list_of_text_properties)
9109 (Ftext_property_any, Ftext_property_not_all)
9110 (copy_text_properties, text_property_list, extend_property_ranges)
9111 (verify_interval_modification):
9112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9113 (Fnext_single_char_property_change)
9114 (Fprevious_single_char_property_change):
9115 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9116 (copy_text_properties):
9117 Check for integer overflow in index calculation.
9118 * undo.c (last_boundary_position, record_point, record_insert)
9119 (record_delete, record_marker_adjustment, record_change)
9120 (record_property_change):
9121 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9122 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9123 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9124 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9125 (Fx_hide_tip, Fx_file_dialog):
9126 * w32menu.c (set_frame_menubar):
9127 Use ptrdiff_t, not int, for consistency with rest of code.
9128 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9129 (select_window, Fdelete_other_windows_internal)
9130 (window_scroll_pixel_based, window_scroll_line_based)
9131 (Frecenter, Fset_window_configuration):
9132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9133 (Fset_window_hscroll, run_window_configuration_change_hook)
9134 (set_window_buffer, temp_output_buffer_show, scroll_command)
9135 (Fscroll_other_window, Frecenter):
9136 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9137 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9138 Don't assume fixnum fits in int.
9139 (Fset_window_scroll_bars):
9140 Check that fixnums are in proper range for system types.
9141 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9142 (string_pos, c_string_pos, number_of_chars, init_iterator)
9143 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9144 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9145 (compute_display_string_end, handle_face_prop)
9146 (face_before_or_after_it_pos, handle_invisible_prop)
9147 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9148 (display_prop_intangible_p, string_buffer_position_lim)
9149 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9150 (get_overlay_strings_1, get_overlay_strings)
9151 (iterate_out_of_display_property, forward_to_next_line_start)
9152 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9153 (get_next_display_element, set_iterator_to_next)
9154 (get_visually_first_element, compute_stop_pos_backwards)
9155 (handle_stop_backwards, next_element_from_buffer)
9156 (move_it_in_display_line_to, move_it_in_display_line)
9157 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9158 (add_to_log, message_dolog, message_log_check_duplicate)
9159 (message2, message2_nolog, message3, message3_nolog
9160 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9161 (current_message_1, truncate_echo_area, truncate_message_1)
9162 (set_message, set_message_1, store_mode_line_noprop)
9163 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9164 (text_outside_line_unchanged_p, check_point_in_composition)
9165 (reconsider_clip_changes)
9166 (redisplay_internal, set_cursor_from_row, try_scrolling)
9167 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9168 (redisplay_window, find_last_unchanged_at_beg_row)
9169 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9170 (trailing_whitespace_p, find_row_edges, display_line)
9171 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9172 (display_mode_element, store_mode_line_string)
9173 (pint2str, pint2hrstr, decode_mode_spec)
9174 (display_count_lines, display_string, draw_glyphs)
9175 (x_produce_glyphs, x_insert_glyphs)
9176 (rows_from_pos_range, mouse_face_from_buffer_pos)
9177 (fast_find_string_pos, mouse_face_from_string_pos)
9178 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9180 (safe_call, init_from_display_pos, handle_fontified_prop)
9181 (handle_single_display_spec, load_overlay_strings)
9182 (with_echo_area_buffer, setup_echo_area_for_printing)
9183 (display_echo_area, echo_area_display)
9184 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9185 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9186 (redisplay_window, dump_glyph_row, display_mode_line)
9187 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9188 (handle_display_spec, display_prop_string_p):
9189 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9190 (handle_single_display_spec, build_desired_tool_bar_string)
9191 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9192 (get_specified_cursor_type):
9193 Check that fixnums are in proper range for system types.
9194 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9195 (Flookup_image_map):
9196 Don't assume fixnums fit in int.
9197 (compare_overlay_entries):
9198 Avoid mishandling comparisons due to subtraction overflow.
9199 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9200 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9201 (handle_tool_bar_click):
9202 Use int, not unsigned, since we prefer signed and the signedness
9203 doesn't matter here.
9204 (get_next_display_element, next_element_from_display_vector):
9205 Use int, not EMACS_INT, when int is wide enough.
9206 (start_hourglass): Use duration_to_sec_usec to do proper
9207 overflow checking on durations.
9208 * xfaces.c (Fbitmap_spec_p):
9209 Check that fixnums are in proper range for system types.
9210 (compare_fonts_by_sort_order):
9211 Avoid mishandling comparisons due to subtraction overflow.
9212 (Fx_family_fonts, realize_basic_faces):
9213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9214 (Fx_family_fonts):
9215 Don't assume fixnum fits in int.
9216 Use SAFE_ALLOCA_LISP, not alloca.
9217 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9218 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9219 (face_at_buffer_position, face_for_overlay_string)
9220 (face_at_string_position):
9221 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9222 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9223 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9224 (Fx_show_tip):
9225 Check that fixnums are in proper range for system types.
9226 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9227 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9228 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9229 (Fx_change_window_property): Don't assume fixnums fit in int.
9230 * xfont.c (xfont_chars_supported):
9231 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9232 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9233 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9234 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9235 * xml.c (parse_region):
9236 * xrdb.c (magic_file_p):
9237 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9238 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9239 (x_get_local_selection, x_reply_selection_request)
9240 (x_handle_selection_request, wait_for_property_change):
9241 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9242 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9243 short is wide enough.
9244 (x_send_client_event): Don't assume fixnum fits in int.
9245 * xterm.c (x_x_to_emacs_modifiers):
9246 Don't assume EMACS_INT overflows nicely into int.
9247 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9248 may come from Lisp.
9249 (handle_one_xevent): NATNUMP can eval its arg twice.
9250 (x_connection_closed):
9251 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9252 * xterm.h: Adjust decls to match defn changes elsewhere.
9253 (struct scroll_bar): Use struct vectorlike_header
9254 rather than rolling our own approximation.
9255 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9256
9257 2012-05-25 Glenn Morris <rgm@gnu.org>
9258
9259 * lisp.mk (lisp): Update for more files being compiled now.
9260
9261 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9262
9263 * lread.c: Remove `read_pure' which makes no difference.
9264 (read_pure): Remove var.
9265 (unreadpure): Remove function.
9266 (readevalloop): Don't call read_list with -1 flag.
9267 (read1, read_vector): Don't test read_pure any more.
9268 (read_list): Simplify.
9269
9270 * fileio.c, character.h: Minor style tweaks.
9271
9272 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9273
9274 * window.h (clip_changed): Remove useless declaration.
9275
9276 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9277
9278 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9279 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9280
9281 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9282
9283 Remove src/m/*.
9284 This directory predates autoconf and is no longer needed nowadays.
9285 Move its few remaining bits of functionality to where they're needed.
9286 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9287 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9288 * m/template.h: Remove.
9289 * Makefile.in (M_FILE): Remove. All uses removed.
9290 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9291 * lisp.h (USE_LSB_TAG):
9292 * mem-limits.h (EXCEEDS_LISP_PTR):
9293 Use VAL_MAX, not VALBITS, in #if.
9294 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9295 (EMACS_UINT): Define unconditionally now.
9296 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9297 (BITS_PER_EMACS_INT): New constants, replacing
9298 what used to be in config.h, but not useful in #if.
9299 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9300 define them any more.
9301 (VAL_MAX): New macro.
9302 (VALMASK): Use it.
9303 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9304 BITS_PER_EMACS_INT, in #if.
9305 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9306 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9307 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9308 * s/ms-w32.h (DATA_START):
9309 Move here from removed file m/intel386.h.
9310 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9311 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9312
9313 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9314
9315 Assume C89 or later.
9316 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9317 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9318 (xrealloc):
9319 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9320 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9321 * textprop.c, tparam.c (NULL): Remove.
9322 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9323 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9324 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9325 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9326 * xterm.c (input_signal_count): Assume volatile works.
9327
9328 2012-05-21 Ken Brown <kbrown@cornell.edu>
9329
9330 * xgselect.c (xg_select): Fix first argument in call to 'select'
9331 (bug#11508).
9332
9333 2012-05-20 Ken Brown <kbrown@cornell.edu>
9334
9335 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9336 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9337
9338 2012-05-19 Ken Brown <kbrown@cornell.edu>
9339
9340 * xfns.c (x_in_use): Remove `static' qualifier.
9341 * xterm.h (x_in_use): Declare.
9342 * xgselect.c: Include xterm.h.
9343 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9344 and `display_arg' (bug#9754).
9345
9346 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9347
9348 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9349
9350 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9351 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9352
9353 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9354
9355 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9356
9357 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9358 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9359
9360 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9361 reference to image_cache->refcount.
9362 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9363
9364 2012-05-17 Juri Linkov <juri@jurta.org>
9365
9366 * search.c (Fword_search_regexp, Fword_search_backward)
9367 (Fword_search_forward, Fword_search_backward_lax)
9368 (Fword_search_forward_lax): Move functions to isearch.el
9369 (bug#10145, bug#11381).
9370
9371 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9372
9373 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9374
9375 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9376
9377 * lread.c (init_obarray): Declare Qt and Qnil as special.
9378
9379 2012-05-14 Glenn Morris <rgm@gnu.org>
9380
9381 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9382 Put "libexec" before "bin", for the sake of init_callproc_1.
9383
9384 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9385
9386 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9387
9388 * unexaix.c: Port to more-recent AIX compilers.
9389 (report_error, report_error_1, make_hdr, copy_sym)
9390 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9391 Make arguments const char *, not char *, to avoid violations of C
9392 standard and to fix some AIX warnings reported by Gilles Pion.
9393
9394 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9395
9396 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9397 already have overlays loaded.
9398 (handle_single_display_spec): Before returning without displaying
9399 fringe bitmap, synchronize the bidi iterator with the main display
9400 iterator, by calling iterate_out_of_display_property.
9401 (iterate_out_of_display_property): Detect buffer iteration by
9402 testing that it->string is a Lisp string.
9403 (get_next_display_element): When the current object is exhausted,
9404 and there's something on it->stack, call set_iterator_to_next to
9405 proceed with what's on the stack, instead of returning zero.
9406 (set_iterator_to_next): If called at the end of a Lisp string,
9407 proceed to consider_string_end without incrementing string
9408 position. Don't increment display vector index past the end of
9409 the display vector. (Bug#11417)
9410 (pos_visible_p): Don't report a position visible when move_it_to
9411 stopped at the last line of window, which happens to be scanned
9412 backwards by the bidi iteration. (Bug#11464)
9413
9414 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9415
9416 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9417 and right-margin display specs even if the spec is invalid or we
9418 are on a TTY, and thus unable to display on the fringes.
9419 That's because the text with the property will not be displayed anyway,
9420 so we need to signal to the caller that this is a "replacing"
9421 display spec. This fixes display when the spec is invalid or we
9422 are on a TTY.
9423
9424 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9425
9426 * unexaix.c (make_hdr): Fix typo in prototype.
9427 This bug broke the build on AIX. Problem reported by Gilles Pion.
9428
9429 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9430
9431 * keyboard.c (kbd_buffer_get_event): Read special events also in
9432 batch mode. (Bug#11415)
9433
9434 2012-05-12 Glenn Morris <rgm@gnu.org>
9435
9436 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9437
9438 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9439
9440 * lisp.mk (lisp): Add newcomment.elc.
9441
9442 2012-05-12 Glenn Morris <rgm@gnu.org>
9443
9444 * Makefile.in (MKDIR_P): New, set by configure.
9445 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9446
9447 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9448
9449 Remove unused function hourglass_started.
9450 * dispextern.h (hourglass_started):
9451 * w32fns.c (hourglass_started):
9452 * xdisp.c (hourglass_started): Remove.
9453
9454 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9455
9456 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9457 Update dependencies.
9458
9459 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9460
9461 * xgselect.c (xg_select): Put maxfds+1 into a var.
9462 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9463
9464 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9465
9466 2012-05-10 Dave Abrahams <dave@boostpro.com>
9467
9468 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9469 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9470
9471 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9472
9473 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9474 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9475 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9476 Initialize xd_registered_buses.
9477
9478 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9479
9480 Untag more efficiently if USE_LSB_TAG.
9481 This is based on a proposal by YAMAMOTO Mitsuharu in
9482 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9483 For an admittedly artificial (nth 8000 longlist) benchmark on
9484 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9485 Emacs's overall text size by 1%.
9486 * lisp.h (XUNTAG): New macro.
9487 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9488 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9489 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9490 * eval.c (Fautoload):
9491 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9492 * frame.h (XFRAME): Use XUNTAG.
9493
9494 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9495 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9496 Remove unportable assumptions about print widths of types like
9497 dbus_uint32_t.
9498 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9499 intptr_t when converting between pointer and integer, to avoid GCC
9500 warnings about wrong width.
9501
9502 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9503
9504 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9505 stack for each reader_thread, instead of defaulting to 8MB
9506 determined by the linker. This avoids failures in creating
9507 subprocesses on Windows 7, see the discussion in this thread:
9508 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9509
9510 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9511
9512 Fix up display of the *Minibuf-0* buffer in the mini window.
9513 * keyboard.c (read_char): Don't clear the echo area if there's no
9514 message to clear.
9515 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9516 contents of *Minibuf-0*) if there's no message displayed in its stead.
9517
9518 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9519
9520 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9521 batch mode.
9522
9523 2012-05-06 Chong Yidong <cyd@gnu.org>
9524
9525 * lisp.mk (lisp): Update.
9526
9527 2012-05-05 Jim Meyering <meyering@redhat.com>
9528
9529 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9530
9531 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9532
9533 * data.c (PUT_ERROR): New macro.
9534 (syms_of_data): Use it. Add new error type `user-error'.
9535 * undo.c (user_error): New function.
9536 (Fprimitive_undo): Use it.
9537 * print.c (print_error_message): Adjust print style for `user-error'.
9538 * keyboard.c (user_error): New function.
9539 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9540
9541 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9542
9543 Do not limit current-time-string to years 1000..9999.
9544 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9545 (Fcurrent_time_string): Support any year that is supported by the
9546 underlying localtime representation. Don't use asctime, as it
9547 has undefined behavior for years outside the range -999..9999.
9548
9549 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9550
9551 Fix race conditions involving setenv, gmtime, localtime, asctime.
9552 Without this fix, interrupts could mess up code that uses these
9553 nonreentrant functions, since setting TZ invalidates existing
9554 tm_zone or tzname values, and since most of these functions return
9555 pointers to static storage.
9556 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9557 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9558 Grow the critical sections to include not just invoking
9559 localtime/gmtime, but also accessing these functions' results
9560 including their tm_zone values if any, and any related TZ setting.
9561 (format_time_string): Last arg is now struct tm *, not struct tm **,
9562 so that the struct tm is saved in the critical section.
9563 All callers changed. Simplify allocation of initial buffer, partly
9564 motivated by the fact that memory allocation needs to be outside
9565 the critical section.
9566
9567 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9568
9569 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9570 with RESET_INTERVAL.
9571
9572 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9573 Remove duplicated buffer name initialization.
9574
9575 2012-05-02 Jim Meyering <jim@meyering.net>
9576
9577 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9578
9579 * xfns.c (x_window): Use xstrdup (Bug#11375).
9580
9581 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9582
9583 * xdisp.c (pos_visible_p): If already at a newline from the
9584 display string before the 'while' loop, don't walk back the glyphs
9585 from it3.glyph_row. Solves assertion violation when the display
9586 string begins with a newline (egg.el). (Bug#11367)
9587
9588 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9589
9590 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9591 Move to simple.el.
9592
9593 2012-05-01 Glenn Morris <rgm@gnu.org>
9594
9595 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9596 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9597 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9598 All were removed before 23.1.
9599
9600 * dispnew.c: Remove HAVE_LIBNCURSES test;
9601 it is always true on relevant platforms.
9602
9603 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9604 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9605
9606 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9607
9608 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9609
9610 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9611 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9612 Remove.
9613
9614 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9615
9616 Do not avoid creating empty evaporating overlays (Bug#9642).
9617 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9618 That is, do not delete an evaporating overlay if it becomes
9619 empty after its bounds are adjusted to fit within its buffer.
9620 This fix caused other problems, and I'm reverting it until we get
9621 to the bottom of them.
9622
9623 2012-04-27 Chong Yidong <cyd@gnu.org>
9624
9625 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9626
9627 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9628
9629 * xdisp.c (pos_visible_p): If the window start position is beyond
9630 ZV, start the display from buffer beginning. Prevents assertion
9631 violation in init_iterator when the minibuffer window is scrolled
9632 via the scroll bar.
9633
9634 * window.c (window_scroll_pixel_based): Likewise.
9635
9636 2012-04-27 Chong Yidong <cyd@gnu.org>
9637
9638 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9639
9640 2012-04-27 Glenn Morris <rgm@gnu.org>
9641
9642 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9643 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9644
9645 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9646
9647 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9648 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9649
9650 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9651
9652 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9653 display element, check also the underlying string or buffer
9654 character. (Bug#11341)
9655
9656 * w32menu.c: Include w32heap.h.
9657 (add_menu_item): If the call to AppendMenuW (via
9658 unicode_append_menu) fails, disable Unicode menus only if we are
9659 running on Windows 9X/Me.
9660
9661 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9662
9663 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9664 (xgetint): Add missing shift for LSB tags.
9665
9666 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9667
9668 * keyboard.c (read_char): Don't wipe echo area for select window
9669 events: These might get delayed via `mouse-autoselect-window'
9670 (Bug#11304).
9671
9672 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9673
9674 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9675 manipulation of :loaded-from data.
9676
9677 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9678
9679 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9680 now a cons (bug#11311).
9681
9682 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9683
9684 Do not create empty overlays with the evaporate property (Bug#9642).
9685 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9686 if it becomes empty after its bounds are adjusted to fit within
9687 its buffer. Without this fix, in a nonempty buffer (let ((o
9688 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9689 yields an empty overlay that has the evaporate property, which is
9690 not supposed to happen.
9691
9692 Fix minor GTK3 problems found by static checking.
9693 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9694 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9695 (struct _EmacsFixedClass, emacs_fixed_get_type):
9696 Move decls here from emacsgtkfixed.h, since they needn't be public.
9697 (emacs_fixed_get_type): Now static.
9698 (emacs_fixed_class_init): Omit unused local.
9699 (emacs_fixed_child_type): Remove; unused.
9700 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9701 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9702 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9703 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9704 (EMACS_FIXED_GET_CLASS): Remove; unused.
9705 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9706
9707 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9708 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9709
9710 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9711
9712 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9713 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9714 (__malloc_size_t, __malloc_ptrdiff_t):
9715 Remove. All uses removed, replaced by the definiens if needed,
9716 since we can assume C89 or better now.
9717 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9718 (protect_malloc_state, align, get_contiguous_space)
9719 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9720 (malloc_atfork_handler_child, malloc_enable_thread)
9721 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9722 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9723 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9724 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9725 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9726 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9727 Define using prototypes, not old style.
9728 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9729 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9730 (align): Don't assume that signed integer overflow wraps around.
9731 Omit unused local var.
9732 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9733 (_free_internal_nolock, memalign, mallochook, reallochook):
9734 Omit no-longer-needed casts.
9735 (valloc): Use getpagesize, not __getpagesize.
9736 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9737 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9738
9739 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9740
9741 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9742
9743 Move functions from C to Lisp. Make non-blocking method calls
9744 the default. Implement further D-Bus standard interfaces.
9745
9746 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9747 (QCdbus_request_name_allow_replacement)
9748 (QCdbus_request_name_replace_existing)
9749 (QCdbus_request_name_do_not_queue)
9750 (QCdbus_request_name_reply_primary_owner)
9751 (QCdbus_request_name_reply_in_queue)
9752 (QCdbus_request_name_reply_exists)
9753 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9754 (QCdbus_registered_serial, QCdbus_registered_method)
9755 (QCdbus_registered_signal): New Lisp objects.
9756 (XD_DEBUG_MESSAGE): Use sizeof.
9757 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9758 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9759 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9760 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9761 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9762 (xd_signature, xd_append_arg): Allow float for integer types.
9763 (xd_get_connection_references): New function.
9764 (xd_get_connection_address): Rename from xd_initialize.
9765 Return cached address.
9766 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9767 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9768 level.
9769 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9770 Return number of refcounts.
9771 (Fdbus_get_unique_name): Make stronger parameter check.
9772 (Fdbus_message_internal): New defun.
9773 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9774 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9775 (Fdbus_send_signal, Fdbus_register_service)
9776 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9777 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9778 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9779 (Vdbus_compiled_version, Vdbus_runtime_version)
9780 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9781 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9782 (Vdbus_message_type_signal): New defvars.
9783 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9784 Adapt docstring.
9785
9786 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9787
9788 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9789 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9790 Do not assume ptrdiff_t is the same width as 'int'.
9791
9792 * alloc.c: Handle unusual debugging option combinations.
9793 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9794 since the two debugging options are incompatible.
9795 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9796 is defined.
9797 (mem_init, mem_insert, mem_insert_fixup):
9798 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9799 (NEED_MEM_INSERT): Remove; no longer needed.
9800
9801 2012-04-22 Leo Liu <sdl.web@gmail.com>
9802
9803 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9804
9805 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9806
9807 * sysdep.c [__FreeBSD__]: Minor cleanups.
9808 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9809 Use Emacs indenting style more consistently. Avoid some casts.
9810 Use 'double' consistently rather than mixing 'float' and 'double'.
9811
9812 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9813
9814 * sysdep.c (list_system_processes, system_process_attributes):
9815 Add implementation for FreeBSD (Bug#5243).
9816
9817 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9818
9819 * lisp.mk (lisp): Update.
9820
9821 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9822
9823 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9824 It is never used otherwise.
9825
9826 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9827
9828 * print.c (print_preprocess): Only check print_depth if print-circle
9829 is nil.
9830 (print_object): Check for cycles even when print-circle is nil and
9831 print-gensym is t, but only check print_depth if print-circle is nil.
9832
9833 2012-04-20 Chong Yidong <cyd@gnu.org>
9834
9835 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9836 set the status to "failed" and ensure that sentinel is run.
9837
9838 2012-04-20 Glenn Morris <rgm@gnu.org>
9839
9840 * process.c (Fset_process_inherit_coding_system_flag)
9841 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9842 (Fmake_network_process, Fmake_serial_process): Doc fix.
9843
9844 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9845
9846 * xdisp.c (string_buffer_position_lim): Limit starting position to
9847 BEGV.
9848 (set_cursor_from_row): If called for a mode-line or header-line
9849 row, return zero immediately.
9850 (try_cursor_movement): If inside continuation line, don't back up
9851 farther than the first row after the header line, if any.
9852 Don't consider the header-line row as "partially visible", even if
9853 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9854
9855 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9856
9857 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9858 (bug#11238).
9859
9860 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9861 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9862
9863 configure: new option --enable-gcc-warnings (Bug#11207)
9864 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9865 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9866 (ALL_CFLAGS): Use new macros rather than old.
9867 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9868 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9869 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9870 -Wunused-result, -Wunused-variable. This should go away once
9871 the Emacs and Gnulib regex code is merged.
9872 (xmalloc, xrealloc): Now static.
9873
9874 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9875
9876 * dired.c (Fsystem_groups): Remove unused local.
9877
9878 2012-04-17 Glenn Morris <rgm@gnu.org>
9879
9880 * dired.c (Fsystem_users): Doc fix.
9881
9882 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9883
9884 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9885 (syms_of_dired): Add them.
9886
9887 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9888
9889 Fix minor alloc.c problems found by static checking.
9890 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9891 New extern decls, to avoid calling undeclared functions.
9892 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9893 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9894 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9895 (NEED_MEM_INSERT): New macro.
9896 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9897 Remove one incorrect comment and fix another.
9898
9899 Fix minor ralloc.c problems found by static checking.
9900 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9901 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9902 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9903 (r_alloc_sbrk): Now static.
9904
9905 Improve ralloc.c interface checking.
9906 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9907 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9908 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9909 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9910 [REL_ALLOC]: ... to here, to check interface.
9911 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9912 Remove decls. This fixes an "It stinks!".
9913
9914 * alloc.c (which_symbols): Fix alignment issue / type clash.
9915
9916 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9917
9918 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9919 (struct Lisp_Misc_Any): Likewise.
9920 (struct Lisp_Free): Likewise.
9921 * alloc.c (union aligned_Lisp_Symbol): Define.
9922 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9923 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9924 (union aligned_Lisp_Misc): Define.
9925 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9926 aligned_Lisp_Misc instead of union Lisp_Misc.
9927 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9928
9929 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9930
9931 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9932 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9933 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9934 * s/netbsd.h, s/sol2-6.h:
9935 Remove definition of GC_MARK_STACK, since the default now works.
9936 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9937 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9938 no longer the default.
9939 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9940
9941 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9942
9943 * lread.c (lisp_file_lexically_bound_p):
9944 Fix hang at ";-*-\n" (bug#11238).
9945
9946 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9947
9948 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9949 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9950
9951 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9952
9953 * nsterm.m (constrainFrameRect): Always constrain when there is only
9954 one screen (Bug#10962).
9955
9956 2012-04-13 Ken Brown <kbrown@cornell.edu>
9957
9958 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9959
9960 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9961
9962 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9963
9964 2012-04-11 Daniel Colascione <dancol@dancol.org>
9965
9966 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9967 against is gone. It's better to use vfork now so that when Cygwin
9968 gains a new, working vfork, we use it automatically (bug#10398).
9969
9970 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9971
9972 * window.c (save_window_save): Obey window-point-insertion-type.
9973
9974 2012-04-11 Glenn Morris <rgm@gnu.org>
9975
9976 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9977
9978 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9979
9980 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9981
9982 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9983
9984 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9985 (force_quit_count): New var.
9986 (handle_interrupt): Use it.
9987
9988 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9989
9990 * w32.c (w32_delayed_load): Record the full path of the library
9991 being loaded (bug#10424).
9992
9993 2012-04-09 Glenn Morris <rgm@gnu.org>
9994
9995 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9996 not just in the obarray, before snarfing them. (Bug#11036)
9997
9998 * Makefile.in ($(leimdir)/leim-list.el):
9999 Pass EMACS rather than BUILT_EMACS.
10000
10001 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10002
10003 * process.c (make_process):
10004 * process.h: Add integer `gnutls_handshakes_tried' member to
10005 process struct.
10006
10007 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10008 Add convenience `GNUTLS_LOG2i' macro.
10009
10010 * gnutls.c (gnutls_log_function2i): Convenience log function.
10011 (emacs_gnutls_read): Use new log functions,
10012 `gnutls_handshakes_tried' process member, and
10013 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10014 attempts per process (connection).
10015
10016 2012-04-09 Chong Yidong <cyd@gnu.org>
10017
10018 * eval.c (Fuser_variable_p, user_variable_p_eh)
10019 (lisp_indirect_variable): Functions deleted.
10020 (Fdefvar): Caller changed.
10021
10022 * callint.c (Finteractive, Fcall_interactively):
10023 * minibuf.c (Fread_variable): Callers changed.
10024
10025 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10026
10027 * xdisp.c (set_cursor_from_row): If the display string appears in
10028 the buffer at position that is closer to point than the position
10029 after the display string, display the cursor on the first glyph of
10030 the display string. Fixes cursor display when a 'display' text
10031 property immediately follows invisible text. (Bug#11094)
10032
10033 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10034
10035 composite.c: use 'double' consistently
10036 * composite.c (get_composition_id): Use 'double' consistently
10037 instead of converting 'float' to 'double' and vice versa; this is
10038 easier to understand and avoids a GCC warning.
10039
10040 2012-04-09 Glenn Morris <rgm@gnu.org>
10041
10042 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10043 preparation for dumping it with emacs. (Bug#4789)
10044 (leimdir): New variable.
10045 ($(leimdir)/leim-list.el): New rule.
10046 (emacs$(EXEEXT)): Depend on leim-list.el.
10047
10048 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10049 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10050 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10051
10052 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10053
10054 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10055 proper alignment.
10056
10057 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10058
10059 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10060 Remove unused local variable.
10061
10062 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10063
10064 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10065 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10066 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10067 objects, as mark_maybe_pointer will catch them otherwise.
10068 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10069 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10070
10071 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10072
10073 Fix typo that broke non-Windows builds.
10074 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10075
10076 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10077
10078 Support building on MS-Windows with libxml2.
10079
10080 * makefile.w32-in (OBJ2): Add xml.$(O).
10081 (GLOBAL_SOURCES): Add xml.c.
10082 ($(BLD)/xml.$(O)): New dependency list.
10083
10084 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10085 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10086 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10087 [!WINDOWSNT]: New macros.
10088 (init_libxml2_functions, libxml2_loaded_p): New functions.
10089 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10090 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10091 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10092 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10093 linked in).
10094 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10095 Call init_libxml2_functions before calling libxml2 functions.
10096 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10097
10098 * emacs.c: Don't include libxml/parser.h.
10099 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10100 xmlCleanupParser directly.
10101
10102 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10103
10104 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10105
10106 * indent.c (Fvertical_motion): If there is a display string at
10107 point, use it.vpos to compute how many lines to backtrack after
10108 move_it_to point. (Bug#11133)
10109
10110 2012-04-06 Eli Zaretskii <eliz@gnu.org>
10111
10112 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10113 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10114 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10115 macros related to unification of CJK characters. For the details,
10116 see the discussion following the message here:
10117 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10118
10119 2012-04-04 Chong Yidong <cyd@gnu.org>
10120
10121 * keyboard.c (Vdelayed_warnings_list): Doc fix.
10122
10123 2012-04-01 Eli Zaretskii <eliz@gnu.org>
10124
10125 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10126 instead of alloca. (Bug#11138)
10127
10128 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10129
10130 * w32menu.c (is_simple_dialog): Properly check lisp types.
10131 (Bug#11141)
10132
10133 2012-03-31 Eli Zaretskii <eliz@gnu.org>
10134
10135 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10136 position we get to after a call to move_it_to fails the
10137 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10138 only if we wind up in a string from display property. (Bug#11063)
10139
10140 * window.c (Fdelete_other_windows_internal): Invalidate the row
10141 and column information about mouse highlight, so that redisplay
10142 restores it after reallocating the glyph matrices. (Bug#7464)
10143
10144 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10145 string comes from a `display' text property, use the buffer
10146 position of that property as if we actually saw that position in
10147 the row's glyphs.
10148 (move_it_by_lines): Remove the assertion that
10149 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10150 violated when there's a before-string at the beginning of a line.
10151 (Bug#11063)
10152
10153 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10154
10155 * xdisp.c (append_space_for_newline): If the default face was
10156 remapped, use the remapped face for the appended newline.
10157 (extend_face_to_end_of_line): Use the remapped default face for
10158 extending the face to the end of the line.
10159 (display_line): Call extend_face_to_end_of_line when the default
10160 face was remapped. (Bug#11068)
10161
10162 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10163
10164 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10165
10166 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10167
10168 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10169
10170 2012-03-27 Glenn Morris <rgm@gnu.org>
10171
10172 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10173 Doc fixes.
10174
10175 2012-03-26 Kenichi Handa <handa@m17n.org>
10176
10177 * dispextern.h (struct glyph): Fix previous change. Change the
10178 bit length of glyphless.ch to 25 (Bug#11082).
10179
10180 2012-03-26 Chong Yidong <cyd@gnu.org>
10181
10182 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10183 (command_loop_1): Use it; inhibit selection update for
10184 handle-select-window too (Bug#8996).
10185
10186 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10187
10188 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10189
10190 2012-03-25 Kenichi Handa <handa@m17n.org>
10191
10192 * dispextern.h (struct glyph): Change the bit length of
10193 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10194
10195 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10196
10197 * s/ms-w32.h (tzname): Include time.h before redirecting to
10198 _tzname. Fixes the MSVC build. (Bug#9960)
10199
10200 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10201
10202 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10203 characters.
10204
10205 * xterm.c (XTread_socket): Only modify handling_signal if
10206 !SYNC_INPUT. (Bug#11080)
10207
10208 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10209
10210 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10211 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10212 when fetching a multibyte character consumes more bytes than
10213 CHAR_BYTES returns, due to unification of CJK characters in
10214 string_char. (Bug#11073)
10215
10216 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10217
10218 * process.c (wait_reading_process_output): Handle pty disconnect
10219 by refraining from sending oneself a SIGCHLD (bug#10933).
10220
10221 2012-03-22 Chong Yidong <cyd@gnu.org>
10222
10223 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10224
10225 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10226 Mark string as coming from a prefix property.
10227 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10228 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10229
10230 2012-03-21 Chong Yidong <cyd@gnu.org>
10231
10232 * xfaces.c (Vface_remapping_alist): Doc fix.
10233
10234 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10235
10236 * w32proc.c (Fw32_set_console_codepage)
10237 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10238 Doc fixes.
10239
10240 2012-03-20 Chong Yidong <cyd@gnu.org>
10241
10242 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10243 to reflect default non-nil value of redisplay-dont-pause.
10244
10245 2012-03-19 Kenichi Handa <handa@m17n.org>
10246
10247 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10248 it fit in a valid range (Bug#11003).
10249
10250 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10251
10252 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10253 that is not from display property, accept the row as a "cursor
10254 row" if one of the string's character has a non-nil `cursor'
10255 property. Fixes cursor positioning when there are newlines in
10256 overlay strings, e.g. in icomplete.el. (Bug#11035)
10257
10258 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10259
10260 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10261
10262 2012-03-12 Chong Yidong <cyd@gnu.org>
10263
10264 * eval.c (inhibit_lisp_code): Rename from
10265 inhibit_window_configuration_change_hook; move from window.c.
10266
10267 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10268 * window.c (run_window_configuration_change_hook)
10269 (syms_of_window): Callers changed.
10270
10271 2012-03-11 Chong Yidong <cyd@gnu.org>
10272
10273 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10274
10275 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10276
10277 2012-03-10 Chong Yidong <cyd@gnu.org>
10278
10279 * frame.c (other_visible_frames): Don't assume the selected frame
10280 is visible (Bug#10955).
10281
10282 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10283
10284 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10285
10286 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10287
10288 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10289 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10290 zero (Bug#10954).
10291
10292 2012-03-03 Glenn Morris <rgm@gnu.org>
10293
10294 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10295
10296 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10297
10298 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10299 position past the first glyph_row that ends at ZV. (Bug#10902)
10300 (redisplay_window, next_element_from_string): Fix typos in
10301 comments.
10302 (redisplay_window): Pass to move_it_vertically the margin in
10303 pixels, not in screen lines.
10304
10305 2012-03-02 Glenn Morris <rgm@gnu.org>
10306
10307 * buffer.c (buffer-list-update-hook): Doc fix.
10308
10309 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10310
10311 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10312 push_it before setting up the iterator for the first overlay
10313 string, even if we have an empty string loaded.
10314 (next_overlay_string): If there's an empty string on the iterator
10315 stack, pop the stack. (Bug#10903)
10316
10317 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10318
10319 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10320 Suggested by Stefan Monnier in
10321 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10322 * alloc.c (widen_to_Lisp_Object): New static function.
10323 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10324 and widening them to Lisp_Objects. This would work even if
10325 USE_LSB_TAG is defined and wide integers are used, which might
10326 happen in a future version of Emacs.
10327
10328 2012-02-25 Chong Yidong <cyd@gnu.org>
10329
10330 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10331 Doc fix.
10332
10333 * xselect.c (Fx_selection_exists_p): Doc fix.
10334 (x_clipboard_manager_save_all): Print an informative message
10335 before saving to clipboard manager.
10336
10337 2012-02-24 Chong Yidong <cyd@gnu.org>
10338
10339 * keyboard.c (process_special_events): Handle all X selection
10340 requests in kbd_buffer, not just the next one (Bug#8869).
10341
10342 2012-02-23 Chong Yidong <cyd@gnu.org>
10343
10344 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10345 call when setting menu-bar-lines and tool-bar-lines parameters.
10346 (unwind_create_frame_1): New helper function.
10347
10348 * window.c (inhibit_window_configuration_change_hook): New var.
10349 (run_window_configuration_change_hook): Obey it.
10350 (syms_of_window): Initialize it.
10351
10352 2012-02-22 Chong Yidong <cyd@gnu.org>
10353
10354 * xterm.c (x_draw_image_relief): Add missing type check for
10355 Vtool_bar_button_margin (Bug#10743).
10356
10357 2012-02-21 Chong Yidong <cyd@gnu.org>
10358
10359 * fileio.c (Vfile_name_handler_alist): Doc fix.
10360
10361 * buffer.c (Fget_file_buffer): Protect against invalid file
10362 handler return value.
10363
10364 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10365
10366 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10367 when computing $valmask.
10368
10369 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10370 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10371 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10372 It's useless in that case, and it can cause problems on hosts
10373 that allocate halves of EMACS_INT values separately.
10374 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10375 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10376 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10377 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10378 it avoids undefined behavior on hosts where shifting right by more
10379 than the word width has undefined behavior.
10380
10381 2012-02-19 Chong Yidong <cyd@gnu.org>
10382
10383 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10384 (Funhandled_file_name_directory, Ffile_name_as_directory)
10385 (Fdirectory_file_name, Fexpand_file_name)
10386 (Fsubstitute_in_file_name): Protect against invalid file handler
10387 return values (Bug#10845).
10388
10389 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10390
10391 * .gdbinit (pitx): Fix incorrect references to fields of the
10392 iterator stack.
10393
10394 2012-02-17 Chong Yidong <cyd@gnu.org>
10395
10396 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10397
10398 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10399
10400 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10401 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10402
10403 2012-02-15 Chong Yidong <cyd@gnu.org>
10404
10405 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10406 marked as special. Also, starting docstrings with * is obsolete.
10407
10408 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10409
10410 * gnutls.c (emacs_gnutls_write): Fix last change.
10411
10412 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10413
10414 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10415 send_process.
10416
10417 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10418
10419 * keymap.c (Fsingle_key_description): Handle char ranges.
10420
10421 2012-02-12 Chong Yidong <cyd@gnu.org>
10422
10423 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10424 as that creates a dangerous corner case.
10425
10426 * window.c (Fdelete_window_internal): Invalidate the mouse
10427 highlight (Bug#9904).
10428
10429 2012-02-12 Glenn Morris <rgm@gnu.org>
10430
10431 * xselect.c (Fx_own_selection_internal)
10432 (Fx_get_selection_internal, Fx_disown_selection_internal)
10433 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10434 * nsselect.m (Fx_own_selection_internal)
10435 (Fx_disown_selection_internal, Fx_selection_exists_p)
10436 (Fx_selection_owner_p, Fx_get_selection_internal):
10437 Sync docs and argument specs with the xselect.c versions.
10438
10439 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10440
10441 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10442
10443 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10444
10445 * w32select.c (Fx_selection_exists_p): Sync doc string and
10446 argument list with xselect.c. (Bug#10783)
10447
10448 * w16select.c (Fx_selection_exists_p): Sync doc string and
10449 argument list with xselect.c. (Bug#10783)
10450
10451 2012-02-10 Glenn Morris <rgm@gnu.org>
10452
10453 * fns.c (Fsecure_hash): Doc fix.
10454
10455 2012-02-09 Kenichi Handa <handa@m17n.org>
10456
10457 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10458
10459 2012-02-07 Chong Yidong <cyd@gnu.org>
10460
10461 * buffer.c (Fbuffer_local_variables)
10462 (buffer_lisp_local_variables): Handle unbound vars correctly;
10463 don't let Qunbound leak into Lisp.
10464
10465 2012-02-07 Glenn Morris <rgm@gnu.org>
10466
10467 * image.c (Fimagemagick_types): Doc fix.
10468
10469 * image.c (imagemagick-render-type): Change it from a lisp object
10470 to an integer. Move the doc here from the lisp manual.
10471 Treat all values not equal to 0 the same.
10472
10473 2012-02-06 Chong Yidong <cyd@gnu.org>
10474
10475 * doc.c (store_function_docstring): Avoid applying docstring of
10476 alias to base function (Bug#2603).
10477
10478 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10479
10480 * .gdbinit (pp1, pv1): Remove redundant defines.
10481 (pr): Use pp.
10482
10483 2012-02-04 Chong Yidong <cyd@gnu.org>
10484
10485 * nsterm.m: Declare a global (Bug#10694).
10486
10487 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10488
10489 * w32.c (get_emacs_configuration_options):
10490 Include --enable-checking, if specified, in the return value.
10491
10492 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10493
10494 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10495 after rounding frame sizes. (Bug#9723)
10496
10497 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10498
10499 * keyboard.c (adjust_point_for_property): Don't position point
10500 before BEGV. (Bug#10696)
10501
10502 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10503
10504 Handle overflow when computing char display width (Bug#9496).
10505 * character.c (char_width): Return EMACS_INT, not int.
10506 (char_width, c_string_width): Check for overflow when
10507 computing the width; this is possible now that individual
10508 characters can have unbounded width. Problem introduced
10509 by merge from Emacs 23 on 2012-01-19.
10510
10511 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10512
10513 * dbusbind.c (Fdbus_register_method): Mention the return value
10514 :ignore in the docstring.
10515
10516 2012-02-02 Glenn Morris <rgm@gnu.org>
10517
10518 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10519
10520 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10521 Unconditionally set to t. (Bug#10673)
10522 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10523 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10524 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10525
10526 2012-02-02 Kenichi Handa <handa@m17n.org>
10527
10528 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10529 0, do not call append_composite_glyph.
10530
10531 2012-02-02 Kenichi Handa <handa@m17n.org>
10532
10533 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10534 NULL (Bug#6988).
10535 (x_produce_glyphs): If the component of a composition is a null
10536 string, set it->pixel_width to 1 to avoid zero-width glyph.
10537
10538 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10539
10540 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10541 first 2 arguments are identical. This makes inserting large
10542 output from a subprocess an order of magnitude faster on
10543 MS-Windows, where all sbrk'ed memory is always contiguous.
10544
10545 2012-01-31 Glenn Morris <rgm@gnu.org>
10546
10547 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10548 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10549 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10550
10551 2012-01-29 Glenn Morris <rgm@gnu.org>
10552
10553 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10554
10555 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10556
10557 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10558
10559 2012-01-28 Chong Yidong <cyd@gnu.org>
10560
10561 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10562
10563 2012-01-26 Chong Yidong <cyd@gnu.org>
10564
10565 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10566
10567 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10568 repeat counts (Bug#10507).
10569
10570 2012-01-26 Glenn Morris <rgm@gnu.org>
10571
10572 * lread.c (syms_of_lread): Doc fix.
10573
10574 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10575
10576 * coding.c (encode_designation_at_bol): Change return value to
10577 EMACS_INT.
10578
10579 2012-01-25 Chong Yidong <cyd@gnu.org>
10580
10581 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10582
10583 2012-01-21 Chong Yidong <cyd@gnu.org>
10584
10585 * floatfns.c (Fcopysign): Make the second argument non-optional,
10586 since nil is not allowed anyway.
10587
10588 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10589
10590 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10591 (send_process): Likewise.
10592
10593 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10594
10595 * window.c (save_window_save, Fcurrent_window_configuration)
10596 (Vwindow_persistent_parameters): Do not use Qstate.
10597 Rewrite doc-strings.
10598
10599 2012-01-19 Kenichi Handa <handa@m17n.org>
10600
10601 * character.c (char_width): New function.
10602 (Fchar_width, c_string_width, lisp_string_width):
10603 Use char_width (Bug#9496).
10604
10605 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10606
10607 * window.c (Vwindow_persistent_parameters): New variable.
10608 (Fset_window_configuration, save_window_save): Handle persistent
10609 window parameters.
10610
10611 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10612
10613 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10614 thrashing the stack of the thread. (Bug#9087)
10615
10616 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10617
10618 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10619
10620 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10621
10622 * xdisp.c (rows_from_pos_range): Handle the case where the
10623 highlight ends on a newline. (Bug#10464)
10624 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10625 he end column for display of highlight that ends on a newline
10626 before a R2L line.
10627
10628 2012-01-11 Glenn Morris <rgm@gnu.org>
10629
10630 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10631 from load-path also when installation-directory is nil. (Bug#10208)
10632
10633 2012-01-10 Glenn Morris <rgm@gnu.org>
10634
10635 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10636
10637 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10638 Update template values to be closer to their typical values these days.
10639
10640 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10641
10642 * xdisp.c (rows_from_pos_range): Accept additional argument
10643 DISP_STRING, and accept any glyph in a row whose object is that
10644 string as eligible for mouse highlight. Fixes mouse highlight of
10645 display strings from overlays. (Bug#10464)
10646
10647 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10648
10649 emacs: fix an auto-save permissions race condition (Bug#10400)
10650 * fileio.c (auto_saving_dir_umask): New static var.
10651 (Fmake_directory_internal): Use it.
10652 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10653 creating the directory. The old code temporarily assigns
10654 too-generous permissions to the directory.
10655 (do_auto_save_eh): Clear it.
10656 (Fdo_auto_save): Catch all errors, not just file errors, so
10657 that the var is always cleared.
10658
10659 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10660
10661 * search.c (scan_buffer): Pass character positions to
10662 know_region_cache, not byte positions. (Bug#6540)
10663
10664 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10665
10666 * w32.c (sys_rename): Report EXDEV when rename of a directory
10667 fails because the target is on another logical disk. (Bug#10284)
10668
10669 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10670
10671 * xterm.c (x_embed_request_focus): New function.
10672
10673 * xterm.h: Add prototype.
10674
10675 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10676
10677 2012-01-05 Glenn Morris <rgm@gnu.org>
10678
10679 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10680
10681 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10682
10683 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10684 Load gnutls_transport_set_lowat only if GnuTLS version is below
10685 2.11.1.
10686 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10687 GnuTLS versions below 2.11.1.
10688
10689 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10690
10691 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10692 to the doc string advising against its use for altering the way
10693 windows are scrolled.
10694
10695 2011-12-28 Kenichi Handa <handa@m17n.org>
10696
10697 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10698 coding-system ASCII compatible only when it does not produce BOM
10699 on encoding (Bug#10383).
10700
10701 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10702
10703 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10704 can scroll.
10705 (create_and_show_popup_menu): Always use menu_position_func for
10706 Gtk3 (Bug#10361).
10707
10708 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10709
10710 * callint.c (Fcall_interactively): Don't truncate prompt string.
10711
10712 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10713
10714 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10715 property that ends at ZV, so that the bidi iteration could be
10716 resumed from there (after widening). (Bug#10360)
10717
10718 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10719
10720 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10721
10722 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10723
10724 * nsterm.m (x_free_frame_resources):
10725 Release f->output_data.ns->miniimage.
10726 (ns_index_color): Fix indentation. Do not retain
10727 color_table->colors[i].
10728
10729 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10730 before returning.
10731
10732 * nsfns.m (x_set_background_color): Assign return value from
10733 ns_index_color to face-background instead of NSColor*.
10734 (ns_implicitly_set_icon_type): Fix indentation.
10735 Change assignment in for loop to comparison.
10736
10737 * emacs.c (ns_pool): New variable.
10738 (main): Assign ns_pool.
10739 (Fkill_emacs): Call ns_release_autorelease_pool.
10740
10741 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10742 autorelease fdesc, release fdAttrs and tdict.
10743 (ns_get_covering_families): Release charset.
10744 (ns_findfonts): Release NSFontDescriptor created with new.
10745 (ns_uni_to_glyphs): Fix indentation.
10746 (setString): Release attrStr before assigning new value.
10747
10748 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10749
10750 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10751 and NS_IMPL_COCOA.
10752 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10753 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10754
10755 2011-12-18 David Reitter <reitter@cmu.edu>
10756
10757 * nsterm.m (ns_term_init): Subscribe for notifications
10758 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10759 to method trackingNotification in EmacsMenu.
10760
10761 * nsmenu.m (trackingMenu): New variable.
10762 (trackingNotification): New method (from Aquamacs).
10763 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10764 from Aquamacs (Bug#7030).
10765
10766 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10767
10768 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10769 (symbol_to_nsstring): Fix indentation.
10770 (ns_symbol_to_pb): New function.
10771 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10772 (Fns_rotate_cut_buffers_internal): Remove.
10773 (Fns_store_selection_internal): Rename from
10774 Fns_store_cut_buffer_internal.
10775 (ns_get_foreign_selection, Fx_own_selection_internal)
10776 (Fx_disown_selection_internal, Fx_selection_exists_p)
10777 (Fns_get_selection_internal, Fns_store_selection_internal):
10778 Use ns_symbol_to_pb and check if return value is nil.
10779 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10780 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10781 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10782 renamed to Sns_store_selection_internal.
10783 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10784 and remove this function.
10785 (ns_handle_selection_clear): Remove, never used.
10786 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10787 here.
10788
10789 2011-12-17 Ken Brown <kbrown@cornell.edu>
10790
10791 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10792 GID is unknown (Bug#10257).
10793
10794 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10795
10796 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10797 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10798 which caused a build failure on GNU/Linux IA-64. This problem was
10799 introduced by my 2011-10-07 patch.
10800
10801 2011-12-15 Juri Linkov <juri@jurta.org>
10802
10803 * image.c (imagemagick_error): New function. (Bug#10112)
10804 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10805 Use `imagemagick_error' where ImageMagick functions return
10806 `MagickFalse'.
10807 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10808 proper order.
10809
10810 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10811
10812 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10813 fill background (Bug#8992).
10814
10815 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10816
10817 * window.c (Vwindow_combination_resize)
10818 (Vwindow_combination_limit): Use t instead of non-nil in
10819 doc-strings.
10820 (Vrecenter_redisplay): Add first sentence of doc-string on
10821 separate line.
10822 (Frecenter): Fix doc-string typo.
10823
10824 2011-12-11 Kenichi Handa <handa@m17n.org>
10825
10826 * coding.c (Funencodable_char_position): Pay attention to the
10827 buffer text relocation (Bug#9389).
10828
10829 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10830
10831 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10832 gtk_init (Bug#10100).
10833
10834 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10835
10836 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10837 IT->string is nil. (Bug#10263)
10838
10839 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10840
10841 * nsterm.h (x_free_frame_resources): Declare.
10842
10843 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10844 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10845
10846 * nsterm.h (ns_get_defaults_value): Declare.
10847
10848 * nsterm.m (ns_default): Call ns_get_defaults_value.
10849
10850 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10851
10852 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10853 (Bug#10170)
10854
10855 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10856
10857 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10858 that where the value of an _OBJC_* symbol points to is in the .bss
10859 section (Bug#10240).
10860
10861 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10862
10863 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10864 after the loop to call ccl_driver at least once (Bug#8619).
10865
10866 2011-12-08 Kenichi Handa <handa@m17n.org>
10867
10868 * ftfont.c (get_adstyle_property): Fix previous change
10869 (Bug#10233).
10870
10871 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10872
10873 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10874 dirs from the default value of EMACSLOADPATH (bug#10208).
10875
10876 2011-12-07 Glenn Morris <rgm@gnu.org>
10877
10878 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10879 installation and source directories as well. (Bug#10208)
10880
10881 2011-12-06 Chong Yidong <cyd@gnu.org>
10882
10883 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10884
10885 2011-12-06 Glenn Morris <rgm@gnu.org>
10886
10887 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10888 as an error, not just -1. (Bug#10217)
10889
10890 2011-12-05 Chong Yidong <cyd@gnu.org>
10891
10892 * keyboard.c (process_special_events): New function.
10893 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10894
10895 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10896
10897 * coding.c (encode_designation_at_bol): Don't use uninitialized
10898 local variable (Bug#9318).
10899
10900 2011-12-05 Kenichi Handa <handa@m17n.org>
10901
10902 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10903 return Qnil (Bug#8046, Bug#10193).
10904
10905 2011-12-05 Kenichi Handa <handa@m17n.org>
10906
10907 * coding.c (encode_designation_at_bol): New args charbuf_end and
10908 dst. Return the number of produced bytes. Callers changed.
10909 (coding_set_source): Return how many bytes coding->source was
10910 relocated.
10911 (coding_set_destination): Return how many bytes
10912 coding->destination was relocated.
10913 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10914 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10915
10916 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10917
10918 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10919 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10920 macro (Bug#9318).
10921
10922 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10923
10924 The following changes are to fix Bug#9318.
10925
10926 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10927 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10928 (encode_coding_iso_2022, encode_coding_sjis)
10929 (encode_coding_big5, encode_coding_charset): Use the above macros.
10930
10931 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10932
10933 * lisp.h (process_quit_flag): Fix external declaration.
10934
10935 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10936
10937 Don't macro-inline non-performance-critical code.
10938 * eval.c (process_quit_flag): New function.
10939 * lisp.h (QUIT): Use it.
10940
10941 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10942
10943 * nsfns.m (get_geometry_from_preferences): New function.
10944 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10945
10946 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10947
10948 * emacs.c (Qkill_emacs): Define.
10949 (syms_of_emacs): Initialize it.
10950 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10951 Qquit_flag to `kill-emacs' instead.
10952 (quit_throw_to_read_char): Add parameter `from_signal'.
10953 All callers changed. Call Fkill_emacs if requested and safe.
10954 * lisp.h (QUIT): Call Fkill_emacs if requested.
10955
10956 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10957
10958 * widget.c (update_wm_hints): Return if wmshell is null.
10959 (widget_update_wm_size_hints): New function.
10960
10961 * widget.h (widget_update_wm_size_hints): Declare.
10962
10963 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10964 widget_update_wm_size_hints (Bug#10104).
10965
10966 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10967
10968 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10969 before a newline, prepare the bidi iterator for consuming the
10970 newline, and keep the current paragraph direction. (Bug#10183)
10971 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10972
10973 2011-12-02 Juri Linkov <juri@jurta.org>
10974
10975 * search.c (Fword_search_regexp): New Lisp function created from
10976 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10977 (Fword_search_backward, Fword_search_forward)
10978 (Fword_search_backward_lax, Fword_search_forward_lax):
10979 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10980 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10981
10982 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10983
10984 * fileio.c (Finsert_file_contents): Move after-change-function call
10985 to before the "handled:" label, since all "goto handled" appear in
10986 cases where the *-change-functions have already been properly called
10987 (bug#10117).
10988
10989 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10990
10991 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10992 waiting for input. (Bug#10169)
10993
10994 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10995
10996 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10997 verifies glyph row's hash code--we have just reallocated the
10998 glyphs, so their contents can be complete garbage. (Bug#10164)
10999
11000 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
11001
11002 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11003
11004 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11005
11006 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11007 attributes are tested _before_ calling verify_row_hash, to protect
11008 against GCC re-ordering of the tests. (Bug#10164)
11009
11010 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11011
11012 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11013
11014 * xterm.c (handle_one_xevent): Only set async_visible and friends
11015 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11016 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11017 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11018
11019 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11020
11021 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11022 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11023 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11024 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11025 All uses changed to use GCPRO1 etc.
11026 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11027 Revert to old implementation (i.e., before 2011-03-11).
11028
11029 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11030
11031 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11032 of scroll runs so as to avoid assigning disabled bogus rows and
11033 unnecessary graphics copy operations.
11034
11035 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11036
11037 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11038 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11039 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11040 (malloc, free, realloc, calloc): Redirect to e_* only when
11041 compiling Emacs.
11042
11043 * lisp.h (GCTYPEBITS): Move before first use.
11044 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11045 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11046 this macro definition.
11047
11048 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11049 _MSC_VER.
11050
11051 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11052
11053 * gtkutil.c (xg_create_frame_widgets):
11054 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11055 present with Gtk+ 2.0.
11056
11057 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11058
11059 * fileio.c (Finsert_file_contents): Undo previous change; see
11060 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11061
11062 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11063
11064 Rename locals to avoid shadowing.
11065 * fileio.c (Finsert_file_contents):
11066 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11067 * process.c (wait_reading_process_output):
11068 Rename inner 'proc' to 'p' to avoid shadowing.
11069 Indent for consistency with usual Emacs style.
11070
11071 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11072
11073 * xdisp.c (redisplay_window): If cursor row is not fully visible
11074 after recentering, and scroll-conservatively is set to a large
11075 number, scroll window by a few more lines to make the cursor fully
11076 visible and out of scroll-margin. (Bug#10105)
11077 (start_display): Don't move to the next line if the display should
11078 start at a newline that is part of a display vector or an overlay
11079 string. (Bug#10119)
11080
11081 2011-11-24 Juri Linkov <juri@jurta.org>
11082
11083 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11084 after the `MagickPingImage' call. (Bug#10112)
11085
11086 2011-11-23 Chong Yidong <cyd@gnu.org>
11087
11088 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11089
11090 2011-11-23 Martin Rudalics <rudalics@gmx.at>
11091
11092 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11093 making another buffer current. (Bug#10114)
11094
11095 2011-11-23 Glenn Morris <rgm@gnu.org>
11096
11097 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11098
11099 2011-11-23 Chong Yidong <cyd@gnu.org>
11100
11101 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11102 using it (Bug#5984).
11103
11104 2011-11-22 Eli Zaretskii <eliz@gnu.org>
11105
11106 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11107 and header-lines, as they don't have one computed for them.
11108 (Bug#10098)
11109
11110 * .gdbinit (prow): Make displayed values more self-explaining.
11111 Add row's hash code.
11112
11113 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11114
11115 * process.c (wait_reading_process_output): Fix asynchrounous
11116 GnuTLS socket handling on some versions of the GnuTLS library.
11117 (wait_reading_process_output): Add comment and URL.
11118
11119 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
11120
11121 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11122
11123 2011-11-21 Chong Yidong <cyd@gnu.org>
11124
11125 * window.c (Fnext_window, Fprevious_window): Doc fix.
11126
11127 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11128
11129 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11130
11131 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11132
11133 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11134
11135 2011-11-20 Martin Rudalics <rudalics@gmx.at>
11136
11137 * window.c (Fset_window_combination_limit): Rename argument
11138 STATUS to LIMIT.
11139 (Vwindow_combination_limit): Remove "status" from doc-string.
11140
11141 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11142
11143 * m/ibms390.h: Remove.
11144 * m/ibms390x.h: Don't include "ibms390.h".
11145
11146 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11147
11148 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11149 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11150
11151 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11152
11153 * casetab.c (Fset_case_table):
11154 * charset.c (Fcharset_after): Fix typos.
11155
11156 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11157
11158 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11159 Otherwise, valgrind does not work on some platforms.
11160 Problem reported by Andreas Schwab in
11161 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11162 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11163 is set, removing the need for VIRT_ADDRESS_VARIES.
11164 (PURE_P): Use a more-efficient implementation that needs just one
11165 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11166 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11167 to 4 (xorl, subq, cmpq, setbe).
11168 * alloc.c (pure): Always extern now, since that's the
11169 VIRT_ADDR_VARIES behavior.
11170 (PURE_POINTER_P): Use a single comparison, not two, for
11171 consistency with the new puresize.h.
11172 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11173 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11174 Remove VIRT_ADDR_VARIES no longer needed.
11175
11176 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11177
11178 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11179 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11180 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11181 behave as if the cursor position were at the window margin.
11182
11183 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11184 and the cursor position is out of bounds, behave as if the cursor
11185 position were at the window margin. (Bug#10075)
11186
11187 2011-11-18 Chong Yidong <cyd@gnu.org>
11188
11189 * window.c (Fwindow_combination_limit): Make first argument
11190 non-optional, since it is meaningless for live windows like the
11191 selected window.
11192
11193 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11194
11195 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11196
11197 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11198
11199 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11200 (graft_intervals_into_buffer): Simplify.
11201
11202 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11203
11204 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11205 hash values of the two rows.
11206 (copy_row_except_pointers): Preserve the used[] arrays and the
11207 hash values of the two rows. (Bug#10035)
11208 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11209
11210 * xdisp.c (row_hash): New function, body extracted from
11211 compute_line_metrics.
11212 (compute_line_metrics): Call row_hash, instead of computing the
11213 hash code inline.
11214
11215 * dispnew.c (verify_row_hash): Call row_hash for computing the
11216 hash code of a row, instead of duplicating code from xdisp.c.
11217
11218 * dispextern.h (row_hash): Add prototype.
11219
11220 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11221
11222 * frame.c (delete_frame): Don't delete the terminal when the last
11223 X frame is closed if emacs is built with GTK toolkit.
11224
11225 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11226
11227 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11228
11229 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11230
11231 * window.c (Vwindow_splits): Rename to
11232 Vwindow_combination_resize. Suggested by Juri Linkov.
11233 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11234 of Vwindow_splits.
11235
11236 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11237
11238 * nsfns.m (Fns_font_name):
11239 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11240
11241 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11242
11243 * window.h (window): Rename slot "nest" to "combination_limit".
11244 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11245 (Fset_window_nest): Rename to Fset_window_combination_limit.
11246 (Vwindow_nest): Rename to Vwindow_combination_limit.
11247 (recombine_windows, make_parent_window, make_window)
11248 (Fsplit_window_internal, saved_window)
11249 (Fset_window_configuration, save_window_save): Rename all
11250 occurrences of window_nest to window_combination_limit.
11251
11252 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11253
11254 * image.c (imagemagick_load_image): Fix typo.
11255
11256 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11257
11258 * xdisp.c (display_line): Move the call to
11259 highlight_trailing_whitespace before the call to
11260 compute_line_metrics, since the latter needs to see the final
11261 faces of all the glyphs to compute ROW's hash value.
11262 Fixes assertion violations in row_equal_p. (Bug#10035)
11263
11264 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11265
11266 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11267 just return (bug#10044).
11268
11269 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11270
11271 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11272 with user-defined heap size. Bump the default size of the temacs
11273 heap to 27MB, to avoid memory warning when running temacs.
11274 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11275
11276 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11277 current_matrix and desired_matrix. (Bug#9990)
11278 (verify_row_hash) [XASSERTS]: New function.
11279 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11280 that the hash value of glyph rows is correct.
11281
11282 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11283
11284 * window.h (window): Remove splits slot.
11285 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11286 (Fdelete_other_windows_internal, make_parent_window)
11287 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11288 (Fset_window_configuration, save_window_save): Don't deal with
11289 split status of windows.
11290 (saved_window): Remove splits slot.
11291 (Vwindow_splits): Rewrite doc-string.
11292
11293 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11294
11295 * xfns.c (unwind_create_frame):
11296 * nsfns.m (unwind_create_frame):
11297 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11298 Vframe_list (Bug#9999).
11299
11300 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11301
11302 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11303
11304 2011-11-11 Kenichi Handa <handa@m17n.org>
11305
11306 * callproc.c (Fcall_process): Set the member dst_multibyte of
11307 process_coding.
11308
11309 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11310
11311 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11312 avoid a crash (bug#9496).
11313
11314 2011-11-09 Chong Yidong <cyd@gnu.org>
11315
11316 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11317 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11318
11319 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11320
11321 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11322
11323 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11324
11325 Avoid some portability problems by eschewing 'extern inline' functions.
11326 The trivial performance wins aren't worth the portability hassles; see
11327 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11328 et seq.
11329 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11330 (window_box_width, window_box_left, window_box_left_offset)
11331 (window_box_right, window_box_right_offset): Undo previous change,
11332 by removing the "extern"s.
11333 * intervals.c (adjust_intervals_for_insertion)
11334 (adjust_intervals_for_deletion): Undo previous change,
11335 making these static again.
11336 (offset_intervals, temp_set_point_both, temp_set_point)
11337 (copy_intervals_to_string): No longer inline.
11338 * xdisp.c (window_text_bottom_y, window_box_width)
11339 (window_box_height, window_box_left_offset)
11340 (window_box_right_offset, window_box_left, window_box_right)
11341 (window_box): No longer inline.
11342
11343 2011-11-08 Chong Yidong <cyd@gnu.org>
11344
11345 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11346 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11347 Signal an error if not a live window.
11348 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11349 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11350
11351 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11352
11353 * lisp.h (syms_of_abbrev): Remove declaration.
11354 Reported by CHENG Gao <chenggao@royau.me>.
11355
11356 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11357
11358 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11359 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11360 of temacs in GUI mode.
11361
11362 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11363
11364 * window.h: Declare delete_all_child_windows instead of
11365 delete_all_subwindows.
11366 * window.c (Fwindow_nest, Fset_window_nest)
11367 (Fset_window_new_total, Fset_window_new_normal)
11368 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11369 (delete_all_subwindows): Rename to delete_all_child_windows.
11370 (Fdelete_other_windows_internal, Fset_window_configuration):
11371 Call delete_all_child_windows instead of delete_all_subwindows.
11372 * frame.c (delete_frame): Call delete_all_child_windows instead
11373 of delete_all_subwindows.
11374
11375 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11376
11377 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11378 This is also needed for porting to any host where GC_MARK_STACK is
11379 not GC_MAKE_GCPROS_NOOPS.
11380 (which_symbols): Use it.
11381
11382 2011-11-07 Kenichi Handa <handa@m17n.org>
11383
11384 * coding.c (coding_set_destination): Check coding->src_pos only
11385 when coding->src_object is a buffer (bug#9910).
11386
11387 * process.c (send_process): Set the member src_multibyte of coding
11388 to 0 (bug#9911) when sending a unibyte text.
11389
11390 * callproc.c (Fcall_process): Set the member src_multibyte of
11391 process_coding to 0 (bug#9912).
11392
11393 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11394
11395 * xmenu.c (cleanup_widget_value_tree): New function.
11396 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11397 calling free_menubar_widget_value_tree directly (Bug#9830).
11398
11399 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11400
11401 Fix some portability problems with 'inline'.
11402 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11403 (window_box_width, window_box_left, window_box_left_offset)
11404 (window_box_right, window_box_right_offset): Declare extern.
11405 Otherwise, these inline functions do not conform to C99 and
11406 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11407 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11408 * intervals.c (adjust_intervals_for_insertion)
11409 (adjust_intervals_for_deletion): Now extern, because otherwise the
11410 extern inline functions 'offset_intervals' couldn't refer to it.
11411 (static_offset_intervals): Remove.
11412 (offset_intervals): Rewrite using the old contents of
11413 static_offset_intervals. The old version didn't conform to C99
11414 because an extern inline function contained a reference to an
11415 identifier with static linkage.
11416
11417 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11418
11419 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11420 GC.
11421
11422 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11423
11424 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11425 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11426 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11427 return Qleft_to_right.
11428
11429 2011-11-06 Chong Yidong <cyd@gnu.org>
11430
11431 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11432 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11433 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11434 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11435 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11436 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11437 (Fwindow_vscroll): Doc fix.
11438 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11439 argument, since it makes no sense to pass a live window and for
11440 consistency with window-child.
11441
11442 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11443
11444 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11445 support MSVC.
11446
11447 2011-11-05 Jason Rumney <jasonr@gnu.org>
11448
11449 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11450 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11451 fonts (Bug#6029).
11452 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11453 bitwise arithmetic preventing use of unicode-sip and non-truetype
11454 opentype fonts.
11455
11456 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11457
11458 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11459 "emacs"-only part.
11460
11461 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11462 initialization code to keep similarity to xfns.c after changes
11463 from 2011-11-05.
11464
11465 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11466
11467 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11468 (unwind_create_frame): New function (Bug#9943).
11469 (Fx_create_frame): Restructure code to be more similar to the one in
11470 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11471 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11472 Move terminal->reference_count++ just before making the frame official
11473 (Bug#9943).
11474
11475 * nsterm.m (x_free_frame_resources): New function.
11476 (x_destroy_window): Move code to x_free_frame_resources.
11477
11478 * xfns.c (unwind_create_frame): Fix comment.
11479 (Fx_create_frame, x_create_tip_frame):
11480 Move terminal->reference_count++ just before making the frame
11481 official. Move initialization of image_cache_refcount and
11482 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11483
11484 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11485
11486 Support MSVC build with newer versions of Visual Studio.
11487 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11488 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11489 nt/gmake.defs.
11490
11491 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11492 which are not supported by MSVC.
11493 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11494 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11495 bitfields.
11496 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11497 types in bitfields.
11498 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11499
11500 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11501
11502 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11503
11504 Support MSVC build with newer versions of Visual Studio.
11505 * w32.c: Don't include w32api.h for MSVC.
11506 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11507
11508 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11509 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11510 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11511 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11512 e_* cousins.
11513 (alloca) [_MSC_VER]: Define to _alloca.
11514
11515 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11516
11517 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11518
11519 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11520
11521 * xdisp.c (note_mouse_highlight): If either of
11522 previous/next-single-property-change returns nil, treat that as
11523 the beginning or the end of the buffer. (Bug#9955)
11524
11525 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11526
11527 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11528 label is not null (Bug#9951).
11529 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11530 may be NULL.
11531
11532 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11533
11534 * window.c (Fwindow_body_size): Mention in the doc string that the
11535 return value is in frame's canonical units. (Bug#9949)
11536
11537 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11538
11539 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11540
11541 * w32fns.c (unwind_create_frame): If needed, free the glyph
11542 matrices of the partially constructed frame. (Bug#9943)
11543 * xfns.c (unwind_create_frame): Likewise.
11544
11545 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11546
11547 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11548 Don't stop backward scan on the continuation glyph, even though
11549 its CHARPOS is positive.
11550 (mouse_face_from_buffer_pos, note_mouse_highlight):
11551 Rename cover_string to disp_string.
11552
11553 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11554
11555 * window.c (temp_output_buffer_show): Don't use
11556 Vtemp_buffer_show_specifiers.
11557 (Vtemp_buffer_show_specifiers): Remove unused variable.
11558
11559 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11560
11561 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11562 past the beginning of the current glyph matrix.
11563
11564 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11565
11566 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11567 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11568 HAVE_GTK3 (Bug#9869).
11569
11570 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11571 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11572
11573 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11574
11575 * xterm.c: Declare x_handle_net_wm_state to return int.
11576 (handle_one_xevent): Check if we are iconified but don't have
11577 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11578 (get_current_wm_state): Return non-zero if not hidden,
11579 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11580 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11581 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11582 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11583
11584 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11585
11586 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11587 so that this new function doesn't get optimized away by a
11588 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11589
11590 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11591
11592 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11593
11594 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11595
11596 Fix the `xbytecode' command.
11597 * .gdbinit (xprintbytestr): New command.
11598 (xwhichsymbols): Rename from `which'; all callers changed.
11599 (xbytecode): Print the byte-code string as well.
11600
11601 2011-10-29 Kim Storm <storm@cua.dk>
11602
11603 * alloc.c (which_symbols): New function.
11604
11605 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11606
11607 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11608 line. (Bug#9903)
11609
11610 2011-10-29 Glenn Morris <rgm@gnu.org>
11611
11612 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11613 Not clear what it was for, and it causes various bugs. (Bug#9839)
11614
11615 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11616
11617 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11618 possible random value that matches one of those tested as
11619 condition to clear the mouse face.
11620
11621 2011-10-28 Chong Yidong <cyd@gnu.org>
11622
11623 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11624
11625 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11626
11627 * window.c (make_window): Initialize phys_cursor_on_p.
11628
11629 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11630
11631 * lisp.h (struct Lisp_Symbol): Update comments.
11632
11633 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11634
11635 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11636
11637 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11638
11639 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11640 <oslsachem@gmail.com> for helping to debug this.
11641
11642 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11643 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11644 (g_b_init_get_glyph_outline_w): New static variables.
11645 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11646 (GetGlyphOutlineW_Proc): New typedefs.
11647 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11648 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11649 New functions.
11650 (w32font_open_internal, compute_metrics):
11651 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11652 instead of calling the "wide" APIs directly.
11653
11654 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11655
11656 * w32.h (syms_of_w32font): Add prototype.
11657
11658 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11659
11660 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11661 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11662 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11663 (Fmove_to_window_line): Doc fix.
11664
11665 2011-10-27 Chong Yidong <cyd@gnu.org>
11666
11667 * process.c (make_process): Set gnutls_state to NULL.
11668
11669 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11670 non-NULL, regardless of GNUTLS_INITSTAGE.
11671 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11672 an error. Set process slots as soon as we allocate them.
11673
11674 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11675
11676 2011-10-27 Chong Yidong <cyd@gnu.org>
11677
11678 * gnutls.c (emacs_gnutls_deinit): New function.
11679 Deallocate credentials structures as well as calling gnutls_deinit.
11680 (Fgnutls_deinit, Fgnutls_boot): Use it.
11681
11682 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11683 (deactivate_process): Call emacs_gnutls_deinit.
11684
11685 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11686
11687 * image.c (x_create_x_image_and_pixmap):
11688 * w32.c (sys_rename, w32_delayed_load):
11689 * w32font.c (fill_in_logfont):
11690 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11691
11692 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11693
11694 * w32fns.c (w32_default_color_map): New function,
11695 extracted from Fw32_default_color_map.
11696 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11697
11698 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11699
11700 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11701
11702 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11703
11704 * keyboard.c (test_undefined): New function (bug#9751).
11705 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11706
11707 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11708
11709 * sysdep.c (init_sys_modes): Fix the check for the controlling
11710 terminal (Bug#6649).
11711
11712 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11713
11714 * dispextern.h (struct bidi_it): New member next_en_type.
11715
11716 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11717 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11718 current character, check also for next_en_type being WEAK_EN.
11719 (bidi_resolve_weak): Don't enter the expensive loop if the current
11720 position is before next_en_pos. Record the bidi type of the first
11721 non-ET, non-BN character we find, in addition to its position.
11722 (bidi_level_of_next_char): Invalidate next_en_type when
11723 next_en_pos is over-stepped.
11724
11725 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11726
11727 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11728 * editfns.c: Rewrite current-time-zone so that it invokes
11729 the equivalent of (format-time-string "%Z") to get the time zone name.
11730 This fixes a bug when the time zone name contains characters that
11731 need converting from the system time locale to Emacs internal format.
11732 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11733 that patch fixed format-time-string to do the conversion, but
11734 I forgot to fix current-time-zone.
11735 (format_time_string): New function, containing most of
11736 what Fformat_time_string used to contain.
11737 (Fformat_time_string): Rewrite in terms of format_time_string.
11738 This doesn't change this function's behavior.
11739 (current-time-zone): Rewrite to use format_time_string.
11740 This fixes the bug reported by Michael Schierl in
11741 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11742 Jason Rumney's 2007-06-07 change worked around this bug, but
11743 didn't fix it.
11744 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11745
11746 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11747
11748 * xdisp.c (start_display): If the character at POS is displayed
11749 via a display vector, reset IT->current.dpvec_index to zero.
11750 (try_window_reusing_current_matrix): If a line ends in a display
11751 vector or the next line starts in a display vector, continue
11752 redrawing the window even though the character position of
11753 start_row was reached.
11754 (Bug#9771, part 2)
11755
11756 2011-10-18 Chong Yidong <cyd@gnu.org>
11757
11758 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11759 with nobreak-char-display too.
11760
11761 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11762
11763 Fix part 3 of bug#9771.
11764 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11765 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11766 non-neutral characters if the current character is a paragraph
11767 separator (a.k.a. Newline). This avoids running the same
11768 expensive loop twice, once when we consume the preceding newline
11769 and the other time when the line actually needs to be displayed.
11770 Avoid the loop when we see neutrals on the base embedding level
11771 following a character whose directionality is the same as the
11772 paragraph's. This avoids running the expensive loop when a line
11773 ends in a long sequence of neutrals, like control characters.
11774 Add assertion against STRONG_AL type. Slightly rearrange code
11775 that determines the type of a neutral given the first non-neutral
11776 that follows it.
11777 (bidi_level_of_next_char): Set next_en_pos to zero when
11778 invalidating its info.
11779
11780 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11781
11782 * xdisp.c (push_display_prop): Determine whether to record string
11783 or buffer position by IT->string, not by IT->method. Allow
11784 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11785 (move_it_vertically_backward): Don't look for character position
11786 immediately after the newline when in a continuation line.
11787 (Bug#9771, part 1)
11788
11789 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11790
11791 * window.c (coordinates_in_window): Rewrite and delabelize
11792 vertical border check. (Bug#5357) (Bug#9618)
11793
11794 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11795
11796 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11797 errors in XSetWindowBorder (bug#9310).
11798
11799 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11800
11801 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11802 avoid crash when xmalloc overrun checking is enabled.
11803
11804 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11805
11806 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11807 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11808 cursor motion with <left> and <right> arrow keys.
11809
11810 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11811 some callers set that themselves.
11812
11813 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11814
11815 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11816 display string and the previous row comes from the same string and
11817 is empty. (Bug#9739) (Bug#9738)
11818
11819 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11820
11821 * doc.c (get_doc_string): Encode file name (bug#9735).
11822
11823 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11824
11825 * bidi.c (bidi_level_of_next_char):
11826 * xdisp.c (get_visually_first_element): Remove old incorrect
11827 comments regarding the Unicode Line Separator character.
11828
11829 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11830
11831 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11832
11833 * alloc.c (Fgc_status): Do not access beyond zombies array
11834 boundary if nzombies > MAX_ZOMBIES.
11835 * alloc.c (dump_zombies): Add missing format specifier.
11836
11837 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11838
11839 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11840 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11841
11842 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11843 Some packages use them to denote characters with modifiers.
11844
11845 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11846
11847 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11848 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11849 matching a pp-number. Rename parameter var to var1.
11850
11851 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11852
11853 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11854
11855 2011-10-08 Glenn Morris <rgm@gnu.org>
11856
11857 * callint.c (Fcall_interactively): Give a more explicit error for the
11858 'c' case with a non-character input. (Bug#8479)
11859
11860 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11861
11862 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11863 lines.
11864 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11865 lines that are hscrolled on the left.
11866
11867 * dispnew.c (buffer_posn_from_coords): Account for a possible
11868 presence of header-line. (Bug#4426)
11869
11870 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11871
11872 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11873 Don't advertise functionality which we discourage or doesn't work.
11874
11875 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11876
11877 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11878 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11879 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11880 this makes Emacs dump core during garbage collection on rare
11881 occasions. sizeof is obviously inferior to offsetof here, so
11882 stick with offsetof.
11883 (GC_POINTER_ALIGNMENT): New macro.
11884 (mark_memory): Omit 3rd (offset) arg; caller changed.
11885 Don't assume EMACS_INT alignment is the same as pointer alignment.
11886
11887 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11888
11889 * keyboard.c (read_key_sequence_remapped): New var.
11890 (read_key_sequence): Compute remapping in the right buffer.
11891 (command_loop_1): Use read_key_sequence's remapping directly.
11892
11893 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11894
11895 * dired.c (file_name_completion): Don't expand file name.
11896 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11897 before checking file name handler.
11898
11899 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11900 they've been requested explicitly (bug#9591).
11901
11902 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11903
11904 * keymap.c (Fsingle_key_description): Use make_specified_string
11905 instead of build_string to build string from push_key_description.
11906 (Bug#5193)
11907
11908 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11909
11910 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11911 This fixes a Y2038 bug on 64-bit hosts.
11912 * buffer.c (reset_buffer):
11913 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11914 (Fclear_buffer_auto_save_failure):
11915 Use 0, not -1, to represent an unset failure time, since time_t
11916 might not be signed.
11917
11918 Remove dependency on glibc malloc internals.
11919 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11920 Move back here from lisp.h, but with their new implementations.
11921 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11922 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11923 * charset.c (charset_table_init): New static var.
11924 (syms_of_charset): Use it instead of xmalloc. This removes a
11925 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11926 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11927 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11928 Move back to alloc.c.
11929 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11930 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11931
11932 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11933
11934 * nsterm.m (windowDidResize): Call x_set_window_size only when
11935 ns_in_resize is true. Otherwise set pixelwidth/height and
11936 call change_frame_size (Bug#9628).
11937
11938 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11939
11940 Port --enable-checking=all to Fedora 14 x86-64.
11941 * charset.c (syms_of_charset): Also account for glibc malloc's
11942 internal overhead when calculating the initial malloc maximum.
11943
11944 Port --enable-checking=all to Fedora 14 x86.
11945 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11946 Move to lisp.h.
11947 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11948 (overrun_check_realloc, overrun_check_free):
11949 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11950 That way, xmalloc returns a properly-aligned pointer even if
11951 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11952 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11953 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11954 into account when calculating the initial malloc maximum.
11955 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11956 Move here from alloc.c, so that charset.c can use it too.
11957 Properly align; the old code wasn't right for common 32-bit hosts
11958 when configured with --enable-checking=all.
11959 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11960 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11961
11962 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11963
11964 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11965 use EDOM.
11966
11967 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11968
11969 * xdisp.c (compute_display_string_end): If there's no display
11970 string at CHARPOS, return -1.
11971
11972 * bidi.c (bidi_fetch_char): When compute_display_string_end
11973 returns a negative value, treat the character as a normal
11974 character not covered by a display string. (Bug#9624)
11975
11976 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11977
11978 * lread.c (Fread_from_string): Fix typo in docstring.
11979
11980 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11981
11982 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11983 newline, reseat the iterator instead of bidi-iterating there one
11984 character at a time. (Bug#9610)
11985 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11986 TO_CHARPOS if the bidi iterator is at base embedding level.
11987
11988 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11989
11990 * lread.c (readevalloop): Use correct code for NBSP.
11991 (read1): Likewise. (Bug#9608)
11992
11993 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11994
11995 * dbusbind.c (Fdbus_register_signal): When service is not
11996 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11997
11998 2011-09-25 Glenn Morris <rgm@gnu.org>
11999
12000 * buffer.c (truncate-lines): Doc fix.
12001
12002 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
12003
12004 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12005 (Fset_window_next_buffers): Doc fix.
12006
12007 2011-09-24 Glenn Morris <rgm@gnu.org>
12008
12009 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12010
12011 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12012
12013 Fix minor problems found by static checking.
12014 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12015 * indent.c (Fvertical_motion): Fix == vs = typo.
12016
12017 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12018
12019 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12020 Default value is now t. Doc fix.
12021
12022 * indent.c (Fvertical_motion): Compute and apply the overshoot
12023 logic when moving up, not only when moving down. Fix the
12024 confusing name and values of the it_overshoot_expected variable;
12025 logic changes accordingly. (Bug#9254) (Bug#9549)
12026
12027 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12028 CHARPOS is covered by a display string which includes newlines.
12029 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12030 is covered by a display string with embedded newlines.
12031
12032 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12033
12034 * dbusbind.c (Fdbus_register_signal): Add match rule to
12035 Vdbus_registered_objects_table. (Bug#9581)
12036 (Fdbus_register_method, Vdbus_registered_objects_table):
12037 Fix docstring.
12038
12039 2011-09-24 Jim Meyering <meyering@redhat.com>
12040
12041 do not ignore write error for any output size
12042 The previous change was incomplete.
12043 While it makes emacs --batch detect the vast majority of stdout
12044 write failures, errors were still ignored whenever the output size is
12045 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12046 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12047 && echo FAIL: ignored write error
12048 FAIL: ignored write error
12049 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12050 && echo FAIL: ignored write error
12051 FAIL: ignored write error
12052 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12053
12054 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12055
12056 * emacs.c (Fkill_emacs): In noninteractive mode exit
12057 non-successfully if a write error occurred on stdout. (Bug#9574)
12058
12059 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12060
12061 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12062 the xassert test.
12063
12064 * dispextern.h (struct it): Update the comment documenting what
12065 can it->OBJECT be.
12066
12067 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12068
12069 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12070 a display string, extend search for cursor position to end of row.
12071 (find_row_edges): If the row ends in a newline from a display
12072 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12073 Handle the case of a display string with multiple newlines.
12074 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12075 non-empty line. Fixes confusing cursor motion with arrow keys at
12076 the beginning of a line that starts with whitespace.
12077
12078 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12079
12080 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12081 (bug#9493).
12082
12083 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
12084
12085 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12086 boolean (Bug#9154).
12087
12088 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12089
12090 * xdisp.c (display_line): Record maximum and minimum buffer
12091 positions even if no glyphs were produced (e.g., by a zero-width
12092 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12093 buffer positions that will be removed from the glyph row because
12094 they don't fit.
12095 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12096 column is beyond frame width: don't subtract 1 "pixel" when
12097 computing width of the stretch.
12098 (reseat_at_next_visible_line_start): Undo the change made on
12099 2011-09-17 that saved paragraph information and restored it after
12100 the call to `reseat'. (Bug#9545)
12101
12102 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12103
12104 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12105 and turn window cursor on if cleared (Bug#9415).
12106
12107 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
12108
12109 * search.c (boyer_moore): Take unibyte characters from pattern
12110 literally. (Bug#9458)
12111
12112 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12113
12114 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12115
12116 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12117
12118 Fix minor problem found by static checking.
12119 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12120 initialized, to pacify gcc -Wuninitialized.
12121
12122 * fileio.c: Report proper errno when syscall falls.
12123 (Finsert_file_contents): Save and restore errno,
12124 so that report_file_error outputs the correct diagnostic.
12125 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12126
12127 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12128
12129 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12130
12131 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12132
12133 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12134 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12135
12136 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12137
12138 * xdisp.c (reseat_at_next_visible_line_start): Keep information
12139 about the current paragraph and restore it after the call to reseat.
12140
12141 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12142 (bidi_find_paragraph_start): Search back for paragraph beginning
12143 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12144 (bidi_move_to_visually_next): Only trigger paragraph-related
12145 computations when the last character is a newline or at EOB, not
12146 just any NEUTRAL_B. (Bug#9470)
12147
12148 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12149 truncated lines if point is covered by a display string. (Bug#9524)
12150
12151 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12152
12153 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12154 (cons_to_x_long): New function.
12155 (lisp_data_to_selection_data): Use it. Correct the test for
12156 short-versus-long data; it was negated. Break out of vector
12157 loop, for efficiency, when a long datum is discovered.
12158
12159 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12160
12161 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12162
12163 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12164
12165 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12166 GCC PR/17406) by declaring this function with external scope.
12167
12168 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12169
12170 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12171 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12172
12173 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12174
12175 * editfns.c (Fformat): Correctly handle text properties on "%%".
12176
12177 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12178
12179 * xterm.c (x_draw_composite_glyph_string_foreground):
12180 * w32term.c (x_draw_composite_glyph_string_foreground):
12181 * term.c (encode_terminal_code):
12182 * composite.c (composition_update_it, get_composition_id):
12183 * xdisp.c (get_next_display_element)
12184 (fill_composite_glyph_string): Add comments about special meaning
12185 of TAB characters in a composition.
12186
12187 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12188
12189 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12190 This occurs when processing a multibyte format.
12191 Problem reported by Wolfgang Jenker.
12192
12193 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12194
12195 * xdisp.c (try_cursor_movement): Only check for exact match if
12196 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12197
12198 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12199
12200 Remove unused external symbols.
12201 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12202 * xdisp.c (calc_pixel_width_or_height): Now static.
12203 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12204 * indent.c (check_display_width):
12205 * w32term.c: Fix comment to match code.
12206 * xterm.c, xterm.h (x_catching_errors): Remove.
12207
12208 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12209
12210 * xselect.c: Use signed conversions more consistently (Bug#9498).
12211 (selection_data_to_lisp_data): Assume incoming selection data are
12212 signed integers, not unsigned. This is to be consistent with
12213 outgoing selection data, which was modified to use signed integers
12214 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12215 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12216 expects long, not unsigned long.
12217
12218 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12219
12220 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12221 computation of loop end. Reported by Johan Bockgård
12222 <bojohan@gnu.org>.
12223
12224 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12225
12226 * frame.c (Fother_visible_frames_p): Function deleted.
12227
12228 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12229
12230 * indent.c (compute_motion): Process display vector front to back
12231 rather than the other way around. (Bug#2496)
12232
12233 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12234
12235 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12236
12237 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12238
12239 * minibuf.c (Fread_from_minibuffer): Doc fix.
12240
12241 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12242
12243 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12244 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12245
12246 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12247
12248 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12249 value for non-existent files.
12250
12251 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12252
12253 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12254 set its "size" to -1. This will set the modtime_size field of
12255 the corresponding buffer to -1, which is what
12256 verify-visited-file-modtime expects for files that do not exist.
12257 (Bug#9139)
12258
12259 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12260
12261 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12262 here ...
12263 * lisp.h: ... from here. push_key_description is no longer
12264 defined in keyboard.c, so its declaration should not be in
12265 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12266 logically belongs with push_key_description.
12267
12268 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12269
12270 * buffer.h: Include <sys/types.h> instead of <time.h>.
12271 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12272 Problem reported by Herbert J. Skuhra.
12273
12274 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12275
12276 * xml.c (parse_region): Make the parsing work for
12277 non-comment-starting XML files again (bug#9144).
12278
12279 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12280
12281 * image.c (gif_load): Fix calculation of bottom and right corner.
12282 (Bug#9468)
12283
12284 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12285
12286 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12287 redisplay in small windows.
12288
12289 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12290
12291 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12292
12293 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12294
12295 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12296 Operate on live windows only.
12297
12298 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12299
12300 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12301
12302 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12303
12304 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12305 only under bidi iteration.
12306
12307 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12308
12309 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12310
12311 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12312
12313 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12314 Without this fix, the command to link temacs failed due to an
12315 undefined symbol __builtin_isnan. This is because
12316 /usr/include/iso/math_c99.h #defines isnan(x) to
12317 __builtin_isnan(x), but the bundled gcc, which identifies itself
12318 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12319 a __builtin_isnan.
12320 * floatfns.c (isnan): #undef, and then #define to a clone of
12321 what's in data.c.
12322 (Fisnan): Always define, since it's always available now.
12323 (syms_of_floatfns): Always define isnan at the Lisp level.
12324
12325 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12326
12327 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12328
12329 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12330
12331 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12332 The previous code assumed that file offsets (off_t values) fit in
12333 EMACS_INT variables, which is not true on typical 32-bit hosts.
12334 The code messed up by falsely reporting buffer overflow in cases
12335 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12336 when "big" contains more than 2**29 bytes, even though this
12337 inserts just one byte and does not overflow the buffer.
12338 (Finsert_file_contents): Store file offsets as off_t
12339 values, not as EMACS_INT values. Check for overflow when
12340 converting between EMACS_INT and off_t. When checking for
12341 buffer overflow or for overlap, take the offsets into account.
12342 Don't use EMACS_INT for small values where int suffices.
12343 When checking for overlap, fix a typo: ZV was used where
12344 ZV_BYTE was intended.
12345 (Fwrite_region): Don't assume off_t fits into 'long'.
12346 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12347
12348 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12349
12350 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12351
12352 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12353
12354 sprintf-related integer and memory overflow issues (Bug#9412).
12355
12356 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12357 (esprintf, exprintf, evxprintf): New functions.
12358 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12359 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12360 (modify_event_symbol): Do not assume that the length of
12361 name_alist_or_stem is safe to alloca and fits in int.
12362 (Fexecute_extended_command): Likewise for function name and binding.
12363 (Frecursion_depth): Wrap around reliably on integer overflow.
12364 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12365 since some callers pass EMACS_INT values.
12366 (Fsingle_key_description): Don't crash if symbol name contains more
12367 than MAX_ALLOCA bytes.
12368 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12369 (get_minibuffer): Arg is now EMACS_INT, not int.
12370 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12371 (esprintf, exprintf, evxprintf): New decls.
12372 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12373
12374 * dbusbind.c (signature_cat): New function.
12375 (xd_signature, Fdbus_register_signal):
12376 Do not overrun buffer; instead, report string overflow.
12377
12378 * dispnew.c (add_window_display_history): Don't overrun buffer.
12379 Truncate instead; this is OK since it's just a log.
12380
12381 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12382 even if the time zone offset is outlandishly large.
12383 Don't mishandle offset == INT_MIN.
12384
12385 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12386 when creating daemon; the previous buffer-overflow check was incorrect.
12387
12388 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12389 which has the guts of the old verror function.
12390
12391 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12392 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12393
12394 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12395 (font_unparse_xlfd): Don't blindly alloca long strings.
12396 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12397 fits in int, when using sprintf. Use single snprintf to count
12398 length of string rather than counting it via multiple sprintfs;
12399 that's simpler and more reliable.
12400 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12401 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12402 sprintf, in case result does not fit in int.
12403
12404 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12405 (fontset_from_font): Print it.
12406
12407 * frame.c (tty_frame_count): Now printmax_t, not int.
12408 (make_terminal_frame, set_term_frame_name): Print it.
12409 (x_report_frame_params): In X, window IDs are unsigned long,
12410 not signed long, so print them as unsigned.
12411 (validate_x_resource_name): Check for implausibly long names,
12412 and don't assume name length fits in 'int'.
12413 (x_get_resource_string): Don't blindly alloca invocation name;
12414 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12415 not fit in int.
12416
12417 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12418 (xg_check_special_colors, xg_set_geometry):
12419 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12420
12421 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12422 Use esprintf, not sprintf, in case result does not fit in int.
12423
12424 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12425 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12426 it as a large positive number.
12427 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12428 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12429
12430 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12431 in case result does not fit in int.
12432
12433 * print.c (float_to_string): Detect width overflow more reliably.
12434 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12435 buffer overrun. Don't assume list length fits in 'int'. Treat
12436 print length of 0 as 0, not as infinity; to be consistent with other
12437 uses of print length in this function. Don't overflow print length
12438 index. Don't assume hash table size fits in 'long', or that
12439 vectorlike size fits in 'unsigned long'.
12440
12441 * process.c (make_process): Use printmax_t, not int, to format
12442 process-name gensyms.
12443
12444 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12445
12446 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12447 to avoid potential buffer overrun.
12448
12449 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12450 if X resource line is longer than 512 bytes.
12451
12452 * xfns.c (x_window): Make sprintf buffer a bit bigger
12453 to avoid potential buffer overrun.
12454
12455 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12456
12457 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12458
12459 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12460
12461 Integer overflow fixes for scrolling, etc.
12462 Without these, Emacs silently mishandles large integers sometimes.
12463 For example, "C-u 4294967297 M-x recenter" was treated as if
12464 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12465
12466 * xdisp.c (try_window_id): Check Emacs fixnum range before
12467 converting to 'int'.
12468
12469 * window.c (window_scroll_line_based, Frecenter):
12470 Check that an Emacs fixnum is in range before assigning it to 'int'.
12471 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12472 values converted from Emacs fixnums.
12473 (Frecenter): Don't wrap around a line count if it is out of 'int'
12474 range; instead, treat it as an extreme value.
12475 (Fset_window_configuration, compare_window_configurations):
12476 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12477
12478 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12479 that can exceed INT_MAX. Check that EMACS_INT value is in range
12480 before assigning it to the (possibly-narrower) index.
12481 (match_limit): Don't assume that a fixnum can fit in 'int'.
12482
12483 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12484 exceed INT_MAX.
12485
12486 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12487 (Fvertical_motion): Don't wrap around LINES values that don't fit
12488 in 'int'. Instead, treat them as extreme values. This is good
12489 enough for windows, which can't have more than INT_MAX lines anyway.
12490
12491 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12492
12493 * Require libxml/parser.h to avoid compilation warning.
12494
12495 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12496
12497 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12498 since this reportedly can destroy thread storage.
12499
12500 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12501
12502 * syntax.c (find_defun_start): Update all cache variables if
12503 exiting early (Bug#9401).
12504
12505 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12506
12507 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12508
12509 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12510 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12511 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12512
12513 * term.c (tty_append_glyph): New function.
12514 (produce_stretch_glyph): Static function and its prototype deleted.
12515
12516 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12517 Add prototypes.
12518
12519 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12520
12521 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12522 when checking :margin (Bug#9390).
12523 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12524 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12525 so that the name doesn't mislead. All uses changed.
12526
12527 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12528
12529 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12530 set_tty_hooks.
12531
12532 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12533
12534 * xdisp.c (move_it_to): Don't bail out early when reaching
12535 position beyond to_charpos, if we are scanning backwards.
12536 (move_it_vertically_backward): When DY == 0, make sure we get to
12537 the first character in the line after the newline.
12538
12539 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12540
12541 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12542 (ccl_driver): Do not generate an out-of-range pointer.
12543 (Fccl_execute_on_string): Remove unnecessary check for
12544 integer overflow, noted by Stefan Monnier in
12545 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12546 Remove a FIXME that didn't need fixing.
12547 Simplify the newly-introduced buffer reallocation code.
12548
12549 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12550
12551 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12552
12553 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12554
12555 Integer and memory overflow issues (Bug#9196).
12556
12557 * doc.c (get_doc_string): Rework so that
12558 get_doc_string_buffer_size is the actual buffer size, rather than
12559 being 1 less than the actual buffer size; this makes xpalloc more
12560 convenient.
12561
12562 * image.c (x_allocate_bitmap_record, cache_image):
12563 * xselect.c (Fx_register_dnd_atom):
12564 Simplify previous changes by using xpalloc.
12565
12566 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12567 since either will do and ptrdiff_t is convenient with xpalloc.
12568
12569 * charset.c (charset_table_size)
12570 (struct charset_sort_data.priority): Now ptrdiff_t.
12571 (charset_compare): Don't overflow if priorities differ greatly.
12572 (Fsort_charsets): Don't assume list length fits in int.
12573 Check for size-calculation overflow when allocating sort data.
12574 (syms_of_charset): Allocate an initial charset table that is
12575 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12576
12577 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12578
12579 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12580 The actual value is always <= INT_MAX, and leaving it unsigned made
12581 overflow checking harder.
12582
12583 * dispextern.h (struct glyph_matrix.rows_allocated)
12584 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12585 with xpalloc. The values are still always <= INT_MAX.
12586
12587 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12588
12589 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12590 (SAFE_NALLOCA): New macro.
12591
12592 * region-cache.c (struct boundary.pos, find_cache_boundary)
12593 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12594 (set_cache_region, invalidate_region_cache)
12595 (revalidate_region_cache, know_region_cache, region_cache_forward)
12596 (region_cache_backward, pp_cache):
12597 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12598 so that ptrdiff_t * can be passed to xpalloc.
12599 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12600 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12601 (pp_cache): Don't assume cache_len fits in int.
12602 * region-cache.h: Adjust extern decls to match.
12603
12604 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12605 EMACS_INT, since either will do, for xpalloc.
12606
12607 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12608 (xnmalloc, xnrealloc, xpalloc): New functions.
12609
12610 * bidi.c (bidi_shelve_header_size): New constant.
12611 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12612 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12613
12614 * bidi.c (bidi_cache_shrink):
12615 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12616 (overlay_strings):
12617 Don't update size of array until after memory allocation succeeds,
12618 because xmalloc/xrealloc may not return.
12619 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12620 now that we have proper integer overflow checking.
12621 (record_overlay_string, overlay_strings): Catch overflows when
12622 calculating size of overlay_str_buf.
12623
12624 * callproc.c (Fcall_process): Check for size overflow when
12625 calculating size of args2.
12626 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12627 Normally we prefer signed values, but sticking with ptrdiff_t would
12628 require adding more-complicated checks.
12629
12630 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12631 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12632 Redo buffer-overflow calculations to avoid integer overflow.
12633 Add a FIXME comment where memory seems to be over-allocated.
12634
12635 * character.c (Fstring): Check for size-calculation overflow.
12636
12637 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12638 unnecessary integer overflow. Check for size overflow.
12639 (encode_coding_object): Don't update size until xmalloc succeeds.
12640
12641 * composite.c (get_composition_id): Check for overflow in glyph
12642 length calculations.
12643
12644 Integer and memory overflow fixes for display code.
12645 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12646 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12647 (scrolling_window): Check for overflow in size calculations.
12648 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12649 Don't assume glyph table len fits in int.
12650 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12651 (row_table_size): Now ptrdiff_t, not int.
12652 (scrolling_window): Avoid overflow in size calculations.
12653 Don't update size until allocation succeeds.
12654 * fns.c (concat): Check for overflow in size calculations.
12655 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12656 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12657 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12658
12659 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12660 (get_doc_string): Check for size calculation overflow.
12661 Don't update size until allocation succeeds.
12662 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12663 EMACS_INT, where ptrdiff_t will do.
12664 (Fsubstitute_command_keys): Check for string overflow.
12665
12666 * editfns.c (set_time_zone_rule): Don't assume environment length
12667 fits in int.
12668 (message_length): Now ptrdiff_t, not int.
12669 (Fmessage_box): Don't update size until allocation succeeds.
12670 Don't assume message length fits in int.
12671 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12672
12673 * emacs.c (main): Do not reallocate argv, since there is a null at
12674 the end that can be overwritten, and this way there's no need to
12675 worry about size-calculation overflow.
12676 (sort_args): Check for size-calculation overflow.
12677
12678 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12679 alloc succeeds.
12680 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12681
12682 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12683 (x_set_scroll_bar_width, x_figure_window_size):
12684 Check for integer overflow.
12685 (x_set_alpha): Do not assume XINT fits in int.
12686
12687 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12688 This is for the members text_lines, text_cols, total_lines, total_cols,
12689 where the system imposes an 'int' limit.
12690
12691 * fringe.c (Fdefine_fringe_bitmap):
12692 Don't update size until alloc works.
12693
12694 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12695 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12696
12697 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12698 Check for size-calculation overflow.
12699 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12700 do, as we prefer signed integers.
12701 (id_to_widget.max_size, id_to_widget.used)
12702 (xg_store_widget_in_map, xg_remove_widget_from_map)
12703 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12704 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12705 Use and return ptrdiff_t, not int.
12706 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12707 * gtkutil.h: Change prototypes to match the above.
12708
12709 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12710 are duplicate now that they've been promoted to lisp.h.
12711 (x_allocate_bitmap_record, x_alloc_image_color)
12712 (make_image_cache, cache_image, xpm_load):
12713 Don't update size until alloc is done.
12714 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12715 (x_detect_edges):
12716 Check for size calculation overflow.
12717 (ct_colors_allocated_max): New constant.
12718 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12719 overflow.
12720
12721 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12722 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12723 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12724 Use ptrdiff_t, not int, to count maps.
12725 (read_char_minibuf_menu_prompt): Check for overflow in size
12726 calculations. Don't update size until allocation succeeds.
12727 Redo calculations to avoid overflow.
12728 * keyboard.h: Change prototypes to match the above.
12729
12730 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12731 to count maps.
12732 (current_minor_maps): Check for size calculation overflow.
12733 * keymap.h: Change prototypes to match the above.
12734
12735 * lread.c (read1, init_obarray): Don't update size until alloc done.
12736
12737 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12738 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12739
12740 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12741 Now ptrdiff_t, not int.
12742 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12743 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12744
12745 * process.c (Fnetwork_interface_list): Check for overflow
12746 in size calculation.
12747
12748 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12749
12750 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12751 overflow. Don't bother calling xmalloc when xrealloc will do.
12752
12753 * search.c (Freplace_match): Check for size calculation overflow.
12754 (Fset_match_data): Don't assume list lengths fit in 'int'.
12755
12756 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12757 for command line length. Do not attempt to address one before the
12758 beginning of an array, as that's not portable.
12759
12760 * term.c (max_frame_lines): Remove; unused.
12761 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12762 not int.
12763 (encode_terminal_code, calculate_costs): Check for size
12764 calculation overflow.
12765 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12766 table lengths and related sizes. Don't update size until alloc
12767 done. Redo calculations to avoid overflow.
12768 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12769
12770 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12771 subtracting pointers.
12772 (gobble_line): Check for overflow more carefully. Don't update size
12773 until alloc done.
12774
12775 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12776 Don't update size until alloc done.
12777 Redo size calculations to avoid overflow.
12778 Check for size calculation overflow.
12779 (main) [DEBUG]: Fix typo in invoking tparam1.
12780
12781 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12782 Use ptrdiff_t, not int, for sizes.
12783 (store_mode_line_noprop_char): Don't update size until alloc done.
12784
12785 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12786 Use ptrdiff_t, not int, for sizes.
12787 (Finternal_make_lisp_face, cache_face):
12788 Check for size calculation overflow.
12789 (cache_face): Treat size calculation overflows as if they were
12790 memory exhaustion (the usual treatment), rather than aborting.
12791
12792 * xfns.c (x_encode_text, x_set_name_internal)
12793 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12794 sizes, since they can exceed INT_MAX in size. Check for size
12795 calculation overflow.
12796
12797 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12798 (xg_select): Check for size calculation overflow.
12799 Don't update size until alloc done.
12800
12801 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12802 as sprintf is limited to int lengths.
12803
12804 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12805 (X_LONG_MIN): New macros.
12806 Use them to make the following changes clearer.
12807 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12808 This change doesn't affect the value now, but it may help remind
12809 future maintainers not to raise the value too much later.
12810 (SELECTION_QUANTUM): Remove, replacing with ...
12811 (selection_quantum): ... new function, which avoids overflow.
12812 All uses changed.
12813 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12814 assumption that selection length fits in 'int'.
12815 (x_reply_selection_request, x_handle_selection_request)
12816 (x_get_window_property, receive_incremental_selection)
12817 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12818 (lisp_data_to_selection_data, clean_local_selection_data):
12819 Use ptrdiff_t, not int, to record length of selection.
12820 (x_reply_selection_request, x_get_window_property)
12821 (receive_incremental_selection, x_property_data_to_lisp):
12822 Redo calculations to avoid overflow.
12823 (x_reply_selection_request): When sending hint, ceiling it at
12824 X_LONG_MAX rather than relying on wraparound overflow to send
12825 something.
12826 (x_get_window_property, receive_incremental_selection)
12827 (lisp_data_to_selection_data, x_property_data_to_lisp):
12828 Check for size-calculation overflow.
12829 (x_get_window_property, receive_incremental_selection)
12830 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12831 Don't store size until memory allocation succeeds.
12832 (x_get_window_property): Plug memory leak on memory exhaustion.
12833 Don't double-block input; malloc is safe here. Don't assume 2**34
12834 - 4 fits in unsigned long. Add an xassert to check
12835 XGetWindowProperty overflow. Be more careful about overflow
12836 calculations, and distinguish size from memory overflow better.
12837 (receive_incremental_selection): When tracing, don't assume
12838 unsigned int is less than INT_MAX.
12839 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12840 harmful) conversions of unsigned short to int.
12841 (lisp_data_to_selection_data): Don't assume that integers
12842 in the range -65535 through -1 fit in an X unsigned short.
12843 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12844 result parameters unless successful. Rely on cons_to_unsigned
12845 to report problems with elements; the old code wasn't right anyway.
12846 (x_check_property_data): Check for int overflow; we cannot use
12847 a wider type due to X limits.
12848 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12849
12850 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12851
12852 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12853 (x_term_init): Check for size calculation overflow.
12854 (x_color_cells): Don't store size until memory allocation succeeds.
12855 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12856 Don't assume alloca size is less than MAX_ALLOCA.
12857 (x_term_init): Don't assume length fits in int (sprintf is limited
12858 to int size).
12859
12860 Use ptrdiff_t for composition IDs.
12861 * character.c (lisp_string_width):
12862 * composite.c (composition_table_size, n_compositions)
12863 (get_composition_id, composition_gstring_from_id):
12864 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12865 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12866 * window.c (Frecenter):
12867 Use ptrdiff_t, not int, for composition IDs.
12868 * composite.c (get_composition_id): Check for integer overflow.
12869 * composite.h: Adjust prototypes to match the above changes.
12870
12871 Use ptrdiff_t for hash table indexes.
12872 * category.c (hash_get_category_set):
12873 * ccl.c (ccl_driver):
12874 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12875 * coding.c (coding_system_charset_list, detect_coding_system):
12876 * coding.h (struct coding_system.id):
12877 * composite.c (get_composition_id, gstring_lookup_cache):
12878 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12879 * image.c (xpm_get_color_table_h):
12880 * lisp.h (hash_lookup, hash_put):
12881 * minibuf.c (Ftest_completion):
12882 Use ptrdiff_t for hash table indexes, not int (which is too
12883 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12884 32-bit --with-wide-int hosts).
12885
12886 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12887 Add a FIXME comment about memory leaks.
12888 (syms_of_charset): Don't assume xmalloc returns.
12889
12890 Don't assume that stated character widths fit in int.
12891 * character.c (Fchar_width, c_string_width, lisp_string_width):
12892 * character.h (CHAR_WIDTH):
12893 * indent.c (MULTIBYTE_BYTES_WIDTH):
12894 Use sanitize_char_width to avoid undefined and/or bad behavior
12895 with outlandish widths.
12896 * character.h (sanitize_tab_width): Rename from sanitize_width,
12897 now that we have two such functions. All uses changed.
12898 (sanitize_char_width): New inline function.
12899
12900 Don't assume that tab-width fits in int.
12901 * character.h (sanitize_width): New inline function.
12902 (SANE_TAB_WIDTH): New macro.
12903 (ASCII_CHAR_WIDTH): Use it.
12904 * indent.c (sane_tab_width): Remove. All uses replaced by
12905 SANE_TAB_WIDTH (current_buffer).
12906 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12907
12908 * fileio.c: Integer overflow issues with file modes.
12909 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12910
12911 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12912 Remove unreachable code.
12913 (read_hex, load_charset_map_from_file): Check for integer overflow.
12914
12915 * xterm.c: Don't go over XClientMessageEvent limit.
12916 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12917 (x_send_scroll_bar_event): Likewise. Check that the size does not
12918 exceed limits imposed by XClientMessageEvent, as well as the usual
12919 ptrdiff_t and size_t limits.
12920
12921 * keyboard.c: Overflow, signedness and related fixes.
12922 (make_lispy_movement): Use same integer type in forward decl
12923 that is used in the definition.
12924 (read_key_sequence, keyremap_step):
12925 Change bufsize argument back to int, undoing my 2011-03-30 change.
12926 We prefer signed types, and int is wide enough here.
12927 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12928 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12929 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12930 length, not size_t. Use ptrdiff_t for index, not int.
12931 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12932 possibility of integer overflow.
12933
12934 Overflow, signedness and related fixes for images.
12935
12936 * dispextern.h (struct it.stack[0].u.image.image_id)
12937 (struct_it.image_id, struct image.id, struct image_cache.size)
12938 (struct image_cache.used, struct image_cache.ref_count):
12939 * gtkutil.c (update_frame_tool_bar):
12940 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12941 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12942 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12943 * nsmenu.m (update_frame_tool_bar):
12944 * xdisp.c (calc_pixel_width_or_height):
12945 * xfns.c (image_cache_refcount):
12946 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12947 on typical 64-bit hosts.
12948
12949 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12950 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12951 Omit unnecessary casts to int.
12952 (parse_image_spec): Check that integers fall into 'int' range
12953 when the callers expect that.
12954 (image_ascent): Redo ascent calculation to avoid int overflow.
12955 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12956 (lookup_image): Remove unnecessary tests.
12957 (xbm_image_p): Locals are now of int, not EMACS_INT,
12958 since parse_image_check makes sure they fit into int.
12959 (png_load, gif_load, svg_load_image):
12960 Prefer int to unsigned where either will do.
12961 (tiff_handler): New function, combining the cores of the
12962 old tiff_error_handler and tiff_warning_handler.
12963 This function is rewritten to use vsnprintf and thereby avoid
12964 stack buffer overflows. It uses only the features of vsnprintf
12965 that are common to both POSIX and native Microsoft.
12966 (tiff_error_handler, tiff_warning_handler): Use it.
12967 (tiff_load, gif_load, imagemagick_load_image):
12968 Don't assume :index value fits in 'int'.
12969 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12970 (imagemagick_load_image): Check that crop parameters fit into
12971 the integer types that MagickCropImage accepts. Don't assume
12972 Vimagemagick_render_type has a nonnegative value. Don't assume
12973 size_t fits in 'long'.
12974 (gs_load): Use printmax_t to print the widest integers possible.
12975 Check for integer overflow when computing image height and width.
12976
12977 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12978
12979 * xdisp.c (redisplay_window): Don't force window start if point
12980 will be invisible in the resulting window. (Bug#9324)
12981
12982 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12983
12984 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12985 the display spec is of the form `(space ...)'.
12986 (handle_display_spec): Return the value returned by
12987 handle_single_display_spec, not just 1 or zero.
12988 (handle_single_display_spec): If the display spec is of the form
12989 `(space ...)', and specifies display in the text area, return 2
12990 rather than 1.
12991 (try_cursor_movement): Check for the need to scroll more
12992 accurately, and prefer exact match for point under bidi.
12993 Don't advance `row' beyond the last row of the window.
12994
12995 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12996 into disp_prop; all users changed.
12997
12998 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12999 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13000 for the text covered by the display property.
13001
13002 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
13003
13004 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13005 Change return value to nil.
13006 (Frecord_buffer): Delete unused function.
13007
13008 2011-08-24 Eli Zaretskii <eliz@gnu.org>
13009
13010 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13011 buffers, return left-to-right.
13012 (set_cursor_from_row): Consider candidate row a win if its glyph
13013 represents a newline and point is on that newline. Fixes cursor
13014 positioning on the newline at EOL of R2L text within L2R
13015 paragraph, and vice versa.
13016 (try_cursor_movement): Check continued rows, in addition to
13017 continuation rows. Fixes unwarranted scroll when point enters a
13018 continued line of R2L text within an L2R paragraph, or vice versa.
13019 (cursor_row_p): Consider the case of point being equal to
13020 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13021 from the end of a short line to the beginning of a continued line
13022 of R2L text within L2R paragraph.
13023 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13024 composed characters.
13025
13026 * bidi.c (bidi_check_type): Use xassert.
13027 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13028 members.
13029
13030 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13031
13032 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13033 a character.
13034
13035 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13036
13037 * nsfont.m (ns_otf_to_script): Fix typo.
13038
13039 2011-08-22 Kenichi Handa <handa@m17n.org>
13040
13041 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13042 extra slot even if the purpose is char-code-property-table.
13043
13044 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13045
13046 * xdisp.c (redisplay_window): When computing centering_position,
13047 account for the height of the header line. (Bug#8874)
13048
13049 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13050 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13051 candidate is selected by the mouse, and that candidate has a
13052 composed character under the mouse.
13053
13054 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13055 coordinates reported by pos-visible-in-window-p for a composed
13056 character in column zero.
13057
13058 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13059
13060 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13061
13062 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13063
13064 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13065 consider it a hit if to_charpos is anywhere in the range of the
13066 composed buffer positions.
13067
13068 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13069
13070 * image.c (gif_load): Don't assume that each subimage has the same
13071 dimensions as the base image. Handle disposal method that is
13072 "undefined" by the gif spec (Bug#9335).
13073
13074 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13075
13076 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13077 (Fcondition_case): Document `debug' symbol in error handler.
13078
13079 2011-08-19 Eli Zaretskii <eliz@gnu.org>
13080
13081 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13082 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13083 from an Org mode buffer to a Speedbar frame.
13084
13085 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13086 a composition, take its buffer position from IT->cmp_it.charpos.
13087 Fixes cursor positioning at the beginning of a line that begins
13088 with a composed character.
13089
13090 2011-08-18 Eli Zaretskii <eliz@gnu.org>
13091
13092 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13093 character bidirectional type, use STRONG_L instead. Fixes crashes
13094 in a buffer produced by `describe-categories'.
13095
13096 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13097 members before the level stack, so they would be saved and
13098 restored when copying iterator state. Fixes incorrect reordering
13099 around TABs covered by display properties.
13100
13101 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13102
13103 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13104
13105 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
13106
13107 * eval.c (internal_condition_case, internal_condition_case_1)
13108 (internal_condition_case_2, internal_condition_case_n):
13109 Remove unnecessary aborts (Bug#9081).
13110
13111 2011-08-17 Eli Zaretskii <eliz@gnu.org>
13112
13113 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13114 has no `load' handler, try opening the file locally. (Bug#9311)
13115
13116 2011-08-16 Ken Brown <kbrown@cornell.edu>
13117
13118 * gmalloc.c: Expand comment.
13119
13120 2011-08-16 Eli Zaretskii <eliz@gnu.org>
13121
13122 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13123 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13124
13125 2011-08-16 Ken Brown <kbrown@cornell.edu>
13126
13127 Fix memory allocation problems in Cygwin build (Bug#9273).
13128
13129 * unexcw.c ( __malloc_initialized): Declare external variable.
13130 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13131
13132 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13133 New variables.
13134 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13135 dumped emacs.
13136 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13137 in the static heap.
13138 [CYGWIN] (special_realloc): New function.
13139 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13140 requests to realloc storage in the static heap.
13141
13142 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13143
13144 * bidi.c (bidi_initialize): Remove unused local.
13145
13146 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13147
13148 * bidimirror.h:
13149 * biditype.h: Remove file.
13150 * makefile.w32-in ($(BLD)/bidi.$(O)):
13151 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13152
13153 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13154
13155 * chartab.c: Improve commentary for the uniprop_table API.
13156
13157 * bidi.c (bidi_paragraph_init): Support zero value of
13158 bidi_ignore_explicit_marks_for_paragraph_level.
13159 (bidi_initialize): Use uniprop_table instead of including
13160 biditype.h and bidimirror.h.
13161
13162 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13163 coordinates of the iterator when restoring from ppos_it.
13164 (Bug#9296)
13165
13166 2011-08-14 Kenichi Handa <handa@m17n.org>
13167
13168 * process.c (create_process): Call setup_process_coding_systems
13169 after the pid of the process is set to -1 (Bug#8162).
13170
13171 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13172
13173 * xdisp.c (move_it_in_display_line_to): Don't invoke
13174 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13175 ppos_it. Fixes vertical cursor motion when line beginning is
13176 covered by an image. (Bug#9296)
13177
13178 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13179
13180 * nsterm.h (ns_run_ascript): Declare.
13181 (NSAPP_DATA2_RUNASSCRIPT): Define.
13182
13183 * nsfns.m (as_script, as_result, as_status): New static variables.
13184 (ns_run_ascript): New function.
13185 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13186 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13187 the event loop. Get status from as_status (Bug#7276).
13188
13189 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13190 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13191 the event loop (Bug#7276).
13192
13193 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13194
13195 * gnutls.c (QCgnutls_bootprop_priority)
13196 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13197 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13198 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13199 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13200 (QCgnutls_bootprop_verify_hostname_error)
13201 (QCgnutls_bootprop_callbacks_verify): Rename from
13202 Qgnutls_bootprop_..., all uses changed.
13203
13204 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13205 uses changed.
13206
13207 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13208
13209 * xfaces.c (Qframe_set_background_mode): Now static.
13210 * dispextern.h (Qframe_set_background_mode): Remove decl.
13211
13212 * process.c (Fnetwork_interface_info): Declare local only if needed.
13213
13214 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13215
13216 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13217 (Fnetwork_interface_list): Allocate in increments of bytes instead
13218 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13219 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13220 sockaddr.
13221 (struct ifflag_def): notrailers is smart on OSX.
13222 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13223 Get hardware address with getifaddrs if available.
13224
13225 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13226
13227 * xdisp.c (iterate_out_of_display_property): xassert that
13228 IT->position is set to within IT->object's boundaries. Break from
13229 the loop as soon as EOB is reached; avoids infloops in redisplay
13230 when IT->position is set up wrongly due to some bug.
13231 Set IT->current to match the bidi iterator unconditionally.
13232 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13233 entry. Force push_it to save on the stack the current
13234 buffer/string position, to be restored by pop_it. Fix flags in
13235 the iterator structure wrt the object coming from a display
13236 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13237 properties. (Bug#9284)
13238
13239 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13240
13241 * fontset.c (fontset_get_font_group): Add proper type checks.
13242 (Bug#9172)
13243
13244 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13245
13246 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13247 and LC_VERSION_MIN_MACOSX.
13248 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13249 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13250
13251 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13252
13253 * xdisp.c (forward_to_next_line_start): Allow to use the
13254 no-display-properties-and-no-overlays under bidi display.
13255 Set disp_pos in the bidi iterator to avoid searches for display
13256 properties and overlays.
13257
13258 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13259
13260 * editfns.c (Fset_time_zone_rule): Document relationship with the
13261 setenv function.
13262
13263 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13264 the font entity extracted from the cache (Bug#8109).
13265
13266 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13267
13268 * composite.c (autocmp_chars): Don't reset point. That is done by
13269 restore_point_unwind (Bug#5984).
13270
13271 2011-08-07 Juri Linkov <juri@jurta.org>
13272
13273 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13274 to show the arg `TIME' instead of `TIMEVAL'.
13275
13276 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13277
13278 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13279 display property strides EOL and includes a newline, as in
13280 longlines-mode. (Bug#9254)
13281 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13282 word-wrap under bidirectional display. (Bug#9224)
13283
13284 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13285 is non-zero, even if the data buffer is NULL. Fixes a crash in
13286 vertical-motion with longlines-mode. (Bug#9254)
13287
13288 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13289
13290 * bidi.c <bidi_cache_total_alloc>: Now static.
13291 (bidi_initialize): Initialize bidi_cache_total_alloc.
13292
13293 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13294 cache. (Bug#9221)
13295
13296 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13297 amount allocated this far in `bidi_cache_total_alloc'.
13298 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13299 non-zero, only free the data buffer without restoring the cache
13300 contents. All callers changed.
13301
13302 * dispextern.h (bidi_unshelve_cache): Update prototype.
13303
13304 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13305 (move_it_in_display_line, move_it_to)
13306 (move_it_vertically_backward, move_it_by_lines): Replace the call
13307 to xfree to an equivalent call to bidi_unshelve_cache.
13308 (move_it_in_display_line_to): Fix logic of returning
13309 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13310
13311 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13312
13313 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13314 came from a string character with a `cursor' property. (Bug#9229)
13315
13316 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13317
13318 * Makefile.in (LIB_PTHREAD): New variable.
13319 (LIBES): Add LIB_PTHREAD (Bug#9216).
13320
13321 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13322 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13323
13324 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13325
13326 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13327
13328 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13329
13330 * xterm.c (x_find_topmost_parent): New function.
13331 (x_set_frame_alpha): Find topmost parent window with
13332 x_find_topmost_parent and set the property there also (bug#9181).
13333 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13334
13335 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13336
13337 * callproc.c (Fcall_process): Avoid vfork clobbering
13338 the local vars buffer, coding_systems, current_dir.
13339
13340 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13341
13342 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13343
13344 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13345
13346 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13347 so that it is not optimized away.
13348
13349 * xdisp.c (compute_display_string_pos): Remove unused local.
13350
13351 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13352
13353 Fix slow cursor motion and scrolling in large buffers with
13354 selective display, like Org Mode buffers. (Bug#9218)
13355
13356 * dispextern.h (struct bidi_it): New member disp_prop_p.
13357
13358 * xdisp.c: Remove one-slot cache of display string positions.
13359 (compute_display_string_pos): Accept an additional argument
13360 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13361 for a display string or property. If found, set DISP_PROP_P
13362 non-zero.
13363
13364 * bidi.c (bidi_fetch_char): Accept an additional argument
13365 DISP_PROP_P, and pass it to compute_display_string_pos.
13366 Only handle text covered by a display string if DISP_PROP_P is returned
13367 non-zero. All callers of bidi_fetch_char changed.
13368
13369 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13370
13371 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13372
13373 2010-12-03 Don March <don@ohspite.net>
13374
13375 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13376 last character M-[char] is translated to ESC [char] (bug#7541).
13377
13378 2011-08-02 Kenichi Handa <handa@m17n.org>
13379
13380 * lisp.h (uniprop_table): Extern it.
13381
13382 * chartab.c (uniprop_table): Make it non-static.
13383
13384 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13385
13386 * xdisp.c (forward_to_next_line_start): Accept additional argument
13387 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13388 on the newline.
13389 (reseat_at_next_visible_line_start): Use the bidi iterator state
13390 returned by forward_to_next_line_start to restore the state of
13391 it->bidi_it after backing up to previous newline. (Bug#9212)
13392
13393 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13394
13395 * regex.c (re_comp): Protoize.
13396 (re_exec): Fix return type.
13397 (regexec): Fix type of `ret'. (Bug#9203)
13398
13399 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13400
13401 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13402 This is needed if max-image-size is a floating-point number.
13403
13404 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13405
13406 * print.c (print_object): Print empty symbol as ##.
13407
13408 * lread.c (read1): Read ## as empty symbol.
13409
13410 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13411
13412 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13413 setting frame foreground color (Bug#9175).
13414 (x_set_background_color): Likewise.
13415
13416 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13417 contents (Bug#9176).
13418 (EmacsTooltip -init): Remove bezels and add shadows to
13419 tooltip windows.
13420
13421 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13422 or scroll bar (Bug#8470).
13423
13424 * nsfont.m (nsfont_open): Remove assignment to voffset and
13425 unnecessary vars hshink, expand, hd, full_height, min_height.
13426 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13427
13428 * nsterm.h (nsfont_info): Remove voffset field.
13429
13430 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13431
13432 Implement strike-through and overline on NextStep (Bug#8863).
13433
13434 * nsfont.m (nsfont_open): Use underline position provided by font,
13435 instead of hard-coded value of 2.
13436 (nsfont_draw): Call ns_draw_text_decoration instead.
13437
13438 * nsterm.h: Add declaration for ns_draw_text_decoration.
13439
13440 * nsterm.m (ns_draw_text_decoration): New function for drawing
13441 underline, overline, and strike-through.
13442 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13443 ns_draw_text_decoration. Change treatment of cursor drawing to
13444 accommodate underlining, etc.
13445
13446 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13447
13448 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13449 default.
13450
13451 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13452
13453 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13454 Without this fix, if a signal arrives just after memory fills up,
13455 'malloc' might be invoked reentrantly.
13456
13457 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13458 In other words, assume that every image size is allowed, on non-X
13459 hosts. This assumption is probably wrong, but it lets Emacs compile.
13460
13461 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13462
13463 * regex.c (re_iswctype): Convert return values to boolean.
13464
13465 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13466
13467 * xdisp.c (compute_display_string_pos): Don't use cached display
13468 string position if the buffer had its restriction changed.
13469 (Bug#9184)
13470
13471 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13472
13473 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13474
13475 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13476
13477 Integer signedness and overflow and related fixes. (Bug#9079)
13478
13479 * bidi.c: Integer size and overflow fixes.
13480 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13481 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13482 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13483 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13484 (bidi_find_other_level_edge):
13485 Use ptrdiff_t instead of EMACS_INT where either will do.
13486 This works better on 32-bit hosts configured --with-wide-int.
13487 (bidi_cache_ensure_space): Check for size-calculation overflow.
13488 Use % rather than repeated addition, for better worst-case speed.
13489 Don't set bidi_cache_size until after xrealloc returns, because it
13490 might not return.
13491 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13492 (bidi_cache_ensure_space): Also check that the bidi cache size
13493 does not exceed that of the largest Lisp string or buffer. See Eli
13494 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13495
13496 * alloc.c (__malloc_size_t): Remove.
13497 All uses replaced by size_t. See Andreas Schwab's note
13498 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13499
13500 * image.c: Improve checking for integer overflow.
13501 (check_image_size): Assume that f is nonnull, since
13502 it is always nonnull in practice. This is one less thing to
13503 worry about when checking for integer overflow later.
13504 (x_check_image_size): New function, which checks for integer
13505 overflow issues inside X.
13506 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13507 This removes the need for a memory_full check.
13508 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13509 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13510 (xbm_read_bitmap_data): Change locals back to 'int', since
13511 their values must fit in 'int'.
13512 (xpm_load_image, png_load, tiff_load):
13513 Invoke x_create_x_image_and_pixmap earlier,
13514 to avoid much needless work if the image is too large.
13515 (tiff_load): Treat overly large images as if
13516 x_create_x_image_and_pixmap failed, not as malloc failures.
13517 (gs_load): Use x_check_image_size.
13518
13519 * gtkutil.c: Omit integer casts.
13520 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13521 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13522
13523 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13524
13525 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13526 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13527 would wrongly return t on a 64-bit host.
13528
13529 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13530 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13531 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13532 and therefore cause GCC to emit a bogus diagnostic in some cases.
13533
13534 * image.c: Integer signedness and overflow and related fixes.
13535 This is not an exhaustive set of fixes, but it's time to
13536 record what I've got.
13537 (lookup_pixel_color, check_image_size): Remove redundant decls.
13538 (check_image_size): Don't assume that arbitrary EMACS_INT values
13539 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13540 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13541 (tiff_load, imagemagick_load_image):
13542 Check for overflow in size calculations.
13543 (x_create_x_image_and_pixmap): Remove unnecessary test for
13544 xmalloc returning NULL; that can't happen.
13545 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13546 (xpm_color_bucket): Use better integer hashing function.
13547 (xpm_cache_color): Don't possibly over-allocate memory.
13548 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13549 (gif_memory_source):
13550 Use ptrdiff_t, not int or size_t, to record sizes.
13551 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13552 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13553 either works, as we prefer signed integers.
13554 (tiff_read_from_memory, tiff_write_from_memory):
13555 Return tsize_t, not size_t, since that's what the TIFF API wants.
13556 (tiff_read_from_memory): Don't fail simply because the read would
13557 go past EOF; instead, return a short read.
13558 (tiff_load): Omit no-longer-needed casts.
13559 (Fimagemagick_types): Don't assume size fits into 'int'.
13560
13561 Improve hashing quality when configured --with-wide-int.
13562 * fns.c (hash_string): New function, taken from sxhash_string.
13563 Do not discard information about ASCII character case; this
13564 discarding is no longer needed.
13565 (sxhash-string): Use it. Change sig to match it. Caller changed.
13566 * lisp.h: Declare it.
13567 * lread.c (hash_string): Remove, since we now use fns.c's version.
13568 The fns.c version returns a wider integer if --with-wide-int is
13569 specified, so this should help the quality of the hashing a bit.
13570
13571 * emacs.c: Integer overflow minor fix.
13572 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13573 Define only if GNU_LINUX.
13574 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13575
13576 * dispnew.c: Integer signedness and overflow fixes.
13577 Remove unnecessary forward decls, that were a maintenance hassle.
13578 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13579 All uses changed.
13580 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13581 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13582 (prepare_desired_row, line_draw_cost):
13583 Use int, not unsigned, where either works.
13584 (save_current_matrix, restore_current_matrix):
13585 Use ptrdiff_t, not size_t, where either works.
13586 (init_display): Check for overflow more accurately, and without
13587 relying on undefined behavior.
13588
13589 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13590 Remove, replacing with the new symbols in lisp.h. All uses changed.
13591 * fileio.c (make_temp_name):
13592 * filelock.c (lock_file_1, lock_file):
13593 * xdisp.c (message_dolog):
13594 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13595 Use pMd etc. instead.
13596 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13597 replacing the pWIDE etc. symbols removed from editfns.c.
13598
13599 * keyboard.h (num_input_events): Now uintmax_t.
13600 This is (very slightly) less likely to mess up due to wraparound.
13601 All uses changed.
13602
13603 * buffer.c: Integer signedness fixes.
13604 (alloc_buffer_text, enlarge_buffer_text):
13605 Use ptrdiff_t rather than size_t when either will do, as we prefer
13606 signed integers.
13607
13608 * alloc.c: Integer signedness and overflow fixes.
13609 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13610 (__malloc_size_t): Default to size_t, not to int.
13611 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13612 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13613 Prefer ptrdiff_t to size_t when either would do, as we prefer
13614 signed integers.
13615 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13616 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13617 Now const. Initialize with values that are in range even if char
13618 is signed.
13619 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13620 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13621 These functions do the right thing with sizes > 2**32.
13622 (check_depth): Now ptrdiff_t, not int.
13623 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13624 Adjust to new way of storing sizes. Check for size overflow bugs
13625 in rest of code.
13626 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13627 slightly wrong anyway, as it missed one instance of
13628 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13629 (refill_memory_reserve): Omit needless cast to size_t.
13630 (mark_object_loop_halt): Mark as externally visible.
13631
13632 * xselect.c: Integer signedness and overflow fixes.
13633 (Fx_register_dnd_atom, x_handle_dnd_message):
13634 Use ptrdiff_t, not size_t, since we prefer signed.
13635 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13636 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13637 x_dnd_atoms_size and x_dnd_atoms_length.
13638
13639 * doprnt.c: Prefer signed to unsigned when either works.
13640 * eval.c (verror):
13641 * doprnt.c (doprnt):
13642 * lisp.h (doprnt):
13643 * xdisp.c (vmessage):
13644 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13645 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13646 prefer signed arithmetic to avoid comparison confusion.
13647 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13648 but is a bit tricky.
13649
13650 Assume freestanding C89 headers, string.h, stdlib.h.
13651 * data.c, doprnt.c, floatfns.c, print.c:
13652 Include float.h unconditionally.
13653 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13654 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13655 * regex.c: Likewise for stddef.h, string.h.
13656 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13657 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13658 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13659 (STDC_HEADERS): Remove obsolete defines.
13660 * sysdep.c: Include limits.h unconditionally.
13661
13662 Assume support for memcmp, memcpy, memmove, memset.
13663 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13664 * regex.c (memcmp, memcpy):
13665 Remove; we assume C89 now.
13666
13667 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13668 (__malloc_safe_bcopy): Remove; no longer needed.
13669
13670 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13671 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13672 well either way, and we prefer signed to unsigned.
13673
13674 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13675
13676 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13677 closes the connection while we're reading (bug#9182).
13678
13679 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13680
13681 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13682 are specified (Bug#9168).
13683
13684 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13685
13686 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13687 Found by GCC static checking and --with-wide-int on a 32-bit host.
13688
13689 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13690
13691 * xdisp.c (compute_display_string_pos): Fix logic of caching
13692 previous display string position. Initialize cached_prev_pos to
13693 -1. Fixes slow-down at the beginning of a buffer.
13694
13695 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13696
13697 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13698 for attrs[LFACE_FONTSET_INDEX].
13699
13700 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13701
13702 * xml.c (parse_region): Remove unused local
13703 that was recently introduced.
13704
13705 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13706
13707 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13708 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13709
13710 * xdisp.c (move_it_in_display_line_to): Record the best matching
13711 position for TO_CHARPOS while scanning the line, and restore it on
13712 exit if none of the characters scanned was an exact match.
13713 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13714 when exact match is impossible due to invisible text, and the
13715 lines are truncated.
13716
13717 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13718
13719 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13720 for OSX >= 10.7.
13721
13722 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13723
13724 Fix a significant slow-down of cursor motion with C-n, C-p,
13725 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13726 auto-repeat under bidi redisplay in fontified buffers.
13727 * xdisp.c (compute_stop_pos_backwards): New function.
13728 (next_element_from_buffer): Call compute_stop_pos_backwards to
13729 find a suitable prev_stop when we find ourselves before
13730 base_level_stop.
13731 (reseat): Don't look for prev_stop, as that could mean a very long
13732 run.
13733 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13734 <cached_disp_overlay_modiff>: Cache for last found display string
13735 position.
13736 (compute_display_string_pos): Return the cached position if asked
13737 about the same buffer in the same area of character positions, and
13738 the buffer wasn't changed since the time the display string
13739 position was cached.
13740
13741 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13742
13743 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13744 is an integer, which is important for empty lines. (Bug#9149)
13745
13746 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13747
13748 * frame.c (Fmodify_frame_parameters): In tty case, update the
13749 default face if necessary (Bug#4238).
13750
13751 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13752
13753 * editfns.c (Fstring_to_char): No need to explain what a character
13754 is in the docstring (Bug#6576).
13755
13756 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13757
13758 * xml.c (parse_region): Make sure we always return a tree.
13759
13760 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13761
13762 * xml.c (parse_region): If a document contains only comments,
13763 return that, too.
13764
13765 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13766
13767 * xml.c (make_dom): Return comments, too.
13768
13769 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13770
13771 Port to OpenBSD.
13772 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13773 and the surrounding thread.
13774 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13775 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13776 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13777 timer goes off.
13778 * s/openbsd.h (BROKEN_SIGIO): Define.
13779 * unexelf.c (unexec) [__OpenBSD__]:
13780 Don't update the .mdebug section of the Alpha COFF symbol table.
13781
13782 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13783
13784 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13785 (bug#8460).
13786
13787 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13788
13789 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13790 This fixes some race conditions on the permissions of any newly
13791 created file.
13792
13793 * alloc.c (valid_pointer_p): Use pipe, not open.
13794 This fixes some permissions issues when debugging.
13795
13796 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13797 If fchown fails to set both uid and gid, try to set just gid,
13798 as that is sometimes allowed. Adjust the file's mode to eliminate
13799 setuid or setgid bits that are inappropriate if fchown fails.
13800
13801 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13802
13803 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13804 to compare Lisp_Objects.
13805 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13806 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13807 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13808
13809 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13810
13811 * lread.c (read_integer): Unread even EOF character.
13812 (read1): Likewise. Properly record start position of symbol.
13813
13814 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13815 symbol character follows.
13816
13817 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13818
13819 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13820 This works around a problem with the previous change to Fcopy_file.
13821 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13822 and without this change, GCC might complain about discarding
13823 fchown's return value.
13824
13825 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13826
13827 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13828
13829 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13830
13831 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13832
13833 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13834
13835 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13836 it's used from the C level.
13837
13838 * process.c: Use the same condition for POLL_FOR_INPUT in both
13839 keyboard.c and process.c (bug#1858).
13840
13841 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13842
13843 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13844 (Fgnutls_boot): Use it.
13845
13846 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13847
13848 * doc.c (Fsubstitute_command_keys): Revert last change.
13849
13850 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13851
13852 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13853 quotes the next character, and doesn't affect other longer
13854 sequences (bug#8935).
13855
13856 * lread.c (syms_of_lread): Clarify that is isn't only
13857 `eval-buffer' and `eval-defun' that's affected by
13858 `lexical-binding' (bug#8460).
13859
13860 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13861
13862 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13863 bidi redisplay when a line includes both an image and is truncated.
13864
13865 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13866
13867 Fix minor problems found by static checking.
13868 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13869 (elsz): Now a signed constant, not a size_t var. We prefer signed
13870 types to unsigned, to avoid integer comparison confusion. Without
13871 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13872 "cannot optimize loop, the loop counter may overflow", a symptom
13873 of the confusion.
13874 * indent.c (Fvertical_motion): Mark locals as initialized.
13875 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13876
13877 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13878
13879 * search.c (Fre_search_backward): Mention `case-fold-search' in
13880 all the re_search_* functions (bug#8138).
13881
13882 * keyboard.c (Fopen_dribble_file): Document when the file is
13883 closed (bug#8056).
13884
13885 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13886
13887 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13888 bidi_cache_idx.
13889
13890 Support bidi reordering of display and overlay strings.
13891 * xdisp.c (compute_display_string_pos)
13892 (compute_display_string_end): Accept additional argument STRING.
13893 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13894 (reseat_to_string): Initialize bidi_it->string.s and
13895 bidi_it->string.schars.
13896 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13897 NULL (avoids a crash in bidi_paragraph_init).
13898 Initialize itb.string.lstring.
13899 (init_iterator): Call bidi_init_it only of a valid
13900 buffer position was specified. Initialize paragraph_embedding to
13901 L2R.
13902 (reseat_to_string): Initialize the bidi iterator.
13903 (display_string): If we need to ignore text properties of
13904 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13905 original value of -1 will not work with bidi.)
13906 (compute_display_string_pos): First arg is now struct
13907 `text_pos *'; all callers changed. Support display properties on
13908 Lisp strings.
13909 (compute_display_string_end): Support display properties on Lisp
13910 strings.
13911 (init_iterator, reseat_1, reseat_to_string): Initialize the
13912 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13913 when iterating on a string not from display properties).
13914 (compute_display_string_pos, compute_display_string_end):
13915 Fix calculation of the object to scan. Fixes an error when using
13916 arrow keys.
13917 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13918 base_level_stop; instead, set base_level_stop to BEGV.
13919 Fixes crashes in vertical-motion.
13920 (next_element_from_buffer): Improve commentary for when
13921 the iterator is before prev_stop.
13922 (init_iterator): Initialize bidi_p from the default value of
13923 bidi-display-reordering, not from buffer-local value. Use the
13924 buffer-local value only if initializing for buffer iteration.
13925 (handle_invisible_prop): Support invisible properties on strings
13926 that are being bidi-reordered.
13927 (set_iterator_to_next): Support bidi reordering of C strings and
13928 Lisp strings.
13929 (next_element_from_string): Support bidi reordering of Lisp
13930 strings.
13931 (handle_stop_backwards): Support Lisp strings as well.
13932 (display_string): Support display of R2L glyph rows.
13933 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13934 (init_iterator): Don't initialize it->bidi_p for strings
13935 here.
13936 (reseat_to_string): Initialize it->bidi_p for strings here.
13937 (next_element_from_string, next_element_from_c_string)
13938 (next_element_from_buffer): Add xassert's for correspondence
13939 between IT's object being iterated and it->bidi_it.string
13940 structure.
13941 (face_before_or_after_it_pos): Support bidi iteration.
13942 (next_element_from_c_string): Handle the case of the first string
13943 character that is not the first one in the visual order.
13944 (get_visually_first_element): New function, refactored from common
13945 parts of next_element_from_buffer, next_element_from_string, and
13946 next_element_from_c_string.
13947 (tool_bar_lines_needed, redisplay_tool_bar)
13948 (display_menu_bar): Force left-to-right direction. Add a FIXME
13949 comment for making that be controlled by a user option.
13950 (push_it, pop_it): Save and restore the state of the
13951 bidi iterator. Save and restore the bidi_p flag.
13952 (pop_it): Iterate out of display property for string iteration as
13953 well.
13954 (iterate_out_of_display_property): Support iteration over strings.
13955 (handle_single_display_spec): Set up it->bidi_it for iteration
13956 over a display string, and call bidi_init_it.
13957 (handle_single_display_spec, next_overlay_string)
13958 (get_overlay_strings_1, push_display_prop): Set up the bidi
13959 iterator for displaying display or overlay strings.
13960 (forward_to_next_line_start): Don't use the shortcut if
13961 bidi-iterating.
13962 (back_to_previous_visible_line_start): If handle_display_prop
13963 pushed the iterator stack, restore the internal state of the bidi
13964 iterator by calling bidi_pop_it same number of times.
13965 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13966 and we are bidi-iterating, don't decrement the iterator position;
13967 instead, set the first_elt flag in the bidi iterator, to produce
13968 the same effect.
13969 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13970 (push_display_prop): xassert that we are iterating a buffer.
13971 (push_it, pop_it): Save and restore paragraph_embedding member.
13972 (handle_single_display_spec, next_overlay_string)
13973 (get_overlay_strings_1, reseat_1, reseat_to_string)
13974 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13975 correctly. Don't assume unibyte strings are not bidi-reordered.
13976 (compute_display_string_pos)
13977 (compute_display_string_end): Fix handling the case of C string.
13978 (push_it, pop_it): Save and restore from_disp_prop_p.
13979 (handle_single_display_spec, push_display_prop): Set the
13980 from_disp_prop_p flag.
13981 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13982 (pop_it): Call iterate_out_of_display_property only if we are
13983 popping after iteration over a string that came from a display
13984 property. Fix a typo in popping stretch info. Add an assertion
13985 for verifying that the iterator position is in sync with the bidi
13986 iterator.
13987 (handle_single_display_spec, get_overlay_strings_1)
13988 (push_display_prop): Fix initialization of paragraph direction for
13989 string when that of the parent object is not yet determined.
13990 (reseat_1): Call bidi_init_it to resync the bidi
13991 iterator with IT's position. (Bug#7616)
13992 (find_row_edges): If ROW->start.pos gives position
13993 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13994 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13995 Reset the from_disp_prop_p flag.
13996 (SAVE_IT, RESTORE_IT): New macros.
13997 (pos_visible_p, face_before_or_after_it_pos)
13998 (back_to_previous_visible_line_start)
13999 (move_it_in_display_line_to, move_it_in_display_line)
14000 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14001 (try_scrolling, redisplay_window, display_line): Use them when
14002 saving a temporary copy of the iterator and restoring it back.
14003 (back_to_previous_visible_line_start, reseat_1)
14004 (init_iterator): Empty the bidi cache "stack".
14005 (move_it_in_display_line_to): If iterator ended up at
14006 EOL, but we never saw any buffer positions smaller than
14007 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14008 motion in bidi-reordered lines.
14009 (move_it_in_display_line_to): Record prev_method and prev_pos
14010 immediately before the call to set_iterator_to_next. Fixes cursor
14011 motion in bidi-reordered lines with stretch glyphs and strings
14012 displayed in margins. (Bug#8133) (Bug#8867)
14013 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14014 TO_CHARPOS.
14015 (pos_visible_p): Support positions in bidi-reordered lines.
14016 Save and restore bidi cache.
14017
14018 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14019 (bidi_paragraph_info): Delete unused struct.
14020 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14021 (bidi_cache_start): New variable.
14022 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14023 to zero.
14024 (bidi_cache_fetch_state, bidi_cache_search)
14025 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14026 (bidi_cache_find, bidi_peek_at_next_level)
14027 (bidi_level_of_next_char, bidi_find_other_level_edge)
14028 (bidi_move_to_visually_next): Compare cache index with
14029 bidi_cache_start rather than with zero.
14030 (bidi_fetch_char): Accept new argument STRING; all callers
14031 changed. Support iteration over a string. Support strings with
14032 display properties. Support unibyte strings. Fix the type of
14033 `len' according to what STRING_CHAR_AND_LENGTH expects.
14034 (bidi_paragraph_init, bidi_resolve_explicit_1)
14035 (bidi_resolve_explicit, bidi_resolve_weak)
14036 (bidi_level_of_next_char, bidi_move_to_visually_next):
14037 Support iteration over a string.
14038 (bidi_set_sor_type, bidi_resolve_explicit_1)
14039 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14040 can now be zero (for strings); special values 0 and -1 were
14041 changed to -1 and -2, respectively.
14042 (bidi_char_at_pos): New function.
14043 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14044 Call it instead of FETCH_MULTIBYTE_CHAR.
14045 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14046 initialized to valid values.
14047 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14048 values.
14049 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14050 the test for valid cached positions. Fix the logic for looking up
14051 the sentinel state in the cache. GCPRO the Lisp string we are
14052 iterating.
14053 (bidi_push_it, bidi_pop_it): New functions.
14054 (bidi_initialize): Initialize the bidi cache start stack pointer.
14055 (bidi_cache_ensure_space): New function, refactored from part of
14056 bidi_cache_iterator_state. Don't assume the required size is just
14057 one BIDI_CACHE_CHUNK away.
14058 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14059 (bidi_count_bytes, bidi_char_at_pos): New functions.
14060 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14061 always valid if bidi_cache_idx is valid.
14062 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14063 is valid if it's going to be used.
14064 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14065 (bidi_cache_fetch_state, bidi_cache_search)
14066 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14067 (bidi_cache_iterator_state, bidi_cache_find)
14068 (bidi_find_other_level_edge, bidi_cache_start_stack):
14069 All variables related to cache indices are now EMACS_INT.
14070
14071 * dispextern.h (struct bidi_string_data): New structure.
14072 (struct bidi_it): New member `string'. Make flag members be 1-bit
14073 fields, and put them last in the struct.
14074 (compute_display_string_pos, compute_display_string_end):
14075 Update prototypes.
14076 (bidi_push_it, bidi_pop_it): Add prototypes.
14077 (struct iterator_stack_entry): New members bidi_p,
14078 paragraph_embedding, and from_disp_prop_p.
14079 (struct it): Member bidi_p is now a bit field 1 bit wide.
14080 (bidi_shelve_cache, bidi_unshelve_cache):
14081 Declare prototypes.
14082
14083 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14084 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14085 and vector-like objects.
14086
14087 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14088 cache around display iteration.
14089
14090 * window.c (Fwindow_end, window_scroll_pixel_based)
14091 (displayed_window_lines, Frecenter): Save and restore the bidi
14092 cache around display iteration.
14093
14094 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14095
14096 * editfns.c (Fdelete_region): Clarify the use of the named
14097 parameters (bug#6788).
14098
14099 2011-07-14 Martin Rudalics <rudalics@gmx.at>
14100
14101 * indent.c (Fvertical_motion): Set and restore w->pointm when
14102 saving and restoring the window's buffer (Bug#9006).
14103
14104 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14105
14106 * editfns.c (Fstring_to_char): Clarify just what is returned
14107 (bug#6576). Text by Eli Zaretskii.
14108
14109 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
14110
14111 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14112
14113 2011-07-13 Eli Zaretskii <eliz@gnu.org>
14114
14115 * buffer.c (mmap_find): Fix a typo.
14116
14117 2011-07-13 Johan Bockgård <bojohan@gnu.org>
14118
14119 Fix execution of x selection hooks.
14120 * xselect.c (Qx_lost_selection_functions)
14121 (Qx_sent_selection_functions): New vars.
14122 (syms_of_xselect): DEFSYM them.
14123 (x_handle_selection_request): Pass Qx_sent_selection_functions
14124 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14125 (x_handle_selection_clear,x_clear_frame_selections):
14126 Pass Qx_lost_selection_functions rather than
14127 Vx_lost_selection_functions to Frun_hook_with_args.
14128
14129 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14130
14131 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14132 The old code sometimes used this field without initializing it.
14133
14134 * alloc.c (gc_sweep): Don't read past end of array.
14135 In theory, the old code could also have corrupted Emacs internals,
14136 though it'd be very unlikely.
14137
14138 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14139
14140 * character.c (Fcharacterp): Don't advertise optional ignored
14141 argument. (Bug#4026)
14142
14143 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14144
14145 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14146 key" (bug#4257).
14147
14148 * window.c (Fset_window_start): Doc fix (bug#4199).
14149 (Fset_window_hscroll): Ditto.
14150
14151 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14152
14153 Fix minor new problems caught by GCC 4.6.1.
14154 * term.c (init_tty): Remove unused local.
14155 * xsettings.c (store_monospaced_changed): Define this function only
14156 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14157 not used otherwise.
14158
14159 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14160
14161 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14162
14163 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14164
14165 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14166 are the mini-buffer and the echo area (bug#3320).
14167
14168 * term.c (init_tty): Remove support for supdup, c10 and perq
14169 terminals, which are no longer supported (bug#1482).
14170
14171 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14172
14173 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14174
14175 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14176
14177 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14178 for non-popups (Bug#3642).
14179
14180 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14181
14182 * alloc.c (reset_malloc_hooks): Protoize.
14183 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14184 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14185 * cm.c (losecursor): Likewise.
14186 * data.c (fmod): Likewise.
14187 * dispnew.c (swap_glyphs_in_rows): Likewise.
14188 * emacs.c (memory_warning_signal): Likewise.
14189 * floatfns.c (float_error): Likewise.
14190 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14191 (otf_open, font_otf_capability, generate_otf_features)
14192 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14193 Likewise.
14194 * image.c (pbm_read_file): Likewise.
14195 * indent.c (string_display_width): Likewise.
14196 * intervals.c (check_for_interval, search_for_interval)
14197 (inc_interval_count, count_intervals, root_interval)
14198 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14199 * lread.c (defalias): Likewise.
14200 * ralloc.c (r_alloc_check): Likewise.
14201 * regex.c (set_image_of_range_1, set_image_of_range)
14202 (regex_grow_registers): Likewise.
14203 * sysdep.c (strerror): Likewise.
14204 * termcap.c (valid_filename_p, tprint, main): Likewise.
14205 * tparam.c (main): Likewise.
14206 * unexhp9k800.c (run_time_remap, save_data_space)
14207 (update_file_ptrs, read_header, write_header, calculate_checksum)
14208 (copy_file, copy_rest, display_header): Likewise.
14209 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14210 Likewise.
14211 * xdisp.c (check_it): Likewise.
14212 * xfaces.c (register_color, unregister_color, unregister_colors):
14213 Likewise.
14214 * xfns.c (print_fontset_result): Likewise.
14215 * xrdb.c (member, fatal, main): Likewise.
14216
14217 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14218
14219 Fix minor problems found by static checking (Bug#9031).
14220 * chartab.c (char_table_set_range, map_sub_char_table):
14221 Remove unused locals.
14222 (uniprop_table): Now static.
14223 * composite.c (_work_char): Remove unused static var.
14224
14225 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14226
14227 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14228
14229 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14230
14231 * gtkutil.c (qttip_cb): Remove code without function.
14232
14233 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14234
14235 * w32.c (pthread_sigmask): New stub.
14236
14237 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14238
14239 Use pthread_sigmask, not sigprocmask (Bug#9010).
14240 sigprocmask is portable only for single-threaded applications, and
14241 Emacs can be multi-threaded when it uses GTK.
14242 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14243 (LIBES): Use it.
14244 * callproc.c (Fcall_process):
14245 * process.c (create_process):
14246 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14247 Use pthread_sigmask, not sigprocmask.
14248
14249 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14250
14251 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14252 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14253 wrong (Bug#8591).
14254
14255 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14256
14257 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14258 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14259 (xg_hide_tooltip): Fix comment.
14260
14261 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14262 in registerServicesMenuSendTypes.
14263 (validRequestorForSendType): Don't check ns_return_types.
14264
14265 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14266 ns_return_type.
14267
14268 2011-07-08 Jason Rumney <jasonr@gnu.org>
14269
14270 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14271 SH_SHOW for hidden windows (Bug#5482).
14272
14273 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14274 frame struct members of non-existent frames (Bug#6284).
14275
14276 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14277
14278 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14279 variable firstTime not needed on OSX >= 10.6.
14280 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14281 >= 10.5. Use setKnobProportion, setDoubleValue.
14282
14283 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14284 (MAC_OS_X_VERSION_10_5): Define if not defined.
14285 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14286 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14287 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14288
14289 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14290 cString and lossyCString on OSX >= 10.4.
14291
14292 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14293 sizeToFit on OSX >= 10.2.
14294
14295 * nsimage.m (allocInitFromFile): Don't use deprecated method
14296 bestRepresentationForDevice on OSX >= 10.6.
14297
14298 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14299 to avoid warning.
14300
14301 * emacs.c: Declare unexec_init_emacs_zone.
14302
14303 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14304
14305 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14306
14307 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14308 on svcsMenu (Bug#8842).
14309
14310 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14311 ns_return_types.
14312 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14313
14314 * nsterm.m (QUTF8_STRING): Declare.
14315 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14316 (validRequestorForSendType): Return type is (id).
14317 Change indexOfObjectIdenticalTo to indexOfObject.
14318 Check if we have local selection before returning self (Bug#8842).
14319 (writeSelectionToPasteboard): Put local selection into paste board
14320 if we have a local selection (Bug#8842).
14321 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14322
14323 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14324 (ns_get_local_selection): Declare.
14325
14326 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14327
14328 * keymap.c (describe_map_tree): Don't insert a double newline at
14329 the end of the buffer (bug#1169) and return whether we inserted
14330 something.
14331
14332 * callint.c (Fcall_interactively): Change "reading args" to
14333 "providing args" to try to clarify what it does (bug#1010).
14334
14335 2011-07-07 Kenichi Handa <handa@m17n.org>
14336
14337 * composite.c (composition_compute_stop_pos): Ignore a static
14338 composition starting before CHARPOS (Bug#8915).
14339
14340 * xdisp.c (handle_composition_prop): Likewise.
14341
14342 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14343
14344 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14345 (Bug#9015)
14346
14347 2011-07-07 Kenichi Handa <handa@m17n.org>
14348
14349 * character.h (unicode_category_t): New enum type.
14350
14351 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14352 (Qchar_code_property_table): New variable.
14353 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14354 (UNIPROP_COMPRESSED_FORM_P): New macros.
14355 (char_table_ascii): Uncompress the compressed values.
14356 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14357 Uncompress the compressed values.
14358 (sub_char_table_ref_and_range): Likewise.
14359 (char_table_ref_and_range): Uncompress the compressed values.
14360 (sub_char_table_set): New arg is_uniprop. Callers changed.
14361 Uncompress the compressed values.
14362 (sub_char_table_set_range): Args changed. Callers changed.
14363 (char_table_set_range): Adjuted for the above change.
14364 (map_sub_char_table): Delete args default_val and parent. Add arg
14365 top. Give decoded values to a Lisp function.
14366 (map_char_table): Adjust for the above change. Give decoded
14367 values to a Lisp function. Gcpro more variables.
14368 (uniprop_table_uncompress)
14369 (uniprop_decode_value_run_length): New functions.
14370 (uniprop_decoder, uniprop_decoder_count): New variables.
14371 (uniprop_get_decoder, uniprop_encode_value_character)
14372 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14373 New functions.
14374 (uniprop_encoder, uniprop_encoder_count): New variables.
14375 (uniprop_get_encoder, uniprop_table)
14376 (Funicode_property_table_internal, Fget_unicode_property_internal)
14377 (Fput_unicode_property_internal): New functions.
14378 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14379 Sunicode_property_table_internal, Sget_unicode_property_internal,
14380 and Sput_unicode_property_internal. Defvar_lisp
14381 char-code-property-alist.
14382
14383 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14384 Vunicode_category_table.
14385
14386 * font.c (font_range): Adjust for the change of
14387 Vunicode_category_table.
14388
14389 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14390
14391 * m/iris4d.h: Remove file, move contents ...
14392 * s/irix6-5.h: ... here.
14393
14394 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14395
14396 Remove unportable assumption about struct layout (Bug#8884).
14397 * alloc.c (mark_buffer):
14398 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14399 (clone_per_buffer_values): Don't assume that
14400 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14401 This isn't true in general, and it's particularly not true
14402 if Emacs is configured with --with-wide-int.
14403 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14404 New macros, used in the buffer.c change.
14405
14406 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14407
14408 * xsettings.c: Use both GConf and GSettings if both are available.
14409 (store_config_changed_event): Add comment.
14410 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14411 (store_tool_bar_style_changed): New functions.
14412 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14413 (struct xsettings): Move font inside HAVE_XFT.
14414 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14415 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14416 Move inside HAVE_XFT.
14417 (something_changed_gsettingsCB): Rename from something_changedCB.
14418 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14419 also.
14420 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14421 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14422 (something_changed_gconfCB): Rename from something_changedCB.
14423 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14424 (parse_settings): Move check for font inside HAVE_XFT.
14425 (read_settings, apply_xft_settings): Add comment.
14426 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14427 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14428 call store_font_name_changed.
14429 (xft_settings_event): Add comment.
14430 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14431 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14432 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14433 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14434 (xsettings_initialize): Call init_gsettings last.
14435 (xsettings_get_system_font, xsettings_get_system_normal_font):
14436 Add comment.
14437
14438 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14439
14440 Random fixes. E.g., (random) never returned negative values.
14441 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14442 subseconds part to the entropy, as that's a bit more random.
14443 Prefer signed to unsigned, since the signedness doesn't matter and
14444 in general we prefer signed. When given a limit, use a
14445 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14446 latter isn't right if USE_2_TAGS_FOR_INTS.
14447 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14448 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14449
14450 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14451
14452 * textprop.c (text_property_stickiness):
14453 Obey Vtext_property_default_nonsticky.
14454 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14455 * w32fns.c (syms_of_w32fns):
14456 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14457
14458 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14459
14460 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14461 This is more efficient than Ffile_directory_p and avoids a minor race.
14462
14463 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14464
14465 * buffer.c (Foverlay_put): Say what the return value is
14466 (bug#7835).
14467
14468 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14469 is a directory before asking whether to use the file name
14470 (bug#7564).
14471 (barf_or_query_if_file_exists): Make the "File is a directory"
14472 error be more correct.
14473
14474 * fns.c (Frequire): Remove the mention of the .gz files, since
14475 that's installation-specific, but keep the mention of
14476 `get-load-suffixes'.
14477
14478 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14479
14480 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14481 Report string overflow if the output is too long.
14482
14483 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14484
14485 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14486 (syms_of_gnutls): Remove duplicate DEFSYM for
14487 Qgnutls_bootprop_verify_hostname_error, an error for
14488 Qgnutls_bootprop_verify_error (which is no longer used).
14489
14490 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14491 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14492 Also (re)move comments that are misplaced or no longer relevant.
14493
14494 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14495
14496 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14497
14498 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14499
14500 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14501 and background color parameters if they have been changed.
14502
14503 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14504
14505 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14506
14507 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14508
14509 * xsettings.c (SYSTEM_FONT): Define only when used.
14510 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14511
14512 * keymap.c (access_keymap_1): Now static.
14513
14514 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14515
14516 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14517 leave any prefix arg for the up event (Bug#1586).
14518
14519 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14520
14521 * lread.c (syms_of_lread): Mention single symbols defined by
14522 `defvar' or `defconst' (bug#7154).
14523
14524 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14525 (Frequire): Mention get-load-suffixes.
14526
14527 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14528
14529 * window.h (window): Remove clone_number slot.
14530 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14531 Remove.
14532 (make_parent_window, make_window, saved_window)
14533 (Fset_window_configuration, save_window_save): Don't deal with
14534 clone numbers.
14535 * buffer.c (Qclone_number): Remove declaration.
14536 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14537
14538 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14539
14540 Add multiple inheritance to keymaps.
14541 * keymap.c (Fmake_composed_keymap): New function.
14542 (Fset_keymap_parent): Simplify.
14543 (fix_submap_inheritance): Remove.
14544 (access_keymap_1): New function extracted from access_keymap to handle
14545 embedded parents and handle lists of maps.
14546 (access_keymap): Use it.
14547 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14548 (Fcopy_keymap): Handle embedded parents.
14549 (Fcommand_remapping, define_as_prefix): Simplify.
14550 (Fkey_binding): Simplify.
14551 (syms_of_keymap): Move minibuffer-local-completion-map,
14552 minibuffer-local-filename-completion-map,
14553 minibuffer-local-must-match-map, and
14554 minibuffer-local-filename-must-match-map to Elisp.
14555 (syms_of_keymap): Defsubr make-composed-keymap.
14556 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14557 (parse_menu_item): Trivial simplification.
14558
14559 2011-07-01 Glenn Morris <rgm@gnu.org>
14560
14561 * Makefile.in (SETTINGS_LIBS): Fix typo.
14562
14563 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14564
14565 * coding.c (Fencode_coding_string): Record the last coding system
14566 used, as the function doc string says (bug#8738).
14567
14568 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14569
14570 * xsettings.c (store_monospaced_changed): Take new font as arg and
14571 check for change against current_mono_font.
14572 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14573 (emacs_settings_constructor, emacs_settings_get_property)
14574 (emacs_settings_set_property, emacs_settings_class_init)
14575 (emacs_settings_init, gsettings_obj): Remove.
14576 (something_changedCB): New function for HAVE_GSETTINGS.
14577 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14578 with value as argument.
14579 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14580 g_settings_new (Bug#8967). Do not create gsettings_obj.
14581 Remove calls to g_settings_bind. Connect something_changedCB to
14582 "changed".
14583
14584 * xgselect.c: Add defined (HAVE_GSETTINGS).
14585 (xgselect_initialize): Ditto.
14586
14587 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14588 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14589 xg_select.
14590
14591 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14592
14593 * eval.c (struct backtrace): Simplify and port the data structure.
14594 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14595 signed bit field, as this assumption is not portable and it makes
14596 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14597 "char debug_on_exit : 1" as this is not portable either; instead,
14598 use the portable "unsigned int debug_on_exit : 1". Remove unused
14599 member evalargs. Remove obsolete comments about cc bombing out.
14600
14601 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14602
14603 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14604 Let HAVE_GSETTINGS override HAVE_GCONF.
14605 (store_monospaced_changed): New function.
14606 (EMACS_SETTINGS): A new type derived from GObject to handle
14607 GSettings notifications.
14608 (emacs_settings_constructor, emacs_settings_get_property)
14609 (emacs_settings_set_property, emacs_settings_class_init):
14610 New functions.
14611 (gsettings_client, gsettings_obj): New variables.
14612 (GSETTINGS_SCHEMA): New define.
14613 (something_changedCB): Call store_monospaced_changed.
14614 (init_gsettings): New function.
14615 (xsettings_initialize): Call init_gsettings.
14616 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14617 to NULL.
14618
14619 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14620 GCONF_CFLAGS/LIBS.
14621
14622 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14623
14624 * window.c (resize_root_window, grow_mini_window)
14625 (shrink_mini_window): Rename Qresize_root_window to
14626 Qwindow_resize_root_window and Qresize_root_window_vertically to
14627 Qwindow_resize_root_window_vertically.
14628
14629 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14630
14631 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14632
14633 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14634
14635 * makefile.w32-in: Redesign dependencies so they reflect more
14636 clearly which files are directly included by each source file,
14637 and not through other includes.
14638
14639 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14640
14641 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14642 (sort_overlays, overlay_strings): When an overlay's clone number
14643 matches the window's clone number process the overlay even if
14644 the overlay's window property doesn't match the current window.
14645
14646 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14647 (Fwindow_hchild): Rename to Fwindow_left_child.
14648 (Fwindow_next): Rename to Fwindow_next_sibling.
14649 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14650 (resize_window_check): Rename to window_resize_check.
14651 (resize_window_apply): Rename to window_resize_apply.
14652 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14653 (Fdelete_other_windows_internal, resize_frame_windows)
14654 (Fsplit_window_internal, Fdelete_window_internal)
14655 (grow_mini_window, shrink_mini_window)
14656 (Fresize_mini_window_internal): Fix callers accordingly.
14657
14658 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14659
14660 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14661 (emacs_fixed_set_min_size): Remove.
14662 (emacs_fixed_new): Take frame as argument.
14663
14664 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14665 (_EmacsFixedPrivate): Remove minwidth/height.
14666 Add struct frame *f.
14667 (emacs_fixed_init): Initialize priv->f.
14668 (get_parent_class, emacs_fixed_set_min_size): Remove.
14669 (emacs_fixed_new): Set priv->f to argument.
14670 (emacs_fixed_get_preferred_width)
14671 (emacs_fixed_get_preferred_height): Use min_width/height from
14672 frames size_hint to set minimum and natural (Bug#8919).
14673 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14674 and use min_width/height from frames size_hint to set
14675 min_width/height (Bug#8919).
14676
14677 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14678 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14679 Fix indentation.
14680
14681 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14682
14683 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14684 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14685 called at ZV.
14686
14687 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14688
14689 * process.c (wait_reading_process_output): Bypass select if
14690 waiting for a cell while ignoring keyboard input, and input is
14691 pending. Suggested by Jan Djärv (Bug#8869).
14692
14693 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14694
14695 Use gnulib's dup2 module instead of rolling our own.
14696 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14697
14698 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14699
14700 * dispnew.c (scrolling_window): Before scrolling, turn off a
14701 mouse-highlight in the window being scrolled.
14702
14703 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14704
14705 Move DEFSYM to lisp.h and use everywhere.
14706
14707 * character.h (DEFSYM): Move declaration...
14708 * lisp.h (DEFSYM): ...here.
14709
14710 * gnutls.c:
14711 * minibuf.c:
14712 * w32menu.c:
14713 * w32proc.c:
14714 * w32select.c: Don't include character.h.
14715
14716 * alloc.c (syms_of_alloc):
14717 * buffer.c (syms_of_buffer):
14718 * bytecode.c (syms_of_bytecode):
14719 * callint.c (syms_of_callint):
14720 * casefiddle.c (syms_of_casefiddle):
14721 * casetab.c (init_casetab_once):
14722 * category.c (init_category_once, syms_of_category):
14723 * ccl.c (syms_of_ccl):
14724 * cmds.c (syms_of_cmds):
14725 * composite.c (syms_of_composite):
14726 * dbusbind.c (syms_of_dbusbind):
14727 * dired.c (syms_of_dired):
14728 * dispnew.c (syms_of_display):
14729 * doc.c (syms_of_doc):
14730 * editfns.c (syms_of_editfns):
14731 * emacs.c (syms_of_emacs):
14732 * eval.c (syms_of_eval):
14733 * fileio.c (syms_of_fileio):
14734 * fns.c (syms_of_fns):
14735 * frame.c (syms_of_frame):
14736 * fringe.c (syms_of_fringe):
14737 * insdel.c (syms_of_insdel):
14738 * keymap.c (syms_of_keymap):
14739 * lread.c (init_obarray, syms_of_lread):
14740 * macros.c (syms_of_macros):
14741 * msdos.c (syms_of_msdos):
14742 * print.c (syms_of_print):
14743 * process.c (syms_of_process):
14744 * search.c (syms_of_search):
14745 * sound.c (syms_of_sound):
14746 * syntax.c (init_syntax_once, syms_of_syntax):
14747 * terminal.c (syms_of_terminal):
14748 * textprop.c (syms_of_textprop):
14749 * undo.c (syms_of_undo):
14750 * w32.c (globals_of_w32):
14751 * window.c (syms_of_window):
14752 * xdisp.c (syms_of_xdisp):
14753 * xfaces.c (syms_of_xfaces):
14754 * xfns.c (syms_of_xfns):
14755 * xmenu.c (syms_of_xmenu):
14756 * xsettings.c (syms_of_xsettings):
14757 * xterm.c (syms_of_xterm): Use DEFSYM.
14758
14759 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14760
14761 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14762
14763 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14764
14765 Integer and buffer overflow fixes (Bug#8873).
14766
14767 * print.c (printchar, strout): Check for string overflow.
14768 (PRINTPREPARE, printchar, strout):
14769 Don't set size unless allocation succeeds.
14770
14771 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14772 for sizes. Check for string overflow more accurately.
14773 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14774
14775 * macros.c: Integer and buffer overflow fixes.
14776 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14777 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14778 Use ptrdiff_t, not int, for sizes.
14779 Don't increment bufsize until after realloc succeeds.
14780 Check for size-calculation overflow.
14781 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14782
14783 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14784
14785 * lread.c: Integer overflow fixes.
14786 (read_integer): Radix is now EMACS_INT, not int,
14787 to improve quality of diagnostics for out-of-range radices.
14788 Calculate buffer size correctly for out-of-range radices.
14789 (read1): Check for integer overflow in radices, and in
14790 read-circle numbers.
14791 (read_escape): Avoid int overflow.
14792 (Fload, openp, read_buffer_size, read1)
14793 (substitute_object_recurse, read_vector, read_list, map_obarray):
14794 Use ptrdiff_t, not int, for sizes.
14795 (read1): Use EMACS_INT, not int, for sizes.
14796 Check for size overflow.
14797
14798 * image.c (cache_image): Check for size arithmetic overflow.
14799
14800 * lread.c: Integer overflow issues.
14801 (saved_doc_string_size, saved_doc_string_length)
14802 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14803 Now ptrdiff_t, not int.
14804 (read1): Don't assume doc string length fits in int. Check for
14805 out-of-range doc string lengths.
14806 (read_list): Don't assume file position fits in int.
14807 (read_escape): Check for hex character overflow.
14808
14809 2011-06-22 Leo Liu <sdl.web@gmail.com>
14810
14811 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14812 Move to minibuffer.el.
14813
14814 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14815
14816 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14817 The following patches are for when GLYPH_DEBUG && !XASSERT.
14818 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14819 * dispnew.c (flush_stdout):
14820 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14821 Mark as externally visible.
14822 * dispnew.c (check_window_matrix_pointers): Now static.
14823 * dispnew.c (window_to_frame_vpos):
14824 * xfns.c (unwind_create_frame):
14825 * xterm.c (x_check_font): Remove unused local.
14826 * scroll.c (CHECK_BOUNDS):
14827 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14828 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14829 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14830 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14831 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14832 Now static.
14833 (debug_method_add): Use va_list and vsprintf rather than relying
14834 on undefined behavior with wrong number of arguments.
14835 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14836 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14837 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14838 since we're not interested in debugging glyphs with old libraries.
14839 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14840 GCC 4.6.0's static checking.
14841
14842 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14843
14844 Integer overflow and signedness fixes (Bug#8873).
14845 A few related buffer overrun fixes, too.
14846
14847 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14848
14849 * dispextern.h (struct face.stipple):
14850 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14851 (x_bitmap_mask, x_allocate_bitmap_record)
14852 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14853 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14854 (x_create_bitmap_from_xpm_data):
14855 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14856 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14857 (.bitmaps_last):
14858 * xfaces.c (load_pixmap):
14859 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14860 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14861 (.bitmaps_last, struct x_output.icon_bitmap):
14862 Use ptrdiff_t, not int, for bitmap indexes.
14863 (x_allocate_bitmap_record): Check for size overflow.
14864 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14865
14866 Use ptrdiff_t, not int, for overlay counts.
14867 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14868 * editfns.c (overlays_around, get_pos_property):
14869 * textprop.c (get_char_property_and_overlay):
14870 * xdisp.c (next_overlay_change, note_mouse_highlight):
14871 * xfaces.c (face_at_buffer_position):
14872 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14873 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14874 (Fnext_overlay_change, Fprevious_overlay_change)
14875 (mouse_face_overlay_overlaps, Foverlays_in):
14876 Use ptrdiff_t, not int, for sizes.
14877 (overlays_at, overlays_in): Check for size-calculation overflow.
14878
14879 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14880
14881 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14882 (x_session_initialize): Do not assume string length fits in int.
14883
14884 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14885 This is unlikely, but can occur if DPI is outlandish.
14886
14887 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14888 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14889
14890 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14891 * xrdb.c (magic_file_p, search_magic_path):
14892 Omit last arg SUFFIX; it was always 0. All callers changed.
14893 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14894
14895 * xfont.c (xfont_match): Avoid need for strlen.
14896
14897 * xfns.c: Don't assume strlen fits in int.
14898 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14899
14900 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14901 not unsigned long, as we prefer signed integers. All callers changed.
14902 Detect integer overflow in repeat count.
14903 (message_dolog): Don't assume print length fits in 39 bytes.
14904 (display_mode_element): Don't assume strlen fits in int.
14905
14906 * termcap.c: Don't assume sizes fit in int and never overflow.
14907 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14908 (gobble_line): Check for size-calculation overflow.
14909
14910 * minibuf.c (Fread_buffer):
14911 * lread.c (intern, intern_c_string):
14912 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14913 Don't assume string length fits in int.
14914
14915 * keyboard.c (parse_tool_bar_item):
14916 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14917
14918 * font.c: Don't assume string length fits in int.
14919 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14920 Use ptrdiff_t, not int.
14921 (font_intern_prop): Don't assume string length fits in int.
14922 Don't assume integer property fits in fixnum.
14923 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14924
14925 * filelock.c: Fix some buffer overrun and integer overflow issues.
14926 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14927 Reformulate so as not to need the command string.
14928 Invoke gzip -cd rather than gunzip, as it's more portable.
14929 (lock_info_type, lock_file_1, lock_file):
14930 Don't assume pid_t and time_t fit in unsigned long.
14931 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14932 (current_lock_owner): Prefer signed type for sizes.
14933 Use memcpy, not strncpy, where memcpy is what is really wanted.
14934 Don't assume (via atoi) that time_t and pid_t fit in int.
14935 Check for time_t and/or pid_t out of range, e.g., via a network share.
14936 Don't alloca where an auto var works fine.
14937
14938 * fileio.c: Fix some integer overflow issues.
14939 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14940 Don't assume string length fits in int.
14941 (directory_file_name): Don't assume string length fits in long.
14942 (make_temp_name): Don't assume pid fits in int, or that its print
14943 length is less than 20.
14944
14945 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14946
14947 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14948
14949 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14950
14951 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14952 We prefer signed integers, even for size calculations.
14953
14954 * emacs.c: Don't assume string length fits in 'int'.
14955 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14956 (main): Don't invoke strlen when not needed.
14957
14958 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14959 (XD_DEBUG_MESSAGE): Don't waste a byte.
14960
14961 * callproc.c (getenv_internal_1, getenv_internal)
14962 (Fgetenv_internal):
14963 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14964
14965 * lread.c (invalid_syntax): Omit length argument.
14966 All uses changed. This doesn't fix a bug, but it simplifies the
14967 code away from its former Hollerith-constant appearance, and it's
14968 one less 'int' to worry about when looking at integer-overflow issues.
14969 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14970
14971 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14972 This didn't break anything, but it didn't help either.
14973 It's confusing to put a bogus integer in a place where the actual
14974 value does not matter.
14975 (LIST_END_P): Remove unused macro and its bogus comment.
14976 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14977
14978 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14979 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14980 implementation.
14981 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14982 We prefer signed types, and the value cannot exceed the EMACS_INT
14983 range anyway (because otherwise the length would not be representable).
14984 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14985 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14986 This avoids a GCC warning when WIDE_EMACS_INT.
14987
14988 * indent.c (sane_tab_width): New function.
14989 (current_column, scan_for_column, Findent_to, position_indentation)
14990 (compute_motion): Use it. This is just for clarity.
14991 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14992
14993 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14994
14995 * lisp.h (lint_assume): New macro.
14996 * composite.c (composition_gstring_put_cache):
14997 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14998
14999 * editfns.c, insdel.c:
15000 Omit unnecessary forward decls, to simplify future changes.
15001
15002 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15003
15004 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15005
15006 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15007 Use much-faster test for byte-length change.
15008 Don't assume string byte-length fits in 'int'.
15009 Check that character arg fits in 'int'.
15010 (mapcar1): Declare byte as byte, for clarity.
15011
15012 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15013
15014 * fns.c (concat): Catch string overflow earlier.
15015 Do not rely on integer wraparound.
15016
15017 * dispextern.h (struct it.overlay_strings_charpos)
15018 (struct it.selective): Now EMACS_INT, not int.
15019 * xdisp.c (forward_to_next_line_start)
15020 (back_to_previous_visible_line_start)
15021 (reseat_at_next_visible_line_start, next_element_from_buffer):
15022 Don't arbitrarily truncate the value of 'selective' to int.
15023
15024 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15025
15026 * composite.c: Don't truncate sizes to 'int'.
15027 (composition_gstring_p, composition_reseat_it)
15028 (composition_adjust_point): Use EMACS_INT, not int.
15029 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15030 not EMACS_UINT, for indexes.
15031
15032 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15033
15034 * buffer.c: Include <verify.h>.
15035 (struct sortvec.priority, struct sortstr.priority):
15036 Now EMACS_INT, not int.
15037 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15038 (struct sortstr.size, record_overlay_string)
15039 (struct sortstrlist.size, struct sortlist.used):
15040 Don't truncate size to int.
15041 (record_overlay_string): Check for size-calculation overflow.
15042 (init_buffer_once): Check at compile-time, not run-time.
15043
15044 2011-06-22 Jim Meyering <meyering@redhat.com>
15045
15046 Don't leak an XBM-image-sized buffer
15047 * image.c (xbm_load): Free the image buffer after using it.
15048
15049 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15050
15051 Port to Sun C.
15052 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15053 that Sun C diagnosed.
15054 * fns.c (secure_hash): Fix pointer signedness issue.
15055 * intervals.c (static_offset_intervals): New function.
15056 (offset_intervals): Use it.
15057
15058 2011-06-21 Leo Liu <sdl.web@gmail.com>
15059
15060 * deps.mk (fns.o):
15061 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15062 sha512.h.
15063
15064 * fns.c (secure_hash): Rename from crypto_hash_function and change
15065 the first arg to accept symbols.
15066 (Fsecure_hash): New primitive.
15067 (syms_of_fns): New symbols.
15068
15069 2011-06-20 Deniz Dogan <deniz@dogan.se>
15070
15071 * process.c (Fset_process_buffer): Clarify return value in
15072 docstring.
15073
15074 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15075
15076 * dispnew.c (add_window_display_history): Use BVAR.
15077
15078 * xdisp.c (debug_method_add): Use BVAR.
15079 (check_window_end, dump_glyph_matrix, dump_glyph)
15080 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15081
15082 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15083 Likewise.
15084
15085 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15086 check till after the cache is created in init_frame_faces.
15087
15088 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15089
15090 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15091
15092 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15093
15094 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15095 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15096 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15097
15098 Improve buffer-overflow checking (Bug#8873).
15099 * fileio.c (Finsert_file_contents):
15100 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15101 Remove the old (too-loose) buffer overflow checks.
15102 They weren't needed, since make_gap checks for buffer overflow.
15103 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15104 The old code merely checked for Emacs fixnum overflow, and relied
15105 on undefined (wraparound) behavior. The new code avoids undefined
15106 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15107
15108 * editfns.c (Finsert_char): Don't dump core with very negative counts.
15109 Tune. Don't use wider integers than needed. Don't use alloca.
15110 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
15111
15112 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15113
15114 * insdel.c, lisp.h (buffer_overflow): New function.
15115 (insert_from_buffer_1, replace_range, replace_range_2):
15116 * insdel.c (make_gap_larger):
15117 * editfns.c (Finsert_char):
15118 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15119
15120 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15121
15122 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
15123
15124 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15125
15126 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15127 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15128
15129 * fileio.c: Don't assume EMACS_INT fits in off_t.
15130 (emacs_lseek): New static function.
15131 (Finsert_file_contents, Fwrite_region): Use it.
15132 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15133
15134 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15135
15136 * fns.c: Don't overflow int when computing a list length.
15137 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15138 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15139 truncation on 64-bit hosts. Check for QUIT every
15140 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15141 faster and is responsive enough.
15142 (Flength): Report an error instead of overflowing an integer.
15143 (Fsafe_length): Return a float if the value is not representable
15144 as a fixnum. This shouldn't happen except in contrived situations.
15145 (Fnthcdr, Fsort): Don't assume list length fits in int.
15146 (Fcopy_sequence): Don't assume vector length fits in int.
15147
15148 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15149 (header_size, word_size): New constants.
15150 (allocate_vectorlike): Don't check size overflow here.
15151 (allocate_vector): Check it here instead, since this is the only
15152 caller of allocate_vectorlike that could cause overflow.
15153 Check that the new vector's length is representable as a fixnum.
15154
15155 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15156 The previous code was bogus. For example, next_almost_prime (32)
15157 returned 39, which is undesirable as it is a multiple of 3; and
15158 next_almost_prime (24) returned 25, which is a multiple of 5 so
15159 why was the code bothering to check for multiples of 7?
15160
15161 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15162
15163 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15164
15165 Variadic C functions now count arguments with ptrdiff_t.
15166 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15167 Back then I didn't know that the Emacs coding style prefers signed int.
15168 Also, in the meantime I found a few more instances where arguments
15169 were being counted with int, which may truncate counts on 64-bit
15170 machines, or EMACS_INT, which may be unnecessarily wide.
15171 * lisp.h (struct Lisp_Subr.function.aMANY)
15172 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15173 Arg counts are now ptrdiff_t, not size_t.
15174 All variadic functions and their callers changed accordingly.
15175 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15176 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15177 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15178 * callint.c (Fcall_interactively): Check arg count for overflow,
15179 to avoid potential buffer overrun. Use signed char, not 'int',
15180 for 'varies' array, so that we needn't bother to check its size
15181 calculation for overflow.
15182 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15183 * eval.c (apply_lambda):
15184 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15185 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15186 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15187
15188 * callint.c (Fcall_interactively): Don't use index var as event count.
15189
15190 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15191 * mem-limits.h (SIZE): Remove; no longer used.
15192
15193 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15194
15195 Remove unnecessary casts.
15196 * xterm.c (x_term_init):
15197 * xfns.c (x_set_border_pixel):
15198 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15199 These aren't needed now that we assume ANSI C.
15200
15201 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15202 It's more likely to cause problems (due to unsigned overflow)
15203 than to cure them.
15204
15205 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15206
15207 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15208
15209 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15210
15211 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15212
15213 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15214
15215 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15216
15217 GLYPH_CODE_FACE returns EMACS_INT, not int.
15218 * dispextern.h (merge_faces):
15219 * xfaces.c (merge_faces):
15220 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15221 Don't assume EMACS_INT fits in int.
15222
15223 * character.h (CHAR_VALID_P): Remove unused parameter.
15224 * fontset.c, lisp.h, xdisp.c: All uses changed.
15225
15226 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15227
15228 * fns.c (concat): Minor tuning based on overflow analysis.
15229 This doesn't fix any bugs. Use int to hold character, instead
15230 of constantly refetching from Emacs object. Use XFASTINT, not
15231 XINT, for value known to be a character. Don't bother comparing
15232 a single byte to 0400, as it's always less.
15233
15234 * floatfns.c (Fexpt):
15235 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15236
15237 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15238 for characters.
15239
15240 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15241
15242 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15243 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15244 incorrectly succeed when S was a string, because 4294967386 was
15245 truncated before it was used.
15246
15247 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15248 Otherwise, an out-of-range integer could cause undefined behavior
15249 on a 64-bit host.
15250
15251 * composite.c: Use int, not EMACS_INT, for characters.
15252 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15253 EMACS_INT, for values that are known to be in character range.
15254 This doesn't fix any bugs but is the usual style inside Emacs and
15255 may generate better code on 32-bit machines.
15256
15257 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15258 This is for reasons similar to the recent CHAR_STRING fix.
15259 * charset.c (Fencode_char): Check that character arg is actually
15260 a character. Pass an int to ENCODE_CHAR.
15261 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15262 wider than 'int', as a compile-time check to prevent future regressions
15263 in this area.
15264
15265 * character.c (char_string): Remove unnecessary casts.
15266
15267 Make sure a 64-bit char is never passed to CHAR_STRING.
15268 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15269 by silently ignoring the top 32 bits, allowing some values
15270 that were far too large to be valid characters.
15271 * character.h: Include <verify.h>.
15272 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15273 arguments are no wider than unsigned, as a compile-time check
15274 to prevent future regressions in this area.
15275 * data.c (Faset):
15276 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15277 (Fsubst_char_in_region):
15278 * fns.c (concat):
15279 * xdisp.c (decode_mode_spec_coding):
15280 Adjust to CHAR_STRING's new requirement.
15281 * editfns.c (Finsert_char, Fsubst_char_in_region):
15282 * fns.c (concat): Check that character args are actually
15283 characters. Without this test, these functions did the wrong
15284 thing with wildly out-of-range values on 64-bit hosts.
15285
15286 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15287 These casts should not be needed on 32-bit hosts, either.
15288 * keyboard.c (read_char):
15289 * lread.c (Fload): Remove casts to unsigned.
15290
15291 * lisp.h (UNSIGNED_CMP): New macro.
15292 This fixes comparison bugs on 64-bit hosts.
15293 (ASCII_CHAR_P): Use it.
15294 * casefiddle.c (casify_object):
15295 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15296 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15297 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15298 * dispextern.h (FACE_FROM_ID):
15299 * keyboard.c (read_char): Use UNSIGNED_CMP.
15300
15301 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15302 not to EMACS_INT, to avoid GCC warning.
15303
15304 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15305
15306 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15307 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15308 isn't needed on 32-bit machines.
15309
15310 * buffer.c (Fgenerate_new_buffer_name):
15311 Use EMACS_INT for count, not int.
15312 (advance_to_char_boundary): Return EMACS_INT, not int.
15313
15314 * data.c (Qcompiled_function): Now static.
15315
15316 * window.c (window_body_lines): Now static.
15317
15318 * image.c (gif_load): Rename local to avoid shadowing.
15319
15320 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15321 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15322 * alloc.c (make_save_value): Integer argument is now of type
15323 ptrdiff_t, not int.
15324 (mark_object): Use ptrdiff_t, not int.
15325 * lisp.h (pD): New macro.
15326 * print.c (print_object): Use it.
15327
15328 * alloc.c: Use EMACS_INT, not int, to count objects.
15329 (total_conses, total_markers, total_symbols, total_vector_size)
15330 (total_free_conses, total_free_markers, total_free_symbols)
15331 (total_free_floats, total_floats, total_free_intervals)
15332 (total_intervals, total_strings, total_free_strings):
15333 Now EMACS_INT, not int. All uses changed.
15334 (Fgarbage_collect): Compute overall total using a double, so that
15335 integer overflow is less likely to be a problem. Check for overflow
15336 when converting back to an integer.
15337 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15338 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15339 These were 'int' variables that could overflow on 64-bit hosts;
15340 they were never used, so remove them instead of repairing them.
15341 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15342 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15343 Previously, this ceilinged at INT_MAX, but that doesn't work on
15344 64-bit machines.
15345 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15346
15347 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15348 (allocate_vectorlike): Check for ptrdiff_t overflow.
15349 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15350 when a (possibly-narrower) signed value would do just as well.
15351 We prefer using signed arithmetic, to avoid comparison confusion.
15352
15353 * alloc.c: Catch some string size overflows that we were missing.
15354 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15355 for convenience in STRING_BYTES_MAX.
15356 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15357 The definition here is exact; the one in lisp.h was approximate.
15358 (allocate_string_data): Check for string overflow. This catches
15359 some instances we weren't catching before. Also, it catches
15360 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15361 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15362 and ptrdiff_t and EMACS_INT are both 64 bits.
15363
15364 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15365 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15366 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15367
15368 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15369
15370 * alloc.c (Fmake_string): Check for out-of-range init.
15371
15372 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15373
15374 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15375
15376 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15377
15378 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15379 xg_get_default_scrollbar_width.
15380
15381 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15382 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15383 (style_changed_cb): Call update_theme_scrollbar_width and call
15384 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15385 all frames (Bug#8505).
15386 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15387 Call gtk_window_set_resizable if HAVE_GTK3.
15388 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15389 and height if HAVE_GTK3 (Bug#8505).
15390 (scroll_bar_width_for_theme): New variable.
15391 (update_theme_scrollbar_width): New function.
15392 (xg_get_default_scrollbar_width): Move code to
15393 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15394 (xg_initialize): Call update_theme_scrollbar_width.
15395
15396 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15397
15398 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15399
15400 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15401
15402 * frame.c (make_frame): Call other_buffer_safely instead of
15403 other_buffer.
15404
15405 * window.c (temp_output_buffer_show): Call display_buffer with
15406 second argument Vtemp_buffer_show_specifiers and reset latter
15407 immediately after the call.
15408 (Vtemp_buffer_show_specifiers): New variable.
15409 (auto_window_vscroll_p, next_screen_context_lines)
15410 (Vscroll_preserve_screen_position): Remove leading asterisks from
15411 doc-strings.
15412
15413 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15414
15415 Fix minor problems found by GCC 4.6.0 static checking.
15416 * buffer.c (Qclone_number): Remove for now, as it's unused.
15417 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15418 (record_buffer): Remove unused local.
15419 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15420 (set_frame_buffer_list): Remove; unused.
15421 * frame.h (other_visible_frames): Remove decl.
15422 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15423 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15424 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15425 if HAVE_GPM.
15426 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15427 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15428 Define only if HAVE_GPM.
15429 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15430 (update_hints_inhibit): Remove; never set. All uses removed.
15431 * widgetprv.h (emacsFrameClassRec): Remove decl.
15432 * window.c (delete_deletable_window): Now returns void, since it
15433 wasn't returning anything.
15434 (compare_window_configurations): Remove unused locals.
15435 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15436 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15437 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15438 the same widths as pointers. This follows up on the 2011-05-06 patch.
15439 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15440 * xterm.h: Likewise.
15441 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15442
15443 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15444
15445 * makefile.w32-in: Update dependencies.
15446 (LISP_H): Add lib/intprops.h.
15447
15448 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15449
15450 * image.c (gif_load): Add animation frame delay to the metadata.
15451 (syms_of_image): Use DEFSYM. New symbol `delay'.
15452
15453 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15454
15455 * window.c (delete_deletable_window): Re-add.
15456 (Fset_window_configuration): Rewrite to handle dead buffers and
15457 consequently deletable windows.
15458 (window_tree, Fwindow_tree): Remove. Supply functionality in
15459 window.el.
15460 (compare_window_configurations): Simplify code.
15461
15462 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15463
15464 * image.c (imagemagick_load_image): Fix type mismatch.
15465 (Fimagemagick_types): Likewise.
15466
15467 * window.h (replace_buffer_in_windows): Declare.
15468
15469 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15470
15471 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15472 Qclone_number. Remove external declaration of Qdelete_window.
15473 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15474 code.
15475 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15476 Run Qbuffer_list_update_hook if allowed.
15477 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15478 buffer list implementation.
15479 (other_buffer_safely): New function.
15480 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15481 calls to replace_buffer_in_windows and
15482 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15483 if allowed.
15484 (record_buffer): Inhibit quitting and rewrite using quittable
15485 functions. Run Qbuffer_list_update_hook if allowed.
15486 (Frecord_buffer, Funrecord_buffer): New functions.
15487 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15488 Move switch-to-buffer to window.el.
15489 (bury-buffer): Move to window.el.
15490 (Vbuffer_list_update_hook): New variable.
15491
15492 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15493 section.
15494
15495 * window.h (resize_frame_windows): Move up in code.
15496 (Fwindow_frame): Remove EXFUN.
15497 (replace_buffer_in_all_windows): Remove prototype.
15498 (replace_buffer_in_windows_safely): Add prototype.
15499
15500 * window.c: Declare Qdelete_window static again. Move down
15501 declaration of select_count.
15502 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15503 (Fother_window): Move to window.el.
15504 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15505 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15506 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15507 window.el.
15508 (replace_buffer_in_windows): Implement by calling
15509 Qreplace_buffer_in_windows.
15510 (replace_buffer_in_all_windows): Remove with some functionality
15511 moved into replace_buffer_in_windows_safely.
15512 (replace_buffer_in_windows_safely): New function.
15513 (select_window_norecord, select_frame_norecord): Move in front
15514 of run_window_configuration_change_hook. Remove now obsolete
15515 declarations.
15516 (Fset_window_buffer): Rewrite doc-string.
15517 Call Qrecord_window_buffer.
15518 (keys_of_window): Move binding for other-window to window.el.
15519
15520 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15521
15522 * dispextern.h (struct image): Replace data member, whose int_val
15523 and ptr_val fields were not used by anything, with a single
15524 lisp_val object.
15525
15526 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15527 (gif_clear_image, gif_load, imagemagick_load_image)
15528 (gs_clear_image, gs_load): Callers changed.
15529
15530 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15531
15532 * buffer.h: Include <time.h>, for time_t.
15533 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15534
15535 Fix minor problems found by static checking.
15536
15537 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15538
15539 Make identifiers static if they are not used in other modules.
15540 * data.c (Qcompiled_function, Qframe, Qvector):
15541 * image.c (QimageMagick, Qsvg):
15542 * minibuf.c (Qmetadata):
15543 * window.c (resize_window_check, resize_root_window): Now static.
15544 * window.h (resize_window_check, resize_root_window): Remove decls.
15545
15546 * window.c (window_deletion_count, delete_deletable_window):
15547 Remove; unused.
15548 (window_body_lines): Now static.
15549 (Fdelete_other_windows_internal): Mark vars as initialized.
15550 Make sure 'resize_failed' is initialized.
15551 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15552 (resize_window_apply): Remove unused local.
15553 * window.h (delete_deletable_window): Remove decl.
15554
15555 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15556 (imagemagick_load_image): Fix pointer signedness problem by changing
15557 last arg from unsigned char * to char *. All uses changed.
15558 Also, fix a local for similar reasons.
15559 Remove unused locals. Remove locals to avoid shadowing.
15560 (fn_rsvg_handle_free): Remove; unused.
15561 (svg_load, svg_load_image): Fix pointer signedness problem.
15562 (imagemagick_load_image): Don't use garbage pointer image_wand.
15563
15564 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15565
15566 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15567
15568 * image.c (gif_load): Fix omitted cast error introduced by
15569 2011-06-06 change.
15570
15571 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15572
15573 * window.h (resize_proportionally, orig_total_lines)
15574 (orig_top_line): Remove from window structure.
15575 (set_window_height, set_window_width, change_window_heights)
15576 (Fdelete_window): Remove prototypes.
15577 (resize_frame_windows): Remove duplicate declaration.
15578
15579 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15580
15581 * window.h (resize_frame_windows, resize_window_check)
15582 (delete_deletable_window, resize_root_window)
15583 (resize_frame_windows): Declare prototypes.
15584
15585 * window.c (resize_window_apply): Make definition be "static" to
15586 match the prototype.
15587
15588 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15589
15590 * window.c: Remove declarations of Qwindow_size_fixed,
15591 window_min_size_1, window_min_size_2, window_min_size,
15592 size_window, window_fixed_size_p, enlarge_window, delete_window.
15593 Remove static from declaration of Qdelete_window, it's
15594 temporarily needed by Fbury_buffer.
15595 (replace_window): Don't assign orig_top_line and
15596 orig_total_lines.
15597 (Fdelete_window, delete_window): Remove. Window deletion is
15598 handled by window.el.
15599 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15600 Replace Fdelete_window calls with calls to Qdelete_window.
15601 (Fdelete_other_windows): Remove. Deleting other windows is
15602 handled by window.el.
15603 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15604 handled in window.el.
15605 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15606 Window minimum sizes are handled in window.el.
15607 (shrink_windows, size_window, set_window_height)
15608 (set_window_width, change_window_heights, window_height)
15609 (window_width, CURBEG, CURSIZE, enlarge_window)
15610 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15611 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15612 handled in window.el.
15613 (make_dummy_parent): Rename to make_parent_window and give it a
15614 second argument horflag.
15615 (make_window): Don't set resize_proportionally any more.
15616 (Fsplit_window): Remove. Windows are split in window.el.
15617 (save_restore_action, save_restore_orig_size)
15618 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15619 Resize mini windows in window.el.
15620 (grow_mini_window, shrink_mini_window): Implement by calling
15621 Qresize_root_window_vertically, resize_window_check and
15622 resize_window_apply.
15623 (saved_window, Fset_window_configuration, save_window_save):
15624 Do not handle orig_top_line, orig_total_lines, and
15625 resize_proportionally.
15626 (window_min_height, window_min_width): Move to window.el.
15627 (keys_of_window): Move bindings for delete-other-windows,
15628 split-window, delete-window and enlarge-window to window.el.
15629
15630 * buffer.c: Temporarily extern Qdelete_window.
15631 (Fbury_buffer): Temporarily call Qdelete_window instead of
15632 Fdelete_window (Fbury_buffer will move to window.el soon).
15633
15634 * frame.c (set_menu_bar_lines_1): Remove code handling
15635 orig_top_line and orig_total_lines.
15636
15637 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15638 set_window_height but set heights directly.
15639 (change_frame_size_1): Use resize_frame_windows.
15640
15641 * xdisp.c (init_xdisp): Don't use set_window_height but set
15642 heights directly.
15643
15644 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15645 Use resize_frame_windows instead of change_window_heights and run
15646 run_window_configuration_change_hook.
15647
15648 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15649 instead of change_window_heights and run
15650 run_window_configuration_change_hook.
15651
15652 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15653
15654 * window.c (replace_window): Rename second argument REPLACEMENT to
15655 NEW. New third argument SETFLAG. Rewrite.
15656 (delete_window, make_dummy_parent): Call replace_window with
15657 third argument 1.
15658 (window_list_1): Move down in code.
15659 (run_window_configuration_change_hook): Move set_buffer part
15660 before select_frame_norecord part in order to unwind correctly.
15661 Rename count1 to count.
15662 (recombine_windows, delete_deletable_window, resize_root_window)
15663 (Fdelete_other_windows_internal)
15664 (Frun_window_configuration_change_hook, make_parent_window)
15665 (resize_window_check, resize_window_apply, Fresize_window_apply)
15666 (resize_frame_windows, Fsplit_window_internal)
15667 (Fdelete_window_internal, Fresize_mini_window_internal):
15668 New functions.
15669 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15670
15671 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15672
15673 * window.h (window): Add some new members to window structure -
15674 normal_lines, normal_cols, new_total, new_normal, clone_number,
15675 splits, nest, prev_buffers, next_buffers.
15676 (WINDOW_TOTAL_SIZE): Move here from window.c.
15677 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15678
15679 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15680 Remove.
15681 (make_dummy_parent): Set new members of windows structure.
15682 (make_window): Move down in code. Handle new members of window
15683 structure.
15684 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15685 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15686 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15687 (Fset_window_prev_buffers, Fwindow_next_buffers)
15688 (Fset_window_next_buffers, Fset_window_clone_number):
15689 New functions.
15690 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15691 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15692 Doc-string fixes.
15693 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15694 Argument WINDOW can be now internal window too.
15695 (Fwindow_use_time): Move up in code.
15696 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15697 Rewrite doc-string.
15698 (Fset_window_configuration, saved_window)
15699 (Fcurrent_window_configuration, save_window_save): Handle new
15700 members of window structure.
15701 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15702 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15703 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15704 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15705 Qget_mru_window, Qresize_root_window,
15706 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15707 Qauto_buffer_name; staticpro them.
15708
15709 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15710
15711 * window.c (Fwindow_total_size, Fwindow_left_column)
15712 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15713 (Fwindow_list_1): New functions.
15714 (window_box_text_cols): Replace with window_body_cols.
15715 (Fwindow_width, Fscroll_left, Fscroll_right):
15716 Use window_body_cols instead of window_box_text_cols.
15717 (delete_window, Fset_window_configuration):
15718 Call delete_all_subwindows with window as argument.
15719 (delete_all_subwindows): Take a window as argument and not a
15720 structure. Rewrite.
15721 (window_loop): Remove handling of GET_LRU_WINDOW and
15722 GET_LARGEST_WINDOW.
15723 (Fget_lru_window, Fget_largest_window): Move to window.el.
15724
15725 * window.h: Extern window_body_cols instead of
15726 window_box_text_cols. delete_all_subwindows now takes a
15727 Lisp_Object as argument.
15728
15729 * indent.c (compute_motion, Fcompute_motion):
15730 Use window_body_cols instead of window_box_text_cols.
15731
15732 * frame.c (delete_frame): Call delete_all_subwindows with root
15733 window as argument.
15734
15735 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15736
15737 * fns.c (Fputhash): Document return value.
15738
15739 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15740
15741 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15742
15743 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15744
15745 Cons<->int and similar integer overflow fixes (Bug#8794).
15746
15747 Check for overflow when converting integer to cons and back.
15748 * charset.c (Fdefine_charset_internal, Fdecode_char):
15749 Use cons_to_unsigned to catch overflow.
15750 (Fencode_char): Use INTEGER_TO_CONS.
15751 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15752 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15753 * data.c (long_to_cons, cons_to_long): Remove.
15754 (cons_to_unsigned, cons_to_signed): New functions.
15755 These signal an error for invalid or out-of-range values.
15756 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15757 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15758 * font.c (Ffont_variation_glyphs):
15759 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15760 * lisp.h: Include <intprops.h>.
15761 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15762 (cons_to_signed, cons_to_unsigned): New decls.
15763 (long_to_cons, cons_to_long): Remove decls.
15764 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15765 (Fprimitive_undo): Use CONS_TO_INTEGER.
15766 * xfns.c (Fx_window_property): Likewise.
15767 * xselect.c: Include <limits.h>.
15768 (x_own_selection, selection_data_to_lisp_data):
15769 Use INTEGER_TO_CONS.
15770 (x_handle_selection_request, x_handle_selection_clear)
15771 (x_get_foreign_selection, Fx_disown_selection_internal)
15772 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15773 (lisp_data_to_selection_data): Use cons_to_unsigned.
15774 (x_fill_property_data): Use cons_to_signed.
15775 Report values out of range.
15776
15777 Check for buffer and string overflow more precisely.
15778 * buffer.h (BUF_BYTES_MAX): New macro.
15779 * lisp.h (STRING_BYTES_MAX): New macro.
15780 * alloc.c (Fmake_string):
15781 * character.c (string_escape_byte8):
15782 * coding.c (coding_alloc_by_realloc):
15783 * doprnt.c (doprnt):
15784 * editfns.c (Fformat):
15785 * eval.c (verror):
15786 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15787 since they may not be the same number.
15788 * editfns.c (Finsert_char):
15789 * fileio.c (Finsert_file_contents):
15790 Likewise for BUF_BYTES_MAX.
15791
15792 * image.c: Use ptrdiff_t, not int, for sizes.
15793 (slurp_file): Switch from int to ptrdiff_t.
15794 All uses changed.
15795 (slurp_file): Check that file size fits in both size_t (for
15796 malloc) and ptrdiff_t (for sanity and safety).
15797
15798 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15799 if b->modtime has its maximal value.
15800
15801 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15802
15803 Don't assume time_t can fit into int.
15804 * buffer.h (struct buffer.modtime): Now time_t, not int.
15805 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15806 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15807
15808 Minor fixes for signed vs unsigned integers.
15809 * character.h (MAYBE_UNIFY_CHAR):
15810 * charset.c (maybe_unify_char):
15811 * keyboard.c (read_char, reorder_modifiers):
15812 XINT -> XFASTINT, since the integer must be nonnegative.
15813 * ftfont.c (ftfont_spec_pattern):
15814 * keymap.c (access_keymap, silly_event_symbol_error):
15815 XUINT -> XFASTINT, since the integer must be nonnegative.
15816 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15817 since it makes no difference and we prefer signed.
15818 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15819 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15820 nonnegative.
15821
15822 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15823
15824 * window.h (Fwindow_frame): Declare.
15825
15826 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15827
15828 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15829 (SPARE_MEMORY): Always define.
15830 (LARGE_REQUEST): Remove.
15831 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15832
15833 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15834
15835 * lisp.h: Move EXFUNS for Fframe_root_window,
15836 Fframe_first_window and Fset_frame_selected_window to window.h.
15837
15838 * window.h: Move EXFUNS for Fframe_root_window,
15839 Fframe_first_window and Fset_frame_selected_window here from
15840 lisp.h.
15841
15842 * frame.c (Fwindow_frame, Fframe_first_window)
15843 (Fframe_root_window, Fframe_selected_window)
15844 (Fset_frame_selected_window): Move to window.c.
15845 (Factive_minibuffer_window): Move to minibuf.c.
15846 (Fother_visible_frames_p): New function.
15847
15848 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15849
15850 * window.c (decode_window, decode_any_window): Move up in code.
15851 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15852 (inhibit_frame_unsplittable): Remove unused variable.
15853 (Fwindow_buffer): Move up and rewrite doc-string.
15854 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15855 (Fwindow_prev): New functions.
15856 (Fwindow_frame): Move here from frame.c. Accept any window as
15857 argument.
15858 (Fframe_root_window, Fframe_first_window)
15859 (Fframe_selected_window): Move here from frame.c. Accept frame
15860 or arbitrary window as argument. Update doc-strings.
15861 (Fminibuffer_window): Move up in code.
15862 (Fwindow_minibuffer_p): Move up in code and simplify.
15863 (Fset_frame_selected_window): Move here from frame.c.
15864 Marginal rewrite.
15865 (Fselected_window, select_window, Fselect_window): Move up in
15866 code. Minor doc-string fixes.
15867
15868 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15869
15870 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15871 Do not assume that spare memory exists; that assumption is valid
15872 only if SYSTEM_MALLOC.
15873 (LARGE_REQUEST): New macro, so that the issue of large requests
15874 is separated from the issue of spare memory.
15875
15876 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15877
15878 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15879 format. (Bug#8806)
15880
15881 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15882
15883 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15884 before statements.
15885
15886 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15887
15888 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15889
15890 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15891
15892 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15893 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15894
15895 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15896
15897 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15898
15899 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15900
15901 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15902 (x_clipboard_manager_save): Add return value.
15903 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15904 New error handlers.
15905 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15906 Obey Vx_select_enable_clipboard_manager. Catch errors in
15907 x_clipboard_manager_save (Bug#8779).
15908 (Vx_select_enable_clipboard_manager): New variable.
15909 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15910
15911 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15912
15913 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15914
15915 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15916
15917 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15918 in the current matrix if keep_current_p is non-zero.
15919
15920 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15921
15922 * bidi.c (bidi_level_of_next_char): Fix last change.
15923
15924 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15925
15926 Support bidi reordering of text covered by display properties.
15927
15928 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15929 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15930 (bidi_cache_search, bidi_cache_iterator_state)
15931 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15932 (bidi_level_of_next_char, bidi_move_to_visually_next):
15933 Support character positions inside a run of characters covered by a
15934 display string.
15935 (bidi_paragraph_init, bidi_resolve_explicit_1)
15936 (bidi_level_of_next_char): Call bidi_fetch_char and
15937 bidi_fetch_char_advance instead of FETCH_CHAR and
15938 FETCH_CHAR_ADVANCE.
15939 (bidi_init_it): Initialize new members.
15940 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15941 definitions.
15942 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15943 instead of using explicit *_CHAR codes.
15944 (bidi_resolve_explicit, bidi_resolve_weak):
15945 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15946 bidirectional text is supported only in multibyte buffers.
15947 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15948 it to initialize the frame_window_p member of struct bidi_it.
15949 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15950 (bidi_resolve_explicit, bidi_resolve_weak)
15951 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15952 bidi_it->nchars is non-positive.
15953 (bidi_level_of_next_char): Don't try to lookup the cache for the
15954 next/previous character if nothing is cached there yet, or if we
15955 were just reseat()'ed to a new position.
15956
15957 * xdisp.c (set_cursor_from_row): Set start and stop points
15958 according to the row's direction when priming the loop that looks
15959 for the glyph on which to display cursor.
15960 (single_display_spec_intangible_p): Function deleted.
15961 (display_prop_intangible_p): Reimplement to call
15962 handle_display_spec instead of single_display_spec_intangible_p.
15963 Accept 3 additional arguments needed by handle_display_spec.
15964 This fixes incorrect cursor motion across display property with complex
15965 values: lists, `(when COND...)' forms, etc.
15966 (single_display_spec_string_p): Support property values that are
15967 lists with the argument STRING its top-level element.
15968 (display_prop_string_p): Fix the condition for processing a
15969 property that is a list to be consistent with handle_display_spec.
15970 (handle_display_spec): New function, refactored from the
15971 last portion of handle_display_prop.
15972 (compute_display_string_pos): Accept additional argument
15973 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15974 value of a `display' property is a "replacing spec".
15975 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15976 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15977 the display property, but just return a value indicating whether
15978 the display property will replace the characters it covers.
15979 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15980 frame_window_p members of struct bidi_it.
15981 (compute_display_string_pos, compute_display_string_end):
15982 New functions.
15983 (push_it): Accept second argument POSITION, where pop_it should
15984 jump to continue iteration.
15985 (reseat_1): Initialize bidi_it.disp_pos.
15986
15987 * keyboard.c (adjust_point_for_property): Adjust the call to
15988 display_prop_intangible_p to its new signature.
15989
15990 * dispextern.h (struct bidi_it): New member frame_window_p.
15991 (bidi_init_it): Update prototypes.
15992 (display_prop_intangible_p): Update prototype.
15993 (compute_display_string_pos, compute_display_string_end):
15994 Declare prototypes.
15995 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15996 EMACS_INT.
15997
15998 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15999
16000 Malloc failure behavior now depends on size of allocation.
16001 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16002 * lisp.h: Change signatures accordingly.
16003 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16004 All callers changed. (Bug#8762)
16005
16006 * gnutls.c: Use Emacs's memory allocators.
16007 Without this change, the gnutls library would invoke malloc etc.
16008 directly, which causes problems on non-SYNC_INPUT hosts, and which
16009 runs afoul of improving memory_full behavior. (Bug#8761)
16010 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16011 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16012 xfree instead of the default malloc, realloc, free.
16013 (Fgnutls_boot): No need to check for memory allocation failure,
16014 since xmalloc does that for us.
16015
16016 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16017 * category.c (hash_get_category_set):
16018 * ccl.c (ccl_driver):
16019 * charset.c (Fdefine_charset_internal):
16020 * charset.h (struct charset.hash_index):
16021 * composite.c (get_composition_id, gstring_lookup_cache)
16022 (composition_gstring_put_cache):
16023 * composite.h (struct composition.hash_index):
16024 * dispextern.h (struct image.hash):
16025 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16026 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16027 (hashfn_equal, hashfn_user_defined, make_hash_table)
16028 (maybe_resize_hash_table, hash_lookup, hash_put)
16029 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16030 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16031 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16032 * image.c (make_image, search_image_cache, lookup_image)
16033 (xpm_put_color_table_h):
16034 * lisp.h (struct Lisp_Hash_Table):
16035 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16036 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16037 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16038 * alloc.c (allocate_vectorlike):
16039 Check for overflow in vector size calculations.
16040 * ccl.c (ccl_driver):
16041 Check for overflow when converting EMACS_INT to int.
16042 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16043 need to be updated by these changes.
16044 * fns.c (make_hash_table, maybe_resize_hash_table):
16045 Check for integer overflow with large hash tables.
16046 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16047 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16048 (SXHASH_REDUCE): New macro.
16049 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16050 Use it instead of discarding useful hash info with large hash values.
16051 (sxhash_float): New function.
16052 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16053 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16054 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16055 Rewrite to use FIXNUM_BITS, as this simplifies things.
16056 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16057 Adjust signatures to match updated version of code.
16058 (consing_since_gc): Now EMACS_INT, since a single hash table can
16059 use more than INT_MAX bytes.
16060
16061 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16062
16063 Make it possible to build with GCC-4.6+ -O2 -flto.
16064
16065 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16066
16067 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16068
16069 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16070 Call minibuffer-inactive-mode.
16071
16072 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16073
16074 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16075 Update dependencies.
16076
16077 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16078
16079 * data.c (init_data): Remove code for UTS, this system is not
16080 supported anymore.
16081
16082 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16083
16084 Don't force ./temacs to start in terminal mode.
16085
16086 * frame.c (make_initial_frame): Initialize faces in all cases, not
16087 only when CANNOT_DUMP is defined.
16088 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16089
16090 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16091
16092 * dispnew.c (add_window_display_history): Use const for the string
16093 pointer. Remove declaration, not needed.
16094
16095 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16096
16097 Use 'inline', not 'INLINE'.
16098 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16099 * alloc.c, fontset.c (INLINE): Remove.
16100 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16101 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16102 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16103 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16104 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16105
16106 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16107
16108 Make it possible to run ./temacs.
16109
16110 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16111 syms_of_callproc does the same thing. Remove test for
16112 "initialized", do it in the caller.
16113 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16114
16115 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16116
16117 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16118 (read_minibuf): Use get_minibuffer.
16119 (syms_of_minibuf): Use DEFSYM.
16120 (Qmetadata): New var.
16121 * data.c (Qbuffer): Don't make it static.
16122 (syms_of_data): Use DEFSYM.
16123
16124 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16125
16126 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16127 (CCL_CODE_MIN): New macro.
16128
16129 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16130
16131 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16132
16133 * eval.c (Qdebug): Now static.
16134 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16135 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16136 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16137
16138 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16139
16140 * image.c: Various fixes to ImageMagick code comments.
16141 (Fimagemagick_types): Doc fix.
16142
16143 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16144
16145 Minor fixes prompted by GCC 4.6.0 warnings.
16146
16147 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16148
16149 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16150 (x_clipboard_manager_save_all): Move extern decl to ...
16151 * xterm.h: ... here, so that it can be checked for consistency.
16152
16153 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16154
16155 * xselect.c (x_clipboard_manager_save_frame)
16156 (x_clipboard_manager_save_all): New functions.
16157 (Fx_clipboard_manager_save): Lisp function deleted.
16158
16159 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16160 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16161
16162 * xterm.h: Update prototype.
16163
16164 2011-05-28 William Xu <william.xwl@gmail.com>
16165
16166 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16167 exiting (Bug#8239).
16168
16169 2011-05-28 Jim Meyering <meyering@redhat.com>
16170
16171 Avoid a sign-extension bug in crypto_hash_function.
16172 * fns.c (to_uchar): Define.
16173 (crypto_hash_function): Use it to convert some newly-signed
16174 variables to unsigned, to avoid sign-extension bugs. For example,
16175 without this change, (md5 "truc") would evaluate to
16176 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16177 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16178 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16179
16180 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16181
16182 Integer overflow fixes.
16183
16184 * dbusbind.c: Serial number integer overflow fixes.
16185 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16186 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16187 to hold a serial number that is too large for a fixnum.
16188 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16189 Check for serial numbers out of range. Decode any serial number
16190 that was so large that it became a float. (Bug#8722)
16191
16192 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16193 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16194 Use XFASTINT rather than XUINT when numbers are nonnegative.
16195 (xd_append_arg, Fdbus_method_return_internal):
16196 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16197 arguments, check that Lisp number is nonnegative, rather than
16198 silently wrapping negative numbers around. (Bug#8722)
16199 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16200 (Bug#8722)
16201
16202 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16203
16204 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16205
16206 ccl: Add integer overflow checks.
16207 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16208 (IN_INT_RANGE): New macros.
16209 (ccl_driver): Use them to check for integer overflow when
16210 decoding a CCL program. Many of the new checks are whether XINT (x)
16211 fits in int; it doesn't always, on 64-bit hosts. The new version
16212 doesn't catch all possible integer overflows, but it's an
16213 improvement. (Bug#8719)
16214
16215 * alloc.c (make_event_array): Use XINT, not XUINT.
16216 There's no need for unsigned here.
16217
16218 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16219 This follows up to the 2011-05-06 change that substituted uintptr_t
16220 for EMACS_INT. This case wasn't caught back then.
16221
16222 Rework Fformat to avoid integer overflow issues.
16223 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16224 now (part of C89). Include <verify.h>.
16225 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16226 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16227 (Fformat): Avoid the prepass trying to compute sizes; it was only
16228 approximate and thus did not catch overflow reliably. Instead, walk
16229 through the format just once, formatting and computing sizes as we go,
16230 checking for integer overflow at every step, and allocating a larger
16231 buffer as needed. Keep track separately whether the format is
16232 multibyte. Keep only the most-recently calculated precision, rather
16233 than them all. Record whether each argument has been converted to
16234 string. Use EMACS_INT, not int, for byte and char and arg counts.
16235 Support field widths and precisions larger than INT_MAX. Avoid
16236 sprintf's undefined behavior with conversion specifications such as %#d
16237 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16238 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16239 formatting out-of-range floating point numbers with int
16240 formats. (Bug#8668)
16241
16242 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16243
16244 * data.c: Avoid integer truncation in expressions involving floats.
16245 * data.c: Include <intprops.h>.
16246 (arith_driver): When there's an integer overflow in an expression
16247 involving floating point, convert the integers to floating point
16248 so that the resulting value does not suffer from catastrophic
16249 integer truncation. For example, on a 64-bit host (* 4
16250 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16251 Do not rely on undefined behavior after integer overflow.
16252
16253 merge count_size_as_multibyte, parse_str_to_multibyte
16254 * character.c, character.h (count_size_as_multibyte):
16255 Rename from parse_str_to_multibyte; all uses changed.
16256 Check for integer overflow.
16257 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16258 since it's now a duplicate of the other. This is more of
16259 a character than a buffer op, so better that it's in character.c.
16260 * fns.c, print.c: Adjust to above changes.
16261
16262 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16263
16264 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16265
16266 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16267
16268 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16269 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16270 (x_clipboard_manager_save): Now static.
16271 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16272
16273 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16274 (crypto_hash_function): Now static.
16275 Fix pointer signedness problems. Avoid unnecessary initializations.
16276
16277 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16278
16279 * termhooks.h (Vselection_alist): Make it terminal-local.
16280
16281 * terminal.c (create_terminal): Initialize it.
16282
16283 * xselect.c: Support for clipboard managers.
16284 (Vselection_alist): Move to termhooks.h as terminal-local var.
16285 (LOCAL_SELECTION): New macro.
16286 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16287 (symbol_to_x_atom): Remove gratuitous arg.
16288 (x_handle_selection_request, lisp_data_to_selection_data)
16289 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16290 (x_own_selection, x_get_local_selection, x_convert_selection):
16291 New arg, specifying work frame. Use terminal-local Vselection_alist.
16292 (some_frame_on_display): Delete unused function.
16293 (Fx_own_selection_internal, Fx_get_selection_internal)
16294 (Fx_disown_selection_internal, Fx_selection_owner_p)
16295 (Fx_selection_exists_p): New optional frame arg.
16296 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16297 (x_handle_selection_clear): Don't treat other terminals with the
16298 same keyboard specially. Use the terminal-local Vselection_alist.
16299 (x_clear_frame_selections): Use Frun_hook_with_args.
16300
16301 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16302
16303 * xterm.h: Add support for those atoms.
16304
16305 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16306
16307 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16308 (converted_selections, conversion_fail_tag): New global variables.
16309 (x_selection_request_lisp_error): Free the above.
16310 (x_get_local_selection): Remove unnecessary code.
16311 (x_reply_selection_request): Args changed; handle arbitrary array
16312 of converted selections stored in converted_selections.
16313 Separate the XChangeProperty and SelectionNotify steps.
16314 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16315 (x_convert_selection): New function.
16316 (x_handle_selection_event): Simplify.
16317 (x_get_foreign_selection): Don't ignore incoming requests while
16318 waiting for an answer; this will fail when we implement
16319 SAVE_TARGETS, and seems unnecessary anyway.
16320 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16321 (Vx_sent_selection_functions): Doc fix.
16322
16323 2011-05-26 Leo Liu <sdl.web@gmail.com>
16324
16325 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16326
16327 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16328
16329 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16330
16331 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16332 for fringe update if it has periodic bitmap.
16333 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16334 and fringe_bitmap_periodic_p.
16335
16336 * fringe.c (get_fringe_bitmap_data): New function.
16337 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16338 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16339 row. Mark glyph row for fringe update if periodicity changed.
16340
16341 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16342 for fringe update unless it has periodic bitmap.
16343
16344 2011-05-25 Kenichi Handa <handa@m17n.org>
16345
16346 * xdisp.c (get_next_display_element): Set correct it->face_id for
16347 a static composition.
16348
16349 2011-05-24 Leo Liu <sdl.web@gmail.com>
16350
16351 * deps.mk (fns.o):
16352 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16353
16354 * fns.c (crypto_hash_function, Fsha1): New function.
16355 (Fmd5): Use crypto_hash_function.
16356 (syms_of_fns): Add Ssha1.
16357
16358 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16359
16360 * gnutls.c: Remove unused macros.
16361 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16362 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16363 Remove macros that are defined and never used.
16364 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16365
16366 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16367
16368 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16369 (Fx_get_selection_internal): Minor cleanup.
16370 (Fx_own_selection_internal): Rename arguments for consistency with
16371 select.el.
16372
16373 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16374
16375 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16376
16377 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16378
16379 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16380
16381 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16382
16383 * dispnew.c (scrolling_window): Don't exclude the case that the
16384 last enabled row in the desired matrix touches the bottom boundary.
16385
16386 2011-05-21 Glenn Morris <rgm@gnu.org>
16387
16388 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16389 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16390 and add some more files.
16391
16392 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16393
16394 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16395 report_file_error introduced by the change from 2011-05-07.
16396
16397 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16398
16399 * systime.h (Time): Define only if emacs is defined.
16400 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16401 where the include path doesn't have X11/X.h by default. See
16402 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16403
16404 2011-05-20 Kenichi Handa <handa@m17n.org>
16405
16406 * composite.c (find_automatic_composition): Fix previous change.
16407
16408 2011-05-20 Glenn Morris <rgm@gnu.org>
16409
16410 * lisp.mk: New file, split from Makefile.in.
16411 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16412 (shortlisp): Remove.
16413 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16414
16415 2011-05-19 Glenn Morris <rgm@gnu.org>
16416
16417 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16418 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16419 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16420 (lisp): Set the order to that of loadup.el.
16421 (shortlisp): Make it a copy of $lisp.
16422 (SOME_MACHINE_LISP): Remove.
16423 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16424 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16425
16426 2011-05-18 Kenichi Handa <handa@m17n.org>
16427
16428 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16429 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16430 (find_automatic_composition): Mostly rewrite for efficiency.
16431
16432 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16433
16434 * makefile.w32-in: Update dependencies.
16435
16436 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16437
16438 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16439 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16440
16441 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16442
16443 Fix some integer overflow issues, such as string length overflow.
16444
16445 * insdel.c (count_size_as_multibyte): Check for string overflow.
16446
16447 * character.c (lisp_string_width): Check for string overflow.
16448 Use EMACS_INT, not int, for string indexes and lengths; in
16449 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16450 the resulting string length overflows an EMACS_INT; instead,
16451 report a string overflow if no precision given. When checking for
16452 precision exhaustion, use a check that cannot possibly have
16453 integer overflow. (Bug#8675)
16454 * character.h (lisp_string_width): Adjust to new signature.
16455
16456 * alloc.c (string_overflow): New function.
16457 (Fmake_string): Use it. This doesn't change behavior, but saves
16458 a few bytes and will simplify future changes.
16459 * character.c (string_escape_byte8): Likewise.
16460 * lisp.h (string_overflow): New decl.
16461
16462 Fixups, following up to the user-interface timestamp change.
16463 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16464 for UI timestamps, instead of unsigned long.
16465 * msdos.c (mouse_get_pos): Likewise.
16466 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16467 * w32gui.h (Time): Define by including "systime.h" rather than by
16468 declaring it ourselves. (Bug#8664)
16469
16470 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16471 * image.c (clear_image_cache): Likewise.
16472
16473 * term.c (term_mouse_position): Don't assume time_t wraparound.
16474
16475 Be more systematic about user-interface timestamps.
16476 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16477 and sometimes 'EMACS_UINT', to represent these timestamps.
16478 This change causes it to use 'Time' uniformly, as that's what X uses.
16479 This makes the code easier to follow, and makes it easier to catch
16480 integer overflow bugs such as Bug#8664.
16481 * frame.c (Fmouse_position, Fmouse_pixel_position):
16482 Use Time, not unsigned long, for user-interface timestamps.
16483 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16484 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16485 * keyboard.h (last_event_timestamp): Likewise.
16486 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16487 * menu.h (xmenu_show): Likewise.
16488 * term.c (term_mouse_position): Likewise.
16489 * termhooks.h (struct input_event.timestamp): Likewise.
16490 (struct terminal.mouse_position_hook): Likewise.
16491 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16492 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16493 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16494 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16495 what it was before.
16496 * menu.h, termhooks.h: Include "systime.h", for Time.
16497
16498 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16499 Don't assume that the difference between two unsigned long values
16500 can fit into an integer. At this point, we know button_down_time
16501 <= event->timestamp, so the difference must be nonnegative, so
16502 there's no need to cast the result if double-click-time is
16503 nonnegative, as it should be; check that it's nonnegative, just in
16504 case. This bug is triggered when events are more than 2**31 ms
16505 apart (about 25 days). (Bug#8664)
16506
16507 * xselect.c (last_event_timestamp): Remove duplicate decl.
16508 (x_own_selection): Remove needless cast to unsigned long.
16509
16510 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16511 that always fit in int. Use a sentinel instead of a counter, to
16512 avoid a temp and to allay GCC's concerns about possible int overflow.
16513 * frame.h (struct frame): Use int for menu_bar_items_used
16514 instead of EMACS_INT, since it always fits in int.
16515
16516 * menu.c (grow_menu_items): Check for int overflow.
16517
16518 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16519
16520 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16521 Before, the code was not consistent. These values cannot exceed
16522 2**31 - 1 so there's no need to make them unsigned.
16523 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16524 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16525 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16526 as modifiers.
16527 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16528
16529 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16530 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16531 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16532 presumably because the widths might not match.
16533
16534 * window.c (size_window): Avoid needless test at loop start.
16535
16536 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16537
16538 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16539
16540 2011-05-12 Drew Adams <drew.adams@oracle.com>
16541
16542 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16543
16544 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16545
16546 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16547 `width' to `bar_area_x' and `bar_area_width', respectively.
16548 (x_scroll_run): Take account of fringe background extension.
16549
16550 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16551 Rename local vars `left' and `width' to `bar_area_x' and
16552 `bar_area_width', respectively.
16553 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16554 background extension.
16555
16556 2011-05-10 Jim Meyering <meyering@redhat.com>
16557
16558 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16559
16560 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16561
16562 * image.c (Finit_image_library): Return t for built-in image types,
16563 like pbm and xbm. (Bug#8640)
16564
16565 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16566
16567 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16568
16569 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16570
16571 * w32console.c (Fset_screen_color): Doc fix.
16572 (Fget_screen_color): New function.
16573 (syms_of_ntterm): Defsubr it.
16574
16575 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16576 unlink the temporary file if Fcall_process didn't create it in the
16577 first place.
16578 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16579 child process will be redirected to a file specified with `:file'.
16580 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16581 cue to call_process_cleanup not to close that handle.
16582
16583 2011-05-07 Ben Key <bkey76@gmail.com>
16584
16585 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16586 one of two shell specific rules, either bootstrap-temacs-CMD or
16587 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16588 to the previous implementation of the bootstrap-temacs rule.
16589 The bootstrap-temacs-CMD rule is similar to the previous
16590 implementation of the bootstrap-temacs rule except that it
16591 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16592 variable.
16593
16594 These changes, along with some changes to nt/configure.bat,
16595 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16596 earlier fix to add support for --cflags and --ldflags options
16597 that include quotes so that it works whether make uses cmd or
16598 sh as the shell.
16599
16600 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16601
16602 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16603 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16604 is a constant.
16605 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16606 a string. Handle both cases.
16607 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16608 (Fdbus_register_method): Use Qinvalid_function.
16609
16610 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16611
16612 * makefile.w32-in: Update dependencies.
16613 (LISP_H): Add inttypes.h and stdin.h.
16614 (PROCESS_H): Add unistd.h.
16615
16616 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16617
16618 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16619 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16620
16621 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16622
16623 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16624
16625 * term.c (vfatal): Remove stray call to va_end.
16626 It's not needed and the C Standard doesn't allow it here anyway.
16627
16628 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16629 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16630
16631 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16632 bytes.
16633
16634 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16635
16636 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16637
16638 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16639
16640 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16641
16642 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16643
16644 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16645 * charset.c (Fdefine_charset_internal): Don't initialize
16646 charset.code_space[15]. The value was garbage, on hosts with
16647 32-bit int (Bug#8600).
16648
16649 * lread.c (read_integer): Be more consistent with string-to-number.
16650 Use string_to_number to do the actual conversion; this avoids
16651 rounding errors and fixes some other screwups. Without this fix,
16652 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16653 (digit_to_number): Move earlier, for benefit of read_integer.
16654 Return -1 if the digit is out of range for the base, -2 if it is
16655 not a digit in any supported base. (Bug#8602)
16656
16657 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16658
16659 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16660 to match comment at start of function. This also removes a
16661 GCC warning about overflow in a 32+64-bit port.
16662
16663 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16664
16665 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16666 Reported by Stefan Monnier in
16667 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16668 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16669 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16670
16671 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16672 (EMACS_UINTPTR): Likewise, with uintptr_t.
16673
16674 * lisp.h: Prefer 64-bit EMACS_INT if available.
16675 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16676 on 32-bit hosts that have 64-bit int, so that they can access
16677 large files.
16678 However, temporarily disable this change unless the temporary
16679 symbol WIDE_EMACS_INT is defined.
16680
16681 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16682
16683 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16684 This removes an assumption that EMACS_INT and long are the same
16685 width as pointers. The assumption is true for Emacs porting targets
16686 now, but we want to make other targets possible.
16687 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16688 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16689 In the rest of the code, change types of integers that hold casted
16690 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16691 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16692 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16693 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16694 No need to cast type when ORing.
16695 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16696 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16697 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16698 assume EMACS_INT is the same width as char *.
16699 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16700 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16701 Remove no-longer-needed casts.
16702 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16703 (xg_tool_bar_help_callback, xg_make_tool_item):
16704 Use EMACS_INTPTR to hold an integer
16705 that will be cast to void *; this can avoid a GCC warning
16706 if EMACS_INT is not the same width as void *.
16707 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16708 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16709 (current_message_1, set_message_1):
16710 Use a local to convert to proper width without a cast.
16711 * xmenu.c (dialog_selection_callback): Likewise.
16712
16713 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16714 Also, don't assume VALBITS / RAND_BITS is less than 5,
16715 and don't rely on undefined behavior when shifting a 1 left into
16716 the sign bit.
16717 * lisp.h (get_random): Change signature to match.
16718
16719 * lread.c (hash_string): Use size_t, not int, for hash computation.
16720 Normally we prefer signed values; but hashing is special, because
16721 it's better to use unsigned division on hash table sizes so that
16722 the remainder is nonnegative. Also, size_t is the natural width
16723 for hashing into memory. The previous code used 'int', which doesn't
16724 retain enough info to hash well into very large tables.
16725 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16726
16727 * dbusbind.c: Don't possibly lose pointer info when converting.
16728 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16729 Use XPNTR rather than XHASH, so that the high-order bits of
16730 the pointer aren't lost when converting through void *.
16731
16732 * eval.c (Fautoload): Don't double-shift a pointer.
16733
16734 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16735
16736 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16737
16738 * gnutls.c (DEF_GNUTLS_FN):
16739 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16740
16741 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16742
16743 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16744 marker. (Bug#8610)
16745
16746 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16747
16748 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16749 New version that can reserve upto 2GB of heap space.
16750
16751 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16752
16753 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16754
16755 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16756
16757 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16758 `gnutls_certificate_set_x509_key_file'.
16759
16760 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16761
16762 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16763 Update dependencies.
16764
16765 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16766
16767 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16768 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16769 Remove unused parameter `fildes'.
16770 * process.c (read_process_output, send_process): Don't pass it.
16771
16772 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16773
16774 Fix previous change: the library cache is defined in w32.c.
16775 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16776 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16777
16778 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16779
16780 Implement dynamic loading of GnuTLS on Windows.
16781
16782 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16783 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16784 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16785 Declare.
16786
16787 * gnutls.c (Qgnutls_dll): Define.
16788 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16789 (gnutls_*): Declare function pointers.
16790 (init_gnutls_functions): New function to initialize function pointers.
16791 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16792 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16793 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16794 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16795 (emacs_gnutls_write, emacs_gnutls_read)
16796 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16797 (Fgnutls_available_p): New function.
16798 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16799 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16800 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16801
16802 * image.c: Include w32.h.
16803 (Vimage_type_cache): Delete.
16804 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16805 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16806 (w32_delayed_load): Move to w32.c.
16807
16808 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16809
16810 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16811 (w32_delayed_load): Move from image.c. When loading a library, record
16812 its filename in the :loaded-from property of the library id.
16813 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16814 Initialize and staticpro them.
16815 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16816
16817 * process.c: Include lisp.h before w32.h, not after.
16818 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16819 instead of gnutls_record_check_pending.
16820
16821 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16822
16823 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16824
16825 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16826 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16827 as passed in.
16828
16829 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16830
16831 * xterm.c (x_set_frame_alpha): Do not set property on anything
16832 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16833
16834 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16835
16836 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16837
16838 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16839
16840 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16841 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16842 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16843 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16844 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16845 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16846 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16847 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16848 (Qgnutls_bootprop_callbacks_verify): Make static.
16849
16850 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16851
16852 * callproc.c: Indentation fixup.
16853
16854 * sysdep.c (wait_for_termination_1): Make static.
16855 (wait_for_termination, interruptible_wait_for_termination):
16856 Move after wait_for_termination_1.
16857
16858 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16859
16860 * sysdep.c (interruptible_wait_for_termination): New function
16861 which is like wait_for_termination, but allows keyboard
16862 interruptions.
16863
16864 * callproc.c (Fcall_process): Add (:file "file") as an option for
16865 the STDOUT buffer.
16866 (Fcall_process_region): Ditto.
16867
16868 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16869
16870 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16871 rather than `XVECTOR (FOO)->size'.
16872
16873 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16874 inttypes.h, as a gnulib replacement is used if it not available in
16875 system headers.
16876
16877 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16878
16879 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16880 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16881 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16882
16883 * coding.c (coding_alloc_by_realloc): Error out if destination
16884 will grow beyond MOST_POSITIVE_FIXNUM.
16885 (decode_coding_emacs_mule): Abort if there isn't enough place in
16886 charbuf for the composition carryover bytes. Reserve an extra
16887 space for up to 2 characters produced in a loop.
16888 (decode_coding_iso_2022): Abort if there isn't enough place in
16889 charbuf for the composition carryover bytes.
16890
16891 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16892
16893 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16894 aborting when %lld or %lll format is passed.
16895 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16896 %llo or %llx format is passed. (Bug#8545)
16897
16898 * window.c (window_scroll_line_based): Use a marker instead of
16899 simple variables to record original value of point. (Bug#7952)
16900
16901 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16902 produced by %s or %c overflows available buffer space. (Bug#8545)
16903
16904 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16905
16906 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16907 (SIZE_MAX): Move defn after all includes, as they might #define it.
16908
16909 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16910
16911 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16912
16913 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16914
16915 * keyboard.c (Qdelayed_warnings_hook): Define.
16916 (command_loop_1): Run `delayed-warnings-hook'
16917 if Vdelayed_warnings_list is non-nil.
16918 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16919 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16920
16921 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16922
16923 * doprnt.c (doprnt): Don't return value smaller than the buffer
16924 size if the message was truncated. (Bug#8545).
16925
16926 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16927
16928 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16929 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16930
16931 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16932
16933 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16934
16935 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16936
16937 * makefile.w32-in: Update dependencies.
16938
16939 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16940
16941 Improve `doprnt' and its usage. (Bug#8545)
16942 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16943 `format_end'. Remove support for %l as a conversion specifier.
16944 Don't use xrealloc. Improve diagnostics when the %l size modifier
16945 is used. Update the commentary.
16946
16947 * eval.c (verror): Simplify calculation of size_t.
16948
16949 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16950 messages.
16951
16952 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16953
16954 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16955 change.
16956
16957 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16958
16959 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16960 This makes this file independent of the recent pseudovector change.
16961
16962 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16963
16964 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16965
16966 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16967 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16968 Remove unused local.
16969 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16970
16971 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16972 GCC 4.6.0 optimizes based on type-based alias analysis.
16973 For example, if b is of type struct buffer * and v of type struct
16974 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16975 != &v->size, and therefore "v->size = 1; b->size = 2; return
16976 v->size;" must therefore return 1. This assumption is incorrect
16977 for Emacs, since it type-puns struct Lisp_Vector * with many other
16978 types. To fix this problem, this patch adds a new type struct
16979 vectorlike_header that documents the constraints on layout of vectors
16980 and pseudovectors, and helps optimizing compilers not get fooled
16981 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16982 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16983 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16984 the size member.
16985 (XSETPVECTYPE): Rewrite in terms of new macro.
16986 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16987 This is a bit clearer, and further avoids the possibility of
16988 undesirable aliasing.
16989 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16990 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16991 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16992 since Lisp_Subr is a special case (no "next" field).
16993 (ASIZE): Now uses header.size rather than size.
16994 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16995 to avoid the hassle of writing XVECTOR (foo)->header.size.
16996 (struct vectorlike_header): New type.
16997 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16998 object, to help avoid aliasing.
16999 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17000 (SUBRP): Likewise, since Lisp_Subr is a special case.
17001 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17002 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17003 (struct Lisp_Hash_Table): Combine first two members into a single
17004 struct vectorlike_header member. All uses of "size" and "next" members
17005 changed to be "header.size" and "header.next".
17006 * buffer.h (struct buffer): Likewise.
17007 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17008 * frame.h (struct frame): Likewise.
17009 * process.h (struct Lisp_Process): Likewise.
17010 * termhooks.h (struct terminal): Likewise.
17011 * window.c (struct save_window_data, struct saved_window): Likewise.
17012 * window.h (struct window): Likewise.
17013 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17014 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17015 * buffer.c (init_buffer_once): Likewise.
17016 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17017 special case.
17018 * process.c (Fformat_network_address): Use local var for size,
17019 for brevity.
17020
17021 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17022
17023 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17024 * data.c (atof): Remove decl; no longer used or needed.
17025 (digit_to_number): Move to lread.c.
17026 (Fstring_to_number): Use new string_to_number function, to be
17027 consistent with how the Lisp reader treats infinities and NaNs.
17028 Do not assume that floating-point numbers represent EMACS_INT
17029 without losing information; this is not true on most 64-bit hosts.
17030 Avoid double-rounding errors, by insisting on integers when
17031 parsing non-base-10 numbers, as the documentation specifies.
17032 * lisp.h (string_to_number): New decl, replacing ...
17033 (isfloat_string): Remove.
17034 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17035 (read1): Do not accept +. and -. as integers; this
17036 appears to have been a coding error. Similarly, do not accept
17037 strings like +-1e0 as floating point numbers. Do not report
17038 overflow for integer overflows unless the base is not 10 which
17039 means we have no simple and reliable way to continue.
17040 Break out the floating-point parsing into a new
17041 function string_to_number, so that Fstring_to_number parses
17042 floating point numbers consistently with the Lisp reader.
17043 (digit_to_number): Move here from data.c. Make it static inline.
17044 (E_CHAR, EXP_INT): Remove, replacing with ...
17045 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17046 (string_to_number): New function, replacing isfloat_string.
17047 This function checks for valid syntax and produces the resulting
17048 Lisp float number too. Rework it so that string-to-number
17049 no longer mishandles examples like "1.0e+". Use strtoumax,
17050 so that overflow for non-base-10 numbers is reported only when
17051 there's no portable and simple way to convert to floating point.
17052
17053 * textprop.c (set_text_properties_1): Rewrite for clarity,
17054 and to avoid GCC warning about integer overflow.
17055
17056 * intervals.h (struct interval): Use EMACS_INT for members
17057 where EMACS_UINT might cause problems. See
17058 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17059 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17060 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17061 All uses changed.
17062 (offset_intervals): Tell GCC not to worry about length overflow
17063 when negating a negative length.
17064
17065 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17066 (overrun_check_free): Likewise.
17067
17068 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17069 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17070 word size.
17071
17072 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17073 (gnutls_make_error): Rename local to avoid shadowing.
17074 (gnutls_emacs_global_deinit): ifdef out; not used.
17075 (Fgnutls_boot): Use const for pointer to readonly storage.
17076 Comment out unused local. Fix pointer signedness problems.
17077
17078 * lread.c (openp): Don't stuff size_t into an 'int'.
17079 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17080 about possible signed overflow.
17081
17082 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17083 (GDK_KEY_g): Don't define if already defined.
17084 (xg_prepare_tooltip): Avoid pointer signedness problem.
17085 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17086
17087 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17088 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17089
17090 * xfns.c (Fx_window_property): Simplify a bit,
17091 to make a bit faster and to avoid GCC 4.6.0 warning.
17092 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17093
17094 * fns.c (internal_equal): Don't assume size_t fits in int.
17095
17096 * alloc.c (compact_small_strings): Tighten assertion a little.
17097
17098 Replace pEd with more-general pI, and fix some printf arg casts.
17099 * lisp.h (pI): New macro, generalizing old pEd macro to other
17100 conversion specifiers. For example, use "...%"pI"d..." rather
17101 than "...%"pEd"...".
17102 (pEd): Remove. All uses replaced with similar uses of pI.
17103 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17104 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17105 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17106 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17107 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17108 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17109 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17110 64-bit hosts.
17111 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17112 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17113 * print.c (safe_debug_print, print_object): Likewise.
17114 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17115 to int.
17116 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17117 avoiding the 0 flag, which is not portable.
17118 * process.c (Fmake_network_process): Use pI to avoid cast.
17119 * region-cache.c (pp_cache): Likewise.
17120 * xdisp.c (decode_mode_spec): Likewise.
17121 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17122 behavior on 64-bit hosts with printf arg.
17123 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17124 (x_stop_queuing_selection_requests): Likewise.
17125 (x_get_window_property): Don't truncate byte count to an 'int'
17126 when tracing.
17127
17128 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17129 here, since it parses constructs like leading '-' and spaces,
17130 which are not wanted; and it overflows with large numbers.
17131 Instead, simply match F[0-9]+, which is what is wanted anyway.
17132
17133 * alloc.c: Remove unportable assumptions about struct layout.
17134 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17135 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17136 (allocate_vectorlike, make_pure_vector): Use the new macros,
17137 plus offsetof, to remove unportable assumptions about struct layout.
17138 These assumptions hold on all porting targets that I know of, but
17139 they are not guaranteed, they're easy to remove, and removing them
17140 makes further changes easier.
17141
17142 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17143 This doesn't fix a bug but makes the code clearer.
17144 (string_overrun_cookie): Now const. Use initializers that
17145 don't formally overflow signed char, to avoid warnings.
17146 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17147 can cause Emacs to crash when string overrun checking is enabled.
17148 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17149 multiple of sizeof (EMACS_INT); it need not be, if
17150 alignof(EMACS_INT) < sizeof (EMACS_INT).
17151 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17152
17153 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17154
17155 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17156
17157 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17158
17159 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17160 supposed to be handshaking. (Bug#8556)
17161 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17162
17163 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17164
17165 * lisp.h (Qdebug): List symbol.
17166 * eval.c (Qdebug): Restore global linkage.
17167 * keyboard.c (debug-on-event): New variable.
17168 (handle_user_signal): Break into debugger when debug-on-event
17169 matches the current signal symbol.
17170
17171 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17172
17173 * alloc.c (check_sblock, check_string_bytes)
17174 (check_string_free_list): Convert to standard C.
17175
17176 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17177
17178 * w32.c (emacs_gnutls_push): Fix typo.
17179
17180 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17181
17182 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17183 "cast to pointer from integer of different size".
17184
17185 Improve doprnt and its use in verror. (Bug#8545)
17186 * doprnt.c (doprnt): Document the set of format control sequences
17187 supported by the function. Use SAFE_ALLOCA instead of always
17188 using `alloca'.
17189
17190 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17191 is one byte too soon. Don't use xrealloc; instead xfree and
17192 xmalloc anew.
17193
17194 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17195
17196 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17197 callbacks stage.
17198
17199 * gnutls.c: Renamed global_initialized to
17200 gnutls_global_initialized. Added internals for the
17201 :verify-hostname-error, :verify-error, and :verify-flags
17202 parameters of `gnutls-boot' and documented those parameters in the
17203 docstring. Start callback support.
17204 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17205 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17206 on error. Return error code.
17207 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17208 (emacs_gnutls_read): Likewise.
17209 (Fgnutls_boot): Return handshake error code.
17210 (emacs_gnutls_handle_error): New function.
17211 (wsaerror_to_errno): Likewise.
17212
17213 * w32.h (emacs_gnutls_pull): Add prototype.
17214 (emacs_gnutls_push): Likewise.
17215
17216 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17217 (emacs_gnutls_push): Likewise.
17218
17219 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17220
17221 * process.c (wait_reading_process_output): Check if GnuTLS
17222 buffered some data internally if no FDs are set for TLS
17223 connections.
17224
17225 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17226 (LIBS): Link to USER_LIBS.
17227 ($(BLD)/gnutls.$(0)): New target.
17228
17229 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17230
17231 * xdisp.c (handle_single_display_spec): Rename the
17232 display_replaced_before_p argument into display_replaced_p, to
17233 make it consistent with the commentary. Fix typos in the
17234 commentary.
17235
17236 * textprop.c (syms_of_textprop): Remove dead code.
17237 (copy_text_properties): Delete obsolete commentary about an
17238 interface that was deleted long ago. Fix typos in the description
17239 of arguments.
17240
17241 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17242 to changes in oldXMenu/XMenu.h from 2011-04-16.
17243 <menu_help_message, prev_menu_help_message>: Constify.
17244 (IT_menu_make_room): menu->help_text is now `const char **';
17245 adjust.
17246
17247 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17248 to changes in oldXMenu/XMenu.h from 2011-04-16.
17249 (struct XMenu): Declare `help_text' `const char **'.
17250
17251 * xfaces.c <Qunspecified>: Make extern again.
17252
17253 * syntax.c: Include sys/types.h before including regex.h, as
17254 required by POSIX.
17255
17256 * doc.c (get_doc_string): Improve the format passed to `error'.
17257
17258 * doprnt.c (doprnt): Improve commentary.
17259
17260 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17261
17262 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17263 them with etags.
17264
17265 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17266 changes in globals.h immediately force recompilation.
17267 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17268 $(CURDIR)/s/ms-w32.h.
17269 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17270
17271 * character.c (Fchar_direction): Function deleted.
17272 (syms_of_character): Don't defsubr it.
17273 <char-direction-table>: Deleted.
17274
17275 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17276
17277 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17278 * doprnt.c: Include limits.h.
17279 (SIZE_MAX): New macro.
17280 (doprnt): Return a size_t value. 2nd arg is now size_t.
17281 Many local variables are now size_t instead of int or unsigned.
17282 Improve overflow protection. Support `l' modifier for integer
17283 conversions. Support %l conversion. Don't assume an EMACS_INT
17284 argument for integer conversions and for %c.
17285
17286 * lisp.h (doprnt): Restore prototype.
17287
17288 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17289 $(SRC)/character.h.
17290
17291 * Makefile.in (base_obj): Add back doprnt.o.
17292
17293 * deps.mk (doprnt.o): Add back prerequisites.
17294 (callint.o): Depend on character.h.
17295
17296 * eval.c (internal_lisp_condition_case): Include the handler
17297 representation in the error message.
17298 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17299 when breaking from the loop.
17300
17301 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17302
17303 * callint.c (Fcall_interactively): When displaying error message
17304 about invalid control letter, pass the character's codepoint, not
17305 a pointer to its multibyte form. Improve display of the character
17306 in octal and display also its hex code.
17307
17308 * character.c (char_string): Use %x to display the (unsigned)
17309 codepoint of an invalid character, to avoid displaying a bogus
17310 negative value.
17311
17312 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17313 `error', not SYMBOL_NAME itself.
17314
17315 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17316 character arguments to `error'.
17317
17318 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17319 to `error' in error message about FINAL_CHAR argument. Make sure
17320 FINAL_CHAR is a character, and use %c when it is passed as
17321 argument to `error'.
17322
17323 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17324
17325 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17326
17327 * w32.c: Include <time.h>.
17328 (sys_localtime): New function.
17329
17330 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17331
17332 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17333
17334 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17335
17336 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17337
17338 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17339 zombies (Bug#8467).
17340
17341 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17342
17343 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17344 gl_state.e_property when gl_state.object is Qt.
17345
17346 * insdel.c (make_gap_larger): Remove limitation of buffer size
17347 to <= INT_MAX.
17348
17349 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17350
17351 * xdisp.c (lookup_glyphless_char_display)
17352 (produce_glyphless_glyph): Handle cons cell entry in
17353 glyphless-char-display.
17354 (Vglyphless_char_display): Document it.
17355
17356 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17357 glyphless-char-display.
17358
17359 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17360
17361 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17362
17363 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17364
17365 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17366 definition for no-X builds.
17367
17368 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17369
17370 Static checks with GCC 4.6.0 and non-default toolkits.
17371
17372 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17373
17374 * process.c (keyboard_bit_set): Define only if SIGIO.
17375 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17376 (send_process): Repair possible setjmp clobbering.
17377
17378 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17379
17380 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17381
17382 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17383
17384 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17385 Define only if needed.
17386
17387 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17388 by pacifying GCC about it. Maybe it's time to retire it?
17389 * xfaces.c (USG, __TIMEVAL__): Likewise.
17390
17391 * dispextern.h (struct redisplay_interface): Rename param
17392 to avoid shadowing.
17393 * termhooks.h (struct terminal): Likewise.
17394 * xterm.c (xembed_send_message): Likewise.
17395
17396 * insdel.c (make_gap_smaller): Define only if
17397 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17398
17399 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17400 it.
17401
17402 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17403 so that we aren't warned about unused symbols.
17404
17405 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17406
17407 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17408
17409 * xfns.c (x_real_positions): Mark locals as initialized.
17410
17411 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17412
17413 * xterm.c: Fix problems found by static analysis with other toolkits.
17414 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17415 (x_dispatch_event): Declare static if USE_GTK, and
17416 define if USE_GTK || USE_X_TOOLKIT.
17417 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17418 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17419 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17420 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17421
17422 * xmenu.c (menu_help_callback): Pointer type fixes.
17423 Use const pointers when pointing at readonly data. Avoid pointer
17424 signedness clashes.
17425 (FALSE): Remove unused macro.
17426 (update_frame_menubar): Remove unused decl.
17427
17428 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17429
17430 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17431 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17432 (single_menu_item): Rename local to avoid shadowing.
17433
17434 * keyboard.c (make_lispy_event): Remove unused local var.
17435
17436 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17437 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17438
17439 * bitmaps: Change bitmaps from unsigned char back to the X11
17440 compatible char. Avoid the old compiler warnings about
17441 out-of-range initializers by using, for example, '\xab' rather
17442 than 0xab.
17443
17444 * xgselect.c (xgselect_initialize): Check vs interface
17445 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17446
17447 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17448
17449 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17450 to read-only memory.
17451
17452 * fns.c (vector): Remove; this old hack is no longer needed.
17453
17454 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17455 Remove unused var.
17456 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17457
17458 * xrdb.c (x_load_resources): Omit unused local.
17459
17460 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17461 (x_window): Rename locals to avoid shadowing.
17462 (USG): Use the kludged USG macro, to pacify gcc.
17463
17464 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17465 (x_term_init): Remove local to avoid shadowing.
17466
17467 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17468
17469 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17470 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17471
17472 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17473
17474 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17475
17476 Fix regex.c, syntax.c and friends for buffers > 2GB.
17477 * syntax.h (struct gl_state_s): Declare character position members
17478 EMACS_INT.
17479
17480 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17481
17482 * textprop.c (verify_interval_modification, interval_of):
17483 Declare arguments EMACS_INT.
17484
17485 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17486 EMACS_INT.
17487
17488 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17489
17490 * indent.c (Fvertical_motion): Local variable it_start is now
17491 EMACS_INT.
17492
17493 * regex.c (re_match, re_match_2, re_match_2_internal)
17494 (bcmp_translate, regcomp, regexec, print_double_string)
17495 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17496 (re_compile_pattern, re_exec): Declare arguments and local
17497 variables `size_t' and `ssize_t' and return values `regoff_t', as
17498 appropriate.
17499 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17500 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17501 <compile_stack_type>: `size' and `avail' are now `size_t'.
17502
17503 * regex.h <regoff_t>: Use ssize_t, not int.
17504 (re_search, re_search_2, re_match, re_match_2): Arguments that
17505 specify buffer/string position and length are now ssize_t and
17506 size_t. Return type is regoff_t.
17507
17508 2011-04-16 Ben Key <bkey76@gmail.com>
17509
17510 * nsfont.m: Fixed bugs in ns_get_family and
17511 ns_descriptor_to_entity that were caused by using free to
17512 deallocate memory blocks that were allocated by xmalloc (via
17513 xstrdup). This caused Emacs to crash when compiled with
17514 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17515 --enable-checking=xmallocoverrun). xfree is now used to
17516 deallocate these memory blocks.
17517
17518 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17519
17520 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17521
17522 emacs_write: Accept and return EMACS_INT for sizes.
17523 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17524 et seq.
17525 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17526 Accept and return EMACS_INT.
17527 (emacs_gnutls_write): Return the number of bytes written on
17528 partial writes.
17529 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17530 (emacs_read, emacs_write): Remove check for negative size, as the
17531 Emacs source code has been audited now.
17532 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17533 (emacs_read, emacs_write): Use it.
17534 * process.c (send_process): Adjust to the new signatures of
17535 emacs_write and emacs_gnutls_write. Do not attempt to store
17536 a byte offset into an 'int'; it might overflow.
17537 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17538
17539 * sound.c: Don't assume sizes fit in 'int'.
17540 (struct sound_device.period_size, alsa_period_size):
17541 Return EMACS_INT, not int.
17542 (struct sound_device.write, vox_write, alsa_write):
17543 Accept EMACS_INT, not int.
17544 (wav_play, au_play): Use EMACS_INT to store sizes and to
17545 record read return values.
17546
17547 2011-04-15 Ben Key <bkey76@gmail.com>
17548
17549 * keyboard.c (Qundefined): Don't declare static since it is used
17550 in nsfns.m.
17551 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17552 static since they are used in nsfont.m.
17553
17554 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17555
17556 * process.c (Qprocessp): Don't declare static.
17557 * lisp.h (Qprocessp): Declare again.
17558
17559 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17560
17561 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17562
17563 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17564
17565 Improve C-level modularity by making more things 'static'.
17566
17567 Don't publish debugger-only interfaces to other modules.
17568 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17569 (verify_bytepos, count_markers): Move decls to the only modules
17570 that need them.
17571 * region-cache.h (pp_cache): Likewise.
17572 * window.h (check_all_windows): Likewise.
17573 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17574
17575 * sysdep.c (croak): Now static, if
17576 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17577 * syssignal.h (croak): Declare only if not static.
17578
17579 * alloc.c (refill_memory_reserve): Now static if
17580 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17581 * lisp.h (refill_memory_reserve): Declare only if not static.
17582
17583 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17584 Define only if USE_LUCID.
17585
17586 * xrdb.c (x_customization_string, x_rm_string): Now static.
17587
17588 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17589 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17590
17591 * xdisp.c (draw_row_with_mouse_face): Now static.
17592 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17593
17594 * window.h (check_all_windows): Mark externally visible.
17595
17596 * window.c (window_deletion_count): Now static.
17597
17598 * undo.c: Make symbols static if they're not exported.
17599 (last_undo_buffer, last_boundary_position, pending_boundary):
17600 Now static.
17601
17602 * textprop.c (interval_insert_behind_hooks): Now static.
17603 (interval_insert_in_front_hooks): Likewise.
17604
17605 * term.c: Make symbols static if they're not exported.
17606 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17607 (max_frame_lines, tty_set_terminal_modes):
17608 (tty_reset_terminal_modes, tty_turn_off_highlight):
17609 (get_tty_terminal): Now static.
17610 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17611 * termhooks.h (term_mouse_moveto): Do not declare if
17612 HAVE_WINDOW_SYSTEM.
17613 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17614 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17615
17616 * sysdep.c: Make symbols static if they're not exported.
17617 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17618 Now static.
17619 (sigprocmask_set, full_mask): Remove; unused.
17620 (wait_debugging): Mark as visible.
17621 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17622 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17623
17624 * syntax.c (syntax_temp): Define only if !__GNUC__.
17625
17626 * sound.c (current_sound_device, current_sound): Now static.
17627
17628 * search.c (searchbufs, searchbuf_head): Now static.
17629
17630 * scroll.c (scroll_cost): Remove; unused.
17631 * dispextern.h (scroll_cost): Remove decl.
17632
17633 * region-cache.h (pp_cache): Mark as externally visible.
17634
17635 * process.c: Make symbols static if they're not exported.
17636 (process_tick, update_tick, create_process, chan_process):
17637 (Vprocess_alist, proc_buffered_char, datagram_access):
17638 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17639 (deactivate_process): Mark defn as static, as well as decl.
17640 * lisp.h (create_process): Remove decl.
17641 * process.h (chan_process, Vprocess_alist): Remove decls.
17642
17643 * print.c: Make symbols static if they're not exported.
17644 (print_depth, new_backquote_output, being_printed, print_buffer):
17645 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17646 (print_interval, print_number_index, initial_stderr_stream):
17647 Now static.
17648 * lisp.h (Fprinc): Remove decl.
17649 (debug_output_compilation_hack): Mark as externally visible.
17650
17651 * sysdep.c (croak): Move decl from here to syssignal.h.
17652 * syssignal.h (croak): Put it here, so the API can be checked when
17653 'croak' is called from dissociate_if_controlling_tty.
17654
17655 * minibuf.c: Make symbols static if they're not exported.
17656 (minibuf_save_list, choose_minibuf_frame): Now static.
17657 * lisp.h (choose_minibuf_frame): Remove decl.
17658
17659 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17660
17661 * lread.c: Make symbols static if they're not exported.
17662 (read_objects, initial_obarray, oblookup_last_bucket_number):
17663 Now static.
17664 (make_symbol): Remove; unused.
17665 * lisp.h (initial_obarray, make_symbol): Remove decls.
17666
17667 * keyboard.c: Make symbols static if they're not exported.
17668 (single_kboard, recent_keys_index, total_keys, recent_keys):
17669 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17670 (this_single_command_key_start, echoing, last_auto_save):
17671 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17672 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17673 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17674 (Vlispy_mouse_stem, double_click_count):
17675 Now static.
17676 (force_auto_save_soon): Define only if SIGDANGER.
17677 (ignore_mouse_drag_p): Now static if
17678 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17679 (print_help): Remove; unused.
17680 (stop_character, last_timer_event): Mark as externally visible.
17681 * keyboard.h (ignore_mouse_drag_p): Declare only if
17682 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17683 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17684 * lisp.h (echoing): Remove decl.
17685 (force_auto_save_soon): Declare only if SIGDANGER.
17686 * xdisp.c (redisplay_window): Simplify code, to make it more
17687 obvious that ignore_mouse_drag_p is not accessed if !defined
17688 USE_GTK && !defined HAVE_NS.
17689
17690 * intervals.c: Make symbols static if they're not exported.
17691 (merge_properties_sticky, merge_interval_right, delete_interval):
17692 Now static.
17693 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17694
17695 * insdel.c: Make symbols static if they're not exported.
17696 However, leave prepare_to_modify_buffer alone. It's never
17697 called from outside this function, but that appears to be a bug.
17698 (combine_after_change_list, combine_after_change_buffer):
17699 (adjust_after_replace, signal_before_change): Now static.
17700 (adjust_after_replace_noundo): Remove; unused.
17701 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17702 (signal_before_change): Remove decls.
17703
17704 * indent.c (val_compute_motion, val_vmotion): Now static.
17705
17706 * image.c: Make symbols static if they're not exported.
17707 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17708 if USE_GTK.
17709 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17710 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17711
17712 * fringe.c (standard_bitmaps): Now static.
17713 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17714
17715 * frame.c: Make symbols static if they're not exported.
17716 (x_report_frame_params, make_terminal_frame): Now static.
17717 (get_frame_param): Now static, unless HAVE_NS.
17718 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17719 (x_get_resource_string): Remove; not used.
17720 * frame.h (make_terminal_frame, x_report_frame_params):
17721 (x_get_resource_string); Remove decls.
17722 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17723 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17724
17725 * font.c, fontset.c: Make symbols static if they're not exported.
17726 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17727 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17728 * font.c (font_close_object): Now static.
17729 * font.h (font_close_object): Remove.
17730 * fontset.c (FONTSET_OBJLIST): Remove.
17731 (free_realized_fontset) #if-0 the body, which does nothing.
17732 (face_suitable_for_char_p): #if-0, as it's never called.
17733 * fontset.h (face_suitable_for_char_p): Remove decl.
17734 * xfaces.c (face_at_string_position):
17735 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17736 since 0 is always ASCII.
17737
17738 * fns.c (weak_hash_tables): Now static.
17739
17740 * fileio.c: Make symbols static if they're not exported.
17741 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17742 (Vwrite_region_annotation_buffers): Now static.
17743
17744 * eval.c: Make symbols static if they're not exported.
17745 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17746 * lisp.h (backtrace_list): Remove decl.
17747
17748 * emacs.c: Make symbols static if they're not exported.
17749 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17750 (fatal_error_code, fatal_error_signal_hook, standard_args):
17751 Now static.
17752 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17753 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17754 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17755 * lisp.h (fatal_error_signal_hook): Remove decl.
17756 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17757
17758 * editfns.c: Move a (normally-unused) function to its only use.
17759 * editfns.c, lisp.h (get_operating_system_release): Remove.
17760 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17761 worth the hassle of breaking this out.
17762
17763 * xterm.c: Make symbols static if they're not exported.
17764 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17765 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17766 (x_destroy_window, x_delete_display):
17767 Now static.
17768 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17769 (x_mouse_leave): Remove; unused.
17770 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17771 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17772 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17773 Remove decls.
17774 (x_mouse_leave): Declare only if WINDOWSNT.
17775 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17776 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17777 USE_X_TOOLKIT.
17778
17779 * ftxfont.c: Make symbols static if they're not exported.
17780 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17781 HAVE_FREETYPE.
17782 * font.h (ftxfont_driver): Likewise.
17783
17784 * xfns.c: Make symbols static if they're not exported.
17785 (x_last_font_name, x_display_info_for_name):
17786 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17787 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17788 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17789 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17790 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17791 (last_show_tip_args): Now static.
17792 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17793 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17794 (x_screen_planes): Remove; unused.
17795 * dispextern.h (x_screen_planes): Remove decl.
17796
17797 * dispnew.c: Make symbols static if they're not exported.
17798 * dispextern.h (redraw_garbaged_frames, scrolling):
17799 (increment_row_positions): Remove.
17800 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17801 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17802 Now static.
17803 (redraw_garbaged_frames): Remove; unused.
17804
17805 * xfaces.c: Make symbols static if they're not exported.
17806 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17807 Remove decls.
17808 * xterm.h (defined_color): Remove decls.
17809 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17810 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17811 (menu_face_changed_default, defined_color, free_realized_face):
17812 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17813 (ascii_face_of_lisp_face): Remove; unused.
17814
17815 * xdisp.c: Make symbols static if they're not exported.
17816 * dispextern.h (scratch_glyph_row, window_box_edges):
17817 (glyph_to_pixel_coords, set_cursor_from_row):
17818 (get_next_display_element, set_iterator_to_next):
17819 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17820 (show_mouse_face): Remove decls
17821 * frame.h (message_buf_print): Likewise.
17822 * lisp.h (pop_message, set_message, check_point_in_composition):
17823 Likewise.
17824 * xterm.h (set_vertical_scroll_bar): Likewise.
17825 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17826 (message_buf_print, scratch_glyph_row, displayed_buffer):
17827 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17828 (get_next_display_element, show_mouse_face, window_box_edges):
17829 (frame_to_window_pixel_xy, check_point_in_composition):
17830 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17831 (glyph_to_pixel_coords): Remove; unused.
17832
17833 * dired.c (file_name_completion): Now static.
17834
17835 * dbusbind.c (xd_in_read_queued_messages): Now static.
17836
17837 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17838 * data.c (circular_list_error): Remove.
17839
17840 * commands.h (last_point_position, last_point_position_buffer):
17841 (last_point_position_window): Remove decls.
17842 * keyboard.c: Make these variables static.
17843
17844 * coding.h (coding, code_convert_region, encode_coding_gap):
17845 Remove decls.
17846 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17847 (iso_code_class, detect_coding, code_convert_region): Now static.
17848 (encode_coding_gap): Remove; unused.
17849
17850 * chartab.c (chartab_chars, chartab_bits): Now static.
17851
17852 * charset.h (charset_iso_8859_1): Remove decl.
17853 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17854 Now static.
17855
17856 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17857 * ccl.c (Vccl_program_table): Now static.
17858 (check_ccl_update): Remove; unused.
17859
17860 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17861 * category.h: ... from here.
17862 * category.c (check_category_table, set_category_set): Now static.
17863
17864 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17865 * lisp.h: Remove these decls.
17866
17867 * buffer.c (buffer_count): Remove unused var.
17868
17869 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17870 so that it's not optimized away.
17871 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17872 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17873 exported only to the debugger.
17874
17875 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17876 * atimer.h (run_all_atimers): Remove; not exported.
17877
17878 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17879 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17880 was inaccessible from Lisp.
17881 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17882 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17883
17884 alloc.c: Import and export fewer symbols, and remove unused items.
17885 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17886 is defined.
17887 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17888 it's not optimized away by whole-program optimization.
17889 (message_enable_multibyte, free_misc): Remove.
17890 (catchlist, handlerlist, mark_backtrace):
17891 Declare only if BYTE_MARK_STACK.
17892 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17893 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17894 (message_enable_multibyte): Remove decl.
17895 (free_misc, interval_free_list, float_block, float_block_index):
17896 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17897 (cons_free_list, last_marked_index):
17898 Now static.
17899 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17900 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17901 (mark_backtrace): Define only if BYTE_MARK_STACK.
17902 * xdisp.c (message_enable_multibyte): Now static.
17903
17904 Declare Lisp_Object Q* variables to be 'static' if not exported.
17905 This makes it easier for human readers (and static analyzers)
17906 to see whether these variables are used from other modules.
17907 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17908 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17909 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17910 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17911 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17912 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17913 * xmenu.c, xselect.c:
17914 Declare Q* vars static if they are not used in other modules.
17915 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17916 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17917 Remove decls of unexported vars.
17918 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17919
17920 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17921
17922 Make Emacs functions such as Fatom 'static' by default.
17923 This makes it easier for human readers (and static analyzers)
17924 to see whether these functions can be called from other modules.
17925 DEFUN now defines a static function. To make the function external
17926 so that it can be used in other C modules, use the new macro DEFUE.
17927 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17928 (Finit_image_library):
17929 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17930 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17931 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17932 Remove decls, since these functions are now static.
17933 (Funintern, Fget_internal_run_time): New decls, since these functions
17934 were already external.
17935
17936 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17937 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17938 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17939 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17940 * keyboard.c, keymap.c, lread.c:
17941 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17942 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17943 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17944 Mark functions with DEFUE instead of DEFUN,
17945 if they are used in other modules.
17946 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17947 decls for now-static functions.
17948 * buffer.h (Fdelete_overlay): Remove decl.
17949 * callproc.c (Fgetenv_internal): Mark as internal.
17950 * composite.c (Fremove_list_of_text_properties): Remove decl.
17951 (Fcomposition_get_gstring): New forward static decl.
17952 * composite.h (Fcomposite_get_gstring): Remove decl.
17953 * dired.c (Ffile_attributes): New forward static decl.
17954 * doc.c (Fdocumntation_property): New forward static decl.
17955 * eval.c (Ffetch_bytecode): New forward static decl.
17956 (Funintern): Remove extern decl; now in .h file where it belongs.
17957 * fileio.c (Fmake_symbolic_link): New forward static decl.
17958 * image.c (Finit_image_library): New forward static decl.
17959 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17960 * intervals.h (Fprevious_property_change):
17961 (Fremove_list_of_text_properties): Remove decls.
17962 * keyboard.c (Fthis_command_keys): Remove decl.
17963 (Fcommand_execute): New forward static decl.
17964 * keymap.c (Flookup_key): New forward static decl.
17965 (Fcopy_keymap): Now static.
17966 * keymap.h (Flookup_key): Remove decl.
17967 * process.c (Fget_process): New forward static decl.
17968 (Fprocess_datagram_address): Mark as internal.
17969 * syntax.c (Fsyntax_table_p): New forward static decl.
17970 (skip_chars): Remove duplicate decl.
17971 * textprop.c (Fprevious_property_change): New forward static decl.
17972 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17973 Now internal.
17974 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17975 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17976
17977 * editfns.c (Fformat): Remove unreachable code.
17978
17979 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17980
17981 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17982 change. (Bug#8496)
17983
17984 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17985
17986 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17987 when at ZV. (Bug#8487)
17988
17989 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17990
17991 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17992 (Bug#8437)
17993 * keyboard.c (parse_tool_bar_item): Likewise.
17994 * sound.c (sound_cleanup, alsa_close): Likewise.
17995 * termcap.c (tgetent): Likewise.
17996 * xfns.c (x_default_font_parameter): Likewise.
17997 * xsettings.c (read_and_apply_settings): Likewise.
17998
17999 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18000 (overrun_check_free): Protoize.
18001
18002 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18003
18004 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18005 since callers should never pass a negative size.
18006 Change the signature to match that of plain 'read' and 'write'; see
18007 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18008 * lisp.h: Update prototypes of emacs_write and emacs_read.
18009
18010 2011-04-11 Eli Zaretskii <eliz@gnu.org>
18011
18012 * xdisp.c (redisplay_window): Don't try to determine the character
18013 position of the scroll margin if the window start point w->startp
18014 is outside the buffer's accessible region. (Bug#8468)
18015
18016 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18017
18018 Fix write-region and its subroutines for buffers > 2GB.
18019 * fileio.c (a_write, e_write): Modify declaration of arguments and
18020 local variables to support buffers larger than 2GB.
18021 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18022
18023 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18024 argument, local variables, and return value.
18025
18026 * lisp.h: Update prototypes of emacs_write and emacs_read.
18027
18028 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18029
18030 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18031
18032 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18033
18034 Fix more problems found by GCC 4.6.0's static checks.
18035
18036 * xdisp.c (vmessage): Use a better test for character truncation.
18037
18038 * charset.c (load_charset_map): <, not <=, for optimization,
18039 and to avoid potential problems with integer overflow.
18040 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18041 * casetab.c (set_identity, shuffle): Likewise.
18042 * editfns.c (Fformat): Likewise.
18043 * syntax.c (skip_chars): Likewise.
18044
18045 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18046 This also lets GCC 4.6.0 generate slightly better loop code.
18047
18048 * callint.c (Fcall_interactively): <, not <=, for optimization.
18049 (Fcall_interactively): Count the number of arguments produced,
18050 not the number of arguments given. This is simpler and lets GCC
18051 4.6.0 generate slightly better code.
18052
18053 * ftfont.c: Distingish more carefully between FcChar8 and char.
18054 The previous code passed unsigned char * to a functions like
18055 strlen and xstrcasecmp that expect char *, which does not
18056 conform to the C standard.
18057 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18058 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18059 char * when the C standard requires it.
18060
18061 * keyboard.c (read_char): Remove unused var.
18062
18063 * eval.c: Port to Windows vsnprintf (Bug#8435).
18064 Include <limits.h>.
18065 (SIZE_MAX): Define if the headers do not.
18066 (verror): Do not give up if vsnprintf returns a negative count.
18067 Instead, grow the buffer. This ports to Windows vsnprintf, which
18068 does not conform to C99. Problem reported by Eli Zaretskii.
18069 Also, simplify the allocation scheme, by avoiding the need for
18070 calling realloc, and removing the ALLOCATED variable.
18071
18072 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18073
18074 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18075 But keep the doprint source code for now, as we might revamp it
18076 and use it again (Bug#8435).
18077 * lisp.h (doprnt): Remove.
18078 * Makefile.in (base_obj): Remove doprnt.o.
18079 * deps.mk (doprnt.o): Remove.
18080
18081 error: Print 32- and 64-bit integers portably (Bug#8435).
18082 Without this change, on typical 64-bit hosts error ("...%d...", N)
18083 was used to print both 32- and 64-bit integers N, which relied on
18084 undefined behavior.
18085 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18086 * lisp.h (error, verror): Mark as printf-like functions.
18087 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18088 Report overflow in size calculations when allocating printf buffer.
18089 Do not truncate output string at its first null byte.
18090 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18091 Truncate the output at a character boundary, since vsnprintf does not
18092 do that.
18093 * charset.c (check_iso_charset_parameter): Convert internal
18094 character to string before calling 'error', since %c now has the
18095 printf meaning.
18096 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18097 overflow when computing char to be passed to 'error'. Do not
18098 pass Lisp_Object to 'error'; pass the integer instead.
18099 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18100 formatted with plain %d.
18101
18102 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18103
18104 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18105
18106 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18107
18108 * xterm.c (x_catch_errors): Remove duplicate declaration.
18109
18110 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18111
18112 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18113
18114 2011-04-10 Jim Meyering <meyering@redhat.com>
18115
18116 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18117 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18118 return ssize_t not "int", and use size_t as the buffer length.
18119 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18120 * gnutls.h: Update declarations.
18121 * process.c (read_process_output): Use ssize_t, to match.
18122 (send_process): Likewise.
18123
18124 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18125
18126 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18127
18128 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18129
18130 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18131 Use unsigned char, to match FcChar8 type definition.
18132
18133 * xterm.c (handle_one_xevent):
18134 * xmenu.c (create_and_show_popup_menu):
18135 * xselect.c (x_decline_selection_request)
18136 (x_reply_selection_request): Avoid type-punned deref of X events.
18137
18138 2011-04-09 Eli Zaretskii <eliz@gnu.org>
18139
18140 Fix some uses of `int' instead of EMACS_INT.
18141 * search.c (string_match_1, fast_string_match)
18142 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18143 (scan_buffer, find_next_newline_no_quit)
18144 (find_before_next_newline, search_command, Freplace_match)
18145 (Fmatch_data): Make some `int' variables be EMACS_INT.
18146
18147 * xdisp.c (display_count_lines): 3rd argument and return value now
18148 EMACS_INT. All callers changed.
18149 (pint2hrstr): Last argument is now EMACS_INT.
18150
18151 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18152 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18153 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18154 (decode_coding_utf_16, decode_coding_emacs_mule)
18155 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18156 (decode_coding_ccl, decode_coding_charset)
18157 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18158 (decode_coding_iso_2022, decode_coding_emacs_mule)
18159 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18160 <char_offset, last_offset>: Declare EMACS_INT.
18161 (encode_coding_utf_8, encode_coding_utf_16)
18162 (encode_coding_emacs_mule, encode_invocation_designation)
18163 (encode_designation_at_bol, encode_coding_iso_2022)
18164 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18165 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18166 Declare EMACS_INT.
18167 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18168 (encode_invocation_designation): Last argument P_NCHARS is now
18169 EMACS_INT.
18170 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18171 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18172
18173 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18174 All users changed.
18175
18176 * ccl.c (Fccl_execute_on_string): Declare some variables
18177 EMACS_INT.
18178
18179 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18180
18181 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18182
18183 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18184
18185 * process.c (Fformat_network_address): Doc fix.
18186
18187 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18188
18189 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18190
18191 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18192
18193 * keyboard.c (read_char): Call Lisp function help-form-show,
18194 instead of using internal_with_output_to_temp_buffer.
18195 (Qhelp_form_show): New var.
18196 (syms_of_keyboard): Use DEFSYM macro.
18197
18198 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18199
18200 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18201
18202 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18203
18204 * process.c (Flist_processes): Remove to Lisp.
18205 (list_processes_1): Delete.
18206
18207 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18208
18209 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18210
18211 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18212
18213 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18214
18215 Fix more problems found by GCC 4.6.0's static checks.
18216
18217 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18218
18219 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18220
18221 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18222
18223 * xdisp.c (vmessage): Mark as a printf-like function.
18224
18225 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18226
18227 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18228
18229 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18230 printf-like functions.
18231 (tiff_load): Add casts to remove these marks before passing them
18232 to system-supplied API.
18233
18234 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18235
18236 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18237 This avoids several warnings with gcc -Wstrict-overflow.
18238 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18239 directly, rather than having caller test rule sign. This avoids
18240 some unnecessary tests.
18241 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18242 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18243 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18244
18245 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18246 (xfont_open): Avoid unnecessary tests.
18247
18248 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18249
18250 * composite.h, composite.c (composition_gstring_put_cache):
18251 Use EMACS_INT, not int, for length.
18252
18253 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18254 breaking out part of COMPOSITION_DECODE_RULE.
18255 (COMPOSITION_DECODE_RULE): Use it.
18256 * composite.c (get_composition_id): Remove unused local vars,
18257 by using the new macro.
18258
18259 * textprop.c (set_text_properties_1): Change while to do-while,
18260 since the condition is always true at first.
18261
18262 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18263 (interval_deletion_adjustment): Return unsigned value.
18264 All uses changed.
18265
18266 * process.c (list_processes_1, create_pty, read_process_output):
18267 (exec_sentinel): Remove vars that were set but not used.
18268 (create_pty): Remove unnecessary "volatile"s.
18269 (Fnetwork_interface_info): Avoid possibility of int overflow.
18270 (read_process_output): Do adaptive read buffering even if carryover.
18271 (read_process_output): Simplify nbytes computation if buffered.
18272
18273 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18274
18275 * syntax.c (scan_words): Remove var that was set but not used.
18276 (update_syntax_table): Use unsigned instead of int.
18277
18278 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18279 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18280 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18281
18282 * print.c (print_error_message): Avoid int overflow.
18283
18284 * font.c (font_list_entities): Redo for clarity,
18285 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18286
18287 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18288 (font_score): Avoid potential overflow in diff calculation.
18289
18290 * fns.c (substring_both): Remove var that is set but not used.
18291 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18292
18293 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18294
18295 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18296 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18297 can always succeed if overflow has undefined behavior.
18298
18299 * search.c (boyer_moore, wordify): Remove vars set but not used.
18300 (wordify): Omit three unnecessary tests.
18301
18302 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18303 All callers changed. This avoids the need for an unused var.
18304
18305 * casefiddle.c (casify_region): Remove var that is set but not used.
18306
18307 * dired.c (file_name_completion): Remove var that is set but not used.
18308
18309 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18310
18311 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18312 (Finsert_file_contents): Remove unnecessary code checking fd.
18313
18314 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18315 Check for integer overflow on size calculations.
18316
18317 * buffer.c (Fprevious_overlay_change): Remove var that is set
18318 but not used.
18319
18320 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18321 Remove vars that are set but not used.
18322 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18323 (timer_check_2): Mark vars as initialized.
18324
18325 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18326
18327 * image.c (lookup_image): Remove var that is set but not used.
18328 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18329
18330 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18331 that are set but not used.
18332
18333 * xfns.c (make_invisible_cursor): Don't return garbage
18334 if XCreateBitmapFromData fails (Bug#8410).
18335
18336 * xselect.c (x_get_local_selection, x_handle_property_notify):
18337 Remove vars that are set but not used.
18338
18339 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18340 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18341
18342 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18343 Remove var that is set but not used.
18344 (scroll_bar_windows_size): Now size_t, not int.
18345 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18346 Check for overflow.
18347
18348 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18349 (map_tty_color) [!defined MSDOS]: Likewise.
18350
18351 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18352
18353 * coding.c: Remove vars that are set but not used.
18354 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18355 All callers changed.
18356 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18357 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18358 (decode_coding_charset): Remove vars that are set but not used.
18359
18360 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18361 that is set but not used.
18362
18363 * print.c (print_object): Remove var that is set but not used.
18364
18365 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18366 The gnulib version avoids calling malloc in the usual case,
18367 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18368 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18369 * filelock.c (current_lock_owner): Likewise.
18370 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18371 * sysdep.c: Include allocator.h, careadlinkat.h.
18372 (emacs_no_realloc_allocator): New static constant.
18373 (emacs_readlink): New function.
18374 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18375 ../lib/careadlinkat.h.
18376
18377 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18378
18379 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18380 first non-nil return value).
18381
18382 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18383
18384 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18385 if not defined (Bug#8403).
18386
18387 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18388
18389 * xdisp.c (display_count_lines): Remove parameter `start',
18390 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18391 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18392 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18393 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18394 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18395 and thereabouts. All callers changed.
18396 (get_per_char_metric): Remove parameter `f', unused since
18397 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18398
18399 2011-04-02 Jim Meyering <meyering@redhat.com>
18400
18401 do not dereference NULL upon failed strdup
18402 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18403 (ns_get_family): Likewise.
18404
18405 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18406
18407 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18408
18409 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18410
18411 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18412 later (Bug#8403).
18413
18414 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18415
18416 Add lexical binding.
18417
18418 * window.c (Ftemp_output_buffer_show): New fun.
18419 (Fsave_window_excursion):
18420 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18421
18422 * lread.c (lisp_file_lexically_bound_p): New function.
18423 (Fload): Bind Qlexical_binding.
18424 (readevalloop): Remove `evalfun' arg.
18425 Bind Qinternal_interpreter_environment.
18426 (Feval_buffer): Bind Qlexical_binding.
18427 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18428 Mark as dynamic.
18429 (syms_of_lread): Declare `lexical-binding'.
18430
18431 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18432
18433 * keyboard.c (eval_dyn): New fun.
18434 (menu_item_eval_property): Use it.
18435
18436 * image.c (parse_image_spec): Use Ffunctionp.
18437
18438 * fns.c (concat, mapcar1): Accept byte-code-functions.
18439
18440 * eval.c (Fsetq): Handle lexical vars.
18441 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18442 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18443 (FletX, Flet): Obey lexical binding.
18444 (Fcommandp): Handle closures.
18445 (Feval): New `lexical' arg.
18446 (eval_sub): New function extracted from Feval. Use it almost
18447 everywhere where Feval was used. Look up vars in lexical env.
18448 Handle closures.
18449 (Ffunctionp): Move from subr.el.
18450 (Ffuncall): Handle closures.
18451 (apply_lambda): Remove `eval_flags'.
18452 (funcall_lambda): Handle closures and new byte-code-functions.
18453 (Fspecial_variable_p): New function.
18454 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18455 but without exporting it to Lisp.
18456
18457 * doc.c (Fdocumentation, store_function_docstring):
18458 * data.c (Finteractive_form): Handle closures.
18459
18460 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18461 interactive spec.
18462
18463 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18464 New byte-codes.
18465 (exec_byte_code): New function extracted from Fbyte_code to handle new
18466 calling convention for byte-code-functions. Add new byte-codes.
18467
18468 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18469
18470 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18471
18472 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18473
18474 * xdisp.c (redisplay_internal): Fix prototype.
18475
18476 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18477
18478 * xdisp.c (SCROLL_LIMIT): New macro.
18479 (try_scrolling): Use it when setting scroll_limit.
18480 Limit scrolling to 100 screen lines.
18481 (redisplay_window): Even when falling back on "recentering",
18482 position point in the window according to scroll-conservatively,
18483 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18484
18485 (try_scrolling): When point is above the window, allow searching
18486 as far as scroll_max, or one screenful, to compute vertical
18487 distance from PT to the scroll margin position. This prevents
18488 try_scrolling from unnecessarily failing when
18489 scroll-conservatively is set to a value slightly larger than the
18490 window height. Clean up the case of PT below the margin at bottom
18491 of window: scroll_max can no longer be INT_MAX. When aggressive
18492 scrolling is in use, don't let point enter the opposite scroll
18493 margin as result of the scroll.
18494 (syms_of_xdisp) <scroll-conservatively>: Document the
18495 threshold of 100 lines for never-recentering scrolling.
18496
18497 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18498
18499 * dispextern.h (move_it_by_lines):
18500 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18501 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18502 (message_log_check_duplicate): Remove parameters `prev_bol' and
18503 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18504 (redisplay_internal): Remove parameter `preserve_echo_area',
18505 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18506
18507 * indent.c (Fvertical_motion):
18508 * window.c (window_scroll_pixel_based, Frecenter):
18509 Don't pass `need_y_p' to `move_it_by_lines'.
18510
18511 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18512
18513 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18514 steal a few bits to be more compact.
18515 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18516 Remove unneeded casts.
18517
18518 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18519
18520 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18521
18522 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18523 binding" message (bug#7967).
18524
18525 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18526
18527 Fix more problems found by GCC 4.6.0's static checks.
18528
18529 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18530 Remove unused local var.
18531
18532 * editfns.c (Fmessage_box): Remove unused local var.
18533
18534 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18535 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18536 Omit unused local vars.
18537 * window.c (shrink_windows): Omit unused local var.
18538 * menu.c (digest_single_submenu): Omit unused local var.
18539 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18540 Omit unused local var.
18541
18542 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18543 Don't assume string length fits in int.
18544 (keyremap_step, read_key_sequence): Use size_t for sizes.
18545 (read_key_sequence): Don't check last_real_key_start redundantly.
18546
18547 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18548 instead of alloca (Bug#8344).
18549
18550 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18551 (Fbacktrace_frame): Don't assume nframes fits in int.
18552
18553 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18554
18555 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18556 concerns.
18557
18558 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18559
18560 * cm.c (calccost): Turn while-do into do-while, for clarity.
18561
18562 * keyboard.c (syms_of_keyboard): Use the same style as later
18563 in this function when indexing through an array. This also
18564 works around GCC bug 48267.
18565
18566 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18567
18568 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18569
18570 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18571 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18572
18573 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18574 This avoids undefined behavior on integer overflow, and is a bit
18575 more convenient anyway since it is compared to a size_t variable.
18576
18577 Variadic C functions now count arguments with size_t, not int.
18578 This avoids an unnecessary limitation on 64-bit machines, which
18579 caused (substring ...) to crash on large vectors (Bug#8344).
18580 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18581 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18582 All variadic functions and their callers changed accordingly.
18583 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18584 * data.c (arith_driver, float_arith_driver): Likewise.
18585 * editfns.c (general_insert_function): Likewise.
18586 * eval.c (struct backtrace.nargs, interactive_p)
18587 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18588 (funcall_lambda, mark_backtrace): Likewise.
18589 * fns.c (concat): Likewise.
18590 * frame.c (x_set_frame_parameters): Likewise.
18591 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18592 0 if not found, not -1. All callers changed.
18593
18594 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18595 (stack_copy_size): Now size_t, not int.
18596 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18597
18598 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18599
18600 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18601 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18602 All callers changed.
18603
18604 * lisp.h (multibyte_char_to_unibyte):
18605 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18606 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18607 * character.h (CHAR_TO_BYTE8):
18608 * cmds.c (internal_self_insert):
18609 * editfns.c (general_insert_function):
18610 * keymap.c (push_key_description):
18611 * search.c (Freplace_match):
18612 * xdisp.c (message_dolog, set_message_1): All callers changed.
18613
18614 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18615
18616 * keyboard.c (safe_run_hook_funcall): New function.
18617 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18618 don't set the hook to nil, but remove the offending function instead.
18619 (Qcommand_hook_internal): Remove, unused.
18620 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18621 Vcommand_hook_internal.
18622
18623 * eval.c (enum run_hooks_condition): Remove.
18624 (funcall_nil, funcall_not): New functions.
18625 (run_hook_with_args): Call each function through a `funcall' argument.
18626 Remove `cond' argument, now redundant.
18627 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18628 (Frun_hook_with_args_until_failure): Adjust accordingly.
18629 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18630
18631 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18632
18633 * dispextern.h (string_buffer_position): Remove declaration.
18634
18635 * print.c (strout): Remove parameter `multibyte', unused since
18636 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18637
18638 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18639 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18640 All callers changed.
18641
18642 * w32.c (_wsa_errlist): Use braces for struct initializers.
18643
18644 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18645 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18646 All callers changed.
18647 (string_buffer_position): Likewise. Also, make static (it's never
18648 used outside xdisp.c).
18649 (cursor_row_p): Remove parameter `w', unused since
18650 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18651 (decode_mode_spec): Remove parameter `precision', introduced during
18652 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18653 All callers changed.
18654
18655 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18656
18657 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18658
18659 2011-03-27 Anders Lindgren <andlind@gmail.com>
18660
18661 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18662 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18663 (ns_update_auto_hide_menu_bar): New functions.
18664 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18665 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18666 ns_constrain_all_frames.
18667 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18668 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18669
18670 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18671
18672 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18673
18674 2011-03-27 Glenn Morris <rgm@gnu.org>
18675
18676 * syssignal.h: Replace RETSIGTYPE with void.
18677 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18678 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18679 Replace SIGTYPE with void everywhere.
18680 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18681 * s/template.h (SIGTYPE): Remove commented out definition.
18682
18683 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18684
18685 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18686 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18687
18688 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18689
18690 * w32.c (read_unc_volume): Use parameter `henum', instead of
18691 global variable `wget_enum_handle'.
18692
18693 * keymap.c (describe_vector): Remove parameters `indices' and
18694 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18695 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18696
18697 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18698
18699 * keyboard.c (timer_check): Remove parameter `do_it_now',
18700 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18701 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18702 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18703
18704 * keyboard.c (read_char):
18705 * w32menu.c (w32_menu_display_help):
18706 * xmenu.c (show_help_event, menu_help_callback):
18707 Adjust calls to `show_help_echo'.
18708
18709 * gtkutil.c (xg_maybe_add_timer):
18710 * keyboard.c (readable_events):
18711 * process.c (wait_reading_process_output):
18712 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18713
18714 * insdel.c (adjust_markers_gap_motion):
18715 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18716 (gap_left, gap_right): Don't call it.
18717
18718 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18719
18720 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18721 incurred during fontification.
18722
18723 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18724
18725 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18726 (DEFVAR_PER_BUFFER): Don't pass it.
18727
18728 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18729 (scrolling_window): Don't pass it.
18730
18731 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18732
18733 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18734
18735 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18736 and `suffix'.
18737 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18738 of variables specific to SELinux and computation of `encoded_absname'.
18739
18740 * image.c (XPutPixel): Remove unused variable `height'.
18741
18742 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18743
18744 * unexw32.c (get_section_info): Remove unused variable `section'.
18745
18746 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18747 (system_process_attributes): Remove unused variable `sess'.
18748 (sys_read): Remove unused variable `err'.
18749
18750 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18751 (w32_wnd_proc): Remove unused variable `isdead'.
18752 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18753 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18754 (x_create_tip_frame): Remove unused variable `tem'.
18755
18756 * w32inevt.c (w32_console_read_socket):
18757 Remove unused variable `no_events'.
18758
18759 * w32term.c (x_draw_composite_glyph_string_foreground):
18760 Remove unused variable `width'.
18761
18762 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18763
18764 * w32term.c (x_set_glyph_string_clipping):
18765 Don't pass uninitialized region to CombineRgn.
18766
18767 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18768
18769 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18770 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18771 (Fx_close_connection): Remove unused variable `i'.
18772
18773 * w32font.c (w32font_draw): Return number of glyphs.
18774 (w32font_open_internal): Remove unused variable `i'.
18775 (w32font_driver): Add missing initializer.
18776
18777 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18778 (fill_in_menu): Remove unused variable `items_added'.
18779
18780 * w32term.c (last_mouse_press_frame): Remove static global variable.
18781 (w32_clip_to_row): Remove unused variable `f'.
18782 (x_delete_terminal): Remove unused variable `i'.
18783
18784 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18785 (NOTHING): Remove unused static global variable.
18786 (uniscribe_check_otf): Remove unused variable `table'.
18787 (uniscribe_font_driver): Add missing initializers.
18788
18789 2011-03-23 Julien Danjou <julien@danjou.info>
18790
18791 * term.c (Fsuspend_tty, Fresume_tty):
18792 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18793 * window.c (temp_output_buffer_show):
18794 * insdel.c (signal_before_change):
18795 * frame.c (Fhandle_switch_frame):
18796 * fileio.c (Fdo_auto_save):
18797 * emacs.c (Fkill_emacs):
18798 * editfns.c (save_excursion_restore):
18799 * cmds.c (internal_self_insert):
18800 * callint.c (Fcall_interactively):
18801 * buffer.c (Fkill_all_local_variables):
18802 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18803 Use Frun_hooks.
18804 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18805 unconditionally since it does the check itself.
18806
18807 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18808
18809 Fix more problems found by GCC 4.5.2's static checks.
18810
18811 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18812 the first time through the loop, since we know p0 < p1 then.
18813 This also avoids a gcc -Wstrict-overflow warning.
18814
18815 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18816 leading to a memory leak, possible in functions like
18817 load_charset_map_from_file that can allocate an unbounded number
18818 of objects (Bug#8318).
18819
18820 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18821 that could (at least in theory) be that large.
18822
18823 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18824 This is less likely to overflow, and avoids undefined behavior if
18825 overflow does occur. All callers changed. Use strtoul to scan
18826 for the unsigned long integer.
18827 (pint2hrstr): Simplify and tune code slightly.
18828 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18829
18830 * scroll.c (do_scrolling): Work around GCC bug 48228.
18831 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18832
18833 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18834 This also avoids a warning with gcc -Wstrict-overflow.
18835 (validate_x_resource_name): Simplify count usage.
18836 This also avoids a warning with gcc -Wstrict-overflow.
18837
18838 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18839 fail (Bug#8306).
18840
18841 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18842
18843 * process.c (Fmake_network_process): Use socklen_t, not int,
18844 where POSIX says socklen_t is required in portable programs.
18845 This fixes a porting bug on hosts like 64-bit HP-UX, where
18846 socklen_t is wider than int (Bug#8277).
18847 (Fmake_network_process, server_accept_connection):
18848 (wait_reading_process_output, read_process_output):
18849 Likewise.
18850
18851 * process.c: Rename or move locals to avoid shadowing.
18852 (list_processes_1, Fmake_network_process):
18853 (read_process_output_error_handler, exec_sentinel_error_handler):
18854 Rename or move locals.
18855 (Fmake_network_process): Define label "retry_connect" only if needed.
18856 (Fnetwork_interface_info): Fix pointer signedness.
18857 (process_send_signal): Add cast to avoid pointer signedness problem.
18858 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18859 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18860
18861 Make tparam.h and terminfo.c consistent.
18862 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18863 Include tparam.h instead, since it declares them.
18864 * cm.h (PC): Remove extern decl; tparam.h now does this.
18865 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18866 * terminfo.c: Include tparam.h, to check interfaces.
18867 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18868 (tparam): Adjust signature to match interface in tparam.h;
18869 this removes some undefined behavior. Check that outstring and len
18870 are zero, which they always are with Emacs.
18871 * tparam.h (PC, BC, UP): New extern decls.
18872
18873 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18874 (xftfont_open): Rename locals to avoid shadowing.
18875
18876 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18877 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18878 (OTF_TAG_SYM): Omit macro if not needed.
18879 (ftfont_list): Remove unused local.
18880 (get_adstyle_property, ftfont_pattern_entity):
18881 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18882 Rename locals to avoid shadowing.
18883
18884 * xfont.c (xfont_list_family): Mark var as initialized.
18885
18886 * xml.c (make_dom): Now static.
18887
18888 * composite.c (composition_compute_stop_pos): Rename local to
18889 avoid shadowing.
18890 (composition_reseat_it): Remove unused locals.
18891 (find_automatic_composition, composition_adjust_point): Likewise.
18892 (composition_update_it): Mark var as initialized.
18893 (find_automatic_composition): Mark vars as initialized,
18894 with a FIXME (Bug#8290).
18895
18896 character.h: Rename locals to avoid shadowing.
18897 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18898 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18899 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18900 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18901 to avoid shadowing.
18902
18903 * textprop.c (property_change_between_p): Remove; unused.
18904
18905 * intervals.c (interval_start_pos): Now static.
18906
18907 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18908
18909 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18910 Rename locals to avoid shadowing.
18911
18912 * sound.c (wav_play, au_play, Fplay_sound_internal):
18913 Fix pointer signedness.
18914 (alsa_choose_format): Remove unused local var.
18915 (wav_play): Initialize a variable to 0, to prevent undefined
18916 behavior (Bug#8278).
18917
18918 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18919
18920 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18921
18922 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18923 clobbering (Bug#8298).
18924 * sysdep.c (sys_subshell): Likewise.
18925 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18926
18927 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18928 This should get cleaned up, so that child_setup has the
18929 same signature on all platforms.
18930
18931 * callproc.c (call_process_cleanup): Now static.
18932 (relocate_fd): Rename locals to avoid shadowing.
18933
18934 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18935
18936 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18937 not to be necessary, and produces flickering.
18938
18939 2011-03-20 Glenn Morris <rgm@gnu.org>
18940
18941 * config.in: Remove file.
18942
18943 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18944
18945 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18946 are now in src/globals.h.
18947 (syms_of_minibuf): Remove spurious & from previous change.
18948
18949 2011-03-20 Leo Liu <sdl.web@gmail.com>
18950
18951 * minibuf.c (completing-read-function): New variable.
18952 (completing-read-default): Rename from completing-read.
18953 (completing-read): Call completing-read-function.
18954
18955 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18956
18957 * xfaces.c (Fx_load_color_file):
18958 Read color file from absolute filename (bug#8250).
18959
18960 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18961
18962 * makefile.w32-in: Update dependencies.
18963
18964 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18965
18966 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18967
18968 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18969
18970 Fix more problems found by GCC 4.5.2's static checks.
18971
18972 * process.c (make_serial_process_unwind, send_process_trap):
18973 (sigchld_handler): Now static.
18974
18975 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18976 That way, the code declares only the vars that it needs.
18977 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18978 * s/cygwin.h (PTY_ITERATION): Likewise.
18979 * s/darwin.h (PTY_ITERATION): Likewise.
18980 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18981
18982 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18983 * process.c (allocate_pty): Don't declare stb unless it's needed.
18984
18985 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18986 (CONSTANTLIM): Remove; unused.
18987 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18988 Define only if needed.
18989
18990 * unexelf.c (unexec): Name an expression,
18991 to avoid gcc -Wbad-function-cast warning.
18992 Use a different way to cause a compilation error if anyone uses
18993 n rather than nn, a way that does not involve shadowing.
18994 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18995
18996 * deps.mk (unexalpha.o): Remove; unused.
18997
18998 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18999 * unexec.h: New file.
19000 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19001 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19002 Depend on unexec.h.
19003 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19004 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19005 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19006 Change as necessary to match prototype in unexec.h.
19007
19008 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19009 shadowing.
19010 (back_comment, skip_chars): Mark vars as initialized.
19011
19012 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19013 Rename locals to avoid shadowing.
19014
19015 * lread.c (read1): Rewrite so as not to use empty "else".
19016 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19017
19018 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19019
19020 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19021 warning when compiling print.c.
19022
19023 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19024 instead of using an uninitialized var.
19025 (font_sort_entities): Mark var as initialized.
19026
19027 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19028
19029 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19030 pointers to constants.
19031 (font_parse_fcname): Remove unused vars.
19032 (font_delete_unmatched): Now static.
19033 (font_get_spec): Remove; unused.
19034 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19035 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19036 Rename or move locals to avoid shadowing.
19037
19038 * fns.c (require_nesting_list, require_unwind): Now static.
19039 (Ffillarray): Rename locals to avoid shadowing.
19040
19041 * floatfns.c (domain_error2): Define only if needed.
19042 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19043
19044 * alloc.c (mark_backtrace): Move decl from here ...
19045 * lisp.h: ... to here, so that it can be checked.
19046
19047 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19048 (Fdefvar): Rewrite so as not to use empty "else".
19049 (lisp_indirect_variable): Name an expression,
19050 to avoid gcc -Wbad-function-cast warning.
19051 (Fdefvar): Rename locals to avoid shadowing.
19052
19053 * callint.c (quotify_arg, quotify_args): Now static.
19054 (Fcall_interactively): Rename locals to avoid shadowing.
19055 Use const pointer when appropriate.
19056
19057 * lisp.h (get_system_name, get_operating_system_release):
19058 Move decls here, to check interfaces.
19059 * process.c (get_operating_system_release): Move decl to lisp.h.
19060 * xrdb.c (get_system_name): Likewise.
19061 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19062 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19063 some of which prompt warnings from gcc -Wbad-function-cast.
19064 (Fformat_time_string, Fencode_time, Finsert_char):
19065 (Ftranslate_region_internal, Fformat):
19066 Rename or remove local vars to avoid shadowing.
19067 (Ftranslate_region_internal): Mark var as initialized.
19068
19069 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19070 avoid shadowing.
19071
19072 * lisp.h (eassert): Check that the argument compiles, even if
19073 ENABLE_CHECKING is not defined.
19074
19075 * data.c (Findirect_variable): Name an expression, to avoid
19076 gcc -Wbad-function-cast warning.
19077 (default_value, arithcompare, arith_driver, arith_error): Now static.
19078 (store_symval_forwarding): Rename local to avoid shadowing.
19079 (Fmake_variable_buffer_local, Fmake_local_variable):
19080 Mark variables as initialized.
19081 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19082
19083 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19084 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19085 Rename locals to avoid shadowing.
19086 (mark_stack): Move local variables into the #ifdef region where
19087 they're used.
19088 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19089 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19090 needed otherwise.
19091 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19092 (GC_STRING_CHARS): Remove; not used.
19093 (Fmemory_limit): Cast sbrk's returned value to char *.
19094
19095 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19096 avoids undefined behavior in theory.
19097
19098 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19099
19100 Use functions, not macros, for up- and down-casing (Bug#8254).
19101 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19102 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19103 to use the following functions instead of these macros.
19104 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19105 EMACS_INT, since callers assume the returned value fits in int.
19106 (upcase1): Likewise, for UPCASE_TABLE.
19107 (uppercasep, lowercasep, upcase): New static inline functions.
19108 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19109 the race-condition problem in the old DOWNCASE.
19110
19111 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19112 Rename locals to avoid shadowing.
19113 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19114 (regex_compile, re_search_2, re_match_2_internal):
19115 Remove unused local vars.
19116 (FREE_VAR): Rewrite so as not to use empty "else",
19117 which gcc can warn about.
19118 (regex_compile, re_match_2_internal): Mark locals as initialized.
19119 (RETALLOC_IF): Define only if needed.
19120 (WORDCHAR_P): Likewise. This one is never needed, but is used
19121 only in a comment talking about a compiler bug, so put inside
19122 the #if 0 of that comment.
19123 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19124 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19125 Remove; unused.
19126
19127 * search.c (boyer_moore): Rename locals to avoid shadowing.
19128 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19129 (PREV_CHAR_BOUNDARY): Likewise.
19130
19131 * search.c (simple_search): Remove unused var.
19132
19133 * dired.c (compile_pattern): Move decl from here ...
19134 * lisp.h: ... to here, so that it can be checked.
19135 (struct re_registers): New forward decl.
19136
19137 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19138
19139 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19140 All uses changed.
19141 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19142 Rename locals to avoid shadowing.
19143 (Fvertical_motion): Mark locals as initialized.
19144
19145 * casefiddle.c (casify_object, casify_region): Now static.
19146 (casify_region): Mark local as initialized.
19147
19148 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19149
19150 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19151 New macros, so that the caller can use some names other than
19152 gcpro1, gcpro2, etc.
19153 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19154 of the new macros.
19155 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19156 argument, for consistency with GCPRO2_VAR, etc: it is now the
19157 prefix of the variable, not the variable itself. All uses
19158 changed.
19159 * dired.c (directory_files_internal, file_name_completion):
19160 Rename locals to avoid shadowing.
19161
19162 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19163 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19164 dired.c's scmp function, had undefined behavior.
19165 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19166 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19167 * buffer.h: ... to here, because these macros use current_buffer,
19168 and the new implementation with inline functions needs to have
19169 current_buffer in scope now, rather than later when the macros
19170 are used.
19171 (downcase, upcase1): New static inline functions.
19172 (DOWNCASE, UPCASE1): Reimplement using these functions.
19173 This avoids undefined behavior in expressions like
19174 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19175 from race conditions in accessing the global variables
19176 case_temp1 and case_temp2.
19177 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19178 * lisp.h (case_temp1, case_temp2): Remove their decls.
19179 * character.h (ASCII_CHAR_P): Move from here ...
19180 * lisp.h: ... to here, so that the inline functions mentioned
19181 above can use them.
19182
19183 * dired.c (directory_files_internal_unwind): Now static.
19184
19185 * fileio.c (file_name_as_directory, directory_file_name):
19186 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19187 Now static.
19188 (file_name_as_directory): Use const pointers when appropriate.
19189 (Fexpand_file_name): Likewise. In particular, newdir might
19190 point at constant storage, so make it a const pointer.
19191 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19192 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19193 signedness issues.
19194 (Fset_file_times, Finsert_file_contents, auto_save_error):
19195 Rename locals to avoid shadowing.
19196
19197 * minibuf.c (choose_minibuf_frame_1): Now static.
19198 (Ftry_completion, Fall_completions): Rename or remove locals
19199 to avoid shadowing.
19200
19201 * marker.c (bytepos_to_charpos): Remove; unused.
19202
19203 * lisp.h (verify_bytepos, count_markers): New decls,
19204 so that gcc does not warn that these functions aren't declared.
19205
19206 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19207 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19208 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19209 (copy_text): Remove unused local var.
19210
19211 * filelock.c (within_one_second): Now static.
19212 (lock_file_1): Rename local to avoid shadowing.
19213
19214 * buffer.c (fix_overlays_before): Mark locals as initialized.
19215 (fix_start_end_in_overlays): Likewise. This function should be
19216 simplified by using pointers-to-pointers, but that's a different
19217 matter.
19218 (switch_to_buffer_1): Now static.
19219 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19220 (report_overlay_modification): Rename locals to avoid shadowing.
19221
19222 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19223 Fix pointer signedness issue.
19224 (sys_subshell): Mark local as volatile if checking for lint,
19225 to suppress a gcc -Wclobbered warning that does not seem to be right.
19226 (MAXPATHLEN): Define only if needed.
19227
19228 * process.c (serial_open, serial_configure): Move decls from here ...
19229 * systty.h: ... to here, so that they can be checked.
19230
19231 * fns.c (get_random, seed_random): Move extern decls from here ...
19232 * lisp.h: ... to here, so that they can be checked.
19233
19234 * sysdep.c (reset_io): Now static.
19235 (wait_for_termination_signal): Remove; unused.
19236
19237 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19238 (copy_keymap_item, append_key, push_text_char_description):
19239 Now static.
19240 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19241 (DENSE_TABLE_SIZE): Remove; unused.
19242 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19243 (describe_map_tree):
19244 Rename locals to avoid shadowing.
19245
19246 * keyboard.c: Declare functions static if they are not used elsewhere.
19247 (echo_char, echo_dash, cmd_error, top_level_2):
19248 (poll_for_input, handle_async_input): Now static.
19249 (read_char, kbd_buffer_get_event, make_lispy_position):
19250 (make_lispy_event, make_lispy_movement, apply_modifiers):
19251 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19252 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19253 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19254 (read_key_sequence, read_char): Mark locals as initialized.
19255 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19256
19257 * keyboard.h (make_ctrl_char): New decl.
19258 (mark_kboards): Move decl here ...
19259 * alloc.c (mark_kboards): ... from here.
19260
19261 * lisp.h (force_auto_save_soon): New decl.
19262
19263 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19264 (DEFINE_DUMMY_FUNCTION): New macro.
19265 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19266 Use it.
19267 (main): Add casts to avoid warnings
19268 if GCC considers string literals to be constants.
19269
19270 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19271
19272 * dbusbind.c: Pointer signedness fixes.
19273 (xd_signature, xd_append_arg, xd_initialize):
19274 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19275 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19276 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19277 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19278
19279 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19280 if GCC considers string literals to be constants.
19281 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19282
19283 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19284
19285 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19286 (print_preprocess, print_object): New macro to fix last change.
19287
19288 * print.c (print_preprocess): Don't forget font objects.
19289
19290 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19291
19292 * emacs.c (USAGE3): Doc fixes.
19293
19294 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19295
19296 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19297 structure.
19298
19299 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19300
19301 * lisp.h (VWindow_system, Qfile_name_history):
19302 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19303 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19304 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19305
19306 * w32select.c: Don't #include "keyboard.h".
19307 (run_protected): Add extern declaration for waiting_for_input.
19308
19309 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19310 * w32console.c (detect_input_pending, read_input_pending)
19311 (encode_terminal_code):
19312 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19313 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19314 (w32_system_caret_y, Qfile_name_history):
19315 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19316 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19317 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19318 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19319 * w32proc.c (Qlocal, report_file_error):
19320 * w32term.c (Vwindow_system, updating_frame):
19321 * w32uniscribe.c (initialized, uniscribe_font_driver):
19322 Remove unneeded extern declarations.
19323
19324 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19325
19326 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19327
19328 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19329
19330 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19331 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19332 These macros can no longer be used for assignment.
19333
19334 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19335 Assign struct members directly, instead of using BUF_BEGV etc.
19336 (record_buffer_markers, fetch_buffer_markers): New functions for
19337 recording and fetching special buffer markers.
19338 (set_buffer_internal_1, set_buffer_temp): Use them.
19339
19340 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19341
19342 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19343
19344 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19345 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19346
19347 * xdisp.c (hscroll_window_tree):
19348 (reconsider_clip_changes): Use PT instead of BUF_PT.
19349
19350 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19351
19352 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19353 $(EMACS_ROOT)/lib/intprops.h.
19354
19355 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19356
19357 Fix more problems found by GCC 4.5.2's static checks.
19358
19359 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19360 to unsigned char * to avoid compiler diagnostic.
19361 (xg_free_frame_widgets): Make it clear that a local variable is
19362 needed only if USE_GTK_TOOLTIP.
19363 (gdk_window_get_screen): Make it clear that this macro is needed
19364 only if USE_GTK_TOOLTIP.
19365 (int_gtk_range_get_value): New function, which avoids a diagnostic
19366 from gcc -Wbad-function-cast.
19367 (xg_set_toolkit_scroll_bar_thumb): Use it.
19368 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19369 diagnostic from gcc -Wbad-function-cast.
19370 (get_utf8_string, xg_get_file_with_chooser):
19371 Rename locals to avoid shadowing.
19372 (create_dialog): Move locals to avoid shadowing.
19373
19374 * xgselect.c (xg_select): Remove unused var.
19375
19376 * image.c (four_corners_best): Mark locals as initialized.
19377 (gif_load): Initialize transparent_p to zero (Bug#8238).
19378 Mark another local as initialized.
19379 (my_png_error, my_error_exit): Mark with NO_RETURN.
19380
19381 * image.c (clear_image_cache): Now static.
19382 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19383 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19384 (x_edge_detection): Remove unnecessary cast that
19385 gcc -Wbad-function-cast diagnoses.
19386 (gif_load): Fix pointer signedness.
19387 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19388 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19389
19390 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19391
19392 Improve quality of tests for time stamp overflow.
19393 For example, without this patch (encode-time 0 0 0 1 1
19394 1152921504606846976) returns the obviously-bogus value (-948597
19395 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19396 reports time overflow. See
19397 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19398 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19399 * editfns.c: Include limits.h and intprops.h.
19400 (TIME_T_MIN, TIME_T_MAX): New macros.
19401 (time_overflow): Move earlier, to before first use.
19402 (hi_time, lo_time): New functions, for an accurate test for
19403 out-of-range times.
19404 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19405 (Fget_internal_run_time): Don't assume time_t fits in int.
19406 (make_time): Use list2 instead of Fcons twice.
19407 (Fdecode_time): More accurate test for out-of-range times.
19408 (check_tm_member): New function.
19409 (Fencode_time): Use it, to test for out-of-range times.
19410 (lisp_time_argument): Don't rely on undefined left-shift and
19411 right-shift behavior when checking for time stamp overflow.
19412
19413 * editfns.c (time_overflow): New function, refactoring common code.
19414 (Fformat_time_string, Fdecode_time, Fencode_time):
19415 (Fcurrent_time_string): Use it.
19416
19417 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19418 * dired.c (make_time): Move to ...
19419 * editfns.c (make_time): ... here.
19420 * systime.h: Note the move.
19421
19422 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19423
19424 * fringe.c (update_window_fringes): Remove unused variables.
19425
19426 * unexmacosx.c (copy_data_segment): Also copy __got section.
19427 (Bug#8223)
19428
19429 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19430
19431 * termcap.c [MSDOS]: Include "msdos.h".
19432 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19433 Constify `char *' arguments and their references according to
19434 prototypes in tparam.h.
19435
19436 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19437
19438 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19439 Adapt all references accordingly.
19440
19441 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19442
19443 2011-03-11 Tom Tromey <tromey@redhat.com>
19444
19445 * buffer.c (syms_of_buffer): Remove obsolete comment.
19446
19447 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19448
19449 * termhooks.h (encode_terminal_code): Declare prototype.
19450
19451 * msdos.c (encode_terminal_code): Don't declare prototype.
19452
19453 * term.c (encode_terminal_code): Now external again, used by
19454 w32console.c and msdos.c.
19455
19456 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19457 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19458
19459 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19460
19461 Fix some minor problems found by GCC 4.5.2's static checks.
19462
19463 * fringe.c (update_window_fringes): Mark locals as initialized
19464 (Bug#8227).
19465 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19466
19467 * alloc.c (mark_fringe_data): Move decl from here ...
19468 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19469 to check its interface.
19470 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19471
19472 * fontset.c (free_realized_fontset): Now static.
19473 (Fset_fontset_font): Rename local to avoid shadowing.
19474 (fontset_font): Mark local as initialized.
19475 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19476
19477 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19478
19479 * xselect.c (x_disown_buffer_selections): Remove; not used.
19480 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19481 (x_own_selection, Fx_disown_selection_internal): Rename locals
19482 to avoid shadowing.
19483 (x_handle_dnd_message): Remove local to avoid shadowing.
19484
19485 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19486 so that the caller can use some name other than gcpro1.
19487 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19488 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19489 (Fx_backspace_delete_keys_p):
19490 Use them to avoid shadowing, and rename vars to avoid shadowing.
19491 (x_decode_color, x_set_name, x_window): Now static.
19492 (Fx_create_frame): Add braces to silence GCC warning.
19493 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19494 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19495 Remove unused locals.
19496 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19497 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19498 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19499 macros.
19500
19501 * xterm.h (x_mouse_leave): New decl.
19502
19503 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19504 Remove unused functions.
19505 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19506 (x_calc_absolute_position): Now static.
19507 (XTread_socket): Don't define label "out" unless it's used.
19508 Don't declare local "event" unless it's used.
19509 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19510 unless they are used.
19511 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19512 (x_fatal_error_signal): Remove; not used.
19513 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19514 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19515 (x_error_catcher, x_connection_closed, x_error_handler):
19516 (x_error_quitter, xembed_send_message, x_iconify_frame):
19517 (my_log_handler): Rename locals to avoid shadowing.
19518 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19519 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19520
19521 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19522 Rename or move locals to avoid shadowing.
19523 (tty_defined_color, merge_face_heights): Now static.
19524 (free_realized_faces_for_fontset): Remove; not used.
19525 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19526 does not deduce is never used uninitialized.
19527 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19528 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19529
19530 * terminal.c (store_terminal_param): Now static.
19531
19532 * xmenu.c (menu_highlight_callback): Now static.
19533 (set_frame_menubar): Remove unused local.
19534 (xmenu_show): Rename parameter to avoid shadowing.
19535 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19536 since they might point to immutable storage.
19537 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19538 since it's unused otherwise.
19539
19540 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19541 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19542 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19543 avoids a gcc -Wuninitialized diagnostic.
19544 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19545 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19546 does not deduce are never used uninitialized.
19547
19548 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19549
19550 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19551 * window.c (window_loop, size_window):
19552 (run_window_configuration_change_hook, enlarge_window): Likewise.
19553
19554 * window.c (display_buffer): Now static.
19555 (size_window): Mark variables that gcc -Wuninitialized
19556 does not deduce are never used uninitialized.
19557 * window.h (check_all_windows): New decl, to forestall
19558 gcc -Wmissing-prototypes diagnostic.
19559 * dispextern.h (bidi_dump_cached_states): Likewise.
19560
19561 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19562 shadowing.
19563 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19564 Include <limits.h>.
19565 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19566 and to avoid gcc -Wuninitialized warning.
19567 (load_charset_map): Mark variables that gcc -Wuninitialized
19568 does not deduce are never used uninitialized.
19569 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19570
19571 * coding.c (coding_set_source, coding_set_destination):
19572 Use "else { /* comment */ }" rather than "else /* comment */;"
19573 for clarity, and to avoid gcc -Wempty-body warning.
19574 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19575 a block, when the outer 'i' will do.
19576 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19577 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19578 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19579 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19580 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19581 Rename locals to avoid shadowing.
19582 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19583 * coding.c (emacs_mule_char, encode_invocation_designation):
19584 Now static, since they're not used elsewhere.
19585 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19586 (decode_coding_object, encode_coding_object, detect_coding_system):
19587 (decode_coding_emacs_mule): Mark variables that gcc
19588 -Wuninitialized does not deduce are never used uninitialized.
19589 (detect_coding_iso_2022): Initialize a local variable that might
19590 be used uninitialized. Leave a FIXME because it's not clear that
19591 this initialization is needed. (Bug#8211)
19592 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19593 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19594 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19595 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19596 Remove unused macros.
19597
19598 * category.c (hash_get_category_set): Remove unused local var.
19599 (copy_category_table): Now static, since it's not used elsewhere.
19600 * character.c (string_count_byte8): Likewise.
19601
19602 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19603 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19604
19605 * chartab.c (copy_sub_char_table): Now static, since it's not used
19606 elsewhere.
19607 (sub_char_table_ref_and_range, char_table_ref_and_range):
19608 Rename locals to avoid shadowing.
19609 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19610
19611 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19612 (BIDI_BOB): Remove unused macro.
19613
19614 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19615 deduce are never used uninitialized.
19616 * term.c (encode_terminal_code): Likewise.
19617
19618 * term.c (encode_terminal_code): Now static. Remove unused local.
19619
19620 * tparam.h: New file.
19621 * term.c, tparam.h: Include it.
19622 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19623 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19624 Move these decls to tparam.h, and make them agree with what
19625 is actually in tparam.c. The previous trick of using incompatible
19626 decls in different modules does not conform to the C standard.
19627 All callers of tparam changed to use tparam's actual API.
19628 * tparam.c (tparam1, tparam, tgoto):
19629 Use const pointers where appropriate.
19630
19631 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19632 * cm.h (struct cm): Likewise.
19633 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19634 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19635 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19636 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19637 (turn_on_face, init_tty): Likewise.
19638 * termchar.h (struct tty_display_info): Likewise.
19639
19640 * term.c (term_mouse_position): Rename local to avoid shadowing.
19641
19642 * alloc.c (mark_ttys): Move decl from here ...
19643 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19644
19645 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19646
19647 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19648
19649 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19650
19651 * search.c (compile_pattern_1): Remove argument regp, unused since
19652 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19653 (compile_pattern): Don't pass it.
19654
19655 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19656
19657 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19658 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19659 for ! HAVE_GTK3.
19660 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19661
19662 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19663
19664 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19665 gdk_window_get_screen, gdk_window_get_geometry,
19666 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19667 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19668 (xg_get_pixbuf_from_pixmap): New function.
19669 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19670 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19671 Call xg_get_pixbuf_from_pixmap instead of
19672 gdk_pixbuf_get_from_drawable.
19673 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19674 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19675 (xg_check_special_colors): Use GtkStyleContext and its functions
19676 for HAVE_GTK3.
19677 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19678 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19679 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19680 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19681 Call gtk_widget_get_preferred_size.
19682 (xg_frame_resized): gdk_window_get_geometry only takes 5
19683 parameters.
19684 (xg_win_to_widget, xg_event_is_for_menubar):
19685 Call gdk_x11_window_lookup_for_display.
19686 (xg_set_widget_bg): New function.
19687 (delete_cb): New function.
19688 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19689 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19690 (xg_set_background_color): Call xg_set_widget_bg.
19691 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19692 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19693 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19694 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19695 if ! HAVE_GTK3.
19696 (update_frame_tool_bar): Call gtk_widget_hide.
19697 (xg_initialize): Use GDK_KEY_g.
19698
19699 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19700 if ! HAVE_GTK3
19701 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19702
19703 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19704 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19705 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19706
19707 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19708
19709 * w32xfns.c (select_palette): Check success of RealizePalette against
19710 GDI_ERROR, not zero.
19711
19712 See ChangeLog.11 for earlier changes.
19713
19714 ;; Local Variables:
19715 ;; coding: utf-8
19716 ;; End:
19717
19718 Copyright (C) 2011-2013 Free Software Foundation, Inc.
19719
19720 This file is part of GNU Emacs.
19721
19722 GNU Emacs is free software: you can redistribute it and/or modify
19723 it under the terms of the GNU General Public License as published by
19724 the Free Software Foundation, either version 3 of the License, or
19725 (at your option) any later version.
19726
19727 GNU Emacs is distributed in the hope that it will be useful,
19728 but WITHOUT ANY WARRANTY; without even the implied warranty of
19729 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19730 GNU General Public License for more details.
19731
19732 You should have received a copy of the GNU General Public License
19733 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.