* xdisp.c (Qinhibit_debug_on_message): Now static.
[bpt/emacs.git] / src / ChangeLog
1 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2
3 * xdisp.c (Qinhibit_debug_on_message): Now static.
4
5 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6
7 * nsterm.m (ns_update_begin): Set clip path to whole view by using
8 NSBezierPath (Bug#12131).
9
10 2012-09-10 Chong Yidong <cyd@gnu.org>
11
12 * fns.c (Fdelq, Fdelete): Doc fix.
13
14 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
15
16 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
17 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
18
19 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
20
21 * lisp.h (make_lisp_ptr): New macro to replace XSET.
22 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
23 Use it.
24
25 2012-09-09 Eli Zaretskii <eliz@gnu.org>
26
27 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
28 left fringe if the window has a left margin. This avoids leaving
29 traces of the cursor because its leftmost pixel is not drawn over.
30
31 * dispnew.c (update_window_line): When the left margin area of a
32 screen line is updated, set the redraw_fringe_bitmaps_p flag of
33 that screen line. (Bug#12277)
34
35 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
36
37 Assume C89 or later for math functions (Bug#12381).
38 This simplifies the code, and makes it a bit smaller and faster,
39 and (most important) makes it easier to clean up signal handling
40 since we can stop worring about floating-point exceptions in
41 library code. That was a problem before C89, but the problem
42 went away many years ago on all practical Emacs targets.
43 * data.c, image.c, lread.c, print.c:
44 Don't include <math.h>; no longer needed.
45 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
46 might be autoconfigured, as that never happens.
47 * data.c (fmod):
48 * doprnt.c (DBL_MAX_10_EXP):
49 * print.c (DBL_DIG):
50 Remove. C89 or later always defines these.
51 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
52 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
53 (arith_error, domain_error, domain_error2):
54 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
55 no longer needed -- we simply return what C returns. All uses removed.
56 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
57 the wrapped code.
58 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
59 Remove. All uses expanded, as these macros are no longer used
60 more than once and are now more trouble than they're worth.
61 (Ftan): Use tan, not sin / cos.
62 (Flogb): Assume C89 frexp.
63 (fmod_float): Assume C89 fmod.
64 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
65 (init_floatfns): Remove. All uses removed.
66
67 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
68
69 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
70 compositeToPoint for OSX < 10.6 (Bug#12390).
71
72 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
73
74 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
75 This produces more-accurate results.
76
77 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
78
79 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
80 changes (Bug#12088).
81
82 2012-09-08 Chong Yidong <cyd@gnu.org>
83
84 * syntax.c (Fstring_to_syntax): Doc fix.
85
86 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
87
88 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
89 in the internal border.
90 (x_set_window_size): Remove static variables and their usage.
91 (ns_redraw_scroll_bars): Fix NSTRACE arg.
92 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
93 fringe/internal border adjustment (Bug#11052).
94 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
95 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
96 (ns_fix_rect_ibw): Remove.
97 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
98 (ns_dumpglyphs_box_or_relief): Ditto.
99 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
100 adjustment.
101 (ns_dumpglyphs_image): Ditto.
102 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
103 border adjustment.
104 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
105 their usage. Add fringe_extended_p and its use as in other terms.
106 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
107 scroll bar was removed.
108 (updateFrameSize): New function.
109 (windowDidResize): Move code to updateFrameSize and call it.
110
111 * nsterm.h (EmacsView): Add updateFrameSize.
112
113 2012-09-07 Chong Yidong <cyd@gnu.org>
114
115 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
116
117 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
118
119 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
120
121 More signal-handler cleanup (Bug#12327).
122 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
123 Problem introduced when merging patches. Noted by Eli Zaretskii in
124 <http://bugs.gnu.org/12327#67>.
125 * floatfns.c: Comment fix.
126 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
127 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
128 and anyway the declaration is harmless even if SIGDANGER is not defined.
129 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
130 defined BROKEN_FIONREAD). systty.h formerly did this, but other
131 source files not surprisingly expected syssignal.h to define, or
132 not define, SIGIO, and it's cleaner to do it that way, for consistency.
133 Include <sys/ioctl.h>, for FIONREAD.
134 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
135 This eliminates a problem whereby other files mysteriously had
136 to include "syssignal.h" before including "systty.h" if they
137 wanted to use "#ifdef SIGIO".
138
139 2012-09-07 Eli Zaretskii <eliz@gnu.org>
140
141 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
142
143 * w32.c (sigemptyset): Empty the set.
144 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
145
146 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
147
148 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
149
150 * alloc.c (mark_buffer): Revert unsafe marking optimization.
151 (mark_object): Likewise for frame objects.
152
153 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
154
155 * syssignal.h (handle_on_main_thread): Always declare,
156 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
157 This ports to platforms without HAVE_PTHREAD.
158
159 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
160
161 Signal-handler cleanup (Bug#12327).
162 Emacs's signal handlers were written in the old 4.2BSD style with
163 sigblock and sigmask and so forth, and this led to some
164 inefficiencies and confusion. Rewrite these to use
165 pthread_sigmask etc. without copying signal sets around. Also,
166 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
167 'signal', and instead use functions that do not attempt to take
168 over the system name space. This patch causes Emacs's text
169 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
170 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
171 Do not include <signal.h> or "syssignal.h", as these
172 modules do not use signals.
173 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
174 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
175 Do not include <signal.h>, as "syssignal.h" does that for us now.
176 * atimer.c (sigmask_atimers): New function.
177 (block_atimers, unblock_atimers): New functions,
178 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
179 All uses replaced.
180 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
181 no longer needed here.
182 * emacs.c (main): Inspect existing signal handler with sigaction,
183 so that there's no need to block and unblock SIGHUP.
184 * sysdep.c (struct save_signal): New member 'action', replacing
185 old member 'handler'.
186 (save_signal_handlers, restore_signal_handlers):
187 Use sigaction instead of 'signal' to save and restore.
188 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
189 New function. All users of 'signal' modified to use set_sighandler
190 if they're writeonly, and to use sys_signal if they're read+write.
191 (emacs_sigaction_init, forwarded_signal): New functions.
192 (sys_signal): Remove. All uses replaced by calls to sigaction
193 and emacs_sigaction_init, or by direct calls to 'signal'.
194 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
195 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
196 all uses replaced by pthread_sigmask etc. calls.
197 * syssignal.h: Include <signal.h>.
198 (emacs_sigaction_init, forwarded_signal): New decls.
199 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
200 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
201 (sigmask, sys_sigmask): Remove; no longer needed.
202 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
203 (sigblock, sigunblock, sigfree):
204 (sigsetmask) [!defined sigsetmask]:
205 Remove. All uses replaced by pthread_sigmask.
206 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
207 no longer need to be replaced, and its typical old uses
208 are now done via emacs_sigaction_init and sigaction.
209 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
210 (sys_sigdel): Remove; unused.
211 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
212
213 2012-09-06 Eli Zaretskii <eliz@gnu.org>
214
215 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
216 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
217
218 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
219
220 Explicitly mark buffer_defaults and buffer_local_symbols.
221 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
222 mark_local_symbols here.
223 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
224 since special buffers aren't marked here any more.
225 (allocate_buffer): Chain new buffer with all_buffers here...
226 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
227 not here.
228 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
229 (syms_of_buffer): Remove staticpro of the above.
230 (init_buffer_once): Set names for buffer_defaults and
231 buffer_local_symbols.
232
233 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
234
235 Use bool for booleans in font-related modules.
236 * font.c (font_intern_prop, font_style_to_value)
237 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
238 (generate_otf_features, font_check_otf_features, font_check_otf)
239 (font_match_p, font_list_entities, font_at):
240 * fontset.c (fontset_id_valid_p, reorder_font_vector
241 (fontset_find_font, Fset_fontset_font)
242 (face_suitable_for_char_p) [0]:
243 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
244 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
245 (m17n_flt_initialized, ftfont_shape_by_flt):
246 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
247 * nsfont.m (nsfont_draw):
248 * w32font.c (w32font_draw):
249 * w32term.c (x_draw_glyphless_glyph_string_foreground):
250 Use bool for booleans.
251 * font.h: Adjust to above API changes.
252 (struct font, struct font_driver, struct font_driver_list):
253 Use bool for booleans.
254 (struct font): Remove useless member encoding_type.
255 All users removed.
256 * fontset.c, xftfont.c: Omit unnecessary static decls.
257
258 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
259
260 * alloc.c (mark_object): Revert window marking code
261 since it's unsafe for the Fset_window_configuration.
262
263 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
264
265 Fix race conditions with signal handlers and errno (Bug#12327).
266 Be more systematic about preserving errno whenever a signal
267 handler returns, even if it's not in the main thread. Do this by
268 renaming signal handlers to distinguish between signal delivery
269 and signal handling. All uses changed.
270 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
271 * data.c (deliver_arith_signal): Rename from arith_error.
272 * dispnew.c (deliver_window_change_signal): Rename from
273 window_change_signal.
274 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
275 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
276 * keyboard.c (deliver_input_available_signal): Rename from
277 input_available_signal.
278 (deliver_user_signal): Rename from handle_user_signal.
279 (deliver_interrupt_signal): Rename from interrupt_signal.
280 * process.c (deliver_pipe_signal): Rename from send_process_trap.
281 (deliver_child_signal): Rename from sigchld_handler.
282 * atimer.c (handle_alarm_signal):
283 * data.c (handle_arith_signal):
284 * dispnew.c (handle_window_change_signal):
285 * emacs.c (handle_fatal_signal, handle_danger_signal):
286 * keyboard.c (handle_input_available_signal):
287 * keyboard.c (handle_user_signal, handle_interrupt_signal):
288 * process.c (handle_pipe_signal, handle_child_signal):
289 New functions, with the actual signal-handling code taken from the
290 original respective signal handlers, sans the sporadic attempts to
291 preserve errno, since that's now done by handle_on_main_thread.
292 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
293 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
294 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
295 Move to sysdep.c.
296 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
297 Move initialization of main_thread to sysdep.c's init_signals.
298 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
299 our usage, and simplifies the mainline code.
300 (record_child_status_change): New static function, as a helper
301 for handle_child_signal, and with most of the old child handler's
302 contents.
303 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
304 (handle_child_signal): Use the above.
305 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
306 Moved here from emacs.c.
307 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
308 code moved here from emacs.c's main function.
309 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
310 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
311 lets callers save and restore errno properly.
312
313 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
314
315 Remove redundant or unused things here and there.
316 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
317 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
318 * editfns.c (Fcompare_buffer_substrings): Likewise.
319 * frame.h (struct terminal, struct font_driver_list):
320 Remove redundant declarations.
321 * window.h (Qleft, Qright): Likewise.
322
323 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
324
325 Do not mark objects from deleted buffers, windows and frames.
326 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
327 (mark_object): Likewise for windows and frames.
328
329 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
330
331 * alloc.c (valid_lisp_object_p): Treat killed buffers,
332 buffer_defaults and buffer_local_symbols as valid objects.
333 Return special value to denote them.
334
335 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
336
337 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
338 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
339 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
340 (file_name_absolute_p, Fsubstitute_in_file_name):
341 (check_executable, check_writable, Ffile_accessible_directory_p)
342 (Fset_file_selinux_context, Fdefault_file_modes)
343 (Finsert_file_contents, choose_write_coding_system)
344 (Fwrite_region, build_annotations, a_write, e_write)
345 (Fdo_auto_save):
346 * filelock.c (boot_time_initialized, get_boot_time)
347 (get_boot_time_1, lock_file_1, within_one_second):
348 * floatfns.c (in_float):
349 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
350 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
351 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
352 * lisp.h (struct Lisp_Hash_Table.cmpfn):
353 * window.c (compare_window_configurations):
354 Use bool for booleans.
355 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
356 (Fdefault_file_modes): Now mode_t, not int, for modes.
357 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
358 (internal_delete_file): Now returns void, not a (boolean) int,
359 since nobody was looking at the return value.
360 * lisp.h, window.h: Adjust to above API changes.
361
362 * xdisp.c (set_message): Simplify and reindent last change.
363
364 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
365
366 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
367
368 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
369
370 * eval.c (call_debugger): Make the function non-static so that we
371 can call it from set_message.
372
373 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
374 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
375
376 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
377
378 Give more-useful info on a fatal error (Bug#12328).
379 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
380 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
381 of doing the work ourselves.
382 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
383 do most of the work.
384 (fatal_error_backtrace): New function, taken from the guts
385 of the old fatal_error_signal, but with a new option to output
386 a backtrace.
387 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
388 info about the signal than just its number.
389 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
390 * sysdep.c: Include <execinfo.h>
391 (emacs_backtrace): New function, taken partly from the previous
392 code of the 'die' function.
393 (emacs_abort): Call fatal_error_backtrace rather than abort.
394
395 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
396
397 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
398 eager (load-time) macro-expansion.
399 * lisp.mk (lisp): Add macroexp.
400
401 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
402
403 Simplify redefinition of 'abort' (Bug#12316).
404 Do not try to redefine the 'abort' function. Instead, redo
405 the code so that it calls 'emacs_abort' rather than 'abort'.
406 This removes the need for the NO_ABORT configure-time macro
407 and makes it easier to change the abort code to do a backtrace.
408 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
409 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
410 Remove; sysdep.c's emacs_abort now takes its place.
411 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
412 'abort' changed to use 'emacs_abort'.
413 * msdos.c (dos_abort) [defined abort]: Remove; not used.
414 (abort) [!defined abort]: Rename to ...
415 (emacs_abort): ... new name.
416 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
417 the place of the old 'abort' in emacs.c.
418 * w32.c, w32fns.c (abort): Do not #undef.
419 * w32.c (emacs_abort): Rename from w32_abort.
420
421 2012-09-04 Eli Zaretskii <eliz@gnu.org>
422
423 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
424 offsets[j].dv, since the y axis of the screen coordinates points
425 down, while the y axis of the font definition coordinates points
426 up. This fixes display of Arabic diacritics such as KASRA and
427 KASRATAN. (Bug#11860)
428
429 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
430
431 Be more systematic about _setjmp vs setjmp.
432 * alloc.c (test_setjmp, mark_stack):
433 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
434 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
435 (png_load, my_error_exit, jpeg_load):
436 * process.c (send_process_trap, send_process):
437 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
438 The underscored versions are up to 30x faster on some hosts.
439 Formerly, the code used setjmp+longjmp sometimes and
440 _setjmp+_longjmp at other times, with no particular reason to
441 prefer setjmp+longjmp.
442
443 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
444
445 Fix minor problem found by static checking.
446 * buffer.c (Fdelete_all_overlays): Return nil.
447
448 2012-09-03 Martin Rudalics <rudalics@gmx.at>
449
450 * buffer.c (Fdelete_all_overlays): New function.
451
452 2012-09-03 Chong Yidong <cyd@gnu.org>
453
454 * gtkutil.c: Add extern decl for Qxft.
455
456 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
457
458 * emacs.c, eval.c: Use bool for boolean.
459 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
460 (malloc_using_checking) [DOUG_LEA_MALLOC]:
461 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
462 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
463 (main, decode_env_path, Fdaemon_initialized):
464 * eval.c (call_debugger, Finteractive_p, interactive_p):
465 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
466 (maybe_call_debugger, Fbacktrace):
467 * process.c (read_process_output, exec_sentinel):
468 Use bool for booleans.
469 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
470 All callers changed.
471 * eval.c (interactive_p): Omit always-true boolean argument
472 EXCLUDE_SUBRS_P. All callers changed.
473 * dispextern.h, lisp.h: Reflect above API changes.
474 * firstfile.c (dummy): Use the address of 'main', whose signature
475 won't change, instead of the address of 'initialize', whose
476 signature just changed from int to bool.
477 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
478 * msdos.c (fatal_error_in_progress): ... from here.
479 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
480 of incrementing it.
481 (redisplay_internal, unwind_redisplay): Simply clear
482 REDISPLAYING_P when unwinding, instead of saving its previous,
483 always-false value and then restoring it.
484
485 Clean up some extern decls.
486 Mostly, this hoists extern decls out of .c files and into .h files.
487 That way, we're more likely to catch errors if the interfaces change.
488 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
489 declare xg_mark_data.
490 * dispextern.h (x_frame_parm_handlers):
491 * font.h (Qxft):
492 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
493 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
494 (Qultra_bold, Qoblique, Qitalic):
495 Move extern decl here from .c file.
496 * alloc.c (xg_mark_data) [USE_GTK]:
497 * doc.c (Qclosure):
498 * eval.c (Qlexical_binding):
499 * fns.c (time) [!HAVE_UNISTD_H]:
500 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
501 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
502 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
503 * lread.c (Qinternal_interpreter_environment):
504 * minibuf.c (Qbuffer):
505 * process.c (QCfamily, QCfilter):
506 * widget.c (free_frame_faces):
507 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
508 * xfont.c (x_clear_errors):
509 * xterm.c (x_frame_parm_handlers):
510 Remove now-redundant extern decls.
511 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
512 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
513 Now static.
514 * xfaces.c: Remove unnecessary static decls.
515 * xterm.c (updating_frame): Remove decl of nonexistent object.
516
517 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
518 when building globals.h, as the objects that are not built on
519 this host are not needed to compile C files on this host.
520
521 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
522
523 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
524
525 * frame.h: Add missing prototype for x_wm_set_size_hint.
526
527 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
528
529 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
530 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
531 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
532 (Fsubstitute_command_keys):
533 * editfns.c (region_limit, find_field, Fconstrain_to_field)
534 (save_excursion_save, save_excursion_restore)
535 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
536 (format_time_string, general_insert_function)
537 (make_buffer_string, make_buffer_string_both)
538 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
539 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
540 (copy_text, insert_1, insert_1_both, insert_from_string)
541 (insert_from_string_before_markers, insert_from_string_1)
542 (insert_from_buffer, insert_from_buffer_1, replace_range)
543 (replace_range_2, del_range_1, del_range_byte, del_range_both)
544 (del_range_2, modify_region):
545 * intervals.c (intervals_equal, balance_possible_root_interval)
546 (adjust_intervals_for_insertion, merge_properties_sticky)
547 (graft_intervals_into_buffer, lookup_char_property)
548 (adjust_for_invis_intang, set_point_both)
549 (get_property_and_range, compare_string_intervals)
550 (set_intervals_multibyte_1, set_intervals_multibyte):
551 * keyboard.c (decode_timer):
552 Use bool for boolean.
553 * intervals.h, lisp.h, systime.h: Reflect above API changes.
554 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
555
556 2012-09-02 Chong Yidong <cyd@gnu.org>
557
558 * keymap.c (push_key_description): Print M-TAB as C-M-i
559 (Bug#11758).
560
561 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
562
563 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
564 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
565 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
566 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
567 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
568 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
569 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
570
571 2012-09-01 Eli Zaretskii <eliz@gnu.org>
572
573 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
574 more than one grapheme cluster passed to the shaper: compute the
575 offset adjustment values separately for each cluster. (Bug#11860)
576
577 * image.c: Restore mistakenly removed inclusion of w32.h. Without
578 it, GCC doesn't see prototypes of w32_delayed_load, and complains
579 about implicit conversions from integer to pointer.
580
581 2012-09-01 Daniel Colascione <dancol@dancol.org>
582
583 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
584 system used too early.
585
586 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
587
588 Better seed support for (random).
589 * emacs.c (main): Call init_random.
590 * fns.c (Frandom): Set the seed from a string argument, if given.
591 Remove long-obsolete Gentzel cruft.
592 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
593 (init_random): New function.
594
595 2012-09-01 Daniel Colascione <dancol@dancol.org>
596
597 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
598 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
599 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
600 x_wm_set_size_hint, x_query_colors, x_real_positions,
601 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
602 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
603 all of which have been moved to common code.
604
605 * xfaces.c: Include TERM_HEADER instead of listing all possible
606 window-system headers.
607
608 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
609 to match header.
610
611 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
612 directly accessing frame internals.
613
614 * w32font.h: Include font.h. Define syms_of_w32font and
615 globals_of_w32font.
616
617 * process.c: Include TERM_HEADER instead of listing all possible
618 window-system headers.
619
620 * nsterm.h: Remove declarations now in frame.h. Define
621 FRAME_X_SCREEN, FRAME_X_VISUAL.
622
623 * menu.c: Include TERM_HEADER instead of listing all possible
624 window-system headers.
625
626 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
627 window system.
628
629 * keyboard.c: Include TERM_HEADER instead of listing all possible
630 window-system headers.
631
632 * image.c: Include TERM_HEADER instead of listing all possible
633 window-system headers. Declare Vlibrary_cache when compiling for
634 Windows.
635
636 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
637 window system declarations.
638
639 * frame.h: Move common functions here: set_frame_menubar,
640 x_set_window_size, x_sync, x_get_focus_frame,
641 x_set_mouse_position, x_set_mouse_pixel_position,
642 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
643 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
644 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
645 x_activate_menubar, x_real_positions, x_bitmap_icon,
646 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
647 and x_query_colors.
648
649 * frame.c: Include TERM_HEADER instead of listing all possible
650 window-system headers.
651
652 * font.c: Include TERM_HEADER instead of listing all possible
653 window-system headers.
654
655 * emacs.c: Include TERM_HEADER.
656
657 * dispnew.c: Include TERM_HEADER instead of listing all possible
658 window-system headers.
659
660 * ccl.h: Include character.h.
661
662 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
663 the current window system; include in list of objects to link into
664 Emacs.
665
666 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
667
668 Remove mark_ttys function and fix tty_display_info initialization.
669 * lisp.h (mark_ttys): Remove prototype.
670 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
671 to mark_ttys because all possible values of 'top_frame' slot are
672 the frames which are reachable from Vframe_list.
673 * term.c (mark_ttys): Remove.
674 (init_tty): Safely initialize 'top_frame' slot with Qnil.
675
676 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
677
678 Change struct frame bitfields from unsigned char to unsigned.
679 * frame.h (struct frame): Change type of 'display_preempted',
680 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
681 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
682 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
683 bitfields from unsigned char to unsigned.
684
685 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
686
687 Remove unused member of struct x_output and struct w32_output.
688 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
689 * w32term.h (struct w32_output): Likewise.
690
691 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
692
693 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
694 does not become zero (Bug#12234).
695
696 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
697
698 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
699 for GCC 4.7.1 x86-64.
700
701 2012-08-30 Glenn Morris <rgm@gnu.org>
702
703 * lread.c (init_lread): For out-of-tree builds, only add the
704 source directory's site-lisp dir to the load-path if it exists,
705 consistent with in-tree builds. (Bug#12302)
706
707 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
708
709 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
710 button_values to NULL. Call setStykeMask so dialogs get a close button.
711 (windowShouldClose:): Set window_closed.
712 (dealloc): New member, free button_values.
713 (process_dialog:): Make member function. Remove window argument,
714 replace window with self. Count buttons and allocate and store values
715 in button_values.
716 (addButton:value:row:): value is int with the name tag. Call setTag
717 with tag. Remove return self, declare return value as void.
718 (addString:row:): Remove return self, declare return value as void.
719 (addSplit): Remove return self, declare return value as void.
720 (clicked:): Remove return self, declare return value as void.
721 Set dialog_return to button_values[seltag]. Code formatting change.
722 (initFromContents:isQuestion:): Adjust call to process_dialog.
723 Code formatting change.
724 (timeout_handler:): Set timer_fired to YES.
725 (runDialogAt:): Set timer_fired to NO.
726 Handle click on close button as quit.
727
728 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
729 Add window_closed and button_values. Add void as return value for
730 add(Button|String|Split). addButton takes int instead of Lisp_Object.
731 Add process_dialog as new member.
732
733 2012-08-28 Eli Zaretskii <eliz@gnu.org>
734
735 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
736 is not one of the heaps we manage. (Bug#12242)
737
738 2012-08-28 Glenn Morris <rgm@gnu.org>
739
740 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
741
742 2012-08-28 Martin Rudalics <rudalics@gmx.at>
743
744 * window.c (Fset_window_configuration): Remove handling of
745 auto-buffer-name window parameter. Install revision of reverted
746 fix.
747
748 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
749
750 Do not allow to set major mode for a dead buffer.
751 * buffer.c (Fset_buffer_major_mode): Signal an error
752 if the buffer is dead.
753 (Fother_buffer, other_buffer_safely): Remove redundant
754 nested declaration.
755
756 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
757
758 Always use set_buffer_if_live to restore original buffer at unwind.
759 * buffer.h (record_unwind_current_buffer): New function.
760 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
761 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
762 * undo.c, window.c: Adjust users.
763 * buffer.c (set_buffer_if_live): Fix comment.
764
765 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
766
767 Fix usage of set_buffer_internal.
768 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
769 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
770 * coding.c (decode_coding): Omit redundant test.
771 * fileio.c (decide_coding_unwind): Likewise.
772 * fns.c (secure_hash): Likewise.
773 * insdel.c (modify_region): Likewise.
774 * keyboard.c (command_loop_1): Likewise.
775 * print.c (PRINTFINISH): Likewise.
776 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
777
778 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
779
780 * dispnew.c: Use bool for boolean.
781 (frame_garbaged, display_completed, delayed_size_change)
782 (fonts_changed_p, add_window_display_history)
783 (add_frame_display_history, verify_row_hash)
784 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
785 (row_equal_p, realloc_glyph_pool)
786 (allocate_matrices_for_frame_redisplay)
787 (showing_window_margins_p)
788 (adjust_frame_glyphs_for_frame_redisplay)
789 (build_frame_matrix_from_leaf_window, make_current)
790 (mirrored_line_dance, mirror_line_dance, update_frame)
791 (update_window_tree, update_single_window)
792 (check_current_matrix_flags, update_window, update_text_area)
793 (update_window_line, set_window_update_flags, scrolling_window)
794 (update_frame_1, scrolling, buffer_posn_from_coords)
795 (do_pending_window_change, change_frame_size)
796 (change_frame_size_1, sit_for):
797 Use bool for boolean.
798 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
799 and remove last int (actually boolean) argument, which was always 0.
800 All callers changed.
801 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
802 * dispextern.h (struct composition_it): Use bool for boolean.
803 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
804 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
805 * dired.c (file_name_completion):
806 Use bool for boolean. (This was missed in an earlier change.)
807
808 2012-08-27 Martin Rudalics <rudalics@gmx.at>
809
810 * window.c (Fset_window_configuration): Revert first part of
811 last change.
812
813 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
814
815 * nsterm.h (NSPanel): New class variable dialog_return.
816
817 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
818 dialog_return.
819 (windowShouldClose:): Use stop instead of stopModalWithCode.
820 (clicked:): Ditto, and also set dialog_return (Bug#12258).
821 (timeout_handler:): Use stop instead of abortModal. Send a dummy
822 event.
823 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
824 modal loop returns.
825
826 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
827
828 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
829 * composite.c (find_composition, composition_gstring_p)
830 (composition_reseat_it, find_automatic_composition):
831 * data.c (let_shadows_buffer_binding_p)
832 (let_shadows_global_binding_p, set_internal, make_blv)
833 (Fmake_variable_buffer_local, Fmake_local_variable)
834 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
835 (cons_to_signed, arith_driver):
836 * dbusbind.c (xd_in_read_queued_messages):
837 * dired.c (directory_files_internal, file_name_completion):
838 Use bool for booleans.
839 * dired.c (file_name_completion):
840 * process.h (fd_callback):
841 Omit int (actually boolean) argument. It wasn't being used.
842 All uses changed.
843 * composite.h, lisp.h: Reflect above API changes.
844
845 * cmds.c, coding.c: Use bool for booleans.
846 * cmds.c (move_point, Fself_insert_command):
847 * coding.h (struct composition status, struct coding_system):
848 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
849 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
850 (emacs_mule_char, decode_coding_emacs_mule)
851 (encode_coding_emacs_mule, detect_coding_iso_2022)
852 (decode_coding_iso_2022, encode_invocation_designation)
853 (encode_designation_at_bol, encode_coding_iso_2022)
854 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
855 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
856 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
857 (encode_coding_raw_text, detect_coding_charset)
858 (decode_coding_charset, encode_coding_charset, detect_eol)
859 (detect_coding, get_translation_table, produce_chars)
860 (consume_chars, reused_workbuf_in_use)
861 (make_conversion_work_buffer, code_conversion_save)
862 (decode_coding_object, encode_coding_object)
863 (detect_coding_system, char_encodable_p)
864 (Funencodable_char_position, code_convert_region)
865 (code_convert_string, code_convert_string_norecord)
866 (Fset_coding_system_priority):
867 * fileio.c (Finsert_file_contents):
868 Use bool for booleans.
869 * coding.h, lisp.h: Reflect above API changes.
870 * coding.c: Remove unnecessary static function decls.
871 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
872 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
873 not a boolean 'int', since callers never look at the return value.
874 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
875 * coding.h (decoding_buffer_size, encoding_buffer_size)
876 (emacs_mule_string_char): Remove unused extern decls.
877 (struct iso_2022_spec, struct coding_system):
878 Use 'unsigned int : 1' for boolean fields, since there's more than one.
879 (struct emacs_mule_spec): Remove unused field 'full_support'.
880 All initializations removed.
881 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
882
883 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
884
885 Fix spare memory change (Bug#12286).
886 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
887 (valid_lisp_object_p): Likewise.
888
889 2012-08-27 Martin Rudalics <rudalics@gmx.at>
890
891 * window.c (Fset_window_configuration): Record any window's old
892 buffer if it's replaced (see Bug#8789). If the new current
893 buffer doesn't appear in the selected window, go to its old
894 point (Bug#12208).
895
896 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
897
898 Special MEM_TYPE_SPARE to denote reserved memory.
899 * alloc.c (enum mem_type): New memory type.
900 (refill_memory_reserve): Use new type for spare memory.
901 This prevents live_cons_p and live_string_p from incorrect
902 detection of uninitialized objects from spare memory as live.
903
904 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
905
906 Spelling fixes.
907 * Makefile.in (.PHONY): versioclean -> versionclean.
908
909 Remove unused external symbols.
910 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
911 * window.c (Qwindow_valid_p, decode_valid_window):
912 Now static, not extern.
913 * data.c (Qinterval): Remove; unused.
914 (syms_of_data): Do not define 'interval'.
915 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
916 * window.h (decode_valid_window):
917 Remove decls.
918
919 * character.c, charset.c, chartab.c: Use bool for booleans.
920 * character.c (lisp_string_width, string_count_byte8)
921 (string_escape_byte8):
922 * charset.c (charset_map_loaded, load_charset_map, read_hex):
923 (load_charset_map_from_file, map_charset_chars)
924 (Fdefine_charset_internal, define_charset_internal)
925 (Fdeclare_equiv_charset, find_charsets_in_text)
926 (Ffind_charset_region, char_charset, Fiso_charset):
927 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
928 (sub_char_table_set, sub_char_table_set_range)
929 (char_table_set_range, optimize_sub_char_table)
930 (map_sub_char_table):
931 Use bool for boolean.
932 * character.c (str_to_unibyte): Omit last boolean argument; it was
933 always 0. All callers changed.
934 * character.h, charset.h: Adjust to match previous changes.
935 * character.h (char_printable_p): Remove decl of nonexistent function.
936 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
937 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
938 are all boolean, so make them single-bit bitfields.
939
940 * lisp.h (ASET): Remove attempt to detect side effects.
941 It was meant to be temporary and it often doesn't work,
942 because when IDX has side effects the behavior of IDX==IDX
943 is undefined. See Stefan Monnier in
944 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
945
946 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
947
948 * lisp.h (functionp): New function (extracted from Ffunctionp).
949 (FUNCTIONP): Use it.
950 * eval.c (Ffunctionp): Use it.
951
952 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
953
954 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
955 as that's faster and simpler than static storage. Don't bother
956 with the g_main_context_query overhead if g_main_context_pending
957 says no events are pending.
958 (gfds, gfds_size): Remove these static vars.
959 (xgselect_initialize): Remove; no longer needed.
960 All uses and decls removed.
961
962 * emacs.c (fatal_error_signal_hook): Remove.
963 All uses removed. This leftover from old code was always 0.
964
965 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
966 * casefiddle.c (casify_object, casify_region):
967 * casetab.c (set_case_table):
968 * category.c, category.h (word_boundary_p):
969 * category.h (CHAR_HAS_CATEGORY):
970 Use bool for booleans, instead of int.
971
972 2012-08-25 Eli Zaretskii <eliz@gnu.org>
973
974 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
975
976 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
977
978 On assertion failure, print backtrace if available.
979 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
980 (die) [ENABLE_CHECKING]: Print a backtrace if available.
981 * Makefile.in (LIB_EXECINFO): New macro.
982 (LIBES): Use it.
983
984 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
985 * bytecode.c (exec_byte_code):
986 * callint.c (check_mark, Fcall_interactively):
987 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
988 (getenv_internal, sync_process_alive, call_process_exited):
989 * lisp.h (USE_SAFE_ALLOCA):
990 Use bool for booleans, instead of int.
991 * lisp.h, process.h: Adjust prototypes to match above changes.
992 * callint.c (Fcall_interactively): Don't assume the mark's
993 offset fits in 'int'.
994
995 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
996
997 * buffer.c, buffer.h: Use bool for boolean.
998 * buffer.c (reset_buffer_local_variables)
999 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1000 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1001 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1002 (overlay_touches_p, overlay_strings, Foverlay_put)
1003 (report_overlay_modification, call_overlay_mod_hooks):
1004 (mmap_enlarge, mmap_set_vars):
1005 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1006 Use bool for booleans, instead of int.
1007 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1008 since the 1-or-0 return value is always ignored anyway.
1009 (mmap_initialized_p):
1010 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1011 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1012
1013 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1014
1015 * bidi.c: Use bool for boolean.
1016 This is a bit more readable, and makes the text segment of bidi.o
1017 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1018 Presumably it's faster too.
1019 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1020 Now bool.
1021 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1022 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1023 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1024 (bidi_explicit_dir_char, bidi_level_of_next_char)
1025 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1026 Use bool for booleans, instead of int.
1027 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1028 (bidi_unshelve_cache): Adjust decls to match code.
1029
1030 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1031
1032 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1033 argument.
1034
1035 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1036
1037 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1038 * atimer.h: Include <stdbool.h>.
1039
1040 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1041
1042 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1043 compile time tests instead of run time tests on systems that do
1044 not use them.
1045 (FRAME_MAC_P): Remove leftover from deleted code.
1046 * frame.c (syms_of_frame): Remove leftover from deleted code.
1047
1048 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1049
1050 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1051
1052 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1053
1054 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1055 Otherwise, the compiler complains about (A?B:C) where B is void
1056 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1057 (fontset_add): Return void, for FONTSET_ADD.
1058
1059 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1060
1061 * alloc.c: Use bool for booleans.
1062 (gc_in_progress, abort_on_gc)
1063 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1064 (dont_register_blocks) [GC_MALLOC_CHECK]:
1065 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1066 (check_string_bytes, make_specified_string, memory_full)
1067 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1068 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1069 (mark_stack, valid_pointer_p, make_pure_string)
1070 (Fgarbage_collect, survives_gc_p, gc_sweep):
1071 Use bool for booleans, instead of int.
1072 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1073 Remove unused local.
1074 * alloc.c (PURE_POINTER_P):
1075 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1076 * editfns.c (Fformat):
1077 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1078 (Fdo_auto_save):
1079 * fns.c (sweep_weak_table):
1080 * lisp.h (suppress_checking, push_message, survives_gc_p)
1081 (make_pure_string, gc_in_progress, abort_on_gc):
1082 * lread.c (readchar, read1):
1083 * print.c (Fprin1_to_string):
1084 * xdisp.c (push_message):
1085 Use bool for booleans affected directly or indirectly by
1086 alloc.c's changes.
1087
1088 Make recently-introduced setters macros.
1089 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1090 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1091 (set_fontset_default, set_fontset_fallback): Rename from their
1092 upper-case counterparts, and make them functions rather than macros.
1093 This is more consistent with the other recently-introduced setters.
1094 These don't need to be inline, since they're local.
1095
1096 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1097
1098 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1099 the loop (Bug#12247).
1100
1101 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1102
1103 * lisp.h (vcopy): Use memcpy rather than our own loop.
1104 This fixes a performance regression introduced by the recent
1105 addition of vcopy. This means 'vcopy' will need to be modified
1106 for a copying collector, but that's OK. Also, tighten the
1107 checking in the assertion.
1108
1109 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1110
1111 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1112 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1113 non-base glyph for the width of the base character, according to
1114 what x_draw_composite_glyph_string_foreground expects.
1115 Generate WADJUST value according to composition_gstring_width's
1116 expectations, to produce correct width of the composed character.
1117 Reverse the sign of the DU offset produced by ScriptPlace.
1118
1119 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1120
1121 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1122
1123 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1124
1125 Avoid direct writes to contents member of struct Lisp_Vector.
1126 * lisp.h (vcopy): New function to copy data into vector.
1127 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1128 * fns.c (Ffillarray): Use ASET.
1129 * keyboard.c (timer_check_2): Use AREF and ASET.
1130 (append_tool_bar_item, Frecent_keys): Use vcopy.
1131 * lread.c (read_vector): Use ASET.
1132 * msdos.c (Frecent_doskeys): Use vcopy.
1133 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1134 (Finternal_merge_in_global_face): Use ASET and vcopy.
1135 * xfont.c (xfont_list_pattern): Likewise.
1136
1137 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1138
1139 * window.c (Fwindow_point): For the selected window always return
1140 the position of its buffer's point.
1141 (Fset_window_point): For the selected window always go in its
1142 buffer to the specified position.
1143
1144 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1145
1146 Setter macros for fontsets.
1147 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1148 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1149 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1150 Adjust users.
1151
1152 2012-08-20 Glenn Morris <rgm@gnu.org>
1153
1154 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1155 Don't assume that `ln -f' works.
1156
1157 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1158
1159 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1160 and later about non-assignments with no effect. See discussion at
1161 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1162 details.
1163
1164 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1165
1166 Inline setter functions for Lisp_Objects slots of struct specbinding.
1167 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1168 Adjust users.
1169
1170 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1171
1172 * window.c (select_window): Always make selected window's buffer
1173 current.
1174
1175 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1176
1177 Use AREF and ASET for docstrings of category tables.
1178 * category.h (CATEGORY_DOCSTRING): Use AREF.
1179 (SET_CATEGORY_DOCSTRING): Use ASET.
1180 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1181
1182 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1183
1184 Inline setter functions for hash table members.
1185 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1186 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1187 (set_hash_key_and_value, set_hash_index, set_hash_next)
1188 (set_hash_hash): New functions.
1189 * charset.c, fns.c: Adjust users.
1190
1191 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1192
1193 Inline getter and setter functions for per-buffer values.
1194 * buffer.h (per_buffer_default, set_per_buffer_default)
1195 (per_buffer_value, set_per_buffer_value): New functions.
1196 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1197 * buffer.c, data.c: Adjust users.
1198
1199 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1200
1201 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1202
1203 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1204
1205 Rely on <config.h> + <unistd.h> to declare 'environ',
1206 as gnulib does this if the system doesn't.
1207 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1208 Remove declaration. MS-Windows declares it on stdlib.h which is
1209 included by conf_post.h.
1210 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1211 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1212 * vm-limit.c: Include <unistd.h>, for 'environ'.
1213
1214 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1215 (start_of_data): Remove decl; mem-limits.h provides it.
1216
1217 * xdisp.c (handle_invisible_prop): Make it a bit faster
1218 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1219
1220 2012-08-19 Chong Yidong <cyd@gnu.org>
1221
1222 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1223 ends (Bug#3874).
1224
1225 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1226
1227 * .gdbinit: Use call instead of set when calling a function in the
1228 inferior.
1229
1230 * data.c (set_internal): Don't use set_blv_found.
1231 (Fkill_local_variable): Likewise.
1232
1233 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1234
1235 * nsfont.m (ns_ascii_average_width): Ensure the string
1236 ascii_printable is initialized with a null-terminated character
1237 array. Otherwise, it can contain undesired extra characters.
1238
1239 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1240
1241 port new setting code to Sun C 5.8 2005/10/13
1242 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1243 Return void, not Lisp_Object. Otherwise, the compiler
1244 complains about (A?B:C) where B is void and C is Lisp_Object
1245 when compiling CHAR_TABLE_SET, due to the recent change to
1246 the API of sub_char_table_set_contents.
1247
1248 2012-08-18 Chong Yidong <cyd@gnu.org>
1249
1250 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1251 for the string case (Bug#3874).
1252
1253 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1254
1255 * buffer.h (BSET): Remove (Bug#12215).
1256 Replace all uses with calls to new setter functions.
1257 (bset_bidi_paragraph_direction, bset_case_canon_table)
1258 (bset_case_eqv_table, bset_directory, bset_display_count)
1259 (bset_display_time, bset_downcase_table)
1260 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1261 (bset_last_selected_window, bset_local_var_alist)
1262 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1263 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1264 (bset_width_table):
1265 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1266 (bset_auto_fill_function, bset_auto_save_file_format)
1267 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1268 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1269 (bset_cache_long_line_scans, bset_case_fold_search)
1270 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1271 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1272 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1273 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1274 (bset_header_line_format, bset_indicate_buffer_boundaries)
1275 (bset_indicate_empty_lines, bset_invisibility_spec)
1276 (bset_left_fringe_width, bset_major_mode, bset_mark)
1277 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1278 (bset_name, bset_overwrite_mode, bset_pt_marker)
1279 (bset_right_fringe_width, bset_save_length)
1280 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1281 (bset_scroll_up_aggressively, bset_selective_display)
1282 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1283 (bset_word_wrap, bset_zv_marker):
1284 * category.c (bset_category_table):
1285 * syntax.c (bset_syntax_table):
1286 New setter functions.
1287
1288 * process.h (PSET): Remove (Bug#12215).
1289 Replace all uses with calls to new setter functions.
1290 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1291 (PROCESS_INLINE): New macro.
1292 (pset_childp): New setter function.
1293 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1294 * process.c (PROCESS_INLINE):
1295 Define to EXTERN_INLINE, so that the corresponding functions
1296 are compiled into code.
1297 (pset_buffer, pset_command, pset_decode_coding_system)
1298 (pset_decoding_buf, pset_encode_coding_system)
1299 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1300 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1301 (pset_type, pset_write_queue): New setter functions.
1302
1303 * window.h (WSET): Remove (Bug#12215).
1304 Replace all uses with calls to new setter functions.
1305 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1306 (WINDOW_INLINE): New macro.
1307 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1308 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1309 (wset_total_lines, wset_vertical_scroll_bar)
1310 (wset_window_end_pos, wset_window_end_valid)
1311 (wset_window_end_vpos): New setter functions.
1312 * window.c (WINDOW_INLINE):
1313 Define to EXTERN_INLINE, so that the corresponding functions
1314 are compiled into code.
1315 (wset_combination_limit, wset_dedicated, wset_display_table)
1316 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1317 (wset_new_normal, wset_new_total, wset_next_buffers)
1318 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1319 (wset_prev_buffers, wset_right_fringe_width)
1320 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1321 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1322 (wset_window_parameters):
1323 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1324 (wset_column_number_displayed, wset_region_showing):
1325 New setter functions.
1326
1327 * termhooks.h (TSET): Remove (Bug#12215).
1328 Replace all uses with calls to new setter functions.
1329 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1330 (TERMHOOKS_INLINE): New macro.
1331 (tset_charset_list, tset_selection_alist): New setter functions.
1332 * terminal.c (TERMHOOKS_INLINE):
1333 Define to EXTERN_INLINE, so that the corresponding functions
1334 are compiled into code.
1335 (tset_param_alist): New setter function.
1336
1337 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1338
1339 * keyboard.h (KSET): Remove (Bug#12215).
1340 Replace all uses with calls to new setter functions.
1341 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1342 (KEYBOARD_INLINE): New macro.
1343 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1344 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1345 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1346 New setter functions.
1347 * keyboard.c (KEYBOARD_INLINE):
1348 Define to EXTERN_INLINE, so that the corresponding functions
1349 are compiled into code.
1350 (kset_echo_string, kset_kbd_queue)
1351 (kset_keyboard_translate_table, kset_last_prefix_arg)
1352 (kset_last_repeatable_command, kset_local_function_key_map)
1353 (kset_overriding_terminal_local_map, kset_real_last_command)
1354 (kset_system_key_syms): New setter functions.
1355
1356 * frame.h (FSET): Remove (Bug#12215).
1357 Replace all uses with calls to new setter functions.
1358 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1359 (FRAME_INLINE): New macro.
1360 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1361 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1362 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1363 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1364 (fset_param_alist, fset_root_window, fset_scroll_bars)
1365 (fset_selected_window, fset_title, fset_tool_bar_items)
1366 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1367 * frame.c (FRAME_INLINE):
1368 Define to EXTERN_INLINE, so that the corresponding functions
1369 are compiled into code.
1370 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1371
1372 A few more naming-convention fixes for getters and setters.
1373 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1374 and rename from buffer_overlays_set_before.
1375 (set_buffer_overlays_after): Move here from buffer.h, and rename
1376 from buffer_overlays_set_after.
1377 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1378 All uses changed.
1379 (set_buffer_intervals): Rename from buffer_set_intervals.
1380 * intervals.c (set_interval_object): Move here from intervals.h,
1381 and rename from interval_set_object.
1382 (set_interval_left): Move here from intervals.h, and rename from
1383 interval_set_left.
1384 (set_interval_right): Move here from intervals.h, and rename from
1385 interval_set_right.
1386 (copy_interval_parent): Move here from intervals.h, and rename from
1387 interval_copy_parent.
1388 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1389 (set_interval_plist): Rename from interval_set_plist.
1390 Return void, not Lisp_Object, since no caller uses the result.
1391 * lisp.h (string_intervals): Rename from string_get_intervals.
1392 (set_string_intervals): Rename from string_set_intervals.
1393
1394 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1395 (set_char_table_contents): Rename from char_table_set_contents.
1396 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1397 All uses changed. See the end of
1398 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1399
1400 * lisp.h (CSET): Remove (Bug#12215).
1401 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1402 (set_char_table_purpose): New functions,
1403 replacing CSET. All uses changed. For example, replace
1404 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1405 "set_char_table_parent (char_table, parent);".
1406 The old version was confusing because it used the same name
1407 'parent' for two different things.
1408
1409 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1410
1411 Functions to get and set Lisp_Object fields of buffer-local variables.
1412 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1413 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1414 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1415 * data.c, eval.c, frame.c: Adjust users.
1416
1417 2012-08-17 Chong Yidong <cyd@gnu.org>
1418
1419 * xfaces.c (merge_face_vectors): If the target font specfies a
1420 font spec, make the font's attributes take precedence over
1421 directly-specified attributes.
1422 (merge_face_ref): Recognize :font.
1423
1424 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1425
1426 Do not use memcpy for copying intervals.
1427 * intervals.c (reproduce_interval): New function.
1428 (reproduce_tree, reproduce_tree_obj): Use it.
1429 (reproduce_tree_obj): Remove prototype.
1430
1431 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1432
1433 * lisp.h (duration_to_sec_usec): Remove unused decl.
1434
1435 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1436
1437 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1438 to an allocated instance of NSString, not to the class itself.
1439
1440 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1441
1442 * makefile.w32-in (C_CTYPE_H): New macro.
1443 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1444 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1445 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1446
1447 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1448
1449 Use ASCII tests for character types.
1450 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1451 * xfns.c, xterm.c:
1452 Don't include <ctype.h>; was not needed.
1453 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1454 * sysdep.c, xfaces.c:
1455 Include <c-ctype.h> instead of <ctype.h>.
1456 * nsterm.m: Include <c-ctype.h>.
1457 * charset.c (read_hex):
1458 * doc.c (Fsnarf_documentation):
1459 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1460 (DRIVE_LETTER) [DOS_NT]:
1461 (Ffile_name_directory, Fexpand_file_name)
1462 (Fsubstitute_in_file_name):
1463 * font.c (font_parse_xlfd, font_parse_fcname):
1464 * frame.c (x_set_font_backend):
1465 * gtkutil.c (xg_get_font):
1466 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1467 * nsimage.m (hexchar):
1468 * nsterm.m (ns_xlfd_to_fontname):
1469 * sysdep.c (system_process_attributes):
1470 * xfaces.c (hash_string_case_insensitive):
1471 Use C-locale tests instead of locale-specific tests for character
1472 types, since we want the ASCII interpretation here, not the
1473 interpretation suitable for whatever happens to be the current locale.
1474
1475 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1476
1477 Consistently check windows for validity/liveness
1478 (Bug#11984, Bug#12025, Bug#12026).
1479 * lisp.h (CHECK_VALID_WINDOW): New macro.
1480 * window.c (decode_window): Rename to decode_live_window.
1481 (decode_valid_window, Fwindow_valid_p): New functions.
1482 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1483 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1484 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1485 (Fwindow_prev_sibling, Fwindow_combination_limit)
1486 (Fset_window_combination_limit, Fwindow_use_time)
1487 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1488 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1489 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1490 (Fwindow_hscroll, Fset_window_hscroll)
1491 (Fwindow_redisplay_end_trigger)
1492 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1493 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1494 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1495 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1496 (Fwindow_end, Fset_window_point, Fset_window_start)
1497 (Fpos_visible_in_window_p, Fwindow_line_height)
1498 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1499 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1500 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1501 (Fset_window_parameter, Fwindow_display_table)
1502 (Fset_window_display_table, Fdelete_other_windows_internal)
1503 (Fset_window_buffer, Fset_window_new_total)
1504 (Fset_window_new_normal, Fdelete_window_internal)
1505 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1506 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1507 (Fwindow_scroll_bars): Check whether argument window is a valid or
1508 live window. Update doc-strings.
1509 (syms_of_window): New symbol Qwindow_valid_p.
1510 * keyboard.c (Fposn_at_x_y): Check whether argument
1511 frame_or_window denotes a valid window.
1512
1513 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1514
1515 Fix previous char table change.
1516 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1517 * chartab.c (optimize_sub_char_table): Likewise.
1518
1519 2012-08-16 Chong Yidong <cyd@gnu.org>
1520
1521 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1522
1523 * xfont.c (xfont_open):
1524 * xftfont.c (xftfont_open): Set the font's max_width field.
1525
1526 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1527 min_width to space_width and average_width to the average over
1528 printable ASCII characters.
1529 (ns_char_width): Code cleanup.
1530 (ns_ascii_average_width): New utility function.
1531
1532 * font.h (struct font): Update comments.
1533
1534 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1535
1536 Simple interface to set Lisp_Object fields of character tables.
1537 * lisp.h (CSET): New macro.
1538 (char_table_set_extras, char_table_set_contents)
1539 (sub_char_table_set_contents): New function.
1540 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1541 * syntax.c: Adjust users.
1542
1543 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1544
1545 * eval.c (eval_sub): Bind lexical-binding.
1546 * lread.c (Qlexical_binding): Make non-static.
1547
1548 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1549
1550 * nsmenu.m (popupSession): Remove.
1551 (pop_down_menu): Remove endModalSession.
1552 (timeout_handler:): New method.
1553 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1554 Call runModalForWindow. Check timer_fired when it returns.
1555 If not set, cancel timer and break out of loop.
1556 Otherwise loop again, with a new timeout.
1557
1558 * nsterm.m: Include fcntl.h if present.
1559 (fd_entry, t_readfds, inNsSelect): Remove.
1560 (select_writefds, select_valid, select_timeout, selfds)
1561 (select_mutex, apploopnr): Add.
1562 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1563 Otherwise call kbd_buffer_store_event.
1564 (ns_send_appdefined): Remove release of fd_entry.
1565 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1566 Increment and decrement apploopnr.
1567 (ns_select): If no file descriptors, just do a NSTimer.
1568 Otherwise copy read/write masks and start select thread (fd_handler).
1569 Start main loop and wait for application defined event.
1570 Inform select thread to stop selecting after main loop is exited.
1571 (ns_term_init): Create selfds pipe and set non-blocking.
1572 Initialize select_mutex. Start the select thread (fd_handler).
1573 (fd_handler:): Loop forever, wait for info from the main thread
1574 to either start or stop selecting. When select returns, send
1575 and appdefined event.
1576 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1577 If not call kbd_buffer_store_event.
1578
1579 * nsterm.h (EmacsApp): fd_handler takes id argument.
1580 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1581
1582 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1583
1584 2012-08-15 Eli Zaretskii <eliz@gnu.org>
1585
1586 * region-cache.c (move_cache_gap): Update gap_len using the actual
1587 growth of the boundaries array. Do not change cache_len.
1588 (Bug#12196)
1589
1590 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1591
1592 Generalize and cleanup font subsystem checks.
1593 * font.h (FONT_DEBUG, font_assert): Remove.
1594 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1595 Change font_assert to eassert. Use eassert where appropriate.
1596
1597 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1598
1599 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1600
1601 2012-08-15 Chong Yidong <cyd@gnu.org>
1602
1603 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1604 When using the new font chooser, use gtk_font_chooser_get_font_desc to
1605 extract the font descriptor instead of just the font name.
1606 In that case, return a font spec instead of a string.
1607 (x_last_font_name): Move to this file from xfns.c.
1608
1609 * xfns.c (Fx_select_font): The return value can also be a font
1610 spec. Move x_last_font_name management to gtkutil.c.
1611
1612 * xfaces.c: Make font weight and style symbols non-static.
1613
1614 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1615
1616 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1617 (bug#12117).
1618
1619 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1620
1621 * alloc.c (Fgarbage_collect): Use plural form consistently.
1622
1623 2012-08-14 Eli Zaretskii <eliz@gnu.org>
1624
1625 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1626 iteration through the command loop. Fixes a problem whereby mouse
1627 movements are ignored until the first mouse click.
1628
1629 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1630
1631 Use bool, not int, for Lisp booleans.
1632 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1633 makes Emacs a bit smaller and presumably a bit faster.
1634 * lisp.h: Include <stdbool.h>.
1635 (struct Lisp_Boolfwd, defvar_bool):
1636 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1637 * regex.c [!emacs]: Include <stdbool.h>.
1638 (false, true): Remove; <stdbool.h> does this for us now.
1639
1640 2012-08-14 Chong Yidong <cyd@gnu.org>
1641
1642 * character.c (Fcharacterp): Doc fix (Bug#12076).
1643
1644 * data.c (Findirect_variable): Doc fix (Bug#11040).
1645
1646 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1647
1648 * editfns.c (Fformat): Doc fix (Bug#12059).
1649 (Fsave_current_buffer): Doc fix (Bug#11542).
1650
1651 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1652
1653 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1654 (bug#12022).
1655
1656 2012-08-14 Martin Rudalics <rudalics@gmx.at>
1657
1658 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1659 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1660 * minibuf.c (choose_minibuf_frame, read_minibuf):
1661 * w32fns.c (x_create_tip_frame):
1662 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1663 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1664
1665 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1666
1667 * intervals.c (offset_intervals): Remove obsolete comment.
1668
1669 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1670
1671 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1672
1673 2012-08-14 Gergely Risko <gergely@risko.hu>
1674
1675 * coding.c (decode_coding): Record buffer modification before
1676 disabling undo_list (Bug#11773).
1677
1678 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1679
1680 Revert and cleanup some recent overlay changes.
1681 * buffer.h (enum overlay_type): Remove.
1682 (buffer_get_overlays, buffer_set_overlays): Likewise.
1683 (buffer_set_overlays_before, buffer_set_overlays_after):
1684 New function. Adjust users.
1685 (unchain_both): Add eassert.
1686
1687 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1688
1689 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1690
1691 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1692
1693 * gtkutil.c (xg_mark_data): Don't assume C99.
1694
1695 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1696
1697 * gtkutil.c (xg_frame_tb_info): New struct.
1698 (TB_INFO_KEY): New define.
1699 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1700 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1701 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1702 if not present.
1703 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1704 is up to date. Otherwise store new data.
1705 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1706
1707 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1708
1709 Use KSET for write access to Lisp_Object members of struct kboard.
1710 * keyboard.h (KSET): New macro.
1711 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1712 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1713 * xterm.c: Adjust users.
1714
1715 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1716
1717 Use BSET for write access to Lisp_Object members of struct buffer.
1718 * buffer.h (BSET): New macro.
1719 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1720 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1721 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1722 * window.c, xdisp.c, xfns.c: Adjust users.
1723
1724 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1725
1726 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1727
1728 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1729
1730 * nsterm.m (not_in_argv): New function.
1731 (application:openFile, application:openTempFile:):
1732 (application:openFileWithoutUI:, application:openFiles:): Open file
1733 if not_in_argv returns non-zero (bug#12171).
1734
1735 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
1736 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
1737 Define for Gtk+ versions less than 3.2.
1738 (xg_get_font_name): Use those functions/macros here.
1739 Reported by Frans Oilinki <moilinki@gmail.com>.
1740
1741 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1742
1743 * unexmacosx.c (copy_data_segment): Copy initialized data in
1744 statically linked libraries from input file rather than memory.
1745
1746 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1747 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1748 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1749
1750 2012-08-10 Glenn Morris <rgm@gnu.org>
1751
1752 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1753 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1754
1755 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1756
1757 Fix last change to allow compilation with low optimization levels.
1758 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1759 Reported by Jan Djärv <jan.h.d@swipnet.se>.
1760
1761 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1762
1763 Use common inline syntax in intervals.h.
1764 * intervals.h (INTERVALS_INLINE): New macro.
1765 Change all users from LISP_INLINE.
1766
1767 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1768
1769 Define Qnone once for all platforms.
1770 * frame.c (Qnone): Define here.
1771 (syms_of_frame): DEFSYM it.
1772 * lisp.h (Qnone): New declaration.
1773 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1774 * xfns.c: Remove duplication. Adjust users.
1775
1776 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1777
1778 Remove unused macros from intervals.h.
1779 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1780 * intervals.c: Adjust comment.
1781
1782 2012-08-10 Eli Zaretskii <eliz@gnu.org>
1783
1784 * w32fns.c <w32_unicode_gui>: New static variable.
1785 (globals_of_w32fns): Initialize it according to os_subtype.
1786 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1787 testing os_subtype.
1788
1789 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
1790 Eli Zaretskii <eliz@gnu.org>
1791
1792 Fix bug #10299 with Unicode characters sent by customized
1793 keyboards created by MSKLC.
1794 * w32fns.c (INIT_WINDOW_CLASS): New macro.
1795 (w32_init_class): Use it to initialize the Emacs class with either
1796 ANSI or Unicode API calls.
1797 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1798 later.
1799 (w32_wnd_proc): If the character code sent by WM_CHAR or
1800 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1801 original message. Call DefWindowProcW on NT and later.
1802
1803 2012-08-10 Glenn Morris <rgm@gnu.org>
1804
1805 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1806
1807 * lisp.h (DIRECTORY_SEP): Let configure set it.
1808
1809 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1810
1811 Use TSET for write access to Lisp_Object slots of struct terminal.
1812 * termhooks.h (TSET): New macro.
1813 * coding.c, terminal.c, xselect.c: Adjust users.
1814
1815 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1816
1817 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1818 the failing expression, include them in the error message.
1819 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1820 * lisp.h (internal_condition_case_n): Update declaration.
1821
1822 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1823
1824 Inline functions to examine and change buffer overlays.
1825 * buffer.c (unchain_both): New function.
1826 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1827 (buffer_has_overlays): New function.
1828 (enum overlay_type): New enum.
1829 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1830 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1831
1832 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1833
1834 Inline functions to examine and change buffer intervals.
1835 * alloc.c (mark_interval_tree): Remove.
1836 (MARK_INTERVAL_TREE): Simplify.
1837 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1838 * intervals.c (buffer_balance_intervals): New function.
1839 (graft_intervals_into_buffer): Adjust indentation.
1840 (set_intervals_multibyte): Simplify.
1841 * buffer.h (BUF_INTERVALS): Remove.
1842 (buffer_get_intervals, buffer_set_intervals): New function.
1843 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1844 * intervals.c, textprop.c: Adjust users.
1845
1846 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1847
1848 Inline functions to examine and change string intervals.
1849 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1850 (string_get_intervals, string_set_intervals): New function.
1851 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1852 * lread.c, print.c, textprop.c: Adjust users.
1853
1854 2012-08-08 Glenn Morris <rgm@gnu.org>
1855
1856 * lisp.mk (lisp): Remove language/persian.elc.
1857
1858 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1859
1860 Cleanup intervals.
1861 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1862 (NULL_INTERVAL_P): Likewise. Adjust users.
1863 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1864 Adjust comment. Move under #if 0.
1865 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1866 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1867
1868 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1869
1870 Check total length of intervals with eassert.
1871 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1872 * intervals.c: Change all users to eassert.
1873
1874 2012-08-07 Eli Zaretskii <eliz@gnu.org>
1875
1876 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1877 Rename fields to match removal of FGET and WGET and disuse of
1878 INTERNAL_FIELD in Lisp_Cons.
1879
1880 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1881
1882 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1883 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1884 name since all xname users are fixed long time ago. Do not
1885 use INTERNAL_FIELD.
1886 (set_symbol_name, set_symbol_function, set_symbol_plist):
1887 (set_symbol_next, set_overlay_plist): New function.
1888 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1889 (struct Lisp_Overlay): Likewise.
1890 (CVAR, MVAR, SVAR): Remove.
1891 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1892 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1893 * xterm.c: Adjust users.
1894 * .gdbinit: Change to use name field of struct Lisp_Symbol
1895 where appropriate.
1896
1897 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1898
1899 Basic functions to set Lisp_Object and pointer slots of intervals.
1900 * intervals.h (interval_set_parent, interval_set_object):
1901 (interval_set_left, interval_set_right, interval_set_plist):
1902 (interval_copy_parent): New function.
1903 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
1904 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1905 Adjust indentation.
1906 (INTERVAL_SIZE): Remove. Adjust users.
1907 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1908
1909 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1910
1911 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1912 * process.h (PGET): Remove.
1913 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1914 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1915
1916 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1917
1918 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1919 * window.h (WGET): Remove.
1920 (struct window): Do not use INTERNAL_FIELD.
1921 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1922 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1923 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1924 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1925 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1926 Adjust users.
1927
1928 2012-08-07 Chong Yidong <cyd@gnu.org>
1929
1930 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1931 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1932 (Fdelete_window_internal): Signal an error if the window is not on
1933 a live frame (Bug#12025).
1934
1935 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1936
1937 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1938 * frame.h (FGET): Remove.
1939 (struct frame): Do not use INTERNAL_FIELD.
1940 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1941 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1942 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1943 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1944
1945 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
1946
1947 * w32.c: Silence compiler warnings.
1948 (map_w32_filename): Remove unused variable `is_fat'.
1949 (chase_symlinks): Add parentheses around expression.
1950
1951 2012-08-06 Glenn Morris <rgm@gnu.org>
1952
1953 * sysdep.c: Respect BROKEN_GETWD.
1954
1955 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1956 Let configure handle it.
1957 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1958
1959 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1960
1961 Use GCALIGNMENT where appropriate.
1962 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1963 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1964 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1965
1966 2012-08-06 Eli Zaretskii <eliz@gnu.org>
1967
1968 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1969 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
1970
1971 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1972
1973 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1974 that should be sufficient for everyone.
1975
1976 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1977
1978 * keyboard.c (timer_check_2): Add break so timer_check returns next
1979 timeout.
1980
1981 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1982
1983 Fix Windows build errors introduced after converting to WGET and WSET.
1984 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1985 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1986
1987 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1988
1989 * nsterm.m (ns_frame_rehighlight): Use FSET.
1990
1991 * nsmenu.m (ns_update_menubar): Use FSET.
1992
1993 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1994
1995 Separate read and write access to Lisp_Object slots of Lisp_Process.
1996 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1997 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1998
1999 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2000
2001 Separate read and write access to Lisp_Object slots of struct window.
2002 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2003 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2004 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2005 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2006 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2007 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2008 Adjust users.
2009
2010 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2011
2012 Fix Windows build errors introduced after converting to FGET and FSET.
2013 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2014 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2015 (w32_judge_scroll_bars): Change to use FSET.
2016 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2017
2018 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2019
2020 Fix replacement typo.
2021 * window.c (replace_window): Set root_window instead of
2022 selected_window. This fixes a total window subsystem
2023 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2024
2025 2012-08-06 Glenn Morris <rgm@gnu.org>
2026
2027 * lisp.mk (lisp): Add language/persian.elc.
2028
2029 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2030
2031 Separate read and write access to Lisp_Object slots of struct frame.
2032 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2033 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2034 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2035 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2036 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2037
2038 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2039
2040 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2041
2042 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2043
2044 Generalize common compile-time constants.
2045 * lisp.h (header_size, bool_header_size, word_size): Now here.
2046 (struct Lisp_Vector): Add comment.
2047 (struct Lisp_Bool_Vector): Move up to define handy constants.
2048 (VECSIZE, PSEUDOVECSIZE): Simplify.
2049 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2050 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2051 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2052 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2053 * xfont.c, xmenu.c: Use word_size where appropriate.
2054
2055 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2056
2057 * search.c (Freplace_match): Treat \? in the replacement text
2058 literally (Bug#8161).
2059
2060 2012-08-05 Chong Yidong <cyd@gnu.org>
2061
2062 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2063 * frame.c (Vdelete_frame_functions):
2064 * emacs.c (Vkill_emacs_hook): Doc fix.
2065
2066 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2067
2068 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2069 --with-x-toolkit=no builds.
2070 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2071
2072 2012-08-04 Chong Yidong <cyd@gnu.org>
2073
2074 * syntax.c (Fmodify_syntax_entry): Doc fix.
2075
2076 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2077
2078 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2079 * w32.c (init_environment): Change the default values of many
2080 environment variables in dflt_envvars[] to NULL, to avoid pushing
2081 them into environment when they were not already defined.
2082 Remove the code that deletes site-lisp subdirectories from the default
2083 value of EMACSLOADPATH, as it is no longer needed.
2084 (check_windows_init_file): Now external, not static.
2085 Use Vload_path as is, without adding anything, as this function is now
2086 called when Vload_path is already set up.
2087
2088 * w32.h (check_windows_init_file): Add prototype.
2089
2090 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2091 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2092 compatibility with Posix platforms.
2093 (main): Move the call to check_windows_init_file to here from
2094 w32.c.
2095 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2096 any, in the DEFALT argument into the root of the Emacs build or
2097 installation tree, as appropriate.
2098
2099 * callproc.c (init_callproc_1): Call decode_env_path instead of
2100 doing its equivalent by hand.
2101 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2102 the code that sets Vexec_path run on MS-Windows.
2103
2104 * lread.c (init_lread): Add comments to #ifdef's.
2105
2106 * msdos.c (dos_set_window_size, IT_update_begin)
2107 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2108 instead of direct references.
2109
2110 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2111
2112 Export DEFAULT_REHASH_* to GDB.
2113 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2114 Now constants, not macros.
2115
2116 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2117
2118 Remove unnecessary casts involving pointers.
2119 These casts are no longer needed now that we assume C89 or later,
2120 since they involve casting to or from void *.
2121 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2122 (make_pure_float, make_pure_vector):
2123 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2124 * macros.c (Fstart_kbd_macro):
2125 * menu.c (find_and_return_menu_selection):
2126 * minibuf.c (read_minibuf_noninteractive):
2127 * sysdep.c (closedir):
2128 * xdisp.c (x_produce_glyphs):
2129 * xfaces.c (compare_fonts_by_sort_order):
2130 * xfns.c (x_real_positions, select_visual):
2131 * xselect.c (x_stop_queuing_selection_requests)
2132 (x_get_window_property, x_get_window_property_as_lisp_data):
2133 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2134 Remove unnecessary pointer casts.
2135 * alloc.c (record_xmalloc): New function.
2136 * lisp.h (record_xmalloc): New decl.
2137 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2138 more like a function. This is because the pointer cast is not
2139 needed. All uses changed.
2140 * print.c (print_string, print_error_message): Avoid length recalc.
2141
2142 Improve fix for macroexp crash with debugging (Bug#12118).
2143 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2144 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2145 not supposed to be invoked from the garbage collector.
2146 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2147 (gc_aset): New function, which is like ASET but can be
2148 used in the garbage collector.
2149 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2150 (set_hash_index): Use it instead of ASET.
2151
2152 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2153
2154 Support symlinks on latest versions of MS-Windows.
2155 * w32.c: Include winioctl.h and aclapi.h.
2156 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2157 (revert_to_self): Forward declarations of static functions.
2158 <static BOOL g_b_init_get_security_info>:
2159 <g_b_init_create_symbolic_link>: New static flags.
2160 (globals_of_w32): Initialize them to zero.
2161 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2162 (map_w32_filename): Improve commentary. Simplify switch.
2163 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2164 headers (most versions of MinGW w32api don't).
2165 (get_security_info, create_symbolic_link)
2166 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2167 New functions.
2168 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2169 in the argument file name.
2170 (sys_access): Call unc_volume_file_attributes only if
2171 GetFileAttributes fails with network-related error codes.
2172 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2173 have the required privileges.
2174 (get_file_security_desc_by_name): Rename from
2175 get_file_security_desc.
2176 (stat_worker): New function, with most of the guts of 'stat', and
2177 with addition of handling of symlinks and support for 'lstat'.
2178 If possible, get file's attributes and security information by
2179 handle, not by name. Produce S_IFLNK bit for symlinks, when
2180 called from 'lstat'.
2181 (stat, lstat): New functions, call 'stat_worker'.
2182 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2183 symlinks when the underlying filesystem supports them.
2184
2185 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2186
2187 Fix macroexp crash on Windows with debugging (Bug#12118).
2188 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2189 checking subscripts; problem introduced with the recent
2190 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2191 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2192 since it's used in non-static inline functions now.
2193
2194 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2195 Don't assume buffer size fits in 'int'. Remove unused local.
2196
2197 Use C99-style 'extern inline' if available.
2198 * buffer.h (BUFFER_INLINE):
2199 * category.h (CATEGORY_INLINE):
2200 * character.h (CHARACTER_INLINE):
2201 * charset.h (CHARSET_INLINE):
2202 * composite.h (COMPOSITE_INLINE):
2203 * dispextern.h (DISPEXTERN_INLINE):
2204 * lisp.h (LISP_INLINE):
2205 * systime.h (SYSTIME_INLINE):
2206 New macro, replacing 'static inline' in this header.
2207 * buffer.h, category.h, character.h, charset.h, composite.h:
2208 * dispextern.h, lisp.h, systime.h:
2209 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2210 * alloc.c (LISP_INLINE):
2211 * buffer.c (BUFFER_INLINE):
2212 * category.c (CATEGORY_INLINE):
2213 * character.c (CHARACTER_INLINE):
2214 * charset.c (CHARSET_INLINE):
2215 * composite.c (COMPOSITE_INLINE):
2216 * dispnew.c (DISPEXTERN_INLINE):
2217 * sysdep.c (SYSTIME_INLINE):
2218 Define to EXTERN_INLINE, so that the corresponding functions
2219 are compiled into code.
2220 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2221 (INLINE_HEADER_END): New macros.
2222 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2223 since it's used in non-static inline functions now.
2224 (VALMASK) [!USE_LSB_TAG]: Likewise.
2225
2226 2012-08-02 Glenn Morris <rgm@gnu.org>
2227
2228 * s/: Remove empty directory.
2229
2230 * s/ms-w32.h: Move to ../nt/inc.
2231 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2232 Update for new ms-w32.h location.
2233
2234 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2235
2236 Port to Solaris 8.
2237 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2238
2239 2012-08-02 Glenn Morris <rgm@gnu.org>
2240
2241 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2242 hard-coding the path separator.
2243
2244 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2245
2246 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2247 This how ASET and AREF are supposed to work, and makes
2248 it easier to think about future improvements. See
2249 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2250 * charset.h (set_charset_attr): New function.
2251 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2252 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2253 (aref_addr): New function. All uses of &AREF(...) changed.
2254 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2255 (set_hash_index): New functions. All lvalue-style uses of
2256 HASH_KEY etc. changed.
2257 * keyboard.c (set_prop): New function. All lvalue-style uses
2258 of PROP changed.
2259
2260 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2261
2262 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2263 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2264 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2265 * nsfns.m (ns_set_name_as_filename): Likewise.
2266 * nsmenu.m (ns_update_menubar): Likewise.
2267 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2268
2269 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2270
2271 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2272 Adapt to latest changes in field names of the corresponding Lisp
2273 objects.
2274
2275 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2276
2277 2012-08-01 Glenn Morris <rgm@gnu.org>
2278
2279 * s/msdos.h: Remove file.
2280 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2281 * Makefile.in (S_FILE): Remove.
2282 (config_h): Remove S_FILE.
2283
2284 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2285
2286 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2287 Remove; moved to nt/config.nt.
2288
2289 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2290
2291 Use INTERNAL_FIELD for conses and overlays.
2292 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2293 Remove obsolete comment.
2294 (MVAR): New macro.
2295 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2296 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2297
2298 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2299
2300 Use INTERNAL_FIELD for symbols.
2301 * lisp.h (SVAR): New macro. Adjust users.
2302 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2303 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2304
2305 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2306
2307 Use INTERNAL_FIELD for processes.
2308 * process.h (PVAR): New macro. Adjust style.
2309 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2310 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2311
2312 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2313
2314 Use INTERNAL_FIELD for windows.
2315 * window.h (WVAR): New macro.
2316 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2317 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2318 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2319 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2320 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2321 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2322
2323 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2324
2325 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2326
2327 2012-08-01 Glenn Morris <rgm@gnu.org>
2328
2329 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2330 Move to configure.ac.
2331
2332 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2333
2334 * makefile.w32-in (CONFIG_H): Update dependencies.
2335 (CONF_POST_H): New macro.
2336
2337 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2338
2339 2012-07-31 Glenn Morris <rgm@gnu.org>
2340
2341 * Makefile.in (S_FILE): No longer set by configure.
2342
2343 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2344 is available.
2345 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2346
2347 * process.h (NULL_DEVICE):
2348 * emacs.c (SEPCHAR):
2349 * editfns.c (USER_FULL_NAME): Let configure set them.
2350
2351 * s/README, s/template.h: Remove files.
2352
2353 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2354
2355 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2356 Move to configure.ac.
2357
2358 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2359
2360 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2361 resulting renaming of 'struct frame' members.
2362
2363 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2364
2365 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2366 after introduction of FVAR.
2367
2368 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2369
2370 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2371
2372 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2373 instead of compositeToPoint.
2374 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2375
2376 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2377
2378 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2379
2380 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2381 * lisp.h (INTERNAL_FIELD): New macro.
2382 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2383 (BVAR): Change to use INTERNAL_FIELD.
2384 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2385 (KVAR): Change to use INTERNAL_FIELD.
2386 * frame.h (FVAR): New macro.
2387 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2388 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2389 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2390 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2391 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2392
2393 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2394
2395 Miscellaneous fixes for non-default X toolkits.
2396 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2397 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2398 Move under #ifdef USE_LUCID.
2399 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2400 definition and usage to avoid warnings.
2401
2402 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2403
2404 * nsterm.m (openFiles): Fix previous checkin.
2405
2406 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2407
2408 * indent.c (compute_motion): Remove unused local.
2409
2410 2012-07-31 Glenn Morris <rgm@gnu.org>
2411
2412 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2413
2414 * conf_post.h [USG5_4]:
2415 Move remaining contents of s/usg5-4-common.h here.
2416 * s/usg5-4-common.h: Remove file.
2417
2418 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2419 * s/irix6-5.h: Remove file.
2420
2421 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2422 * s/darwin.h: Remove file.
2423
2424 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2425 * s/hpux10-20.h: Remove file, which is now empty.
2426
2427 2012-07-30 Glenn Morris <rgm@gnu.org>
2428
2429 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2430 * Makefile.in (config_h): Add conf_post.h.
2431 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2432
2433 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2434
2435 * nsterm.m (ns_do_open_file): New variable.
2436 (ns_term_init): Set ns_do_open_file to YES after run returns.
2437 (openFile, openTempFile, openFileWithoutUI, openFiles):
2438 Open files only if ns_do_open_file.
2439
2440 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2441
2442 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2443 This no-op macro hasn't been needed for many years.
2444 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2445
2446 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2447 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2448 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2449 gdb_make_enums_visible.
2450 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2451 (DIRECTORY_SEP): Now a constant, not a macro.
2452
2453 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2454
2455 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2456 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2457
2458 * w32term.c <w32_keyboard_codepage>: Renamed from
2459 keyboard_codepage and now external. All users changed.
2460
2461 * w32term.h: Add declaration of w32_keyboard_codepage.
2462
2463 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2464 the codepage to translate keys to Unicode. If this argument is
2465 -1, use the value returned by GetConsoleCP. All callers changed.
2466
2467 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2468
2469 Update .PHONY listings in makefiles.
2470 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2471 bootstrap-clean, distclean, maintainer-clean, versioclean,
2472 extraclean, frc.
2473
2474 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2475 This is a bit clearer. Fix some commentary typos.
2476
2477 2012-07-30 Glenn Morris <rgm@gnu.org>
2478
2479 * s/netbsd.h: Let configure include signal.h if needed.
2480 Remove file, which is now empty.
2481
2482 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2483 Let configure set them.
2484 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2485 No more need to undefine.
2486
2487 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2488
2489 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2490 non-single-byte char when adding meta modifier. (Bug#12090)
2491
2492 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2493
2494 Convert safe_call to use variable number of arguments.
2495 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2496 (safe_call2): Fix comment.
2497 * lisp.h (safe_call): Adjust prototype.
2498 * coding.c (encode_coding_object): Change to use safe_call2.
2499 * xfaces.c (merge_face_heights): Change to use safe_call1.
2500
2501 2012-07-30 Glenn Morris <rgm@gnu.org>
2502
2503 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2504 does that unconditionally. Remove file, which is now empty.
2505
2506 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2507 Remove empty files.
2508
2509 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2510
2511 Export to GDB most of lisp.h's remaining object-like macros.
2512 * lisp.h (min, max): Move earlier, because they're used earlier now.
2513 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2514 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2515 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2516 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2517 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2518 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2519 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2520 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2521 Now constants, for GDB. They need not be macros.
2522 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2523 Now constants, for GDB, as well as macros, for static initializers.
2524 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2525 Move to after the definition of struct Lisp_Char_Table,
2526 since the former now needs that type defined.
2527 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2528 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2529 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2530 New enums, for gdb_make_enums_visible.
2531 (GLYPH_MODE_LINE_FACE): Remove; unused.
2532 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2533 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2534 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2535 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2536 enum maxargs, enum MAX_ALLOCA.
2537 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2538 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2539 no longer needed, now that they are done in lisp.h.
2540
2541 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2542
2543 Cleanup string bytes checking.
2544 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2545 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2546 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2547 (check_sblock, compact_small_strings): Simplify.
2548
2549 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2550
2551 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2552 These macros are confusing and no longer need to be defined, as
2553 the enum values now suffice. All uses replaced with definiens.
2554 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2555
2556 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
2557
2558 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2559 ($(BLD)/w32console.$(O)): Update dependencies.
2560
2561 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2562
2563 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2564 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2565 time. Adjust users.
2566 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2567
2568 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2569
2570 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2571 setting sitelisp (Bug#12010).
2572
2573 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2574
2575 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2576
2577 * w32heap.c (cache_system_info):
2578 * w32.c (sys_rename):
2579 * w32proc.c (find_child_console, sys_kill): All users changed.
2580
2581 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2582
2583 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2584
2585 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2586
2587 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2588
2589 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2590
2591 Cleanup statistics calculation in Fgarbage_collect.
2592 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2593 Fix zombies percentage calculation. Simplify elapsed time calculation.
2594
2595 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2596
2597 Generalize marker debugging code under MARKER_DEBUG and use eassert.
2598 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2599 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2600 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2601 (replace_range, replace_range_2, del_range_2): Change to eassert.
2602 * marker.c (byte_char_debug_check): Adjust style.
2603
2604 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2605
2606 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2607 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2608 long-ago-commented-out code that talks about "WIN32".
2609 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2610 All uses changed.
2611
2612 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2613
2614 Use Gnulib stdalign module (Bug#9772, Bug#9960).
2615 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2616 Simplify by using alignof.
2617 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2618 * lisp.h: Include <stdalign.h>.
2619 (GCALIGNMENT): New macro and constant.
2620 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
2621 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2622 (stdalign): New macro, if not already defined.
2623
2624 2012-07-28 Eli Zaretskii <eliz@gnu.org>
2625
2626 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
2627 * w32inevt.c: Include w32inevt.h.
2628 (w32_read_console_input): New inline function, calls either
2629 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2630 w32_console_unicode_input.
2631 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2632 (w32_kbd_patch_key, key_event): Use the codepage returned by
2633 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2634 (key_event): use uChar.UnicodeChar only if
2635 w32_console_unicode_input is non-zero.
2636
2637 * w32console.c: Include w32heap.h.
2638 <w32_console_unicode_input>: New global variable.
2639 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2640 family of Windows, zero otherwise.
2641
2642 * w32inevt.h: Declare w32_console_unicode_input.
2643
2644 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2645 --without-x. (Bug#11742)
2646
2647 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2648
2649 Adjust GDB to reflect pvec_type changes (Bug#12036).
2650 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
2651 2012-07-04 changes to pseudovector representation.
2652 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
2653
2654 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
2655
2656 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2657 bus address.
2658 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2659
2660 2012-07-27 Eli Zaretskii <eliz@gnu.org>
2661
2662 * alloc.c (listn): Fix the order the arguments are consed onto the
2663 list.
2664
2665 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2666 enumeration constants, as PURE and HEAP are too general, and clash
2667 with other headers and sources, such as gmalloc.c and the
2668 MS-Windows system headers. All users changed.
2669
2670 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2671
2672 Revert last save_excursion_save and save_excursion_restore changes.
2673 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2674 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2675
2676 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2677
2678 Fix recently-introduced typos in Windows port.
2679 Reported by Martin Rudalics <rudalics@gmx.at>.
2680 * w32.c (init_environment): Replace comma with semicolon.
2681 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
2682
2683 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2684
2685 Improve GDB symbol export (Bug#12036).
2686 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2687 arms of an 'if', not using conditional expressions; otherwise GDB
2688 complains about the types in the unevaluated arm when the argument
2689 is an integer literal.
2690 (xgetint): Simplify expression.
2691 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2692 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2693 Zaretskii in <http://bugs.gnu.org/12036#13>.
2694 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2695 needed now that we have gdb_make_enums_visible.
2696 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2697 (enum enum_USE_LSB_TAG):
2698 New enum types, packaging up enums that need to be exported to GDB.
2699
2700 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2701
2702 Utility function to make a list from specified amount of objects.
2703 * lisp.h (enum constype): New datatype.
2704 (listn): New prototype.
2705 * alloc.c (listn): New function.
2706 (Fmemory_use_count, syms_of_alloc): Use it.
2707 * buffer.c (syms_of_buffer): Likewise.
2708 * callint.c (syms_of_callint): Likewise.
2709 * charset.c (define_charset_internal): Likewise.
2710 * coding.c (syms_of_coding): Likewise.
2711 * keymap.c (syms_of_keymap): Likewise.
2712 * search.c (syms_of_search): Likewise.
2713 * syntax.c (syms_of_syntax): Likewise.
2714 * w32.c (init_environment): Likewise.
2715 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2716 * xdisp.c (syms_of_xdisp): Likewise.
2717 * xfns.c (syms_of_xfns): Likewise.
2718
2719 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2720
2721 Fast save_excursion_save and save_excursion_restore.
2722 * lisp.h (struct Lisp_Excursion): New data type.
2723 (PVEC_EXCURSION): New pseudovector type.
2724 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2725 to deal with it. Adjust comments.
2726 (init_marker, attach_marker): New prototype.
2727 (unchain_marker): Adjust prototype.
2728 * marker.c (attach_marker): Change to global.
2729 (init_marker): New function.
2730 * alloc.c (Fmake_marker, build_marker): Use it.
2731 (build_marker): More easserts.
2732 (mark_object): Handle struct Lisp_Excursion.
2733 * editfns.c (save_excursion_save, save_excursion_restore):
2734 Reimplement to use struct Lisp_Excursion. Add comments.
2735
2736 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2737
2738 Fix export of symbols to GDB (Bug#12036).
2739 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
2740 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2741 emacs.c, as this is a more-suitable home. Had this been done earlier
2742 the fix for 12036 would have avoided some of the problems noted in
2743 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2744 would have been more obvious.
2745 * emacs.c: Do not include <verify.h>; no longer needed.
2746 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
2747 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2748 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2749 Remove; now done in lisp.h.
2750 * lisp.h (PUBLISH_TO_GDB): New macro.
2751 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2752 (DATA_SEG_BITS): Use it.
2753 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2754 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2755 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2756 not be usable in #if. This simplifies things.
2757
2758 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
2759
2760 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2761
2762 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2763
2764 Simplify export of symbols to GDB (Bug#12036).
2765 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2766 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2767 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2768 Adjust to changes in lisp.h and emacs.c, by using
2769 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2770 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2771 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2772 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2773 instead of gdb_valbits.
2774 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2775 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2776 instead of gdb_array_mark_flag.
2777 (xboolvector): Get size from $->size, not $->header.size.
2778 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2779 (xreload, hook-run, hookpost-run): Remove.
2780 * emacs.c: Include <verify.h>.
2781 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2782 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2783 Remove.
2784 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2785 (gdb_USE_LSB_TAG): New enum constants.
2786 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2787 Also define these as enum constants, so they're visible to GDB.
2788 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2789 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2790 as constants, so they're visible to GDB.
2791 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2792 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2793 Now enum constants, not macros, so they're visible to GDB.
2794 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2795 more convenient now. All uses changed.
2796 (VALMASK) [USE_LSB_TAG]: Also define in this case.
2797 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2798
2799 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2800
2801 Explicitly free restriction data that are not needed anymore.
2802 * editfns.c (save_restriction_restore): Free restriction data.
2803
2804 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2805
2806 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2807 add argument, tune behavior, and adjust all callers.
2808
2809 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2810
2811 Use typedef for EMACS_INT, EMACS_UINT.
2812 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2813 than macros. This simplifies debugging in the usual case, since
2814 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2815 and it allows expressions involving EMACS_INT casts.
2816 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2817
2818 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2819
2820 * nsterm.m (ns_read_socket): Return early if there is a modal
2821 window (Bug#12043).
2822
2823 2012-07-25 Martin Rudalics <rudalics@gmx.at>
2824
2825 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2826 that FOCUS-FRAME can be omitted.
2827
2828 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2829
2830 Adjust buffer text indirection counters at the end of Fkill_buffer.
2831 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2832 buffer is definitely dead. This should really fix an issue reported
2833 by Christoph Scholtes again. (Bug#12007).
2834 (init_buffer_once): Initialize indirection counters of
2835 buffer_defaults and buffer_local_symbols (for sanity and safety).
2836
2837 2012-07-24 Eli Zaretskii <eliz@gnu.org>
2838
2839 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2840 and continuation glyphs on tooltip frames, leave them at zero.
2841 Avoids continued lines in tooltips. (Bug#11832)
2842
2843 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2844
2845 Simplify copy_overlay.
2846 * buffer.c (copy_overlay): Simplify. Use build_marker.
2847 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2848
2849 2012-07-23 Eli Zaretskii <eliz@gnu.org>
2850
2851 * print.c (print_object): Don't crash when a frame's name is nil
2852 or invalid. (Bug#12025)
2853
2854 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2855 it signals an error when a tooltip frame is being created.
2856
2857 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2858
2859 Cleanup miscellaneous objects allocation and initialization.
2860 * alloc.c (allocate_misc): Change to static. Add argument to
2861 specify the subtype. Adjust comment and users.
2862 (build_overlay): New function.
2863 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2864 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2865 (allocate_misc): Remove prototype.
2866 (build_overlay): Add prototype.
2867
2868 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2869
2870 Swap buffer text indirection counters in Fbuffer_swap_text.
2871 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2872 This avoids crash reported by Christoph Scholtes at
2873 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2874
2875 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2876
2877 * nsmenu.m (Popdown_data): New struct.
2878 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2879 free Popdown_data.
2880 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2881 (initWithContentRect): Make imgView and contentView non-static
2882 and autorelease them. Also autorelease img and matrix (Bug#12005).
2883 (dealloc): Remove (Bug#12005).
2884
2885 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2886
2887 Adjust consing_since_gc when objects are explicitly freed.
2888 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2889 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2890 (free_cons, free_misc): Subtract object size from consing_since_gc.
2891
2892 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2893
2894 Simplify and cleanup markers positioning code.
2895 * marker.c (attach_marker): More useful eassert.
2896 (live_buffer, set_marker_internal): New function.
2897 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2898 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2899
2900 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2901
2902 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2903 as it's limited by the amount of memory, not by INT_MAX.
2904
2905 2012-07-21 Eli Zaretskii <eliz@gnu.org>
2906
2907 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2908 in special-event-map. See the discussion at
2909 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2910 for the reasons.
2911
2912 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2913 info.dwItemData. Fixes crashes on 64-bit Windows.
2914 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2915
2916 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2917
2918 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
2919 (conversationIdentifier): Return value is NSInteger.
2920 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
2921
2922 2012-07-21 Chong Yidong <cyd@gnu.org>
2923
2924 * window.c (decode_any_window): Signal an error if the window is
2925 on a dead frame (Bug#11984).
2926
2927 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2928
2929 Add indirection counting to speed up Fkill_buffer.
2930 * buffer.h (struct buffer): New member.
2931 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2932 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2933 base buffer indirection counter.
2934 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2935 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2936 through buffer list if indirection counter is 0.
2937
2938 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2939
2940 Extend the value returned by Fgarbage_collect with heap statistics.
2941 * alloc.c (Qheap): New symbol.
2942 (syms_of_alloc): DEFSYM it.
2943 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2944 (Fmemory_free): Remove.
2945 (syms_of_alloc): Don't defsubr it.
2946 * buffer.c (Fcompact_buffer): Remove.
2947 (syms_of_buffer): Don't defsubr it.
2948
2949 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2950
2951 Make maybe_gc inline.
2952 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2953 * lisp.h (consing_since_gc, gc_relative_threshold)
2954 (memory_full_cons_threshold): Revert declaration.
2955 (maybe_gc): Remove prototype, define as inline.
2956 * alloc.c: Remove old commented-out code.
2957 (consing_since_gc, gc_relative_threshold)
2958 (memory_full_cons_threshold): Revert to global.
2959 (maybe_gc): Remove.
2960
2961 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2962
2963 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2964 * lisp.h (build_unibyte_string): New function.
2965 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2966 * sysdep.c, w32fns.c, xfns.c: Use it.
2967 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2968 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2969 Adjust users accordingly.
2970 * font.h (font_open_by_name): Adjust prototype.
2971
2972 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2973
2974 Cleanup calls to Fgarbage_collect.
2975 * lisp.h (maybe_gc): New prototype.
2976 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2977 Remove declarations.
2978 * alloc.c (maybe_gc): New function.
2979 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2980 Make them static.
2981 * bytecode.c (MAYBE_GC): Use maybe_gc.
2982 * eval.c (eval_sub, Ffuncall): Likewise.
2983 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2984 to avoid dependency from auto-save feature.
2985
2986 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2987
2988 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2989 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2990 'for_each_per_buffer_object_at'.
2991 All uses changed. It's better to use upper-case for macros that
2992 cannot be implemented as functions, to give the reader a clue
2993 that they're special.
2994
2995 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2996
2997 * alloc.c (Fgarbage_collect): Tweak docstring.
2998
2999 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3000
3001 Tweak the value returned from Fgarbage_collect again.
3002 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3003 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3004 Adjust documentation.
3005 (total_vector_bytes): Rename to total_vector_slots, adjust
3006 accounting.
3007 (total_free_vector_bytes): Rename to total_free_vector_slots,
3008 adjust accounting.
3009 (Qstring_bytes, Qvector_slots): New symbols.
3010 (syms_of_alloc): DEFSYM them.
3011
3012 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3013
3014 Buffer compaction primitive which may be used from Lisp.
3015 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3016 (syms_of_buffer): Register Fcompact_buffer.
3017 * alloc.c (Fgarbage_collect): Use compact_buffer.
3018 * buffer.h (compact_buffer): New prototype.
3019 (struct buffer_text): New member.
3020
3021 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3022
3023 New macro to iterate over all buffers, miscellaneous cleanups.
3024 * lisp.h (all_buffers): Remove declaration.
3025 * buffer.h (all_buffers): Add declaration, with comment.
3026 (for_each_buffer): New macro.
3027 * alloc.c (Fgarbage_collect, mark_object): Use it.
3028 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3029 (init_buffer): Likewise.
3030 * data.c (Fset_default): Likewise.
3031 * coding.c (code_conversion_restore): Remove redundant check
3032 for dead buffer.
3033 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3034
3035 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3036
3037 Fix bug that created negative-length intervals.
3038 * intervals.c (merge_interval_right, merge_interval_left):
3039 Do not zero out this interval if it is absorbed by its children,
3040 as this interval's total length doesn't change in that case. See
3041 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3042
3043 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3044
3045 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3046 when invoking (make-bool-vector N t) and N is a positive
3047 multiple of 8 -- the last 8 bits were mistakenly cleared.
3048
3049 Remove some struct layout assumptions in bool vectors.
3050 * alloc.c (bool_header_size): New constant.
3051 (header_size, word_size): Move earlier, as they're now used earlier.
3052 Use 'word_size' in a few more places, where it's appropriate.
3053 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3054 padding before the data member of a bool vector.
3055 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3056 than doing the check by hand with an abort ().
3057
3058 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3059
3060 * eval.c (Fdefvar): Don't check constants since we only set the var if
3061 it's not yet defined anyway (bug#11904).
3062
3063 * lisp.h (last_undo_boundary): Declare new var.
3064 * keyboard.c (command_loop_1): Set it.
3065 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3066 were auto-added by the command loop (bug#11774).
3067
3068 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3069
3070 * w32font.c (Qsymbol): Remove local definition.
3071 (syms_of_w32font): Don't DEFSYM it.
3072
3073 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3074
3075 Fix sweep_vectors to handle large bool vectors correctly.
3076 * alloc.c (sweep_vectors): Account total_vector_bytes for
3077 bool vectors larger than VBLOCK_BYTES_MAX.
3078
3079 2012-07-18 Chong Yidong <cyd@gnu.org>
3080
3081 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3082 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3083
3084 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3085
3086 Return more descriptive data from Fgarbage_collect.
3087 Suggested by Stefan Monnier in
3088 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3089 * alloc.c (bounded_number): New function.
3090 (total_buffers, total_vectors): New variable.
3091 (total_string_size): Rename to total_string_bytes, adjust users.
3092 (total_vector_size): Rename to total_vector_bytes, adjust users.
3093 (sweep_vectors): Account total_vectors and total_vector_bytes.
3094 (Fgarbage_collect): New return value. Adjust documentation.
3095 (gc_sweep): Account total_buffers.
3096 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3097 (VECTOR_SIZE): Remove.
3098 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3099 (Qinterval, Qmisc): New symbols.
3100 (syms_of_data): Initialize them.
3101 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3102 (Qcons, Qbuffer): New declarations.
3103
3104 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3105
3106 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3107 Round up, not down. Improve doc.
3108
3109 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3110
3111 Restore old code in allocate_string_data to avoid Faset breakage.
3112 Reported by Julien Danjou <julien@danjou.info> in
3113 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3114 * alloc.c (allocate_string_data): Restore old code with minor
3115 adjustments, fix comment to explain this subtle issue.
3116
3117 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3118
3119 Remove FILE_SYSTEM_CASE.
3120 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3121
3122 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3123 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3124 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3125 call-process-region passes it through expand-file-name.
3126
3127 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3128
3129 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3130
3131 Fix crash when creating indirect buffer (Bug#11917)
3132 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3133 Don't handle unbound variables specially if non-zero.
3134 (Fbuffer_local_variables): Pass zero.
3135 (clone_per_buffer_values): Pass non-zero.
3136
3137 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3138
3139 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3140 to make the loop interruptible.
3141
3142 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3143
3144 * gnutls.c (emacs_gnutls_handshake): Only retry if
3145 GNUTLS_E_INTERRUPTED.
3146
3147 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3148
3149 Cleanup and convert miscellaneous checks to eassert.
3150 * alloc.c (mark_interval): Fix comment, partially rephrase
3151 old comment from intervals.h (see below).
3152 * intervals.c (find_interval, adjust_intervals_for_insertion)
3153 (delete_interval, adjust_intervals_for_deletion)
3154 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3155 Convert to eassert.
3156 (adjust_intervals_for_insertion, make_new_interval):
3157 Remove obsolete and unused code.
3158 * intervals.h (struct interval): Remove obsolete comment.
3159 * textprotp.c (erase_properties): Remove unused code.
3160 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3161 (Fremove_list_of_text_properties): Convert to eassert.
3162
3163 2012-07-17 Chong Yidong <cyd@gnu.org>
3164
3165 * editfns.c (Finsert_char): Doc fix.
3166
3167 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3168
3169 Fix previous change to make Fmemory_free always accurate.
3170 * alloc.c (make_interval): Update total_free_intervals.
3171 (make_float): Likewise for total_free_floats.
3172 (free_cons, Fcons): Likewise for total_free_conses.
3173 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3174 Likewise for total_free_vector_bytes.
3175 (Fmake_symbol): Likewise for total_free_symbols.
3176 (bytes_free): Remove.
3177
3178 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3179
3180 Simple free memory accounting feature.
3181 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3182 (sweep_vectors): Accumulate size of free vectors.
3183 (Fgarbage_collect): Setup bytes_free.
3184 (Fmemory_free): New function.
3185 (syms_of_alloc): Register it.
3186
3187 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3188
3189 Cleanup overlays checking.
3190 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3191 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3192 eassert and OVERLAYP.
3193 (sort_overlays): Change to use OVERLAYP.
3194
3195 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3196
3197 * editfns.c (Finsert_char): Make it interactive, and make the
3198 second arg optional. Copy interactive spec and docstring from
3199 ucs-insert.
3200
3201 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3202
3203 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3204 Unlike the other wrapped functions, fabs has an unspecified
3205 effect on errno.
3206
3207 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3208
3209 * nsterm.m (keyDown): Interpret flags without left/right bits
3210 as the left key (Bug#11670).
3211
3212 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3213
3214 Remove empty and useless init functions.
3215 * lisp.h (init_character_once, init_fns, init_image)
3216 (init_filelock, init_sound): Remove prototype.
3217 * character.c (init_character_once): Remove.
3218 * filelock.c (init_filelock): Likewise.
3219 * fns.c (init_fns): Likewise.
3220 * image.c (init_image): Likewise.
3221 * sound.c (init_sound): Likewise.
3222 * emacs.c (main): Adjust accordingly.
3223
3224 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3225
3226 * gtkutil.h: Tiny cleanups.
3227 (use_old_gtk_file_dialog): Remove useless declaration.
3228 (xg_uses_old_file_dialog): Add suggested const attribute.
3229
3230 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3231
3232 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3233 (bidi_paragraph_init): Use it to limit search forward for a strong
3234 directional character in abnormally large paragraphs full of
3235 neutral or weak characters. (Bug#11943)
3236
3237 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3238
3239 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3240 the toolbar (Bug#9451).
3241 (xg_make_tool_item): Give the widget event box a transparent
3242 background.
3243
3244 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3245
3246 Cleanup basic allocation variables and functions.
3247 * alloc.c (ignore_warnings, init_intervals, init_float)
3248 (init_cons, init_symbol, init_marker): Remove.
3249 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3250 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3251 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3252 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3253 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3254 (staticidx, init_alloc_once, init_strings, free_ablock):
3255 Remove redundant initialization.
3256 * fns.c (init_weak_hash_tables): Remove.
3257 * lisp.h (init_weak_hash_tables): Remove prototype.
3258
3259 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3260
3261 Use zero_vector where appropriate.
3262 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3263 accordingly.
3264 * lisp.h (zero_vector): New declaration.
3265 * font.c (null_vector): Remove.
3266 (syms_of_font): Remove initialization and staticpro.
3267 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3268 * keymap.c (Faccessible_keymaps): Likewise.
3269
3270 2012-07-15 Leo Liu <sdl.web@gmail.com>
3271
3272 * fringe.c: Fix typo in comments.
3273
3274 2012-07-14 Leo Liu <sdl.web@gmail.com>
3275
3276 * fringe.c: Add a new bitmap exclamation-mark.
3277
3278 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3279
3280 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3281
3282 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3283 (HAVE_MENUS): Don't define, defined by editing config.in with
3284 msdos/sed2v2.inp.
3285 (GMALLOC_INHIBIT_VALLOC): Don't define.
3286 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3287
3288 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3289
3290 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3291
3292 2012-07-14 Glenn Morris <rgm@gnu.org>
3293
3294 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3295 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3296 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3297
3298 2012-07-13 Glenn Morris <rgm@gnu.org>
3299
3300 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3301
3302 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3303 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3304
3305 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3306
3307 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3308 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3309 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3310 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3311 where appropriate.
3312 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3313 as boolean expression.
3314 (x_set_window_size): Remove unused variable toolbar.
3315 (ns_get_color_default, ns_mod_to_lisp): Remove.
3316 (ns_mouse_position): Remove unused variables xchar and ychar.
3317 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3318 (ns_set_vertical_scroll_bar): Remove unused variable count.
3319 (ns_delete_terminal): Remove unused variable i.
3320 (ns_term_init): Remove unused variables r, g and b.
3321 (mouseDown): Remove unused variable window.
3322 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3323 (initFrameFromEmacs): Remove unused variable vbextra.
3324 (mouseEntered): Remove unused variables p and dpyinfo.
3325 (mouseExited): Remove unused variables p and r.
3326 (ns_define_frame_cursor, ns_clear_frame_area)
3327 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3328 (menuDown): Assign [sender tag] to variable and cast the variable.
3329
3330 * nsterm.h (menuDown): Add id as type to argument sender.
3331 (ns_display_info_for_name): Add Lisp_Object argument.
3332 (ns_term_init): Add Lisp_Object argument.
3333 (ns_map_event_to_object): Add void argument.
3334 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3335 prototype with arguments and only declare if __OBJC__.
3336 (nxatoms_of_nsselect): Add void argument.
3337 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3338 (ns_alloc_autorelease_pool): Add void argument.
3339 (ns_release_autorelease_pool): Add void* argument.
3340 (ns_get_defaults_value): Add const char* argument.
3341
3342 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3343 (initFromContents): Use SSDATA where appropriate.
3344 (ns_update_menubar): Add braces to ambigous if-else.
3345 (initWithTitle): Put () around assignment in if statement.
3346 (ns_menu_show): Remove unused variables window and keymap.
3347 (update_frame_tool_bar): Remove unused variable selected_p.
3348 (initWithContentRect): Remove unused variable this_cmd_name.
3349
3350 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3351 appropriate.
3352 (setXBMColor): Remove unused variable len.
3353 (setPixmapData): Put () around assignment in loop statement.
3354
3355 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3356 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3357 where appropriate.
3358 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3359 around assignment in loop statement.
3360 (nsfont_open): Remove unused variable i.
3361 (nsfont_open): Remove unused variable len.
3362 (nsfont_draw): Remove unused variable cs.
3363
3364 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3365 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3366 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3367 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3368 (Fns_font_name, Fns_perform_service)
3369 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3370 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3371 (ns_set_name): Remove unused variable view.
3372 (x_set_menu_bar_lines): Remove unused variable olines.
3373 (x_set_tool_bar_lines): Remove unused variable root_window.
3374 (Fns_list_colors): Put () around assignment in while statement.
3375 (Fns_perform_service): Remove unused variable len.
3376 (Fns_display_usable_bounds): Remove unused variable top.
3377 (syms_of_nsfns): Remove unused variable i.
3378
3379 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3380 memcpy (Bug#11907).
3381
3382 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3383
3384 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3385 and free it with DestroyExceptionInfo (Bug#11558).
3386
3387 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3388
3389 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3390 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3391 Set here, not in nt/config.nt.
3392
3393 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3394
3395 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3396 cursor overflow into the last glyph on display line when the right
3397 fringe is off. (Bug#11832)
3398
3399 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3400
3401 * xdisp.c (produce_special_glyphs): Now static.
3402 * dispextern.h (produce_special_glyphs): Remove decl.
3403
3404 2012-07-13 Glenn Morris <rgm@gnu.org>
3405
3406 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3407 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3408
3409 * s/usg5-4-common.h (USG, USG5):
3410 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3411 * s/sol2-6.h (SOLARIS2):
3412 * s/irix6-5.h (IRIX6_5):
3413 * s/hpux10-20.h (USG, USG5, HPUX):
3414 * s/gnu-linux.h (USG, GNU_LINUX):
3415 * s/freebsd.h (BSD_SYSTEM):
3416 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3417 * s/cygwin.h (CYGWIN):
3418 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3419 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3420
3421 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3422
3423 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3424
3425 2012-07-13 Glenn Morris <rgm@gnu.org>
3426
3427 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3428
3429 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3430
3431 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3432 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3433
3434 2012-07-12 Glenn Morris <rgm@gnu.org>
3435
3436 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3437
3438 * process.c (init_process_emacs): Rename from init_process.
3439 The old name is also the name of a Mach system call.
3440 * lisp.h, emacs.c: Update for this name change.
3441 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3442 longer needed.
3443
3444 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3445
3446 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3447 memmove call that removes glyphs covered by the left truncation
3448 glyph. Improve commentary.
3449 (display_line): Fix display of continuation glyphs on GUI frames
3450 when the right fringe is turned off and variable-size fonts are
3451 used in the window. Move the code that appends a stretch glyph to
3452 produce_special_glyphs, so that it could be used for truncation
3453 and continuation glyphs alike.
3454 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3455 glyph of a suitably computed width, to align the special glyphs at
3456 the window margin. Code moved from display_line. (Bug#11832)
3457
3458 2012-07-12 Glenn Morris <rgm@gnu.org>
3459
3460 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3461
3462 * s/gnu-linux.h, s/hpux10-20.h:
3463 Do not unconditionally define HAVE_XRMSETDATABASE.
3464
3465 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3466
3467 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3468
3469 Fix typos that broke OS X build.
3470 Reported by Randal L. Schwartz in
3471 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3472 * nsterm.m (ns_timeout): Add missing local decl.
3473 (ns_get_color): snprintf -> sprintf, to fix typo.
3474
3475 2012-07-12 Glenn Morris <rgm@gnu.org>
3476
3477 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3478 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3479 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3480 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3481
3482 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3483 Move PTY_OPEN to configure.
3484
3485 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3486 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3487 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3488
3489 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3490
3491 Use empty_unibyte_string where applicable.
3492 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3493 * lread.c (read1): Likewise.
3494 * xsettings.c (syms_of_xsettings): Likewise.
3495
3496 2012-07-12 Glenn Morris <rgm@gnu.org>
3497
3498 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3499 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3500 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3501 * s/hpux10-20.h (RUN_TIME_REMAP):
3502 * s/bsd-common.h (TABDLY): Move to configure.
3503
3504 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3505
3506 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3507
3508 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3509 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3510
3511 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3512
3513 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3514 * s/template.h: Move NARROWPROTO to configure.
3515
3516 2012-07-11 Glenn Morris <rgm@gnu.org>
3517
3518 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3519 unused since 2011-01-17 change to systty.h.
3520
3521 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3522 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3523 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3524
3525 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3526
3527 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3528
3529 2012-07-11 Glenn Morris <rgm@gnu.org>
3530
3531 * s/darwin.h, s/gnu-linux.h, s/template.h:
3532 Move INTERRUPT_INPUT to configure.
3533
3534 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3535
3536 Minor adjustments to interning code.
3537 * lisp.h (intern, intern_c_string): Redefine as static inline
3538 wrappers for intern_1 and intern_c_string_1, respectively.
3539 (intern_1, intern_c_string_1): Rename prototypes.
3540 * lread.c (intern_1, intern_c_string_1, oblookup):
3541 Simplify Vobarray checking.
3542 * font.c (font_intern_prop): Likewise. Adjust comment.
3543 * w32font.c (intern_font_name): Likewise.
3544
3545 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3546
3547 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3548
3549 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3550 of Fcar/Fcdr if possible.
3551 * font.c (check_otf_features): Likewise.
3552 * fontset.c (Fnew_fontset): Likewise.
3553 * gnutls.c (Fgnutls_boot): Likewise.
3554 * minibuf.c (read_minibuf): Likewise.
3555 * msdos.c (IT_set_frame_parameters): Likewise.
3556 * xmenu.c (Fx_popup_dialog): Likewise.
3557 * w32menu.c (Fx_popup_dialog): Likewise.
3558
3559 2012-07-11 Glenn Morris <rgm@gnu.org>
3560
3561 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3562 since nothing has defined it on these platforms.
3563
3564 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3565 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3566
3567 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3568 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3569 Move CLASH_DETECTION to configure.
3570
3571 * s/gnu.h: Remove file, which is now empty.
3572
3573 * s/gnu.h, s/gnu-linux.h:
3574 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3575
3576 2012-07-11 John Wiegley <johnw@newartisans.com>
3577
3578 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3579 function attribute, so we only use it if it exists in the
3580 compiler.
3581
3582 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3583
3584 Avoid call to strlen in fast_c_string_match_ignore_case.
3585 * search.c (fast_c_string_match_ignore_case): Change to use
3586 length argument. Adjust users accordingly.
3587 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3588
3589 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3590
3591 Assume mkdir, rmdir.
3592 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3593 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3594
3595 Assume rename.
3596 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3597
3598 Assume perror.
3599 * s/hpux10-20.h (HAVE_PERROR): Remove.
3600 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3601 Remove dummy definition, as this problem was obsolete long ago.
3602
3603 Assume strerror.
3604 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3605
3606 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3607
3608 Avoid calls to strlen in font processing functions.
3609 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
3610 (font_open_by_name): Change to use length argument.
3611 Adjust users accordingly.
3612 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3613 Adjust prototypes.
3614 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3615 Change to return ptrdiff_t.
3616 (xfont_list_pattern, xfont_match): Use length returned by
3617 xfont_decode_coding_xlfd.
3618 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3619
3620 2012-07-11 Glenn Morris <rgm@gnu.org>
3621
3622 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3623 Move DONT_REOPEN_PTY to configure.
3624
3625 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3626 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3627
3628 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3629
3630 Remove "#define unix" that is no longer needed (Bug#11905).
3631 * s/aix4-2.h (unix): Remove; no longer needed.
3632
3633 EMACS_TIME simplification (Bug#11875).
3634 This replaces macros (which typically do not work in GDB)
3635 with functions, typedefs and enums, making the code easier to debug.
3636 The functional style also makes code easier to read and maintain.
3637 * systime.h: Include <sys/time.h> on all hosts, not just if
3638 WINDOWSNT, since 'struct timeval' is needed in general.
3639 (EMACS_TIME): Now a typedef, not a macro.
3640 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3641 not macros.
3642 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3643 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3644 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3645 (EMACS_TIME_LE): Now functions, not macros.
3646 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3647 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3648 which are not functions. All uses rewritten to use:
3649 (make_emacs_time): New function.
3650 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3651 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3652 not functions. All uses rewritten to use the following, respectively:
3653 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3654 (add_emacs_time, sub_emacs_time): New functions.
3655 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
3656 * fileio.c (Fcopy_file):
3657 * xterm.c (XTflash): Get the current time closer to when it's used.
3658 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3659
3660 * bytecode.c (targets): Suppress -Woverride-init warnings.
3661
3662 Simplify by avoiding confusing use of strncpy etc.
3663 * doc.c (Fsnarf_documentation):
3664 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3665 * frame.c (Fmake_terminal_frame):
3666 * gtkutil.c (get_utf8_string):
3667 * lread.c (openp):
3668 * nsmenu.m (ns_update_menubar):
3669 * regex.c (regerror):
3670 Prefer memcpy to strncpy and strncat when either will do.
3671 * fileio.c (Fsubstitute_in_file_name):
3672 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3673 (menu_separator_name_p):
3674 * nsmenu.m (ns_update_menubar):
3675 Prefer memcmp to strncmp when either will do.
3676 * nsterm.m: Include <ftoastr.h>.
3677 (ns_get_color):
3678 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3679 Prefer snprintf to strncpy.
3680 * nsterm.m (ns_term_init):
3681 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3682 * nsterm.m (ns_term_init):
3683 Avoid the need for strncpy, by using build_string or
3684 make_unibyte_string directly. Use dtoastr, not snprintf.
3685 * process.c (Fmake_network_process): Diagnose service names that
3686 are too long, rather than silently truncating them or creating
3687 non-null-terminated names.
3688 (Fnetwork_interface_info): Likewise, for interface names.
3689 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3690 Prefer sprintf to strncat.
3691 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3692 Prefer vsnprintf to vsprintf + strncpy.
3693
3694 2012-07-10 Glenn Morris <rgm@gnu.org>
3695
3696 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3697 Clarify fallback case.
3698
3699 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3700
3701 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3702 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3703 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
3704 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
3705 where argument type is known to be a Lisp_Cons.
3706
3707 2012-07-10 Tom Tromey <tromey@redhat.com>
3708
3709 * bytecode.c (BYTE_CODE_THREADED): New macro.
3710 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3711 (enum byte_code_op): New type.
3712 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3713 (exec_byte_code): Use them. Use token threading when applicable.
3714
3715 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3716
3717 Optimize pure C strings initialization.
3718 * lisp.h (make_pure_string): Fix prototype.
3719 (build_pure_c_string): New function, defined as static inline. This
3720 provides a better opportunity to optimize away calls to strlen when
3721 the function is called with compile-time constant argument.
3722 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
3723 argument, adjust users accordingly. Use build_pure_c_string where
3724 appropriate.
3725 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3726 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3727 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3728
3729 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3730
3731 Avoid calls to strlen in miscellaneous functions.
3732 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3733 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
3734 * lread.c (openp): Likewise.
3735
3736 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3737
3738 Avoid calls to strlen in path processing functions.
3739 * fileio.c (file_name_as_directory): Add comment. Change to add
3740 srclen argument and return the length of result. Adjust users
3741 accordingly.
3742 (directory_file_name): Fix comment. Change to add srclen argument,
3743 swap 1st and 2nd arguments to obey the common convention.
3744 Adjust users accordingly.
3745 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3746
3747 2012-07-10 Glenn Morris <rgm@gnu.org>
3748
3749 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3750 Move PENDING_OUTPUT_COUNT definition to configure.
3751
3752 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3753 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3754 * s/gnu.h (DATA_START): Move definitions to configure.
3755
3756 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3757 We include usg5-4-common.h, which defines them both.
3758
3759 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3760 O_RDONLY already includes it).
3761
3762 Stop ns builds setting the EMACSLOADPATH environment variable.
3763 * nsterm.m (ns_load_path): Rename from ns_init_paths.
3764 Now it does not set EMACSLOADPATH, just returns the load-path string.
3765 * nsterm.h: Update accordingly.
3766 * lread.c [HAVE_NS]: Include nsterm.h.
3767 (init_lread) [HAVE_NS]: Use ns_load_path.
3768 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3769
3770 2012-07-09 Glenn Morris <rgm@gnu.org>
3771
3772 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3773 since the included bsd-common.h does so.
3774
3775 Stop ns builds setting the EMACSPATH environment variable.
3776 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3777 (ns_init_paths): Do not set EMACSPATH.
3778 * nsterm.h (ns_exec_path): Add it.
3779 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3780 Use ns_exec_path.
3781
3782 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3783
3784 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3785
3786 * process.c (wait_reading_process_output): 'waitchannels' was unset
3787 when read_kbd || !NILP (wait_for_cell); fix this.
3788
3789 Add GCC-style 'const' attribute to functions that can use it.
3790 * character.h (char_resolve_modifier_mask):
3791 * keyboard.h (make_ctrl_char):
3792 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3793 (init_character_once, next_almost_prime, init_fns, init_image)
3794 (flush_pending_output, init_sound):
3795 * mem-limits.h (start_of_data):
3796 * menu.h (finish_menu_items):
3797 Add ATTRIBUTE_CONST.
3798 * emacs.c (DEFINE_DUMMY_FUNCTION):
3799 Declare the dummy function with ATTRIBUTE_CONST.
3800 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3801 Add decls with ATTRIBUTE_CONST.
3802
3803 Minor improvements to make_formatted_string.
3804 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3805 where int is good enough, as vsprintf returns an int.
3806 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3807
3808 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3809
3810 Use make_formatted_string to avoid double length calculation.
3811 * lisp.h (make_formatted_string): New prototype.
3812 * alloc.c (make_formatted_string): New function.
3813 * buffer.c (Fgenerate_new_buffer_name): Use it.
3814 * dbus.c (syms_of_dbusbind): Likewise.
3815 * editfns.c (Fcurrent_time_zone): Likewise.
3816 * filelock.c (get_boot_time): Likewise.
3817 * frame.c (make_terminal_frame, set_term_frame_name)
3818 (x_report_frame_params): Likewise.
3819 * image.c (gs_load): Likewise.
3820 * minibuf.c (get_minibuffer): Likewise.
3821 * msdos.c (dos_set_window_size): Likewise.
3822 * process.c (make_process): Likewise.
3823 * xdisp.c (ensure_echo_area_buffers): Likewise.
3824 * xsettings.c (apply_xft_settings): Likewise.
3825
3826 2012-07-09 Glenn Morris <rgm@gnu.org>
3827
3828 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3829 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3830 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3831 * nsterm.h (ns_etc_directory): Add it.
3832 * callproc.c [HAVE_NS]: Include nsterm.h.
3833 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3834
3835 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3836
3837 Move marker debugging code under MARKER_DEBUG.
3838 * marker.c (MARKER_DEBUG): Move marker debugging code under
3839 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3840 for bootstrap with --enable-checking (~3x slowdown reported
3841 by Juanma Barranquero <lekktu@gmail.com>).
3842 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3843
3844 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3845
3846 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3847 See <http://bugs.gnu.org/11825#29>.
3848
3849 2012-07-08 Eli Zaretskii <eliz@gnu.org>
3850
3851 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3852 has no font, use the frame's font. (Bug#11813)
3853 (display_line): Add commentary about displaying truncation glyphs
3854 on GUI frames.
3855 (produce_special_glyphs): Move here from term.c.
3856
3857 * term.c (produce_special_glyphs): Move to xdisp.c.
3858
3859 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3860 section.
3861
3862 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3863
3864 * xdisp.c (display_line): Avoid warning about implicit declaration
3865 of FRAME_FONT.
3866
3867 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3868
3869 * lisp.h: Remove empty conditional.
3870
3871 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3872
3873 * lread.c (load_path_check): Now static.
3874
3875 Fix some minor --with-ns problems found by static checking.
3876 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3877 (x_set_font) [!HAVE_X_WINDOWS]:
3878 * image.c (xpm_load_image) [HAVE_NS]:
3879 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3880 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3881 Remove unused local.
3882 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3883 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3884 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3885 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3886 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3887 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3888 Fix pointer signedness problem.
3889 * xfaces.c (FRAME_X_FONT_TABLE):
3890 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3891
3892 2012-07-07 Glenn Morris <rgm@gnu.org>
3893
3894 * lread.c (load_path_check): New function, split from init_lread.
3895 (init_lread): Reorganize. Motivation:
3896 If EMACSLOADPATH is set, check/warn about that rather than the
3897 defaults, which we are not going to use. Hence we can remove
3898 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3899 Don't warn if site-lisp directories are missing.
3900 If not installed, start from a blank load-path, since
3901 PATH_LOADSEARCH refers to the eventual installation directories.
3902
3903 2012-07-07 Eli Zaretskii <eliz@gnu.org>
3904
3905 Support truncation and continuation glyphs on GUI frames, when
3906 fringes are disabled. (Bug#11832)
3907 * xdisp.c (init_iterator): Get dimensions of truncation and
3908 continuation glyphs even if on GUI frames.
3909 Adjust it->last_visible_x on GUI frames when the left or right fringes,
3910 or both, are absent.
3911 (start_display, move_it_in_display_line_to): Handle the case of a
3912 GUI frame without a fringe to display continuation or truncation
3913 glyphs.
3914 (insert_left_trunc_glyphs): Support GUI frames: make sure
3915 truncation glyphs overwrite enough glyphs from the current line to
3916 have sufficient space in pixels.
3917 (display_line): Support truncation and continuation glyphs on GUI
3918 frames. If some spare pixels are left on the line after inserting
3919 the truncation glyphs, fill that space with a stretch glyph of a
3920 suitably computed width.
3921
3922 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3923 produce_glyphs, to support GUI sessions.
3924
3925 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3926
3927 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3928
3929 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3930
3931 Do not require float-time's arg to fit in time_t (Bug#11825).
3932 This works better on hosts where time_t is unsigned, and where
3933 float-time is applied to the (negative) difference between two times.
3934 * editfns.c (decode_time_components): Last arg is now double *,
3935 not int *, and means to store all the result as a double, without
3936 worrying about whether the seconds part fits in time_t.
3937 All callers changed.
3938 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3939 All callers changed.
3940 (Ffloat_time): Do not fail merely because the specified time falls
3941 outside of time_t range.
3942
3943 2012-07-07 Glenn Morris <rgm@gnu.org>
3944
3945 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3946 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3947 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3948
3949 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
3950
3951 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3952 Update dependencies.
3953
3954 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3955
3956 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3957
3958 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3959 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3960 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3961 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3962 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3963 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3964
3965 * xfont.c (compare_font_names): Redo to omit the need for casts.
3966
3967 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3968
3969 * xfns.c (Fx_change_window_property): Doc fix.
3970 * w32fns.c (Fx_change_window_property): Doc fix.
3971
3972 * w32fns.c (Fx_window_property): Accept the same arguments as the
3973 X Windows version. Doc fix.
3974 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3975
3976 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
3977 Eli Zaretskii <eliz@gnu.org>
3978
3979 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3980 Windows-specific code from nt/config.nt moved here.
3981 Obsolete settings removed.
3982
3983 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3984
3985 * process.c: Avoid unnecessary calls to gettime.
3986 (wait_reading_process_output): Don't get the time of day
3987 when gobbling data immediately and not waiting, as there's no need
3988 for it in that case. This removes a FIXME.
3989
3990 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3991
3992 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3993 is defined (Bug#11768).
3994
3995 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3996
3997 Fix marker debugging code.
3998 * marker.c (byte_char_debug_check): Do not perform the check
3999 if buffer is not multibyte.
4000 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4001 Call byte_char_debug_check with correct arguments.
4002
4003 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4004
4005 Compile marker debugging code only if ENABLE_CHECKING is defined.
4006 * marker.c (byte_char_debug_check, count_markers):
4007 Use only if ENABLE_CHECKING is defined.
4008 (byte_debug_flag): Remove.
4009 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4010 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4011
4012 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4013
4014 Avoid code repetition in marker-related functions.
4015 * marker.c (attach_marker): New function.
4016 (Fset_marker, set_marker_restricted, set_marker_both)
4017 (set_marker_restricted_both): Use it.
4018 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4019 Consistently rename charno to charpos.
4020 (marker_position): Add eassert.
4021 (marker_byte_position): Convert to eassert.
4022
4023 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4024
4025 Simplify list operations in unchain_overlay and unchain_marker.
4026 * buffer.c (unchain_overlay): Simplify. Add comment.
4027 * marker.c (unchain_marker): Simplify. Fix comments.
4028
4029 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4030
4031 Introduce fast path for the widely used marker operation.
4032 * alloc.c (build_marker): New function.
4033 * lisp.h (build_marker): New prototype.
4034 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4035 * composite.c (autocmp_chars): Likewise.
4036 * editfns.c (buildmark): Remove.
4037 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4038 (save_restriction_save): Use build_marker.
4039 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4040 * window.c (save_window_save): Likewise.
4041
4042 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4043
4044 Do not use Fdelete_overlay in delete_all_overlays
4045 to avoid redundant calls to unchain_overlay.
4046 * buffer.c (drop_overlay): New function.
4047 (delete_all_overlays, Fdelete_overlay): Use it.
4048 * minibuf.c (get_minibuffer): Fix comment.
4049
4050 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4051
4052 Port to OpenBSD 5.1 amd64.
4053 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4054 This is needed for OpenBSD, and should be harmless on all BSD systems.
4055 Also, include <sys/sysctl.h>, as it should be available on all
4056 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4057 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4058 use p_pid member, not kp_proc.pid.
4059
4060 2012-07-06 Glenn Morris <rgm@gnu.org>
4061
4062 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4063
4064 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4065
4066 More xmalloc and related cleanup.
4067 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4068 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4069 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4070 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4071 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4072 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4073 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4074 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4075 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4076 * xterm.c:
4077 Omit needless casts involving void * pointers and allocation.
4078 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4079 as the former is more robust if P's type is changed.
4080 Prefer xzalloc to xmalloc + memset 0.
4081 Simplify malloc-or-realloc to realloc.
4082 Don't worry about xmalloc returning a null pointer.
4083 Prefer xstrdup to xmalloc + strcpy.
4084 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4085 growing it.
4086 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4087 alloca of a constant.
4088
4089 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4090
4091 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4092 hscroll is larger than the line width. Fixes long and futile
4093 looping inside extend_face_to_end_of_line (on a TTY) producing
4094 glyphs that are not needed and thrown away.
4095
4096 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4097
4098 * marker.c (set_marker_restricted_both): Simplify by using
4099 clip_to_bounds.
4100
4101 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4102
4103 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4104
4105 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4106
4107 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4108 not defined (Bug#11768).
4109 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4110 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4111 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4112 followed by gtk_box_set_homogeneous (Bug#11768).
4113 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4114 (update_theme_scrollbar_width, xg_create_scroll_bar):
4115 Use gtk_scrollbar_new (Bug#11768).
4116 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4117 (is_box_type): New function (Bug#11768).
4118 (xg_tool_item_stale_p): Call is_box_type.
4119 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4120 with default display (Bug#11768).
4121
4122 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4123
4124 * xdisp.c (window_hscroll_limited): New function.
4125 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4126 coordinates when window's hscroll is set to insanely large
4127 values. (Bug#11857)
4128
4129 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4130
4131 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4132 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4133
4134 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4135
4136 Cleanup xmalloc.
4137 * lisp.h (xzalloc): New prototype. Omit needless casts.
4138 * alloc.c (xzalloc): New function. Omit needless casts.
4139 * charset.c: Omit needless casts. Convert all calls to
4140 xmalloc with following memset to xzalloc.
4141 * dispnew.c: Likewise.
4142 * fringe.c: Likewise.
4143 * image.c: Likewise.
4144 * sound.c: Likewise.
4145 * term.c: Likewise.
4146 * w32fns.c: Likewise.
4147 * w32font.c: Likewise.
4148 * w32term.c: Likewise.
4149 * xfaces.c: Likewise.
4150 * xfns.c: Likewise.
4151 * xterm.c: Likewise.
4152 * atimer.c: Omit needless casts.
4153 * buffer.c: Likewise.
4154 * callproc.c: Likewise.
4155 * ccl.c: Likewise.
4156 * coding.c: Likewise.
4157 * composite.c: Likewise.
4158 * doc.c: Likewise.
4159 * doprnt.c: Likewise.
4160 * editfns.c: Likewise.
4161 * emacs.c: Likewise.
4162 * eval.c: Likewise.
4163 * filelock.c: Likewise.
4164 * fns.c: Likewise.
4165 * gtkutil.c: Likewise.
4166 * keyboard.c: Likewise.
4167 * lisp.h: Likewise.
4168 * lread.c: Likewise.
4169 * minibuf.c: Likewise.
4170 * msdos.c: Likewise.
4171 * print.c: Likewise.
4172 * process.c: Likewise.
4173 * region-cache.c: Likewise.
4174 * search.c: Likewise.
4175 * sysdep.c: Likewise.
4176 * termcap.c: Likewise.
4177 * terminal.c: Likewise.
4178 * tparam.c: Likewise.
4179 * w16select.c: Likewise.
4180 * w32.c: Likewise.
4181 * w32reg.c: Likewise.
4182 * w32select.c: Likewise.
4183 * w32uniscribe.c: Likewise.
4184 * widget.c: Likewise.
4185 * xdisp.c: Likewise.
4186 * xmenu.c: Likewise.
4187 * xrdb.c: Likewise.
4188 * xselect.c: Likewise.
4189
4190 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4191
4192 * fileio.c (time_error_value): Check the right error number.
4193 Problem reported by Troels Nielsen in
4194 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4195
4196 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4197
4198 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4199 This should be fixed in a better way; see Eli Zaretskii in
4200 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4201 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4202
4203 * fileio.c (time_error_value): Rename from special_mtime.
4204 The old name's problems were noted by Eli Zaretskii in
4205 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4206
4207 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4208 This variable's comment says Emacs needs at least one GDB-visible
4209 symbol of type enum pvec_type, to work around GDB problems.
4210 The symbol's value doesn't matter.
4211
4212 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4213 that causes compilation to fail on pre-C99 compilers.
4214
4215 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4216
4217 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4218 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4219
4220 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4221
4222 * buffer.c (init_buffer_once): Fix initialization of
4223 headers for buffer_defaults and buffer_local_symbols.
4224 Reported by Juanma Barranquero <lekktu@gmail.com>.
4225
4226 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4227
4228 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4229 * lisp.h (enum pvec_type): Use fewer bits.
4230 (PSEUDOVECTOR_SIZE_BITS): New constant.
4231 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4232 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4233 change in pvec_type.
4234 (PSEUDOVECTOR_TYPEP): New macro.
4235 (TYPED_PSEUDOVECTORP): Use it.
4236 * fns.c (internal_equal): Adapt code to extract pvectype.
4237 * emacs.c (gdb_pvec_type): Update type.
4238 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4239 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4240 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4241 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4242 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4243 abusing vector->header.next.nbytes.
4244 (live_vector_p): Use PVEC_TYPE.
4245 (mark_object): Adapt code to extract pvectype. Use switch.
4246
4247 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4248
4249 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4250 Tighten new eassert a bit.
4251
4252 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4253
4254 Fix compilation with --enable-gcc-warnings and -O1
4255 optimization level.
4256 * doprnt.c (doprnt): Change type of tem to int, initialize
4257 to avoid compiler warning. Add eassert.
4258 * search.c (simple_search): Initialize match_byte to avoid
4259 compiler warning. Add eassert.
4260
4261 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4262
4263 Avoid weird behavior with large horizontal scrolls.
4264 Without this change, for example, large hscroll values would
4265 mess up Emacs's display on Fedora 15 x86, presumably due to
4266 overflows in int calculations in the display code.
4267 Also, if buffers had long lines, Emacs would freeze.
4268 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4269 (set_window_hscroll): New function, containing the old guts of
4270 Fset_window_hscroll. Return the clipped value.
4271 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4272 This avoids the need to check against PTRDIFF_MAX.
4273
4274 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4275
4276 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4277
4278 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4279
4280 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4281
4282 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4283 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4284 since GCC 4.4.6 issues a bogus warning for them.
4285
4286 Fix bugs in file timestamp newness comparisons.
4287 * fileio.c (Ffile_newer_than_file_p):
4288 * lread.c (Fload): Use full timestamp resolution of files,
4289 not just the 1-second resolution, so that files that are only
4290 slightly newer still count as newer.
4291 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4292 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4293
4294 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4295
4296 * fileio.c: Improve handling of file time marker. (Bug#11852)
4297 (special_mtime): New function.
4298 (Finsert_file_contents, Fverify_visited_file_modtime):
4299 Use it to set special mtime values consistently.
4300
4301 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4302
4303 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4304 marker for non-existing file. (Bug#11852)
4305
4306 2012-07-03 Glenn Morris <rgm@gnu.org>
4307
4308 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4309 and did not make it into globals.h).
4310
4311 2012-07-03 Tom Tromey <tromey@redhat.com>
4312
4313 * window.c (Fset_window_margins, Fset_window_fringes)
4314 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4315 * textprop.c (Fprevious_property_change): No longer static.
4316 * syntax.c (Fsyntax_table_p): No longer static.
4317 * process.c (Fget_process, Fprocess_datagram_address): No longer
4318 static.
4319 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4320 * keyboard.c (Fcommand_execute): No longer static.
4321 Remove EXFUN.
4322 * insdel.c (Fcombine_after_change_execute): No longer static.
4323 * image.c (Finit_image_library): No longer static.
4324 * fileio.c (Fmake_symbolic_link): No longer static.
4325 * eval.c (Ffetch_bytecode): No longer static.
4326 * editfns.c (Fuser_full_name): No longer static.
4327 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4328 No longer static.
4329 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4330 static.
4331 * dired.c (Ffile_attributes): No longer static.
4332 * composite.c (Fcomposition_get_gstring): No longer static.
4333 * callproc.c (Fgetenv_internal): No longer static.
4334
4335 * ccl.h: Remove EXFUNs.
4336 * buffer.h: Remove EXFUNs.
4337 * dispextern.h: Remove EXFUNs.
4338 * intervals.h: Remove EXFUNs.
4339 * fontset.h: Remove EXFUN.
4340 * font.h: Remove EXFUNs.
4341 * dosfns.c (system_process_attributes): Remove EXFUN.
4342 * keymap.h: Remove EXFUNs.
4343 * lisp.h: Remove EXFUNs.
4344 * w32term.h: Remove EXFUNs.
4345 * window.h: Remove EXFUNs.
4346 * xsettings.h: Remove EXFUN.
4347 * xterm.h: Remove EXFUN.
4348
4349 2012-07-03 Glenn Morris <rgm@gnu.org>
4350
4351 * lisp.h (Frandom): Make it visible to C.
4352 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4353 buffer for invisible buffers. (Bug#1229)
4354
4355 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4356
4357 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4358 values which aren't power of 2.
4359 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4360 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4361 accordingly.
4362
4363 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4364
4365 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4366
4367 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4368
4369 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4370
4371 * alloc.c (allocate_vector_block): Remove redundant
4372 calls to mallopt if DOUG_LEA_MALLOC is defined.
4373 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4374 avoid calls to mallopt if zero_vector is returned.
4375
4376 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4377
4378 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4379 is enabled, avoid dereferencing NULL current_sblock if
4380 running undumped.
4381
4382 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4383
4384 Cleanup basic buffer management.
4385 * buffer.h (struct buffer): Change layout to use generic vector
4386 marking code. Fix some comments. Change type of 'clip_changed'
4387 to bitfield. Remove unused #ifndef old.
4388 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4389 (GET_OVERLAYS_AT): Fix indentation.
4390 (for_each_per_buffer_object_at): New macro.
4391 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4392 (Fbuffer_local_variables): Use it.
4393 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4394 * alloc.c (allocate_buffer): Adjust to match new layout of
4395 struct buffer. Fix comment.
4396 (mark_overlay): New function.
4397 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4398 Lisp area of struct buffer.
4399 (mark_object): Use it. Adjust marking of misc objects
4400 and related comments.
4401
4402 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4403
4404 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4405 wrapper that is not needed because the wrapped code is a no-op (zero
4406 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4407 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4408
4409 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4410
4411 * alloc.c (mark_buffer): Simplify. Remove prototype.
4412 (mark_object): Add comment. Reorganize marking of vector-like
4413 objects. Use CHECK_LIVE for all vector-like objects except buffers
4414 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4415 Avoid redundant calls to mark_vectorlike for bool vectors.
4416
4417 2012-06-30 Glenn Morris <rgm@gnu.org>
4418
4419 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4420
4421 * epaths.in (PATH_SITELOADSEARCH): New.
4422 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4423 This is rather than relying on --enable-locallisppath elements
4424 having "site-lisp" in their names. (Bug#10208#25, 11658)
4425
4426 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4427
4428 * w32proc.c (sys_select): Accept and ignore one more argument.
4429
4430 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4431
4432 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4433 (pselect) [!MS_DOS]: Redirect to sys_select.
4434
4435 * sysdep.c: Don't include dos.h and dosfns.h.
4436
4437 * process.c (sys_select):
4438 * msdos.c (sys_select): Accept one more argument and ignore it.
4439
4440 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4441 adapt data types and code to that.
4442
4443 * dosfns.c:
4444 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4445 which clashes with the gnulib function of the same name.
4446
4447 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4448
4449 * font.c (font_style_to_value, font_style_symbolic)
4450 (font_prop_validate_style): Add type checks for values in
4451 font_style_table.
4452
4453 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4454 argument.
4455 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4456 uses.
4457
4458 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4459
4460 * xdisp.c (try_window_id): Undo last change.
4461
4462 * w32.c (getwd): Adjust commentary about startup_dir.
4463 (init_environment): Always call sys_access, even in non-MSVC
4464 builds. Don't chdir to the directory of the Emacs executable.
4465 This undoes code from 1997 which was justified by the need to
4466 "avoid conflicts when removing and renaming directories". But its
4467 downside was that every relative file name was being interpreted
4468 relative to the directory of the Emacs executable, which can never
4469 be TRT. In particular, it broke sys_access when called with
4470 relative file names.
4471 (sys_access): Map GetLastError to errno.
4472
4473 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4474
4475 * window.h (struct window): Change type of 'fringes_outside_margins'
4476 to bitfield. Fix comment. Adjust users accordingly.
4477 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4478 Adjust comment.
4479 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4480 to ptrdiff_t.
4481
4482 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4483
4484 * gnutls.c (emacs_gnutls_handshake):
4485 Add QUIT to make the loop interruptible.
4486
4487 2012-06-29 Glenn Morris <rgm@gnu.org>
4488
4489 * charset.c (init_charset): Make lack of etc/charsets fatal.
4490
4491 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4492
4493 * editfns.c (region_limit): Fix type mismatch.
4494
4495 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4496
4497 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4498 undefined. Convert from xassert to eassert.
4499 * nsmenu.m: Convert from xassert to eassert.
4500 * nsterm.m: Likewise.
4501
4502 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4503
4504 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4505
4506 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4507
4508 Avoid integer overflow on scroll-left and scroll-right.
4509 * window.c (HSCROLL_MAX): New macro.
4510 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4511 overflow when requested scroll falls outside ptrdiff_t range.
4512
4513 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4514
4515 * window.h (struct window): Change type of 'hscroll',
4516 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4517 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4518 Adjust users accordingly.
4519 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4520 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4521 from EMACS_INT to ptrdiff_t.
4522 (make_window): Omit redundant initialization.
4523
4524 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4525
4526 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4527
4528 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4529
4530 * window.h (struct window): Change type of 'use_time' and
4531 'sequence_number' from Lisp_Object to int.
4532 * frame.c (make_frame): Adjust users accordingly.
4533 * print.c (print_object): Likewise.
4534 * window.c (select_window, Fwindow_use_time, make_parent_window)
4535 (make_window): Likewise.
4536
4537 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4538
4539 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4540 enabled with --enable-checking=[all,glyphs] configure option.
4541 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4542 adjust comments accordingly.
4543 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4544 undefined, adjust comments accordingly.
4545 * image.c: Likewise.
4546 * scroll.c: Likewise.
4547 * w32fns.c: Likewise.
4548 * w32term.c: Likewise.
4549 * xdisp.c: Likewise.
4550 * xfaces.c: Likewise.
4551 * xfns.c: Likewise.
4552 * xterm.c: Likewise.
4553
4554 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4555
4556 Generalize run-time debugging checks.
4557 * dispextern.h (XASSERTS): Remove.
4558 * fontset.c (xassert): Remove.
4559 Convert from xassert to eassert.
4560 * alloc.c: Convert from xassert to eassert.
4561 * bidi.c: Likewise.
4562 * dispnew.c: Likewise.
4563 * fns.c: Likewise.
4564 * fringe.c: Likewise.
4565 * ftfont.c: Likewise.
4566 * gtkutil.c: Likewise.
4567 * image.c: Likewise.
4568 * keyboard.c: Likewise.
4569 * menu.c: Likewise.
4570 * process.c: Likewise.
4571 * scroll.c: Likewise.
4572 * sound.c: Likewise.
4573 * term.c: Likewise.
4574 * w32console.c: Likewise.
4575 * w32fns.c: Likewise.
4576 * w32term.c: Likewise.
4577 * window.c: Likewise.
4578 * xdisp.c: Likewise.
4579 * xfaces.c: Likewise.
4580 * xfns.c: Likewise.
4581 * xselect.c: Likewise.
4582 * xterm.c: Likewise.
4583
4584 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4585
4586 * fns.c (maybe_resize_hash_table): Output message when growing the
4587 purify-hashtable.
4588
4589 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4590
4591 * alloc.c (allocate_string_data): Remove dead code.
4592 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4593 avoid GCC warning about unused macro.
4594
4595 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4596
4597 * alloc.c (allocate_string): Omit intervals initialization.
4598 * alloc.c (make_uninit_multibyte_string): Initialize intervals
4599 as in make_pure_string and make_pure_c_string.
4600
4601 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4602
4603 * alloc.c (allocate_string): Fix last change.
4604
4605 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4606
4607 * alloc.c (allocate_string): Remove two redundant calls
4608 to memset, add explicit initialization where appropriate.
4609
4610 2012-06-27 Glenn Morris <rgm@gnu.org>
4611
4612 * lisp.mk (lisp): Remove paths.elc.
4613
4614 2012-06-27 Chong Yidong <cyd@gnu.org>
4615
4616 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4617
4618 2012-06-26 John Wiegley <johnw@newartisans.com>
4619
4620 * unexmacosx.c (copy_data_segment): Add two section names used
4621 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4622
4623 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4624 when building with Clang.
4625
4626 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4627
4628 * eval.c (Fapply): Allow calling it with a single argument.
4629
4630 2012-06-26 Eli Zaretskii <eliz@gnu.org>
4631
4632 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4633 _stricmp and _strnicmp.
4634 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4635
4636 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4637
4638 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4639 allocated window.
4640 (allocate_process): Likewise for new process.
4641 (allocate_terminal): Change to use offsetof.
4642 (allocate_frame): Likewise.
4643 * frame.c (make_frame): Omit redundant initialization.
4644 * window.c (make_parent_window): Use memset.
4645 (make_window): Omit redundant initialization.
4646 * process.c (make_process): Omit redundant initialization.
4647 * terminal.c (create_terminal): Likewise.
4648
4649 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4650
4651 * term.c (delete_tty): Remove redundant call to memset.
4652
4653 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4654
4655 * alloc.c: Remove build_string.
4656 * lisp.h: Define build_string as static inline. This provides
4657 a better opportunity to optimize away calls to strlen when the
4658 function is called with compile-time constant argument.
4659 * image.c (imagemagick_error): Convert to build_string.
4660 * w32proc.c (sys_spawnve): Likewise.
4661 * xterm.c (x_term_init): Likewise.
4662
4663 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4664
4665 Use sprintf return value instead of invoking strlen on result.
4666 In the old days this wasn't portable, since some sprintf
4667 implementations returned char *. But they died out years ago and
4668 Emacs already assumes sprintf returns int.
4669 Similarly for float_to_string.
4670 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4671 * ccl.c (ccl_driver):
4672 * character.c (string_escape_byte8):
4673 * data.c (Fnumber_to_string):
4674 * doprnt.c (doprnt):
4675 * print.c (print_object):
4676 * xdisp.c (message_dolog):
4677 * xfns.c (syms_of_xfns):
4678 Use sprintf or float_to_string result to avoid need to call strlen.
4679 * data.c (Fnumber_to_string):
4680 Use make_unibyte_string, since the string must be ASCII.
4681 * lisp.h, print.c (float_to_string): Now returns int length.
4682 * term.c (produce_glyphless_glyph):
4683 Use sprintf result rather than recomputing it.
4684
4685 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4686 * Makefile.in (ALL_CFLAGS):
4687 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4688 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4689
4690 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4691
4692 * dispextern.h (xstrcasecmp): Define to library function
4693 strcasecmp if available.
4694 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4695
4696 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4697
4698 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4699 Avoid comma operator.
4700 * menu.c (push_submenu_start, push_submenu_end)
4701 (push_left_right_boundary, push_menu_pane): Likewise.
4702 * msdos.c (dos_rawgetc): Likewise.
4703
4704 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4705
4706 * xfns.c (xic_create_fontsetname): Remove redundant calls
4707 to memset.
4708
4709 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4710
4711 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4712 sprintf already null-terminates its output.
4713
4714 * xfns.c (x_window): Remove redundant cast.
4715
4716 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4717
4718 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4719 `const char *' to `char *' to avoid compiler warning.
4720
4721 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4722
4723 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4724 instead of truncating it to 63 (admittedly a generous limit).
4725
4726 * process.c: Fix spelling and caps in comments.
4727
4728 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4729
4730 * emacs.c (setpgrp): Remove definition, unused.
4731 * sysdep.c (setpgrp): Remove definition, not used in this file.
4732
4733 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
4734
4735 * makefile.w32-in: Update dependencies.
4736
4737 2012-06-24 Eli Zaretskii <eliz@gnu.org>
4738
4739 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4740 (SYSTIME_H): Add nt/inc/sys/time.h.
4741
4742 * systime.h [WINDOWSNT]: Include sys/time.h.
4743
4744 * s/ms-w32.h (struct timespec): Definition moved from
4745 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4746
4747 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4748
4749 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4750 * buffer.h (buffer_slot_type_mismatch):
4751 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4752 * eval.c (unwind_to_catch):
4753 * image.c (my_png_error, my_error_exit):
4754 * keyboard.c (quit_throw_to_read_char, user_error)
4755 (Fexit_recursive_edit, Fabort_recursive_edit):
4756 * lisp.h (die, args_out_of_range, args_out_of_range_3)
4757 (wrong_type_argument, buffer_overflow, __executable_start)
4758 (memory_full, buffer_memory_full, string_overflow, Fthrow)
4759 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4760 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4761 (fatal):
4762 (child_setup) [!DOS_NT]:
4763 * lread.c (end_of_file_error, invalid_syntax):
4764 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4765 * puresize.h (pure_write_error):
4766 * search.c (matcher_overflow):
4767 * sound.c (sound_perror, alsa_sound_perror):
4768 * sysdep.c, syssignal.h (croak):
4769 * term.c (maybe_fatal, vfatal):
4770 * textprop.c (text_read_only):
4771 * undo.c (user_error):
4772 * unexmacosx.c (unexec_error):
4773 * xterm.c (x_ins_del_lines, x_delete_glyphs):
4774 Use _Noreturn rather than NO_RETURN.
4775 No need for separate decl merely because of _Noreturn.
4776 * sound.c (sound_warning, parse_sound):
4777 Remove unnecessary forward decls.
4778
4779 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4780
4781 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4782 * lisp.h (WAIT_READING_MAX): New macro.
4783 * dispnew.c (Fsleep_for, sit_for):
4784 * keyboard.c (kbd_buffer_get_event):
4785 * process.c (Faccept_process_output):
4786 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4787 This improves on the previous patch, which introduced a bug
4788 when time_t is unsigned and as wide as intmax_t.
4789 See <http://bugs.gnu.org/9000#51>.
4790
4791 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4792
4793 * dispnew.c (sit_for, Fsleep_for):
4794 * keyboard.c (kbd_buffer_get_event):
4795 * process.c (Faccept_process_output): Avoid compiler warnings when
4796 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4797
4798 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
4799
4800 * makefile.w32-in: Update dependencies.
4801
4802 * w32.c (ltime): Add return type and declare static.
4803 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4804
4805 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4806
4807 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4808 Privately reported by Herbert J. Skuhra.
4809 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4810 All uses changed.
4811 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4812 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4813
4814 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4815
4816 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4817 last argument of make_unibyte_string.
4818
4819 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4820 language ID in the event parameters.
4821
4822 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4823 event.code, not the obscure "character set ID".
4824
4825 2012-06-23 Chong Yidong <cyd@gnu.org>
4826
4827 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4828
4829 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4830
4831 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4832 * w32.c (fdutimens): New function.
4833
4834 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4835
4836 * s/ms-w32.h (pselect): Redirect to sys_select.
4837
4838 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4839
4840 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4841 in the logic of incrementing and decrementing the value of
4842 use_relocatable_buffers.
4843
4844 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4845
4846 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4847 Privately reported by Herbert J. Skuhra.
4848 [__FreeBSD__]: Remove "*/" typo after "#include".
4849 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4850 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4851 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4852 Don't assume EMACS_TIME and struct timeval are the same type.
4853
4854 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4855
4856 Support higher-resolution time stamps (Bug#9000).
4857 The time stamps are only nanosecond-resolution at the C level,
4858 since that's the best that any real-world system supports now.
4859 But they are picosecond-resolution at the Lisp level, as that's
4860 easy, and leaves room for future OS improvements.
4861
4862 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4863 (LIBES): Use it.
4864
4865 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4866 Don't get current time unless it's needed.
4867
4868 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4869 now provides it if it's absent.
4870 (start_atimer): Port to higher-res time stamps.
4871 Check for time stamp overflow. Don't get current time more
4872 often than is needed.
4873
4874 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4875 Include systime.h, not time.h.
4876 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4877
4878 * dired.c: Include stat-time.h.
4879 (Ffile-attributes): File times now have higher resolution.
4880
4881 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4882 (struct image): Timestamp now has higher resolution.
4883
4884 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4885 has at least microseconds now. All uses removed.
4886 (update_frame, update_single_window, update_window, update_frame_1)
4887 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
4888 (duration_to_sec_usec): Remove; no longer needed.
4889
4890 * editfns.c (time_overflow): Now extern.
4891 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4892 (float-time, Fformat_time_string, Fcurrent_time_string)
4893 (Fcurrent_time_zone): Accept and generate higher-resolution
4894 time stamps.
4895 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4896 (decode_time_components, lisp_seconds_argument): New functions.
4897 (make_time): Now static.
4898 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4899 Report an error if the time is invalid, rather than having the caller
4900 do that.
4901
4902 * fileio.c: Include <stat-time.h>
4903 (Fcopy_file): Copy higher-resolution time stamps.
4904 Prefer to set the time stamp via a file descriptor if that works.
4905 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4906 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4907 (Fvisited_file_modtime, Fset_visited_file_modtime):
4908 Support higher-resolution time stamps.
4909
4910 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4911
4912 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4913
4914 * image.c (prepare_image_for_display, clear_image_cache)
4915 (lookup_image): Port to higer-resolution time stamps.
4916
4917 * keyboard.c (start_polling, bind_polling_period):
4918 Check for time stamp overflow.
4919 (read_char, kbd_buffer_get_event, timer_start_idle)
4920 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4921 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4922 Port to higher-resolution time stamps. Do not assume time_t is signed.
4923 (decode_timer): New function. Timers are now vectors of length 9,
4924 not 8, to accommodate the picosecond component.
4925 (timer_check_2): Use it.
4926
4927 * nsterm.m (select_timeout, timeval_subtract): Remove.
4928 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4929 as they're a bit more accurate and handle overflow better.
4930 (ns_select): Change prototype to be compatible with pselect.
4931 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4932 * nsterm.h (ns_select): Adjust prototype.
4933
4934 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4935 us-resolution time stamps.
4936 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4937
4938 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4939
4940 * lisp.h (time_overflow): New decl.
4941 (wait_reading_process_output): First arg is now intmax_t, not int,
4942 to accommodate larger waits.
4943
4944 * process.h (struct Lisp_Process.read_output_delay):
4945 Now counts nanoseconds, not microseconds.
4946 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4947 EMACS_HAS_USECS.
4948 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4949 (wait_reading_process_output):
4950 Port to ns-resolution time stamps.
4951 (Faccept_process_output, wait_reading_process_output):
4952 Check for time stamp overflow. Do not assume time_t is signed.
4953 (select_wrapper): Remove; we now use pselect.
4954 (Fprocess_attributes): Now generates ns-resolution time stamps.
4955
4956 * sysdep.c: Include utimens.h. Don't include utime.h
4957 or worry about struct utimbuf; gnulib does that for us now.
4958 (gettimeofday): Remove; gnulib provides a substitute.
4959 (make_timeval): New function.
4960 (set_file_times): Now sets ns-resolution time stamps.
4961 New arg FD; all uses changed.
4962 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4963 (system_process_attributes):
4964 Now returns ns-resolution time stamp. All uses changed.
4965 Check for time stamp overflow.
4966
4967 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4968 provides a substitute now.
4969
4970 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4971 since it guarantees struct timespec.
4972 (EMACS_TIME): Now struct timespec, so that we can support
4973 ns-resolution time stamps.
4974 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4975 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4976 (EMACS_USECS): Remove.
4977 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4978 so multiply the arg by 1000 before storing it.
4979 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4980 New macros.
4981 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4982 Port to ns-resolution time stamps.
4983 (EMACS_TIME_NEG_P): Remove; replaced by....
4984 (EMACS_TIME_SIGN): New macro.
4985 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4986 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4987 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4988 (make_timeval, make_lisp_time, decode_time_components): New decls.
4989 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4990 that it mishandled time_t overflow. You can't compare by subtracting!
4991 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4992 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4993
4994 * term.c: Include <sys/time.h>.
4995 (timeval_to_Time): New function, for proper overflow wraparound.
4996 (term_mouse_position, term_mouse_click): Use it.
4997
4998 * undo.c (record_first_change): Support higher-resolution time stamps
4999 in the undo buffer.
5000 (Fprimitive_undo): Use them when restoring time stamps.
5001
5002 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5003 (w32_get_internal_run_time):
5004 Port to higher-resolution Emacs time stamps.
5005 (ltime): Now accepts single 64-bit integer, as that's more convenient
5006 for callers.
5007
5008 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5009
5010 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5011 for compatibility with pselect. Support ns-resolution time stamps.
5012
5013 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5014
5015 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5016 Check for time stamp overflow, and support ns-resolution time stamps.
5017
5018 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5019 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5020 (timeval_subtract): Remove; no longer needed.
5021 (XTflash, XTring_bell, x_wait_for_event):
5022 Port to ns-resolution time stamps. Don't assume time_t is signed.
5023
5024 2012-06-22 Chong Yidong <cyd@gnu.org>
5025
5026 * xdisp.c (x_consider_frame_title): Revert last change.
5027
5028 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5029
5030 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5031 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5032 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5033 staticidx goes up to 1597 out of 1600 = 0x640.)
5034
5035 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5036
5037 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5038 Otherwise, the umask might be mistakenly 0 while handling input signals.
5039
5040 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5041
5042 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5043
5044 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5045
5046 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5047 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5048 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5049 access to `contents' member of Lisp_Vector objects with AREF and ASET
5050 where appropriate.
5051
5052 2012-06-19 Chong Yidong <cyd@gnu.org>
5053
5054 * frame.c (delete_frame): When selecting a frame on a different
5055 text terminal, do not alter the terminal's top-frame.
5056
5057 * xdisp.c (format_mode_line_unwind_data): Record the target
5058 frame's selected window and its terminal's top-frame.
5059 (unwind_format_mode_line): Restore them.
5060 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5061 Callers changed.
5062 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5063 since tty frames can be explicitly named.
5064 (prepare_menu_bars): Likewise.
5065
5066 * term.c (Ftty_top_frame): New function.
5067
5068 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5069
5070 Port byte-code-meter to modern targets.
5071 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5072 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5073 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5074 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5075 (METER_1, METER_2): Simplify.
5076
5077 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5078
5079 * data.c (Fdefalias): Return `symbol' (bug#11686).
5080
5081 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5082
5083 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5084 gets killed during executing of this function (Bug#11665).
5085 Try to always return Qt when the buffer has been actually killed.
5086 (Vkill_buffer_query_functions): In doc-string say that functions
5087 run by this hook should not change the current buffer.
5088
5089 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5090
5091 Fix recently-introduced process.c problems found by static checking.
5092 * process.c (write_queue_push, write_queue_pop, send_process):
5093 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5094 (write_queue_pop): Fix pointer signedness problem.
5095 (send_process): Remove unused local.
5096
5097 2012-06-17 Chong Yidong <cyd@gnu.org>
5098
5099 * xdisp.c (redisplay_internal): No need to redisplay terminal
5100 frames that are not on top.
5101
5102 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5103
5104 * process.c (make_process): Initialize write_queue.
5105 (write_queue_push, write_queue_pop): New functions.
5106 (send_process): Use them to maintain correct ordering of process
5107 writes (Bug#10815).
5108
5109 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5110
5111 * lisp.h (eassert): Assume C89 or later.
5112 This removes the need for CHECK.
5113 (CHECK): Remove. Its comments about always evaluating its
5114 argument were confusing, as 'eassert' typically does not evaluate
5115 its argument.
5116
5117 * coding.c (produce_chars): Use ptrdiff_t, not int.
5118
5119 * xterm.c (x_draw_underwave): Check for integer overflow.
5120 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5121
5122 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5123
5124 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5125 referenced (Bug#11583).
5126
5127 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5128
5129 Implement wave-style variant of underlining.
5130 * dispextern.h (face_underline_type): New enum.
5131 (face): Add field for underline type.
5132 * nsterm.m (ns_draw_underwave): New function.
5133 (ns_draw_text_decoration): Use it.
5134 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5135 New functions.
5136 (x_draw_glyph_string): Use them.
5137 * xfaces.c (Qline, Qwave): New Lisp objects.
5138 (check_lface_attrs, merge_face_ref)
5139 (Finternal_set_lisp_face_attribute, realize_x_face):
5140 Handle wave-style underline face attributes.
5141 * xterm.c (x_draw_underwave): New function.
5142 (x_draw_glyph_string): Use it.
5143
5144 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5145
5146 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5147 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5148 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5149 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5150 ($(BLD)/w32select.$(O)): Update dependencies.
5151
5152 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5153
5154 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5155 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5156 * character.c (_fetch_multibyte_char_p): Remove.
5157 * alloc.c: Include "character.h" before "buffer.h".
5158 * bidi.c: Likewise.
5159 * buffer.c: Likewise.
5160 * bytecode.c: Likewise.
5161 * callint.c: Likewise.
5162 * callproc.c: Likewise.
5163 * casefiddle.c: Likewise.
5164 * casetab.c: Likewise.
5165 * category.c: Likewise.
5166 * cmds.c: Likewise.
5167 * coding.c: Likewise.
5168 * composite.c: Likewise.
5169 * dired.c: Likewise.
5170 * dispnew.c: Likewise.
5171 * doc.c: Likewise.
5172 * dosfns.c: Likewise.
5173 * editfns.c: Likewise.
5174 * emacs.c: Likewise.
5175 * fileio.c: Likewise.
5176 * filelock.c: Likewise.
5177 * font.c: Likewise.
5178 * fontset.c: Likewise.
5179 * fringe.c: Likewise.
5180 * indent.c: Likewise.
5181 * insdel.c: Likewise.
5182 * intervals.c: Likewise.
5183 * keyboard.c: Likewise.
5184 * keymap.c: Likewise.
5185 * lread.c: Likewise.
5186 * macros.c: Likewise.
5187 * marker.c: Likewise.
5188 * minibuf.c: Likewise.
5189 * nsfns.m: Likewise.
5190 * nsmenu.m: Likewise.
5191 * print.c: Likewise.
5192 * process.c: Likewise.
5193 * regex.c: Likewise.
5194 * region-cache.c: Likewise.
5195 * search.c: Likewise.
5196 * syntax.c: Likewise.
5197 * term.c: Likewise.
5198 * textprop.c: Likewise.
5199 * undo.c: Likewise.
5200 * unexsol.c: Likewise.
5201 * w16select.c: Likewise.
5202 * w32fns.c: Likewise.
5203 * w32menu.c: Likewise.
5204 * window.c: Likewise.
5205 * xdisp.c: Likewise.
5206 * xfns.c: Likewise.
5207 * xmenu.c: Likewise.
5208 * xml.c: Likewise.
5209 * xselect.c: Likewise.
5210
5211 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5212
5213 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5214 If all the glyphs of the glyph row came from strings, and we have no
5215 cursor positioning clues, put the cursor on the first glyph of the
5216 row.
5217 (handle_face_prop): Use chunk-relative overlay string index when
5218 indexing into it->string_overlays array. (Bug#11653)
5219 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5220 the rightmost. (Bug#11720)
5221
5222 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5223
5224 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5225 (CATEGORY_MEMBER): Enforce 1/0 value.
5226 * category.c (_temp_category_set): Remove.
5227
5228 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5229
5230 * window.c (Fdelete_other_windows_internal)
5231 (Fdelete_window_internal): Don't access frame's mouse highlight
5232 info of the initial frame. (Bug#11677)
5233
5234 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5235
5236 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5237 Assume USE_2_TAGS_FOR_INTS.
5238 (xreload): Adjust $tagmask width to match recent lisp.h change.
5239
5240 Simplify lisp.h in minor ways that should not affect code.
5241 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5242 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5243 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5244 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5245 (INTTYPEBITS): New macro, for clarity.
5246 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5247 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5248 Simplify now that USE_LSB_TAG is always defined.
5249 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5250 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5251
5252 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5253
5254 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5255
5256 2012-06-13 Glenn Morris <rgm@gnu.org>
5257
5258 * s/bsd-common.h (BSD4_3):
5259 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5260
5261 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5262
5263 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5264 instead of union.
5265 (XLI, XIL): Define.
5266 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5267 Use them.
5268 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5269 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5270 * alloc.c (widen_to_Lisp_Object): Remove.
5271 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5272 * frame.c (delete_frame): Remove outdated comment.
5273 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5274 USE_LISP_UNION_TYPE.
5275 (Fw32_unregister_hot_key): Likewise.
5276 (Fw32_toggle_lock_key): Likewise.
5277 * w32menu.c (add_menu_item): Likewise.
5278 (w32_menu_display_help): Use XIL instead of checking
5279 USE_LISP_UNION_TYPE.
5280 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5281 (init_heap): Likewise.
5282 * w32term.c (w32_read_socket): Update comment.
5283
5284 2012-06-13 Glenn Morris <rgm@gnu.org>
5285
5286 * s/usg5-4-common.h, src/s/unixware.h:
5287 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5288
5289 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5290
5291 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5292
5293 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5294 * alloc.c (make_number) [!defined make_number]:
5295 Remove, as lisp.h always defines this now.
5296 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5297 (roundup_size): Verify that it is a power of 2.
5298 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5299 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5300 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5301 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5302 USE_LSB_TAG now is always defined to be either 0 or 1.
5303 All uses changed.
5304 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5305 code works fine either way, and efficiency is not a concern here,
5306 as the union type is for debugging, not for production.
5307 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5308 Use an inline function on all platforms when using the union type,
5309 since this is simpler and 'static inline' can be used portably
5310 within Emacs now.
5311 (LISP_INITIALLY_ZERO): New macro.
5312 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5313 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5314
5315 2012-06-12 Glenn Morris <rgm@gnu.org>
5316
5317 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5318
5319 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5320
5321 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5322 Move BROKEN_SIGIO to configure.
5323
5324 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5325 Move NO_TERMIO to configure.
5326
5327 2012-06-12 Chong Yidong <cyd@gnu.org>
5328
5329 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5330 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5331 MagickExportImagePixels is undefined.
5332
5333 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5334
5335 * image.c (imagemagick_load_image): Remove unused label.
5336
5337 2012-06-11 Glenn Morris <rgm@gnu.org>
5338
5339 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5340 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5341 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5342 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5343
5344 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5345
5346 * alloc.c (make_byte_code): New function.
5347 (Fmake_byte_code): Use it. Don't purify here.
5348 * lread.c (read1): Use it as well to avoid extra allocation.
5349
5350 2012-06-11 Chong Yidong <cyd@gnu.org>
5351
5352 * image.c (imagemagick_load_image): Implement transparency.
5353
5354 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5355
5356 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5357 account for preceding backslashes. (Bug#11663)
5358
5359 2012-06-09 Chong Yidong <cyd@gnu.org>
5360
5361 * term.c: Support italics in capable terminals (Bug#9652).
5362 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5363 (turn_on_face): Output using TS_enter_italic_mode if available.
5364 Don't handle unused blinking and alt-charset cases.
5365 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5366 and tty_alt_charset_p cases.
5367 (tty_capable_p, init_tty): Support italics.
5368
5369 * termchar.h (struct tty_display_info): Add field for italics.
5370 Remove unused blink field.
5371
5372 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5373 Handle slant.
5374
5375 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5376 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5377 tty_alt_charset_p. Add tty_italic_p.
5378
5379 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5380
5381 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5382 dbus_type_is_basic if available.
5383 (xd_extract_signed, xd_extract_unsigned): Rename from
5384 extract_signed and extract_unsigned, respectively. Adapt callers.
5385
5386 2012-06-09 Chong Yidong <cyd@gnu.org>
5387
5388 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5389
5390 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5391 case (Bug#9752).
5392
5393 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5394
5395 * xdisp.c (vmessage): Treat frame message as multibyte.
5396 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5397 would generate the diagnostic "Making \302\247 buffer-local while
5398 let-bound!".
5399
5400 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5401
5402 * dispnew.c (showing_window_margins_p): Undo last change, which
5403 was done due to an inadvertent commit.
5404 (adjust_frame_glyphs_for_frame_redisplay): Do call
5405 showing_window_margins_p.
5406
5407 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5408
5409 * eval.c (Fmake_var_non_special): New primitive.
5410 (syms_of_eval): Defsubr it.
5411 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5412
5413 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5414
5415 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5416 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5417
5418 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5419
5420 * alloc.c (allocate_vectorlike): Fix last change.
5421
5422 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5423
5424 Block-based vector allocation of small vectors.
5425 * lisp.h (struct vectorlike_header): New field `nbytes',
5426 adjust comment accordingly.
5427 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5428 to denote vector blocks. Adjust users (live_vector_p,
5429 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5430 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5431 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5432 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5433 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5434 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5435 (roundup_size): New constant.
5436 (struct vector_block): New data type.
5437 (vector_blocks, vector_free_lists, zero_vector): New variables.
5438 (all_vectors): Rename to `large_vectors'.
5439 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5440 (sweep_vectors): New functions.
5441 (allocate_vectorlike): Return `zero_vector' as the only vector of
5442 0 items. Allocate new vector from block if vector size is less than
5443 or equal to VBLOCK_BYTES_MAX.
5444 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5445 (init_alloc_once): Add call to init_vectors.
5446
5447 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5448
5449 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5450
5451 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5452
5453 * doprnt.c (doprnt): Truncate multibyte char correctly.
5454 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5455 would mishandle a string argument "Xc" if X was a multibyte
5456 character of length 2: it would truncate after X's first byte
5457 rather than including all of X.
5458
5459 2012-06-06 Chong Yidong <cyd@gnu.org>
5460
5461 * buffer.c (word_wrap): Doc fix.
5462
5463 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5464
5465 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5466
5467 2012-06-03 Glenn Morris <rgm@gnu.org>
5468
5469 * xdisp.c (tool-bar-style): Doc fix.
5470
5471 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5472
5473 * Makefile.in (PAXCTL): Define.
5474 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5475 binary via PaX flags if the paxctl utility is available.
5476 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5477 Restore PaX flags to their default. (Bug#11398)
5478
5479 2012-06-03 Chong Yidong <cyd@gnu.org>
5480
5481 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5482 buffer (Bug#11226).
5483
5484 2012-06-03 Chong Yidong <cyd@gnu.org>
5485
5486 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5487 (note_mode_line_or_margin_highlight): If there is no help echo,
5488 use mode-line-default-help-echo. Handle the case where the mouse
5489 position is past the end of the mode line string.
5490
5491 * buffer.c (buffer_local_value_1): New function, split from
5492 Fbuffer_local_value; can return Qunbound.
5493 (Fbuffer_local_value): Use it.
5494 (Vmode_line_format): Docstring tweaks.
5495
5496 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5497
5498 * sysdep.c (system_process_attributes): Improve comment.
5499
5500 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5501
5502 * keyboard.c: Export real-this-command to Elisp.
5503 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5504 and DEFVAR it. Update all users.
5505
5506 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5507
5508 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5509
5510 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5511 Convert pctcpu and pctmem to Lisp float properly.
5512 Let the compiler fold better, as 100.0/0x8000 is exact.
5513
5514 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5515
5516 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5517 cons_block.
5518
5519 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5520
5521 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5522
5523 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5524
5525 For a 'struct window', replace some Lisp_Object fields to
5526 bitfields where appropriate, remove unused fields.
5527 * window.h (struct window): Remove unused 'last_mark_x' and
5528 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5529 change it's type from Lisp_Object to bitfield.
5530 Change type of 'force_start', 'optional_new_start',
5531 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5532 fields from Lisp_Object to bitfield. Adjust users accordingly.
5533
5534 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5535
5536 Pacify gcc -Wdouble-precision when using Xaw.
5537 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5538 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5539 Use 'float' consistently, rather than 'float' in most places
5540 and 'double' in a couple of places.
5541
5542 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5543
5544 * xdisp.c (handle_stop): Detect whether we have overlay strings
5545 loaded by testing it->current.overlay_string_index to be
5546 non-negative, instead of checking whether n_overlay_strings is
5547 positive. (Bug#11587)
5548
5549 2012-05-31 Chong Yidong <cyd@gnu.org>
5550
5551 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5552
5553 * doc.c (Fsubstitute_command_keys): Doc fix.
5554
5555 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5556
5557 * search.c (search_buffer): Remove calls to
5558 r_alloc_inhibit_buffer_relocation, as it is now called by
5559 maybe_unify_char, which was the cause of relocation of buffer text
5560 in bug#11519.
5561
5562 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5563
5564 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5565 for the duration of call to load_charset, to avoid problems with
5566 callers of maybe_unify_char that access buffer text through C
5567 pointers.
5568
5569 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5570 decrement the inhibition flag, instead of just setting or
5571 resetting it.
5572
5573 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5574
5575 Remove obsolete '#define static' cruft.
5576 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5577 This #undef was "temporary" in 2000; it is no longer needed
5578 now that '#define static' has gone away.
5579 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5580 (gray_bitmap_bits): Remove; no longer needed.
5581 All uses replaced with definiens.
5582 * xterm.c: Include "bitmaps/gray.xbm".
5583
5584 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5585
5586 Clean up __executable_start, monstartup when --enable-profiling.
5587 The following changes affect the code only when profiling.
5588 * dispnew.c (__executable_start): Rename from safe_bcopy.
5589 Define only on platforms that need it.
5590 * emacs.c: Include <sys/gmon.h> when profiling.
5591 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5592 (__executable_start): Remove decl, since lisp.h does it now.
5593 (safe_bcopy): Remove decl; no longer has that name.
5594 (main): Coalesce #if into single bit of code, for simplicity.
5595 Cast pointers to uintptr_t, since standard libraries want integers
5596 and not pointers.
5597 * lisp.h (__executable_start): New decl.
5598
5599 2012-05-31 Glenn Morris <rgm@gnu.org>
5600
5601 * image.c (Fimagemagick_types): Doc fix.
5602
5603 2012-05-30 Jim Meyering <meyering@redhat.com>
5604
5605 * callproc.c (Fcall_process_region): Include directory component
5606 in mkstemp error message (Bug#11586).
5607
5608 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5609
5610 * alloc.c, lisp.h (make_pure_vector): Now static.
5611
5612 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5613
5614 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5615 Move to byte-run.el.
5616 (Fautoload): Do the hash-doc more carefully.
5617 * data.c (Fdefalias): Purify definition, except for keymaps.
5618 (Qdefun): Move from eval.c.
5619 * lisp.h (Qdefun): Remove.
5620 * lread.c (read1): Tiny simplification.
5621
5622 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
5623
5624 Do not create empty overlays with the evaporate property (Bug#9642).
5625 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5626 Bug#9642, but explicitly check that the buffer the overlay would
5627 be moved to is live and rearrange lines to make sure that errors
5628 will not put the overlay in an inconsistent state.
5629 (Fdelete_overlay): Cosmetics.
5630
5631 2012-05-28 Eli Zaretskii <eliz@gnu.org>
5632
5633 * w32term.c (my_bring_window_to_top): New function.
5634 (x_raise_frame): Use handle returned by DeferWindowPos, which
5635 could be different from the original one.
5636 Call my_bring_window_to_top instead of my_set_foreground_window.
5637 (Bug#11513)
5638
5639 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5640 by calling BringWindowToTop.
5641
5642 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5643 (WM_EMACS_END): Increase by one.
5644
5645 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5646
5647 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5648 This avoids undefined behavior that might cause the eassert
5649 to not catch an out-of-range value.
5650
5651 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
5652
5653 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5654 Update dependencies.
5655
5656 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5657
5658 * bidi.c (bidi_mirror_char): Fix last change.
5659
5660 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5661
5662 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5663 when referring to sectname field in printf format.
5664
5665 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5666
5667 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5668 Only r_alloc_inhibit_buffer_relocation needed to be added;
5669 the others were already declared.
5670
5671 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5672 before checking whether it's out of range. Put the check inside
5673 eassert. See
5674 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5675
5676 2012-05-27 Ken Brown <kbrown@cornell.edu>
5677
5678 * callproc.c (Fcall_process): Restore a line that was accidentally
5679 commented out in the 2011-02-13 change (bug#11547).
5680
5681 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5682
5683 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5684 defined on ralloc.c.
5685
5686 * buffer.c [REL_ALLOC]: Remove prototypes of
5687 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5688 they are now on lisp.h.
5689
5690 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5691
5692 * search.c (search_buffer): Use it to inhibit relocation of buffer
5693 text while re_search_2 is doing its job, because re_search_2 is
5694 passed C pointers to buffer text. (Bug#11519)
5695
5696 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5697 Update value to 24.
5698
5699 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5700 state after an additional call to move_it_in_display_line_to, keep
5701 the values of it->max_ascent and it->max_descent found for the
5702 entire line.
5703 (pos_visible_p): Revert the comparison against bottom_y to what it
5704 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5705 (Bug#11464)
5706
5707 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5708
5709 Fix coding-related core dumps with gcc -ftrapv.
5710 The code was computing A - B, where A and B are pointers, and B is
5711 random garbage. This can lead to core dumps on platforms that
5712 have special pointer registers, and it also leads to core dumps on
5713 x86-64 when compiled with gcc -ftrapv. The fix is to compute
5714 A - B only when B is initialized properly.
5715 * coding.c (coding_set_source, coding_set_destination): Return void.
5716 (coding_change_source, coding_change_destinations): New functions,
5717 with the old behaviors of coding_set_source and coding_set_destination.
5718 All callers that need an offset changed to use these new functions.
5719
5720 2012-05-26 Glenn Morris <rgm@gnu.org>
5721
5722 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5723
5724 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5725
5726 Extend mouse support on W32 text-mode console.
5727 * xdisp.c (draw_row_with_mouse_face):
5728 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
5729
5730 * w32console.c: Include window.h.
5731 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5732 New functions.
5733 (initialize_w32_display): Initialize mouse-highlight data.
5734
5735 * w32inevt.c: Include termchar.h and window.h.
5736 (do_mouse_event): Support mouse-autoselect-window. When the mouse
5737 moves, call note_mouse_highlight. If help_echo changed, call
5738 gen_help_event to produce help-echo message in the echo area.
5739 Call clear_mouse_face if mouse_face_hidden is set in the mouse
5740 highlight info.
5741
5742 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5743
5744 * lread.c (read1): Simplify slightly to avoid an overflow warning
5745 with GCC 4.7.0 on x86-64.
5746
5747 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5748
5749 * bidi.c (bidi_mirror_char): Revert last change: an int is
5750 definitely wide enough here.
5751
5752 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
5753
5754 Fix integer width and related bugs (Bug#9874).
5755 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
5756 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5757 (string_bytes, check_sblock, allocate_string_data):
5758 (compact_small_strings, Fmake_bool_vector, make_string)
5759 (make_unibyte_string, make_multibyte_string)
5760 (make_string_from_bytes, make_specified_string)
5761 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5762 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5763 (mark_vectorlike):
5764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5765 (allocate_pseudovector):
5766 Use int, not EMACS_INT, where int is wide enough.
5767 (inhibit_garbage_collection, Fgarbage_collect):
5768 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5769 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5770 int might not be wide enough.
5771 (bidi_cache_search, bidi_cache_find, bidi_init_it)
5772 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5773 (bidi_at_paragraph_end, bidi_find_paragraph_start)
5774 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5775 (bidi_level_of_next_char, bidi_move_to_visually_next):
5776 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5777 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5778 (Fkill_buffer, Fset_buffer_major_mode)
5779 (advance_to_char_boundary, Fbuffer_swap_text)
5780 (Fset_buffer_multibyte, overlays_at, overlays_in)
5781 (overlay_touches_p, struct sortvec, record_overlay_string)
5782 (overlay_strings, recenter_overlay_lists)
5783 (adjust_overlays_for_insert, adjust_overlays_for_delete)
5784 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5785 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5786 (Foverlay_recenter, last_overlay_modification_hooks_used)
5787 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5788 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5789 (validate_region): Omit unnecessary test for b <= e,
5790 since that's guaranteed by the previous test.
5791 (adjust_overlays_for_delete): Avoid pos + length overflow.
5792 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5793 (report_overlay_modification):
5794 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5795 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5796 Omit pointer cast, which isn't needed anyway, and doesn't work
5797 after the EMACS_INT -> ptrdiff_t change.
5798 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
5799 * buffer.h: Adjust decls to match defn changes elsewhere.
5800 (struct buffer_text, struct buffer):
5801 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5802 Use EMACS_INT, not int, where int might not be wide enough.
5803 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5804 not int, to avoid needless 32-bit limit on 64-bit hosts.
5805 (exec_byte_code): Use tighter memory-full test, one that checks
5806 for alloca overflow. Don't compute the address of the object just
5807 before an array, as that's not portable. Use EMACS_INT, not
5808 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
5809 * callint.c (Fcall_interactively):
5810 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5811 * callproc.c (call_process_kill, Fcall_process):
5812 Don't assume pid_t fits into an Emacs fixnum.
5813 (call_process_cleanup, Fcall_process, child_setup):
5814 Don't assume pid_t fits into int.
5815 (call_process_cleanup, Fcall_process, delete_temp_file)
5816 (Fcall_process_region):
5817 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5818 (Fcall_process): Simplify handling of volatile integers.
5819 Use int, not EMACS_INT, where int will do.
5820 * casefiddle.c (casify_object, casify_region, operate_on_word)
5821 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5822 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5823 (casify_object): Avoid integer overflow when overallocating buffer.
5824 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
5825 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
5826 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5827 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5828 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5829 integers are now checked earlier. All uses replaced with XINT.
5830 (ccl_driver):
5831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5832 For CCL_MapSingle, check that content and value are in int range.
5833 (ccl_driver, Fregister_code_conversion_map):
5834 Check that Vcode_version_map_vector is a vector.
5835 (resolve_symbol_ccl_program): Check that vector header is in range.
5836 Always copy the vector, so that we can check its contents reliably
5837 now rather than having to recheck each instruction as it's being
5838 executed. Check that vector words fit in 'int'.
5839 (ccl_get_compiled_code, Fregister_ccl_program)
5840 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5841 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5842 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5843 contents are in range.
5844 (Fccl_execute_on_string): Check that status is in range.
5845 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5846 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5847 Accept and return EMACS_INT, not int, because callers can pass values
5848 out of 'int' range.
5849 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5850 (multibyte_chars_in_text, parse_str_as_multibyte)
5851 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5852 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5853 (string_escape_byte8, Fget_byte):
5854 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5855 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
5856 avoid mishandling large integers.
5857 * character.h: Adjust decls to match defn changes elsewhere.
5858 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5859 (Ffind_charset_region):
5860 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5861 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5862 (load_charset_map_from_vector, Fdefine_charset_internal):
5863 Don't assume fixnum fits in int.
5864 (load_charset_map_from_vector, Fmap_charset_chars):
5865 Remove now-unnecessary CHECK_NATNUMs.
5866 (Fdefine_charset_internal): Check ranges here, more carefully.
5867 Don't rely on undefined behavior with signed left shift overflow.
5868 Don't assume unsigned int fits into fixnum, or that fixnum fits
5869 into unsigned int. Don't require max_code to be a valid fixnum;
5870 that's not true for gb10830 4-byte on a 32-bit host. Allow
5871 invalid_code to be a cons, for the same reason. Require code_offset
5872 to be a character. Avoid int overflow if max_char is close
5873 to INT_MAX.
5874 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5875 this is intended anyway and avoids some undefined behavior.
5876 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5877 INDEX_TO_CODE_POINT, as that's what it expects.
5878 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
5879 * charset.h (DECODE_CHAR): Return int, not unsigned;
5880 this is what was intended anyway, and it avoids undefined behavior.
5881 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5882 integer-overflow issues.
5883 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5884 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5885 where the argument is EMACS_INT, and this behavior is not intended.
5886 * chartab.c (Fmake_char_table, Fset_char_table_range)
5887 (uniprop_get_decoder, uniprop_get_encoder):
5888 Don't assume fixnum fits in int.
5889 * cmds.c (move_point): New function, that does the gist of
5890 Fforward_char and Fbackward_char, but does so while checking
5891 for integer overflow more accurately.
5892 (Fforward_char, Fbackward_char): Use it.
5893 (Fforward_line, Fend_of_line, internal_self_insert)
5894 (internal_self_insert):
5895 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5896 Fix a FIXME, by checking for integer overflow when calculating
5897 target_clm and actual_clm.
5898 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
5899 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
5900 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5901 (coding_alloc_by_making_gap, alloc_destination)
5902 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5903 (encode_coding_utf_16, detect_coding_emacs_mule)
5904 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5905 (detect_coding_iso_2022, decode_coding_iso_2022)
5906 (encode_invocation_designation, encode_designation_at_bol)
5907 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5908 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5909 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5910 (encode_coding_ccl, encode_coding_raw_text)
5911 (detect_coding_charset, decode_coding_charset)
5912 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5913 (produce_composition, produce_charset, produce_annotation)
5914 (decode_coding, handle_composition_annotation)
5915 (handle_charset_annotation, consume_chars, decode_coding_gap)
5916 (decode_coding_object, encode_coding_object, detect_coding_system)
5917 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5918 (code_convert_region, code_convert_string)
5919 (Fdefine_coding_system_internal)
5920 (coding_set_source, coding_set_destination):
5921 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5922 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5923 (Fdefine_coding_system_internal):
5924 Don't assume fixnums fit in int.
5925 (decode_coding_gap, decode_coding_object, encode_coding_object)
5926 (Fread_coding_system, Fdetect_coding_region)
5927 (Funencodable_char_position, Fcheck_coding_systems_region)
5928 (get_translation, handle_composition_annotation, consume_chars):
5929 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5930 (consume_chars): Rewrite to not calculate an address outside buffer.
5931 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
5932 Don't access memory outside of the args array.
5933 (Fdefine_coding_system_internal): Check for charset-id overflow.
5934 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5935 result of ENCODE_CHAR.
5936 * coding.h: Adjust decls to match defn changes elsewhere.
5937 (struct coding_system):
5938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5939 * composite.c (get_composition_id, find_composition)
5940 (run_composition_function, update_compositions)
5941 (compose_text, composition_gstring_put_cache)
5942 (composition_gstring_p, composition_gstring_width)
5943 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5944 (composition_compute_stop_pos, composition_reseat_it)
5945 (composition_update_it, struct position_record)
5946 (find_automatic_composition, composition_adjust_point)
5947 (Fcomposition_get_gstring, Ffind_composition_internal):
5948 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5949 (update_compositions):
5950 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5951 * composite.h: Adjust decls to match defn changes elsewhere.
5952 (struct composition):
5953 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5954 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5955 Do not attempt to compute the address of the object just before a
5956 buffer; this is not portable.
5957 (Faref, Faset):
5958 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5959 (Faset): Use int, not EMACS_INT, where int is wide enough.
5960 (Fstring_to_number): Don't assume fixnums fit in int.
5961 (Frem): Don't assume arg is nonnegative.
5962 * dbusbind.c (xd_append_arg): Check for integers out of range.
5963 (Fdbus_call_method): Don't overflow the timeout int.
5964 (extract_signed, extract_unsigned): New functions.
5965 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5966 (xd_get_connection_references): Return ptrdiff_t, not int.
5967 All uses changed.
5968 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5969 (xd_read_message_1):
5970 Use int, not unsigned, where the dbus API uses int.
5971 (Fdbus_message_internal): Don't overflow mtype.
5972 (syms_of_dbusbind): Allocate right-sized buffer for integers.
5973 * dired.c (directory_files_internal, file_name_completion, scmp)
5974 (file_name_completion_stat):
5975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5976 (file_name_completion): Don't overflow matchcount.
5977 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5978 * dispextern.h: Adjust decls to match defn changes elsewhere.
5979 (struct text_pos, struct glyph, struct bidi_saved_info)
5980 (struct bidi_string_data, struct bidi_it, struct composition_it)
5981 (struct it):
5982 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5983 (struct display_pos, struct composition_it, struct it):
5984 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5985 * dispnew.c (increment_matrix_positions)
5986 (increment_row_positions, mode_line_string)
5987 (marginal_area_string):
5988 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5989 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
5990 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5991 (duration_to_sec_usec): New function, to check for overflow better.
5992 (Fsleep_for, sit_for): Use it.
5993 * doc.c (get_doc_string, store_function_docstring):
5994 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5995 (get_doc_string, Fsnarf_documentation):
5996 Use int, not EMACS_INT, where int is wide enough.
5997 (get_doc_string):
5998 Use SAFE_ALLOCA, not alloca.
5999 Check for overflow when converting EMACS_INT to off_t.
6000 * doprnt.c (doprnt):
6001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6002 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6003 Don't assume uid_t fits into fixnum.
6004 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6005 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6006 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6007 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6008 (general_insert_function)
6009 (Finsert_char, make_buffer_string, make_buffer_string_both)
6010 (update_buffer_properties, Fbuffer_substring)
6011 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6012 (Fsubst_char_in_region, check_translation)
6013 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6014 (transpose_markers, Ftranspose_regions):
6015 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6016 (clip_to_bounds): Move to lisp.h as an inline function).
6017 (Fconstrain_to_field): Don't assume integers are nonnegative.
6018 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6019 (Fsubst_char_in_region, Fsave_restriction):
6020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6021 (Femacs_pid): Don't assume pid_t fits into fixnum.
6022 (lo_time): Use int, not EMACS_INT, when int suffices.
6023 (lisp_time_argument): Check for usec out of range.
6024 (Fencode_time): Don't assume fixnum fits in int.
6025 (Fuser_login_name, Fuser_full_name): Signal an error
6026 if a uid argument is out of range, rather than relying on
6027 undefined behavior.
6028 (Fformat_time_string): Remove now-unnecessary check.
6029 lisp_time_argument checks for out-of-range usec now.
6030 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6031 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6032 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6033 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6034 (init_cmdargs, Fdump_emacs):
6035 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6036 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6037 the bottom (typically) 32 bits of the fixnum.
6038 * eval.c (specpdl_size, call_debugger):
6039 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6040 (when_entered_debugger, Fbacktrace_debug):
6041 Don't assume fixnum can fit in int.
6042 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6043 the object just before a buffer; this is not portable.
6044 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6045 (grow_specpdl, unbind_to):
6046 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6047 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6048 (grow_specpdl): Simplify allocation by using xpalloc.
6049 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6050 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6051 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6053 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6054 (a_write, e_write):
6055 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6056 (Fcopy_file, non_regular_nbytes, read_non_regular)
6057 (Finsert_file_contents):
6058 Use int, not EMACS_INT, where int is wide enough.
6059 (READ_BUF_SIZE): Verify that it fits in int.
6060 (Finsert_file_contents): Check that counts are in proper range,
6061 rather than assuming fixnums fit into ptrdiff_t etc.
6062 Don't assume fixnums fit into int.
6063 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6064 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6065 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6066 (string_char_to_byte, string_byte_to_char)
6067 (string_make_multibyte, string_to_multibyte)
6068 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6069 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6070 (substring_both, Fdelete, internal_equal, Ffillarray)
6071 (Fclear_string, mapcar1)
6072 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6073 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6074 (larger_vector, make_hash_table, maybe_resize_hash_table)
6075 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6076 (Fmaphash, secure_hash):
6077 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6078 (concat): Check for string index and length overflow.
6079 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6080 (Frequire):
6081 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6082 (larger_vector): New API (vec, incr_min, size_max) replaces old
6083 one (vec, new_size, init). This catches size overflow.
6084 INIT was removed because it was always Qnil.
6085 All callers changed.
6086 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6087 the upper bound on a hash table index size.
6088 (make_hash_table, maybe_resize_hash_table): Use it.
6089 (secure_hash): Computer start_byte and end_byte only after
6090 they're known to be in ptrdiff_t range.
6091 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6092 (Ffont_get_glyphs, Ffont_at):
6093 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6094 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6095 (Flist_fonts, Fopen_font):
6096 Don't assume fixnum can fit in int.
6097 (check_gstring): Don't assume index can fit in int.
6098 (font_match_p): Check that fixnum is a character, not a nonnegative
6099 fixnum, since the later code needs to stuff it into an int.
6100 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6101 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6102 conversion overflow issues.
6103 (Fopen_font): Check for integer out of range.
6104 (Ffont_get_glyphs): Don't assume index can fit in int.
6105 * font.h: Adjust decls to match defn changes elsewhere.
6106 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6107 integer overflow.
6108 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6109 printmax_t, where ptrdiff_t is wide enough.
6110 (Finternal_char_font):
6111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6112 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6113 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6114 (Fset_frame_position, x_set_frame_parameters)
6115 (x_set_line_spacing, x_set_border_width)
6116 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6117 Check that fixnums are in proper range for system types.
6118 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6119 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6120 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6121 Use SAFE_ALLOCA_LISP, not alloca.
6122 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6123 intptr_t is wide enough.
6124 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6125 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6126 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6127 Check for fixnum out of range.
6128 * ftfont.c (ftfont_list): Don't assume index fits in int.
6129 Check that fixnums are in proper range for system types.
6130 (ftfont_shape_by_flt):
6131 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6132 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6134 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6135 Check that fixnums are in proper range for system types.
6136 * gnutls.h: Adjust decls to match defn changes elsewhere.
6137 * gtkutil.c (xg_dialog_run):
6138 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6139 (update_frame_tool_bar):
6140 Check that fixnums are in proper range for system types.
6141 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6142 (lookup_image): Check that fixnums are in range for system types.
6143 * indent.c (last_known_column, last_known_column_point):
6144 (current_column_bol_cache):
6145 (skip_invisible, current_column, check_display_width):
6146 (check_display_width, scan_for_column, current_column_1)
6147 (Findent_to, Fcurrent_indentation, position_indentation)
6148 (indented_beyond_p, Fmove_to_column, compute_motion):
6149 (Fcompute_motion, Fvertical_motion):
6150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6151 (last_known_column_modified): Use EMACS_INT, not int.
6152 (check_display_width):
6153 (Fcompute_motion):
6154 Check that fixnums and floats are in proper range for system types.
6155 (compute_motion): Don't assume index or fixnum fits in int.
6156 (compute_motion, Fcompute_motion):
6157 Use int, not EMACS_INT, when it is wide enough.
6158 (vmotion): Omit local var start_hpos that is always 0; that way
6159 we don't need to worry about overflow in expressions involving it.
6160 * indent.h: Adjust decls to match defn changes elsewhere.
6161 (struct position):
6162 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6163 Use int, not EMACS_INT, where int is wide enough.
6164 Remove unused members ovstring_chars_done and tab_offset;
6165 all uses removed.
6166 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6167 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6168 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6169 (make_gap, copy_text, insert, insert_and_inherit)
6170 (insert_before_markers, insert_before_markers_and_inherit)
6171 (insert_1, count_combining_before, count_combining_after)
6172 (insert_1_both, insert_from_string)
6173 (insert_from_string_before_markers, insert_from_string_1)
6174 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6175 (adjust_after_replace, adjust_after_insert, replace_range)
6176 (replace_range_2, del_range, del_range_1, del_range_byte)
6177 (del_range_both, del_range_2, modify_region)
6178 (prepare_to_modify_buffer, signal_before_change)
6179 (signal_after_change, Fcombine_after_change_execute):
6180 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6181 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6182 (balance_an_interval, split_interval_right, split_interval_left)
6183 (find_interval, next_interval, update_interval)
6184 (adjust_intervals_for_insertion, delete_node, delete_interval)
6185 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6186 (static_offset_intervals, offset_intervals)
6187 (merge_interval_right, merge_interval_left, make_new_interval)
6188 (graft_intervals_into_buffer, temp_set_point_both)
6189 (temp_set_point, set_point, adjust_for_invis_intang)
6190 (set_point_both, move_if_not_intangible, get_property_and_range)
6191 (get_local_map, copy_intervals, copy_intervals_to_string)
6192 (compare_string_intervals, set_intervals_multibyte_1):
6193 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6194 * intervals.h: Adjust decls to match defn changes elsewhere.
6195 (struct interval):
6196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6197 * keyboard.c (this_command_key_count, this_single_command_key_start)
6198 (before_command_key_count, before_command_echo_length, echo_now)
6199 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6200 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6201 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6202 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6203 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6204 (last_non_minibuf_size, last_point_position, echo_truncate)
6205 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6206 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6207 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6208 (stuff_buffered_input):
6209 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6210 (last_auto_save, command_loop_1, read_char):
6211 Use EMACS_INT, not int, to avoid integer overflow.
6212 (record_char): Avoid overflow in total_keys computation.
6213 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6214 * keyboard.h: Adjust decls to match defn changes elsewhere.
6215 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6216 (Fkey_description, Fdescribe_vector, Flookup_key):
6217 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6218 (click_position): New function, to check that positions are in range.
6219 (Fcurrent_active_maps):
6220 (describe_command):
6221 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6222 (Faccessible_keymaps, Fkey_description):
6223 (preferred_sequence_p):
6224 Don't assume fixnum can fit into int.
6225 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6226 Check for integer overflow in size calculations.
6227 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6228 avoid mishandling large integers.
6229 * lisp.h: Adjust decls to match defn changes elsewhere.
6230 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6231 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6232 (struct Lisp_Marker):
6233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6234 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6235 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6236 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6237 All callers changed.
6238 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6239 Assume the arg has valid form, since it always does.
6240 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6241 unsigned integer system type.
6242 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6243 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6244 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6245 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6246 (duration_to_sec_usec): New decl.
6247 * lread.c (read_from_string_index, read_from_string_index_byte)
6248 (read_from_string_limit, readchar, unreadchar, openp)
6249 (read_internal_start, read1, oblookup):
6250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6251 (Fload, readevalloop, Feval_buffer, Feval_region):
6252 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6253 (openp): Check for out-of-range argument to 'access'.
6254 (read1): Use int, not EMACS_INT, where int is wide enough.
6255 Don't assume fixnum fits into int.
6256 Fix off-by-one error that can read outside a buffer.
6257 (read_filtered_event): Use duration_to_sec_usec
6258 to do proper overflow checking on durations.
6259 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6260 in size calculation.
6261 (Fexecute_kbd_macro):
6262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6263 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6264 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6265 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6266 (set_marker_both, set_marker_restricted_both, marker_position)
6267 (marker_byte_position, Fbuffer_has_markers_at):
6268 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6269 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6270 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6271 It now merely ensures that the menu is large enough, without
6272 necessarily growing it, as this avoids some integer overflow issues.
6273 All callers changed.
6274 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6275 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6276 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6277 Use SAFE_ALLOCA_LISP, not alloca.
6278 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6279 to EMACS_INT. Check that fixnums are in proper range for system types.
6280 * minibuf.c (minibuf_prompt_width, string_to_object)
6281 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6282 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6283 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6284 (get_minibuffer, read_minibuf_unwind):
6285 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6286 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6287 this simplifies overflow checking. All callers changed.
6288 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6289 (Ftest_completion):
6290 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6291 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6292 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6293 Check that fixnums are in proper range for system types.
6294 (Fx_create_frame, Fx_show_tip):
6295 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6296 * nsfont.m (ns_findfonts, nsfont_list_family):
6297 Don't assume fixnum fits in long.
6298 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6299 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6300 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6301 wide enough.
6302 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6303 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6304 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6305 (PRINTDECLARE, PRINTPREPARE):
6306 (strout, print_string):
6307 (print, print_preprocess, print_check_string_charset_prop)
6308 (print_object):
6309 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6310 (PRINTDECLARE):
6311 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6312 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6313 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6314 (printchar, strout): Use xpalloc to catch size calculation overflow.
6315 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6316 (print_error_message): Use SAFE_ALLOCA, not alloca.
6317 (print_object): Use int, not EMACS_INT, where int is wide enough.
6318 (print_depth, new_backquote_output, print_number_index):
6319 Use ptrdiff_t, not int, where int might not be wide enough.
6320 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6321 (Fset_process_window_size, Fformat_network_address)
6322 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6323 (sigchld_handler):
6324 Check that fixnums are in proper range for system types.
6325 (Fsignal_process): Simplify by avoiding a goto.
6326 Check for process-ids out of pid_t range rather than relying on
6327 undefined behavior.
6328 (process_tick, update_tick): Use EMACS_INT, not int.
6329 (Fformat_network_address, read_process_output, send_process)
6330 (Fprocess_send_region, status_notify):
6331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6332 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6333 (wait_reading_process_output, read_process_output, exec_sentinel):
6334 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6335 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6336 (Faccept_process_output): Use duration_to_sec_usec to do proper
6337 overflow checking on durations.
6338 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6339 Don't assume pid_t fits in int.
6340 * process.h (struct Lisp_Process): Members tick and update_tick
6341 are now of type EMACS_INT, not int.
6342 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6343 configured --with-wide-int.
6344 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6345 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6346 * search.c (looking_at_1, string_match_1):
6347 (fast_string_match, fast_c_string_match_ignore_case)
6348 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6349 (scan_newline, find_before_next_newline, search_command)
6350 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6351 (set_search_regs, wordify):
6352 (Freplace_match):
6353 (Fmatch_data):
6354 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6355 (string_match_1, search_buffer, set_search_regs):
6356 (Fmatch_data):
6357 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6358 (wordify): Check for overflow in size calculation.
6359 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6360 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6361 Check that fixnums are in proper range for system types.
6362 * sound.c (struct sound_device)
6363 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6364 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6365 (Fplay_sound_internal):
6366 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6367 * syntax.c (struct lisp_parse_state, find_start_modiff)
6368 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6369 (Fparse_partial_sexp):
6370 Don't assume fixnums can fit in int.
6371 (struct lisp_parse_state, find_start_pos, find_start_value)
6372 (find_start_value_byte, find_start_begv)
6373 (update_syntax_table, char_quoted, dec_bytepos)
6374 (find_defun_start, prev_char_comend_first, back_comment):
6375 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6376 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6377 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6378 (Finternal_describe_syntax_value): Check that match_lisp is a
6379 character, not an integer, since the code stuffs it into int.
6380 (scan_words, scan_sexps_forward):
6381 Check that fixnums are in proper range for system types.
6382 (Fforward_word):
6383 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6384 (scan_sexps_forward):
6385 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6386 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6387 * syntax.h: Adjust decls to match defn changes elsewhere.
6388 (struct gl_state_s):
6389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6390 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6391 MOST_POSITIVE_FIXNUM.
6392 * sysdep.c (wait_for_termination_1, wait_for_termination)
6393 (interruptible_wait_for_termination, mkdir):
6394 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6395 (emacs_read, emacs_write):
6396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6397 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6398 and double all fit in int.
6399 * term.c (set_tty_color_mode):
6400 Check that fixnums are in proper range for system types.
6401 * termhooks.h (struct input_event):
6402 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6403 * textprop.c (validate_interval_range, interval_of)
6404 (Fadd_text_properties, set_text_properties_1)
6405 (Fremove_text_properties, Fremove_list_of_text_properties)
6406 (Ftext_property_any, Ftext_property_not_all)
6407 (copy_text_properties, text_property_list, extend_property_ranges)
6408 (verify_interval_modification):
6409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6410 (Fnext_single_char_property_change)
6411 (Fprevious_single_char_property_change):
6412 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6413 (copy_text_properties):
6414 Check for integer overflow in index calculation.
6415 * undo.c (last_boundary_position, record_point, record_insert)
6416 (record_delete, record_marker_adjustment, record_change)
6417 (record_property_change):
6418 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6419 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6420 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6421 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6422 (Fx_hide_tip, Fx_file_dialog):
6423 * w32menu.c (set_frame_menubar):
6424 Use ptrdiff_t, not int, for consistency with rest of code.
6425 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6426 (select_window, Fdelete_other_windows_internal)
6427 (window_scroll_pixel_based, window_scroll_line_based)
6428 (Frecenter, Fset_window_configuration):
6429 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6430 (Fset_window_hscroll, run_window_configuration_change_hook)
6431 (set_window_buffer, temp_output_buffer_show, scroll_command)
6432 (Fscroll_other_window, Frecenter):
6433 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6434 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6435 Don't assume fixnum fits in int.
6436 (Fset_window_scroll_bars):
6437 Check that fixnums are in proper range for system types.
6438 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6439 (string_pos, c_string_pos, number_of_chars, init_iterator)
6440 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6441 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6442 (compute_display_string_end, handle_face_prop)
6443 (face_before_or_after_it_pos, handle_invisible_prop)
6444 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6445 (display_prop_intangible_p, string_buffer_position_lim)
6446 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6447 (get_overlay_strings_1, get_overlay_strings)
6448 (iterate_out_of_display_property, forward_to_next_line_start)
6449 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6450 (get_next_display_element, set_iterator_to_next)
6451 (get_visually_first_element, compute_stop_pos_backwards)
6452 (handle_stop_backwards, next_element_from_buffer)
6453 (move_it_in_display_line_to, move_it_in_display_line)
6454 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6455 (add_to_log, message_dolog, message_log_check_duplicate)
6456 (message2, message2_nolog, message3, message3_nolog
6457 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6458 (current_message_1, truncate_echo_area, truncate_message_1)
6459 (set_message, set_message_1, store_mode_line_noprop)
6460 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6461 (text_outside_line_unchanged_p, check_point_in_composition)
6462 (reconsider_clip_changes)
6463 (redisplay_internal, set_cursor_from_row, try_scrolling)
6464 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6465 (redisplay_window, find_last_unchanged_at_beg_row)
6466 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6467 (trailing_whitespace_p, find_row_edges, display_line)
6468 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6469 (display_mode_element, store_mode_line_string)
6470 (pint2str, pint2hrstr, decode_mode_spec)
6471 (display_count_lines, display_string, draw_glyphs)
6472 (x_produce_glyphs, x_insert_glyphs)
6473 (rows_from_pos_range, mouse_face_from_buffer_pos)
6474 (fast_find_string_pos, mouse_face_from_string_pos)
6475 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6477 (safe_call, init_from_display_pos, handle_fontified_prop)
6478 (handle_single_display_spec, load_overlay_strings)
6479 (with_echo_area_buffer, setup_echo_area_for_printing)
6480 (display_echo_area, echo_area_display)
6481 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6482 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6483 (redisplay_window, dump_glyph_row, display_mode_line)
6484 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6485 (handle_display_spec, display_prop_string_p):
6486 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6487 (handle_single_display_spec, build_desired_tool_bar_string)
6488 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6489 (get_specified_cursor_type):
6490 Check that fixnums are in proper range for system types.
6491 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6492 (Flookup_image_map):
6493 Don't assume fixnums fit in int.
6494 (compare_overlay_entries):
6495 Avoid mishandling comparisons due to subtraction overflow.
6496 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6497 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6498 (handle_tool_bar_click):
6499 Use int, not unsigned, since we prefer signed and the signedness
6500 doesn't matter here.
6501 (get_next_display_element, next_element_from_display_vector):
6502 Use int, not EMACS_INT, when int is wide enough.
6503 (start_hourglass): Use duration_to_sec_usec to do proper
6504 overflow checking on durations.
6505 * xfaces.c (Fbitmap_spec_p):
6506 Check that fixnums are in proper range for system types.
6507 (compare_fonts_by_sort_order):
6508 Avoid mishandling comparisons due to subtraction overflow.
6509 (Fx_family_fonts, realize_basic_faces):
6510 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6511 (Fx_family_fonts):
6512 Don't assume fixnum fits in int.
6513 Use SAFE_ALLOCA_LISP, not alloca.
6514 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6515 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6516 (face_at_buffer_position, face_for_overlay_string)
6517 (face_at_string_position):
6518 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6519 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6520 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6521 (Fx_show_tip):
6522 Check that fixnums are in proper range for system types.
6523 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6524 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6525 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6526 (Fx_change_window_property): Don't assume fixnums fit in int.
6527 * xfont.c (xfont_chars_supported):
6528 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6529 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6530 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6532 * xml.c (parse_region):
6533 * xrdb.c (magic_file_p):
6534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6535 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6536 (x_get_local_selection, x_reply_selection_request)
6537 (x_handle_selection_request, wait_for_property_change):
6538 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6539 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6540 short is wide enough.
6541 (x_send_client_event): Don't assume fixnum fits in int.
6542 * xterm.c (x_x_to_emacs_modifiers):
6543 Don't assume EMACS_INT overflows nicely into int.
6544 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6545 may come from Lisp.
6546 (handle_one_xevent): NATNUMP can eval its arg twice.
6547 (x_connection_closed):
6548 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6549 * xterm.h: Adjust decls to match defn changes elsewhere.
6550 (struct scroll_bar): Use struct vectorlike_header
6551 rather than rolling our own approximation.
6552 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6553
6554 2012-05-25 Glenn Morris <rgm@gnu.org>
6555
6556 * lisp.mk (lisp): Update for more files being compiled now.
6557
6558 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6559
6560 * lread.c: Remove `read_pure' which makes no difference.
6561 (read_pure): Remove var.
6562 (unreadpure): Remove function.
6563 (readevalloop): Don't call read_list with -1 flag.
6564 (read1, read_vector): Don't test read_pure any more.
6565 (read_list): Simplify.
6566
6567 * fileio.c, character.h: Minor style tweaks.
6568
6569 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6570
6571 * window.h (clip_changed): Remove useless declaration.
6572
6573 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
6574
6575 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6576 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6577
6578 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6579
6580 Remove src/m/*.
6581 This directory predates autoconf and is no longer needed nowadays.
6582 Move its few remaining bits of functionality to where they're needed.
6583 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6584 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6585 * m/template.h: Remove.
6586 * Makefile.in (M_FILE): Remove. All uses removed.
6587 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6588 * lisp.h (USE_LSB_TAG):
6589 * mem-limits.h (EXCEEDS_LISP_PTR):
6590 Use VAL_MAX, not VALBITS, in #if.
6591 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6592 (EMACS_UINT): Define unconditionally now.
6593 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6594 (BITS_PER_EMACS_INT): New constants, replacing
6595 what used to be in config.h, but not useful in #if.
6596 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6597 define them any more.
6598 (VAL_MAX): New macro.
6599 (VALMASK): Use it.
6600 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6601 BITS_PER_EMACS_INT, in #if.
6602 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6603 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6604 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6605 * s/ms-w32.h (DATA_START):
6606 Move here from removed file m/intel386.h.
6607 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6608 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6609
6610 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6611
6612 Assume C89 or later.
6613 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6614 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6615 (xrealloc):
6616 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6617 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6618 * textprop.c, tparam.c (NULL): Remove.
6619 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6620 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6621 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
6622 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6623 * xterm.c (input_signal_count): Assume volatile works.
6624
6625 2012-05-21 Ken Brown <kbrown@cornell.edu>
6626
6627 * xgselect.c (xg_select): Fix first argument in call to 'select'
6628 (bug#11508).
6629
6630 2012-05-20 Ken Brown <kbrown@cornell.edu>
6631
6632 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
6633 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
6634
6635 2012-05-19 Ken Brown <kbrown@cornell.edu>
6636
6637 * xfns.c (x_in_use): Remove `static' qualifier.
6638 * xterm.h (x_in_use): Declare.
6639 * xgselect.c: Include xterm.h.
6640 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6641 and `display_arg' (bug#9754).
6642
6643 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6644
6645 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6646
6647 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6648 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6649
6650 2012-05-18 Eli Zaretskii <eliz@gnu.org>
6651
6652 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6653
6654 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
6655 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
6656
6657 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6658 reference to image_cache->refcount.
6659 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6660
6661 2012-05-17 Juri Linkov <juri@jurta.org>
6662
6663 * search.c (Fword_search_regexp, Fword_search_backward)
6664 (Fword_search_forward, Fword_search_backward_lax)
6665 (Fword_search_forward_lax): Move functions to isearch.el
6666 (bug#10145, bug#11381).
6667
6668 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6669
6670 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6671
6672 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6673
6674 * lread.c (init_obarray): Declare Qt and Qnil as special.
6675
6676 2012-05-14 Glenn Morris <rgm@gnu.org>
6677
6678 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
6679 Put "libexec" before "bin", for the sake of init_callproc_1.
6680
6681 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6682
6683 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6684
6685 * unexaix.c: Port to more-recent AIX compilers.
6686 (report_error, report_error_1, make_hdr, copy_sym)
6687 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6688 Make arguments const char *, not char *, to avoid violations of C
6689 standard and to fix some AIX warnings reported by Gilles Pion.
6690
6691 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6692
6693 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6694 already have overlays loaded.
6695 (handle_single_display_spec): Before returning without displaying
6696 fringe bitmap, synchronize the bidi iterator with the main display
6697 iterator, by calling iterate_out_of_display_property.
6698 (iterate_out_of_display_property): Detect buffer iteration by
6699 testing that it->string is a Lisp string.
6700 (get_next_display_element): When the current object is exhausted,
6701 and there's something on it->stack, call set_iterator_to_next to
6702 proceed with what's on the stack, instead of returning zero.
6703 (set_iterator_to_next): If called at the end of a Lisp string,
6704 proceed to consider_string_end without incrementing string
6705 position. Don't increment display vector index past the end of
6706 the display vector. (Bug#11417)
6707 (pos_visible_p): Don't report a position visible when move_it_to
6708 stopped at the last line of window, which happens to be scanned
6709 backwards by the bidi iteration. (Bug#11464)
6710
6711 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6712
6713 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6714 and right-margin display specs even if the spec is invalid or we
6715 are on a TTY, and thus unable to display on the fringes.
6716 That's because the text with the property will not be displayed anyway,
6717 so we need to signal to the caller that this is a "replacing"
6718 display spec. This fixes display when the spec is invalid or we
6719 are on a TTY.
6720
6721 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6722
6723 * unexaix.c (make_hdr): Fix typo in prototype.
6724 This bug broke the build on AIX. Problem reported by Gilles Pion.
6725
6726 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
6727
6728 * keyboard.c (kbd_buffer_get_event): Read special events also in
6729 batch mode. (Bug#11415)
6730
6731 2012-05-12 Glenn Morris <rgm@gnu.org>
6732
6733 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6734
6735 2012-05-12 Eli Zaretskii <eliz@gnu.org>
6736
6737 * lisp.mk (lisp): Add newcomment.elc.
6738
6739 2012-05-12 Glenn Morris <rgm@gnu.org>
6740
6741 * Makefile.in (MKDIR_P): New, set by configure.
6742 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6743
6744 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6745
6746 Remove unused function hourglass_started.
6747 * dispextern.h (hourglass_started):
6748 * w32fns.c (hourglass_started):
6749 * xdisp.c (hourglass_started): Remove.
6750
6751 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
6752
6753 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6754 Update dependencies.
6755
6756 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6757
6758 * xgselect.c (xg_select): Put maxfds+1 into a var.
6759 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6760
6761 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6762
6763 2012-05-10 Dave Abrahams <dave@boostpro.com>
6764
6765 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6766 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6767
6768 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
6769
6770 * dbusbind.c (xd_registered_buses): New internal Lisp object.
6771 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6772 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6773 Initialize xd_registered_buses.
6774
6775 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6776
6777 Untag more efficiently if USE_LSB_TAG.
6778 This is based on a proposal by YAMAMOTO Mitsuharu in
6779 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6780 For an admittedly artificial (nth 8000 longlist) benchmark on
6781 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
6782 Emacs's overall text size by 1%.
6783 * lisp.h (XUNTAG): New macro.
6784 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6785 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6786 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6787 * eval.c (Fautoload):
6788 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6789 * frame.h (XFRAME): Use XUNTAG.
6790
6791 Port recent dbusbind.c changes to 32-bit --with-wide-int.
6792 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6793 Remove unportable assumptions about print widths of types like
6794 dbus_uint32_t.
6795 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6796 intptr_t when converting between pointer and integer, to avoid GCC
6797 warnings about wrong width.
6798
6799 2012-05-09 Eli Zaretskii <eliz@gnu.org>
6800
6801 * w32proc.c (new_child): Force Windows to reserve only 64KB of
6802 stack for each reader_thread, instead of defaulting to 8MB
6803 determined by the linker. This avoids failures in creating
6804 subprocesses on Windows 7, see the discussion in this thread:
6805 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6806
6807 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6808
6809 Fix up display of the *Minibuf-0* buffer in the mini window.
6810 * keyboard.c (read_char): Don't clear the echo area if there's no
6811 message to clear.
6812 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
6813 contents of *Minibuf-0*) if there's no message displayed in its stead.
6814
6815 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
6816
6817 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6818 batch mode.
6819
6820 2012-05-06 Chong Yidong <cyd@gnu.org>
6821
6822 * lisp.mk (lisp): Update.
6823
6824 2012-05-05 Jim Meyering <meyering@redhat.com>
6825
6826 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6827
6828 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6829
6830 * data.c (PUT_ERROR): New macro.
6831 (syms_of_data): Use it. Add new error type `user-error'.
6832 * undo.c (user_error): New function.
6833 (Fprimitive_undo): Use it.
6834 * print.c (print_error_message): Adjust print style for `user-error'.
6835 * keyboard.c (user_error): New function.
6836 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6837
6838 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6839
6840 Do not limit current-time-string to years 1000..9999.
6841 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6842 (Fcurrent_time_string): Support any year that is supported by the
6843 underlying localtime representation. Don't use asctime, as it
6844 has undefined behavior for years outside the range -999..9999.
6845
6846 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6847
6848 Fix race conditions involving setenv, gmtime, localtime, asctime.
6849 Without this fix, interrupts could mess up code that uses these
6850 nonreentrant functions, since setting TZ invalidates existing
6851 tm_zone or tzname values, and since most of these functions return
6852 pointers to static storage.
6853 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6854 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6855 Grow the critical sections to include not just invoking
6856 localtime/gmtime, but also accessing these functions' results
6857 including their tm_zone values if any, and any related TZ setting.
6858 (format_time_string): Last arg is now struct tm *, not struct tm **,
6859 so that the struct tm is saved in the critical section.
6860 All callers changed. Simplify allocation of initial buffer, partly
6861 motivated by the fact that memory allocation needs to be outside
6862 the critical section.
6863
6864 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6865
6866 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6867 with RESET_INTERVAL.
6868
6869 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6870 Remove duplicated buffer name initialization.
6871
6872 2012-05-02 Jim Meyering <jim@meyering.net>
6873
6874 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6875
6876 * xfns.c (x_window): Use xstrdup (Bug#11375).
6877
6878 2012-05-02 Eli Zaretskii <eliz@gnu.org>
6879
6880 * xdisp.c (pos_visible_p): If already at a newline from the
6881 display string before the 'while' loop, don't walk back the glyphs
6882 from it3.glyph_row. Solves assertion violation when the display
6883 string begins with a newline (egg.el). (Bug#11367)
6884
6885 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6886
6887 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6888 Move to simple.el.
6889
6890 2012-05-01 Glenn Morris <rgm@gnu.org>
6891
6892 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6893 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6894 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6895 All were removed before 23.1.
6896
6897 * dispnew.c: Remove HAVE_LIBNCURSES test;
6898 it is always true on relevant platforms.
6899
6900 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6901 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6902
6903 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6904
6905 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6906
6907 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6908 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6909 Remove.
6910
6911 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6912
6913 Do not avoid creating empty evaporating overlays (Bug#9642).
6914 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6915 That is, do not delete an evaporating overlay if it becomes
6916 empty after its bounds are adjusted to fit within its buffer.
6917 This fix caused other problems, and I'm reverting it until we get
6918 to the bottom of them.
6919
6920 2012-04-27 Chong Yidong <cyd@gnu.org>
6921
6922 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6923
6924 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6925
6926 * xdisp.c (pos_visible_p): If the window start position is beyond
6927 ZV, start the display from buffer beginning. Prevents assertion
6928 violation in init_iterator when the minibuffer window is scrolled
6929 via the scroll bar.
6930
6931 * window.c (window_scroll_pixel_based): Likewise.
6932
6933 2012-04-27 Chong Yidong <cyd@gnu.org>
6934
6935 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6936
6937 2012-04-27 Glenn Morris <rgm@gnu.org>
6938
6939 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6940 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6941
6942 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6943
6944 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6945 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
6946
6947 2012-04-26 Eli Zaretskii <eliz@gnu.org>
6948
6949 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6950 display element, check also the underlying string or buffer
6951 character. (Bug#11341)
6952
6953 * w32menu.c: Include w32heap.h.
6954 (add_menu_item): If the call to AppendMenuW (via
6955 unicode_append_menu) fails, disable Unicode menus only if we are
6956 running on Windows 9X/Me.
6957
6958 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6959
6960 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6961 (xgetint): Add missing shift for LSB tags.
6962
6963 2012-04-24 Martin Rudalics <rudalics@gmx.at>
6964
6965 * keyboard.c (read_char): Don't wipe echo area for select window
6966 events: These might get delayed via `mouse-autoselect-window'
6967 (Bug#11304).
6968
6969 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
6970
6971 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6972 manipulation of :loaded-from data.
6973
6974 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
6975
6976 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6977 now a cons (bug#11311).
6978
6979 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6980
6981 Do not create empty overlays with the evaporate property (Bug#9642).
6982 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6983 if it becomes empty after its bounds are adjusted to fit within
6984 its buffer. Without this fix, in a nonempty buffer (let ((o
6985 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6986 yields an empty overlay that has the evaporate property, which is
6987 not supposed to happen.
6988
6989 Fix minor GTK3 problems found by static checking.
6990 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6991 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6992 (struct _EmacsFixedClass, emacs_fixed_get_type):
6993 Move decls here from emacsgtkfixed.h, since they needn't be public.
6994 (emacs_fixed_get_type): Now static.
6995 (emacs_fixed_class_init): Omit unused local.
6996 (emacs_fixed_child_type): Remove; unused.
6997 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6998 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6999 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7000 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7001 (EMACS_FIXED_GET_CLASS): Remove; unused.
7002 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7003
7004 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7005 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7006
7007 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7008
7009 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7010 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7011 (__malloc_size_t, __malloc_ptrdiff_t):
7012 Remove. All uses removed, replaced by the definiens if needed,
7013 since we can assume C89 or better now.
7014 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7015 (protect_malloc_state, align, get_contiguous_space)
7016 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7017 (malloc_atfork_handler_child, malloc_enable_thread)
7018 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7019 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7020 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7021 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7022 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7023 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7024 Define using prototypes, not old style.
7025 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7026 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7027 (align): Don't assume that signed integer overflow wraps around.
7028 Omit unused local var.
7029 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7030 (_free_internal_nolock, memalign, mallochook, reallochook):
7031 Omit no-longer-needed casts.
7032 (valloc): Use getpagesize, not __getpagesize.
7033 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7034 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7035
7036 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7037
7038 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7039
7040 Move functions from C to Lisp. Make non-blocking method calls
7041 the default. Implement further D-Bus standard interfaces.
7042
7043 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7044 (QCdbus_request_name_allow_replacement)
7045 (QCdbus_request_name_replace_existing)
7046 (QCdbus_request_name_do_not_queue)
7047 (QCdbus_request_name_reply_primary_owner)
7048 (QCdbus_request_name_reply_in_queue)
7049 (QCdbus_request_name_reply_exists)
7050 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7051 (QCdbus_registered_serial, QCdbus_registered_method)
7052 (QCdbus_registered_signal): New Lisp objects.
7053 (XD_DEBUG_MESSAGE): Use sizeof.
7054 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7055 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7056 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7057 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7058 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7059 (xd_signature, xd_append_arg): Allow float for integer types.
7060 (xd_get_connection_references): New function.
7061 (xd_get_connection_address): Rename from xd_initialize.
7062 Return cached address.
7063 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7064 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7065 level.
7066 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7067 Return number of refcounts.
7068 (Fdbus_get_unique_name): Make stronger parameter check.
7069 (Fdbus_message_internal): New defun.
7070 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7071 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7072 (Fdbus_send_signal, Fdbus_register_service)
7073 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7074 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7075 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7076 (Vdbus_compiled_version, Vdbus_runtime_version)
7077 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7078 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7079 (Vdbus_message_type_signal): New defvars.
7080 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7081 Adapt docstring.
7082
7083 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7084
7085 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7086 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7087 Do not assume ptrdiff_t is the same width as 'int'.
7088
7089 * alloc.c: Handle unusual debugging option combinations.
7090 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7091 since the two debugging options are incompatible.
7092 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7093 is defined.
7094 (mem_init, mem_insert, mem_insert_fixup):
7095 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7096 (NEED_MEM_INSERT): Remove; no longer needed.
7097
7098 2012-04-22 Leo Liu <sdl.web@gmail.com>
7099
7100 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7101
7102 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7103
7104 * sysdep.c [__FreeBSD__]: Minor cleanups.
7105 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7106 Use Emacs indenting style more consistently. Avoid some casts.
7107 Use 'double' consistently rather than mixing 'float' and 'double'.
7108
7109 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7110
7111 * sysdep.c (list_system_processes, system_process_attributes):
7112 Add implementation for FreeBSD (Bug#5243).
7113
7114 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7115
7116 * lisp.mk (lisp): Update.
7117
7118 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7119
7120 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7121 It is never used otherwise.
7122
7123 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7124
7125 * print.c (print_preprocess): Only check print_depth if print-circle
7126 is nil.
7127 (print_object): Check for cycles even when print-circle is nil and
7128 print-gensym is t, but only check print_depth if print-circle is nil.
7129
7130 2012-04-20 Chong Yidong <cyd@gnu.org>
7131
7132 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7133 set the status to "failed" and ensure that sentinel is run.
7134
7135 2012-04-20 Glenn Morris <rgm@gnu.org>
7136
7137 * process.c (Fset_process_inherit_coding_system_flag)
7138 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7139 (Fmake_network_process, Fmake_serial_process): Doc fix.
7140
7141 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7142
7143 * xdisp.c (string_buffer_position_lim): Limit starting position to
7144 BEGV.
7145 (set_cursor_from_row): If called for a mode-line or header-line
7146 row, return zero immediately.
7147 (try_cursor_movement): If inside continuation line, don't back up
7148 farther than the first row after the header line, if any.
7149 Don't consider the header-line row as "partially visible", even if
7150 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7151
7152 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7153
7154 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7155 (bug#11238).
7156
7157 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7158 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7159
7160 configure: new option --enable-gcc-warnings (Bug#11207)
7161 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7162 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7163 (ALL_CFLAGS): Use new macros rather than old.
7164 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7165 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7166 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7167 -Wunused-result, -Wunused-variable. This should go away once
7168 the Emacs and Gnulib regex code is merged.
7169 (xmalloc, xrealloc): Now static.
7170
7171 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7172
7173 * dired.c (Fsystem_groups): Remove unused local.
7174
7175 2012-04-17 Glenn Morris <rgm@gnu.org>
7176
7177 * dired.c (Fsystem_users): Doc fix.
7178
7179 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7180
7181 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7182 (syms_of_dired): Add them.
7183
7184 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7185
7186 Fix minor alloc.c problems found by static checking.
7187 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7188 New extern decls, to avoid calling undeclared functions.
7189 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7190 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7191 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7192 (NEED_MEM_INSERT): New macro.
7193 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7194 Remove one incorrect comment and fix another.
7195
7196 Fix minor ralloc.c problems found by static checking.
7197 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7198 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7199 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7200 (r_alloc_sbrk): Now static.
7201
7202 Improve ralloc.c interface checking.
7203 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7204 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7205 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7206 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7207 [REL_ALLOC]: ... to here, to check interface.
7208 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7209 Remove decls. This fixes an "It stinks!".
7210
7211 * alloc.c (which_symbols): Fix alignment issue / type clash.
7212
7213 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7214
7215 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7216 (struct Lisp_Misc_Any): Likewise.
7217 (struct Lisp_Free): Likewise.
7218 * alloc.c (union aligned_Lisp_Symbol): Define.
7219 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7220 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7221 (union aligned_Lisp_Misc): Define.
7222 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7223 aligned_Lisp_Misc instead of union Lisp_Misc.
7224 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7225
7226 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7227
7228 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7229 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7230 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7231 * s/netbsd.h, s/sol2-6.h:
7232 Remove definition of GC_MARK_STACK, since the default now works.
7233 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7234 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7235 no longer the default.
7236 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7237
7238 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7239
7240 * lread.c (lisp_file_lexically_bound_p):
7241 Fix hang at ";-*-\n" (bug#11238).
7242
7243 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7244
7245 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7246 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7247
7248 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7249
7250 * nsterm.m (constrainFrameRect): Always constrain when there is only
7251 one screen (Bug#10962).
7252
7253 2012-04-13 Ken Brown <kbrown@cornell.edu>
7254
7255 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7256
7257 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7258
7259 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7260
7261 2012-04-11 Daniel Colascione <dancol@dancol.org>
7262
7263 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7264 against is gone. It's better to use vfork now so that when Cygwin
7265 gains a new, working vfork, we use it automatically (bug#10398).
7266
7267 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7268
7269 * window.c (save_window_save): Obey window-point-insertion-type.
7270
7271 2012-04-11 Glenn Morris <rgm@gnu.org>
7272
7273 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7274
7275 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7276
7277 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7278
7279 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7280
7281 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7282 (force_quit_count): New var.
7283 (handle_interrupt): Use it.
7284
7285 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7286
7287 * w32.c (w32_delayed_load): Record the full path of the library
7288 being loaded (bug#10424).
7289
7290 2012-04-09 Glenn Morris <rgm@gnu.org>
7291
7292 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7293 not just in the obarray, before snarfing them. (Bug#11036)
7294
7295 * Makefile.in ($(leimdir)/leim-list.el):
7296 Pass EMACS rather than BUILT_EMACS.
7297
7298 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7299
7300 * process.c (make_process):
7301 * process.h: Add integer `gnutls_handshakes_tried' member to
7302 process struct.
7303
7304 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7305 Add convenience `GNUTLS_LOG2i' macro.
7306
7307 * gnutls.c (gnutls_log_function2i): Convenience log function.
7308 (emacs_gnutls_read): Use new log functions,
7309 `gnutls_handshakes_tried' process member, and
7310 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7311 attempts per process (connection).
7312
7313 2012-04-09 Chong Yidong <cyd@gnu.org>
7314
7315 * eval.c (Fuser_variable_p, user_variable_p_eh)
7316 (lisp_indirect_variable): Functions deleted.
7317 (Fdefvar): Caller changed.
7318
7319 * callint.c (Finteractive, Fcall_interactively):
7320 * minibuf.c (Fread_variable): Callers changed.
7321
7322 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7323
7324 * xdisp.c (set_cursor_from_row): If the display string appears in
7325 the buffer at position that is closer to point than the position
7326 after the display string, display the cursor on the first glyph of
7327 the display string. Fixes cursor display when a 'display' text
7328 property immediately follows invisible text. (Bug#11094)
7329
7330 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7331
7332 composite.c: use 'double' consistently
7333 * composite.c (get_composition_id): Use 'double' consistently
7334 instead of converting 'float' to 'double' and vice versa; this is
7335 easier to understand and avoids a GCC warning.
7336
7337 2012-04-09 Glenn Morris <rgm@gnu.org>
7338
7339 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7340 preparation for dumping it with emacs. (Bug#4789)
7341 (leimdir): New variable.
7342 ($(leimdir)/leim-list.el): New rule.
7343 (emacs$(EXEEXT)): Depend on leim-list.el.
7344
7345 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7346 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7347 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7348
7349 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7350
7351 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7352 proper alignment.
7353
7354 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7355
7356 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7357 Remove unused local variable.
7358
7359 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7360
7361 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7362 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7363 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7364 objects, as mark_maybe_pointer will catch them otherwise.
7365 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7366 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7367
7368 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7369
7370 Fix typo that broke non-Windows builds.
7371 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7372
7373 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7374
7375 Support building on MS-Windows with libxml2.
7376
7377 * makefile.w32-in (OBJ2): Add xml.$(O).
7378 (GLOBAL_SOURCES): Add xml.c.
7379 ($(BLD)/xml.$(O)): New dependency list.
7380
7381 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7382 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7383 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7384 [!WINDOWSNT]: New macros.
7385 (init_libxml2_functions, libxml2_loaded_p): New functions.
7386 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7387 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7388 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7389 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7390 linked in).
7391 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7392 Call init_libxml2_functions before calling libxml2 functions.
7393 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7394
7395 * emacs.c: Don't include libxml/parser.h.
7396 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7397 xmlCleanupParser directly.
7398
7399 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7400
7401 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7402
7403 * indent.c (Fvertical_motion): If there is a display string at
7404 point, use it.vpos to compute how many lines to backtrack after
7405 move_it_to point. (Bug#11133)
7406
7407 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7408
7409 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7410 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7411 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7412 macros related to unification of CJK characters. For the details,
7413 see the discussion following the message here:
7414 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7415
7416 2012-04-04 Chong Yidong <cyd@gnu.org>
7417
7418 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7419
7420 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7421
7422 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7423 instead of alloca. (Bug#11138)
7424
7425 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7426
7427 * w32menu.c (is_simple_dialog): Properly check lisp types.
7428 (Bug#11141)
7429
7430 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7431
7432 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7433 position we get to after a call to move_it_to fails the
7434 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7435 only if we wind up in a string from display property. (Bug#11063)
7436
7437 * window.c (Fdelete_other_windows_internal): Invalidate the row
7438 and column information about mouse highlight, so that redisplay
7439 restores it after reallocating the glyph matrices. (Bug#7464)
7440
7441 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7442 string comes from a `display' text property, use the buffer
7443 position of that property as if we actually saw that position in
7444 the row's glyphs.
7445 (move_it_by_lines): Remove the assertion that
7446 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7447 violated when there's a before-string at the beginning of a line.
7448 (Bug#11063)
7449
7450 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7451
7452 * xdisp.c (append_space_for_newline): If the default face was
7453 remapped, use the remapped face for the appended newline.
7454 (extend_face_to_end_of_line): Use the remapped default face for
7455 extending the face to the end of the line.
7456 (display_line): Call extend_face_to_end_of_line when the default
7457 face was remapped. (Bug#11068)
7458
7459 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7460
7461 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7462
7463 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7464
7465 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7466
7467 2012-03-27 Glenn Morris <rgm@gnu.org>
7468
7469 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7470 Doc fixes.
7471
7472 2012-03-26 Kenichi Handa <handa@m17n.org>
7473
7474 * dispextern.h (struct glyph): Fix previous change. Change the
7475 bit length of glyphless.ch to 25 (Bug#11082).
7476
7477 2012-03-26 Chong Yidong <cyd@gnu.org>
7478
7479 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7480 (command_loop_1): Use it; inhibit selection update for
7481 handle-select-window too (Bug#8996).
7482
7483 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7484
7485 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7486
7487 2012-03-25 Kenichi Handa <handa@m17n.org>
7488
7489 * dispextern.h (struct glyph): Change the bit length of
7490 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7491
7492 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7493
7494 * s/ms-w32.h (tzname): Include time.h before redirecting to
7495 _tzname. Fixes the MSVC build. (Bug#9960)
7496
7497 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7498
7499 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7500 characters.
7501
7502 * xterm.c (XTread_socket): Only modify handling_signal if
7503 !SYNC_INPUT. (Bug#11080)
7504
7505 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7506
7507 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7508 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7509 when fetching a multibyte character consumes more bytes than
7510 CHAR_BYTES returns, due to unification of CJK characters in
7511 string_char. (Bug#11073)
7512
7513 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7514
7515 * process.c (wait_reading_process_output): Handle pty disconnect
7516 by refraining from sending oneself a SIGCHLD (bug#10933).
7517
7518 2012-03-22 Chong Yidong <cyd@gnu.org>
7519
7520 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7521
7522 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7523 Mark string as coming from a prefix property.
7524 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7525 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7526
7527 2012-03-21 Chong Yidong <cyd@gnu.org>
7528
7529 * xfaces.c (Vface_remapping_alist): Doc fix.
7530
7531 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7532
7533 * w32proc.c (Fw32_set_console_codepage)
7534 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7535 Doc fixes.
7536
7537 2012-03-20 Chong Yidong <cyd@gnu.org>
7538
7539 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7540 to reflect default non-nil value of redisplay-dont-pause.
7541
7542 2012-03-19 Kenichi Handa <handa@m17n.org>
7543
7544 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7545 it fit in a valid range (Bug#11003).
7546
7547 2012-03-18 Eli Zaretskii <eliz@gnu.org>
7548
7549 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7550 that is not from display property, accept the row as a "cursor
7551 row" if one of the string's character has a non-nil `cursor'
7552 property. Fixes cursor positioning when there are newlines in
7553 overlay strings, e.g. in icomplete.el. (Bug#11035)
7554
7555 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7556
7557 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7558
7559 2012-03-12 Chong Yidong <cyd@gnu.org>
7560
7561 * eval.c (inhibit_lisp_code): Rename from
7562 inhibit_window_configuration_change_hook; move from window.c.
7563
7564 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7565 * window.c (run_window_configuration_change_hook)
7566 (syms_of_window): Callers changed.
7567
7568 2012-03-11 Chong Yidong <cyd@gnu.org>
7569
7570 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7571
7572 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7573
7574 2012-03-10 Chong Yidong <cyd@gnu.org>
7575
7576 * frame.c (other_visible_frames): Don't assume the selected frame
7577 is visible (Bug#10955).
7578
7579 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7580
7581 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7582
7583 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7584
7585 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7586 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7587 zero (Bug#10954).
7588
7589 2012-03-03 Glenn Morris <rgm@gnu.org>
7590
7591 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
7592
7593 2012-03-02 Eli Zaretskii <eliz@gnu.org>
7594
7595 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7596 position past the first glyph_row that ends at ZV. (Bug#10902)
7597 (redisplay_window, next_element_from_string): Fix typos in
7598 comments.
7599 (redisplay_window): Pass to move_it_vertically the margin in
7600 pixels, not in screen lines.
7601
7602 2012-03-02 Glenn Morris <rgm@gnu.org>
7603
7604 * buffer.c (buffer-list-update-hook): Doc fix.
7605
7606 2012-02-29 Eli Zaretskii <eliz@gnu.org>
7607
7608 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7609 push_it before setting up the iterator for the first overlay
7610 string, even if we have an empty string loaded.
7611 (next_overlay_string): If there's an empty string on the iterator
7612 stack, pop the stack. (Bug#10903)
7613
7614 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7615
7616 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7617 Suggested by Stefan Monnier in
7618 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7619 * alloc.c (widen_to_Lisp_Object): New static function.
7620 (mark_memory): Also mark Lisp_Objects by fetching pointer words
7621 and widening them to Lisp_Objects. This would work even if
7622 USE_LSB_TAG is defined and wide integers are used, which might
7623 happen in a future version of Emacs.
7624
7625 2012-02-25 Chong Yidong <cyd@gnu.org>
7626
7627 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7628 Doc fix.
7629
7630 * xselect.c (Fx_selection_exists_p): Doc fix.
7631 (x_clipboard_manager_save_all): Print an informative message
7632 before saving to clipboard manager.
7633
7634 2012-02-24 Chong Yidong <cyd@gnu.org>
7635
7636 * keyboard.c (process_special_events): Handle all X selection
7637 requests in kbd_buffer, not just the next one (Bug#8869).
7638
7639 2012-02-23 Chong Yidong <cyd@gnu.org>
7640
7641 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7642 call when setting menu-bar-lines and tool-bar-lines parameters.
7643 (unwind_create_frame_1): New helper function.
7644
7645 * window.c (inhibit_window_configuration_change_hook): New var.
7646 (run_window_configuration_change_hook): Obey it.
7647 (syms_of_window): Initialize it.
7648
7649 2012-02-22 Chong Yidong <cyd@gnu.org>
7650
7651 * xterm.c (x_draw_image_relief): Add missing type check for
7652 Vtool_bar_button_margin (Bug#10743).
7653
7654 2012-02-21 Chong Yidong <cyd@gnu.org>
7655
7656 * fileio.c (Vfile_name_handler_alist): Doc fix.
7657
7658 * buffer.c (Fget_file_buffer): Protect against invalid file
7659 handler return value.
7660
7661 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7662
7663 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7664 when computing $valmask.
7665
7666 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7667 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7668 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7669 It's useless in that case, and it can cause problems on hosts
7670 that allocate halves of EMACS_INT values separately.
7671 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7672 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7673 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7674 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7675 it avoids undefined behavior on hosts where shifting right by more
7676 than the word width has undefined behavior.
7677
7678 2012-02-19 Chong Yidong <cyd@gnu.org>
7679
7680 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7681 (Funhandled_file_name_directory, Ffile_name_as_directory)
7682 (Fdirectory_file_name, Fexpand_file_name)
7683 (Fsubstitute_in_file_name): Protect against invalid file handler
7684 return values (Bug#10845).
7685
7686 2012-02-18 Eli Zaretskii <eliz@gnu.org>
7687
7688 * .gdbinit (pitx): Fix incorrect references to fields of the
7689 iterator stack.
7690
7691 2012-02-17 Chong Yidong <cyd@gnu.org>
7692
7693 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7694
7695 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7696
7697 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7698 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7699
7700 2012-02-15 Chong Yidong <cyd@gnu.org>
7701
7702 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7703 marked as special. Also, starting docstrings with * is obsolete.
7704
7705 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7706
7707 * gnutls.c (emacs_gnutls_write): Fix last change.
7708
7709 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7710
7711 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7712 send_process.
7713
7714 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7715
7716 * keymap.c (Fsingle_key_description): Handle char ranges.
7717
7718 2012-02-12 Chong Yidong <cyd@gnu.org>
7719
7720 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7721 as that creates a dangerous corner case.
7722
7723 * window.c (Fdelete_window_internal): Invalidate the mouse
7724 highlight (Bug#9904).
7725
7726 2012-02-12 Glenn Morris <rgm@gnu.org>
7727
7728 * xselect.c (Fx_own_selection_internal)
7729 (Fx_get_selection_internal, Fx_disown_selection_internal)
7730 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7731 * nsselect.m (Fx_own_selection_internal)
7732 (Fx_disown_selection_internal, Fx_selection_exists_p)
7733 (Fx_selection_owner_p, Fx_get_selection_internal):
7734 Sync docs and argument specs with the xselect.c versions.
7735
7736 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
7737
7738 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7739
7740 2012-02-11 Eli Zaretskii <eliz@gnu.org>
7741
7742 * w32select.c (Fx_selection_exists_p): Sync doc string and
7743 argument list with xselect.c. (Bug#10783)
7744
7745 * w16select.c (Fx_selection_exists_p): Sync doc string and
7746 argument list with xselect.c. (Bug#10783)
7747
7748 2012-02-10 Glenn Morris <rgm@gnu.org>
7749
7750 * fns.c (Fsecure_hash): Doc fix.
7751
7752 2012-02-09 Kenichi Handa <handa@m17n.org>
7753
7754 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7755
7756 2012-02-07 Chong Yidong <cyd@gnu.org>
7757
7758 * buffer.c (Fbuffer_local_variables)
7759 (buffer_lisp_local_variables): Handle unbound vars correctly;
7760 don't let Qunbound leak into Lisp.
7761
7762 2012-02-07 Glenn Morris <rgm@gnu.org>
7763
7764 * image.c (Fimagemagick_types): Doc fix.
7765
7766 * image.c (imagemagick-render-type): Change it from a lisp object
7767 to an integer. Move the doc here from the lisp manual.
7768 Treat all values not equal to 0 the same.
7769
7770 2012-02-06 Chong Yidong <cyd@gnu.org>
7771
7772 * doc.c (store_function_docstring): Avoid applying docstring of
7773 alias to base function (Bug#2603).
7774
7775 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7776
7777 * .gdbinit (pp1, pv1): Remove redundant defines.
7778 (pr): Use pp.
7779
7780 2012-02-04 Chong Yidong <cyd@gnu.org>
7781
7782 * nsterm.m: Declare a global (Bug#10694).
7783
7784 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7785
7786 * w32.c (get_emacs_configuration_options):
7787 Include --enable-checking, if specified, in the return value.
7788
7789 2012-02-04 Martin Rudalics <rudalics@gmx.at>
7790
7791 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7792 after rounding frame sizes. (Bug#9723)
7793
7794 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7795
7796 * keyboard.c (adjust_point_for_property): Don't position point
7797 before BEGV. (Bug#10696)
7798
7799 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7800
7801 Handle overflow when computing char display width (Bug#9496).
7802 * character.c (char_width): Return EMACS_INT, not int.
7803 (char_width, c_string_width): Check for overflow when
7804 computing the width; this is possible now that individual
7805 characters can have unbounded width. Problem introduced
7806 by merge from Emacs 23 on 2012-01-19.
7807
7808 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
7809
7810 * dbusbind.c (Fdbus_register_method): Mention the return value
7811 :ignore in the docstring.
7812
7813 2012-02-02 Glenn Morris <rgm@gnu.org>
7814
7815 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7816
7817 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7818 Unconditionally set to t. (Bug#10673)
7819 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7820 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7821 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7822
7823 2012-02-02 Kenichi Handa <handa@m17n.org>
7824
7825 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7826 0, do not call append_composite_glyph.
7827
7828 2012-02-02 Kenichi Handa <handa@m17n.org>
7829
7830 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7831 NULL (Bug#6988).
7832 (x_produce_glyphs): If the component of a composition is a null
7833 string, set it->pixel_width to 1 to avoid zero-width glyph.
7834
7835 2012-02-01 Eli Zaretskii <eliz@gnu.org>
7836
7837 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7838 first 2 arguments are identical. This makes inserting large
7839 output from a subprocess an order of magnitude faster on
7840 MS-Windows, where all sbrk'ed memory is always contiguous.
7841
7842 2012-01-31 Glenn Morris <rgm@gnu.org>
7843
7844 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7845 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7846 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7847
7848 2012-01-29 Glenn Morris <rgm@gnu.org>
7849
7850 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7851
7852 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7853
7854 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7855
7856 2012-01-28 Chong Yidong <cyd@gnu.org>
7857
7858 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7859
7860 2012-01-26 Chong Yidong <cyd@gnu.org>
7861
7862 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7863
7864 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7865 repeat counts (Bug#10507).
7866
7867 2012-01-26 Glenn Morris <rgm@gnu.org>
7868
7869 * lread.c (syms_of_lread): Doc fix.
7870
7871 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7872
7873 * coding.c (encode_designation_at_bol): Change return value to
7874 EMACS_INT.
7875
7876 2012-01-25 Chong Yidong <cyd@gnu.org>
7877
7878 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7879
7880 2012-01-21 Chong Yidong <cyd@gnu.org>
7881
7882 * floatfns.c (Fcopysign): Make the second argument non-optional,
7883 since nil is not allowed anyway.
7884
7885 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7886
7887 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7888 (send_process): Likewise.
7889
7890 2012-01-19 Martin Rudalics <rudalics@gmx.at>
7891
7892 * window.c (save_window_save, Fcurrent_window_configuration)
7893 (Vwindow_persistent_parameters): Do not use Qstate.
7894 Rewrite doc-strings.
7895
7896 2012-01-19 Kenichi Handa <handa@m17n.org>
7897
7898 * character.c (char_width): New function.
7899 (Fchar_width, c_string_width, lisp_string_width):
7900 Use char_width (Bug#9496).
7901
7902 2012-01-16 Martin Rudalics <rudalics@gmx.at>
7903
7904 * window.c (Vwindow_persistent_parameters): New variable.
7905 (Fset_window_configuration, save_window_save): Handle persistent
7906 window parameters.
7907
7908 2012-01-14 Eli Zaretskii <eliz@gnu.org>
7909
7910 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7911 thrashing the stack of the thread. (Bug#9087)
7912
7913 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7914
7915 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7916
7917 2012-01-11 Eli Zaretskii <eliz@gnu.org>
7918
7919 * xdisp.c (rows_from_pos_range): Handle the case where the
7920 highlight ends on a newline. (Bug#10464)
7921 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7922 he end column for display of highlight that ends on a newline
7923 before a R2L line.
7924
7925 2012-01-11 Glenn Morris <rgm@gnu.org>
7926
7927 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7928 from load-path also when installation-directory is nil. (Bug#10208)
7929
7930 2012-01-10 Glenn Morris <rgm@gnu.org>
7931
7932 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7933
7934 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7935 Update template values to be closer to their typical values these days.
7936
7937 2012-01-09 Eli Zaretskii <eliz@gnu.org>
7938
7939 * xdisp.c (rows_from_pos_range): Accept additional argument
7940 DISP_STRING, and accept any glyph in a row whose object is that
7941 string as eligible for mouse highlight. Fixes mouse highlight of
7942 display strings from overlays. (Bug#10464)
7943
7944 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
7945
7946 emacs: fix an auto-save permissions race condition (Bug#10400)
7947 * fileio.c (auto_saving_dir_umask): New static var.
7948 (Fmake_directory_internal): Use it.
7949 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7950 creating the directory. The old code temporarily assigns
7951 too-generous permissions to the directory.
7952 (do_auto_save_eh): Clear it.
7953 (Fdo_auto_save): Catch all errors, not just file errors, so
7954 that the var is always cleared.
7955
7956 2012-01-07 Eli Zaretskii <eliz@gnu.org>
7957
7958 * search.c (scan_buffer): Pass character positions to
7959 know_region_cache, not byte positions. (Bug#6540)
7960
7961 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
7962
7963 * w32.c (sys_rename): Report EXDEV when rename of a directory
7964 fails because the target is on another logical disk. (Bug#10284)
7965
7966 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7967
7968 * xterm.c (x_embed_request_focus): New function.
7969
7970 * xterm.h: Add prototype.
7971
7972 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7973
7974 2012-01-05 Glenn Morris <rgm@gnu.org>
7975
7976 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7977
7978 2012-01-01 Eli Zaretskii <eliz@gnu.org>
7979
7980 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7981 Load gnutls_transport_set_lowat only if GnuTLS version is below
7982 2.11.1.
7983 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7984 GnuTLS versions below 2.11.1.
7985
7986 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7987
7988 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7989 to the doc string advising against its use for altering the way
7990 windows are scrolled.
7991
7992 2011-12-28 Kenichi Handa <handa@m17n.org>
7993
7994 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7995 coding-system ASCII compatible only when it does not produce BOM
7996 on encoding (Bug#10383).
7997
7998 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7999
8000 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8001 can scroll.
8002 (create_and_show_popup_menu): Always use menu_position_func for
8003 Gtk3 (Bug#10361).
8004
8005 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8006
8007 * callint.c (Fcall_interactively): Don't truncate prompt string.
8008
8009 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8010
8011 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8012 property that ends at ZV, so that the bidi iteration could be
8013 resumed from there (after widening). (Bug#10360)
8014
8015 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8016
8017 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8018
8019 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8020
8021 * nsterm.m (x_free_frame_resources):
8022 Release f->output_data.ns->miniimage.
8023 (ns_index_color): Fix indentation. Do not retain
8024 color_table->colors[i].
8025
8026 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8027 before returning.
8028
8029 * nsfns.m (x_set_background_color): Assign return value from
8030 ns_index_color to face-background instead of NSColor*.
8031 (ns_implicitly_set_icon_type): Fix indentation.
8032 Change assignment in for loop to comparison.
8033
8034 * emacs.c (ns_pool): New variable.
8035 (main): Assign ns_pool.
8036 (Fkill_emacs): Call ns_release_autorelease_pool.
8037
8038 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8039 autorelease fdesc, release fdAttrs and tdict.
8040 (ns_get_covering_families): Release charset.
8041 (ns_findfonts): Release NSFontDescriptor created with new.
8042 (ns_uni_to_glyphs): Fix indentation.
8043 (setString): Release attrStr before assigning new value.
8044
8045 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8046
8047 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8048 and NS_IMPL_COCOA.
8049 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8050 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8051
8052 2011-12-18 David Reitter <reitter@cmu.edu>
8053
8054 * nsterm.m (ns_term_init): Subscribe for notifications
8055 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8056 to method trackingNotification in EmacsMenu.
8057
8058 * nsmenu.m (trackingMenu): New variable.
8059 (trackingNotification): New method (from Aquamacs).
8060 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8061 from Aquamacs (Bug#7030).
8062
8063 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8064
8065 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8066 (symbol_to_nsstring): Fix indentation.
8067 (ns_symbol_to_pb): New function.
8068 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8069 (Fns_rotate_cut_buffers_internal): Remove.
8070 (Fns_store_selection_internal): Rename from
8071 Fns_store_cut_buffer_internal.
8072 (ns_get_foreign_selection, Fx_own_selection_internal)
8073 (Fx_disown_selection_internal, Fx_selection_exists_p)
8074 (Fns_get_selection_internal, Fns_store_selection_internal):
8075 Use ns_symbol_to_pb and check if return value is nil.
8076 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8077 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8078 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8079 renamed to Sns_store_selection_internal.
8080 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8081 and remove this function.
8082 (ns_handle_selection_clear): Remove, never used.
8083 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8084 here.
8085
8086 2011-12-17 Ken Brown <kbrown@cornell.edu>
8087
8088 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8089 GID is unknown (Bug#10257).
8090
8091 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8092
8093 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8094 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8095 which caused a build failure on GNU/Linux IA-64. This problem was
8096 introduced by my 2011-10-07 patch.
8097
8098 2011-12-15 Juri Linkov <juri@jurta.org>
8099
8100 * image.c (imagemagick_error): New function. (Bug#10112)
8101 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8102 Use `imagemagick_error' where ImageMagick functions return
8103 `MagickFalse'.
8104 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8105 proper order.
8106
8107 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8108
8109 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8110 fill background (Bug#8992).
8111
8112 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8113
8114 * window.c (Vwindow_combination_resize)
8115 (Vwindow_combination_limit): Use t instead of non-nil in
8116 doc-strings.
8117 (Vrecenter_redisplay): Add first sentence of doc-string on
8118 separate line.
8119 (Frecenter): Fix doc-string typo.
8120
8121 2011-12-11 Kenichi Handa <handa@m17n.org>
8122
8123 * coding.c (Funencodable_char_position): Pay attention to the
8124 buffer text relocation (Bug#9389).
8125
8126 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8127
8128 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8129 gtk_init (Bug#10100).
8130
8131 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8132
8133 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8134 IT->string is nil. (Bug#10263)
8135
8136 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8137
8138 * nsterm.h (x_free_frame_resources): Declare.
8139
8140 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8141 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8142
8143 * nsterm.h (ns_get_defaults_value): Declare.
8144
8145 * nsterm.m (ns_default): Call ns_get_defaults_value.
8146
8147 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8148
8149 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8150 (Bug#10170)
8151
8152 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8153
8154 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8155 that where the value of an _OBJC_* symbol points to is in the .bss
8156 section (Bug#10240).
8157
8158 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8159
8160 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8161 after the loop to call ccl_driver at least once (Bug#8619).
8162
8163 2011-12-08 Kenichi Handa <handa@m17n.org>
8164
8165 * ftfont.c (get_adstyle_property): Fix previous change
8166 (Bug#10233).
8167
8168 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8169
8170 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8171 dirs from the default value of EMACSLOADPATH (bug#10208).
8172
8173 2011-12-07 Glenn Morris <rgm@gnu.org>
8174
8175 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8176 installation and source directories as well. (Bug#10208)
8177
8178 2011-12-06 Chong Yidong <cyd@gnu.org>
8179
8180 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8181
8182 2011-12-06 Glenn Morris <rgm@gnu.org>
8183
8184 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8185 as an error, not just -1. (Bug#10217)
8186
8187 2011-12-05 Chong Yidong <cyd@gnu.org>
8188
8189 * keyboard.c (process_special_events): New function.
8190 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8191
8192 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8193
8194 * coding.c (encode_designation_at_bol): Don't use uninitialized
8195 local variable (Bug#9318).
8196
8197 2011-12-05 Kenichi Handa <handa@m17n.org>
8198
8199 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8200 return Qnil (Bug#8046, Bug#10193).
8201
8202 2011-12-05 Kenichi Handa <handa@m17n.org>
8203
8204 * coding.c (encode_designation_at_bol): New args charbuf_end and
8205 dst. Return the number of produced bytes. Callers changed.
8206 (coding_set_source): Return how many bytes coding->source was
8207 relocated.
8208 (coding_set_destination): Return how many bytes
8209 coding->destination was relocated.
8210 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8211 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8212
8213 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8214
8215 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8216 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8217 macro (Bug#9318).
8218
8219 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8220
8221 The following changes are to fix Bug#9318.
8222
8223 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8224 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8225 (encode_coding_iso_2022, encode_coding_sjis)
8226 (encode_coding_big5, encode_coding_charset): Use the above macros.
8227
8228 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8229
8230 * lisp.h (process_quit_flag): Fix external declaration.
8231
8232 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8233
8234 Don't macro-inline non-performance-critical code.
8235 * eval.c (process_quit_flag): New function.
8236 * lisp.h (QUIT): Use it.
8237
8238 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8239
8240 * nsfns.m (get_geometry_from_preferences): New function.
8241 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8242
8243 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8244
8245 * emacs.c (Qkill_emacs): Define.
8246 (syms_of_emacs): Initialize it.
8247 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8248 Qquit_flag to `kill-emacs' instead.
8249 (quit_throw_to_read_char): Add parameter `from_signal'.
8250 All callers changed. Call Fkill_emacs if requested and safe.
8251 * lisp.h (QUIT): Call Fkill_emacs if requested.
8252
8253 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8254
8255 * widget.c (update_wm_hints): Return if wmshell is null.
8256 (widget_update_wm_size_hints): New function.
8257
8258 * widget.h (widget_update_wm_size_hints): Declare.
8259
8260 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8261 widget_update_wm_size_hints (Bug#10104).
8262
8263 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8264
8265 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8266 before a newline, prepare the bidi iterator for consuming the
8267 newline, and keep the current paragraph direction. (Bug#10183)
8268 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8269
8270 2011-12-02 Juri Linkov <juri@jurta.org>
8271
8272 * search.c (Fword_search_regexp): New Lisp function created from
8273 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8274 (Fword_search_backward, Fword_search_forward)
8275 (Fword_search_backward_lax, Fword_search_forward_lax):
8276 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8277 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8278
8279 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8280
8281 * fileio.c (Finsert_file_contents): Move after-change-function call
8282 to before the "handled:" label, since all "goto handled" appear in
8283 cases where the *-change-functions have already been properly called
8284 (bug#10117).
8285
8286 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8287
8288 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8289 waiting for input. (Bug#10169)
8290
8291 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8292
8293 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8294 verifies glyph row's hash code--we have just reallocated the
8295 glyphs, so their contents can be complete garbage. (Bug#10164)
8296
8297 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8298
8299 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8300
8301 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8302
8303 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8304 attributes are tested _before_ calling verify_row_hash, to protect
8305 against GCC re-ordering of the tests. (Bug#10164)
8306
8307 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8308
8309 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8310
8311 * xterm.c (handle_one_xevent): Only set async_visible and friends
8312 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8313 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8314 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8315
8316 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8317
8318 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8319 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8320 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8321 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8322 All uses changed to use GCPRO1 etc.
8323 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8324 Revert to old implementation (i.e., before 2011-03-11).
8325
8326 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8327
8328 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8329 of scroll runs so as to avoid assigning disabled bogus rows and
8330 unnecessary graphics copy operations.
8331
8332 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8333
8334 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8335 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8336 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8337 (malloc, free, realloc, calloc): Redirect to e_* only when
8338 compiling Emacs.
8339
8340 * lisp.h (GCTYPEBITS): Move before first use.
8341 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8342 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8343 this macro definition.
8344
8345 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8346 _MSC_VER.
8347
8348 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8349
8350 * gtkutil.c (xg_create_frame_widgets):
8351 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8352 present with Gtk+ 2.0.
8353
8354 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8355
8356 * fileio.c (Finsert_file_contents): Undo previous change; see
8357 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8358
8359 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8360
8361 Rename locals to avoid shadowing.
8362 * fileio.c (Finsert_file_contents):
8363 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8364 * process.c (wait_reading_process_output):
8365 Rename inner 'proc' to 'p' to avoid shadowing.
8366 Indent for consistency with usual Emacs style.
8367
8368 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8369
8370 * xdisp.c (redisplay_window): If cursor row is not fully visible
8371 after recentering, and scroll-conservatively is set to a large
8372 number, scroll window by a few more lines to make the cursor fully
8373 visible and out of scroll-margin. (Bug#10105)
8374 (start_display): Don't move to the next line if the display should
8375 start at a newline that is part of a display vector or an overlay
8376 string. (Bug#10119)
8377
8378 2011-11-24 Juri Linkov <juri@jurta.org>
8379
8380 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8381 after the `MagickPingImage' call. (Bug#10112)
8382
8383 2011-11-23 Chong Yidong <cyd@gnu.org>
8384
8385 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8386
8387 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8388
8389 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8390 making another buffer current. (Bug#10114)
8391
8392 2011-11-23 Glenn Morris <rgm@gnu.org>
8393
8394 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8395
8396 2011-11-23 Chong Yidong <cyd@gnu.org>
8397
8398 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8399 using it (Bug#5984).
8400
8401 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8402
8403 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8404 and header-lines, as they don't have one computed for them.
8405 (Bug#10098)
8406
8407 * .gdbinit (prow): Make displayed values more self-explaining.
8408 Add row's hash code.
8409
8410 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8411
8412 * process.c (wait_reading_process_output): Fix asynchrounous
8413 GnuTLS socket handling on some versions of the GnuTLS library.
8414 (wait_reading_process_output): Add comment and URL.
8415
8416 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8417
8418 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8419
8420 2011-11-21 Chong Yidong <cyd@gnu.org>
8421
8422 * window.c (Fnext_window, Fprevious_window): Doc fix.
8423
8424 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8425
8426 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8427
8428 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8429
8430 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8431
8432 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8433
8434 * window.c (Fset_window_combination_limit): Rename argument
8435 STATUS to LIMIT.
8436 (Vwindow_combination_limit): Remove "status" from doc-string.
8437
8438 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8439
8440 * m/ibms390.h: Remove.
8441 * m/ibms390x.h: Don't include "ibms390.h".
8442
8443 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8444
8445 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8446 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8447
8448 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8449
8450 * casetab.c (Fset_case_table):
8451 * charset.c (Fcharset_after): Fix typos.
8452
8453 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8454
8455 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8456 Otherwise, valgrind does not work on some platforms.
8457 Problem reported by Andreas Schwab in
8458 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8459 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8460 is set, removing the need for VIRT_ADDRESS_VARIES.
8461 (PURE_P): Use a more-efficient implementation that needs just one
8462 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8463 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8464 to 4 (xorl, subq, cmpq, setbe).
8465 * alloc.c (pure): Always extern now, since that's the
8466 VIRT_ADDR_VARIES behavior.
8467 (PURE_POINTER_P): Use a single comparison, not two, for
8468 consistency with the new puresize.h.
8469 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8470 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8471 Remove VIRT_ADDR_VARIES no longer needed.
8472
8473 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8474
8475 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8476 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8477 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8478 behave as if the cursor position were at the window margin.
8479
8480 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8481 and the cursor position is out of bounds, behave as if the cursor
8482 position were at the window margin. (Bug#10075)
8483
8484 2011-11-18 Chong Yidong <cyd@gnu.org>
8485
8486 * window.c (Fwindow_combination_limit): Make first argument
8487 non-optional, since it is meaningless for live windows like the
8488 selected window.
8489
8490 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8491
8492 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8493
8494 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8495
8496 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8497 (graft_intervals_into_buffer): Simplify.
8498
8499 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8500
8501 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8502 hash values of the two rows.
8503 (copy_row_except_pointers): Preserve the used[] arrays and the
8504 hash values of the two rows. (Bug#10035)
8505 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8506
8507 * xdisp.c (row_hash): New function, body extracted from
8508 compute_line_metrics.
8509 (compute_line_metrics): Call row_hash, instead of computing the
8510 hash code inline.
8511
8512 * dispnew.c (verify_row_hash): Call row_hash for computing the
8513 hash code of a row, instead of duplicating code from xdisp.c.
8514
8515 * dispextern.h (row_hash): Add prototype.
8516
8517 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8518
8519 * frame.c (delete_frame): Don't delete the terminal when the last
8520 X frame is closed if emacs is built with GTK toolkit.
8521
8522 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8523
8524 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8525
8526 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8527
8528 * window.c (Vwindow_splits): Rename to
8529 Vwindow_combination_resize. Suggested by Juri Linkov.
8530 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8531 of Vwindow_splits.
8532
8533 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8534
8535 * nsfns.m (Fns_font_name):
8536 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8537
8538 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8539
8540 * window.h (window): Rename slot "nest" to "combination_limit".
8541 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8542 (Fset_window_nest): Rename to Fset_window_combination_limit.
8543 (Vwindow_nest): Rename to Vwindow_combination_limit.
8544 (recombine_windows, make_parent_window, make_window)
8545 (Fsplit_window_internal, saved_window)
8546 (Fset_window_configuration, save_window_save): Rename all
8547 occurrences of window_nest to window_combination_limit.
8548
8549 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
8550
8551 * image.c (imagemagick_load_image): Fix typo.
8552
8553 2011-11-14 Eli Zaretskii <eliz@gnu.org>
8554
8555 * xdisp.c (display_line): Move the call to
8556 highlight_trailing_whitespace before the call to
8557 compute_line_metrics, since the latter needs to see the final
8558 faces of all the glyphs to compute ROW's hash value.
8559 Fixes assertion violations in row_equal_p. (Bug#10035)
8560
8561 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
8562
8563 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8564 just return (bug#10044).
8565
8566 2011-11-12 Eli Zaretskii <eliz@gnu.org>
8567
8568 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8569 with user-defined heap size. Bump the default size of the temacs
8570 heap to 27MB, to avoid memory warning when running temacs.
8571 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8572
8573 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8574 current_matrix and desired_matrix. (Bug#9990)
8575 (verify_row_hash) [XASSERTS]: New function.
8576 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8577 that the hash value of glyph rows is correct.
8578
8579 2011-11-12 Martin Rudalics <rudalics@gmx.at>
8580
8581 * window.h (window): Remove splits slot.
8582 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8583 (Fdelete_other_windows_internal, make_parent_window)
8584 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8585 (Fset_window_configuration, save_window_save): Don't deal with
8586 split status of windows.
8587 (saved_window): Remove splits slot.
8588 (Vwindow_splits): Rewrite doc-string.
8589
8590 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8591
8592 * xfns.c (unwind_create_frame):
8593 * nsfns.m (unwind_create_frame):
8594 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8595 Vframe_list (Bug#9999).
8596
8597 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8598
8599 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
8600
8601 2011-11-11 Kenichi Handa <handa@m17n.org>
8602
8603 * callproc.c (Fcall_process): Set the member dst_multibyte of
8604 process_coding.
8605
8606 2011-11-11 Johan Bockgård <bojohan@gnu.org>
8607
8608 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8609 avoid a crash (bug#9496).
8610
8611 2011-11-09 Chong Yidong <cyd@gnu.org>
8612
8613 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8614 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8615
8616 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8617
8618 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8619
8620 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8621
8622 Avoid some portability problems by eschewing 'extern inline' functions.
8623 The trivial performance wins aren't worth the portability hassles; see
8624 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8625 et seq.
8626 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8627 (window_box_width, window_box_left, window_box_left_offset)
8628 (window_box_right, window_box_right_offset): Undo previous change,
8629 by removing the "extern"s.
8630 * intervals.c (adjust_intervals_for_insertion)
8631 (adjust_intervals_for_deletion): Undo previous change,
8632 making these static again.
8633 (offset_intervals, temp_set_point_both, temp_set_point)
8634 (copy_intervals_to_string): No longer inline.
8635 * xdisp.c (window_text_bottom_y, window_box_width)
8636 (window_box_height, window_box_left_offset)
8637 (window_box_right_offset, window_box_left, window_box_right)
8638 (window_box): No longer inline.
8639
8640 2011-11-08 Chong Yidong <cyd@gnu.org>
8641
8642 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
8643 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8644 Signal an error if not a live window.
8645 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8646 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8647
8648 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
8649
8650 * lisp.h (syms_of_abbrev): Remove declaration.
8651 Reported by CHENG Gao <chenggao@royau.me>.
8652
8653 2011-11-07 Eli Zaretskii <eliz@gnu.org>
8654
8655 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8656 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
8657 of temacs in GUI mode.
8658
8659 2011-11-07 Martin Rudalics <rudalics@gmx.at>
8660
8661 * window.h: Declare delete_all_child_windows instead of
8662 delete_all_subwindows.
8663 * window.c (Fwindow_nest, Fset_window_nest)
8664 (Fset_window_new_total, Fset_window_new_normal)
8665 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8666 (delete_all_subwindows): Rename to delete_all_child_windows.
8667 (Fdelete_other_windows_internal, Fset_window_configuration):
8668 Call delete_all_child_windows instead of delete_all_subwindows.
8669 * frame.c (delete_frame): Call delete_all_child_windows instead
8670 of delete_all_subwindows.
8671
8672 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8673
8674 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8675 This is also needed for porting to any host where GC_MARK_STACK is
8676 not GC_MAKE_GCPROS_NOOPS.
8677 (which_symbols): Use it.
8678
8679 2011-11-07 Kenichi Handa <handa@m17n.org>
8680
8681 * coding.c (coding_set_destination): Check coding->src_pos only
8682 when coding->src_object is a buffer (bug#9910).
8683
8684 * process.c (send_process): Set the member src_multibyte of coding
8685 to 0 (bug#9911) when sending a unibyte text.
8686
8687 * callproc.c (Fcall_process): Set the member src_multibyte of
8688 process_coding to 0 (bug#9912).
8689
8690 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8691
8692 * xmenu.c (cleanup_widget_value_tree): New function.
8693 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8694 calling free_menubar_widget_value_tree directly (Bug#9830).
8695
8696 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8697
8698 Fix some portability problems with 'inline'.
8699 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8700 (window_box_width, window_box_left, window_box_left_offset)
8701 (window_box_right, window_box_right_offset): Declare extern.
8702 Otherwise, these inline functions do not conform to C99 and
8703 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8704 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8705 * intervals.c (adjust_intervals_for_insertion)
8706 (adjust_intervals_for_deletion): Now extern, because otherwise the
8707 extern inline functions 'offset_intervals' couldn't refer to it.
8708 (static_offset_intervals): Remove.
8709 (offset_intervals): Rewrite using the old contents of
8710 static_offset_intervals. The old version didn't conform to C99
8711 because an extern inline function contained a reference to an
8712 identifier with static linkage.
8713
8714 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8715
8716 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8717 GC.
8718
8719 2011-11-06 Eli Zaretskii <eliz@gnu.org>
8720
8721 * xdisp.c (init_iterator, reseat_to_string): Don't set the
8722 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
8723 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8724 return Qleft_to_right.
8725
8726 2011-11-06 Chong Yidong <cyd@gnu.org>
8727
8728 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8729 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8730 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8731 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8732 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8733 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8734 (Fwindow_vscroll): Doc fix.
8735 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
8736 argument, since it makes no sense to pass a live window and for
8737 consistency with window-child.
8738
8739 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
8740
8741 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8742 support MSVC.
8743
8744 2011-11-05 Jason Rumney <jasonr@gnu.org>
8745
8746 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8747 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8748 fonts (Bug#6029).
8749 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8750 bitwise arithmetic preventing use of unicode-sip and non-truetype
8751 opentype fonts.
8752
8753 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8754
8755 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8756 "emacs"-only part.
8757
8758 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8759 initialization code to keep similarity to xfns.c after changes
8760 from 2011-11-05.
8761
8762 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8763
8764 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8765 (unwind_create_frame): New function (Bug#9943).
8766 (Fx_create_frame): Restructure code to be more similar to the one in
8767 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
8768 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8769 Move terminal->reference_count++ just before making the frame official
8770 (Bug#9943).
8771
8772 * nsterm.m (x_free_frame_resources): New function.
8773 (x_destroy_window): Move code to x_free_frame_resources.
8774
8775 * xfns.c (unwind_create_frame): Fix comment.
8776 (Fx_create_frame, x_create_tip_frame):
8777 Move terminal->reference_count++ just before making the frame
8778 official. Move initialization of image_cache_refcount and
8779 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8780
8781 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8782
8783 Support MSVC build with newer versions of Visual Studio.
8784 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8785 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
8786 nt/gmake.defs.
8787
8788 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8789 which are not supported by MSVC.
8790 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8791 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8792 bitfields.
8793 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8794 types in bitfields.
8795 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8796
8797 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8798
8799 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
8800
8801 Support MSVC build with newer versions of Visual Studio.
8802 * w32.c: Don't include w32api.h for MSVC.
8803 (init_environment) [_MSC_VER]: Call sys_access, not _access.
8804
8805 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8806 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8807 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8808 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8809 e_* cousins.
8810 (alloca) [_MSC_VER]: Define to _alloca.
8811
8812 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8813
8814 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8815
8816 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8817
8818 * xdisp.c (note_mouse_highlight): If either of
8819 previous/next-single-property-change returns nil, treat that as
8820 the beginning or the end of the buffer. (Bug#9955)
8821
8822 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8823
8824 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
8825 label is not null (Bug#9951).
8826 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8827 may be NULL.
8828
8829 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8830
8831 * window.c (Fwindow_body_size): Mention in the doc string that the
8832 return value is in frame's canonical units. (Bug#9949)
8833
8834 2011-11-03 Eli Zaretskii <eliz@gnu.org>
8835
8836 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8837
8838 * w32fns.c (unwind_create_frame): If needed, free the glyph
8839 matrices of the partially constructed frame. (Bug#9943)
8840 * xfns.c (unwind_create_frame): Likewise.
8841
8842 2011-11-01 Eli Zaretskii <eliz@gnu.org>
8843
8844 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8845 Don't stop backward scan on the continuation glyph, even though
8846 its CHARPOS is positive.
8847 (mouse_face_from_buffer_pos, note_mouse_highlight):
8848 Rename cover_string to disp_string.
8849
8850 2011-11-01 Martin Rudalics <rudalics@gmx.at>
8851
8852 * window.c (temp_output_buffer_show): Don't use
8853 Vtemp_buffer_show_specifiers.
8854 (Vtemp_buffer_show_specifiers): Remove unused variable.
8855
8856 2011-10-30 Eli Zaretskii <eliz@gnu.org>
8857
8858 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8859 past the beginning of the current glyph matrix.
8860
8861 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
8862
8863 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8864 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8865 HAVE_GTK3 (Bug#9869).
8866
8867 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8868 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8869
8870 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8871
8872 * xterm.c: Declare x_handle_net_wm_state to return int.
8873 (handle_one_xevent): Check if we are iconified but don't have
8874 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8875 (get_current_wm_state): Return non-zero if not hidden,
8876 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8877 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8878 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8879 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8880
8881 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8882
8883 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8884 so that this new function doesn't get optimized away by a
8885 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8886
8887 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8888
8889 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8890
8891 2011-10-29 Eli Zaretskii <eliz@gnu.org>
8892
8893 Fix the `xbytecode' command.
8894 * .gdbinit (xprintbytestr): New command.
8895 (xwhichsymbols): Rename from `which'; all callers changed.
8896 (xbytecode): Print the byte-code string as well.
8897
8898 2011-10-29 Kim Storm <storm@cua.dk>
8899
8900 * alloc.c (which_symbols): New function.
8901
8902 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8903
8904 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8905 line. (Bug#9903)
8906
8907 2011-10-29 Glenn Morris <rgm@gnu.org>
8908
8909 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8910 Not clear what it was for, and it causes various bugs. (Bug#9839)
8911
8912 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8913
8914 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8915 possible random value that matches one of those tested as
8916 condition to clear the mouse face.
8917
8918 2011-10-28 Chong Yidong <cyd@gnu.org>
8919
8920 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8921
8922 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8923
8924 * window.c (make_window): Initialize phys_cursor_on_p.
8925
8926 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8927
8928 * lisp.h (struct Lisp_Symbol): Update comments.
8929
8930 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
8931
8932 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8933
8934 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8935
8936 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8937 <oslsachem@gmail.com> for helping to debug this.
8938
8939 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8940 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8941 (g_b_init_get_glyph_outline_w): New static variables.
8942 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8943 (GetGlyphOutlineW_Proc): New typedefs.
8944 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
8945 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8946 New functions.
8947 (w32font_open_internal, compute_metrics):
8948 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
8949 instead of calling the "wide" APIs directly.
8950
8951 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8952
8953 * w32.h (syms_of_w32font): Add prototype.
8954
8955 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8956
8957 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8958 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8959 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8960 (Fmove_to_window_line): Doc fix.
8961
8962 2011-10-27 Chong Yidong <cyd@gnu.org>
8963
8964 * process.c (make_process): Set gnutls_state to NULL.
8965
8966 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8967 non-NULL, regardless of GNUTLS_INITSTAGE.
8968 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8969 an error. Set process slots as soon as we allocate them.
8970
8971 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8972
8973 2011-10-27 Chong Yidong <cyd@gnu.org>
8974
8975 * gnutls.c (emacs_gnutls_deinit): New function.
8976 Deallocate credentials structures as well as calling gnutls_deinit.
8977 (Fgnutls_deinit, Fgnutls_boot): Use it.
8978
8979 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8980 (deactivate_process): Call emacs_gnutls_deinit.
8981
8982 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8983
8984 * image.c (x_create_x_image_and_pixmap):
8985 * w32.c (sys_rename, w32_delayed_load):
8986 * w32font.c (fill_in_logfont):
8987 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8988
8989 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
8990
8991 * w32fns.c (w32_default_color_map): New function,
8992 extracted from Fw32_default_color_map.
8993 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
8994
8995 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8996
8997 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8998
8999 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9000
9001 * keyboard.c (test_undefined): New function (bug#9751).
9002 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9003
9004 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9005
9006 * sysdep.c (init_sys_modes): Fix the check for the controlling
9007 terminal (Bug#6649).
9008
9009 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9010
9011 * dispextern.h (struct bidi_it): New member next_en_type.
9012
9013 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9014 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9015 current character, check also for next_en_type being WEAK_EN.
9016 (bidi_resolve_weak): Don't enter the expensive loop if the current
9017 position is before next_en_pos. Record the bidi type of the first
9018 non-ET, non-BN character we find, in addition to its position.
9019 (bidi_level_of_next_char): Invalidate next_en_type when
9020 next_en_pos is over-stepped.
9021
9022 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9023
9024 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9025 * editfns.c: Rewrite current-time-zone so that it invokes
9026 the equivalent of (format-time-string "%Z") to get the time zone name.
9027 This fixes a bug when the time zone name contains characters that
9028 need converting from the system time locale to Emacs internal format.
9029 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9030 that patch fixed format-time-string to do the conversion, but
9031 I forgot to fix current-time-zone.
9032 (format_time_string): New function, containing most of
9033 what Fformat_time_string used to contain.
9034 (Fformat_time_string): Rewrite in terms of format_time_string.
9035 This doesn't change this function's behavior.
9036 (current-time-zone): Rewrite to use format_time_string.
9037 This fixes the bug reported by Michael Schierl in
9038 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9039 Jason Rumney's 2007-06-07 change worked around this bug, but
9040 didn't fix it.
9041 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9042
9043 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9044
9045 * xdisp.c (start_display): If the character at POS is displayed
9046 via a display vector, reset IT->current.dpvec_index to zero.
9047 (try_window_reusing_current_matrix): If a line ends in a display
9048 vector or the next line starts in a display vector, continue
9049 redrawing the window even though the character position of
9050 start_row was reached.
9051 (Bug#9771, part 2)
9052
9053 2011-10-18 Chong Yidong <cyd@gnu.org>
9054
9055 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9056 with nobreak-char-display too.
9057
9058 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9059
9060 Fix part 3 of bug#9771.
9061 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9062 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9063 non-neutral characters if the current character is a paragraph
9064 separator (a.k.a. Newline). This avoids running the same
9065 expensive loop twice, once when we consume the preceding newline
9066 and the other time when the line actually needs to be displayed.
9067 Avoid the loop when we see neutrals on the base embedding level
9068 following a character whose directionality is the same as the
9069 paragraph's. This avoids running the expensive loop when a line
9070 ends in a long sequence of neutrals, like control characters.
9071 Add assertion against STRONG_AL type. Slightly rearrange code
9072 that determines the type of a neutral given the first non-neutral
9073 that follows it.
9074 (bidi_level_of_next_char): Set next_en_pos to zero when
9075 invalidating its info.
9076
9077 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9078
9079 * xdisp.c (push_display_prop): Determine whether to record string
9080 or buffer position by IT->string, not by IT->method. Allow
9081 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9082 (move_it_vertically_backward): Don't look for character position
9083 immediately after the newline when in a continuation line.
9084 (Bug#9771, part 1)
9085
9086 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9087
9088 * window.c (coordinates_in_window): Rewrite and delabelize
9089 vertical border check. (Bug#5357) (Bug#9618)
9090
9091 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9092
9093 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9094 errors in XSetWindowBorder (bug#9310).
9095
9096 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9097
9098 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9099 avoid crash when xmalloc overrun checking is enabled.
9100
9101 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9102
9103 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9104 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9105 cursor motion with <left> and <right> arrow keys.
9106
9107 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9108 some callers set that themselves.
9109
9110 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9111
9112 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9113 display string and the previous row comes from the same string and
9114 is empty. (Bug#9739) (Bug#9738)
9115
9116 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9117
9118 * doc.c (get_doc_string): Encode file name (bug#9735).
9119
9120 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9121
9122 * bidi.c (bidi_level_of_next_char):
9123 * xdisp.c (get_visually_first_element): Remove old incorrect
9124 comments regarding the Unicode Line Separator character.
9125
9126 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9127
9128 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9129
9130 * alloc.c (Fgc_status): Do not access beyond zombies array
9131 boundary if nzombies > MAX_ZOMBIES.
9132 * alloc.c (dump_zombies): Add missing format specifier.
9133
9134 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9137 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9138
9139 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9140 Some packages use them to denote characters with modifiers.
9141
9142 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9143
9144 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9145 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9146 matching a pp-number. Rename parameter var to var1.
9147
9148 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9149
9150 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9151
9152 2011-10-08 Glenn Morris <rgm@gnu.org>
9153
9154 * callint.c (Fcall_interactively): Give a more explicit error for the
9155 'c' case with a non-character input. (Bug#8479)
9156
9157 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9158
9159 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9160 lines.
9161 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9162 lines that are hscrolled on the left.
9163
9164 * dispnew.c (buffer_posn_from_coords): Account for a possible
9165 presence of header-line. (Bug#4426)
9166
9167 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9168
9169 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9170 Don't advertise functionality which we discourage or doesn't work.
9171
9172 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9173
9174 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9175 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9176 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9177 this makes Emacs dump core during garbage collection on rare
9178 occasions. sizeof is obviously inferior to offsetof here, so
9179 stick with offsetof.
9180 (GC_POINTER_ALIGNMENT): New macro.
9181 (mark_memory): Omit 3rd (offset) arg; caller changed.
9182 Don't assume EMACS_INT alignment is the same as pointer alignment.
9183
9184 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9185
9186 * keyboard.c (read_key_sequence_remapped): New var.
9187 (read_key_sequence): Compute remapping in the right buffer.
9188 (command_loop_1): Use read_key_sequence's remapping directly.
9189
9190 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9191
9192 * dired.c (file_name_completion): Don't expand file name.
9193 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9194 before checking file name handler.
9195
9196 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9197 they've been requested explicitly (bug#9591).
9198
9199 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9200
9201 * keymap.c (Fsingle_key_description): Use make_specified_string
9202 instead of build_string to build string from push_key_description.
9203 (Bug#5193)
9204
9205 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9206
9207 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9208 This fixes a Y2038 bug on 64-bit hosts.
9209 * buffer.c (reset_buffer):
9210 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9211 (Fclear_buffer_auto_save_failure):
9212 Use 0, not -1, to represent an unset failure time, since time_t
9213 might not be signed.
9214
9215 Remove dependency on glibc malloc internals.
9216 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9217 Move back here from lisp.h, but with their new implementations.
9218 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9219 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9220 * charset.c (charset_table_init): New static var.
9221 (syms_of_charset): Use it instead of xmalloc. This removes a
9222 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9223 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9224 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9225 Move back to alloc.c.
9226 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9227 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9228
9229 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9230
9231 * nsterm.m (windowDidResize): Call x_set_window_size only when
9232 ns_in_resize is true. Otherwise set pixelwidth/height and
9233 call change_frame_size (Bug#9628).
9234
9235 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9236
9237 Port --enable-checking=all to Fedora 14 x86-64.
9238 * charset.c (syms_of_charset): Also account for glibc malloc's
9239 internal overhead when calculating the initial malloc maximum.
9240
9241 Port --enable-checking=all to Fedora 14 x86.
9242 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9243 Move to lisp.h.
9244 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9245 (overrun_check_realloc, overrun_check_free):
9246 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9247 That way, xmalloc returns a properly-aligned pointer even if
9248 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9249 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9250 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9251 into account when calculating the initial malloc maximum.
9252 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9253 Move here from alloc.c, so that charset.c can use it too.
9254 Properly align; the old code wasn't right for common 32-bit hosts
9255 when configured with --enable-checking=all.
9256 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9257 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9258
9259 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9260
9261 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9262 use EDOM.
9263
9264 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9265
9266 * xdisp.c (compute_display_string_end): If there's no display
9267 string at CHARPOS, return -1.
9268
9269 * bidi.c (bidi_fetch_char): When compute_display_string_end
9270 returns a negative value, treat the character as a normal
9271 character not covered by a display string. (Bug#9624)
9272
9273 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9274
9275 * lread.c (Fread_from_string): Fix typo in docstring.
9276
9277 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9278
9279 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9280 newline, reseat the iterator instead of bidi-iterating there one
9281 character at a time. (Bug#9610)
9282 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9283 TO_CHARPOS if the bidi iterator is at base embedding level.
9284
9285 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9286
9287 * lread.c (readevalloop): Use correct code for NBSP.
9288 (read1): Likewise. (Bug#9608)
9289
9290 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9291
9292 * dbusbind.c (Fdbus_register_signal): When service is not
9293 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9294
9295 2011-09-25 Glenn Morris <rgm@gnu.org>
9296
9297 * buffer.c (truncate-lines): Doc fix.
9298
9299 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9300
9301 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9302 (Fset_window_next_buffers): Doc fix.
9303
9304 2011-09-24 Glenn Morris <rgm@gnu.org>
9305
9306 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9307
9308 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9309
9310 Fix minor problems found by static checking.
9311 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9312 * indent.c (Fvertical_motion): Fix == vs = typo.
9313
9314 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9315
9316 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9317 Default value is now t. Doc fix.
9318
9319 * indent.c (Fvertical_motion): Compute and apply the overshoot
9320 logic when moving up, not only when moving down. Fix the
9321 confusing name and values of the it_overshoot_expected variable;
9322 logic changes accordingly. (Bug#9254) (Bug#9549)
9323
9324 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9325 CHARPOS is covered by a display string which includes newlines.
9326 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9327 is covered by a display string with embedded newlines.
9328
9329 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9330
9331 * dbusbind.c (Fdbus_register_signal): Add match rule to
9332 Vdbus_registered_objects_table. (Bug#9581)
9333 (Fdbus_register_method, Vdbus_registered_objects_table):
9334 Fix docstring.
9335
9336 2011-09-24 Jim Meyering <meyering@redhat.com>
9337
9338 do not ignore write error for any output size
9339 The previous change was incomplete.
9340 While it makes emacs --batch detect the vast majority of stdout
9341 write failures, errors were still ignored whenever the output size is
9342 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9343 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9344 && echo FAIL: ignored write error
9345 FAIL: ignored write error
9346 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9347 && echo FAIL: ignored write error
9348 FAIL: ignored write error
9349 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9350
9351 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9352
9353 * emacs.c (Fkill_emacs): In noninteractive mode exit
9354 non-successfully if a write error occurred on stdout. (Bug#9574)
9355
9356 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9357
9358 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9359 the xassert test.
9360
9361 * dispextern.h (struct it): Update the comment documenting what
9362 can it->OBJECT be.
9363
9364 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9365
9366 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9367 a display string, extend search for cursor position to end of row.
9368 (find_row_edges): If the row ends in a newline from a display
9369 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9370 Handle the case of a display string with multiple newlines.
9371 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9372 non-empty line. Fixes confusing cursor motion with arrow keys at
9373 the beginning of a line that starts with whitespace.
9374
9375 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9376
9377 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9378 (bug#9493).
9379
9380 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9381
9382 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9383 boolean (Bug#9154).
9384
9385 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9386
9387 * xdisp.c (display_line): Record maximum and minimum buffer
9388 positions even if no glyphs were produced (e.g., by a zero-width
9389 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9390 buffer positions that will be removed from the glyph row because
9391 they don't fit.
9392 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9393 column is beyond frame width: don't subtract 1 "pixel" when
9394 computing width of the stretch.
9395 (reseat_at_next_visible_line_start): Undo the change made on
9396 2011-09-17 that saved paragraph information and restored it after
9397 the call to `reseat'. (Bug#9545)
9398
9399 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9400
9401 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9402 and turn window cursor on if cleared (Bug#9415).
9403
9404 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9405
9406 * search.c (boyer_moore): Take unibyte characters from pattern
9407 literally. (Bug#9458)
9408
9409 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9410
9411 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9412
9413 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9414
9415 Fix minor problem found by static checking.
9416 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9417 initialized, to pacify gcc -Wuninitialized.
9418
9419 * fileio.c: Report proper errno when syscall falls.
9420 (Finsert_file_contents): Save and restore errno,
9421 so that report_file_error outputs the correct diagnostic.
9422 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9423
9424 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9425
9426 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9427
9428 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9429
9430 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9431 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9432
9433 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9434
9435 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9436 about the current paragraph and restore it after the call to reseat.
9437
9438 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9439 (bidi_find_paragraph_start): Search back for paragraph beginning
9440 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9441 (bidi_move_to_visually_next): Only trigger paragraph-related
9442 computations when the last character is a newline or at EOB, not
9443 just any NEUTRAL_B. (Bug#9470)
9444
9445 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9446 truncated lines if point is covered by a display string. (Bug#9524)
9447
9448 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9449
9450 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9451 (cons_to_x_long): New function.
9452 (lisp_data_to_selection_data): Use it. Correct the test for
9453 short-versus-long data; it was negated. Break out of vector
9454 loop, for efficiency, when a long datum is discovered.
9455
9456 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9457
9458 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9459
9460 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9461
9462 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9463 GCC PR/17406) by declaring this function with external scope.
9464
9465 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9466
9467 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9468 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9469
9470 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9471
9472 * editfns.c (Fformat): Correctly handle text properties on "%%".
9473
9474 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9475
9476 * xterm.c (x_draw_composite_glyph_string_foreground):
9477 * w32term.c (x_draw_composite_glyph_string_foreground):
9478 * term.c (encode_terminal_code):
9479 * composite.c (composition_update_it, get_composition_id):
9480 * xdisp.c (get_next_display_element)
9481 (fill_composite_glyph_string): Add comments about special meaning
9482 of TAB characters in a composition.
9483
9484 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9485
9486 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9487 This occurs when processing a multibyte format.
9488 Problem reported by Wolfgang Jenker.
9489
9490 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9491
9492 * xdisp.c (try_cursor_movement): Only check for exact match if
9493 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9494
9495 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9496
9497 Remove unused external symbols.
9498 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9499 * xdisp.c (calc_pixel_width_or_height): Now static.
9500 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9501 * indent.c (check_display_width):
9502 * w32term.c: Fix comment to match code.
9503 * xterm.c, xterm.h (x_catching_errors): Remove.
9504
9505 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9506
9507 * xselect.c: Use signed conversions more consistently (Bug#9498).
9508 (selection_data_to_lisp_data): Assume incoming selection data are
9509 signed integers, not unsigned. This is to be consistent with
9510 outgoing selection data, which was modified to use signed integers
9511 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9512 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9513 expects long, not unsigned long.
9514
9515 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9516
9517 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9518 computation of loop end. Reported by Johan Bockgård
9519 <bojohan@gnu.org>.
9520
9521 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9522
9523 * frame.c (Fother_visible_frames_p): Function deleted.
9524
9525 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9526
9527 * indent.c (compute_motion): Process display vector front to back
9528 rather than the other way around. (Bug#2496)
9529
9530 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9531
9532 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9533
9534 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9535
9536 * minibuf.c (Fread_from_minibuffer): Doc fix.
9537
9538 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9539
9540 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9541 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9542
9543 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9544
9545 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9546 value for non-existent files.
9547
9548 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9549
9550 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9551 set its "size" to -1. This will set the modtime_size field of
9552 the corresponding buffer to -1, which is what
9553 verify-visited-file-modtime expects for files that do not exist.
9554 (Bug#9139)
9555
9556 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9557
9558 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9559 here ...
9560 * lisp.h: ... from here. push_key_description is no longer
9561 defined in keyboard.c, so its declaration should not be in
9562 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9563 logically belongs with push_key_description.
9564
9565 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9566
9567 * buffer.h: Include <sys/types.h> instead of <time.h>.
9568 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9569 Problem reported by Herbert J. Skuhra.
9570
9571 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9572
9573 * xml.c (parse_region): Make the parsing work for
9574 non-comment-starting XML files again (bug#9144).
9575
9576 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9577
9578 * image.c (gif_load): Fix calculation of bottom and right corner.
9579 (Bug#9468)
9580
9581 2011-09-10 Eli Zaretskii <eliz@gnu.org>
9582
9583 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9584 redisplay in small windows.
9585
9586 2011-09-09 Eli Zaretskii <eliz@gnu.org>
9587
9588 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9589
9590 2011-09-08 Martin Rudalics <rudalics@gmx.at>
9591
9592 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9593 Operate on live windows only.
9594
9595 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
9596
9597 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9598
9599 2011-09-07 Eli Zaretskii <eliz@gnu.org>
9600
9601 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9602 only under bidi iteration.
9603
9604 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9605
9606 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9607
9608 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9609
9610 isnan: Fix porting problem to Solaris 10 with bundled gcc.
9611 Without this fix, the command to link temacs failed due to an
9612 undefined symbol __builtin_isnan. This is because
9613 /usr/include/iso/math_c99.h #defines isnan(x) to
9614 __builtin_isnan(x), but the bundled gcc, which identifies itself
9615 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9616 a __builtin_isnan.
9617 * floatfns.c (isnan): #undef, and then #define to a clone of
9618 what's in data.c.
9619 (Fisnan): Always define, since it's always available now.
9620 (syms_of_floatfns): Always define isnan at the Lisp level.
9621
9622 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9623
9624 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9625
9626 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9627
9628 * fileio.c: Fix bugs with large file offsets (Bug#9428).
9629 The previous code assumed that file offsets (off_t values) fit in
9630 EMACS_INT variables, which is not true on typical 32-bit hosts.
9631 The code messed up by falsely reporting buffer overflow in cases
9632 such as (insert-file-contents "big" nil 1 2) into an empty buffer
9633 when "big" contains more than 2**29 bytes, even though this
9634 inserts just one byte and does not overflow the buffer.
9635 (Finsert_file_contents): Store file offsets as off_t
9636 values, not as EMACS_INT values. Check for overflow when
9637 converting between EMACS_INT and off_t. When checking for
9638 buffer overflow or for overlap, take the offsets into account.
9639 Don't use EMACS_INT for small values where int suffices.
9640 When checking for overlap, fix a typo: ZV was used where
9641 ZV_BYTE was intended.
9642 (Fwrite_region): Don't assume off_t fits into 'long'.
9643 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9644
9645 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
9646
9647 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9648
9649 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9650
9651 sprintf-related integer and memory overflow issues (Bug#9412).
9652
9653 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
9654 (esprintf, exprintf, evxprintf): New functions.
9655 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
9656 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
9657 (modify_event_symbol): Do not assume that the length of
9658 name_alist_or_stem is safe to alloca and fits in int.
9659 (Fexecute_extended_command): Likewise for function name and binding.
9660 (Frecursion_depth): Wrap around reliably on integer overflow.
9661 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9662 since some callers pass EMACS_INT values.
9663 (Fsingle_key_description): Don't crash if symbol name contains more
9664 than MAX_ALLOCA bytes.
9665 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9666 (get_minibuffer): Arg is now EMACS_INT, not int.
9667 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
9668 (esprintf, exprintf, evxprintf): New decls.
9669 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9670
9671 * dbusbind.c (signature_cat): New function.
9672 (xd_signature, Fdbus_register_signal):
9673 Do not overrun buffer; instead, report string overflow.
9674
9675 * dispnew.c (add_window_display_history): Don't overrun buffer.
9676 Truncate instead; this is OK since it's just a log.
9677
9678 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9679 even if the time zone offset is outlandishly large.
9680 Don't mishandle offset == INT_MIN.
9681
9682 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9683 when creating daemon; the previous buffer-overflow check was incorrect.
9684
9685 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9686 which has the guts of the old verror function.
9687
9688 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9689 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9690
9691 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9692 (font_unparse_xlfd): Don't blindly alloca long strings.
9693 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
9694 fits in int, when using sprintf. Use single snprintf to count
9695 length of string rather than counting it via multiple sprintfs;
9696 that's simpler and more reliable.
9697 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9698 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9699 sprintf, in case result does not fit in int.
9700
9701 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9702 (fontset_from_font): Print it.
9703
9704 * frame.c (tty_frame_count): Now printmax_t, not int.
9705 (make_terminal_frame, set_term_frame_name): Print it.
9706 (x_report_frame_params): In X, window IDs are unsigned long,
9707 not signed long, so print them as unsigned.
9708 (validate_x_resource_name): Check for implausibly long names,
9709 and don't assume name length fits in 'int'.
9710 (x_get_resource_string): Don't blindly alloca invocation name;
9711 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9712 not fit in int.
9713
9714 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9715 (xg_check_special_colors, xg_set_geometry):
9716 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9717
9718 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9719 Use esprintf, not sprintf, in case result does not fit in int.
9720
9721 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9722 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9723 it as a large positive number.
9724 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9725 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9726
9727 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9728 in case result does not fit in int.
9729
9730 * print.c (float_to_string): Detect width overflow more reliably.
9731 (print_object): Make sprintf buffer a bit bigger, to avoid potential
9732 buffer overrun. Don't assume list length fits in 'int'. Treat
9733 print length of 0 as 0, not as infinity; to be consistent with other
9734 uses of print length in this function. Don't overflow print length
9735 index. Don't assume hash table size fits in 'long', or that
9736 vectorlike size fits in 'unsigned long'.
9737
9738 * process.c (make_process): Use printmax_t, not int, to format
9739 process-name gensyms.
9740
9741 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9742
9743 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9744 to avoid potential buffer overrun.
9745
9746 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9747 if X resource line is longer than 512 bytes.
9748
9749 * xfns.c (x_window): Make sprintf buffer a bit bigger
9750 to avoid potential buffer overrun.
9751
9752 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9753
9754 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9755
9756 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9757
9758 Integer overflow fixes for scrolling, etc.
9759 Without these, Emacs silently mishandles large integers sometimes.
9760 For example, "C-u 4294967297 M-x recenter" was treated as if
9761 it were "C-u 1 M-x recenter" on a typical 64-bit host.
9762
9763 * xdisp.c (try_window_id): Check Emacs fixnum range before
9764 converting to 'int'.
9765
9766 * window.c (window_scroll_line_based, Frecenter):
9767 Check that an Emacs fixnum is in range before assigning it to 'int'.
9768 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9769 values converted from Emacs fixnums.
9770 (Frecenter): Don't wrap around a line count if it is out of 'int'
9771 range; instead, treat it as an extreme value.
9772 (Fset_window_configuration, compare_window_configurations):
9773 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9774
9775 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9776 that can exceed INT_MAX. Check that EMACS_INT value is in range
9777 before assigning it to the (possibly-narrower) index.
9778 (match_limit): Don't assume that a fixnum can fit in 'int'.
9779
9780 * print.c (print_object): Use ptrdiff_t, not int, for index that can
9781 exceed INT_MAX.
9782
9783 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
9784 (Fvertical_motion): Don't wrap around LINES values that don't fit
9785 in 'int'. Instead, treat them as extreme values. This is good
9786 enough for windows, which can't have more than INT_MAX lines anyway.
9787
9788 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9789
9790 * Require libxml/parser.h to avoid compilation warning.
9791
9792 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9793
9794 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9795 since this reportedly can destroy thread storage.
9796
9797 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
9798
9799 * syntax.c (find_defun_start): Update all cache variables if
9800 exiting early (Bug#9401).
9801
9802 2011-08-30 Eli Zaretskii <eliz@gnu.org>
9803
9804 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9805
9806 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9807 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9808 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9809
9810 * term.c (tty_append_glyph): New function.
9811 (produce_stretch_glyph): Static function and its prototype deleted.
9812
9813 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9814 Add prototypes.
9815
9816 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9817
9818 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9819 when checking :margin (Bug#9390).
9820 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
9821 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
9822 so that the name doesn't mislead. All uses changed.
9823
9824 2011-08-28 Johan Bockgård <bojohan@gnu.org>
9825
9826 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9827 set_tty_hooks.
9828
9829 2011-08-27 Eli Zaretskii <eliz@gnu.org>
9830
9831 * xdisp.c (move_it_to): Don't bail out early when reaching
9832 position beyond to_charpos, if we are scanning backwards.
9833 (move_it_vertically_backward): When DY == 0, make sure we get to
9834 the first character in the line after the newline.
9835
9836 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9837
9838 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9839 (ccl_driver): Do not generate an out-of-range pointer.
9840 (Fccl_execute_on_string): Remove unnecessary check for
9841 integer overflow, noted by Stefan Monnier in
9842 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9843 Remove a FIXME that didn't need fixing.
9844 Simplify the newly-introduced buffer reallocation code.
9845
9846 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
9847
9848 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9849
9850 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
9851
9852 Integer and memory overflow issues (Bug#9196).
9853
9854 * doc.c (get_doc_string): Rework so that
9855 get_doc_string_buffer_size is the actual buffer size, rather than
9856 being 1 less than the actual buffer size; this makes xpalloc more
9857 convenient.
9858
9859 * image.c (x_allocate_bitmap_record, cache_image):
9860 * xselect.c (Fx_register_dnd_atom):
9861 Simplify previous changes by using xpalloc.
9862
9863 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9864 since either will do and ptrdiff_t is convenient with xpalloc.
9865
9866 * charset.c (charset_table_size)
9867 (struct charset_sort_data.priority): Now ptrdiff_t.
9868 (charset_compare): Don't overflow if priorities differ greatly.
9869 (Fsort_charsets): Don't assume list length fits in int.
9870 Check for size-calculation overflow when allocating sort data.
9871 (syms_of_charset): Allocate an initial charset table that is
9872 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9873
9874 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9875
9876 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9877 The actual value is always <= INT_MAX, and leaving it unsigned made
9878 overflow checking harder.
9879
9880 * dispextern.h (struct glyph_matrix.rows_allocated)
9881 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9882 with xpalloc. The values are still always <= INT_MAX.
9883
9884 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9885
9886 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9887 (SAFE_NALLOCA): New macro.
9888
9889 * region-cache.c (struct boundary.pos, find_cache_boundary)
9890 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9891 (set_cache_region, invalidate_region_cache)
9892 (revalidate_region_cache, know_region_cache, region_cache_forward)
9893 (region_cache_backward, pp_cache):
9894 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9895 so that ptrdiff_t * can be passed to xpalloc.
9896 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9897 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9898 (pp_cache): Don't assume cache_len fits in int.
9899 * region-cache.h: Adjust extern decls to match.
9900
9901 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9902 EMACS_INT, since either will do, for xpalloc.
9903
9904 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9905 (xnmalloc, xnrealloc, xpalloc): New functions.
9906
9907 * bidi.c (bidi_shelve_header_size): New constant.
9908 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9909 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9910
9911 * bidi.c (bidi_cache_shrink):
9912 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9913 (overlay_strings):
9914 Don't update size of array until after memory allocation succeeds,
9915 because xmalloc/xrealloc may not return.
9916 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9917 now that we have proper integer overflow checking.
9918 (record_overlay_string, overlay_strings): Catch overflows when
9919 calculating size of overlay_str_buf.
9920
9921 * callproc.c (Fcall_process): Check for size overflow when
9922 calculating size of args2.
9923 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9924 Normally we prefer signed values, but sticking with ptrdiff_t would
9925 require adding more-complicated checks.
9926
9927 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9928 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9929 Redo buffer-overflow calculations to avoid integer overflow.
9930 Add a FIXME comment where memory seems to be over-allocated.
9931
9932 * character.c (Fstring): Check for size-calculation overflow.
9933
9934 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9935 unnecessary integer overflow. Check for size overflow.
9936 (encode_coding_object): Don't update size until xmalloc succeeds.
9937
9938 * composite.c (get_composition_id): Check for overflow in glyph
9939 length calculations.
9940
9941 Integer and memory overflow fixes for display code.
9942 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9943 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9944 (scrolling_window): Check for overflow in size calculations.
9945 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9946 Don't assume glyph table len fits in int.
9947 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9948 (row_table_size): Now ptrdiff_t, not int.
9949 (scrolling_window): Avoid overflow in size calculations.
9950 Don't update size until allocation succeeds.
9951 * fns.c (concat): Check for overflow in size calculations.
9952 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9953 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9954 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9955
9956 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9957 (get_doc_string): Check for size calculation overflow.
9958 Don't update size until allocation succeeds.
9959 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9960 EMACS_INT, where ptrdiff_t will do.
9961 (Fsubstitute_command_keys): Check for string overflow.
9962
9963 * editfns.c (set_time_zone_rule): Don't assume environment length
9964 fits in int.
9965 (message_length): Now ptrdiff_t, not int.
9966 (Fmessage_box): Don't update size until allocation succeeds.
9967 Don't assume message length fits in int.
9968 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9969
9970 * emacs.c (main): Do not reallocate argv, since there is a null at
9971 the end that can be overwritten, and this way there's no need to
9972 worry about size-calculation overflow.
9973 (sort_args): Check for size-calculation overflow.
9974
9975 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9976 alloc succeeds.
9977 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9978
9979 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9980 (x_set_scroll_bar_width, x_figure_window_size):
9981 Check for integer overflow.
9982 (x_set_alpha): Do not assume XINT fits in int.
9983
9984 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9985 This is for the members text_lines, text_cols, total_lines, total_cols,
9986 where the system imposes an 'int' limit.
9987
9988 * fringe.c (Fdefine_fringe_bitmap):
9989 Don't update size until alloc works.
9990
9991 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9992 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9993
9994 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9995 Check for size-calculation overflow.
9996 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9997 do, as we prefer signed integers.
9998 (id_to_widget.max_size, id_to_widget.used)
9999 (xg_store_widget_in_map, xg_remove_widget_from_map)
10000 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10001 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10002 Use and return ptrdiff_t, not int.
10003 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10004 * gtkutil.h: Change prototypes to match the above.
10005
10006 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10007 are duplicate now that they've been promoted to lisp.h.
10008 (x_allocate_bitmap_record, x_alloc_image_color)
10009 (make_image_cache, cache_image, xpm_load):
10010 Don't update size until alloc is done.
10011 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10012 (x_detect_edges):
10013 Check for size calculation overflow.
10014 (ct_colors_allocated_max): New constant.
10015 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10016 overflow.
10017
10018 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10019 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10020 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10021 Use ptrdiff_t, not int, to count maps.
10022 (read_char_minibuf_menu_prompt): Check for overflow in size
10023 calculations. Don't update size until allocation succeeds.
10024 Redo calculations to avoid overflow.
10025 * keyboard.h: Change prototypes to match the above.
10026
10027 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10028 to count maps.
10029 (current_minor_maps): Check for size calculation overflow.
10030 * keymap.h: Change prototypes to match the above.
10031
10032 * lread.c (read1, init_obarray): Don't update size until alloc done.
10033
10034 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10035 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10036
10037 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10038 Now ptrdiff_t, not int.
10039 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10040 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10041
10042 * process.c (Fnetwork_interface_list): Check for overflow
10043 in size calculation.
10044
10045 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10046
10047 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10048 overflow. Don't bother calling xmalloc when xrealloc will do.
10049
10050 * search.c (Freplace_match): Check for size calculation overflow.
10051 (Fset_match_data): Don't assume list lengths fit in 'int'.
10052
10053 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10054 for command line length. Do not attempt to address one before the
10055 beginning of an array, as that's not portable.
10056
10057 * term.c (max_frame_lines): Remove; unused.
10058 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10059 not int.
10060 (encode_terminal_code, calculate_costs): Check for size
10061 calculation overflow.
10062 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10063 table lengths and related sizes. Don't update size until alloc
10064 done. Redo calculations to avoid overflow.
10065 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10066
10067 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10068 subtracting pointers.
10069 (gobble_line): Check for overflow more carefully. Don't update size
10070 until alloc done.
10071
10072 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10073 Don't update size until alloc done.
10074 Redo size calculations to avoid overflow.
10075 Check for size calculation overflow.
10076 (main) [DEBUG]: Fix typo in invoking tparam1.
10077
10078 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10079 Use ptrdiff_t, not int, for sizes.
10080 (store_mode_line_noprop_char): Don't update size until alloc done.
10081
10082 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10083 Use ptrdiff_t, not int, for sizes.
10084 (Finternal_make_lisp_face, cache_face):
10085 Check for size calculation overflow.
10086 (cache_face): Treat size calculation overflows as if they were
10087 memory exhaustion (the usual treatment), rather than aborting.
10088
10089 * xfns.c (x_encode_text, x_set_name_internal)
10090 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10091 sizes, since they can exceed INT_MAX in size. Check for size
10092 calculation overflow.
10093
10094 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10095 (xg_select): Check for size calculation overflow.
10096 Don't update size until alloc done.
10097
10098 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10099 as sprintf is limited to int lengths.
10100
10101 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10102 (X_LONG_MIN): New macros.
10103 Use them to make the following changes clearer.
10104 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10105 This change doesn't affect the value now, but it may help remind
10106 future maintainers not to raise the value too much later.
10107 (SELECTION_QUANTUM): Remove, replacing with ...
10108 (selection_quantum): ... new function, which avoids overflow.
10109 All uses changed.
10110 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10111 assumption that selection length fits in 'int'.
10112 (x_reply_selection_request, x_handle_selection_request)
10113 (x_get_window_property, receive_incremental_selection)
10114 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10115 (lisp_data_to_selection_data, clean_local_selection_data):
10116 Use ptrdiff_t, not int, to record length of selection.
10117 (x_reply_selection_request, x_get_window_property)
10118 (receive_incremental_selection, x_property_data_to_lisp):
10119 Redo calculations to avoid overflow.
10120 (x_reply_selection_request): When sending hint, ceiling it at
10121 X_LONG_MAX rather than relying on wraparound overflow to send
10122 something.
10123 (x_get_window_property, receive_incremental_selection)
10124 (lisp_data_to_selection_data, x_property_data_to_lisp):
10125 Check for size-calculation overflow.
10126 (x_get_window_property, receive_incremental_selection)
10127 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10128 Don't store size until memory allocation succeeds.
10129 (x_get_window_property): Plug memory leak on memory exhaustion.
10130 Don't double-block input; malloc is safe here. Don't assume 2**34
10131 - 4 fits in unsigned long. Add an xassert to check
10132 XGetWindowProperty overflow. Be more careful about overflow
10133 calculations, and distinguish size from memory overflow better.
10134 (receive_incremental_selection): When tracing, don't assume
10135 unsigned int is less than INT_MAX.
10136 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10137 harmful) conversions of unsigned short to int.
10138 (lisp_data_to_selection_data): Don't assume that integers
10139 in the range -65535 through -1 fit in an X unsigned short.
10140 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10141 result parameters unless successful. Rely on cons_to_unsigned
10142 to report problems with elements; the old code wasn't right anyway.
10143 (x_check_property_data): Check for int overflow; we cannot use
10144 a wider type due to X limits.
10145 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10146
10147 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10148
10149 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10150 (x_term_init): Check for size calculation overflow.
10151 (x_color_cells): Don't store size until memory allocation succeeds.
10152 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10153 Don't assume alloca size is less than MAX_ALLOCA.
10154 (x_term_init): Don't assume length fits in int (sprintf is limited
10155 to int size).
10156
10157 Use ptrdiff_t for composition IDs.
10158 * character.c (lisp_string_width):
10159 * composite.c (composition_table_size, n_compositions)
10160 (get_composition_id, composition_gstring_from_id):
10161 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10162 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10163 * window.c (Frecenter):
10164 Use ptrdiff_t, not int, for composition IDs.
10165 * composite.c (get_composition_id): Check for integer overflow.
10166 * composite.h: Adjust prototypes to match the above changes.
10167
10168 Use ptrdiff_t for hash table indexes.
10169 * category.c (hash_get_category_set):
10170 * ccl.c (ccl_driver):
10171 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10172 * coding.c (coding_system_charset_list, detect_coding_system):
10173 * coding.h (struct coding_system.id):
10174 * composite.c (get_composition_id, gstring_lookup_cache):
10175 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10176 * image.c (xpm_get_color_table_h):
10177 * lisp.h (hash_lookup, hash_put):
10178 * minibuf.c (Ftest_completion):
10179 Use ptrdiff_t for hash table indexes, not int (which is too
10180 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10181 32-bit --with-wide-int hosts).
10182
10183 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10184 Add a FIXME comment about memory leaks.
10185 (syms_of_charset): Don't assume xmalloc returns.
10186
10187 Don't assume that stated character widths fit in int.
10188 * character.c (Fchar_width, c_string_width, lisp_string_width):
10189 * character.h (CHAR_WIDTH):
10190 * indent.c (MULTIBYTE_BYTES_WIDTH):
10191 Use sanitize_char_width to avoid undefined and/or bad behavior
10192 with outlandish widths.
10193 * character.h (sanitize_tab_width): Rename from sanitize_width,
10194 now that we have two such functions. All uses changed.
10195 (sanitize_char_width): New inline function.
10196
10197 Don't assume that tab-width fits in int.
10198 * character.h (sanitize_width): New inline function.
10199 (SANE_TAB_WIDTH): New macro.
10200 (ASCII_CHAR_WIDTH): Use it.
10201 * indent.c (sane_tab_width): Remove. All uses replaced by
10202 SANE_TAB_WIDTH (current_buffer).
10203 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10204
10205 * fileio.c: Integer overflow issues with file modes.
10206 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10207
10208 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10209 Remove unreachable code.
10210 (read_hex, load_charset_map_from_file): Check for integer overflow.
10211
10212 * xterm.c: Don't go over XClientMessageEvent limit.
10213 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10214 (x_send_scroll_bar_event): Likewise. Check that the size does not
10215 exceed limits imposed by XClientMessageEvent, as well as the usual
10216 ptrdiff_t and size_t limits.
10217
10218 * keyboard.c: Overflow, signedness and related fixes.
10219 (make_lispy_movement): Use same integer type in forward decl
10220 that is used in the definition.
10221 (read_key_sequence, keyremap_step):
10222 Change bufsize argument back to int, undoing my 2011-03-30 change.
10223 We prefer signed types, and int is wide enough here.
10224 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10225 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10226 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10227 length, not size_t. Use ptrdiff_t for index, not int.
10228 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10229 possibility of integer overflow.
10230
10231 Overflow, signedness and related fixes for images.
10232
10233 * dispextern.h (struct it.stack[0].u.image.image_id)
10234 (struct_it.image_id, struct image.id, struct image_cache.size)
10235 (struct image_cache.used, struct image_cache.ref_count):
10236 * gtkutil.c (update_frame_tool_bar):
10237 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10238 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10239 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10240 * nsmenu.m (update_frame_tool_bar):
10241 * xdisp.c (calc_pixel_width_or_height):
10242 * xfns.c (image_cache_refcount):
10243 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10244 on typical 64-bit hosts.
10245
10246 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10247 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10248 Omit unnecessary casts to int.
10249 (parse_image_spec): Check that integers fall into 'int' range
10250 when the callers expect that.
10251 (image_ascent): Redo ascent calculation to avoid int overflow.
10252 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10253 (lookup_image): Remove unnecessary tests.
10254 (xbm_image_p): Locals are now of int, not EMACS_INT,
10255 since parse_image_check makes sure they fit into int.
10256 (png_load, gif_load, svg_load_image):
10257 Prefer int to unsigned where either will do.
10258 (tiff_handler): New function, combining the cores of the
10259 old tiff_error_handler and tiff_warning_handler.
10260 This function is rewritten to use vsnprintf and thereby avoid
10261 stack buffer overflows. It uses only the features of vsnprintf
10262 that are common to both POSIX and native Microsoft.
10263 (tiff_error_handler, tiff_warning_handler): Use it.
10264 (tiff_load, gif_load, imagemagick_load_image):
10265 Don't assume :index value fits in 'int'.
10266 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10267 (imagemagick_load_image): Check that crop parameters fit into
10268 the integer types that MagickCropImage accepts. Don't assume
10269 Vimagemagick_render_type has a nonnegative value. Don't assume
10270 size_t fits in 'long'.
10271 (gs_load): Use printmax_t to print the widest integers possible.
10272 Check for integer overflow when computing image height and width.
10273
10274 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10275
10276 * xdisp.c (redisplay_window): Don't force window start if point
10277 will be invisible in the resulting window. (Bug#9324)
10278
10279 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10280
10281 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10282 the display spec is of the form `(space ...)'.
10283 (handle_display_spec): Return the value returned by
10284 handle_single_display_spec, not just 1 or zero.
10285 (handle_single_display_spec): If the display spec is of the form
10286 `(space ...)', and specifies display in the text area, return 2
10287 rather than 1.
10288 (try_cursor_movement): Check for the need to scroll more
10289 accurately, and prefer exact match for point under bidi.
10290 Don't advance `row' beyond the last row of the window.
10291
10292 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10293 into disp_prop; all users changed.
10294
10295 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10296 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10297 for the text covered by the display property.
10298
10299 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10300
10301 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10302 Change return value to nil.
10303 (Frecord_buffer): Delete unused function.
10304
10305 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10306
10307 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10308 buffers, return left-to-right.
10309 (set_cursor_from_row): Consider candidate row a win if its glyph
10310 represents a newline and point is on that newline. Fixes cursor
10311 positioning on the newline at EOL of R2L text within L2R
10312 paragraph, and vice versa.
10313 (try_cursor_movement): Check continued rows, in addition to
10314 continuation rows. Fixes unwarranted scroll when point enters a
10315 continued line of R2L text within an L2R paragraph, or vice versa.
10316 (cursor_row_p): Consider the case of point being equal to
10317 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10318 from the end of a short line to the beginning of a continued line
10319 of R2L text within L2R paragraph.
10320 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10321 composed characters.
10322
10323 * bidi.c (bidi_check_type): Use xassert.
10324 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10325 members.
10326
10327 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10328
10329 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10330 a character.
10331
10332 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10333
10334 * nsfont.m (ns_otf_to_script): Fix typo.
10335
10336 2011-08-22 Kenichi Handa <handa@m17n.org>
10337
10338 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10339 extra slot even if the purpose is char-code-property-table.
10340
10341 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10342
10343 * xdisp.c (redisplay_window): When computing centering_position,
10344 account for the height of the header line. (Bug#8874)
10345
10346 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10347 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10348 candidate is selected by the mouse, and that candidate has a
10349 composed character under the mouse.
10350
10351 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10352 coordinates reported by pos-visible-in-window-p for a composed
10353 character in column zero.
10354
10355 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10356
10357 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10358
10359 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10360
10361 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10362 consider it a hit if to_charpos is anywhere in the range of the
10363 composed buffer positions.
10364
10365 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10366
10367 * image.c (gif_load): Don't assume that each subimage has the same
10368 dimensions as the base image. Handle disposal method that is
10369 "undefined" by the gif spec (Bug#9335).
10370
10371 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10372
10373 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10374 (Fcondition_case): Document `debug' symbol in error handler.
10375
10376 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10377
10378 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10379 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10380 from an Org mode buffer to a Speedbar frame.
10381
10382 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10383 a composition, take its buffer position from IT->cmp_it.charpos.
10384 Fixes cursor positioning at the beginning of a line that begins
10385 with a composed character.
10386
10387 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10388
10389 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10390 character bidirectional type, use STRONG_L instead. Fixes crashes
10391 in a buffer produced by `describe-categories'.
10392
10393 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10394 members before the level stack, so they would be saved and
10395 restored when copying iterator state. Fixes incorrect reordering
10396 around TABs covered by display properties.
10397
10398 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10399
10400 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10401
10402 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10403
10404 * eval.c (internal_condition_case, internal_condition_case_1)
10405 (internal_condition_case_2, internal_condition_case_n):
10406 Remove unnecessary aborts (Bug#9081).
10407
10408 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10409
10410 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10411 has no `load' handler, try opening the file locally. (Bug#9311)
10412
10413 2011-08-16 Ken Brown <kbrown@cornell.edu>
10414
10415 * gmalloc.c: Expand comment.
10416
10417 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10418
10419 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10420 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10421
10422 2011-08-16 Ken Brown <kbrown@cornell.edu>
10423
10424 Fix memory allocation problems in Cygwin build (Bug#9273).
10425
10426 * unexcw.c ( __malloc_initialized): Declare external variable.
10427 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10428
10429 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10430 New variables.
10431 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10432 dumped emacs.
10433 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10434 in the static heap.
10435 [CYGWIN] (special_realloc): New function.
10436 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10437 requests to realloc storage in the static heap.
10438
10439 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10440
10441 * bidi.c (bidi_initialize): Remove unused local.
10442
10443 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10444
10445 * bidimirror.h:
10446 * biditype.h: Remove file.
10447 * makefile.w32-in ($(BLD)/bidi.$(O)):
10448 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10449
10450 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10451
10452 * chartab.c: Improve commentary for the uniprop_table API.
10453
10454 * bidi.c (bidi_paragraph_init): Support zero value of
10455 bidi_ignore_explicit_marks_for_paragraph_level.
10456 (bidi_initialize): Use uniprop_table instead of including
10457 biditype.h and bidimirror.h.
10458
10459 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10460 coordinates of the iterator when restoring from ppos_it.
10461 (Bug#9296)
10462
10463 2011-08-14 Kenichi Handa <handa@m17n.org>
10464
10465 * process.c (create_process): Call setup_process_coding_systems
10466 after the pid of the process is set to -1 (Bug#8162).
10467
10468 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10469
10470 * xdisp.c (move_it_in_display_line_to): Don't invoke
10471 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10472 ppos_it. Fixes vertical cursor motion when line beginning is
10473 covered by an image. (Bug#9296)
10474
10475 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10476
10477 * nsterm.h (ns_run_ascript): Declare.
10478 (NSAPP_DATA2_RUNASSCRIPT): Define.
10479
10480 * nsfns.m (as_script, as_result, as_status): New static variables.
10481 (ns_run_ascript): New function.
10482 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10483 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10484 the event loop. Get status from as_status (Bug#7276).
10485
10486 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10487 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10488 the event loop (Bug#7276).
10489
10490 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10491
10492 * gnutls.c (QCgnutls_bootprop_priority)
10493 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10494 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10495 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10496 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10497 (QCgnutls_bootprop_verify_hostname_error)
10498 (QCgnutls_bootprop_callbacks_verify): Rename from
10499 Qgnutls_bootprop_..., all uses changed.
10500
10501 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10502 uses changed.
10503
10504 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10505
10506 * xfaces.c (Qframe_set_background_mode): Now static.
10507 * dispextern.h (Qframe_set_background_mode): Remove decl.
10508
10509 * process.c (Fnetwork_interface_info): Declare local only if needed.
10510
10511 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10512
10513 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10514 (Fnetwork_interface_list): Allocate in increments of bytes instead
10515 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10516 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10517 sockaddr.
10518 (struct ifflag_def): notrailers is smart on OSX.
10519 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10520 Get hardware address with getifaddrs if available.
10521
10522 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10523
10524 * xdisp.c (iterate_out_of_display_property): xassert that
10525 IT->position is set to within IT->object's boundaries. Break from
10526 the loop as soon as EOB is reached; avoids infloops in redisplay
10527 when IT->position is set up wrongly due to some bug.
10528 Set IT->current to match the bidi iterator unconditionally.
10529 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10530 entry. Force push_it to save on the stack the current
10531 buffer/string position, to be restored by pop_it. Fix flags in
10532 the iterator structure wrt the object coming from a display
10533 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10534 properties. (Bug#9284)
10535
10536 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10537
10538 * fontset.c (fontset_get_font_group): Add proper type checks.
10539 (Bug#9172)
10540
10541 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10542
10543 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10544 and LC_VERSION_MIN_MACOSX.
10545 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10546 (dump_it) [LC_FUNCTION_STARTS]: Use it.
10547
10548 2011-08-08 Eli Zaretskii <eliz@gnu.org>
10549
10550 * xdisp.c (forward_to_next_line_start): Allow to use the
10551 no-display-properties-and-no-overlays under bidi display.
10552 Set disp_pos in the bidi iterator to avoid searches for display
10553 properties and overlays.
10554
10555 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
10556
10557 * editfns.c (Fset_time_zone_rule): Document relationship with the
10558 setenv function.
10559
10560 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10561 the font entity extracted from the cache (Bug#8109).
10562
10563 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
10564
10565 * composite.c (autocmp_chars): Don't reset point. That is done by
10566 restore_point_unwind (Bug#5984).
10567
10568 2011-08-07 Juri Linkov <juri@jurta.org>
10569
10570 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10571 to show the arg `TIME' instead of `TIMEVAL'.
10572
10573 2011-08-06 Eli Zaretskii <eliz@gnu.org>
10574
10575 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10576 display property strides EOL and includes a newline, as in
10577 longlines-mode. (Bug#9254)
10578 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10579 word-wrap under bidirectional display. (Bug#9224)
10580
10581 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10582 is non-zero, even if the data buffer is NULL. Fixes a crash in
10583 vertical-motion with longlines-mode. (Bug#9254)
10584
10585 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10586
10587 * bidi.c <bidi_cache_total_alloc>: Now static.
10588 (bidi_initialize): Initialize bidi_cache_total_alloc.
10589
10590 * xdisp.c (display_line): Release buffer allocated for shelved bidi
10591 cache. (Bug#9221)
10592
10593 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10594 amount allocated this far in `bidi_cache_total_alloc'.
10595 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10596 non-zero, only free the data buffer without restoring the cache
10597 contents. All callers changed.
10598
10599 * dispextern.h (bidi_unshelve_cache): Update prototype.
10600
10601 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10602 (move_it_in_display_line, move_it_to)
10603 (move_it_vertically_backward, move_it_by_lines): Replace the call
10604 to xfree to an equivalent call to bidi_unshelve_cache.
10605 (move_it_in_display_line_to): Fix logic of returning
10606 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
10607
10608 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10609
10610 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10611 came from a string character with a `cursor' property. (Bug#9229)
10612
10613 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10614
10615 * Makefile.in (LIB_PTHREAD): New variable.
10616 (LIBES): Add LIB_PTHREAD (Bug#9216).
10617
10618 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10619 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10620
10621 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10622
10623 * regex.c (re_iswctype): Remove some redundant boolean conversions.
10624
10625 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10626
10627 * xterm.c (x_find_topmost_parent): New function.
10628 (x_set_frame_alpha): Find topmost parent window with
10629 x_find_topmost_parent and set the property there also (bug#9181).
10630 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10631
10632 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10633
10634 * callproc.c (Fcall_process): Avoid vfork clobbering
10635 the local vars buffer, coding_systems, current_dir.
10636
10637 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10638
10639 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10640
10641 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10642
10643 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10644 so that it is not optimized away.
10645
10646 * xdisp.c (compute_display_string_pos): Remove unused local.
10647
10648 2011-08-02 Eli Zaretskii <eliz@gnu.org>
10649
10650 Fix slow cursor motion and scrolling in large buffers with
10651 selective display, like Org Mode buffers. (Bug#9218)
10652
10653 * dispextern.h (struct bidi_it): New member disp_prop_p.
10654
10655 * xdisp.c: Remove one-slot cache of display string positions.
10656 (compute_display_string_pos): Accept an additional argument
10657 DISP_PROP_P; callers changed. Scan at most 5K characters forward
10658 for a display string or property. If found, set DISP_PROP_P
10659 non-zero.
10660
10661 * bidi.c (bidi_fetch_char): Accept an additional argument
10662 DISP_PROP_P, and pass it to compute_display_string_pos.
10663 Only handle text covered by a display string if DISP_PROP_P is returned
10664 non-zero. All callers of bidi_fetch_char changed.
10665
10666 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10667
10668 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10669
10670 2010-12-03 Don March <don@ohspite.net>
10671
10672 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10673 last character M-[char] is translated to ESC [char] (bug#7541).
10674
10675 2011-08-02 Kenichi Handa <handa@m17n.org>
10676
10677 * lisp.h (uniprop_table): Extern it.
10678
10679 * chartab.c (uniprop_table): Make it non-static.
10680
10681 2011-08-01 Eli Zaretskii <eliz@gnu.org>
10682
10683 * xdisp.c (forward_to_next_line_start): Accept additional argument
10684 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10685 on the newline.
10686 (reseat_at_next_visible_line_start): Use the bidi iterator state
10687 returned by forward_to_next_line_start to restore the state of
10688 it->bidi_it after backing up to previous newline. (Bug#9212)
10689
10690 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10691
10692 * regex.c (re_comp): Protoize.
10693 (re_exec): Fix return type.
10694 (regexec): Fix type of `ret'. (Bug#9203)
10695
10696 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10697
10698 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10699 This is needed if max-image-size is a floating-point number.
10700
10701 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10702
10703 * print.c (print_object): Print empty symbol as ##.
10704
10705 * lread.c (read1): Read ## as empty symbol.
10706
10707 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10708
10709 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10710 setting frame foreground color (Bug#9175).
10711 (x_set_background_color): Likewise.
10712
10713 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10714 contents (Bug#9176).
10715 (EmacsTooltip -init): Remove bezels and add shadows to
10716 tooltip windows.
10717
10718 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10719 or scroll bar (Bug#8470).
10720
10721 * nsfont.m (nsfont_open): Remove assignment to voffset and
10722 unnecessary vars hshink, expand, hd, full_height, min_height.
10723 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10724
10725 * nsterm.h (nsfont_info): Remove voffset field.
10726
10727 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10728
10729 Implement strike-through and overline on NextStep (Bug#8863).
10730
10731 * nsfont.m (nsfont_open): Use underline position provided by font,
10732 instead of hard-coded value of 2.
10733 (nsfont_draw): Call ns_draw_text_decoration instead.
10734
10735 * nsterm.h: Add declaration for ns_draw_text_decoration.
10736
10737 * nsterm.m (ns_draw_text_decoration): New function for drawing
10738 underline, overline, and strike-through.
10739 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
10740 ns_draw_text_decoration. Change treatment of cursor drawing to
10741 accommodate underlining, etc.
10742
10743 2011-07-28 Eli Zaretskii <eliz@gnu.org>
10744
10745 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10746 default.
10747
10748 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10749
10750 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10751 Without this fix, if a signal arrives just after memory fills up,
10752 'malloc' might be invoked reentrantly.
10753
10754 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10755 In other words, assume that every image size is allowed, on non-X
10756 hosts. This assumption is probably wrong, but it lets Emacs compile.
10757
10758 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10759
10760 * regex.c (re_iswctype): Convert return values to boolean.
10761
10762 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10763
10764 * xdisp.c (compute_display_string_pos): Don't use cached display
10765 string position if the buffer had its restriction changed.
10766 (Bug#9184)
10767
10768 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10769
10770 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10771
10772 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10773
10774 Integer signedness and overflow and related fixes. (Bug#9079)
10775
10776 * bidi.c: Integer size and overflow fixes.
10777 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10778 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10779 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10780 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10781 (bidi_find_other_level_edge):
10782 Use ptrdiff_t instead of EMACS_INT where either will do.
10783 This works better on 32-bit hosts configured --with-wide-int.
10784 (bidi_cache_ensure_space): Check for size-calculation overflow.
10785 Use % rather than repeated addition, for better worst-case speed.
10786 Don't set bidi_cache_size until after xrealloc returns, because it
10787 might not return.
10788 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
10789 (bidi_cache_ensure_space): Also check that the bidi cache size
10790 does not exceed that of the largest Lisp string or buffer. See Eli
10791 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
10792
10793 * alloc.c (__malloc_size_t): Remove.
10794 All uses replaced by size_t. See Andreas Schwab's note
10795 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10796
10797 * image.c: Improve checking for integer overflow.
10798 (check_image_size): Assume that f is nonnull, since
10799 it is always nonnull in practice. This is one less thing to
10800 worry about when checking for integer overflow later.
10801 (x_check_image_size): New function, which checks for integer
10802 overflow issues inside X.
10803 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10804 This removes the need for a memory_full check.
10805 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10806 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10807 (xbm_read_bitmap_data): Change locals back to 'int', since
10808 their values must fit in 'int'.
10809 (xpm_load_image, png_load, tiff_load):
10810 Invoke x_create_x_image_and_pixmap earlier,
10811 to avoid much needless work if the image is too large.
10812 (tiff_load): Treat overly large images as if
10813 x_create_x_image_and_pixmap failed, not as malloc failures.
10814 (gs_load): Use x_check_image_size.
10815
10816 * gtkutil.c: Omit integer casts.
10817 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10818 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10819
10820 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10821
10822 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10823 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10824 would wrongly return t on a 64-bit host.
10825
10826 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10827 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10828 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10829 and therefore cause GCC to emit a bogus diagnostic in some cases.
10830
10831 * image.c: Integer signedness and overflow and related fixes.
10832 This is not an exhaustive set of fixes, but it's time to
10833 record what I've got.
10834 (lookup_pixel_color, check_image_size): Remove redundant decls.
10835 (check_image_size): Don't assume that arbitrary EMACS_INT values
10836 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10837 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10838 (tiff_load, imagemagick_load_image):
10839 Check for overflow in size calculations.
10840 (x_create_x_image_and_pixmap): Remove unnecessary test for
10841 xmalloc returning NULL; that can't happen.
10842 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10843 (xpm_color_bucket): Use better integer hashing function.
10844 (xpm_cache_color): Don't possibly over-allocate memory.
10845 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10846 (gif_memory_source):
10847 Use ptrdiff_t, not int or size_t, to record sizes.
10848 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10849 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10850 either works, as we prefer signed integers.
10851 (tiff_read_from_memory, tiff_write_from_memory):
10852 Return tsize_t, not size_t, since that's what the TIFF API wants.
10853 (tiff_read_from_memory): Don't fail simply because the read would
10854 go past EOF; instead, return a short read.
10855 (tiff_load): Omit no-longer-needed casts.
10856 (Fimagemagick_types): Don't assume size fits into 'int'.
10857
10858 Improve hashing quality when configured --with-wide-int.
10859 * fns.c (hash_string): New function, taken from sxhash_string.
10860 Do not discard information about ASCII character case; this
10861 discarding is no longer needed.
10862 (sxhash-string): Use it. Change sig to match it. Caller changed.
10863 * lisp.h: Declare it.
10864 * lread.c (hash_string): Remove, since we now use fns.c's version.
10865 The fns.c version returns a wider integer if --with-wide-int is
10866 specified, so this should help the quality of the hashing a bit.
10867
10868 * emacs.c: Integer overflow minor fix.
10869 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10870 Define only if GNU_LINUX.
10871 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10872
10873 * dispnew.c: Integer signedness and overflow fixes.
10874 Remove unnecessary forward decls, that were a maintenance hassle.
10875 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10876 All uses changed.
10877 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10878 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10879 (prepare_desired_row, line_draw_cost):
10880 Use int, not unsigned, where either works.
10881 (save_current_matrix, restore_current_matrix):
10882 Use ptrdiff_t, not size_t, where either works.
10883 (init_display): Check for overflow more accurately, and without
10884 relying on undefined behavior.
10885
10886 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10887 Remove, replacing with the new symbols in lisp.h. All uses changed.
10888 * fileio.c (make_temp_name):
10889 * filelock.c (lock_file_1, lock_file):
10890 * xdisp.c (message_dolog):
10891 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10892 Use pMd etc. instead.
10893 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10894 replacing the pWIDE etc. symbols removed from editfns.c.
10895
10896 * keyboard.h (num_input_events): Now uintmax_t.
10897 This is (very slightly) less likely to mess up due to wraparound.
10898 All uses changed.
10899
10900 * buffer.c: Integer signedness fixes.
10901 (alloc_buffer_text, enlarge_buffer_text):
10902 Use ptrdiff_t rather than size_t when either will do, as we prefer
10903 signed integers.
10904
10905 * alloc.c: Integer signedness and overflow fixes.
10906 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10907 (__malloc_size_t): Default to size_t, not to int.
10908 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10909 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10910 Prefer ptrdiff_t to size_t when either would do, as we prefer
10911 signed integers.
10912 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10913 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10914 Now const. Initialize with values that are in range even if char
10915 is signed.
10916 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10917 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10918 These functions do the right thing with sizes > 2**32.
10919 (check_depth): Now ptrdiff_t, not int.
10920 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10921 Adjust to new way of storing sizes. Check for size overflow bugs
10922 in rest of code.
10923 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10924 slightly wrong anyway, as it missed one instance of
10925 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10926 (refill_memory_reserve): Omit needless cast to size_t.
10927 (mark_object_loop_halt): Mark as externally visible.
10928
10929 * xselect.c: Integer signedness and overflow fixes.
10930 (Fx_register_dnd_atom, x_handle_dnd_message):
10931 Use ptrdiff_t, not size_t, since we prefer signed.
10932 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10933 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10934 x_dnd_atoms_size and x_dnd_atoms_length.
10935
10936 * doprnt.c: Prefer signed to unsigned when either works.
10937 * eval.c (verror):
10938 * doprnt.c (doprnt):
10939 * lisp.h (doprnt):
10940 * xdisp.c (vmessage):
10941 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10942 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10943 prefer signed arithmetic to avoid comparison confusion.
10944 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10945 but is a bit tricky.
10946
10947 Assume freestanding C89 headers, string.h, stdlib.h.
10948 * data.c, doprnt.c, floatfns.c, print.c:
10949 Include float.h unconditionally.
10950 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10951 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10952 * regex.c: Likewise for stddef.h, string.h.
10953 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10954 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10955 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10956 (STDC_HEADERS): Remove obsolete defines.
10957 * sysdep.c: Include limits.h unconditionally.
10958
10959 Assume support for memcmp, memcpy, memmove, memset.
10960 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10961 * regex.c (memcmp, memcpy):
10962 Remove; we assume C89 now.
10963
10964 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10965 (__malloc_safe_bcopy): Remove; no longer needed.
10966
10967 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
10968 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10969 well either way, and we prefer signed to unsigned.
10970
10971 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10972
10973 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10974 closes the connection while we're reading (bug#9182).
10975
10976 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
10977
10978 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10979 are specified (Bug#9168).
10980
10981 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10982
10983 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10984 Found by GCC static checking and --with-wide-int on a 32-bit host.
10985
10986 2011-07-25 Eli Zaretskii <eliz@gnu.org>
10987
10988 * xdisp.c (compute_display_string_pos): Fix logic of caching
10989 previous display string position. Initialize cached_prev_pos to
10990 -1. Fixes slow-down at the beginning of a buffer.
10991
10992 2011-07-24 Eli Zaretskii <eliz@gnu.org>
10993
10994 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10995 for attrs[LFACE_FONTSET_INDEX].
10996
10997 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10998
10999 * xml.c (parse_region): Remove unused local
11000 that was recently introduced.
11001
11002 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11003
11004 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11005 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11006
11007 * xdisp.c (move_it_in_display_line_to): Record the best matching
11008 position for TO_CHARPOS while scanning the line, and restore it on
11009 exit if none of the characters scanned was an exact match.
11010 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11011 when exact match is impossible due to invisible text, and the
11012 lines are truncated.
11013
11014 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11015
11016 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11017 for OSX >= 10.7.
11018
11019 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11020
11021 Fix a significant slow-down of cursor motion with C-n, C-p,
11022 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11023 auto-repeat under bidi redisplay in fontified buffers.
11024 * xdisp.c (compute_stop_pos_backwards): New function.
11025 (next_element_from_buffer): Call compute_stop_pos_backwards to
11026 find a suitable prev_stop when we find ourselves before
11027 base_level_stop.
11028 (reseat): Don't look for prev_stop, as that could mean a very long
11029 run.
11030 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11031 <cached_disp_overlay_modiff>: Cache for last found display string
11032 position.
11033 (compute_display_string_pos): Return the cached position if asked
11034 about the same buffer in the same area of character positions, and
11035 the buffer wasn't changed since the time the display string
11036 position was cached.
11037
11038 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11039
11040 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11041 is an integer, which is important for empty lines. (Bug#9149)
11042
11043 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11044
11045 * frame.c (Fmodify_frame_parameters): In tty case, update the
11046 default face if necessary (Bug#4238).
11047
11048 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11049
11050 * editfns.c (Fstring_to_char): No need to explain what a character
11051 is in the docstring (Bug#6576).
11052
11053 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11054
11055 * xml.c (parse_region): Make sure we always return a tree.
11056
11057 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11058
11059 * xml.c (parse_region): If a document contains only comments,
11060 return that, too.
11061
11062 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11063
11064 * xml.c (make_dom): Return comments, too.
11065
11066 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11067
11068 Port to OpenBSD.
11069 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11070 and the surrounding thread.
11071 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11072 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11073 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11074 timer goes off.
11075 * s/openbsd.h (BROKEN_SIGIO): Define.
11076 * unexelf.c (unexec) [__OpenBSD__]:
11077 Don't update the .mdebug section of the Alpha COFF symbol table.
11078
11079 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11080
11081 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11082 (bug#8460).
11083
11084 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11085
11086 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11087 This fixes some race conditions on the permissions of any newly
11088 created file.
11089
11090 * alloc.c (valid_pointer_p): Use pipe, not open.
11091 This fixes some permissions issues when debugging.
11092
11093 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11094 If fchown fails to set both uid and gid, try to set just gid,
11095 as that is sometimes allowed. Adjust the file's mode to eliminate
11096 setuid or setgid bits that are inappropriate if fchown fails.
11097
11098 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11099
11100 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11101 to compare Lisp_Objects.
11102 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11103 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11104 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11105
11106 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11107
11108 * lread.c (read_integer): Unread even EOF character.
11109 (read1): Likewise. Properly record start position of symbol.
11110
11111 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11112 symbol character follows.
11113
11114 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11115
11116 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11117 This works around a problem with the previous change to Fcopy_file.
11118 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11119 and without this change, GCC might complain about discarding
11120 fchown's return value.
11121
11122 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11123
11124 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11125
11126 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11127
11128 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11129
11130 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11131
11132 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11133 it's used from the C level.
11134
11135 * process.c: Use the same condition for POLL_FOR_INPUT in both
11136 keyboard.c and process.c (bug#1858).
11137
11138 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11139
11140 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11141 (Fgnutls_boot): Use it.
11142
11143 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11144
11145 * doc.c (Fsubstitute_command_keys): Revert last change.
11146
11147 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11148
11149 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11150 quotes the next character, and doesn't affect other longer
11151 sequences (bug#8935).
11152
11153 * lread.c (syms_of_lread): Clarify that is isn't only
11154 `eval-buffer' and `eval-defun' that's affected by
11155 `lexical-binding' (bug#8460).
11156
11157 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11158
11159 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11160 bidi redisplay when a line includes both an image and is truncated.
11161
11162 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11163
11164 Fix minor problems found by static checking.
11165 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11166 (elsz): Now a signed constant, not a size_t var. We prefer signed
11167 types to unsigned, to avoid integer comparison confusion. Without
11168 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11169 "cannot optimize loop, the loop counter may overflow", a symptom
11170 of the confusion.
11171 * indent.c (Fvertical_motion): Mark locals as initialized.
11172 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11173
11174 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11175
11176 * search.c (Fre_search_backward): Mention `case-fold-search' in
11177 all the re_search_* functions (bug#8138).
11178
11179 * keyboard.c (Fopen_dribble_file): Document when the file is
11180 closed (bug#8056).
11181
11182 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11183
11184 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11185 bidi_cache_idx.
11186
11187 Support bidi reordering of display and overlay strings.
11188 * xdisp.c (compute_display_string_pos)
11189 (compute_display_string_end): Accept additional argument STRING.
11190 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11191 (reseat_to_string): Initialize bidi_it->string.s and
11192 bidi_it->string.schars.
11193 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11194 NULL (avoids a crash in bidi_paragraph_init).
11195 Initialize itb.string.lstring.
11196 (init_iterator): Call bidi_init_it only of a valid
11197 buffer position was specified. Initialize paragraph_embedding to
11198 L2R.
11199 (reseat_to_string): Initialize the bidi iterator.
11200 (display_string): If we need to ignore text properties of
11201 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11202 original value of -1 will not work with bidi.)
11203 (compute_display_string_pos): First arg is now struct
11204 `text_pos *'; all callers changed. Support display properties on
11205 Lisp strings.
11206 (compute_display_string_end): Support display properties on Lisp
11207 strings.
11208 (init_iterator, reseat_1, reseat_to_string): Initialize the
11209 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11210 when iterating on a string not from display properties).
11211 (compute_display_string_pos, compute_display_string_end):
11212 Fix calculation of the object to scan. Fixes an error when using
11213 arrow keys.
11214 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11215 base_level_stop; instead, set base_level_stop to BEGV.
11216 Fixes crashes in vertical-motion.
11217 (next_element_from_buffer): Improve commentary for when
11218 the iterator is before prev_stop.
11219 (init_iterator): Initialize bidi_p from the default value of
11220 bidi-display-reordering, not from buffer-local value. Use the
11221 buffer-local value only if initializing for buffer iteration.
11222 (handle_invisible_prop): Support invisible properties on strings
11223 that are being bidi-reordered.
11224 (set_iterator_to_next): Support bidi reordering of C strings and
11225 Lisp strings.
11226 (next_element_from_string): Support bidi reordering of Lisp
11227 strings.
11228 (handle_stop_backwards): Support Lisp strings as well.
11229 (display_string): Support display of R2L glyph rows.
11230 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11231 (init_iterator): Don't initialize it->bidi_p for strings
11232 here.
11233 (reseat_to_string): Initialize it->bidi_p for strings here.
11234 (next_element_from_string, next_element_from_c_string)
11235 (next_element_from_buffer): Add xassert's for correspondence
11236 between IT's object being iterated and it->bidi_it.string
11237 structure.
11238 (face_before_or_after_it_pos): Support bidi iteration.
11239 (next_element_from_c_string): Handle the case of the first string
11240 character that is not the first one in the visual order.
11241 (get_visually_first_element): New function, refactored from common
11242 parts of next_element_from_buffer, next_element_from_string, and
11243 next_element_from_c_string.
11244 (tool_bar_lines_needed, redisplay_tool_bar)
11245 (display_menu_bar): Force left-to-right direction. Add a FIXME
11246 comment for making that be controlled by a user option.
11247 (push_it, pop_it): Save and restore the state of the
11248 bidi iterator. Save and restore the bidi_p flag.
11249 (pop_it): Iterate out of display property for string iteration as
11250 well.
11251 (iterate_out_of_display_property): Support iteration over strings.
11252 (handle_single_display_spec): Set up it->bidi_it for iteration
11253 over a display string, and call bidi_init_it.
11254 (handle_single_display_spec, next_overlay_string)
11255 (get_overlay_strings_1, push_display_prop): Set up the bidi
11256 iterator for displaying display or overlay strings.
11257 (forward_to_next_line_start): Don't use the shortcut if
11258 bidi-iterating.
11259 (back_to_previous_visible_line_start): If handle_display_prop
11260 pushed the iterator stack, restore the internal state of the bidi
11261 iterator by calling bidi_pop_it same number of times.
11262 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11263 and we are bidi-iterating, don't decrement the iterator position;
11264 instead, set the first_elt flag in the bidi iterator, to produce
11265 the same effect.
11266 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11267 (push_display_prop): xassert that we are iterating a buffer.
11268 (push_it, pop_it): Save and restore paragraph_embedding member.
11269 (handle_single_display_spec, next_overlay_string)
11270 (get_overlay_strings_1, reseat_1, reseat_to_string)
11271 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11272 correctly. Don't assume unibyte strings are not bidi-reordered.
11273 (compute_display_string_pos)
11274 (compute_display_string_end): Fix handling the case of C string.
11275 (push_it, pop_it): Save and restore from_disp_prop_p.
11276 (handle_single_display_spec, push_display_prop): Set the
11277 from_disp_prop_p flag.
11278 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11279 (pop_it): Call iterate_out_of_display_property only if we are
11280 popping after iteration over a string that came from a display
11281 property. Fix a typo in popping stretch info. Add an assertion
11282 for verifying that the iterator position is in sync with the bidi
11283 iterator.
11284 (handle_single_display_spec, get_overlay_strings_1)
11285 (push_display_prop): Fix initialization of paragraph direction for
11286 string when that of the parent object is not yet determined.
11287 (reseat_1): Call bidi_init_it to resync the bidi
11288 iterator with IT's position. (Bug#7616)
11289 (find_row_edges): If ROW->start.pos gives position
11290 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11291 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11292 Reset the from_disp_prop_p flag.
11293 (SAVE_IT, RESTORE_IT): New macros.
11294 (pos_visible_p, face_before_or_after_it_pos)
11295 (back_to_previous_visible_line_start)
11296 (move_it_in_display_line_to, move_it_in_display_line)
11297 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11298 (try_scrolling, redisplay_window, display_line): Use them when
11299 saving a temporary copy of the iterator and restoring it back.
11300 (back_to_previous_visible_line_start, reseat_1)
11301 (init_iterator): Empty the bidi cache "stack".
11302 (move_it_in_display_line_to): If iterator ended up at
11303 EOL, but we never saw any buffer positions smaller than
11304 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11305 motion in bidi-reordered lines.
11306 (move_it_in_display_line_to): Record prev_method and prev_pos
11307 immediately before the call to set_iterator_to_next. Fixes cursor
11308 motion in bidi-reordered lines with stretch glyphs and strings
11309 displayed in margins. (Bug#8133) (Bug#8867)
11310 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11311 TO_CHARPOS.
11312 (pos_visible_p): Support positions in bidi-reordered lines.
11313 Save and restore bidi cache.
11314
11315 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11316 (bidi_paragraph_info): Delete unused struct.
11317 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11318 (bidi_cache_start): New variable.
11319 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11320 to zero.
11321 (bidi_cache_fetch_state, bidi_cache_search)
11322 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11323 (bidi_cache_find, bidi_peek_at_next_level)
11324 (bidi_level_of_next_char, bidi_find_other_level_edge)
11325 (bidi_move_to_visually_next): Compare cache index with
11326 bidi_cache_start rather than with zero.
11327 (bidi_fetch_char): Accept new argument STRING; all callers
11328 changed. Support iteration over a string. Support strings with
11329 display properties. Support unibyte strings. Fix the type of
11330 `len' according to what STRING_CHAR_AND_LENGTH expects.
11331 (bidi_paragraph_init, bidi_resolve_explicit_1)
11332 (bidi_resolve_explicit, bidi_resolve_weak)
11333 (bidi_level_of_next_char, bidi_move_to_visually_next):
11334 Support iteration over a string.
11335 (bidi_set_sor_type, bidi_resolve_explicit_1)
11336 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11337 can now be zero (for strings); special values 0 and -1 were
11338 changed to -1 and -2, respectively.
11339 (bidi_char_at_pos): New function.
11340 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11341 Call it instead of FETCH_MULTIBYTE_CHAR.
11342 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11343 initialized to valid values.
11344 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11345 values.
11346 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11347 the test for valid cached positions. Fix the logic for looking up
11348 the sentinel state in the cache. GCPRO the Lisp string we are
11349 iterating.
11350 (bidi_push_it, bidi_pop_it): New functions.
11351 (bidi_initialize): Initialize the bidi cache start stack pointer.
11352 (bidi_cache_ensure_space): New function, refactored from part of
11353 bidi_cache_iterator_state. Don't assume the required size is just
11354 one BIDI_CACHE_CHUNK away.
11355 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11356 (bidi_count_bytes, bidi_char_at_pos): New functions.
11357 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11358 always valid if bidi_cache_idx is valid.
11359 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11360 is valid if it's going to be used.
11361 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11362 (bidi_cache_fetch_state, bidi_cache_search)
11363 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11364 (bidi_cache_iterator_state, bidi_cache_find)
11365 (bidi_find_other_level_edge, bidi_cache_start_stack):
11366 All variables related to cache indices are now EMACS_INT.
11367
11368 * dispextern.h (struct bidi_string_data): New structure.
11369 (struct bidi_it): New member `string'. Make flag members be 1-bit
11370 fields, and put them last in the struct.
11371 (compute_display_string_pos, compute_display_string_end):
11372 Update prototypes.
11373 (bidi_push_it, bidi_pop_it): Add prototypes.
11374 (struct iterator_stack_entry): New members bidi_p,
11375 paragraph_embedding, and from_disp_prop_p.
11376 (struct it): Member bidi_p is now a bit field 1 bit wide.
11377 (bidi_shelve_cache, bidi_unshelve_cache):
11378 Declare prototypes.
11379
11380 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11381 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11382 and vector-like objects.
11383
11384 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11385 cache around display iteration.
11386
11387 * window.c (Fwindow_end, window_scroll_pixel_based)
11388 (displayed_window_lines, Frecenter): Save and restore the bidi
11389 cache around display iteration.
11390
11391 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11392
11393 * editfns.c (Fdelete_region): Clarify the use of the named
11394 parameters (bug#6788).
11395
11396 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11397
11398 * indent.c (Fvertical_motion): Set and restore w->pointm when
11399 saving and restoring the window's buffer (Bug#9006).
11400
11401 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11402
11403 * editfns.c (Fstring_to_char): Clarify just what is returned
11404 (bug#6576). Text by Eli Zaretskii.
11405
11406 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11407
11408 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11409
11410 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11411
11412 * buffer.c (mmap_find): Fix a typo.
11413
11414 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11415
11416 Fix execution of x selection hooks.
11417 * xselect.c (Qx_lost_selection_functions)
11418 (Qx_sent_selection_functions): New vars.
11419 (syms_of_xselect): DEFSYM them.
11420 (x_handle_selection_request): Pass Qx_sent_selection_functions
11421 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11422 (x_handle_selection_clear,x_clear_frame_selections):
11423 Pass Qx_lost_selection_functions rather than
11424 Vx_lost_selection_functions to Frun_hook_with_args.
11425
11426 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11427
11428 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11429 The old code sometimes used this field without initializing it.
11430
11431 * alloc.c (gc_sweep): Don't read past end of array.
11432 In theory, the old code could also have corrupted Emacs internals,
11433 though it'd be very unlikely.
11434
11435 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11436
11437 * character.c (Fcharacterp): Don't advertise optional ignored
11438 argument. (Bug#4026)
11439
11440 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11441
11442 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11443 key" (bug#4257).
11444
11445 * window.c (Fset_window_start): Doc fix (bug#4199).
11446 (Fset_window_hscroll): Ditto.
11447
11448 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11449
11450 Fix minor new problems caught by GCC 4.6.1.
11451 * term.c (init_tty): Remove unused local.
11452 * xsettings.c (store_monospaced_changed): Define this function only
11453 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11454 not used otherwise.
11455
11456 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11457
11458 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11459
11460 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11461
11462 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11463 are the mini-buffer and the echo area (bug#3320).
11464
11465 * term.c (init_tty): Remove support for supdup, c10 and perq
11466 terminals, which are no longer supported (bug#1482).
11467
11468 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11469
11470 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11471
11472 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11473
11474 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11475 for non-popups (Bug#3642).
11476
11477 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11478
11479 * alloc.c (reset_malloc_hooks): Protoize.
11480 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11481 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11482 * cm.c (losecursor): Likewise.
11483 * data.c (fmod): Likewise.
11484 * dispnew.c (swap_glyphs_in_rows): Likewise.
11485 * emacs.c (memory_warning_signal): Likewise.
11486 * floatfns.c (float_error): Likewise.
11487 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11488 (otf_open, font_otf_capability, generate_otf_features)
11489 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11490 Likewise.
11491 * image.c (pbm_read_file): Likewise.
11492 * indent.c (string_display_width): Likewise.
11493 * intervals.c (check_for_interval, search_for_interval)
11494 (inc_interval_count, count_intervals, root_interval)
11495 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11496 * lread.c (defalias): Likewise.
11497 * ralloc.c (r_alloc_check): Likewise.
11498 * regex.c (set_image_of_range_1, set_image_of_range)
11499 (regex_grow_registers): Likewise.
11500 * sysdep.c (strerror): Likewise.
11501 * termcap.c (valid_filename_p, tprint, main): Likewise.
11502 * tparam.c (main): Likewise.
11503 * unexhp9k800.c (run_time_remap, save_data_space)
11504 (update_file_ptrs, read_header, write_header, calculate_checksum)
11505 (copy_file, copy_rest, display_header): Likewise.
11506 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11507 Likewise.
11508 * xdisp.c (check_it): Likewise.
11509 * xfaces.c (register_color, unregister_color, unregister_colors):
11510 Likewise.
11511 * xfns.c (print_fontset_result): Likewise.
11512 * xrdb.c (member, fatal, main): Likewise.
11513
11514 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11515
11516 Fix minor problems found by static checking (Bug#9031).
11517 * chartab.c (char_table_set_range, map_sub_char_table):
11518 Remove unused locals.
11519 (uniprop_table): Now static.
11520 * composite.c (_work_char): Remove unused static var.
11521
11522 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11523
11524 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11525
11526 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11527
11528 * gtkutil.c (qttip_cb): Remove code without function.
11529
11530 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11531
11532 * w32.c (pthread_sigmask): New stub.
11533
11534 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11535
11536 Use pthread_sigmask, not sigprocmask (Bug#9010).
11537 sigprocmask is portable only for single-threaded applications, and
11538 Emacs can be multi-threaded when it uses GTK.
11539 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11540 (LIBES): Use it.
11541 * callproc.c (Fcall_process):
11542 * process.c (create_process):
11543 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11544 Use pthread_sigmask, not sigprocmask.
11545
11546 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11547
11548 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11549 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11550 wrong (Bug#8591).
11551
11552 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11553
11554 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11555 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11556 (xg_hide_tooltip): Fix comment.
11557
11558 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11559 in registerServicesMenuSendTypes.
11560 (validRequestorForSendType): Don't check ns_return_types.
11561
11562 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11563 ns_return_type.
11564
11565 2011-07-08 Jason Rumney <jasonr@gnu.org>
11566
11567 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11568 SH_SHOW for hidden windows (Bug#5482).
11569
11570 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11571 frame struct members of non-existent frames (Bug#6284).
11572
11573 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11574
11575 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11576 variable firstTime not needed on OSX >= 10.6.
11577 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11578 >= 10.5. Use setKnobProportion, setDoubleValue.
11579
11580 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11581 (MAC_OS_X_VERSION_10_5): Define if not defined.
11582 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11583 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11584 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11585
11586 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11587 cString and lossyCString on OSX >= 10.4.
11588
11589 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11590 sizeToFit on OSX >= 10.2.
11591
11592 * nsimage.m (allocInitFromFile): Don't use deprecated method
11593 bestRepresentationForDevice on OSX >= 10.6.
11594
11595 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11596 to avoid warning.
11597
11598 * emacs.c: Declare unexec_init_emacs_zone.
11599
11600 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11601
11602 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11603
11604 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11605 on svcsMenu (Bug#8842).
11606
11607 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11608 ns_return_types.
11609 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11610
11611 * nsterm.m (QUTF8_STRING): Declare.
11612 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11613 (validRequestorForSendType): Return type is (id).
11614 Change indexOfObjectIdenticalTo to indexOfObject.
11615 Check if we have local selection before returning self (Bug#8842).
11616 (writeSelectionToPasteboard): Put local selection into paste board
11617 if we have a local selection (Bug#8842).
11618 (syms_of_nsterm): DEFSYM QUTF8_STRING.
11619
11620 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11621 (ns_get_local_selection): Declare.
11622
11623 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11624
11625 * keymap.c (describe_map_tree): Don't insert a double newline at
11626 the end of the buffer (bug#1169) and return whether we inserted
11627 something.
11628
11629 * callint.c (Fcall_interactively): Change "reading args" to
11630 "providing args" to try to clarify what it does (bug#1010).
11631
11632 2011-07-07 Kenichi Handa <handa@m17n.org>
11633
11634 * composite.c (composition_compute_stop_pos): Ignore a static
11635 composition starting before CHARPOS (Bug#8915).
11636
11637 * xdisp.c (handle_composition_prop): Likewise.
11638
11639 2011-07-07 Eli Zaretskii <eliz@gnu.org>
11640
11641 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11642 (Bug#9015)
11643
11644 2011-07-07 Kenichi Handa <handa@m17n.org>
11645
11646 * character.h (unicode_category_t): New enum type.
11647
11648 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11649 (Qchar_code_property_table): New variable.
11650 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11651 (UNIPROP_COMPRESSED_FORM_P): New macros.
11652 (char_table_ascii): Uncompress the compressed values.
11653 (sub_char_table_ref): New arg is_uniprop. Callers changed.
11654 Uncompress the compressed values.
11655 (sub_char_table_ref_and_range): Likewise.
11656 (char_table_ref_and_range): Uncompress the compressed values.
11657 (sub_char_table_set): New arg is_uniprop. Callers changed.
11658 Uncompress the compressed values.
11659 (sub_char_table_set_range): Args changed. Callers changed.
11660 (char_table_set_range): Adjuted for the above change.
11661 (map_sub_char_table): Delete args default_val and parent. Add arg
11662 top. Give decoded values to a Lisp function.
11663 (map_char_table): Adjust for the above change. Give decoded
11664 values to a Lisp function. Gcpro more variables.
11665 (uniprop_table_uncompress)
11666 (uniprop_decode_value_run_length): New functions.
11667 (uniprop_decoder, uniprop_decoder_count): New variables.
11668 (uniprop_get_decoder, uniprop_encode_value_character)
11669 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11670 New functions.
11671 (uniprop_encoder, uniprop_encoder_count): New variables.
11672 (uniprop_get_encoder, uniprop_table)
11673 (Funicode_property_table_internal, Fget_unicode_property_internal)
11674 (Fput_unicode_property_internal): New functions.
11675 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11676 Sunicode_property_table_internal, Sget_unicode_property_internal,
11677 and Sput_unicode_property_internal. Defvar_lisp
11678 char-code-property-alist.
11679
11680 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
11681 Vunicode_category_table.
11682
11683 * font.c (font_range): Adjust for the change of
11684 Vunicode_category_table.
11685
11686 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11687
11688 * m/iris4d.h: Remove file, move contents ...
11689 * s/irix6-5.h: ... here.
11690
11691 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11692
11693 Remove unportable assumption about struct layout (Bug#8884).
11694 * alloc.c (mark_buffer):
11695 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11696 (clone_per_buffer_values): Don't assume that
11697 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11698 This isn't true in general, and it's particularly not true
11699 if Emacs is configured with --with-wide-int.
11700 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11701 New macros, used in the buffer.c change.
11702
11703 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11704
11705 * xsettings.c: Use both GConf and GSettings if both are available.
11706 (store_config_changed_event): Add comment.
11707 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11708 (store_tool_bar_style_changed): New functions.
11709 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
11710 (struct xsettings): Move font inside HAVE_XFT.
11711 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
11712 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
11713 Move inside HAVE_XFT.
11714 (something_changed_gsettingsCB): Rename from something_changedCB.
11715 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11716 also.
11717 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
11718 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
11719 (something_changed_gconfCB): Rename from something_changedCB.
11720 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11721 (parse_settings): Move check for font inside HAVE_XFT.
11722 (read_settings, apply_xft_settings): Add comment.
11723 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
11724 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
11725 call store_font_name_changed.
11726 (xft_settings_event): Add comment.
11727 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
11728 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
11729 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
11730 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
11731 (xsettings_initialize): Call init_gsettings last.
11732 (xsettings_get_system_font, xsettings_get_system_normal_font):
11733 Add comment.
11734
11735 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
11736
11737 Random fixes. E.g., (random) never returned negative values.
11738 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
11739 subseconds part to the entropy, as that's a bit more random.
11740 Prefer signed to unsigned, since the signedness doesn't matter and
11741 in general we prefer signed. When given a limit, use a
11742 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11743 latter isn't right if USE_2_TAGS_FOR_INTS.
11744 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11745 not 0..VALMASK. Don't discard "excess" bits that random () returns.
11746
11747 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11748
11749 * textprop.c (text_property_stickiness):
11750 Obey Vtext_property_default_nonsticky.
11751 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11752 * w32fns.c (syms_of_w32fns):
11753 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11754
11755 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11756
11757 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11758 This is more efficient than Ffile_directory_p and avoids a minor race.
11759
11760 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11761
11762 * buffer.c (Foverlay_put): Say what the return value is
11763 (bug#7835).
11764
11765 * fileio.c (barf_or_query_if_file_exists): Check first if the file
11766 is a directory before asking whether to use the file name
11767 (bug#7564).
11768 (barf_or_query_if_file_exists): Make the "File is a directory"
11769 error be more correct.
11770
11771 * fns.c (Frequire): Remove the mention of the .gz files, since
11772 that's installation-specific, but keep the mention of
11773 `get-load-suffixes'.
11774
11775 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11776
11777 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11778 Report string overflow if the output is too long.
11779
11780 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
11781
11782 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11783 (syms_of_gnutls): Remove duplicate DEFSYM for
11784 Qgnutls_bootprop_verify_hostname_error, an error for
11785 Qgnutls_bootprop_verify_error (which is no longer used).
11786
11787 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11788 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
11789 Also (re)move comments that are misplaced or no longer relevant.
11790
11791 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11792
11793 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11794
11795 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
11796
11797 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11798 and background color parameters if they have been changed.
11799
11800 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11801
11802 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11803
11804 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11805
11806 * xsettings.c (SYSTEM_FONT): Define only when used.
11807 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11808
11809 * keymap.c (access_keymap_1): Now static.
11810
11811 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
11812
11813 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11814 leave any prefix arg for the up event (Bug#1586).
11815
11816 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11817
11818 * lread.c (syms_of_lread): Mention single symbols defined by
11819 `defvar' or `defconst' (bug#7154).
11820
11821 * fns.c (Frequire): Mention .el.gz files (bug#7314).
11822 (Frequire): Mention get-load-suffixes.
11823
11824 2011-07-02 Martin Rudalics <rudalics@gmx.at>
11825
11826 * window.h (window): Remove clone_number slot.
11827 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11828 Remove.
11829 (make_parent_window, make_window, saved_window)
11830 (Fset_window_configuration, save_window_save): Don't deal with
11831 clone numbers.
11832 * buffer.c (Qclone_number): Remove declaration.
11833 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11834
11835 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11836
11837 Add multiple inheritance to keymaps.
11838 * keymap.c (Fmake_composed_keymap): New function.
11839 (Fset_keymap_parent): Simplify.
11840 (fix_submap_inheritance): Remove.
11841 (access_keymap_1): New function extracted from access_keymap to handle
11842 embedded parents and handle lists of maps.
11843 (access_keymap): Use it.
11844 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11845 (Fcopy_keymap): Handle embedded parents.
11846 (Fcommand_remapping, define_as_prefix): Simplify.
11847 (Fkey_binding): Simplify.
11848 (syms_of_keymap): Move minibuffer-local-completion-map,
11849 minibuffer-local-filename-completion-map,
11850 minibuffer-local-must-match-map, and
11851 minibuffer-local-filename-must-match-map to Elisp.
11852 (syms_of_keymap): Defsubr make-composed-keymap.
11853 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11854 (parse_menu_item): Trivial simplification.
11855
11856 2011-07-01 Glenn Morris <rgm@gnu.org>
11857
11858 * Makefile.in (SETTINGS_LIBS): Fix typo.
11859
11860 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11861
11862 * coding.c (Fencode_coding_string): Record the last coding system
11863 used, as the function doc string says (bug#8738).
11864
11865 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11866
11867 * xsettings.c (store_monospaced_changed): Take new font as arg and
11868 check for change against current_mono_font.
11869 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11870 (emacs_settings_constructor, emacs_settings_get_property)
11871 (emacs_settings_set_property, emacs_settings_class_init)
11872 (emacs_settings_init, gsettings_obj): Remove.
11873 (something_changedCB): New function for HAVE_GSETTINGS.
11874 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11875 with value as argument.
11876 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11877 g_settings_new (Bug#8967). Do not create gsettings_obj.
11878 Remove calls to g_settings_bind. Connect something_changedCB to
11879 "changed".
11880
11881 * xgselect.c: Add defined (HAVE_GSETTINGS).
11882 (xgselect_initialize): Ditto.
11883
11884 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11885 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11886 xg_select.
11887
11888 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11889
11890 * eval.c (struct backtrace): Simplify and port the data structure.
11891 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11892 signed bit field, as this assumption is not portable and it makes
11893 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11894 "char debug_on_exit : 1" as this is not portable either; instead,
11895 use the portable "unsigned int debug_on_exit : 1". Remove unused
11896 member evalargs. Remove obsolete comments about cc bombing out.
11897
11898 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11899
11900 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
11901 Let HAVE_GSETTINGS override HAVE_GCONF.
11902 (store_monospaced_changed): New function.
11903 (EMACS_SETTINGS): A new type derived from GObject to handle
11904 GSettings notifications.
11905 (emacs_settings_constructor, emacs_settings_get_property)
11906 (emacs_settings_set_property, emacs_settings_class_init):
11907 New functions.
11908 (gsettings_client, gsettings_obj): New variables.
11909 (GSETTINGS_SCHEMA): New define.
11910 (something_changedCB): Call store_monospaced_changed.
11911 (init_gsettings): New function.
11912 (xsettings_initialize): Call init_gsettings.
11913 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11914 to NULL.
11915
11916 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
11917 GCONF_CFLAGS/LIBS.
11918
11919 2011-06-29 Martin Rudalics <rudalics@gmx.at>
11920
11921 * window.c (resize_root_window, grow_mini_window)
11922 (shrink_mini_window): Rename Qresize_root_window to
11923 Qwindow_resize_root_window and Qresize_root_window_vertically to
11924 Qwindow_resize_root_window_vertically.
11925
11926 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11927
11928 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11929
11930 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
11931
11932 * makefile.w32-in: Redesign dependencies so they reflect more
11933 clearly which files are directly included by each source file,
11934 and not through other includes.
11935
11936 2011-06-27 Martin Rudalics <rudalics@gmx.at>
11937
11938 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11939 (sort_overlays, overlay_strings): When an overlay's clone number
11940 matches the window's clone number process the overlay even if
11941 the overlay's window property doesn't match the current window.
11942
11943 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11944 (Fwindow_hchild): Rename to Fwindow_left_child.
11945 (Fwindow_next): Rename to Fwindow_next_sibling.
11946 (Fwindow_prev): Rename to Fwindow_prev_sibling.
11947 (resize_window_check): Rename to window_resize_check.
11948 (resize_window_apply): Rename to window_resize_apply.
11949 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11950 (Fdelete_other_windows_internal, resize_frame_windows)
11951 (Fsplit_window_internal, Fdelete_window_internal)
11952 (grow_mini_window, shrink_mini_window)
11953 (Fresize_mini_window_internal): Fix callers accordingly.
11954
11955 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11956
11957 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11958 (emacs_fixed_set_min_size): Remove.
11959 (emacs_fixed_new): Take frame as argument.
11960
11961 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11962 (_EmacsFixedPrivate): Remove minwidth/height.
11963 Add struct frame *f.
11964 (emacs_fixed_init): Initialize priv->f.
11965 (get_parent_class, emacs_fixed_set_min_size): Remove.
11966 (emacs_fixed_new): Set priv->f to argument.
11967 (emacs_fixed_get_preferred_width)
11968 (emacs_fixed_get_preferred_height): Use min_width/height from
11969 frames size_hint to set minimum and natural (Bug#8919).
11970 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11971 and use min_width/height from frames size_hint to set
11972 min_width/height (Bug#8919).
11973
11974 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
11975 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11976 Fix indentation.
11977
11978 2011-06-26 Eli Zaretskii <eliz@gnu.org>
11979
11980 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11981 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11982 called at ZV.
11983
11984 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
11985
11986 * process.c (wait_reading_process_output): Bypass select if
11987 waiting for a cell while ignoring keyboard input, and input is
11988 pending. Suggested by Jan Djärv (Bug#8869).
11989
11990 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11991
11992 Use gnulib's dup2 module instead of rolling our own.
11993 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11994
11995 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11996
11997 * dispnew.c (scrolling_window): Before scrolling, turn off a
11998 mouse-highlight in the window being scrolled.
11999
12000 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12001
12002 Move DEFSYM to lisp.h and use everywhere.
12003
12004 * character.h (DEFSYM): Move declaration...
12005 * lisp.h (DEFSYM): ...here.
12006
12007 * gnutls.c:
12008 * minibuf.c:
12009 * w32menu.c:
12010 * w32proc.c:
12011 * w32select.c: Don't include character.h.
12012
12013 * alloc.c (syms_of_alloc):
12014 * buffer.c (syms_of_buffer):
12015 * bytecode.c (syms_of_bytecode):
12016 * callint.c (syms_of_callint):
12017 * casefiddle.c (syms_of_casefiddle):
12018 * casetab.c (init_casetab_once):
12019 * category.c (init_category_once, syms_of_category):
12020 * ccl.c (syms_of_ccl):
12021 * cmds.c (syms_of_cmds):
12022 * composite.c (syms_of_composite):
12023 * dbusbind.c (syms_of_dbusbind):
12024 * dired.c (syms_of_dired):
12025 * dispnew.c (syms_of_display):
12026 * doc.c (syms_of_doc):
12027 * editfns.c (syms_of_editfns):
12028 * emacs.c (syms_of_emacs):
12029 * eval.c (syms_of_eval):
12030 * fileio.c (syms_of_fileio):
12031 * fns.c (syms_of_fns):
12032 * frame.c (syms_of_frame):
12033 * fringe.c (syms_of_fringe):
12034 * insdel.c (syms_of_insdel):
12035 * keymap.c (syms_of_keymap):
12036 * lread.c (init_obarray, syms_of_lread):
12037 * macros.c (syms_of_macros):
12038 * msdos.c (syms_of_msdos):
12039 * print.c (syms_of_print):
12040 * process.c (syms_of_process):
12041 * search.c (syms_of_search):
12042 * sound.c (syms_of_sound):
12043 * syntax.c (init_syntax_once, syms_of_syntax):
12044 * terminal.c (syms_of_terminal):
12045 * textprop.c (syms_of_textprop):
12046 * undo.c (syms_of_undo):
12047 * w32.c (globals_of_w32):
12048 * window.c (syms_of_window):
12049 * xdisp.c (syms_of_xdisp):
12050 * xfaces.c (syms_of_xfaces):
12051 * xfns.c (syms_of_xfns):
12052 * xmenu.c (syms_of_xmenu):
12053 * xsettings.c (syms_of_xsettings):
12054 * xterm.c (syms_of_xterm): Use DEFSYM.
12055
12056 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12057
12058 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12059
12060 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12061
12062 Integer and buffer overflow fixes (Bug#8873).
12063
12064 * print.c (printchar, strout): Check for string overflow.
12065 (PRINTPREPARE, printchar, strout):
12066 Don't set size unless allocation succeeds.
12067
12068 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12069 for sizes. Check for string overflow more accurately.
12070 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12071
12072 * macros.c: Integer and buffer overflow fixes.
12073 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12074 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12075 Use ptrdiff_t, not int, for sizes.
12076 Don't increment bufsize until after realloc succeeds.
12077 Check for size-calculation overflow.
12078 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12079
12080 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12081
12082 * lread.c: Integer overflow fixes.
12083 (read_integer): Radix is now EMACS_INT, not int,
12084 to improve quality of diagnostics for out-of-range radices.
12085 Calculate buffer size correctly for out-of-range radices.
12086 (read1): Check for integer overflow in radices, and in
12087 read-circle numbers.
12088 (read_escape): Avoid int overflow.
12089 (Fload, openp, read_buffer_size, read1)
12090 (substitute_object_recurse, read_vector, read_list, map_obarray):
12091 Use ptrdiff_t, not int, for sizes.
12092 (read1): Use EMACS_INT, not int, for sizes.
12093 Check for size overflow.
12094
12095 * image.c (cache_image): Check for size arithmetic overflow.
12096
12097 * lread.c: Integer overflow issues.
12098 (saved_doc_string_size, saved_doc_string_length)
12099 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12100 Now ptrdiff_t, not int.
12101 (read1): Don't assume doc string length fits in int. Check for
12102 out-of-range doc string lengths.
12103 (read_list): Don't assume file position fits in int.
12104 (read_escape): Check for hex character overflow.
12105
12106 2011-06-22 Leo Liu <sdl.web@gmail.com>
12107
12108 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12109 Move to minibuffer.el.
12110
12111 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12112
12113 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12114 The following patches are for when GLYPH_DEBUG && !XASSERT.
12115 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12116 * dispnew.c (flush_stdout):
12117 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12118 Mark as externally visible.
12119 * dispnew.c (check_window_matrix_pointers): Now static.
12120 * dispnew.c (window_to_frame_vpos):
12121 * xfns.c (unwind_create_frame):
12122 * xterm.c (x_check_font): Remove unused local.
12123 * scroll.c (CHECK_BOUNDS):
12124 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12125 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12126 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12127 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12128 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12129 Now static.
12130 (debug_method_add): Use va_list and vsprintf rather than relying
12131 on undefined behavior with wrong number of arguments.
12132 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12133 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12134 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12135 since we're not interested in debugging glyphs with old libraries.
12136 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12137 GCC 4.6.0's static checking.
12138
12139 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12140
12141 Integer overflow and signedness fixes (Bug#8873).
12142 A few related buffer overrun fixes, too.
12143
12144 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12145
12146 * dispextern.h (struct face.stipple):
12147 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12148 (x_bitmap_mask, x_allocate_bitmap_record)
12149 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12150 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12151 (x_create_bitmap_from_xpm_data):
12152 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12153 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12154 (.bitmaps_last):
12155 * xfaces.c (load_pixmap):
12156 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12157 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12158 (.bitmaps_last, struct x_output.icon_bitmap):
12159 Use ptrdiff_t, not int, for bitmap indexes.
12160 (x_allocate_bitmap_record): Check for size overflow.
12161 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12162
12163 Use ptrdiff_t, not int, for overlay counts.
12164 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12165 * editfns.c (overlays_around, get_pos_property):
12166 * textprop.c (get_char_property_and_overlay):
12167 * xdisp.c (next_overlay_change, note_mouse_highlight):
12168 * xfaces.c (face_at_buffer_position):
12169 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12170 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12171 (Fnext_overlay_change, Fprevious_overlay_change)
12172 (mouse_face_overlay_overlaps, Foverlays_in):
12173 Use ptrdiff_t, not int, for sizes.
12174 (overlays_at, overlays_in): Check for size-calculation overflow.
12175
12176 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12177
12178 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12179 (x_session_initialize): Do not assume string length fits in int.
12180
12181 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12182 This is unlikely, but can occur if DPI is outlandish.
12183
12184 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12185 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12186
12187 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12188 * xrdb.c (magic_file_p, search_magic_path):
12189 Omit last arg SUFFIX; it was always 0. All callers changed.
12190 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12191
12192 * xfont.c (xfont_match): Avoid need for strlen.
12193
12194 * xfns.c: Don't assume strlen fits in int.
12195 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12196
12197 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12198 not unsigned long, as we prefer signed integers. All callers changed.
12199 Detect integer overflow in repeat count.
12200 (message_dolog): Don't assume print length fits in 39 bytes.
12201 (display_mode_element): Don't assume strlen fits in int.
12202
12203 * termcap.c: Don't assume sizes fit in int and never overflow.
12204 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12205 (gobble_line): Check for size-calculation overflow.
12206
12207 * minibuf.c (Fread_buffer):
12208 * lread.c (intern, intern_c_string):
12209 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12210 Don't assume string length fits in int.
12211
12212 * keyboard.c (parse_tool_bar_item):
12213 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12214
12215 * font.c: Don't assume string length fits in int.
12216 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12217 Use ptrdiff_t, not int.
12218 (font_intern_prop): Don't assume string length fits in int.
12219 Don't assume integer property fits in fixnum.
12220 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12221
12222 * filelock.c: Fix some buffer overrun and integer overflow issues.
12223 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12224 Reformulate so as not to need the command string.
12225 Invoke gzip -cd rather than gunzip, as it's more portable.
12226 (lock_info_type, lock_file_1, lock_file):
12227 Don't assume pid_t and time_t fit in unsigned long.
12228 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12229 (current_lock_owner): Prefer signed type for sizes.
12230 Use memcpy, not strncpy, where memcpy is what is really wanted.
12231 Don't assume (via atoi) that time_t and pid_t fit in int.
12232 Check for time_t and/or pid_t out of range, e.g., via a network share.
12233 Don't alloca where an auto var works fine.
12234
12235 * fileio.c: Fix some integer overflow issues.
12236 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12237 Don't assume string length fits in int.
12238 (directory_file_name): Don't assume string length fits in long.
12239 (make_temp_name): Don't assume pid fits in int, or that its print
12240 length is less than 20.
12241
12242 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12243
12244 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12245
12246 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12247
12248 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12249 We prefer signed integers, even for size calculations.
12250
12251 * emacs.c: Don't assume string length fits in 'int'.
12252 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12253 (main): Don't invoke strlen when not needed.
12254
12255 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12256 (XD_DEBUG_MESSAGE): Don't waste a byte.
12257
12258 * callproc.c (getenv_internal_1, getenv_internal)
12259 (Fgetenv_internal):
12260 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12261
12262 * lread.c (invalid_syntax): Omit length argument.
12263 All uses changed. This doesn't fix a bug, but it simplifies the
12264 code away from its former Hollerith-constant appearance, and it's
12265 one less 'int' to worry about when looking at integer-overflow issues.
12266 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12267
12268 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12269 This didn't break anything, but it didn't help either.
12270 It's confusing to put a bogus integer in a place where the actual
12271 value does not matter.
12272 (LIST_END_P): Remove unused macro and its bogus comment.
12273 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12274
12275 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12276 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12277 implementation.
12278 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12279 We prefer signed types, and the value cannot exceed the EMACS_INT
12280 range anyway (because otherwise the length would not be representable).
12281 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12282 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12283 This avoids a GCC warning when WIDE_EMACS_INT.
12284
12285 * indent.c (sane_tab_width): New function.
12286 (current_column, scan_for_column, Findent_to, position_indentation)
12287 (compute_motion): Use it. This is just for clarity.
12288 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12289
12290 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12291
12292 * lisp.h (lint_assume): New macro.
12293 * composite.c (composition_gstring_put_cache):
12294 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12295
12296 * editfns.c, insdel.c:
12297 Omit unnecessary forward decls, to simplify future changes.
12298
12299 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12300
12301 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12302
12303 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12304 Use much-faster test for byte-length change.
12305 Don't assume string byte-length fits in 'int'.
12306 Check that character arg fits in 'int'.
12307 (mapcar1): Declare byte as byte, for clarity.
12308
12309 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12310
12311 * fns.c (concat): Catch string overflow earlier.
12312 Do not rely on integer wraparound.
12313
12314 * dispextern.h (struct it.overlay_strings_charpos)
12315 (struct it.selective): Now EMACS_INT, not int.
12316 * xdisp.c (forward_to_next_line_start)
12317 (back_to_previous_visible_line_start)
12318 (reseat_at_next_visible_line_start, next_element_from_buffer):
12319 Don't arbitrarily truncate the value of 'selective' to int.
12320
12321 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12322
12323 * composite.c: Don't truncate sizes to 'int'.
12324 (composition_gstring_p, composition_reseat_it)
12325 (composition_adjust_point): Use EMACS_INT, not int.
12326 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12327 not EMACS_UINT, for indexes.
12328
12329 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12330
12331 * buffer.c: Include <verify.h>.
12332 (struct sortvec.priority, struct sortstr.priority):
12333 Now EMACS_INT, not int.
12334 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12335 (struct sortstr.size, record_overlay_string)
12336 (struct sortstrlist.size, struct sortlist.used):
12337 Don't truncate size to int.
12338 (record_overlay_string): Check for size-calculation overflow.
12339 (init_buffer_once): Check at compile-time, not run-time.
12340
12341 2011-06-22 Jim Meyering <meyering@redhat.com>
12342
12343 Don't leak an XBM-image-sized buffer
12344 * image.c (xbm_load): Free the image buffer after using it.
12345
12346 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12347
12348 Port to Sun C.
12349 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12350 that Sun C diagnosed.
12351 * fns.c (secure_hash): Fix pointer signedness issue.
12352 * intervals.c (static_offset_intervals): New function.
12353 (offset_intervals): Use it.
12354
12355 2011-06-21 Leo Liu <sdl.web@gmail.com>
12356
12357 * deps.mk (fns.o):
12358 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12359 sha512.h.
12360
12361 * fns.c (secure_hash): Rename from crypto_hash_function and change
12362 the first arg to accept symbols.
12363 (Fsecure_hash): New primitive.
12364 (syms_of_fns): New symbols.
12365
12366 2011-06-20 Deniz Dogan <deniz@dogan.se>
12367
12368 * process.c (Fset_process_buffer): Clarify return value in
12369 docstring.
12370
12371 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12372
12373 * dispnew.c (add_window_display_history): Use BVAR.
12374
12375 * xdisp.c (debug_method_add): Use BVAR.
12376 (check_window_end, dump_glyph_matrix, dump_glyph)
12377 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12378
12379 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12380 Likewise.
12381
12382 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12383 check till after the cache is created in init_frame_faces.
12384
12385 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12386
12387 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12388
12389 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12390
12391 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12392 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12393 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12394
12395 Improve buffer-overflow checking (Bug#8873).
12396 * fileio.c (Finsert_file_contents):
12397 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12398 Remove the old (too-loose) buffer overflow checks.
12399 They weren't needed, since make_gap checks for buffer overflow.
12400 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12401 The old code merely checked for Emacs fixnum overflow, and relied
12402 on undefined (wraparound) behavior. The new code avoids undefined
12403 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12404
12405 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12406 Tune. Don't use wider integers than needed. Don't use alloca.
12407 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12408
12409 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12410
12411 * insdel.c, lisp.h (buffer_overflow): New function.
12412 (insert_from_buffer_1, replace_range, replace_range_2):
12413 * insdel.c (make_gap_larger):
12414 * editfns.c (Finsert_char):
12415 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12416
12417 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12418
12419 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12420
12421 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12422
12423 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12424 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12425
12426 * fileio.c: Don't assume EMACS_INT fits in off_t.
12427 (emacs_lseek): New static function.
12428 (Finsert_file_contents, Fwrite_region): Use it.
12429 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12430
12431 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12432
12433 * fns.c: Don't overflow int when computing a list length.
12434 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12435 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12436 truncation on 64-bit hosts. Check for QUIT every
12437 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12438 faster and is responsive enough.
12439 (Flength): Report an error instead of overflowing an integer.
12440 (Fsafe_length): Return a float if the value is not representable
12441 as a fixnum. This shouldn't happen except in contrived situations.
12442 (Fnthcdr, Fsort): Don't assume list length fits in int.
12443 (Fcopy_sequence): Don't assume vector length fits in int.
12444
12445 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12446 (header_size, word_size): New constants.
12447 (allocate_vectorlike): Don't check size overflow here.
12448 (allocate_vector): Check it here instead, since this is the only
12449 caller of allocate_vectorlike that could cause overflow.
12450 Check that the new vector's length is representable as a fixnum.
12451
12452 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12453 The previous code was bogus. For example, next_almost_prime (32)
12454 returned 39, which is undesirable as it is a multiple of 3; and
12455 next_almost_prime (24) returned 25, which is a multiple of 5 so
12456 why was the code bothering to check for multiples of 7?
12457
12458 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12459
12460 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12461
12462 Variadic C functions now count arguments with ptrdiff_t.
12463 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12464 Back then I didn't know that the Emacs coding style prefers signed int.
12465 Also, in the meantime I found a few more instances where arguments
12466 were being counted with int, which may truncate counts on 64-bit
12467 machines, or EMACS_INT, which may be unnecessarily wide.
12468 * lisp.h (struct Lisp_Subr.function.aMANY)
12469 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12470 Arg counts are now ptrdiff_t, not size_t.
12471 All variadic functions and their callers changed accordingly.
12472 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12473 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12474 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12475 * callint.c (Fcall_interactively): Check arg count for overflow,
12476 to avoid potential buffer overrun. Use signed char, not 'int',
12477 for 'varies' array, so that we needn't bother to check its size
12478 calculation for overflow.
12479 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12480 * eval.c (apply_lambda):
12481 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12482 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12483 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12484
12485 * callint.c (Fcall_interactively): Don't use index var as event count.
12486
12487 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12488 * mem-limits.h (SIZE): Remove; no longer used.
12489
12490 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12491
12492 Remove unnecessary casts.
12493 * xterm.c (x_term_init):
12494 * xfns.c (x_set_border_pixel):
12495 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12496 These aren't needed now that we assume ANSI C.
12497
12498 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12499 It's more likely to cause problems (due to unsigned overflow)
12500 than to cure them.
12501
12502 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12503
12504 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12505
12506 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12507
12508 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12509
12510 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12511
12512 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12513
12514 GLYPH_CODE_FACE returns EMACS_INT, not int.
12515 * dispextern.h (merge_faces):
12516 * xfaces.c (merge_faces):
12517 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12518 Don't assume EMACS_INT fits in int.
12519
12520 * character.h (CHAR_VALID_P): Remove unused parameter.
12521 * fontset.c, lisp.h, xdisp.c: All uses changed.
12522
12523 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12524
12525 * fns.c (concat): Minor tuning based on overflow analysis.
12526 This doesn't fix any bugs. Use int to hold character, instead
12527 of constantly refetching from Emacs object. Use XFASTINT, not
12528 XINT, for value known to be a character. Don't bother comparing
12529 a single byte to 0400, as it's always less.
12530
12531 * floatfns.c (Fexpt):
12532 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12533
12534 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12535 for characters.
12536
12537 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12538
12539 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12540 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12541 incorrectly succeed when S was a string, because 4294967386 was
12542 truncated before it was used.
12543
12544 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12545 Otherwise, an out-of-range integer could cause undefined behavior
12546 on a 64-bit host.
12547
12548 * composite.c: Use int, not EMACS_INT, for characters.
12549 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12550 EMACS_INT, for values that are known to be in character range.
12551 This doesn't fix any bugs but is the usual style inside Emacs and
12552 may generate better code on 32-bit machines.
12553
12554 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12555 This is for reasons similar to the recent CHAR_STRING fix.
12556 * charset.c (Fencode_char): Check that character arg is actually
12557 a character. Pass an int to ENCODE_CHAR.
12558 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12559 wider than 'int', as a compile-time check to prevent future regressions
12560 in this area.
12561
12562 * character.c (char_string): Remove unnecessary casts.
12563
12564 Make sure a 64-bit char is never passed to CHAR_STRING.
12565 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12566 by silently ignoring the top 32 bits, allowing some values
12567 that were far too large to be valid characters.
12568 * character.h: Include <verify.h>.
12569 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12570 arguments are no wider than unsigned, as a compile-time check
12571 to prevent future regressions in this area.
12572 * data.c (Faset):
12573 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12574 (Fsubst_char_in_region):
12575 * fns.c (concat):
12576 * xdisp.c (decode_mode_spec_coding):
12577 Adjust to CHAR_STRING's new requirement.
12578 * editfns.c (Finsert_char, Fsubst_char_in_region):
12579 * fns.c (concat): Check that character args are actually
12580 characters. Without this test, these functions did the wrong
12581 thing with wildly out-of-range values on 64-bit hosts.
12582
12583 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12584 These casts should not be needed on 32-bit hosts, either.
12585 * keyboard.c (read_char):
12586 * lread.c (Fload): Remove casts to unsigned.
12587
12588 * lisp.h (UNSIGNED_CMP): New macro.
12589 This fixes comparison bugs on 64-bit hosts.
12590 (ASCII_CHAR_P): Use it.
12591 * casefiddle.c (casify_object):
12592 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
12593 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12594 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12595 * dispextern.h (FACE_FROM_ID):
12596 * keyboard.c (read_char): Use UNSIGNED_CMP.
12597
12598 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12599 not to EMACS_INT, to avoid GCC warning.
12600
12601 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12602
12603 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12604 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12605 isn't needed on 32-bit machines.
12606
12607 * buffer.c (Fgenerate_new_buffer_name):
12608 Use EMACS_INT for count, not int.
12609 (advance_to_char_boundary): Return EMACS_INT, not int.
12610
12611 * data.c (Qcompiled_function): Now static.
12612
12613 * window.c (window_body_lines): Now static.
12614
12615 * image.c (gif_load): Rename local to avoid shadowing.
12616
12617 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12618 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12619 * alloc.c (make_save_value): Integer argument is now of type
12620 ptrdiff_t, not int.
12621 (mark_object): Use ptrdiff_t, not int.
12622 * lisp.h (pD): New macro.
12623 * print.c (print_object): Use it.
12624
12625 * alloc.c: Use EMACS_INT, not int, to count objects.
12626 (total_conses, total_markers, total_symbols, total_vector_size)
12627 (total_free_conses, total_free_markers, total_free_symbols)
12628 (total_free_floats, total_floats, total_free_intervals)
12629 (total_intervals, total_strings, total_free_strings):
12630 Now EMACS_INT, not int. All uses changed.
12631 (Fgarbage_collect): Compute overall total using a double, so that
12632 integer overflow is less likely to be a problem. Check for overflow
12633 when converting back to an integer.
12634 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12635 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12636 These were 'int' variables that could overflow on 64-bit hosts;
12637 they were never used, so remove them instead of repairing them.
12638 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
12639 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12640 Previously, this ceilinged at INT_MAX, but that doesn't work on
12641 64-bit machines.
12642 (allocate_pseudovector): Don't use EMACS_INT when int would do.
12643
12644 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
12645 (allocate_vectorlike): Check for ptrdiff_t overflow.
12646 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12647 when a (possibly-narrower) signed value would do just as well.
12648 We prefer using signed arithmetic, to avoid comparison confusion.
12649
12650 * alloc.c: Catch some string size overflows that we were missing.
12651 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12652 for convenience in STRING_BYTES_MAX.
12653 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12654 The definition here is exact; the one in lisp.h was approximate.
12655 (allocate_string_data): Check for string overflow. This catches
12656 some instances we weren't catching before. Also, it catches
12657 size_t overflow on (unusual) hosts where SIZE_MAX <= min
12658 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12659 and ptrdiff_t and EMACS_INT are both 64 bits.
12660
12661 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12662 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
12663 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
12664
12665 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12666
12667 * alloc.c (Fmake_string): Check for out-of-range init.
12668
12669 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12670
12671 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12672
12673 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12674
12675 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12676 xg_get_default_scrollbar_width.
12677
12678 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12679 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12680 (style_changed_cb): Call update_theme_scrollbar_width and call
12681 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12682 all frames (Bug#8505).
12683 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12684 Call gtk_window_set_resizable if HAVE_GTK3.
12685 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12686 and height if HAVE_GTK3 (Bug#8505).
12687 (scroll_bar_width_for_theme): New variable.
12688 (update_theme_scrollbar_width): New function.
12689 (xg_get_default_scrollbar_width): Move code to
12690 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12691 (xg_initialize): Call update_theme_scrollbar_width.
12692
12693 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12694
12695 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12696
12697 2011-06-12 Martin Rudalics <rudalics@gmx.at>
12698
12699 * frame.c (make_frame): Call other_buffer_safely instead of
12700 other_buffer.
12701
12702 * window.c (temp_output_buffer_show): Call display_buffer with
12703 second argument Vtemp_buffer_show_specifiers and reset latter
12704 immediately after the call.
12705 (Vtemp_buffer_show_specifiers): New variable.
12706 (auto_window_vscroll_p, next_screen_context_lines)
12707 (Vscroll_preserve_screen_position): Remove leading asterisks from
12708 doc-strings.
12709
12710 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
12711
12712 Fix minor problems found by GCC 4.6.0 static checking.
12713 * buffer.c (Qclone_number): Remove for now, as it's unused.
12714 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12715 (record_buffer): Remove unused local.
12716 * frame.c (other_visible_frames, frame_buffer_list): Now static.
12717 (set_frame_buffer_list): Remove; unused.
12718 * frame.h (other_visible_frames): Remove decl.
12719 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12720 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12721 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12722 if HAVE_GPM.
12723 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12724 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12725 Define only if HAVE_GPM.
12726 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12727 (update_hints_inhibit): Remove; never set. All uses removed.
12728 * widgetprv.h (emacsFrameClassRec): Remove decl.
12729 * window.c (delete_deletable_window): Now returns void, since it
12730 wasn't returning anything.
12731 (compare_window_configurations): Remove unused locals.
12732 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12733 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
12734 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
12735 the same widths as pointers. This follows up on the 2011-05-06 patch.
12736 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
12737 * xterm.h: Likewise.
12738 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
12739
12740 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
12741
12742 * makefile.w32-in: Update dependencies.
12743 (LISP_H): Add lib/intprops.h.
12744
12745 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12746
12747 * image.c (gif_load): Add animation frame delay to the metadata.
12748 (syms_of_image): Use DEFSYM. New symbol `delay'.
12749
12750 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12751
12752 * window.c (delete_deletable_window): Re-add.
12753 (Fset_window_configuration): Rewrite to handle dead buffers and
12754 consequently deletable windows.
12755 (window_tree, Fwindow_tree): Remove. Supply functionality in
12756 window.el.
12757 (compare_window_configurations): Simplify code.
12758
12759 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12760
12761 * image.c (imagemagick_load_image): Fix type mismatch.
12762 (Fimagemagick_types): Likewise.
12763
12764 * window.h (replace_buffer_in_windows): Declare.
12765
12766 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12767
12768 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12769 Qclone_number. Remove external declaration of Qdelete_window.
12770 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
12771 code.
12772 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12773 Run Qbuffer_list_update_hook if allowed.
12774 (Fother_buffer): Rewrite doc-string. Major rewrite for new
12775 buffer list implementation.
12776 (other_buffer_safely): New function.
12777 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12778 calls to replace_buffer_in_windows and
12779 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
12780 if allowed.
12781 (record_buffer): Inhibit quitting and rewrite using quittable
12782 functions. Run Qbuffer_list_update_hook if allowed.
12783 (Frecord_buffer, Funrecord_buffer): New functions.
12784 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12785 Move switch-to-buffer to window.el.
12786 (bury-buffer): Move to window.el.
12787 (Vbuffer_list_update_hook): New variable.
12788
12789 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12790 section.
12791
12792 * window.h (resize_frame_windows): Move up in code.
12793 (Fwindow_frame): Remove EXFUN.
12794 (replace_buffer_in_all_windows): Remove prototype.
12795 (replace_buffer_in_windows_safely): Add prototype.
12796
12797 * window.c: Declare Qdelete_window static again. Move down
12798 declaration of select_count.
12799 (Fnext_window, Fprevious_window): Rewrite doc-strings.
12800 (Fother_window): Move to window.el.
12801 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12802 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12803 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12804 window.el.
12805 (replace_buffer_in_windows): Implement by calling
12806 Qreplace_buffer_in_windows.
12807 (replace_buffer_in_all_windows): Remove with some functionality
12808 moved into replace_buffer_in_windows_safely.
12809 (replace_buffer_in_windows_safely): New function.
12810 (select_window_norecord, select_frame_norecord): Move in front
12811 of run_window_configuration_change_hook. Remove now obsolete
12812 declarations.
12813 (Fset_window_buffer): Rewrite doc-string.
12814 Call Qrecord_window_buffer.
12815 (keys_of_window): Move binding for other-window to window.el.
12816
12817 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12818
12819 * dispextern.h (struct image): Replace data member, whose int_val
12820 and ptr_val fields were not used by anything, with a single
12821 lisp_val object.
12822
12823 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12824 (gif_clear_image, gif_load, imagemagick_load_image)
12825 (gs_clear_image, gs_load): Callers changed.
12826
12827 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12828
12829 * buffer.h: Include <time.h>, for time_t.
12830 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12831
12832 Fix minor problems found by static checking.
12833
12834 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12835
12836 Make identifiers static if they are not used in other modules.
12837 * data.c (Qcompiled_function, Qframe, Qvector):
12838 * image.c (QimageMagick, Qsvg):
12839 * minibuf.c (Qmetadata):
12840 * window.c (resize_window_check, resize_root_window): Now static.
12841 * window.h (resize_window_check, resize_root_window): Remove decls.
12842
12843 * window.c (window_deletion_count, delete_deletable_window):
12844 Remove; unused.
12845 (window_body_lines): Now static.
12846 (Fdelete_other_windows_internal): Mark vars as initialized.
12847 Make sure 'resize_failed' is initialized.
12848 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12849 (resize_window_apply): Remove unused local.
12850 * window.h (delete_deletable_window): Remove decl.
12851
12852 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
12853 (imagemagick_load_image): Fix pointer signedness problem by changing
12854 last arg from unsigned char * to char *. All uses changed.
12855 Also, fix a local for similar reasons.
12856 Remove unused locals. Remove locals to avoid shadowing.
12857 (fn_rsvg_handle_free): Remove; unused.
12858 (svg_load, svg_load_image): Fix pointer signedness problem.
12859 (imagemagick_load_image): Don't use garbage pointer image_wand.
12860
12861 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12862
12863 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
12864
12865 * image.c (gif_load): Fix omitted cast error introduced by
12866 2011-06-06 change.
12867
12868 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12869
12870 * window.h (resize_proportionally, orig_total_lines)
12871 (orig_top_line): Remove from window structure.
12872 (set_window_height, set_window_width, change_window_heights)
12873 (Fdelete_window): Remove prototypes.
12874 (resize_frame_windows): Remove duplicate declaration.
12875
12876 2011-06-10 Eli Zaretskii <eliz@gnu.org>
12877
12878 * window.h (resize_frame_windows, resize_window_check)
12879 (delete_deletable_window, resize_root_window)
12880 (resize_frame_windows): Declare prototypes.
12881
12882 * window.c (resize_window_apply): Make definition be "static" to
12883 match the prototype.
12884
12885 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12886
12887 * window.c: Remove declarations of Qwindow_size_fixed,
12888 window_min_size_1, window_min_size_2, window_min_size,
12889 size_window, window_fixed_size_p, enlarge_window, delete_window.
12890 Remove static from declaration of Qdelete_window, it's
12891 temporarily needed by Fbury_buffer.
12892 (replace_window): Don't assign orig_top_line and
12893 orig_total_lines.
12894 (Fdelete_window, delete_window): Remove. Window deletion is
12895 handled by window.el.
12896 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12897 Replace Fdelete_window calls with calls to Qdelete_window.
12898 (Fdelete_other_windows): Remove. Deleting other windows is
12899 handled by window.el.
12900 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12901 handled in window.el.
12902 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12903 Window minimum sizes are handled in window.el.
12904 (shrink_windows, size_window, set_window_height)
12905 (set_window_width, change_window_heights, window_height)
12906 (window_width, CURBEG, CURSIZE, enlarge_window)
12907 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12908 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12909 handled in window.el.
12910 (make_dummy_parent): Rename to make_parent_window and give it a
12911 second argument horflag.
12912 (make_window): Don't set resize_proportionally any more.
12913 (Fsplit_window): Remove. Windows are split in window.el.
12914 (save_restore_action, save_restore_orig_size)
12915 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12916 Resize mini windows in window.el.
12917 (grow_mini_window, shrink_mini_window): Implement by calling
12918 Qresize_root_window_vertically, resize_window_check and
12919 resize_window_apply.
12920 (saved_window, Fset_window_configuration, save_window_save):
12921 Do not handle orig_top_line, orig_total_lines, and
12922 resize_proportionally.
12923 (window_min_height, window_min_width): Move to window.el.
12924 (keys_of_window): Move bindings for delete-other-windows,
12925 split-window, delete-window and enlarge-window to window.el.
12926
12927 * buffer.c: Temporarily extern Qdelete_window.
12928 (Fbury_buffer): Temporarily call Qdelete_window instead of
12929 Fdelete_window (Fbury_buffer will move to window.el soon).
12930
12931 * frame.c (set_menu_bar_lines_1): Remove code handling
12932 orig_top_line and orig_total_lines.
12933
12934 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12935 set_window_height but set heights directly.
12936 (change_frame_size_1): Use resize_frame_windows.
12937
12938 * xdisp.c (init_xdisp): Don't use set_window_height but set
12939 heights directly.
12940
12941 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12942 Use resize_frame_windows instead of change_window_heights and run
12943 run_window_configuration_change_hook.
12944
12945 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12946 instead of change_window_heights and run
12947 run_window_configuration_change_hook.
12948
12949 2011-06-09 Martin Rudalics <rudalics@gmx.at>
12950
12951 * window.c (replace_window): Rename second argument REPLACEMENT to
12952 NEW. New third argument SETFLAG. Rewrite.
12953 (delete_window, make_dummy_parent): Call replace_window with
12954 third argument 1.
12955 (window_list_1): Move down in code.
12956 (run_window_configuration_change_hook): Move set_buffer part
12957 before select_frame_norecord part in order to unwind correctly.
12958 Rename count1 to count.
12959 (recombine_windows, delete_deletable_window, resize_root_window)
12960 (Fdelete_other_windows_internal)
12961 (Frun_window_configuration_change_hook, make_parent_window)
12962 (resize_window_check, resize_window_apply, Fresize_window_apply)
12963 (resize_frame_windows, Fsplit_window_internal)
12964 (Fdelete_window_internal, Fresize_mini_window_internal):
12965 New functions.
12966 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12967
12968 2011-06-08 Martin Rudalics <rudalics@gmx.at>
12969
12970 * window.h (window): Add some new members to window structure -
12971 normal_lines, normal_cols, new_total, new_normal, clone_number,
12972 splits, nest, prev_buffers, next_buffers.
12973 (WINDOW_TOTAL_SIZE): Move here from window.c.
12974 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
12975
12976 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12977 Remove.
12978 (make_dummy_parent): Set new members of windows structure.
12979 (make_window): Move down in code. Handle new members of window
12980 structure.
12981 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12982 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12983 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12984 (Fset_window_prev_buffers, Fwindow_next_buffers)
12985 (Fset_window_next_buffers, Fset_window_clone_number):
12986 New functions.
12987 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12988 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12989 Doc-string fixes.
12990 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12991 Argument WINDOW can be now internal window too.
12992 (Fwindow_use_time): Move up in code.
12993 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12994 Rewrite doc-string.
12995 (Fset_window_configuration, saved_window)
12996 (Fcurrent_window_configuration, save_window_save): Handle new
12997 members of window structure.
12998 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12999 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13000 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13001 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13002 Qget_mru_window, Qresize_root_window,
13003 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13004 Qauto_buffer_name; staticpro them.
13005
13006 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13007
13008 * window.c (Fwindow_total_size, Fwindow_left_column)
13009 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13010 (Fwindow_list_1): New functions.
13011 (window_box_text_cols): Replace with window_body_cols.
13012 (Fwindow_width, Fscroll_left, Fscroll_right):
13013 Use window_body_cols instead of window_box_text_cols.
13014 (delete_window, Fset_window_configuration):
13015 Call delete_all_subwindows with window as argument.
13016 (delete_all_subwindows): Take a window as argument and not a
13017 structure. Rewrite.
13018 (window_loop): Remove handling of GET_LRU_WINDOW and
13019 GET_LARGEST_WINDOW.
13020 (Fget_lru_window, Fget_largest_window): Move to window.el.
13021
13022 * window.h: Extern window_body_cols instead of
13023 window_box_text_cols. delete_all_subwindows now takes a
13024 Lisp_Object as argument.
13025
13026 * indent.c (compute_motion, Fcompute_motion):
13027 Use window_body_cols instead of window_box_text_cols.
13028
13029 * frame.c (delete_frame): Call delete_all_subwindows with root
13030 window as argument.
13031
13032 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13033
13034 * fns.c (Fputhash): Document return value.
13035
13036 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13037
13038 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13039
13040 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13041
13042 Cons<->int and similar integer overflow fixes (Bug#8794).
13043
13044 Check for overflow when converting integer to cons and back.
13045 * charset.c (Fdefine_charset_internal, Fdecode_char):
13046 Use cons_to_unsigned to catch overflow.
13047 (Fencode_char): Use INTEGER_TO_CONS.
13048 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13049 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13050 * data.c (long_to_cons, cons_to_long): Remove.
13051 (cons_to_unsigned, cons_to_signed): New functions.
13052 These signal an error for invalid or out-of-range values.
13053 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13054 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13055 * font.c (Ffont_variation_glyphs):
13056 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13057 * lisp.h: Include <intprops.h>.
13058 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13059 (cons_to_signed, cons_to_unsigned): New decls.
13060 (long_to_cons, cons_to_long): Remove decls.
13061 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13062 (Fprimitive_undo): Use CONS_TO_INTEGER.
13063 * xfns.c (Fx_window_property): Likewise.
13064 * xselect.c: Include <limits.h>.
13065 (x_own_selection, selection_data_to_lisp_data):
13066 Use INTEGER_TO_CONS.
13067 (x_handle_selection_request, x_handle_selection_clear)
13068 (x_get_foreign_selection, Fx_disown_selection_internal)
13069 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13070 (lisp_data_to_selection_data): Use cons_to_unsigned.
13071 (x_fill_property_data): Use cons_to_signed.
13072 Report values out of range.
13073
13074 Check for buffer and string overflow more precisely.
13075 * buffer.h (BUF_BYTES_MAX): New macro.
13076 * lisp.h (STRING_BYTES_MAX): New macro.
13077 * alloc.c (Fmake_string):
13078 * character.c (string_escape_byte8):
13079 * coding.c (coding_alloc_by_realloc):
13080 * doprnt.c (doprnt):
13081 * editfns.c (Fformat):
13082 * eval.c (verror):
13083 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13084 since they may not be the same number.
13085 * editfns.c (Finsert_char):
13086 * fileio.c (Finsert_file_contents):
13087 Likewise for BUF_BYTES_MAX.
13088
13089 * image.c: Use ptrdiff_t, not int, for sizes.
13090 (slurp_file): Switch from int to ptrdiff_t.
13091 All uses changed.
13092 (slurp_file): Check that file size fits in both size_t (for
13093 malloc) and ptrdiff_t (for sanity and safety).
13094
13095 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13096 if b->modtime has its maximal value.
13097
13098 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13099
13100 Don't assume time_t can fit into int.
13101 * buffer.h (struct buffer.modtime): Now time_t, not int.
13102 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13103 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13104
13105 Minor fixes for signed vs unsigned integers.
13106 * character.h (MAYBE_UNIFY_CHAR):
13107 * charset.c (maybe_unify_char):
13108 * keyboard.c (read_char, reorder_modifiers):
13109 XINT -> XFASTINT, since the integer must be nonnegative.
13110 * ftfont.c (ftfont_spec_pattern):
13111 * keymap.c (access_keymap, silly_event_symbol_error):
13112 XUINT -> XFASTINT, since the integer must be nonnegative.
13113 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13114 since it makes no difference and we prefer signed.
13115 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13116 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13117 nonnegative.
13118
13119 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13120
13121 * window.h (Fwindow_frame): Declare.
13122
13123 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13124
13125 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13126 (SPARE_MEMORY): Always define.
13127 (LARGE_REQUEST): Remove.
13128 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13129
13130 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13131
13132 * lisp.h: Move EXFUNS for Fframe_root_window,
13133 Fframe_first_window and Fset_frame_selected_window to window.h.
13134
13135 * window.h: Move EXFUNS for Fframe_root_window,
13136 Fframe_first_window and Fset_frame_selected_window here from
13137 lisp.h.
13138
13139 * frame.c (Fwindow_frame, Fframe_first_window)
13140 (Fframe_root_window, Fframe_selected_window)
13141 (Fset_frame_selected_window): Move to window.c.
13142 (Factive_minibuffer_window): Move to minibuf.c.
13143 (Fother_visible_frames_p): New function.
13144
13145 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13146
13147 * window.c (decode_window, decode_any_window): Move up in code.
13148 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13149 (inhibit_frame_unsplittable): Remove unused variable.
13150 (Fwindow_buffer): Move up and rewrite doc-string.
13151 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13152 (Fwindow_prev): New functions.
13153 (Fwindow_frame): Move here from frame.c. Accept any window as
13154 argument.
13155 (Fframe_root_window, Fframe_first_window)
13156 (Fframe_selected_window): Move here from frame.c. Accept frame
13157 or arbitrary window as argument. Update doc-strings.
13158 (Fminibuffer_window): Move up in code.
13159 (Fwindow_minibuffer_p): Move up in code and simplify.
13160 (Fset_frame_selected_window): Move here from frame.c.
13161 Marginal rewrite.
13162 (Fselected_window, select_window, Fselect_window): Move up in
13163 code. Minor doc-string fixes.
13164
13165 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13166
13167 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13168 Do not assume that spare memory exists; that assumption is valid
13169 only if SYSTEM_MALLOC.
13170 (LARGE_REQUEST): New macro, so that the issue of large requests
13171 is separated from the issue of spare memory.
13172
13173 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13174
13175 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13176 format. (Bug#8806)
13177
13178 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13179
13180 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13181 before statements.
13182
13183 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13184
13185 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13186
13187 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13188
13189 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13190 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13191
13192 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13193
13194 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13195
13196 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13197
13198 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13199 (x_clipboard_manager_save): Add return value.
13200 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13201 New error handlers.
13202 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13203 Obey Vx_select_enable_clipboard_manager. Catch errors in
13204 x_clipboard_manager_save (Bug#8779).
13205 (Vx_select_enable_clipboard_manager): New variable.
13206 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13207
13208 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13209
13210 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13211
13212 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13213
13214 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13215 in the current matrix if keep_current_p is non-zero.
13216
13217 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13218
13219 * bidi.c (bidi_level_of_next_char): Fix last change.
13220
13221 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13222
13223 Support bidi reordering of text covered by display properties.
13224
13225 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13226 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13227 (bidi_cache_search, bidi_cache_iterator_state)
13228 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13229 (bidi_level_of_next_char, bidi_move_to_visually_next):
13230 Support character positions inside a run of characters covered by a
13231 display string.
13232 (bidi_paragraph_init, bidi_resolve_explicit_1)
13233 (bidi_level_of_next_char): Call bidi_fetch_char and
13234 bidi_fetch_char_advance instead of FETCH_CHAR and
13235 FETCH_CHAR_ADVANCE.
13236 (bidi_init_it): Initialize new members.
13237 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13238 definitions.
13239 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13240 instead of using explicit *_CHAR codes.
13241 (bidi_resolve_explicit, bidi_resolve_weak):
13242 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13243 bidirectional text is supported only in multibyte buffers.
13244 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13245 it to initialize the frame_window_p member of struct bidi_it.
13246 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13247 (bidi_resolve_explicit, bidi_resolve_weak)
13248 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13249 bidi_it->nchars is non-positive.
13250 (bidi_level_of_next_char): Don't try to lookup the cache for the
13251 next/previous character if nothing is cached there yet, or if we
13252 were just reseat()'ed to a new position.
13253
13254 * xdisp.c (set_cursor_from_row): Set start and stop points
13255 according to the row's direction when priming the loop that looks
13256 for the glyph on which to display cursor.
13257 (single_display_spec_intangible_p): Function deleted.
13258 (display_prop_intangible_p): Reimplement to call
13259 handle_display_spec instead of single_display_spec_intangible_p.
13260 Accept 3 additional arguments needed by handle_display_spec.
13261 This fixes incorrect cursor motion across display property with complex
13262 values: lists, `(when COND...)' forms, etc.
13263 (single_display_spec_string_p): Support property values that are
13264 lists with the argument STRING its top-level element.
13265 (display_prop_string_p): Fix the condition for processing a
13266 property that is a list to be consistent with handle_display_spec.
13267 (handle_display_spec): New function, refactored from the
13268 last portion of handle_display_prop.
13269 (compute_display_string_pos): Accept additional argument
13270 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13271 value of a `display' property is a "replacing spec".
13272 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13273 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13274 the display property, but just return a value indicating whether
13275 the display property will replace the characters it covers.
13276 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13277 frame_window_p members of struct bidi_it.
13278 (compute_display_string_pos, compute_display_string_end):
13279 New functions.
13280 (push_it): Accept second argument POSITION, where pop_it should
13281 jump to continue iteration.
13282 (reseat_1): Initialize bidi_it.disp_pos.
13283
13284 * keyboard.c (adjust_point_for_property): Adjust the call to
13285 display_prop_intangible_p to its new signature.
13286
13287 * dispextern.h (struct bidi_it): New member frame_window_p.
13288 (bidi_init_it): Update prototypes.
13289 (display_prop_intangible_p): Update prototype.
13290 (compute_display_string_pos, compute_display_string_end):
13291 Declare prototypes.
13292 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13293 EMACS_INT.
13294
13295 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13296
13297 Malloc failure behavior now depends on size of allocation.
13298 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13299 * lisp.h: Change signatures accordingly.
13300 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13301 All callers changed. (Bug#8762)
13302
13303 * gnutls.c: Use Emacs's memory allocators.
13304 Without this change, the gnutls library would invoke malloc etc.
13305 directly, which causes problems on non-SYNC_INPUT hosts, and which
13306 runs afoul of improving memory_full behavior. (Bug#8761)
13307 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13308 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13309 xfree instead of the default malloc, realloc, free.
13310 (Fgnutls_boot): No need to check for memory allocation failure,
13311 since xmalloc does that for us.
13312
13313 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13314 * category.c (hash_get_category_set):
13315 * ccl.c (ccl_driver):
13316 * charset.c (Fdefine_charset_internal):
13317 * charset.h (struct charset.hash_index):
13318 * composite.c (get_composition_id, gstring_lookup_cache)
13319 (composition_gstring_put_cache):
13320 * composite.h (struct composition.hash_index):
13321 * dispextern.h (struct image.hash):
13322 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13323 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13324 (hashfn_equal, hashfn_user_defined, make_hash_table)
13325 (maybe_resize_hash_table, hash_lookup, hash_put)
13326 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13327 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13328 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13329 * image.c (make_image, search_image_cache, lookup_image)
13330 (xpm_put_color_table_h):
13331 * lisp.h (struct Lisp_Hash_Table):
13332 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13333 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13334 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13335 * alloc.c (allocate_vectorlike):
13336 Check for overflow in vector size calculations.
13337 * ccl.c (ccl_driver):
13338 Check for overflow when converting EMACS_INT to int.
13339 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13340 need to be updated by these changes.
13341 * fns.c (make_hash_table, maybe_resize_hash_table):
13342 Check for integer overflow with large hash tables.
13343 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13344 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13345 (SXHASH_REDUCE): New macro.
13346 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13347 Use it instead of discarding useful hash info with large hash values.
13348 (sxhash_float): New function.
13349 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13350 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13351 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13352 Rewrite to use FIXNUM_BITS, as this simplifies things.
13353 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13354 Adjust signatures to match updated version of code.
13355 (consing_since_gc): Now EMACS_INT, since a single hash table can
13356 use more than INT_MAX bytes.
13357
13358 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13359
13360 Make it possible to build with GCC-4.6+ -O2 -flto.
13361
13362 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13363
13364 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13365
13366 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13367 Call minibuffer-inactive-mode.
13368
13369 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13370
13371 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13372 Update dependencies.
13373
13374 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13375
13376 * data.c (init_data): Remove code for UTS, this system is not
13377 supported anymore.
13378
13379 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13380
13381 Don't force ./temacs to start in terminal mode.
13382
13383 * frame.c (make_initial_frame): Initialize faces in all cases, not
13384 only when CANNOT_DUMP is defined.
13385 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13386
13387 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13388
13389 * dispnew.c (add_window_display_history): Use const for the string
13390 pointer. Remove declaration, not needed.
13391
13392 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13393
13394 Use 'inline', not 'INLINE'.
13395 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13396 * alloc.c, fontset.c (INLINE): Remove.
13397 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13398 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13399 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13400 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13401 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13402
13403 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13404
13405 Make it possible to run ./temacs.
13406
13407 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13408 syms_of_callproc does the same thing. Remove test for
13409 "initialized", do it in the caller.
13410 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13411
13412 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13413
13414 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13415 (read_minibuf): Use get_minibuffer.
13416 (syms_of_minibuf): Use DEFSYM.
13417 (Qmetadata): New var.
13418 * data.c (Qbuffer): Don't make it static.
13419 (syms_of_data): Use DEFSYM.
13420
13421 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13422
13423 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13424 (CCL_CODE_MIN): New macro.
13425
13426 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13427
13428 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13429
13430 * eval.c (Qdebug): Now static.
13431 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13432 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13433 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13434
13435 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13436
13437 * image.c: Various fixes to ImageMagick code comments.
13438 (Fimagemagick_types): Doc fix.
13439
13440 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13441
13442 Minor fixes prompted by GCC 4.6.0 warnings.
13443
13444 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13445
13446 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13447 (x_clipboard_manager_save_all): Move extern decl to ...
13448 * xterm.h: ... here, so that it can be checked for consistency.
13449
13450 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13451
13452 * xselect.c (x_clipboard_manager_save_frame)
13453 (x_clipboard_manager_save_all): New functions.
13454 (Fx_clipboard_manager_save): Lisp function deleted.
13455
13456 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13457 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13458
13459 * xterm.h: Update prototype.
13460
13461 2011-05-28 William Xu <william.xwl@gmail.com>
13462
13463 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13464 exiting (Bug#8239).
13465
13466 2011-05-28 Jim Meyering <meyering@redhat.com>
13467
13468 Avoid a sign-extension bug in crypto_hash_function.
13469 * fns.c (to_uchar): Define.
13470 (crypto_hash_function): Use it to convert some newly-signed
13471 variables to unsigned, to avoid sign-extension bugs. For example,
13472 without this change, (md5 "truc") would evaluate to
13473 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13474 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13475 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13476
13477 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13478
13479 Integer overflow fixes.
13480
13481 * dbusbind.c: Serial number integer overflow fixes.
13482 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13483 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13484 to hold a serial number that is too large for a fixnum.
13485 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13486 Check for serial numbers out of range. Decode any serial number
13487 that was so large that it became a float. (Bug#8722)
13488
13489 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13490 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13491 Use XFASTINT rather than XUINT when numbers are nonnegative.
13492 (xd_append_arg, Fdbus_method_return_internal):
13493 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13494 arguments, check that Lisp number is nonnegative, rather than
13495 silently wrapping negative numbers around. (Bug#8722)
13496 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13497 (Bug#8722)
13498
13499 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13500
13501 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13502
13503 ccl: Add integer overflow checks.
13504 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13505 (IN_INT_RANGE): New macros.
13506 (ccl_driver): Use them to check for integer overflow when
13507 decoding a CCL program. Many of the new checks are whether XINT (x)
13508 fits in int; it doesn't always, on 64-bit hosts. The new version
13509 doesn't catch all possible integer overflows, but it's an
13510 improvement. (Bug#8719)
13511
13512 * alloc.c (make_event_array): Use XINT, not XUINT.
13513 There's no need for unsigned here.
13514
13515 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13516 This follows up to the 2011-05-06 change that substituted uintptr_t
13517 for EMACS_INT. This case wasn't caught back then.
13518
13519 Rework Fformat to avoid integer overflow issues.
13520 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13521 now (part of C89). Include <verify.h>.
13522 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13523 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13524 (Fformat): Avoid the prepass trying to compute sizes; it was only
13525 approximate and thus did not catch overflow reliably. Instead, walk
13526 through the format just once, formatting and computing sizes as we go,
13527 checking for integer overflow at every step, and allocating a larger
13528 buffer as needed. Keep track separately whether the format is
13529 multibyte. Keep only the most-recently calculated precision, rather
13530 than them all. Record whether each argument has been converted to
13531 string. Use EMACS_INT, not int, for byte and char and arg counts.
13532 Support field widths and precisions larger than INT_MAX. Avoid
13533 sprintf's undefined behavior with conversion specifications such as %#d
13534 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13535 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13536 formatting out-of-range floating point numbers with int
13537 formats. (Bug#8668)
13538
13539 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13540
13541 * data.c: Avoid integer truncation in expressions involving floats.
13542 * data.c: Include <intprops.h>.
13543 (arith_driver): When there's an integer overflow in an expression
13544 involving floating point, convert the integers to floating point
13545 so that the resulting value does not suffer from catastrophic
13546 integer truncation. For example, on a 64-bit host (* 4
13547 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13548 Do not rely on undefined behavior after integer overflow.
13549
13550 merge count_size_as_multibyte, parse_str_to_multibyte
13551 * character.c, character.h (count_size_as_multibyte):
13552 Rename from parse_str_to_multibyte; all uses changed.
13553 Check for integer overflow.
13554 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13555 since it's now a duplicate of the other. This is more of
13556 a character than a buffer op, so better that it's in character.c.
13557 * fns.c, print.c: Adjust to above changes.
13558
13559 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13560
13561 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13562
13563 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13564
13565 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13566 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13567 (x_clipboard_manager_save): Now static.
13568 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13569
13570 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13571 (crypto_hash_function): Now static.
13572 Fix pointer signedness problems. Avoid unnecessary initializations.
13573
13574 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
13575
13576 * termhooks.h (Vselection_alist): Make it terminal-local.
13577
13578 * terminal.c (create_terminal): Initialize it.
13579
13580 * xselect.c: Support for clipboard managers.
13581 (Vselection_alist): Move to termhooks.h as terminal-local var.
13582 (LOCAL_SELECTION): New macro.
13583 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13584 (symbol_to_x_atom): Remove gratuitous arg.
13585 (x_handle_selection_request, lisp_data_to_selection_data)
13586 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
13587 (x_own_selection, x_get_local_selection, x_convert_selection):
13588 New arg, specifying work frame. Use terminal-local Vselection_alist.
13589 (some_frame_on_display): Delete unused function.
13590 (Fx_own_selection_internal, Fx_get_selection_internal)
13591 (Fx_disown_selection_internal, Fx_selection_owner_p)
13592 (Fx_selection_exists_p): New optional frame arg.
13593 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13594 (x_handle_selection_clear): Don't treat other terminals with the
13595 same keyboard specially. Use the terminal-local Vselection_alist.
13596 (x_clear_frame_selections): Use Frun_hook_with_args.
13597
13598 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13599
13600 * xterm.h: Add support for those atoms.
13601
13602 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
13603
13604 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13605 (converted_selections, conversion_fail_tag): New global variables.
13606 (x_selection_request_lisp_error): Free the above.
13607 (x_get_local_selection): Remove unnecessary code.
13608 (x_reply_selection_request): Args changed; handle arbitrary array
13609 of converted selections stored in converted_selections.
13610 Separate the XChangeProperty and SelectionNotify steps.
13611 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13612 (x_convert_selection): New function.
13613 (x_handle_selection_event): Simplify.
13614 (x_get_foreign_selection): Don't ignore incoming requests while
13615 waiting for an answer; this will fail when we implement
13616 SAVE_TARGETS, and seems unnecessary anyway.
13617 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13618 (Vx_sent_selection_functions): Doc fix.
13619
13620 2011-05-26 Leo Liu <sdl.web@gmail.com>
13621
13622 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13623
13624 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13625
13626 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13627
13628 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13629 for fringe update if it has periodic bitmap.
13630 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
13631 and fringe_bitmap_periodic_p.
13632
13633 * fringe.c (get_fringe_bitmap_data): New function.
13634 (draw_fringe_bitmap_1, update_window_fringes): Use it.
13635 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13636 row. Mark glyph row for fringe update if periodicity changed.
13637
13638 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13639 for fringe update unless it has periodic bitmap.
13640
13641 2011-05-25 Kenichi Handa <handa@m17n.org>
13642
13643 * xdisp.c (get_next_display_element): Set correct it->face_id for
13644 a static composition.
13645
13646 2011-05-24 Leo Liu <sdl.web@gmail.com>
13647
13648 * deps.mk (fns.o):
13649 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13650
13651 * fns.c (crypto_hash_function, Fsha1): New function.
13652 (Fmd5): Use crypto_hash_function.
13653 (syms_of_fns): Add Ssha1.
13654
13655 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13656
13657 * gnutls.c: Remove unused macros.
13658 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13659 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13660 Remove macros that are defined and never used.
13661 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13662
13663 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13664
13665 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13666 (Fx_get_selection_internal): Minor cleanup.
13667 (Fx_own_selection_internal): Rename arguments for consistency with
13668 select.el.
13669
13670 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13671
13672 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13673
13674 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13675
13676 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13677
13678 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13679
13680 * dispnew.c (scrolling_window): Don't exclude the case that the
13681 last enabled row in the desired matrix touches the bottom boundary.
13682
13683 2011-05-21 Glenn Morris <rgm@gnu.org>
13684
13685 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
13686 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13687 and add some more files.
13688
13689 2011-05-20 Eli Zaretskii <eliz@gnu.org>
13690
13691 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13692 report_file_error introduced by the change from 2011-05-07.
13693
13694 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13695
13696 * systime.h (Time): Define only if emacs is defined.
13697 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13698 where the include path doesn't have X11/X.h by default. See
13699 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13700
13701 2011-05-20 Kenichi Handa <handa@m17n.org>
13702
13703 * composite.c (find_automatic_composition): Fix previous change.
13704
13705 2011-05-20 Glenn Morris <rgm@gnu.org>
13706
13707 * lisp.mk: New file, split from Makefile.in.
13708 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13709 (shortlisp): Remove.
13710 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13711
13712 2011-05-19 Glenn Morris <rgm@gnu.org>
13713
13714 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13715 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13716 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13717 (lisp): Set the order to that of loadup.el.
13718 (shortlisp): Make it a copy of $lisp.
13719 (SOME_MACHINE_LISP): Remove.
13720 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13721 Use just $shortlisp, not $SOME_MACHINE_LISP too.
13722
13723 2011-05-18 Kenichi Handa <handa@m17n.org>
13724
13725 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13726 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13727 (find_automatic_composition): Mostly rewrite for efficiency.
13728
13729 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
13730
13731 * makefile.w32-in: Update dependencies.
13732
13733 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13734
13735 * menu.c: Include limits.h (fixes the MS-Windows build broken by
13736 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
13737
13738 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
13739
13740 Fix some integer overflow issues, such as string length overflow.
13741
13742 * insdel.c (count_size_as_multibyte): Check for string overflow.
13743
13744 * character.c (lisp_string_width): Check for string overflow.
13745 Use EMACS_INT, not int, for string indexes and lengths; in
13746 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
13747 the resulting string length overflows an EMACS_INT; instead,
13748 report a string overflow if no precision given. When checking for
13749 precision exhaustion, use a check that cannot possibly have
13750 integer overflow. (Bug#8675)
13751 * character.h (lisp_string_width): Adjust to new signature.
13752
13753 * alloc.c (string_overflow): New function.
13754 (Fmake_string): Use it. This doesn't change behavior, but saves
13755 a few bytes and will simplify future changes.
13756 * character.c (string_escape_byte8): Likewise.
13757 * lisp.h (string_overflow): New decl.
13758
13759 Fixups, following up to the user-interface timestamp change.
13760 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13761 for UI timestamps, instead of unsigned long.
13762 * msdos.c (mouse_get_pos): Likewise.
13763 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
13764 * w32gui.h (Time): Define by including "systime.h" rather than by
13765 declaring it ourselves. (Bug#8664)
13766
13767 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13768 * image.c (clear_image_cache): Likewise.
13769
13770 * term.c (term_mouse_position): Don't assume time_t wraparound.
13771
13772 Be more systematic about user-interface timestamps.
13773 Before, the code sometimes used 'Time', sometimes 'unsigned long',
13774 and sometimes 'EMACS_UINT', to represent these timestamps.
13775 This change causes it to use 'Time' uniformly, as that's what X uses.
13776 This makes the code easier to follow, and makes it easier to catch
13777 integer overflow bugs such as Bug#8664.
13778 * frame.c (Fmouse_position, Fmouse_pixel_position):
13779 Use Time, not unsigned long, for user-interface timestamps.
13780 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13781 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13782 * keyboard.h (last_event_timestamp): Likewise.
13783 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13784 * menu.h (xmenu_show): Likewise.
13785 * term.c (term_mouse_position): Likewise.
13786 * termhooks.h (struct input_event.timestamp): Likewise.
13787 (struct terminal.mouse_position_hook): Likewise.
13788 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13789 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13790 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
13791 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13792 what it was before.
13793 * menu.h, termhooks.h: Include "systime.h", for Time.
13794
13795 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13796 Don't assume that the difference between two unsigned long values
13797 can fit into an integer. At this point, we know button_down_time
13798 <= event->timestamp, so the difference must be nonnegative, so
13799 there's no need to cast the result if double-click-time is
13800 nonnegative, as it should be; check that it's nonnegative, just in
13801 case. This bug is triggered when events are more than 2**31 ms
13802 apart (about 25 days). (Bug#8664)
13803
13804 * xselect.c (last_event_timestamp): Remove duplicate decl.
13805 (x_own_selection): Remove needless cast to unsigned long.
13806
13807 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13808 that always fit in int. Use a sentinel instead of a counter, to
13809 avoid a temp and to allay GCC's concerns about possible int overflow.
13810 * frame.h (struct frame): Use int for menu_bar_items_used
13811 instead of EMACS_INT, since it always fits in int.
13812
13813 * menu.c (grow_menu_items): Check for int overflow.
13814
13815 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13816
13817 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13818 Before, the code was not consistent. These values cannot exceed
13819 2**31 - 1 so there's no need to make them unsigned.
13820 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13821 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13822 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13823 as modifiers.
13824 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13825
13826 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13827 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13828 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13829 presumably because the widths might not match.
13830
13831 * window.c (size_window): Avoid needless test at loop start.
13832
13833 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13834
13835 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13836
13837 2011-05-12 Drew Adams <drew.adams@oracle.com>
13838
13839 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13840
13841 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13842
13843 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13844 `width' to `bar_area_x' and `bar_area_width', respectively.
13845 (x_scroll_run): Take account of fringe background extension.
13846
13847 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13848 Rename local vars `left' and `width' to `bar_area_x' and
13849 `bar_area_width', respectively.
13850 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13851 background extension.
13852
13853 2011-05-10 Jim Meyering <meyering@redhat.com>
13854
13855 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13856
13857 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
13858
13859 * image.c (Finit_image_library): Return t for built-in image types,
13860 like pbm and xbm. (Bug#8640)
13861
13862 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13863
13864 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13865
13866 2011-05-07 Eli Zaretskii <eliz@gnu.org>
13867
13868 * w32console.c (Fset_screen_color): Doc fix.
13869 (Fget_screen_color): New function.
13870 (syms_of_ntterm): Defsubr it.
13871
13872 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13873 unlink the temporary file if Fcall_process didn't create it in the
13874 first place.
13875 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13876 child process will be redirected to a file specified with `:file'.
13877 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13878 cue to call_process_cleanup not to close that handle.
13879
13880 2011-05-07 Ben Key <bkey76@gmail.com>
13881
13882 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13883 one of two shell specific rules, either bootstrap-temacs-CMD or
13884 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13885 to the previous implementation of the bootstrap-temacs rule.
13886 The bootstrap-temacs-CMD rule is similar to the previous
13887 implementation of the bootstrap-temacs rule except that it
13888 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13889 variable.
13890
13891 These changes, along with some changes to nt/configure.bat,
13892 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13893 earlier fix to add support for --cflags and --ldflags options
13894 that include quotes so that it works whether make uses cmd or
13895 sh as the shell.
13896
13897 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
13898
13899 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13900 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13901 is a constant.
13902 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13903 a string. Handle both cases.
13904 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13905 (Fdbus_register_method): Use Qinvalid_function.
13906
13907 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13908
13909 * makefile.w32-in: Update dependencies.
13910 (LISP_H): Add inttypes.h and stdin.h.
13911 (PROCESS_H): Add unistd.h.
13912
13913 2011-05-06 Eli Zaretskii <eliz@gnu.org>
13914
13915 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13916 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13917
13918 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
13919
13920 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13921
13922 * term.c (vfatal): Remove stray call to va_end.
13923 It's not needed and the C Standard doesn't allow it here anyway.
13924
13925 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13926 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13927
13928 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13929 bytes.
13930
13931 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13932
13933 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13934
13935 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13936
13937 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13938
13939 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13940
13941 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13942 * charset.c (Fdefine_charset_internal): Don't initialize
13943 charset.code_space[15]. The value was garbage, on hosts with
13944 32-bit int (Bug#8600).
13945
13946 * lread.c (read_integer): Be more consistent with string-to-number.
13947 Use string_to_number to do the actual conversion; this avoids
13948 rounding errors and fixes some other screwups. Without this fix,
13949 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13950 (digit_to_number): Move earlier, for benefit of read_integer.
13951 Return -1 if the digit is out of range for the base, -2 if it is
13952 not a digit in any supported base. (Bug#8602)
13953
13954 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13955
13956 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13957 to match comment at start of function. This also removes a
13958 GCC warning about overflow in a 32+64-bit port.
13959
13960 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13961
13962 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13963 Reported by Stefan Monnier in
13964 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
13965 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13966 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
13967
13968 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13969 (EMACS_UINTPTR): Likewise, with uintptr_t.
13970
13971 * lisp.h: Prefer 64-bit EMACS_INT if available.
13972 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13973 on 32-bit hosts that have 64-bit int, so that they can access
13974 large files.
13975 However, temporarily disable this change unless the temporary
13976 symbol WIDE_EMACS_INT is defined.
13977
13978 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13979
13980 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13981 This removes an assumption that EMACS_INT and long are the same
13982 width as pointers. The assumption is true for Emacs porting targets
13983 now, but we want to make other targets possible.
13984 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13985 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13986 In the rest of the code, change types of integers that hold casted
13987 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13988 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13989 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13990 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13991 No need to cast type when ORing.
13992 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13993 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13994 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13995 assume EMACS_INT is the same width as char *.
13996 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13997 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13998 Remove no-longer-needed casts.
13999 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14000 (xg_tool_bar_help_callback, xg_make_tool_item):
14001 Use EMACS_INTPTR to hold an integer
14002 that will be cast to void *; this can avoid a GCC warning
14003 if EMACS_INT is not the same width as void *.
14004 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14005 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14006 (current_message_1, set_message_1):
14007 Use a local to convert to proper width without a cast.
14008 * xmenu.c (dialog_selection_callback): Likewise.
14009
14010 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14011 Also, don't assume VALBITS / RAND_BITS is less than 5,
14012 and don't rely on undefined behavior when shifting a 1 left into
14013 the sign bit.
14014 * lisp.h (get_random): Change signature to match.
14015
14016 * lread.c (hash_string): Use size_t, not int, for hash computation.
14017 Normally we prefer signed values; but hashing is special, because
14018 it's better to use unsigned division on hash table sizes so that
14019 the remainder is nonnegative. Also, size_t is the natural width
14020 for hashing into memory. The previous code used 'int', which doesn't
14021 retain enough info to hash well into very large tables.
14022 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14023
14024 * dbusbind.c: Don't possibly lose pointer info when converting.
14025 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14026 Use XPNTR rather than XHASH, so that the high-order bits of
14027 the pointer aren't lost when converting through void *.
14028
14029 * eval.c (Fautoload): Don't double-shift a pointer.
14030
14031 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14032
14033 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14034
14035 * gnutls.c (DEF_GNUTLS_FN):
14036 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14037
14038 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14039
14040 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14041 marker. (Bug#8610)
14042
14043 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14044
14045 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14046 New version that can reserve upto 2GB of heap space.
14047
14048 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14049
14050 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14051
14052 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14053
14054 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14055 `gnutls_certificate_set_x509_key_file'.
14056
14057 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14058
14059 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14060 Update dependencies.
14061
14062 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14063
14064 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14065 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14066 Remove unused parameter `fildes'.
14067 * process.c (read_process_output, send_process): Don't pass it.
14068
14069 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14070
14071 Fix previous change: the library cache is defined in w32.c.
14072 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14073 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14074
14075 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14076
14077 Implement dynamic loading of GnuTLS on Windows.
14078
14079 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14080 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14081 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14082 Declare.
14083
14084 * gnutls.c (Qgnutls_dll): Define.
14085 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14086 (gnutls_*): Declare function pointers.
14087 (init_gnutls_functions): New function to initialize function pointers.
14088 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14089 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14090 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14091 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14092 (emacs_gnutls_write, emacs_gnutls_read)
14093 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14094 (Fgnutls_available_p): New function.
14095 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14096 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14097 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14098
14099 * image.c: Include w32.h.
14100 (Vimage_type_cache): Delete.
14101 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14102 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14103 (w32_delayed_load): Move to w32.c.
14104
14105 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14106
14107 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14108 (w32_delayed_load): Move from image.c. When loading a library, record
14109 its filename in the :loaded-from property of the library id.
14110 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14111 Initialize and staticpro them.
14112 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14113
14114 * process.c: Include lisp.h before w32.h, not after.
14115 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14116 instead of gnutls_record_check_pending.
14117
14118 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14119
14120 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14121
14122 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14123 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14124 as passed in.
14125
14126 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14127
14128 * xterm.c (x_set_frame_alpha): Do not set property on anything
14129 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14130
14131 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14132
14133 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14134
14135 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14136
14137 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14138 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14139 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14140 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14141 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14142 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14143 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14144 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14145 (Qgnutls_bootprop_callbacks_verify): Make static.
14146
14147 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14148
14149 * callproc.c: Indentation fixup.
14150
14151 * sysdep.c (wait_for_termination_1): Make static.
14152 (wait_for_termination, interruptible_wait_for_termination):
14153 Move after wait_for_termination_1.
14154
14155 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14156
14157 * sysdep.c (interruptible_wait_for_termination): New function
14158 which is like wait_for_termination, but allows keyboard
14159 interruptions.
14160
14161 * callproc.c (Fcall_process): Add (:file "file") as an option for
14162 the STDOUT buffer.
14163 (Fcall_process_region): Ditto.
14164
14165 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14166
14167 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14168 rather than `XVECTOR (FOO)->size'.
14169
14170 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14171 inttypes.h, as a gnulib replacement is used if it not available in
14172 system headers.
14173
14174 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14175
14176 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14177 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14178 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14179
14180 * coding.c (coding_alloc_by_realloc): Error out if destination
14181 will grow beyond MOST_POSITIVE_FIXNUM.
14182 (decode_coding_emacs_mule): Abort if there isn't enough place in
14183 charbuf for the composition carryover bytes. Reserve an extra
14184 space for up to 2 characters produced in a loop.
14185 (decode_coding_iso_2022): Abort if there isn't enough place in
14186 charbuf for the composition carryover bytes.
14187
14188 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14189
14190 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14191 aborting when %lld or %lll format is passed.
14192 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14193 %llo or %llx format is passed. (Bug#8545)
14194
14195 * window.c (window_scroll_line_based): Use a marker instead of
14196 simple variables to record original value of point. (Bug#7952)
14197
14198 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14199 produced by %s or %c overflows available buffer space. (Bug#8545)
14200
14201 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14202
14203 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14204 (SIZE_MAX): Move defn after all includes, as they might #define it.
14205
14206 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14207
14208 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14209
14210 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14211
14212 * keyboard.c (Qdelayed_warnings_hook): Define.
14213 (command_loop_1): Run `delayed-warnings-hook'
14214 if Vdelayed_warnings_list is non-nil.
14215 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14216 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14217
14218 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14219
14220 * doprnt.c (doprnt): Don't return value smaller than the buffer
14221 size if the message was truncated. (Bug#8545).
14222
14223 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14224
14225 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14226 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14227
14228 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14229
14230 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14231
14232 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14233
14234 * makefile.w32-in: Update dependencies.
14235
14236 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14237
14238 Improve `doprnt' and its usage. (Bug#8545)
14239 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14240 `format_end'. Remove support for %l as a conversion specifier.
14241 Don't use xrealloc. Improve diagnostics when the %l size modifier
14242 is used. Update the commentary.
14243
14244 * eval.c (verror): Simplify calculation of size_t.
14245
14246 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14247 messages.
14248
14249 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14250
14251 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14252 change.
14253
14254 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14255
14256 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14257 This makes this file independent of the recent pseudovector change.
14258
14259 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14260
14261 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14262
14263 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14264 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14265 Remove unused local.
14266 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14267
14268 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14269 GCC 4.6.0 optimizes based on type-based alias analysis.
14270 For example, if b is of type struct buffer * and v of type struct
14271 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14272 != &v->size, and therefore "v->size = 1; b->size = 2; return
14273 v->size;" must therefore return 1. This assumption is incorrect
14274 for Emacs, since it type-puns struct Lisp_Vector * with many other
14275 types. To fix this problem, this patch adds a new type struct
14276 vectorlike_header that documents the constraints on layout of vectors
14277 and pseudovectors, and helps optimizing compilers not get fooled
14278 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14279 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14280 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14281 the size member.
14282 (XSETPVECTYPE): Rewrite in terms of new macro.
14283 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14284 This is a bit clearer, and further avoids the possibility of
14285 undesirable aliasing.
14286 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14287 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14288 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14289 since Lisp_Subr is a special case (no "next" field).
14290 (ASIZE): Now uses header.size rather than size.
14291 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14292 to avoid the hassle of writing XVECTOR (foo)->header.size.
14293 (struct vectorlike_header): New type.
14294 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14295 object, to help avoid aliasing.
14296 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14297 (SUBRP): Likewise, since Lisp_Subr is a special case.
14298 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14299 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14300 (struct Lisp_Hash_Table): Combine first two members into a single
14301 struct vectorlike_header member. All uses of "size" and "next" members
14302 changed to be "header.size" and "header.next".
14303 * buffer.h (struct buffer): Likewise.
14304 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14305 * frame.h (struct frame): Likewise.
14306 * process.h (struct Lisp_Process): Likewise.
14307 * termhooks.h (struct terminal): Likewise.
14308 * window.c (struct save_window_data, struct saved_window): Likewise.
14309 * window.h (struct window): Likewise.
14310 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14311 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14312 * buffer.c (init_buffer_once): Likewise.
14313 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14314 special case.
14315 * process.c (Fformat_network_address): Use local var for size,
14316 for brevity.
14317
14318 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14319
14320 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14321 * data.c (atof): Remove decl; no longer used or needed.
14322 (digit_to_number): Move to lread.c.
14323 (Fstring_to_number): Use new string_to_number function, to be
14324 consistent with how the Lisp reader treats infinities and NaNs.
14325 Do not assume that floating-point numbers represent EMACS_INT
14326 without losing information; this is not true on most 64-bit hosts.
14327 Avoid double-rounding errors, by insisting on integers when
14328 parsing non-base-10 numbers, as the documentation specifies.
14329 * lisp.h (string_to_number): New decl, replacing ...
14330 (isfloat_string): Remove.
14331 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14332 (read1): Do not accept +. and -. as integers; this
14333 appears to have been a coding error. Similarly, do not accept
14334 strings like +-1e0 as floating point numbers. Do not report
14335 overflow for integer overflows unless the base is not 10 which
14336 means we have no simple and reliable way to continue.
14337 Break out the floating-point parsing into a new
14338 function string_to_number, so that Fstring_to_number parses
14339 floating point numbers consistently with the Lisp reader.
14340 (digit_to_number): Move here from data.c. Make it static inline.
14341 (E_CHAR, EXP_INT): Remove, replacing with ...
14342 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14343 (string_to_number): New function, replacing isfloat_string.
14344 This function checks for valid syntax and produces the resulting
14345 Lisp float number too. Rework it so that string-to-number
14346 no longer mishandles examples like "1.0e+". Use strtoumax,
14347 so that overflow for non-base-10 numbers is reported only when
14348 there's no portable and simple way to convert to floating point.
14349
14350 * textprop.c (set_text_properties_1): Rewrite for clarity,
14351 and to avoid GCC warning about integer overflow.
14352
14353 * intervals.h (struct interval): Use EMACS_INT for members
14354 where EMACS_UINT might cause problems. See
14355 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14356 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14357 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14358 All uses changed.
14359 (offset_intervals): Tell GCC not to worry about length overflow
14360 when negating a negative length.
14361
14362 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14363 (overrun_check_free): Likewise.
14364
14365 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14366 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14367 word size.
14368
14369 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14370 (gnutls_make_error): Rename local to avoid shadowing.
14371 (gnutls_emacs_global_deinit): ifdef out; not used.
14372 (Fgnutls_boot): Use const for pointer to readonly storage.
14373 Comment out unused local. Fix pointer signedness problems.
14374
14375 * lread.c (openp): Don't stuff size_t into an 'int'.
14376 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14377 about possible signed overflow.
14378
14379 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14380 (GDK_KEY_g): Don't define if already defined.
14381 (xg_prepare_tooltip): Avoid pointer signedness problem.
14382 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14383
14384 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14385 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14386
14387 * xfns.c (Fx_window_property): Simplify a bit,
14388 to make a bit faster and to avoid GCC 4.6.0 warning.
14389 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14390
14391 * fns.c (internal_equal): Don't assume size_t fits in int.
14392
14393 * alloc.c (compact_small_strings): Tighten assertion a little.
14394
14395 Replace pEd with more-general pI, and fix some printf arg casts.
14396 * lisp.h (pI): New macro, generalizing old pEd macro to other
14397 conversion specifiers. For example, use "...%"pI"d..." rather
14398 than "...%"pEd"...".
14399 (pEd): Remove. All uses replaced with similar uses of pI.
14400 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14401 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14402 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14403 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14404 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14405 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14406 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14407 64-bit hosts.
14408 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14409 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14410 * print.c (safe_debug_print, print_object): Likewise.
14411 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14412 to int.
14413 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14414 avoiding the 0 flag, which is not portable.
14415 * process.c (Fmake_network_process): Use pI to avoid cast.
14416 * region-cache.c (pp_cache): Likewise.
14417 * xdisp.c (decode_mode_spec): Likewise.
14418 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14419 behavior on 64-bit hosts with printf arg.
14420 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14421 (x_stop_queuing_selection_requests): Likewise.
14422 (x_get_window_property): Don't truncate byte count to an 'int'
14423 when tracing.
14424
14425 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14426 here, since it parses constructs like leading '-' and spaces,
14427 which are not wanted; and it overflows with large numbers.
14428 Instead, simply match F[0-9]+, which is what is wanted anyway.
14429
14430 * alloc.c: Remove unportable assumptions about struct layout.
14431 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14432 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14433 (allocate_vectorlike, make_pure_vector): Use the new macros,
14434 plus offsetof, to remove unportable assumptions about struct layout.
14435 These assumptions hold on all porting targets that I know of, but
14436 they are not guaranteed, they're easy to remove, and removing them
14437 makes further changes easier.
14438
14439 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14440 This doesn't fix a bug but makes the code clearer.
14441 (string_overrun_cookie): Now const. Use initializers that
14442 don't formally overflow signed char, to avoid warnings.
14443 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14444 can cause Emacs to crash when string overrun checking is enabled.
14445 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14446 multiple of sizeof (EMACS_INT); it need not be, if
14447 alignof(EMACS_INT) < sizeof (EMACS_INT).
14448 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14449
14450 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14451
14452 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14453
14454 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14455
14456 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14457 supposed to be handshaking. (Bug#8556)
14458 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14459
14460 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14461
14462 * lisp.h (Qdebug): List symbol.
14463 * eval.c (Qdebug): Restore global linkage.
14464 * keyboard.c (debug-on-event): New variable.
14465 (handle_user_signal): Break into debugger when debug-on-event
14466 matches the current signal symbol.
14467
14468 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14469
14470 * alloc.c (check_sblock, check_string_bytes)
14471 (check_string_free_list): Convert to standard C.
14472
14473 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14474
14475 * w32.c (emacs_gnutls_push): Fix typo.
14476
14477 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14478
14479 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14480 "cast to pointer from integer of different size".
14481
14482 Improve doprnt and its use in verror. (Bug#8545)
14483 * doprnt.c (doprnt): Document the set of format control sequences
14484 supported by the function. Use SAFE_ALLOCA instead of always
14485 using `alloca'.
14486
14487 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14488 is one byte too soon. Don't use xrealloc; instead xfree and
14489 xmalloc anew.
14490
14491 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14492
14493 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14494 callbacks stage.
14495
14496 * gnutls.c: Renamed global_initialized to
14497 gnutls_global_initialized. Added internals for the
14498 :verify-hostname-error, :verify-error, and :verify-flags
14499 parameters of `gnutls-boot' and documented those parameters in the
14500 docstring. Start callback support.
14501 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14502 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14503 on error. Return error code.
14504 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14505 (emacs_gnutls_read): Likewise.
14506 (Fgnutls_boot): Return handshake error code.
14507 (emacs_gnutls_handle_error): New function.
14508 (wsaerror_to_errno): Likewise.
14509
14510 * w32.h (emacs_gnutls_pull): Add prototype.
14511 (emacs_gnutls_push): Likewise.
14512
14513 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14514 (emacs_gnutls_push): Likewise.
14515
14516 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14517
14518 * process.c (wait_reading_process_output): Check if GnuTLS
14519 buffered some data internally if no FDs are set for TLS
14520 connections.
14521
14522 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14523 (LIBS): Link to USER_LIBS.
14524 ($(BLD)/gnutls.$(0)): New target.
14525
14526 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14527
14528 * xdisp.c (handle_single_display_spec): Rename the
14529 display_replaced_before_p argument into display_replaced_p, to
14530 make it consistent with the commentary. Fix typos in the
14531 commentary.
14532
14533 * textprop.c (syms_of_textprop): Remove dead code.
14534 (copy_text_properties): Delete obsolete commentary about an
14535 interface that was deleted long ago. Fix typos in the description
14536 of arguments.
14537
14538 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14539 to changes in oldXMenu/XMenu.h from 2011-04-16.
14540 <menu_help_message, prev_menu_help_message>: Constify.
14541 (IT_menu_make_room): menu->help_text is now `const char **';
14542 adjust.
14543
14544 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14545 to changes in oldXMenu/XMenu.h from 2011-04-16.
14546 (struct XMenu): Declare `help_text' `const char **'.
14547
14548 * xfaces.c <Qunspecified>: Make extern again.
14549
14550 * syntax.c: Include sys/types.h before including regex.h, as
14551 required by POSIX.
14552
14553 * doc.c (get_doc_string): Improve the format passed to `error'.
14554
14555 * doprnt.c (doprnt): Improve commentary.
14556
14557 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14558
14559 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14560 them with etags.
14561
14562 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14563 changes in globals.h immediately force recompilation.
14564 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14565 $(CURDIR)/s/ms-w32.h.
14566 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
14567
14568 * character.c (Fchar_direction): Function deleted.
14569 (syms_of_character): Don't defsubr it.
14570 <char-direction-table>: Deleted.
14571
14572 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14573
14574 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14575 * doprnt.c: Include limits.h.
14576 (SIZE_MAX): New macro.
14577 (doprnt): Return a size_t value. 2nd arg is now size_t.
14578 Many local variables are now size_t instead of int or unsigned.
14579 Improve overflow protection. Support `l' modifier for integer
14580 conversions. Support %l conversion. Don't assume an EMACS_INT
14581 argument for integer conversions and for %c.
14582
14583 * lisp.h (doprnt): Restore prototype.
14584
14585 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14586 $(SRC)/character.h.
14587
14588 * Makefile.in (base_obj): Add back doprnt.o.
14589
14590 * deps.mk (doprnt.o): Add back prerequisites.
14591 (callint.o): Depend on character.h.
14592
14593 * eval.c (internal_lisp_condition_case): Include the handler
14594 representation in the error message.
14595 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
14596 when breaking from the loop.
14597
14598 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14599
14600 * callint.c (Fcall_interactively): When displaying error message
14601 about invalid control letter, pass the character's codepoint, not
14602 a pointer to its multibyte form. Improve display of the character
14603 in octal and display also its hex code.
14604
14605 * character.c (char_string): Use %x to display the (unsigned)
14606 codepoint of an invalid character, to avoid displaying a bogus
14607 negative value.
14608
14609 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14610 `error', not SYMBOL_NAME itself.
14611
14612 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14613 character arguments to `error'.
14614
14615 * charset.c (check_iso_charset_parameter): Fix incorrect argument
14616 to `error' in error message about FINAL_CHAR argument. Make sure
14617 FINAL_CHAR is a character, and use %c when it is passed as
14618 argument to `error'.
14619
14620 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14621
14622 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14623
14624 * w32.c: Include <time.h>.
14625 (sys_localtime): New function.
14626
14627 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
14628
14629 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14630
14631 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
14632
14633 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
14634
14635 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14636 zombies (Bug#8467).
14637
14638 2011-04-19 Eli Zaretskii <eliz@gnu.org>
14639
14640 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14641 gl_state.e_property when gl_state.object is Qt.
14642
14643 * insdel.c (make_gap_larger): Remove limitation of buffer size
14644 to <= INT_MAX.
14645
14646 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
14647
14648 * xdisp.c (lookup_glyphless_char_display)
14649 (produce_glyphless_glyph): Handle cons cell entry in
14650 glyphless-char-display.
14651 (Vglyphless_char_display): Document it.
14652
14653 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14654 glyphless-char-display.
14655
14656 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
14657
14658 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14659
14660 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14661
14662 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14663 definition for no-X builds.
14664
14665 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
14666
14667 Static checks with GCC 4.6.0 and non-default toolkits.
14668
14669 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14670
14671 * process.c (keyboard_bit_set): Define only if SIGIO.
14672 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14673 (send_process): Repair possible setjmp clobbering.
14674
14675 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14676
14677 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14678
14679 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14680
14681 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14682 Define only if needed.
14683
14684 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14685 by pacifying GCC about it. Maybe it's time to retire it?
14686 * xfaces.c (USG, __TIMEVAL__): Likewise.
14687
14688 * dispextern.h (struct redisplay_interface): Rename param
14689 to avoid shadowing.
14690 * termhooks.h (struct terminal): Likewise.
14691 * xterm.c (xembed_send_message): Likewise.
14692
14693 * insdel.c (make_gap_smaller): Define only if
14694 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14695
14696 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14697 it.
14698
14699 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14700 so that we aren't warned about unused symbols.
14701
14702 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14703
14704 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
14705
14706 * xfns.c (x_real_positions): Mark locals as initialized.
14707
14708 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14709
14710 * xterm.c: Fix problems found by static analysis with other toolkits.
14711 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
14712 (x_dispatch_event): Declare static if USE_GTK, and
14713 define if USE_GTK || USE_X_TOOLKIT.
14714 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
14715 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
14716 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14717 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
14718
14719 * xmenu.c (menu_help_callback): Pointer type fixes.
14720 Use const pointers when pointing at readonly data. Avoid pointer
14721 signedness clashes.
14722 (FALSE): Remove unused macro.
14723 (update_frame_menubar): Remove unused decl.
14724
14725 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14726
14727 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14728 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14729 (single_menu_item): Rename local to avoid shadowing.
14730
14731 * keyboard.c (make_lispy_event): Remove unused local var.
14732
14733 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14734 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14735
14736 * bitmaps: Change bitmaps from unsigned char back to the X11
14737 compatible char. Avoid the old compiler warnings about
14738 out-of-range initializers by using, for example, '\xab' rather
14739 than 0xab.
14740
14741 * xgselect.c (xgselect_initialize): Check vs interface
14742 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14743
14744 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14745
14746 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14747 to read-only memory.
14748
14749 * fns.c (vector): Remove; this old hack is no longer needed.
14750
14751 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
14752 Remove unused var.
14753 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
14754
14755 * xrdb.c (x_load_resources): Omit unused local.
14756
14757 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
14758 (x_window): Rename locals to avoid shadowing.
14759 (USG): Use the kludged USG macro, to pacify gcc.
14760
14761 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
14762 (x_term_init): Remove local to avoid shadowing.
14763
14764 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
14765
14766 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14767 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14768
14769 2011-04-16 Eli Zaretskii <eliz@gnu.org>
14770
14771 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14772
14773 Fix regex.c, syntax.c and friends for buffers > 2GB.
14774 * syntax.h (struct gl_state_s): Declare character position members
14775 EMACS_INT.
14776
14777 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14778
14779 * textprop.c (verify_interval_modification, interval_of):
14780 Declare arguments EMACS_INT.
14781
14782 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14783 EMACS_INT.
14784
14785 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14786
14787 * indent.c (Fvertical_motion): Local variable it_start is now
14788 EMACS_INT.
14789
14790 * regex.c (re_match, re_match_2, re_match_2_internal)
14791 (bcmp_translate, regcomp, regexec, print_double_string)
14792 (group_in_compile_stack, re_search, re_search_2, regex_compile)
14793 (re_compile_pattern, re_exec): Declare arguments and local
14794 variables `size_t' and `ssize_t' and return values `regoff_t', as
14795 appropriate.
14796 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14797 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14798 <compile_stack_type>: `size' and `avail' are now `size_t'.
14799
14800 * regex.h <regoff_t>: Use ssize_t, not int.
14801 (re_search, re_search_2, re_match, re_match_2): Arguments that
14802 specify buffer/string position and length are now ssize_t and
14803 size_t. Return type is regoff_t.
14804
14805 2011-04-16 Ben Key <bkey76@gmail.com>
14806
14807 * nsfont.m: Fixed bugs in ns_get_family and
14808 ns_descriptor_to_entity that were caused by using free to
14809 deallocate memory blocks that were allocated by xmalloc (via
14810 xstrdup). This caused Emacs to crash when compiled with
14811 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14812 --enable-checking=xmallocoverrun). xfree is now used to
14813 deallocate these memory blocks.
14814
14815 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
14816
14817 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14818
14819 emacs_write: Accept and return EMACS_INT for sizes.
14820 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14821 et seq.
14822 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14823 Accept and return EMACS_INT.
14824 (emacs_gnutls_write): Return the number of bytes written on
14825 partial writes.
14826 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
14827 (emacs_read, emacs_write): Remove check for negative size, as the
14828 Emacs source code has been audited now.
14829 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14830 (emacs_read, emacs_write): Use it.
14831 * process.c (send_process): Adjust to the new signatures of
14832 emacs_write and emacs_gnutls_write. Do not attempt to store
14833 a byte offset into an 'int'; it might overflow.
14834 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
14835
14836 * sound.c: Don't assume sizes fit in 'int'.
14837 (struct sound_device.period_size, alsa_period_size):
14838 Return EMACS_INT, not int.
14839 (struct sound_device.write, vox_write, alsa_write):
14840 Accept EMACS_INT, not int.
14841 (wav_play, au_play): Use EMACS_INT to store sizes and to
14842 record read return values.
14843
14844 2011-04-15 Ben Key <bkey76@gmail.com>
14845
14846 * keyboard.c (Qundefined): Don't declare static since it is used
14847 in nsfns.m.
14848 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14849 static since they are used in nsfont.m.
14850
14851 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14852
14853 * process.c (Qprocessp): Don't declare static.
14854 * lisp.h (Qprocessp): Declare again.
14855
14856 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
14857
14858 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14859
14860 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14861
14862 Improve C-level modularity by making more things 'static'.
14863
14864 Don't publish debugger-only interfaces to other modules.
14865 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14866 (verify_bytepos, count_markers): Move decls to the only modules
14867 that need them.
14868 * region-cache.h (pp_cache): Likewise.
14869 * window.h (check_all_windows): Likewise.
14870 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14871
14872 * sysdep.c (croak): Now static, if
14873 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14874 * syssignal.h (croak): Declare only if not static.
14875
14876 * alloc.c (refill_memory_reserve): Now static if
14877 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14878 * lisp.h (refill_memory_reserve): Declare only if not static.
14879
14880 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14881 Define only if USE_LUCID.
14882
14883 * xrdb.c (x_customization_string, x_rm_string): Now static.
14884
14885 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14886 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14887
14888 * xdisp.c (draw_row_with_mouse_face): Now static.
14889 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14890
14891 * window.h (check_all_windows): Mark externally visible.
14892
14893 * window.c (window_deletion_count): Now static.
14894
14895 * undo.c: Make symbols static if they're not exported.
14896 (last_undo_buffer, last_boundary_position, pending_boundary):
14897 Now static.
14898
14899 * textprop.c (interval_insert_behind_hooks): Now static.
14900 (interval_insert_in_front_hooks): Likewise.
14901
14902 * term.c: Make symbols static if they're not exported.
14903 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14904 (max_frame_lines, tty_set_terminal_modes):
14905 (tty_reset_terminal_modes, tty_turn_off_highlight):
14906 (get_tty_terminal): Now static.
14907 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14908 * termhooks.h (term_mouse_moveto): Do not declare if
14909 HAVE_WINDOW_SYSTEM.
14910 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14911 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14912
14913 * sysdep.c: Make symbols static if they're not exported.
14914 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14915 Now static.
14916 (sigprocmask_set, full_mask): Remove; unused.
14917 (wait_debugging): Mark as visible.
14918 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14919 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14920
14921 * syntax.c (syntax_temp): Define only if !__GNUC__.
14922
14923 * sound.c (current_sound_device, current_sound): Now static.
14924
14925 * search.c (searchbufs, searchbuf_head): Now static.
14926
14927 * scroll.c (scroll_cost): Remove; unused.
14928 * dispextern.h (scroll_cost): Remove decl.
14929
14930 * region-cache.h (pp_cache): Mark as externally visible.
14931
14932 * process.c: Make symbols static if they're not exported.
14933 (process_tick, update_tick, create_process, chan_process):
14934 (Vprocess_alist, proc_buffered_char, datagram_access):
14935 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14936 (deactivate_process): Mark defn as static, as well as decl.
14937 * lisp.h (create_process): Remove decl.
14938 * process.h (chan_process, Vprocess_alist): Remove decls.
14939
14940 * print.c: Make symbols static if they're not exported.
14941 (print_depth, new_backquote_output, being_printed, print_buffer):
14942 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14943 (print_interval, print_number_index, initial_stderr_stream):
14944 Now static.
14945 * lisp.h (Fprinc): Remove decl.
14946 (debug_output_compilation_hack): Mark as externally visible.
14947
14948 * sysdep.c (croak): Move decl from here to syssignal.h.
14949 * syssignal.h (croak): Put it here, so the API can be checked when
14950 'croak' is called from dissociate_if_controlling_tty.
14951
14952 * minibuf.c: Make symbols static if they're not exported.
14953 (minibuf_save_list, choose_minibuf_frame): Now static.
14954 * lisp.h (choose_minibuf_frame): Remove decl.
14955
14956 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14957
14958 * lread.c: Make symbols static if they're not exported.
14959 (read_objects, initial_obarray, oblookup_last_bucket_number):
14960 Now static.
14961 (make_symbol): Remove; unused.
14962 * lisp.h (initial_obarray, make_symbol): Remove decls.
14963
14964 * keyboard.c: Make symbols static if they're not exported.
14965 (single_kboard, recent_keys_index, total_keys, recent_keys):
14966 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14967 (this_single_command_key_start, echoing, last_auto_save):
14968 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14969 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14970 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14971 (Vlispy_mouse_stem, double_click_count):
14972 Now static.
14973 (force_auto_save_soon): Define only if SIGDANGER.
14974 (ignore_mouse_drag_p): Now static if
14975 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14976 (print_help): Remove; unused.
14977 (stop_character, last_timer_event): Mark as externally visible.
14978 * keyboard.h (ignore_mouse_drag_p): Declare only if
14979 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14980 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14981 * lisp.h (echoing): Remove decl.
14982 (force_auto_save_soon): Declare only if SIGDANGER.
14983 * xdisp.c (redisplay_window): Simplify code, to make it more
14984 obvious that ignore_mouse_drag_p is not accessed if !defined
14985 USE_GTK && !defined HAVE_NS.
14986
14987 * intervals.c: Make symbols static if they're not exported.
14988 (merge_properties_sticky, merge_interval_right, delete_interval):
14989 Now static.
14990 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14991
14992 * insdel.c: Make symbols static if they're not exported.
14993 However, leave prepare_to_modify_buffer alone. It's never
14994 called from outside this function, but that appears to be a bug.
14995 (combine_after_change_list, combine_after_change_buffer):
14996 (adjust_after_replace, signal_before_change): Now static.
14997 (adjust_after_replace_noundo): Remove; unused.
14998 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
14999 (signal_before_change): Remove decls.
15000
15001 * indent.c (val_compute_motion, val_vmotion): Now static.
15002
15003 * image.c: Make symbols static if they're not exported.
15004 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15005 if USE_GTK.
15006 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15007 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15008
15009 * fringe.c (standard_bitmaps): Now static.
15010 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15011
15012 * frame.c: Make symbols static if they're not exported.
15013 (x_report_frame_params, make_terminal_frame): Now static.
15014 (get_frame_param): Now static, unless HAVE_NS.
15015 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15016 (x_get_resource_string): Remove; not used.
15017 * frame.h (make_terminal_frame, x_report_frame_params):
15018 (x_get_resource_string); Remove decls.
15019 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15020 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15021
15022 * font.c, fontset.c: Make symbols static if they're not exported.
15023 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15024 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15025 * font.c (font_close_object): Now static.
15026 * font.h (font_close_object): Remove.
15027 * fontset.c (FONTSET_OBJLIST): Remove.
15028 (free_realized_fontset) #if-0 the body, which does nothing.
15029 (face_suitable_for_char_p): #if-0, as it's never called.
15030 * fontset.h (face_suitable_for_char_p): Remove decl.
15031 * xfaces.c (face_at_string_position):
15032 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15033 since 0 is always ASCII.
15034
15035 * fns.c (weak_hash_tables): Now static.
15036
15037 * fileio.c: Make symbols static if they're not exported.
15038 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15039 (Vwrite_region_annotation_buffers): Now static.
15040
15041 * eval.c: Make symbols static if they're not exported.
15042 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15043 * lisp.h (backtrace_list): Remove decl.
15044
15045 * emacs.c: Make symbols static if they're not exported.
15046 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15047 (fatal_error_code, fatal_error_signal_hook, standard_args):
15048 Now static.
15049 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15050 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15051 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15052 * lisp.h (fatal_error_signal_hook): Remove decl.
15053 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15054
15055 * editfns.c: Move a (normally-unused) function to its only use.
15056 * editfns.c, lisp.h (get_operating_system_release): Remove.
15057 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15058 worth the hassle of breaking this out.
15059
15060 * xterm.c: Make symbols static if they're not exported.
15061 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15062 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15063 (x_destroy_window, x_delete_display):
15064 Now static.
15065 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15066 (x_mouse_leave): Remove; unused.
15067 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15068 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15069 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15070 Remove decls.
15071 (x_mouse_leave): Declare only if WINDOWSNT.
15072 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15073 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15074 USE_X_TOOLKIT.
15075
15076 * ftxfont.c: Make symbols static if they're not exported.
15077 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15078 HAVE_FREETYPE.
15079 * font.h (ftxfont_driver): Likewise.
15080
15081 * xfns.c: Make symbols static if they're not exported.
15082 (x_last_font_name, x_display_info_for_name):
15083 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15084 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15085 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15086 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15087 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15088 (last_show_tip_args): Now static.
15089 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15090 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15091 (x_screen_planes): Remove; unused.
15092 * dispextern.h (x_screen_planes): Remove decl.
15093
15094 * dispnew.c: Make symbols static if they're not exported.
15095 * dispextern.h (redraw_garbaged_frames, scrolling):
15096 (increment_row_positions): Remove.
15097 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15098 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15099 Now static.
15100 (redraw_garbaged_frames): Remove; unused.
15101
15102 * xfaces.c: Make symbols static if they're not exported.
15103 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15104 Remove decls.
15105 * xterm.h (defined_color): Remove decls.
15106 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15107 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15108 (menu_face_changed_default, defined_color, free_realized_face):
15109 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15110 (ascii_face_of_lisp_face): Remove; unused.
15111
15112 * xdisp.c: Make symbols static if they're not exported.
15113 * dispextern.h (scratch_glyph_row, window_box_edges):
15114 (glyph_to_pixel_coords, set_cursor_from_row):
15115 (get_next_display_element, set_iterator_to_next):
15116 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15117 (show_mouse_face): Remove decls
15118 * frame.h (message_buf_print): Likewise.
15119 * lisp.h (pop_message, set_message, check_point_in_composition):
15120 Likewise.
15121 * xterm.h (set_vertical_scroll_bar): Likewise.
15122 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15123 (message_buf_print, scratch_glyph_row, displayed_buffer):
15124 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15125 (get_next_display_element, show_mouse_face, window_box_edges):
15126 (frame_to_window_pixel_xy, check_point_in_composition):
15127 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15128 (glyph_to_pixel_coords): Remove; unused.
15129
15130 * dired.c (file_name_completion): Now static.
15131
15132 * dbusbind.c (xd_in_read_queued_messages): Now static.
15133
15134 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15135 * data.c (circular_list_error): Remove.
15136
15137 * commands.h (last_point_position, last_point_position_buffer):
15138 (last_point_position_window): Remove decls.
15139 * keyboard.c: Make these variables static.
15140
15141 * coding.h (coding, code_convert_region, encode_coding_gap):
15142 Remove decls.
15143 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15144 (iso_code_class, detect_coding, code_convert_region): Now static.
15145 (encode_coding_gap): Remove; unused.
15146
15147 * chartab.c (chartab_chars, chartab_bits): Now static.
15148
15149 * charset.h (charset_iso_8859_1): Remove decl.
15150 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15151 Now static.
15152
15153 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15154 * ccl.c (Vccl_program_table): Now static.
15155 (check_ccl_update): Remove; unused.
15156
15157 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15158 * category.h: ... from here.
15159 * category.c (check_category_table, set_category_set): Now static.
15160
15161 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15162 * lisp.h: Remove these decls.
15163
15164 * buffer.c (buffer_count): Remove unused var.
15165
15166 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15167 so that it's not optimized away.
15168 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15169 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15170 exported only to the debugger.
15171
15172 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15173 * atimer.h (run_all_atimers): Remove; not exported.
15174
15175 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15176 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15177 was inaccessible from Lisp.
15178 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15179 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15180
15181 alloc.c: Import and export fewer symbols, and remove unused items.
15182 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15183 is defined.
15184 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15185 it's not optimized away by whole-program optimization.
15186 (message_enable_multibyte, free_misc): Remove.
15187 (catchlist, handlerlist, mark_backtrace):
15188 Declare only if BYTE_MARK_STACK.
15189 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15190 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15191 (message_enable_multibyte): Remove decl.
15192 (free_misc, interval_free_list, float_block, float_block_index):
15193 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15194 (cons_free_list, last_marked_index):
15195 Now static.
15196 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15197 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15198 (mark_backtrace): Define only if BYTE_MARK_STACK.
15199 * xdisp.c (message_enable_multibyte): Now static.
15200
15201 Declare Lisp_Object Q* variables to be 'static' if not exported.
15202 This makes it easier for human readers (and static analyzers)
15203 to see whether these variables are used from other modules.
15204 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15205 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15206 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15207 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15208 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15209 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15210 * xmenu.c, xselect.c:
15211 Declare Q* vars static if they are not used in other modules.
15212 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15213 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15214 Remove decls of unexported vars.
15215 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15216
15217 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15218
15219 Make Emacs functions such as Fatom 'static' by default.
15220 This makes it easier for human readers (and static analyzers)
15221 to see whether these functions can be called from other modules.
15222 DEFUN now defines a static function. To make the function external
15223 so that it can be used in other C modules, use the new macro DEFUE.
15224 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15225 (Finit_image_library):
15226 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15227 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15228 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15229 Remove decls, since these functions are now static.
15230 (Funintern, Fget_internal_run_time): New decls, since these functions
15231 were already external.
15232
15233 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15234 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15235 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15236 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15237 * keyboard.c, keymap.c, lread.c:
15238 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15239 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15240 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15241 Mark functions with DEFUE instead of DEFUN,
15242 if they are used in other modules.
15243 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15244 decls for now-static functions.
15245 * buffer.h (Fdelete_overlay): Remove decl.
15246 * callproc.c (Fgetenv_internal): Mark as internal.
15247 * composite.c (Fremove_list_of_text_properties): Remove decl.
15248 (Fcomposition_get_gstring): New forward static decl.
15249 * composite.h (Fcomposite_get_gstring): Remove decl.
15250 * dired.c (Ffile_attributes): New forward static decl.
15251 * doc.c (Fdocumntation_property): New forward static decl.
15252 * eval.c (Ffetch_bytecode): New forward static decl.
15253 (Funintern): Remove extern decl; now in .h file where it belongs.
15254 * fileio.c (Fmake_symbolic_link): New forward static decl.
15255 * image.c (Finit_image_library): New forward static decl.
15256 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15257 * intervals.h (Fprevious_property_change):
15258 (Fremove_list_of_text_properties): Remove decls.
15259 * keyboard.c (Fthis_command_keys): Remove decl.
15260 (Fcommand_execute): New forward static decl.
15261 * keymap.c (Flookup_key): New forward static decl.
15262 (Fcopy_keymap): Now static.
15263 * keymap.h (Flookup_key): Remove decl.
15264 * process.c (Fget_process): New forward static decl.
15265 (Fprocess_datagram_address): Mark as internal.
15266 * syntax.c (Fsyntax_table_p): New forward static decl.
15267 (skip_chars): Remove duplicate decl.
15268 * textprop.c (Fprevious_property_change): New forward static decl.
15269 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15270 Now internal.
15271 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15272 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15273
15274 * editfns.c (Fformat): Remove unreachable code.
15275
15276 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15277
15278 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15279 change. (Bug#8496)
15280
15281 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15282
15283 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15284 when at ZV. (Bug#8487)
15285
15286 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15287
15288 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15289 (Bug#8437)
15290 * keyboard.c (parse_tool_bar_item): Likewise.
15291 * sound.c (sound_cleanup, alsa_close): Likewise.
15292 * termcap.c (tgetent): Likewise.
15293 * xfns.c (x_default_font_parameter): Likewise.
15294 * xsettings.c (read_and_apply_settings): Likewise.
15295
15296 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15297 (overrun_check_free): Protoize.
15298
15299 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15300
15301 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15302 since callers should never pass a negative size.
15303 Change the signature to match that of plain 'read' and 'write'; see
15304 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15305 * lisp.h: Update prototypes of emacs_write and emacs_read.
15306
15307 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15308
15309 * xdisp.c (redisplay_window): Don't try to determine the character
15310 position of the scroll margin if the window start point w->startp
15311 is outside the buffer's accessible region. (Bug#8468)
15312
15313 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15314
15315 Fix write-region and its subroutines for buffers > 2GB.
15316 * fileio.c (a_write, e_write): Modify declaration of arguments and
15317 local variables to support buffers larger than 2GB.
15318 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15319
15320 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15321 argument, local variables, and return value.
15322
15323 * lisp.h: Update prototypes of emacs_write and emacs_read.
15324
15325 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15326
15327 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15328
15329 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15330
15331 Fix more problems found by GCC 4.6.0's static checks.
15332
15333 * xdisp.c (vmessage): Use a better test for character truncation.
15334
15335 * charset.c (load_charset_map): <, not <=, for optimization,
15336 and to avoid potential problems with integer overflow.
15337 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15338 * casetab.c (set_identity, shuffle): Likewise.
15339 * editfns.c (Fformat): Likewise.
15340 * syntax.c (skip_chars): Likewise.
15341
15342 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15343 This also lets GCC 4.6.0 generate slightly better loop code.
15344
15345 * callint.c (Fcall_interactively): <, not <=, for optimization.
15346 (Fcall_interactively): Count the number of arguments produced,
15347 not the number of arguments given. This is simpler and lets GCC
15348 4.6.0 generate slightly better code.
15349
15350 * ftfont.c: Distingish more carefully between FcChar8 and char.
15351 The previous code passed unsigned char * to a functions like
15352 strlen and xstrcasecmp that expect char *, which does not
15353 conform to the C standard.
15354 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15355 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15356 char * when the C standard requires it.
15357
15358 * keyboard.c (read_char): Remove unused var.
15359
15360 * eval.c: Port to Windows vsnprintf (Bug#8435).
15361 Include <limits.h>.
15362 (SIZE_MAX): Define if the headers do not.
15363 (verror): Do not give up if vsnprintf returns a negative count.
15364 Instead, grow the buffer. This ports to Windows vsnprintf, which
15365 does not conform to C99. Problem reported by Eli Zaretskii.
15366 Also, simplify the allocation scheme, by avoiding the need for
15367 calling realloc, and removing the ALLOCATED variable.
15368
15369 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15370
15371 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15372 But keep the doprint source code for now, as we might revamp it
15373 and use it again (Bug#8435).
15374 * lisp.h (doprnt): Remove.
15375 * Makefile.in (base_obj): Remove doprnt.o.
15376 * deps.mk (doprnt.o): Remove.
15377
15378 error: Print 32- and 64-bit integers portably (Bug#8435).
15379 Without this change, on typical 64-bit hosts error ("...%d...", N)
15380 was used to print both 32- and 64-bit integers N, which relied on
15381 undefined behavior.
15382 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15383 * lisp.h (error, verror): Mark as printf-like functions.
15384 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15385 Report overflow in size calculations when allocating printf buffer.
15386 Do not truncate output string at its first null byte.
15387 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15388 Truncate the output at a character boundary, since vsnprintf does not
15389 do that.
15390 * charset.c (check_iso_charset_parameter): Convert internal
15391 character to string before calling 'error', since %c now has the
15392 printf meaning.
15393 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15394 overflow when computing char to be passed to 'error'. Do not
15395 pass Lisp_Object to 'error'; pass the integer instead.
15396 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15397 formatted with plain %d.
15398
15399 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15400
15401 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15402
15403 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15404
15405 * xterm.c (x_catch_errors): Remove duplicate declaration.
15406
15407 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15408
15409 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15410
15411 2011-04-10 Jim Meyering <meyering@redhat.com>
15412
15413 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15414 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15415 return ssize_t not "int", and use size_t as the buffer length.
15416 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15417 * gnutls.h: Update declarations.
15418 * process.c (read_process_output): Use ssize_t, to match.
15419 (send_process): Likewise.
15420
15421 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15422
15423 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15424
15425 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15426
15427 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15428 Use unsigned char, to match FcChar8 type definition.
15429
15430 * xterm.c (handle_one_xevent):
15431 * xmenu.c (create_and_show_popup_menu):
15432 * xselect.c (x_decline_selection_request)
15433 (x_reply_selection_request): Avoid type-punned deref of X events.
15434
15435 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15436
15437 Fix some uses of `int' instead of EMACS_INT.
15438 * search.c (string_match_1, fast_string_match)
15439 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15440 (scan_buffer, find_next_newline_no_quit)
15441 (find_before_next_newline, search_command, Freplace_match)
15442 (Fmatch_data): Make some `int' variables be EMACS_INT.
15443
15444 * xdisp.c (display_count_lines): 3rd argument and return value now
15445 EMACS_INT. All callers changed.
15446 (pint2hrstr): Last argument is now EMACS_INT.
15447
15448 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15449 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15450 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15451 (decode_coding_utf_16, decode_coding_emacs_mule)
15452 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15453 (decode_coding_ccl, decode_coding_charset)
15454 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15455 (decode_coding_iso_2022, decode_coding_emacs_mule)
15456 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15457 <char_offset, last_offset>: Declare EMACS_INT.
15458 (encode_coding_utf_8, encode_coding_utf_16)
15459 (encode_coding_emacs_mule, encode_invocation_designation)
15460 (encode_designation_at_bol, encode_coding_iso_2022)
15461 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15462 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15463 Declare EMACS_INT.
15464 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15465 (encode_invocation_designation): Last argument P_NCHARS is now
15466 EMACS_INT.
15467 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15468 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15469
15470 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15471 All users changed.
15472
15473 * ccl.c (Fccl_execute_on_string): Declare some variables
15474 EMACS_INT.
15475
15476 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15477
15478 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15479
15480 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15481
15482 * process.c (Fformat_network_address): Doc fix.
15483
15484 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15485
15486 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15487
15488 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15489
15490 * keyboard.c (read_char): Call Lisp function help-form-show,
15491 instead of using internal_with_output_to_temp_buffer.
15492 (Qhelp_form_show): New var.
15493 (syms_of_keyboard): Use DEFSYM macro.
15494
15495 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15496
15497 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15498
15499 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15500
15501 * process.c (Flist_processes): Remove to Lisp.
15502 (list_processes_1): Delete.
15503
15504 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15505
15506 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15507
15508 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15509
15510 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15511
15512 Fix more problems found by GCC 4.6.0's static checks.
15513
15514 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15515
15516 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15517
15518 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15519
15520 * xdisp.c (vmessage): Mark as a printf-like function.
15521
15522 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15523
15524 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15525
15526 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15527 printf-like functions.
15528 (tiff_load): Add casts to remove these marks before passing them
15529 to system-supplied API.
15530
15531 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15532
15533 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15534 This avoids several warnings with gcc -Wstrict-overflow.
15535 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15536 directly, rather than having caller test rule sign. This avoids
15537 some unnecessary tests.
15538 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15539 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15540 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
15541
15542 * xfont.c (xfont_text_extents): Remove var that was set but not used.
15543 (xfont_open): Avoid unnecessary tests.
15544
15545 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15546
15547 * composite.h, composite.c (composition_gstring_put_cache):
15548 Use EMACS_INT, not int, for length.
15549
15550 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15551 breaking out part of COMPOSITION_DECODE_RULE.
15552 (COMPOSITION_DECODE_RULE): Use it.
15553 * composite.c (get_composition_id): Remove unused local vars,
15554 by using the new macro.
15555
15556 * textprop.c (set_text_properties_1): Change while to do-while,
15557 since the condition is always true at first.
15558
15559 * intervals.c (graft_intervals_into_buffer): Mark var as used.
15560 (interval_deletion_adjustment): Return unsigned value.
15561 All uses changed.
15562
15563 * process.c (list_processes_1, create_pty, read_process_output):
15564 (exec_sentinel): Remove vars that were set but not used.
15565 (create_pty): Remove unnecessary "volatile"s.
15566 (Fnetwork_interface_info): Avoid possibility of int overflow.
15567 (read_process_output): Do adaptive read buffering even if carryover.
15568 (read_process_output): Simplify nbytes computation if buffered.
15569
15570 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15571
15572 * syntax.c (scan_words): Remove var that was set but not used.
15573 (update_syntax_table): Use unsigned instead of int.
15574
15575 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
15576 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
15577 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
15578
15579 * print.c (print_error_message): Avoid int overflow.
15580
15581 * font.c (font_list_entities): Redo for clarity,
15582 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15583
15584 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15585 (font_score): Avoid potential overflow in diff calculation.
15586
15587 * fns.c (substring_both): Remove var that is set but not used.
15588 (sxhash): Redo loop for clarity and to avoid wraparound warning.
15589
15590 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15591
15592 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15593 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15594 can always succeed if overflow has undefined behavior.
15595
15596 * search.c (boyer_moore, wordify): Remove vars set but not used.
15597 (wordify): Omit three unnecessary tests.
15598
15599 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15600 All callers changed. This avoids the need for an unused var.
15601
15602 * casefiddle.c (casify_region): Remove var that is set but not used.
15603
15604 * dired.c (file_name_completion): Remove var that is set but not used.
15605
15606 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15607
15608 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
15609 (Finsert_file_contents): Remove unnecessary code checking fd.
15610
15611 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15612 Check for integer overflow on size calculations.
15613
15614 * buffer.c (Fprevious_overlay_change): Remove var that is set
15615 but not used.
15616
15617 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15618 Remove vars that are set but not used.
15619 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
15620 (timer_check_2): Mark vars as initialized.
15621
15622 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15623
15624 * image.c (lookup_image): Remove var that is set but not used.
15625 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
15626
15627 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15628 that are set but not used.
15629
15630 * xfns.c (make_invisible_cursor): Don't return garbage
15631 if XCreateBitmapFromData fails (Bug#8410).
15632
15633 * xselect.c (x_get_local_selection, x_handle_property_notify):
15634 Remove vars that are set but not used.
15635
15636 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
15637 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
15638
15639 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15640 Remove var that is set but not used.
15641 (scroll_bar_windows_size): Now size_t, not int.
15642 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15643 Check for overflow.
15644
15645 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15646 (map_tty_color) [!defined MSDOS]: Likewise.
15647
15648 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15649
15650 * coding.c: Remove vars that are set but not used.
15651 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15652 All callers changed.
15653 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15654 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15655 (decode_coding_charset): Remove vars that are set but not used.
15656
15657 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15658 that is set but not used.
15659
15660 * print.c (print_object): Remove var that is set but not used.
15661
15662 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
15663 The gnulib version avoids calling malloc in the usual case,
15664 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15665 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15666 * filelock.c (current_lock_owner): Likewise.
15667 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15668 * sysdep.c: Include allocator.h, careadlinkat.h.
15669 (emacs_no_realloc_allocator): New static constant.
15670 (emacs_readlink): New function.
15671 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15672 ../lib/careadlinkat.h.
15673
15674 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15675
15676 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15677 first non-nil return value).
15678
15679 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15680
15681 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15682 if not defined (Bug#8403).
15683
15684 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15685
15686 * xdisp.c (display_count_lines): Remove parameter `start',
15687 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15688 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15689 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15690 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15691 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15692 and thereabouts. All callers changed.
15693 (get_per_char_metric): Remove parameter `f', unused since
15694 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15695
15696 2011-04-02 Jim Meyering <meyering@redhat.com>
15697
15698 do not dereference NULL upon failed strdup
15699 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15700 (ns_get_family): Likewise.
15701
15702 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15703
15704 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15705
15706 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15707
15708 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15709 later (Bug#8403).
15710
15711 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15712
15713 Add lexical binding.
15714
15715 * window.c (Ftemp_output_buffer_show): New fun.
15716 (Fsave_window_excursion):
15717 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15718
15719 * lread.c (lisp_file_lexically_bound_p): New function.
15720 (Fload): Bind Qlexical_binding.
15721 (readevalloop): Remove `evalfun' arg.
15722 Bind Qinternal_interpreter_environment.
15723 (Feval_buffer): Bind Qlexical_binding.
15724 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15725 Mark as dynamic.
15726 (syms_of_lread): Declare `lexical-binding'.
15727
15728 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15729
15730 * keyboard.c (eval_dyn): New fun.
15731 (menu_item_eval_property): Use it.
15732
15733 * image.c (parse_image_spec): Use Ffunctionp.
15734
15735 * fns.c (concat, mapcar1): Accept byte-code-functions.
15736
15737 * eval.c (Fsetq): Handle lexical vars.
15738 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
15739 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
15740 (FletX, Flet): Obey lexical binding.
15741 (Fcommandp): Handle closures.
15742 (Feval): New `lexical' arg.
15743 (eval_sub): New function extracted from Feval. Use it almost
15744 everywhere where Feval was used. Look up vars in lexical env.
15745 Handle closures.
15746 (Ffunctionp): Move from subr.el.
15747 (Ffuncall): Handle closures.
15748 (apply_lambda): Remove `eval_flags'.
15749 (funcall_lambda): Handle closures and new byte-code-functions.
15750 (Fspecial_variable_p): New function.
15751 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15752 but without exporting it to Lisp.
15753
15754 * doc.c (Fdocumentation, store_function_docstring):
15755 * data.c (Finteractive_form): Handle closures.
15756
15757 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15758 interactive spec.
15759
15760 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15761 New byte-codes.
15762 (exec_byte_code): New function extracted from Fbyte_code to handle new
15763 calling convention for byte-code-functions. Add new byte-codes.
15764
15765 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
15766
15767 * alloc.c (Fmake_symbol): Init new `declared_special' field.
15768
15769 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15770
15771 * xdisp.c (redisplay_internal): Fix prototype.
15772
15773 2011-03-31 Eli Zaretskii <eliz@gnu.org>
15774
15775 * xdisp.c (SCROLL_LIMIT): New macro.
15776 (try_scrolling): Use it when setting scroll_limit.
15777 Limit scrolling to 100 screen lines.
15778 (redisplay_window): Even when falling back on "recentering",
15779 position point in the window according to scroll-conservatively,
15780 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
15781
15782 (try_scrolling): When point is above the window, allow searching
15783 as far as scroll_max, or one screenful, to compute vertical
15784 distance from PT to the scroll margin position. This prevents
15785 try_scrolling from unnecessarily failing when
15786 scroll-conservatively is set to a value slightly larger than the
15787 window height. Clean up the case of PT below the margin at bottom
15788 of window: scroll_max can no longer be INT_MAX. When aggressive
15789 scrolling is in use, don't let point enter the opposite scroll
15790 margin as result of the scroll.
15791 (syms_of_xdisp) <scroll-conservatively>: Document the
15792 threshold of 100 lines for never-recentering scrolling.
15793
15794 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15795
15796 * dispextern.h (move_it_by_lines):
15797 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15798 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
15799 (message_log_check_duplicate): Remove parameters `prev_bol' and
15800 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15801 (redisplay_internal): Remove parameter `preserve_echo_area',
15802 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
15803
15804 * indent.c (Fvertical_motion):
15805 * window.c (window_scroll_pixel_based, Frecenter):
15806 Don't pass `need_y_p' to `move_it_by_lines'.
15807
15808 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15809
15810 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15811 steal a few bits to be more compact.
15812 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15813 Remove unneeded casts.
15814
15815 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15816
15817 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15818
15819 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15820 binding" message (bug#7967).
15821
15822 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15823
15824 Fix more problems found by GCC 4.6.0's static checks.
15825
15826 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15827 Remove unused local var.
15828
15829 * editfns.c (Fmessage_box): Remove unused local var.
15830
15831 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15832 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15833 Omit unused local vars.
15834 * window.c (shrink_windows): Omit unused local var.
15835 * menu.c (digest_single_submenu): Omit unused local var.
15836 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15837 Omit unused local var.
15838
15839 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15840 Don't assume string length fits in int.
15841 (keyremap_step, read_key_sequence): Use size_t for sizes.
15842 (read_key_sequence): Don't check last_real_key_start redundantly.
15843
15844 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15845 instead of alloca (Bug#8344).
15846
15847 * eval.c (Fbacktrace): Don't assume nargs fits in int.
15848 (Fbacktrace_frame): Don't assume nframes fits in int.
15849
15850 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15851
15852 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15853 concerns.
15854
15855 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15856
15857 * cm.c (calccost): Turn while-do into do-while, for clarity.
15858
15859 * keyboard.c (syms_of_keyboard): Use the same style as later
15860 in this function when indexing through an array. This also
15861 works around GCC bug 48267.
15862
15863 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15864
15865 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15866
15867 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15868 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15869
15870 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15871 This avoids undefined behavior on integer overflow, and is a bit
15872 more convenient anyway since it is compared to a size_t variable.
15873
15874 Variadic C functions now count arguments with size_t, not int.
15875 This avoids an unnecessary limitation on 64-bit machines, which
15876 caused (substring ...) to crash on large vectors (Bug#8344).
15877 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15878 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
15879 All variadic functions and their callers changed accordingly.
15880 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15881 * data.c (arith_driver, float_arith_driver): Likewise.
15882 * editfns.c (general_insert_function): Likewise.
15883 * eval.c (struct backtrace.nargs, interactive_p)
15884 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15885 (funcall_lambda, mark_backtrace): Likewise.
15886 * fns.c (concat): Likewise.
15887 * frame.c (x_set_frame_parameters): Likewise.
15888 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15889 0 if not found, not -1. All callers changed.
15890
15891 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15892 (stack_copy_size): Now size_t, not int.
15893 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15894
15895 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15896
15897 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15898 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15899 All callers changed.
15900
15901 * lisp.h (multibyte_char_to_unibyte):
15902 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15903 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15904 * character.h (CHAR_TO_BYTE8):
15905 * cmds.c (internal_self_insert):
15906 * editfns.c (general_insert_function):
15907 * keymap.c (push_key_description):
15908 * search.c (Freplace_match):
15909 * xdisp.c (message_dolog, set_message_1): All callers changed.
15910
15911 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15912
15913 * keyboard.c (safe_run_hook_funcall): New function.
15914 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15915 don't set the hook to nil, but remove the offending function instead.
15916 (Qcommand_hook_internal): Remove, unused.
15917 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15918 Vcommand_hook_internal.
15919
15920 * eval.c (enum run_hooks_condition): Remove.
15921 (funcall_nil, funcall_not): New functions.
15922 (run_hook_with_args): Call each function through a `funcall' argument.
15923 Remove `cond' argument, now redundant.
15924 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15925 (Frun_hook_with_args_until_failure): Adjust accordingly.
15926 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15927
15928 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15929
15930 * dispextern.h (string_buffer_position): Remove declaration.
15931
15932 * print.c (strout): Remove parameter `multibyte', unused since
15933 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15934
15935 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15936 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15937 All callers changed.
15938
15939 * w32.c (_wsa_errlist): Use braces for struct initializers.
15940
15941 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15942 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15943 All callers changed.
15944 (string_buffer_position): Likewise. Also, make static (it's never
15945 used outside xdisp.c).
15946 (cursor_row_p): Remove parameter `w', unused since
15947 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15948 (decode_mode_spec): Remove parameter `precision', introduced during
15949 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15950 All callers changed.
15951
15952 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15953
15954 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15955
15956 2011-03-27 Anders Lindgren <andlind@gmail.com>
15957
15958 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15959 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15960 (ns_update_auto_hide_menu_bar): New functions.
15961 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15962 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15963 ns_constrain_all_frames.
15964 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15965 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15966
15967 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15968
15969 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15970
15971 2011-03-27 Glenn Morris <rgm@gnu.org>
15972
15973 * syssignal.h: Replace RETSIGTYPE with void.
15974 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15975 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15976 Replace SIGTYPE with void everywhere.
15977 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15978 * s/template.h (SIGTYPE): Remove commented out definition.
15979
15980 2011-03-26 Eli Zaretskii <eliz@gnu.org>
15981
15982 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15983 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15984
15985 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
15986
15987 * w32.c (read_unc_volume): Use parameter `henum', instead of
15988 global variable `wget_enum_handle'.
15989
15990 * keymap.c (describe_vector): Remove parameters `indices' and
15991 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15992 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15993
15994 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15995
15996 * keyboard.c (timer_check): Remove parameter `do_it_now',
15997 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15998 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15999 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16000
16001 * keyboard.c (read_char):
16002 * w32menu.c (w32_menu_display_help):
16003 * xmenu.c (show_help_event, menu_help_callback):
16004 Adjust calls to `show_help_echo'.
16005
16006 * gtkutil.c (xg_maybe_add_timer):
16007 * keyboard.c (readable_events):
16008 * process.c (wait_reading_process_output):
16009 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16010
16011 * insdel.c (adjust_markers_gap_motion):
16012 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16013 (gap_left, gap_right): Don't call it.
16014
16015 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16016
16017 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16018 incurred during fontification.
16019
16020 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16021
16022 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16023 (DEFVAR_PER_BUFFER): Don't pass it.
16024
16025 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16026 (scrolling_window): Don't pass it.
16027
16028 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16029
16030 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16031
16032 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16033 and `suffix'.
16034 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16035 of variables specific to SELinux and computation of `encoded_absname'.
16036
16037 * image.c (XPutPixel): Remove unused variable `height'.
16038
16039 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16040
16041 * unexw32.c (get_section_info): Remove unused variable `section'.
16042
16043 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16044 (system_process_attributes): Remove unused variable `sess'.
16045 (sys_read): Remove unused variable `err'.
16046
16047 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16048 (w32_wnd_proc): Remove unused variable `isdead'.
16049 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16050 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16051 (x_create_tip_frame): Remove unused variable `tem'.
16052
16053 * w32inevt.c (w32_console_read_socket):
16054 Remove unused variable `no_events'.
16055
16056 * w32term.c (x_draw_composite_glyph_string_foreground):
16057 Remove unused variable `width'.
16058
16059 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16060
16061 * w32term.c (x_set_glyph_string_clipping):
16062 Don't pass uninitialized region to CombineRgn.
16063
16064 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16065
16066 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16067 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16068 (Fx_close_connection): Remove unused variable `i'.
16069
16070 * w32font.c (w32font_draw): Return number of glyphs.
16071 (w32font_open_internal): Remove unused variable `i'.
16072 (w32font_driver): Add missing initializer.
16073
16074 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16075 (fill_in_menu): Remove unused variable `items_added'.
16076
16077 * w32term.c (last_mouse_press_frame): Remove static global variable.
16078 (w32_clip_to_row): Remove unused variable `f'.
16079 (x_delete_terminal): Remove unused variable `i'.
16080
16081 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16082 (NOTHING): Remove unused static global variable.
16083 (uniscribe_check_otf): Remove unused variable `table'.
16084 (uniscribe_font_driver): Add missing initializers.
16085
16086 2011-03-23 Julien Danjou <julien@danjou.info>
16087
16088 * term.c (Fsuspend_tty, Fresume_tty):
16089 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16090 * window.c (temp_output_buffer_show):
16091 * insdel.c (signal_before_change):
16092 * frame.c (Fhandle_switch_frame):
16093 * fileio.c (Fdo_auto_save):
16094 * emacs.c (Fkill_emacs):
16095 * editfns.c (save_excursion_restore):
16096 * cmds.c (internal_self_insert):
16097 * callint.c (Fcall_interactively):
16098 * buffer.c (Fkill_all_local_variables):
16099 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16100 Use Frun_hooks.
16101 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16102 unconditionally since it does the check itself.
16103
16104 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16105
16106 Fix more problems found by GCC 4.5.2's static checks.
16107
16108 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16109 the first time through the loop, since we know p0 < p1 then.
16110 This also avoids a gcc -Wstrict-overflow warning.
16111
16112 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16113 leading to a memory leak, possible in functions like
16114 load_charset_map_from_file that can allocate an unbounded number
16115 of objects (Bug#8318).
16116
16117 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16118 that could (at least in theory) be that large.
16119
16120 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16121 This is less likely to overflow, and avoids undefined behavior if
16122 overflow does occur. All callers changed. Use strtoul to scan
16123 for the unsigned long integer.
16124 (pint2hrstr): Simplify and tune code slightly.
16125 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16126
16127 * scroll.c (do_scrolling): Work around GCC bug 48228.
16128 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16129
16130 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16131 This also avoids a warning with gcc -Wstrict-overflow.
16132 (validate_x_resource_name): Simplify count usage.
16133 This also avoids a warning with gcc -Wstrict-overflow.
16134
16135 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16136 fail (Bug#8306).
16137
16138 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16139
16140 * process.c (Fmake_network_process): Use socklen_t, not int,
16141 where POSIX says socklen_t is required in portable programs.
16142 This fixes a porting bug on hosts like 64-bit HP-UX, where
16143 socklen_t is wider than int (Bug#8277).
16144 (Fmake_network_process, server_accept_connection):
16145 (wait_reading_process_output, read_process_output):
16146 Likewise.
16147
16148 * process.c: Rename or move locals to avoid shadowing.
16149 (list_processes_1, Fmake_network_process):
16150 (read_process_output_error_handler, exec_sentinel_error_handler):
16151 Rename or move locals.
16152 (Fmake_network_process): Define label "retry_connect" only if needed.
16153 (Fnetwork_interface_info): Fix pointer signedness.
16154 (process_send_signal): Add cast to avoid pointer signedness problem.
16155 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16156 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16157
16158 Make tparam.h and terminfo.c consistent.
16159 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16160 Include tparam.h instead, since it declares them.
16161 * cm.h (PC): Remove extern decl; tparam.h now does this.
16162 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16163 * terminfo.c: Include tparam.h, to check interfaces.
16164 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16165 (tparam): Adjust signature to match interface in tparam.h;
16166 this removes some undefined behavior. Check that outstring and len
16167 are zero, which they always are with Emacs.
16168 * tparam.h (PC, BC, UP): New extern decls.
16169
16170 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16171 (xftfont_open): Rename locals to avoid shadowing.
16172
16173 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16174 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16175 (OTF_TAG_SYM): Omit macro if not needed.
16176 (ftfont_list): Remove unused local.
16177 (get_adstyle_property, ftfont_pattern_entity):
16178 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16179 Rename locals to avoid shadowing.
16180
16181 * xfont.c (xfont_list_family): Mark var as initialized.
16182
16183 * xml.c (make_dom): Now static.
16184
16185 * composite.c (composition_compute_stop_pos): Rename local to
16186 avoid shadowing.
16187 (composition_reseat_it): Remove unused locals.
16188 (find_automatic_composition, composition_adjust_point): Likewise.
16189 (composition_update_it): Mark var as initialized.
16190 (find_automatic_composition): Mark vars as initialized,
16191 with a FIXME (Bug#8290).
16192
16193 character.h: Rename locals to avoid shadowing.
16194 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16195 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16196 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16197 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16198 to avoid shadowing.
16199
16200 * textprop.c (property_change_between_p): Remove; unused.
16201
16202 * intervals.c (interval_start_pos): Now static.
16203
16204 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16205
16206 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16207 Rename locals to avoid shadowing.
16208
16209 * sound.c (wav_play, au_play, Fplay_sound_internal):
16210 Fix pointer signedness.
16211 (alsa_choose_format): Remove unused local var.
16212 (wav_play): Initialize a variable to 0, to prevent undefined
16213 behavior (Bug#8278).
16214
16215 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16216
16217 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16218
16219 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16220 clobbering (Bug#8298).
16221 * sysdep.c (sys_subshell): Likewise.
16222 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16223
16224 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16225 This should get cleaned up, so that child_setup has the
16226 same signature on all platforms.
16227
16228 * callproc.c (call_process_cleanup): Now static.
16229 (relocate_fd): Rename locals to avoid shadowing.
16230
16231 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16232
16233 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16234 not to be necessary, and produces flickering.
16235
16236 2011-03-20 Glenn Morris <rgm@gnu.org>
16237
16238 * config.in: Remove file.
16239
16240 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16241
16242 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16243 are now in src/globals.h.
16244 (syms_of_minibuf): Remove spurious & from previous change.
16245
16246 2011-03-20 Leo Liu <sdl.web@gmail.com>
16247
16248 * minibuf.c (completing-read-function): New variable.
16249 (completing-read-default): Rename from completing-read.
16250 (completing-read): Call completing-read-function.
16251
16252 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16253
16254 * xfaces.c (Fx_load_color_file):
16255 Read color file from absolute filename (bug#8250).
16256
16257 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16258
16259 * makefile.w32-in: Update dependencies.
16260
16261 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16262
16263 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16264
16265 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16266
16267 Fix more problems found by GCC 4.5.2's static checks.
16268
16269 * process.c (make_serial_process_unwind, send_process_trap):
16270 (sigchld_handler): Now static.
16271
16272 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16273 That way, the code declares only the vars that it needs.
16274 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16275 * s/cygwin.h (PTY_ITERATION): Likewise.
16276 * s/darwin.h (PTY_ITERATION): Likewise.
16277 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16278
16279 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16280 * process.c (allocate_pty): Don't declare stb unless it's needed.
16281
16282 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16283 (CONSTANTLIM): Remove; unused.
16284 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16285 Define only if needed.
16286
16287 * unexelf.c (unexec): Name an expression,
16288 to avoid gcc -Wbad-function-cast warning.
16289 Use a different way to cause a compilation error if anyone uses
16290 n rather than nn, a way that does not involve shadowing.
16291 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16292
16293 * deps.mk (unexalpha.o): Remove; unused.
16294
16295 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16296 * unexec.h: New file.
16297 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16298 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16299 Depend on unexec.h.
16300 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16301 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16302 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16303 Change as necessary to match prototype in unexec.h.
16304
16305 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16306 shadowing.
16307 (back_comment, skip_chars): Mark vars as initialized.
16308
16309 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16310 Rename locals to avoid shadowing.
16311
16312 * lread.c (read1): Rewrite so as not to use empty "else".
16313 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16314
16315 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16316
16317 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16318 warning when compiling print.c.
16319
16320 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16321 instead of using an uninitialized var.
16322 (font_sort_entities): Mark var as initialized.
16323
16324 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16325
16326 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16327 pointers to constants.
16328 (font_parse_fcname): Remove unused vars.
16329 (font_delete_unmatched): Now static.
16330 (font_get_spec): Remove; unused.
16331 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16332 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16333 Rename or move locals to avoid shadowing.
16334
16335 * fns.c (require_nesting_list, require_unwind): Now static.
16336 (Ffillarray): Rename locals to avoid shadowing.
16337
16338 * floatfns.c (domain_error2): Define only if needed.
16339 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16340
16341 * alloc.c (mark_backtrace): Move decl from here ...
16342 * lisp.h: ... to here, so that it can be checked.
16343
16344 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16345 (Fdefvar): Rewrite so as not to use empty "else".
16346 (lisp_indirect_variable): Name an expression,
16347 to avoid gcc -Wbad-function-cast warning.
16348 (Fdefvar): Rename locals to avoid shadowing.
16349
16350 * callint.c (quotify_arg, quotify_args): Now static.
16351 (Fcall_interactively): Rename locals to avoid shadowing.
16352 Use const pointer when appropriate.
16353
16354 * lisp.h (get_system_name, get_operating_system_release):
16355 Move decls here, to check interfaces.
16356 * process.c (get_operating_system_release): Move decl to lisp.h.
16357 * xrdb.c (get_system_name): Likewise.
16358 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16359 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16360 some of which prompt warnings from gcc -Wbad-function-cast.
16361 (Fformat_time_string, Fencode_time, Finsert_char):
16362 (Ftranslate_region_internal, Fformat):
16363 Rename or remove local vars to avoid shadowing.
16364 (Ftranslate_region_internal): Mark var as initialized.
16365
16366 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16367 avoid shadowing.
16368
16369 * lisp.h (eassert): Check that the argument compiles, even if
16370 ENABLE_CHECKING is not defined.
16371
16372 * data.c (Findirect_variable): Name an expression, to avoid
16373 gcc -Wbad-function-cast warning.
16374 (default_value, arithcompare, arith_driver, arith_error): Now static.
16375 (store_symval_forwarding): Rename local to avoid shadowing.
16376 (Fmake_variable_buffer_local, Fmake_local_variable):
16377 Mark variables as initialized.
16378 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16379
16380 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16381 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16382 Rename locals to avoid shadowing.
16383 (mark_stack): Move local variables into the #ifdef region where
16384 they're used.
16385 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16386 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16387 needed otherwise.
16388 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16389 (GC_STRING_CHARS): Remove; not used.
16390 (Fmemory_limit): Cast sbrk's returned value to char *.
16391
16392 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16393 avoids undefined behavior in theory.
16394
16395 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16396
16397 Use functions, not macros, for up- and down-casing (Bug#8254).
16398 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16399 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16400 to use the following functions instead of these macros.
16401 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16402 EMACS_INT, since callers assume the returned value fits in int.
16403 (upcase1): Likewise, for UPCASE_TABLE.
16404 (uppercasep, lowercasep, upcase): New static inline functions.
16405 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16406 the race-condition problem in the old DOWNCASE.
16407
16408 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16409 Rename locals to avoid shadowing.
16410 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16411 (regex_compile, re_search_2, re_match_2_internal):
16412 Remove unused local vars.
16413 (FREE_VAR): Rewrite so as not to use empty "else",
16414 which gcc can warn about.
16415 (regex_compile, re_match_2_internal): Mark locals as initialized.
16416 (RETALLOC_IF): Define only if needed.
16417 (WORDCHAR_P): Likewise. This one is never needed, but is used
16418 only in a comment talking about a compiler bug, so put inside
16419 the #if 0 of that comment.
16420 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16421 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16422 Remove; unused.
16423
16424 * search.c (boyer_moore): Rename locals to avoid shadowing.
16425 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16426 (PREV_CHAR_BOUNDARY): Likewise.
16427
16428 * search.c (simple_search): Remove unused var.
16429
16430 * dired.c (compile_pattern): Move decl from here ...
16431 * lisp.h: ... to here, so that it can be checked.
16432 (struct re_registers): New forward decl.
16433
16434 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16435
16436 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16437 All uses changed.
16438 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16439 Rename locals to avoid shadowing.
16440 (Fvertical_motion): Mark locals as initialized.
16441
16442 * casefiddle.c (casify_object, casify_region): Now static.
16443 (casify_region): Mark local as initialized.
16444
16445 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16446
16447 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16448 New macros, so that the caller can use some names other than
16449 gcpro1, gcpro2, etc.
16450 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16451 of the new macros.
16452 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16453 argument, for consistency with GCPRO2_VAR, etc: it is now the
16454 prefix of the variable, not the variable itself. All uses
16455 changed.
16456 * dired.c (directory_files_internal, file_name_completion):
16457 Rename locals to avoid shadowing.
16458
16459 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16460 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16461 dired.c's scmp function, had undefined behavior.
16462 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16463 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16464 * buffer.h: ... to here, because these macros use current_buffer,
16465 and the new implementation with inline functions needs to have
16466 current_buffer in scope now, rather than later when the macros
16467 are used.
16468 (downcase, upcase1): New static inline functions.
16469 (DOWNCASE, UPCASE1): Reimplement using these functions.
16470 This avoids undefined behavior in expressions like
16471 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16472 from race conditions in accessing the global variables
16473 case_temp1 and case_temp2.
16474 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16475 * lisp.h (case_temp1, case_temp2): Remove their decls.
16476 * character.h (ASCII_CHAR_P): Move from here ...
16477 * lisp.h: ... to here, so that the inline functions mentioned
16478 above can use them.
16479
16480 * dired.c (directory_files_internal_unwind): Now static.
16481
16482 * fileio.c (file_name_as_directory, directory_file_name):
16483 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16484 Now static.
16485 (file_name_as_directory): Use const pointers when appropriate.
16486 (Fexpand_file_name): Likewise. In particular, newdir might
16487 point at constant storage, so make it a const pointer.
16488 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16489 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16490 signedness issues.
16491 (Fset_file_times, Finsert_file_contents, auto_save_error):
16492 Rename locals to avoid shadowing.
16493
16494 * minibuf.c (choose_minibuf_frame_1): Now static.
16495 (Ftry_completion, Fall_completions): Rename or remove locals
16496 to avoid shadowing.
16497
16498 * marker.c (bytepos_to_charpos): Remove; unused.
16499
16500 * lisp.h (verify_bytepos, count_markers): New decls,
16501 so that gcc does not warn that these functions aren't declared.
16502
16503 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16504 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16505 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16506 (copy_text): Remove unused local var.
16507
16508 * filelock.c (within_one_second): Now static.
16509 (lock_file_1): Rename local to avoid shadowing.
16510
16511 * buffer.c (fix_overlays_before): Mark locals as initialized.
16512 (fix_start_end_in_overlays): Likewise. This function should be
16513 simplified by using pointers-to-pointers, but that's a different
16514 matter.
16515 (switch_to_buffer_1): Now static.
16516 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16517 (report_overlay_modification): Rename locals to avoid shadowing.
16518
16519 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16520 Fix pointer signedness issue.
16521 (sys_subshell): Mark local as volatile if checking for lint,
16522 to suppress a gcc -Wclobbered warning that does not seem to be right.
16523 (MAXPATHLEN): Define only if needed.
16524
16525 * process.c (serial_open, serial_configure): Move decls from here ...
16526 * systty.h: ... to here, so that they can be checked.
16527
16528 * fns.c (get_random, seed_random): Move extern decls from here ...
16529 * lisp.h: ... to here, so that they can be checked.
16530
16531 * sysdep.c (reset_io): Now static.
16532 (wait_for_termination_signal): Remove; unused.
16533
16534 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16535 (copy_keymap_item, append_key, push_text_char_description):
16536 Now static.
16537 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
16538 (DENSE_TABLE_SIZE): Remove; unused.
16539 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16540 (describe_map_tree):
16541 Rename locals to avoid shadowing.
16542
16543 * keyboard.c: Declare functions static if they are not used elsewhere.
16544 (echo_char, echo_dash, cmd_error, top_level_2):
16545 (poll_for_input, handle_async_input): Now static.
16546 (read_char, kbd_buffer_get_event, make_lispy_position):
16547 (make_lispy_event, make_lispy_movement, apply_modifiers):
16548 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16549 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16550 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
16551 (read_key_sequence, read_char): Mark locals as initialized.
16552 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
16553
16554 * keyboard.h (make_ctrl_char): New decl.
16555 (mark_kboards): Move decl here ...
16556 * alloc.c (mark_kboards): ... from here.
16557
16558 * lisp.h (force_auto_save_soon): New decl.
16559
16560 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
16561 (DEFINE_DUMMY_FUNCTION): New macro.
16562 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16563 Use it.
16564 (main): Add casts to avoid warnings
16565 if GCC considers string literals to be constants.
16566
16567 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16568
16569 * dbusbind.c: Pointer signedness fixes.
16570 (xd_signature, xd_append_arg, xd_initialize):
16571 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16572 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16573 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16574 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16575
16576 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16577 if GCC considers string literals to be constants.
16578 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
16579
16580 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16581
16582 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16583 (print_preprocess, print_object): New macro to fix last change.
16584
16585 * print.c (print_preprocess): Don't forget font objects.
16586
16587 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
16588
16589 * emacs.c (USAGE3): Doc fixes.
16590
16591 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16592
16593 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16594 structure.
16595
16596 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
16597
16598 * lisp.h (VWindow_system, Qfile_name_history):
16599 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16600 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16601 (w32_system_caret_x, w32_system_caret_y): Declare extern.
16602
16603 * w32select.c: Don't #include "keyboard.h".
16604 (run_protected): Add extern declaration for waiting_for_input.
16605
16606 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16607 * w32console.c (detect_input_pending, read_input_pending)
16608 (encode_terminal_code):
16609 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16610 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16611 (w32_system_caret_y, Qfile_name_history):
16612 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16613 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16614 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16615 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16616 * w32proc.c (Qlocal, report_file_error):
16617 * w32term.c (Vwindow_system, updating_frame):
16618 * w32uniscribe.c (initialized, uniscribe_font_driver):
16619 Remove unneeded extern declarations.
16620
16621 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
16622
16623 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
16624
16625 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
16626
16627 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16628 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16629 These macros can no longer be used for assignment.
16630
16631 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16632 Assign struct members directly, instead of using BUF_BEGV etc.
16633 (record_buffer_markers, fetch_buffer_markers): New functions for
16634 recording and fetching special buffer markers.
16635 (set_buffer_internal_1, set_buffer_temp): Use them.
16636
16637 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16638
16639 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16640
16641 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16642 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16643
16644 * xdisp.c (hscroll_window_tree):
16645 (reconsider_clip_changes): Use PT instead of BUF_PT.
16646
16647 2011-03-13 Eli Zaretskii <eliz@gnu.org>
16648
16649 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16650 $(EMACS_ROOT)/lib/intprops.h.
16651
16652 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16653
16654 Fix more problems found by GCC 4.5.2's static checks.
16655
16656 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16657 to unsigned char * to avoid compiler diagnostic.
16658 (xg_free_frame_widgets): Make it clear that a local variable is
16659 needed only if USE_GTK_TOOLTIP.
16660 (gdk_window_get_screen): Make it clear that this macro is needed
16661 only if USE_GTK_TOOLTIP.
16662 (int_gtk_range_get_value): New function, which avoids a diagnostic
16663 from gcc -Wbad-function-cast.
16664 (xg_set_toolkit_scroll_bar_thumb): Use it.
16665 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16666 diagnostic from gcc -Wbad-function-cast.
16667 (get_utf8_string, xg_get_file_with_chooser):
16668 Rename locals to avoid shadowing.
16669 (create_dialog): Move locals to avoid shadowing.
16670
16671 * xgselect.c (xg_select): Remove unused var.
16672
16673 * image.c (four_corners_best): Mark locals as initialized.
16674 (gif_load): Initialize transparent_p to zero (Bug#8238).
16675 Mark another local as initialized.
16676 (my_png_error, my_error_exit): Mark with NO_RETURN.
16677
16678 * image.c (clear_image_cache): Now static.
16679 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
16680 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
16681 (x_edge_detection): Remove unnecessary cast that
16682 gcc -Wbad-function-cast diagnoses.
16683 (gif_load): Fix pointer signedness.
16684 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16685 (jpeg_load, gif_load): Rename locals to avoid shadowing.
16686
16687 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
16688
16689 Improve quality of tests for time stamp overflow.
16690 For example, without this patch (encode-time 0 0 0 1 1
16691 1152921504606846976) returns the obviously-bogus value (-948597
16692 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16693 reports time overflow. See
16694 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
16695 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16696 * editfns.c: Include limits.h and intprops.h.
16697 (TIME_T_MIN, TIME_T_MAX): New macros.
16698 (time_overflow): Move earlier, to before first use.
16699 (hi_time, lo_time): New functions, for an accurate test for
16700 out-of-range times.
16701 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16702 (Fget_internal_run_time): Don't assume time_t fits in int.
16703 (make_time): Use list2 instead of Fcons twice.
16704 (Fdecode_time): More accurate test for out-of-range times.
16705 (check_tm_member): New function.
16706 (Fencode_time): Use it, to test for out-of-range times.
16707 (lisp_time_argument): Don't rely on undefined left-shift and
16708 right-shift behavior when checking for time stamp overflow.
16709
16710 * editfns.c (time_overflow): New function, refactoring common code.
16711 (Fformat_time_string, Fdecode_time, Fencode_time):
16712 (Fcurrent_time_string): Use it.
16713
16714 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16715 * dired.c (make_time): Move to ...
16716 * editfns.c (make_time): ... here.
16717 * systime.h: Note the move.
16718
16719 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16720
16721 * fringe.c (update_window_fringes): Remove unused variables.
16722
16723 * unexmacosx.c (copy_data_segment): Also copy __got section.
16724 (Bug#8223)
16725
16726 2011-03-12 Eli Zaretskii <eliz@gnu.org>
16727
16728 * termcap.c [MSDOS]: Include "msdos.h".
16729 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16730 Constify `char *' arguments and their references according to
16731 prototypes in tparam.h.
16732
16733 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
16734
16735 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16736 Adapt all references accordingly.
16737
16738 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16739
16740 2011-03-11 Tom Tromey <tromey@redhat.com>
16741
16742 * buffer.c (syms_of_buffer): Remove obsolete comment.
16743
16744 2011-03-11 Eli Zaretskii <eliz@gnu.org>
16745
16746 * termhooks.h (encode_terminal_code): Declare prototype.
16747
16748 * msdos.c (encode_terminal_code): Don't declare prototype.
16749
16750 * term.c (encode_terminal_code): Now external again, used by
16751 w32console.c and msdos.c.
16752
16753 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16754 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
16755
16756 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
16757
16758 Fix some minor problems found by GCC 4.5.2's static checks.
16759
16760 * fringe.c (update_window_fringes): Mark locals as initialized
16761 (Bug#8227).
16762 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
16763
16764 * alloc.c (mark_fringe_data): Move decl from here ...
16765 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16766 to check its interface.
16767 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16768
16769 * fontset.c (free_realized_fontset): Now static.
16770 (Fset_fontset_font): Rename local to avoid shadowing.
16771 (fontset_font): Mark local as initialized.
16772 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
16773
16774 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16775
16776 * xselect.c (x_disown_buffer_selections): Remove; not used.
16777 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
16778 (x_own_selection, Fx_disown_selection_internal): Rename locals
16779 to avoid shadowing.
16780 (x_handle_dnd_message): Remove local to avoid shadowing.
16781
16782 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16783 so that the caller can use some name other than gcpro1.
16784 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
16785 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16786 (Fx_backspace_delete_keys_p):
16787 Use them to avoid shadowing, and rename vars to avoid shadowing.
16788 (x_decode_color, x_set_name, x_window): Now static.
16789 (Fx_create_frame): Add braces to silence GCC warning.
16790 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
16791 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16792 Remove unused locals.
16793 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16794 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16795 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16796 macros.
16797
16798 * xterm.h (x_mouse_leave): New decl.
16799
16800 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16801 Remove unused functions.
16802 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16803 (x_calc_absolute_position): Now static.
16804 (XTread_socket): Don't define label "out" unless it's used.
16805 Don't declare local "event" unless it's used.
16806 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16807 unless they are used.
16808 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16809 (x_fatal_error_signal): Remove; not used.
16810 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16811 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16812 (x_error_catcher, x_connection_closed, x_error_handler):
16813 (x_error_quitter, xembed_send_message, x_iconify_frame):
16814 (my_log_handler): Rename locals to avoid shadowing.
16815 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
16816 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
16817
16818 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16819 Rename or move locals to avoid shadowing.
16820 (tty_defined_color, merge_face_heights): Now static.
16821 (free_realized_faces_for_fontset): Remove; not used.
16822 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16823 does not deduce is never used uninitialized.
16824 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16825 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
16826
16827 * terminal.c (store_terminal_param): Now static.
16828
16829 * xmenu.c (menu_highlight_callback): Now static.
16830 (set_frame_menubar): Remove unused local.
16831 (xmenu_show): Rename parameter to avoid shadowing.
16832 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16833 since they might point to immutable storage.
16834 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16835 since it's unused otherwise.
16836
16837 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
16838 Add a FIXME, since the code still doesn't look right. (Bug#8215)
16839 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16840 avoids a gcc -Wuninitialized diagnostic.
16841 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
16842 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16843 does not deduce are never used uninitialized.
16844
16845 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16846
16847 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
16848 * window.c (window_loop, size_window):
16849 (run_window_configuration_change_hook, enlarge_window): Likewise.
16850
16851 * window.c (display_buffer): Now static.
16852 (size_window): Mark variables that gcc -Wuninitialized
16853 does not deduce are never used uninitialized.
16854 * window.h (check_all_windows): New decl, to forestall
16855 gcc -Wmissing-prototypes diagnostic.
16856 * dispextern.h (bidi_dump_cached_states): Likewise.
16857
16858 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16859 shadowing.
16860 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
16861 Include <limits.h>.
16862 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16863 and to avoid gcc -Wuninitialized warning.
16864 (load_charset_map): Mark variables that gcc -Wuninitialized
16865 does not deduce are never used uninitialized.
16866 (load_charset): Abort instead of using uninitialized var (Bug#8229).
16867
16868 * coding.c (coding_set_source, coding_set_destination):
16869 Use "else { /* comment */ }" rather than "else /* comment */;"
16870 for clarity, and to avoid gcc -Wempty-body warning.
16871 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16872 a block, when the outer 'i' will do.
16873 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16874 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16875 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16876 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16877 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16878 Rename locals to avoid shadowing.
16879 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
16880 * coding.c (emacs_mule_char, encode_invocation_designation):
16881 Now static, since they're not used elsewhere.
16882 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
16883 (decode_coding_object, encode_coding_object, detect_coding_system):
16884 (decode_coding_emacs_mule): Mark variables that gcc
16885 -Wuninitialized does not deduce are never used uninitialized.
16886 (detect_coding_iso_2022): Initialize a local variable that might
16887 be used uninitialized. Leave a FIXME because it's not clear that
16888 this initialization is needed. (Bug#8211)
16889 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16890 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16891 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16892 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16893 Remove unused macros.
16894
16895 * category.c (hash_get_category_set): Remove unused local var.
16896 (copy_category_table): Now static, since it's not used elsewhere.
16897 * character.c (string_count_byte8): Likewise.
16898
16899 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16900 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16901
16902 * chartab.c (copy_sub_char_table): Now static, since it's not used
16903 elsewhere.
16904 (sub_char_table_ref_and_range, char_table_ref_and_range):
16905 Rename locals to avoid shadowing.
16906 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
16907
16908 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
16909 (BIDI_BOB): Remove unused macro.
16910
16911 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16912 deduce are never used uninitialized.
16913 * term.c (encode_terminal_code): Likewise.
16914
16915 * term.c (encode_terminal_code): Now static. Remove unused local.
16916
16917 * tparam.h: New file.
16918 * term.c, tparam.h: Include it.
16919 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16920 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16921 Move these decls to tparam.h, and make them agree with what
16922 is actually in tparam.c. The previous trick of using incompatible
16923 decls in different modules does not conform to the C standard.
16924 All callers of tparam changed to use tparam's actual API.
16925 * tparam.c (tparam1, tparam, tgoto):
16926 Use const pointers where appropriate.
16927
16928 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16929 * cm.h (struct cm): Likewise.
16930 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16931 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16932 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16933 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16934 (turn_on_face, init_tty): Likewise.
16935 * termchar.h (struct tty_display_info): Likewise.
16936
16937 * term.c (term_mouse_position): Rename local to avoid shadowing.
16938
16939 * alloc.c (mark_ttys): Move decl from here ...
16940 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16941
16942 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16943
16944 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16945
16946 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
16947
16948 * search.c (compile_pattern_1): Remove argument regp, unused since
16949 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16950 (compile_pattern): Don't pass it.
16951
16952 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16953
16954 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16955 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16956 for ! HAVE_GTK3.
16957 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16958
16959 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16960
16961 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16962 gdk_window_get_screen, gdk_window_get_geometry,
16963 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16964 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16965 (xg_get_pixbuf_from_pixmap): New function.
16966 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16967 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16968 Call xg_get_pixbuf_from_pixmap instead of
16969 gdk_pixbuf_get_from_drawable.
16970 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16971 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16972 (xg_check_special_colors): Use GtkStyleContext and its functions
16973 for HAVE_GTK3.
16974 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16975 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16976 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
16977 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16978 Call gtk_widget_get_preferred_size.
16979 (xg_frame_resized): gdk_window_get_geometry only takes 5
16980 parameters.
16981 (xg_win_to_widget, xg_event_is_for_menubar):
16982 Call gdk_x11_window_lookup_for_display.
16983 (xg_set_widget_bg): New function.
16984 (delete_cb): New function.
16985 (xg_create_frame_widgets): Connect delete-event to delete_cb.
16986 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
16987 (xg_set_background_color): Call xg_set_widget_bg.
16988 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16989 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16990 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16991 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16992 if ! HAVE_GTK3.
16993 (update_frame_tool_bar): Call gtk_widget_hide.
16994 (xg_initialize): Use GDK_KEY_g.
16995
16996 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16997 if ! HAVE_GTK3
16998 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16999
17000 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17001 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17002 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17003
17004 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17005
17006 * w32xfns.c (select_palette): Check success of RealizePalette against
17007 GDI_ERROR, not zero.
17008
17009 See ChangeLog.11 for earlier changes.
17010
17011 ;; Local Variables:
17012 ;; coding: utf-8
17013 ;; End:
17014
17015 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17016
17017 This file is part of GNU Emacs.
17018
17019 GNU Emacs is free software: you can redistribute it and/or modify
17020 it under the terms of the GNU General Public License as published by
17021 the Free Software Foundation, either version 3 of the License, or
17022 (at your option) any later version.
17023
17024 GNU Emacs is distributed in the hope that it will be useful,
17025 but WITHOUT ANY WARRANTY; without even the implied warranty of
17026 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17027 GNU General Public License for more details.
17028
17029 You should have received a copy of the GNU General Public License
17030 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.