1 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3 More signal-handler cleanup (Bug#12327).
4 * floatfns.c: Comment fix.
5 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7 and anyway the declaration is harmless even if SIGDANGER is not defined.
8 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
9 defined BROKEN_FIONREAD). systty.h formerly did this, but other
10 source files not surprisingly expected syssignal.h to define, or
11 not define, SIGIO, and it's cleaner to do it that way, for consistency.
12 Include <sys/ioctl.h>, for FIONREAD.
13 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
14 This eliminates a problem whereby other files mysteriously had
15 to include "syssignal.h" before including "systty.h" if they
16 wanted to use "#ifdef SIGIO".
18 2012-09-07 Eli Zaretskii <eliz@gnu.org>
20 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
22 * w32.c (sigemptyset): Empty the set.
23 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
25 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
27 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
29 * alloc.c (mark_buffer): Revert unsafe marking optimization.
30 (mark_object): Likewise for frame objects.
32 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
34 * syssignal.h (handle_on_main_thread): Always declare,
35 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
36 This ports to platforms without HAVE_PTHREAD.
38 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
40 Signal-handler cleanup (Bug#12327).
41 Emacs's signal handlers were written in the old 4.2BSD style with
42 sigblock and sigmask and so forth, and this led to some
43 inefficiencies and confusion. Rewrite these to use
44 pthread_sigmask etc. without copying signal sets around. Also,
45 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
46 'signal', and instead use functions that do not attempt to take
47 over the system name space. This patch causes Emacs's text
48 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
49 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
50 Do not include <signal.h> or "syssignal.h", as these
51 modules do not use signals.
52 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
53 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
54 Do not include <signal.h>, as "syssignal.h" does that for us now.
55 * atimer.c (sigmask_atimers): New function.
56 (block_atimers, unblock_atimers): New functions,
57 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
59 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
60 no longer needed here.
61 * emacs.c (main): Inspect existing signal handler with sigaction,
62 so that there's no need to block and unblock SIGHUP.
63 * sysdep.c (struct save_signal): New member 'action', replacing
65 (save_signal_handlers, restore_signal_handlers):
66 Use sigaction instead of 'signal' to save and restore.
67 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
68 New function. All users of 'signal' modified to use set_sighandler
69 if they're writeonly, and to use sys_signal if they're read+write.
70 (emacs_sigaction_init, forwarded_signal): New functions.
71 (sys_signal): Remove. All uses replaced by calls to sigaction
72 and emacs_sigaction_init, or by direct calls to 'signal'.
73 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
74 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
75 all uses replaced by pthread_sigmask etc. calls.
76 * syssignal.h: Include <signal.h>.
77 (emacs_sigaction_init, forwarded_signal): New decls.
78 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
79 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
80 (sigmask, sys_sigmask): Remove; no longer needed.
81 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
82 (sigblock, sigunblock, sigfree):
83 (sigsetmask) [!defined sigsetmask]:
84 Remove. All uses replaced by pthread_sigmask.
85 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
86 no longer need to be replaced, and its typical old uses
87 are now done via emacs_sigaction_init and sigaction.
88 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
89 (sys_sigdel): Remove; unused.
90 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
92 2012-09-06 Eli Zaretskii <eliz@gnu.org>
94 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
95 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
97 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
99 Explicitly mark buffer_defaults and buffer_local_symbols.
100 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
101 mark_local_symbols here.
102 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
103 since special buffers aren't marked here any more.
104 (allocate_buffer): Chain new buffer with all_buffers here...
105 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
107 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
108 (syms_of_buffer): Remove staticpro of the above.
109 (init_buffer_once): Set names for buffer_defaults and
110 buffer_local_symbols.
112 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
114 Use bool for booleans in font-related modules.
115 * font.c (font_intern_prop, font_style_to_value)
116 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
117 (generate_otf_features, font_check_otf_features, font_check_otf)
118 (font_match_p, font_list_entities, font_at):
119 * fontset.c (fontset_id_valid_p, reorder_font_vector
120 (fontset_find_font, Fset_fontset_font)
121 (face_suitable_for_char_p) [0]:
122 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
123 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
124 (m17n_flt_initialized, ftfont_shape_by_flt):
125 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
126 * nsfont.m (nsfont_draw):
127 * w32font.c (w32font_draw):
128 * w32term.c (x_draw_glyphless_glyph_string_foreground):
129 Use bool for booleans.
130 * font.h: Adjust to above API changes.
131 (struct font, struct font_driver, struct font_driver_list):
132 Use bool for booleans.
133 (struct font): Remove useless member encoding_type.
135 * fontset.c, xftfont.c: Omit unnecessary static decls.
137 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
139 * alloc.c (mark_object): Revert window marking code
140 since it's unsafe for the Fset_window_configuration.
142 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
144 Fix race conditions with signal handlers and errno (Bug#12327).
145 Be more systematic about preserving errno whenever a signal
146 handler returns, even if it's not in the main thread. Do this by
147 renaming signal handlers to distinguish between signal delivery
148 and signal handling. All uses changed.
149 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
150 * data.c (deliver_arith_signal): Rename from arith_error.
151 * dispnew.c (deliver_window_change_signal): Rename from
152 window_change_signal.
153 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
154 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
155 * keyboard.c (deliver_input_available_signal): Rename from
156 input_available_signal.
157 (deliver_user_signal): Rename from handle_user_signal.
158 (deliver_interrupt_signal): Rename from interrupt_signal.
159 * process.c (deliver_pipe_signal): Rename from send_process_trap.
160 (deliver_child_signal): Rename from sigchld_handler.
161 * atimer.c (handle_alarm_signal):
162 * data.c (handle_arith_signal):
163 * dispnew.c (handle_window_change_signal):
164 * emacs.c (handle_fatal_signal, handle_danger_signal):
165 * keyboard.c (handle_input_available_signal):
166 * keyboard.c (handle_user_signal, handle_interrupt_signal):
167 * process.c (handle_pipe_signal, handle_child_signal):
168 New functions, with the actual signal-handling code taken from the
169 original respective signal handlers, sans the sporadic attempts to
170 preserve errno, since that's now done by handle_on_main_thread.
171 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
172 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
173 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
175 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
176 Move initialization of main_thread to sysdep.c's init_signals.
177 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
178 our usage, and simplifies the mainline code.
179 (record_child_status_change): New static function, as a helper
180 for handle_child_signal, and with most of the old child handler's
182 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
183 (handle_child_signal): Use the above.
184 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
185 Moved here from emacs.c.
186 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
187 code moved here from emacs.c's main function.
188 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
189 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
190 lets callers save and restore errno properly.
192 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
194 Remove redundant or unused things here and there.
195 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
196 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
197 * editfns.c (Fcompare_buffer_substrings): Likewise.
198 * frame.h (struct terminal, struct font_driver_list):
199 Remove redundant declarations.
200 * window.h (Qleft, Qright): Likewise.
202 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
204 Do not mark objects from deleted buffers, windows and frames.
205 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
206 (mark_object): Likewise for windows and frames.
208 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
210 * alloc.c (valid_lisp_object_p): Treat killed buffers,
211 buffer_defaults and buffer_local_symbols as valid objects.
212 Return special value to denote them.
214 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
216 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
217 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
218 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
219 (file_name_absolute_p, Fsubstitute_in_file_name):
220 (check_executable, check_writable, Ffile_accessible_directory_p)
221 (Fset_file_selinux_context, Fdefault_file_modes)
222 (Finsert_file_contents, choose_write_coding_system)
223 (Fwrite_region, build_annotations, a_write, e_write)
225 * filelock.c (boot_time_initialized, get_boot_time)
226 (get_boot_time_1, lock_file_1, within_one_second):
227 * floatfns.c (in_float):
228 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
229 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
230 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
231 * lisp.h (struct Lisp_Hash_Table.cmpfn):
232 * window.c (compare_window_configurations):
233 Use bool for booleans.
234 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
235 (Fdefault_file_modes): Now mode_t, not int, for modes.
236 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
237 (internal_delete_file): Now returns void, not a (boolean) int,
238 since nobody was looking at the return value.
239 * lisp.h, window.h: Adjust to above API changes.
241 * xdisp.c (set_message): Simplify and reindent last change.
243 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
245 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
247 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
249 * eval.c (call_debugger): Make the function non-static so that we
250 can call it from set_message.
252 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
253 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
255 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
257 Give more-useful info on a fatal error (Bug#12328).
258 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
259 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
260 of doing the work ourselves.
261 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
263 (fatal_error_backtrace): New function, taken from the guts
264 of the old fatal_error_signal, but with a new option to output
266 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
267 info about the signal than just its number.
268 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
269 * sysdep.c: Include <execinfo.h>
270 (emacs_backtrace): New function, taken partly from the previous
271 code of the 'die' function.
272 (emacs_abort): Call fatal_error_backtrace rather than abort.
274 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
276 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
277 eager (load-time) macro-expansion.
278 * lisp.mk (lisp): Add macroexp.
280 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
282 Simplify redefinition of 'abort' (Bug#12316).
283 Do not try to redefine the 'abort' function. Instead, redo
284 the code so that it calls 'emacs_abort' rather than 'abort'.
285 This removes the need for the NO_ABORT configure-time macro
286 and makes it easier to change the abort code to do a backtrace.
287 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
288 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
289 Remove; sysdep.c's emacs_abort now takes its place.
290 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
291 'abort' changed to use 'emacs_abort'.
292 * msdos.c (dos_abort) [defined abort]: Remove; not used.
293 (abort) [!defined abort]: Rename to ...
294 (emacs_abort): ... new name.
295 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
296 the place of the old 'abort' in emacs.c.
297 * w32.c, w32fns.c (abort): Do not #undef.
298 * w32.c (emacs_abort): Rename from w32_abort.
300 2012-09-04 Eli Zaretskii <eliz@gnu.org>
302 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
303 offsets[j].dv, since the y axis of the screen coordinates points
304 down, while the y axis of the font definition coordinates points
305 up. This fixes display of Arabic diacritics such as KASRA and
306 KASRATAN. (Bug#11860)
308 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
310 Be more systematic about _setjmp vs setjmp.
311 * alloc.c (test_setjmp, mark_stack):
312 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
313 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
314 (png_load, my_error_exit, jpeg_load):
315 * process.c (send_process_trap, send_process):
316 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
317 The underscored versions are up to 30x faster on some hosts.
318 Formerly, the code used setjmp+longjmp sometimes and
319 _setjmp+_longjmp at other times, with no particular reason to
320 prefer setjmp+longjmp.
322 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
324 Fix minor problem found by static checking.
325 * buffer.c (Fdelete_all_overlays): Return nil.
327 2012-09-03 Martin Rudalics <rudalics@gmx.at>
329 * buffer.c (Fdelete_all_overlays): New function.
331 2012-09-03 Chong Yidong <cyd@gnu.org>
333 * gtkutil.c: Add extern decl for Qxft.
335 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
337 * emacs.c, eval.c: Use bool for boolean.
338 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
339 (malloc_using_checking) [DOUG_LEA_MALLOC]:
340 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
341 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
342 (main, decode_env_path, Fdaemon_initialized):
343 * eval.c (call_debugger, Finteractive_p, interactive_p):
344 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
345 (maybe_call_debugger, Fbacktrace):
346 * process.c (read_process_output, exec_sentinel):
347 Use bool for booleans.
348 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
350 * eval.c (interactive_p): Omit always-true boolean argument
351 EXCLUDE_SUBRS_P. All callers changed.
352 * dispextern.h, lisp.h: Reflect above API changes.
353 * firstfile.c (dummy): Use the address of 'main', whose signature
354 won't change, instead of the address of 'initialize', whose
355 signature just changed from int to bool.
356 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
357 * msdos.c (fatal_error_in_progress): ... from here.
358 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
360 (redisplay_internal, unwind_redisplay): Simply clear
361 REDISPLAYING_P when unwinding, instead of saving its previous,
362 always-false value and then restoring it.
364 Clean up some extern decls.
365 Mostly, this hoists extern decls out of .c files and into .h files.
366 That way, we're more likely to catch errors if the interfaces change.
367 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
368 declare xg_mark_data.
369 * dispextern.h (x_frame_parm_handlers):
371 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
372 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
373 (Qultra_bold, Qoblique, Qitalic):
374 Move extern decl here from .c file.
375 * alloc.c (xg_mark_data) [USE_GTK]:
377 * eval.c (Qlexical_binding):
378 * fns.c (time) [!HAVE_UNISTD_H]:
379 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
380 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
381 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
382 * lread.c (Qinternal_interpreter_environment):
383 * minibuf.c (Qbuffer):
384 * process.c (QCfamily, QCfilter):
385 * widget.c (free_frame_faces):
386 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
387 * xfont.c (x_clear_errors):
388 * xterm.c (x_frame_parm_handlers):
389 Remove now-redundant extern decls.
390 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
391 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
393 * xfaces.c: Remove unnecessary static decls.
394 * xterm.c (updating_frame): Remove decl of nonexistent object.
396 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
397 when building globals.h, as the objects that are not built on
398 this host are not needed to compile C files on this host.
400 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
402 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
404 * frame.h: Add missing prototype for x_wm_set_size_hint.
406 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
408 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
409 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
410 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
411 (Fsubstitute_command_keys):
412 * editfns.c (region_limit, find_field, Fconstrain_to_field)
413 (save_excursion_save, save_excursion_restore)
414 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
415 (format_time_string, general_insert_function)
416 (make_buffer_string, make_buffer_string_both)
417 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
418 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
419 (copy_text, insert_1, insert_1_both, insert_from_string)
420 (insert_from_string_before_markers, insert_from_string_1)
421 (insert_from_buffer, insert_from_buffer_1, replace_range)
422 (replace_range_2, del_range_1, del_range_byte, del_range_both)
423 (del_range_2, modify_region):
424 * intervals.c (intervals_equal, balance_possible_root_interval)
425 (adjust_intervals_for_insertion, merge_properties_sticky)
426 (graft_intervals_into_buffer, lookup_char_property)
427 (adjust_for_invis_intang, set_point_both)
428 (get_property_and_range, compare_string_intervals)
429 (set_intervals_multibyte_1, set_intervals_multibyte):
430 * keyboard.c (decode_timer):
431 Use bool for boolean.
432 * intervals.h, lisp.h, systime.h: Reflect above API changes.
433 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
435 2012-09-02 Chong Yidong <cyd@gnu.org>
437 * keymap.c (push_key_description): Print M-TAB as C-M-i
440 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
442 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
443 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
444 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
445 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
446 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
447 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
448 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
450 2012-09-01 Eli Zaretskii <eliz@gnu.org>
452 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
453 more than one grapheme cluster passed to the shaper: compute the
454 offset adjustment values separately for each cluster. (Bug#11860)
456 * image.c: Restore mistakenly removed inclusion of w32.h. Without
457 it, GCC doesn't see prototypes of w32_delayed_load, and complains
458 about implicit conversions from integer to pointer.
460 2012-09-01 Daniel Colascione <dancol@dancol.org>
462 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
463 system used too early.
465 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
467 Better seed support for (random).
468 * emacs.c (main): Call init_random.
469 * fns.c (Frandom): Set the seed from a string argument, if given.
470 Remove long-obsolete Gentzel cruft.
471 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
472 (init_random): New function.
474 2012-09-01 Daniel Colascione <dancol@dancol.org>
476 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
477 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
478 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
479 x_wm_set_size_hint, x_query_colors, x_real_positions,
480 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
481 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
482 all of which have been moved to common code.
484 * xfaces.c: Include TERM_HEADER instead of listing all possible
485 window-system headers.
487 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
490 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
491 directly accessing frame internals.
493 * w32font.h: Include font.h. Define syms_of_w32font and
496 * process.c: Include TERM_HEADER instead of listing all possible
497 window-system headers.
499 * nsterm.h: Remove declarations now in frame.h. Define
500 FRAME_X_SCREEN, FRAME_X_VISUAL.
502 * menu.c: Include TERM_HEADER instead of listing all possible
503 window-system headers.
505 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
508 * keyboard.c: Include TERM_HEADER instead of listing all possible
509 window-system headers.
511 * image.c: Include TERM_HEADER instead of listing all possible
512 window-system headers. Declare Vlibrary_cache when compiling for
515 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
516 window system declarations.
518 * frame.h: Move common functions here: set_frame_menubar,
519 x_set_window_size, x_sync, x_get_focus_frame,
520 x_set_mouse_position, x_set_mouse_pixel_position,
521 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
522 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
523 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
524 x_activate_menubar, x_real_positions, x_bitmap_icon,
525 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
528 * frame.c: Include TERM_HEADER instead of listing all possible
529 window-system headers.
531 * font.c: Include TERM_HEADER instead of listing all possible
532 window-system headers.
534 * emacs.c: Include TERM_HEADER.
536 * dispnew.c: Include TERM_HEADER instead of listing all possible
537 window-system headers.
539 * ccl.h: Include character.h.
541 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
542 the current window system; include in list of objects to link into
545 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
547 Remove mark_ttys function and fix tty_display_info initialization.
548 * lisp.h (mark_ttys): Remove prototype.
549 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
550 to mark_ttys because all possible values of 'top_frame' slot are
551 the frames which are reachable from Vframe_list.
552 * term.c (mark_ttys): Remove.
553 (init_tty): Safely initialize 'top_frame' slot with Qnil.
555 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
557 Change struct frame bitfields from unsigned char to unsigned.
558 * frame.h (struct frame): Change type of 'display_preempted',
559 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
560 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
561 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
562 bitfields from unsigned char to unsigned.
564 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
566 Remove unused member of struct x_output and struct w32_output.
567 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
568 * w32term.h (struct w32_output): Likewise.
570 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
572 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
573 does not become zero (Bug#12234).
575 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
577 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
578 for GCC 4.7.1 x86-64.
580 2012-08-30 Glenn Morris <rgm@gnu.org>
582 * lread.c (init_lread): For out-of-tree builds, only add the
583 source directory's site-lisp dir to the load-path if it exists,
584 consistent with in-tree builds. (Bug#12302)
586 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
588 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
589 button_values to NULL. Call setStykeMask so dialogs get a close button.
590 (windowShouldClose:): Set window_closed.
591 (dealloc): New member, free button_values.
592 (process_dialog:): Make member function. Remove window argument,
593 replace window with self. Count buttons and allocate and store values
595 (addButton:value:row:): value is int with the name tag. Call setTag
596 with tag. Remove return self, declare return value as void.
597 (addString:row:): Remove return self, declare return value as void.
598 (addSplit): Remove return self, declare return value as void.
599 (clicked:): Remove return self, declare return value as void.
600 Set dialog_return to button_values[seltag]. Code formatting change.
601 (initFromContents:isQuestion:): Adjust call to process_dialog.
602 Code formatting change.
603 (timeout_handler:): Set timer_fired to YES.
604 (runDialogAt:): Set timer_fired to NO.
605 Handle click on close button as quit.
607 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
608 Add window_closed and button_values. Add void as return value for
609 add(Button|String|Split). addButton takes int instead of Lisp_Object.
610 Add process_dialog as new member.
612 2012-08-28 Eli Zaretskii <eliz@gnu.org>
614 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
615 is not one of the heaps we manage. (Bug#12242)
617 2012-08-28 Glenn Morris <rgm@gnu.org>
619 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
621 2012-08-28 Martin Rudalics <rudalics@gmx.at>
623 * window.c (Fset_window_configuration): Remove handling of
624 auto-buffer-name window parameter. Install revision of reverted
627 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
629 Do not allow to set major mode for a dead buffer.
630 * buffer.c (Fset_buffer_major_mode): Signal an error
631 if the buffer is dead.
632 (Fother_buffer, other_buffer_safely): Remove redundant
635 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
637 Always use set_buffer_if_live to restore original buffer at unwind.
638 * buffer.h (record_unwind_current_buffer): New function.
639 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
640 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
641 * undo.c, window.c: Adjust users.
642 * buffer.c (set_buffer_if_live): Fix comment.
644 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
646 Fix usage of set_buffer_internal.
647 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
648 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
649 * coding.c (decode_coding): Omit redundant test.
650 * fileio.c (decide_coding_unwind): Likewise.
651 * fns.c (secure_hash): Likewise.
652 * insdel.c (modify_region): Likewise.
653 * keyboard.c (command_loop_1): Likewise.
654 * print.c (PRINTFINISH): Likewise.
655 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
657 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
659 * dispnew.c: Use bool for boolean.
660 (frame_garbaged, display_completed, delayed_size_change)
661 (fonts_changed_p, add_window_display_history)
662 (add_frame_display_history, verify_row_hash)
663 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
664 (row_equal_p, realloc_glyph_pool)
665 (allocate_matrices_for_frame_redisplay)
666 (showing_window_margins_p)
667 (adjust_frame_glyphs_for_frame_redisplay)
668 (build_frame_matrix_from_leaf_window, make_current)
669 (mirrored_line_dance, mirror_line_dance, update_frame)
670 (update_window_tree, update_single_window)
671 (check_current_matrix_flags, update_window, update_text_area)
672 (update_window_line, set_window_update_flags, scrolling_window)
673 (update_frame_1, scrolling, buffer_posn_from_coords)
674 (do_pending_window_change, change_frame_size)
675 (change_frame_size_1, sit_for):
676 Use bool for boolean.
677 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
678 and remove last int (actually boolean) argument, which was always 0.
680 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
681 * dispextern.h (struct composition_it): Use bool for boolean.
682 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
683 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
684 * dired.c (file_name_completion):
685 Use bool for boolean. (This was missed in an earlier change.)
687 2012-08-27 Martin Rudalics <rudalics@gmx.at>
689 * window.c (Fset_window_configuration): Revert first part of
692 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
694 * nsterm.h (NSPanel): New class variable dialog_return.
696 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
698 (windowShouldClose:): Use stop instead of stopModalWithCode.
699 (clicked:): Ditto, and also set dialog_return (Bug#12258).
700 (timeout_handler:): Use stop instead of abortModal. Send a dummy
702 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
705 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
707 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
708 * composite.c (find_composition, composition_gstring_p)
709 (composition_reseat_it, find_automatic_composition):
710 * data.c (let_shadows_buffer_binding_p)
711 (let_shadows_global_binding_p, set_internal, make_blv)
712 (Fmake_variable_buffer_local, Fmake_local_variable)
713 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
714 (cons_to_signed, arith_driver):
715 * dbusbind.c (xd_in_read_queued_messages):
716 * dired.c (directory_files_internal, file_name_completion):
717 Use bool for booleans.
718 * dired.c (file_name_completion):
719 * process.h (fd_callback):
720 Omit int (actually boolean) argument. It wasn't being used.
722 * composite.h, lisp.h: Reflect above API changes.
724 * cmds.c, coding.c: Use bool for booleans.
725 * cmds.c (move_point, Fself_insert_command):
726 * coding.h (struct composition status, struct coding_system):
727 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
728 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
729 (emacs_mule_char, decode_coding_emacs_mule)
730 (encode_coding_emacs_mule, detect_coding_iso_2022)
731 (decode_coding_iso_2022, encode_invocation_designation)
732 (encode_designation_at_bol, encode_coding_iso_2022)
733 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
734 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
735 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
736 (encode_coding_raw_text, detect_coding_charset)
737 (decode_coding_charset, encode_coding_charset, detect_eol)
738 (detect_coding, get_translation_table, produce_chars)
739 (consume_chars, reused_workbuf_in_use)
740 (make_conversion_work_buffer, code_conversion_save)
741 (decode_coding_object, encode_coding_object)
742 (detect_coding_system, char_encodable_p)
743 (Funencodable_char_position, code_convert_region)
744 (code_convert_string, code_convert_string_norecord)
745 (Fset_coding_system_priority):
746 * fileio.c (Finsert_file_contents):
747 Use bool for booleans.
748 * coding.h, lisp.h: Reflect above API changes.
749 * coding.c: Remove unnecessary static function decls.
750 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
751 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
752 not a boolean 'int', since callers never look at the return value.
753 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
754 * coding.h (decoding_buffer_size, encoding_buffer_size)
755 (emacs_mule_string_char): Remove unused extern decls.
756 (struct iso_2022_spec, struct coding_system):
757 Use 'unsigned int : 1' for boolean fields, since there's more than one.
758 (struct emacs_mule_spec): Remove unused field 'full_support'.
759 All initializations removed.
760 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
762 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
764 Fix spare memory change (Bug#12286).
765 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
766 (valid_lisp_object_p): Likewise.
768 2012-08-27 Martin Rudalics <rudalics@gmx.at>
770 * window.c (Fset_window_configuration): Record any window's old
771 buffer if it's replaced (see Bug#8789). If the new current
772 buffer doesn't appear in the selected window, go to its old
775 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
777 Special MEM_TYPE_SPARE to denote reserved memory.
778 * alloc.c (enum mem_type): New memory type.
779 (refill_memory_reserve): Use new type for spare memory.
780 This prevents live_cons_p and live_string_p from incorrect
781 detection of uninitialized objects from spare memory as live.
783 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
786 * Makefile.in (.PHONY): versioclean -> versionclean.
788 Remove unused external symbols.
789 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
790 * window.c (Qwindow_valid_p, decode_valid_window):
791 Now static, not extern.
792 * data.c (Qinterval): Remove; unused.
793 (syms_of_data): Do not define 'interval'.
794 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
795 * window.h (decode_valid_window):
798 * character.c, charset.c, chartab.c: Use bool for booleans.
799 * character.c (lisp_string_width, string_count_byte8)
800 (string_escape_byte8):
801 * charset.c (charset_map_loaded, load_charset_map, read_hex):
802 (load_charset_map_from_file, map_charset_chars)
803 (Fdefine_charset_internal, define_charset_internal)
804 (Fdeclare_equiv_charset, find_charsets_in_text)
805 (Ffind_charset_region, char_charset, Fiso_charset):
806 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
807 (sub_char_table_set, sub_char_table_set_range)
808 (char_table_set_range, optimize_sub_char_table)
809 (map_sub_char_table):
810 Use bool for boolean.
811 * character.c (str_to_unibyte): Omit last boolean argument; it was
812 always 0. All callers changed.
813 * character.h, charset.h: Adjust to match previous changes.
814 * character.h (char_printable_p): Remove decl of nonexistent function.
815 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
816 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
817 are all boolean, so make them single-bit bitfields.
819 * lisp.h (ASET): Remove attempt to detect side effects.
820 It was meant to be temporary and it often doesn't work,
821 because when IDX has side effects the behavior of IDX==IDX
822 is undefined. See Stefan Monnier in
823 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
825 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
827 * lisp.h (functionp): New function (extracted from Ffunctionp).
829 * eval.c (Ffunctionp): Use it.
831 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
833 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
834 as that's faster and simpler than static storage. Don't bother
835 with the g_main_context_query overhead if g_main_context_pending
836 says no events are pending.
837 (gfds, gfds_size): Remove these static vars.
838 (xgselect_initialize): Remove; no longer needed.
839 All uses and decls removed.
841 * emacs.c (fatal_error_signal_hook): Remove.
842 All uses removed. This leftover from old code was always 0.
844 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
845 * casefiddle.c (casify_object, casify_region):
846 * casetab.c (set_case_table):
847 * category.c, category.h (word_boundary_p):
848 * category.h (CHAR_HAS_CATEGORY):
849 Use bool for booleans, instead of int.
851 2012-08-25 Eli Zaretskii <eliz@gnu.org>
853 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
855 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
857 On assertion failure, print backtrace if available.
858 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
859 (die) [ENABLE_CHECKING]: Print a backtrace if available.
860 * Makefile.in (LIB_EXECINFO): New macro.
863 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
864 * bytecode.c (exec_byte_code):
865 * callint.c (check_mark, Fcall_interactively):
866 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
867 (getenv_internal, sync_process_alive, call_process_exited):
868 * lisp.h (USE_SAFE_ALLOCA):
869 Use bool for booleans, instead of int.
870 * lisp.h, process.h: Adjust prototypes to match above changes.
871 * callint.c (Fcall_interactively): Don't assume the mark's
872 offset fits in 'int'.
874 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
876 * buffer.c, buffer.h: Use bool for boolean.
877 * buffer.c (reset_buffer_local_variables)
878 (buffer_lisp_local_variables, Fset_buffer_modified_p)
879 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
880 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
881 (overlay_touches_p, overlay_strings, Foverlay_put)
882 (report_overlay_modification, call_overlay_mod_hooks):
883 (mmap_enlarge, mmap_set_vars):
884 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
885 Use bool for booleans, instead of int.
886 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
887 since the 1-or-0 return value is always ignored anyway.
888 (mmap_initialized_p):
889 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
890 * buffer.h, lisp.h: Adjust prototypes to match above changes.
892 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
894 * bidi.c: Use bool for boolean.
895 This is a bit more readable, and makes the text segment of bidi.o
896 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
897 Presumably it's faster too.
898 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
900 (bidi_cache_find_level_change, bidi_cache_iterator_state)
901 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
902 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
903 (bidi_explicit_dir_char, bidi_level_of_next_char)
904 (bidi_find_other_level_edge, bidi_move_to_visually_next):
905 Use bool for booleans, instead of int.
906 * dispextern.h (bidi_init_it, bidi_paragraph_init)
907 (bidi_unshelve_cache): Adjust decls to match code.
909 2012-08-23 Martin Rudalics <rudalics@gmx.at>
911 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
914 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
916 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
917 * atimer.h: Include <stdbool.h>.
919 2012-08-22 Dan Nicolaescu <dann@gnu.org>
921 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
922 compile time tests instead of run time tests on systems that do
924 (FRAME_MAC_P): Remove leftover from deleted code.
925 * frame.c (syms_of_frame): Remove leftover from deleted code.
927 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
929 * nsterm.m (insertText:): Don't clear modifiers if code is space.
931 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
933 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
934 Otherwise, the compiler complains about (A?B:C) where B is void
935 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
936 (fontset_add): Return void, for FONTSET_ADD.
938 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
940 * alloc.c: Use bool for booleans.
941 (gc_in_progress, abort_on_gc)
942 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
943 (dont_register_blocks) [GC_MALLOC_CHECK]:
944 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
945 (check_string_bytes, make_specified_string, memory_full)
946 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
947 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
948 (mark_stack, valid_pointer_p, make_pure_string)
949 (Fgarbage_collect, survives_gc_p, gc_sweep):
950 Use bool for booleans, instead of int.
951 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
953 * alloc.c (PURE_POINTER_P):
954 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
955 * editfns.c (Fformat):
956 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
958 * fns.c (sweep_weak_table):
959 * lisp.h (suppress_checking, push_message, survives_gc_p)
960 (make_pure_string, gc_in_progress, abort_on_gc):
961 * lread.c (readchar, read1):
962 * print.c (Fprin1_to_string):
963 * xdisp.c (push_message):
964 Use bool for booleans affected directly or indirectly by
967 Make recently-introduced setters macros.
968 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
969 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
970 (set_fontset_default, set_fontset_fallback): Rename from their
971 upper-case counterparts, and make them functions rather than macros.
972 This is more consistent with the other recently-introduced setters.
973 These don't need to be inline, since they're local.
975 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
977 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
978 the loop (Bug#12247).
980 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
982 * lisp.h (vcopy): Use memcpy rather than our own loop.
983 This fixes a performance regression introduced by the recent
984 addition of vcopy. This means 'vcopy' will need to be modified
985 for a copying collector, but that's OK. Also, tighten the
986 checking in the assertion.
988 2012-08-21 Eli Zaretskii <eliz@gnu.org>
990 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
991 components for RTL text (Bug#11860). Adjust X-OFFSET of each
992 non-base glyph for the width of the base character, according to
993 what x_draw_composite_glyph_string_foreground expects.
994 Generate WADJUST value according to composition_gstring_width's
995 expectations, to produce correct width of the composed character.
996 Reverse the sign of the DU offset produced by ScriptPlace.
998 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1000 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1002 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1004 Avoid direct writes to contents member of struct Lisp_Vector.
1005 * lisp.h (vcopy): New function to copy data into vector.
1006 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1007 * fns.c (Ffillarray): Use ASET.
1008 * keyboard.c (timer_check_2): Use AREF and ASET.
1009 (append_tool_bar_item, Frecent_keys): Use vcopy.
1010 * lread.c (read_vector): Use ASET.
1011 * msdos.c (Frecent_doskeys): Use vcopy.
1012 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1013 (Finternal_merge_in_global_face): Use ASET and vcopy.
1014 * xfont.c (xfont_list_pattern): Likewise.
1016 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1018 * window.c (Fwindow_point): For the selected window always return
1019 the position of its buffer's point.
1020 (Fset_window_point): For the selected window always go in its
1021 buffer to the specified position.
1023 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1025 Setter macros for fontsets.
1026 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1027 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1028 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1031 2012-08-20 Glenn Morris <rgm@gnu.org>
1033 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1034 Don't assume that `ln -f' works.
1036 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1038 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1039 and later about non-assignments with no effect. See discussion at
1040 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1043 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1045 Inline setter functions for Lisp_Objects slots of struct specbinding.
1046 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1049 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1051 * window.c (select_window): Always make selected window's buffer
1054 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1056 Use AREF and ASET for docstrings of category tables.
1057 * category.h (CATEGORY_DOCSTRING): Use AREF.
1058 (SET_CATEGORY_DOCSTRING): Use ASET.
1059 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1061 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1063 Inline setter functions for hash table members.
1064 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1065 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1066 (set_hash_key_and_value, set_hash_index, set_hash_next)
1067 (set_hash_hash): New functions.
1068 * charset.c, fns.c: Adjust users.
1070 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1072 Inline getter and setter functions for per-buffer values.
1073 * buffer.h (per_buffer_default, set_per_buffer_default)
1074 (per_buffer_value, set_per_buffer_value): New functions.
1075 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1076 * buffer.c, data.c: Adjust users.
1078 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1080 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1082 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1084 Rely on <config.h> + <unistd.h> to declare 'environ',
1085 as gnulib does this if the system doesn't.
1086 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1087 Remove declaration. MS-Windows declares it on stdlib.h which is
1088 included by conf_post.h.
1089 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1090 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1091 * vm-limit.c: Include <unistd.h>, for 'environ'.
1093 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1094 (start_of_data): Remove decl; mem-limits.h provides it.
1096 * xdisp.c (handle_invisible_prop): Make it a bit faster
1097 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1099 2012-08-19 Chong Yidong <cyd@gnu.org>
1101 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1104 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1106 * .gdbinit: Use call instead of set when calling a function in the
1109 * data.c (set_internal): Don't use set_blv_found.
1110 (Fkill_local_variable): Likewise.
1112 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1114 * nsfont.m (ns_ascii_average_width): Ensure the string
1115 ascii_printable is initialized with a null-terminated character
1116 array. Otherwise, it can contain undesired extra characters.
1118 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1120 port new setting code to Sun C 5.8 2005/10/13
1121 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1122 Return void, not Lisp_Object. Otherwise, the compiler
1123 complains about (A?B:C) where B is void and C is Lisp_Object
1124 when compiling CHAR_TABLE_SET, due to the recent change to
1125 the API of sub_char_table_set_contents.
1127 2012-08-18 Chong Yidong <cyd@gnu.org>
1129 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1130 for the string case (Bug#3874).
1132 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1134 * buffer.h (BSET): Remove (Bug#12215).
1135 Replace all uses with calls to new setter functions.
1136 (bset_bidi_paragraph_direction, bset_case_canon_table)
1137 (bset_case_eqv_table, bset_directory, bset_display_count)
1138 (bset_display_time, bset_downcase_table)
1139 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1140 (bset_last_selected_window, bset_local_var_alist)
1141 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1142 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1144 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1145 (bset_auto_fill_function, bset_auto_save_file_format)
1146 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1147 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1148 (bset_cache_long_line_scans, bset_case_fold_search)
1149 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1150 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1151 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1152 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1153 (bset_header_line_format, bset_indicate_buffer_boundaries)
1154 (bset_indicate_empty_lines, bset_invisibility_spec)
1155 (bset_left_fringe_width, bset_major_mode, bset_mark)
1156 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1157 (bset_name, bset_overwrite_mode, bset_pt_marker)
1158 (bset_right_fringe_width, bset_save_length)
1159 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1160 (bset_scroll_up_aggressively, bset_selective_display)
1161 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1162 (bset_word_wrap, bset_zv_marker):
1163 * category.c (bset_category_table):
1164 * syntax.c (bset_syntax_table):
1165 New setter functions.
1167 * process.h (PSET): Remove (Bug#12215).
1168 Replace all uses with calls to new setter functions.
1169 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1170 (PROCESS_INLINE): New macro.
1171 (pset_childp): New setter function.
1172 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1173 * process.c (PROCESS_INLINE):
1174 Define to EXTERN_INLINE, so that the corresponding functions
1175 are compiled into code.
1176 (pset_buffer, pset_command, pset_decode_coding_system)
1177 (pset_decoding_buf, pset_encode_coding_system)
1178 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1179 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1180 (pset_type, pset_write_queue): New setter functions.
1182 * window.h (WSET): Remove (Bug#12215).
1183 Replace all uses with calls to new setter functions.
1184 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1185 (WINDOW_INLINE): New macro.
1186 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1187 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1188 (wset_total_lines, wset_vertical_scroll_bar)
1189 (wset_window_end_pos, wset_window_end_valid)
1190 (wset_window_end_vpos): New setter functions.
1191 * window.c (WINDOW_INLINE):
1192 Define to EXTERN_INLINE, so that the corresponding functions
1193 are compiled into code.
1194 (wset_combination_limit, wset_dedicated, wset_display_table)
1195 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1196 (wset_new_normal, wset_new_total, wset_next_buffers)
1197 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1198 (wset_prev_buffers, wset_right_fringe_width)
1199 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1200 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1201 (wset_window_parameters):
1202 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1203 (wset_column_number_displayed, wset_region_showing):
1204 New setter functions.
1206 * termhooks.h (TSET): Remove (Bug#12215).
1207 Replace all uses with calls to new setter functions.
1208 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1209 (TERMHOOKS_INLINE): New macro.
1210 (tset_charset_list, tset_selection_alist): New setter functions.
1211 * terminal.c (TERMHOOKS_INLINE):
1212 Define to EXTERN_INLINE, so that the corresponding functions
1213 are compiled into code.
1214 (tset_param_alist): New setter function.
1216 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1218 * keyboard.h (KSET): Remove (Bug#12215).
1219 Replace all uses with calls to new setter functions.
1220 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1221 (KEYBOARD_INLINE): New macro.
1222 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1223 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1224 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1225 New setter functions.
1226 * keyboard.c (KEYBOARD_INLINE):
1227 Define to EXTERN_INLINE, so that the corresponding functions
1228 are compiled into code.
1229 (kset_echo_string, kset_kbd_queue)
1230 (kset_keyboard_translate_table, kset_last_prefix_arg)
1231 (kset_last_repeatable_command, kset_local_function_key_map)
1232 (kset_overriding_terminal_local_map, kset_real_last_command)
1233 (kset_system_key_syms): New setter functions.
1235 * frame.h (FSET): Remove (Bug#12215).
1236 Replace all uses with calls to new setter functions.
1237 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1238 (FRAME_INLINE): New macro.
1239 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1240 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1241 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1242 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1243 (fset_param_alist, fset_root_window, fset_scroll_bars)
1244 (fset_selected_window, fset_title, fset_tool_bar_items)
1245 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1246 * frame.c (FRAME_INLINE):
1247 Define to EXTERN_INLINE, so that the corresponding functions
1248 are compiled into code.
1249 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1251 A few more naming-convention fixes for getters and setters.
1252 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1253 and rename from buffer_overlays_set_before.
1254 (set_buffer_overlays_after): Move here from buffer.h, and rename
1255 from buffer_overlays_set_after.
1256 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1258 (set_buffer_intervals): Rename from buffer_set_intervals.
1259 * intervals.c (set_interval_object): Move here from intervals.h,
1260 and rename from interval_set_object.
1261 (set_interval_left): Move here from intervals.h, and rename from
1263 (set_interval_right): Move here from intervals.h, and rename from
1265 (copy_interval_parent): Move here from intervals.h, and rename from
1266 interval_copy_parent.
1267 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1268 (set_interval_plist): Rename from interval_set_plist.
1269 Return void, not Lisp_Object, since no caller uses the result.
1270 * lisp.h (string_intervals): Rename from string_get_intervals.
1271 (set_string_intervals): Rename from string_set_intervals.
1273 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1274 (set_char_table_contents): Rename from char_table_set_contents.
1275 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1276 All uses changed. See the end of
1277 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1279 * lisp.h (CSET): Remove (Bug#12215).
1280 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1281 (set_char_table_purpose): New functions,
1282 replacing CSET. All uses changed. For example, replace
1283 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1284 "set_char_table_parent (char_table, parent);".
1285 The old version was confusing because it used the same name
1286 'parent' for two different things.
1288 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1290 Functions to get and set Lisp_Object fields of buffer-local variables.
1291 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1292 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1293 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1294 * data.c, eval.c, frame.c: Adjust users.
1296 2012-08-17 Chong Yidong <cyd@gnu.org>
1298 * xfaces.c (merge_face_vectors): If the target font specfies a
1299 font spec, make the font's attributes take precedence over
1300 directly-specified attributes.
1301 (merge_face_ref): Recognize :font.
1303 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1305 Do not use memcpy for copying intervals.
1306 * intervals.c (reproduce_interval): New function.
1307 (reproduce_tree, reproduce_tree_obj): Use it.
1308 (reproduce_tree_obj): Remove prototype.
1310 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1312 * lisp.h (duration_to_sec_usec): Remove unused decl.
1314 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1316 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1317 to an allocated instance of NSString, not to the class itself.
1319 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1321 * makefile.w32-in (C_CTYPE_H): New macro.
1322 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1323 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1324 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1326 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1328 Use ASCII tests for character types.
1329 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1331 Don't include <ctype.h>; was not needed.
1332 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1333 * sysdep.c, xfaces.c:
1334 Include <c-ctype.h> instead of <ctype.h>.
1335 * nsterm.m: Include <c-ctype.h>.
1336 * charset.c (read_hex):
1337 * doc.c (Fsnarf_documentation):
1338 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1339 (DRIVE_LETTER) [DOS_NT]:
1340 (Ffile_name_directory, Fexpand_file_name)
1341 (Fsubstitute_in_file_name):
1342 * font.c (font_parse_xlfd, font_parse_fcname):
1343 * frame.c (x_set_font_backend):
1344 * gtkutil.c (xg_get_font):
1345 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1346 * nsimage.m (hexchar):
1347 * nsterm.m (ns_xlfd_to_fontname):
1348 * sysdep.c (system_process_attributes):
1349 * xfaces.c (hash_string_case_insensitive):
1350 Use C-locale tests instead of locale-specific tests for character
1351 types, since we want the ASCII interpretation here, not the
1352 interpretation suitable for whatever happens to be the current locale.
1354 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1356 Consistently check windows for validity/liveness
1357 (Bug#11984, Bug#12025, Bug#12026).
1358 * lisp.h (CHECK_VALID_WINDOW): New macro.
1359 * window.c (decode_window): Rename to decode_live_window.
1360 (decode_valid_window, Fwindow_valid_p): New functions.
1361 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1362 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1363 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1364 (Fwindow_prev_sibling, Fwindow_combination_limit)
1365 (Fset_window_combination_limit, Fwindow_use_time)
1366 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1367 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1368 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1369 (Fwindow_hscroll, Fset_window_hscroll)
1370 (Fwindow_redisplay_end_trigger)
1371 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1372 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1373 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1374 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1375 (Fwindow_end, Fset_window_point, Fset_window_start)
1376 (Fpos_visible_in_window_p, Fwindow_line_height)
1377 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1378 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1379 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1380 (Fset_window_parameter, Fwindow_display_table)
1381 (Fset_window_display_table, Fdelete_other_windows_internal)
1382 (Fset_window_buffer, Fset_window_new_total)
1383 (Fset_window_new_normal, Fdelete_window_internal)
1384 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1385 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1386 (Fwindow_scroll_bars): Check whether argument window is a valid or
1387 live window. Update doc-strings.
1388 (syms_of_window): New symbol Qwindow_valid_p.
1389 * keyboard.c (Fposn_at_x_y): Check whether argument
1390 frame_or_window denotes a valid window.
1392 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1394 Fix previous char table change.
1395 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1396 * chartab.c (optimize_sub_char_table): Likewise.
1398 2012-08-16 Chong Yidong <cyd@gnu.org>
1400 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1402 * xfont.c (xfont_open):
1403 * xftfont.c (xftfont_open): Set the font's max_width field.
1405 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1406 min_width to space_width and average_width to the average over
1407 printable ASCII characters.
1408 (ns_char_width): Code cleanup.
1409 (ns_ascii_average_width): New utility function.
1411 * font.h (struct font): Update comments.
1413 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1415 Simple interface to set Lisp_Object fields of character tables.
1416 * lisp.h (CSET): New macro.
1417 (char_table_set_extras, char_table_set_contents)
1418 (sub_char_table_set_contents): New function.
1419 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1420 * syntax.c: Adjust users.
1422 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1424 * eval.c (eval_sub): Bind lexical-binding.
1425 * lread.c (Qlexical_binding): Make non-static.
1427 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1429 * nsmenu.m (popupSession): Remove.
1430 (pop_down_menu): Remove endModalSession.
1431 (timeout_handler:): New method.
1432 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1433 Call runModalForWindow. Check timer_fired when it returns.
1434 If not set, cancel timer and break out of loop.
1435 Otherwise loop again, with a new timeout.
1437 * nsterm.m: Include fcntl.h if present.
1438 (fd_entry, t_readfds, inNsSelect): Remove.
1439 (select_writefds, select_valid, select_timeout, selfds)
1440 (select_mutex, apploopnr): Add.
1441 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1442 Otherwise call kbd_buffer_store_event.
1443 (ns_send_appdefined): Remove release of fd_entry.
1444 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1445 Increment and decrement apploopnr.
1446 (ns_select): If no file descriptors, just do a NSTimer.
1447 Otherwise copy read/write masks and start select thread (fd_handler).
1448 Start main loop and wait for application defined event.
1449 Inform select thread to stop selecting after main loop is exited.
1450 (ns_term_init): Create selfds pipe and set non-blocking.
1451 Initialize select_mutex. Start the select thread (fd_handler).
1452 (fd_handler:): Loop forever, wait for info from the main thread
1453 to either start or stop selecting. When select returns, send
1454 and appdefined event.
1455 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1456 If not call kbd_buffer_store_event.
1458 * nsterm.h (EmacsApp): fd_handler takes id argument.
1459 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1461 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1463 2012-08-15 Eli Zaretskii <eliz@gnu.org>
1465 * region-cache.c (move_cache_gap): Update gap_len using the actual
1466 growth of the boundaries array. Do not change cache_len.
1469 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1471 Generalize and cleanup font subsystem checks.
1472 * font.h (FONT_DEBUG, font_assert): Remove.
1473 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1474 Change font_assert to eassert. Use eassert where appropriate.
1476 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1478 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1480 2012-08-15 Chong Yidong <cyd@gnu.org>
1482 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1483 When using the new font chooser, use gtk_font_chooser_get_font_desc to
1484 extract the font descriptor instead of just the font name.
1485 In that case, return a font spec instead of a string.
1486 (x_last_font_name): Move to this file from xfns.c.
1488 * xfns.c (Fx_select_font): The return value can also be a font
1489 spec. Move x_last_font_name management to gtkutil.c.
1491 * xfaces.c: Make font weight and style symbols non-static.
1493 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1495 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1498 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1500 * alloc.c (Fgarbage_collect): Use plural form consistently.
1502 2012-08-14 Eli Zaretskii <eliz@gnu.org>
1504 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1505 iteration through the command loop. Fixes a problem whereby mouse
1506 movements are ignored until the first mouse click.
1508 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1510 Use bool, not int, for Lisp booleans.
1511 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1512 makes Emacs a bit smaller and presumably a bit faster.
1513 * lisp.h: Include <stdbool.h>.
1514 (struct Lisp_Boolfwd, defvar_bool):
1515 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1516 * regex.c [!emacs]: Include <stdbool.h>.
1517 (false, true): Remove; <stdbool.h> does this for us now.
1519 2012-08-14 Chong Yidong <cyd@gnu.org>
1521 * character.c (Fcharacterp): Doc fix (Bug#12076).
1523 * data.c (Findirect_variable): Doc fix (Bug#11040).
1525 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1527 * editfns.c (Fformat): Doc fix (Bug#12059).
1528 (Fsave_current_buffer): Doc fix (Bug#11542).
1530 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1532 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1535 2012-08-14 Martin Rudalics <rudalics@gmx.at>
1537 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1538 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1539 * minibuf.c (choose_minibuf_frame, read_minibuf):
1540 * w32fns.c (x_create_tip_frame):
1541 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1542 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1544 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1546 * intervals.c (offset_intervals): Remove obsolete comment.
1548 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1550 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1552 2012-08-14 Gergely Risko <gergely@risko.hu>
1554 * coding.c (decode_coding): Record buffer modification before
1555 disabling undo_list (Bug#11773).
1557 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1559 Revert and cleanup some recent overlay changes.
1560 * buffer.h (enum overlay_type): Remove.
1561 (buffer_get_overlays, buffer_set_overlays): Likewise.
1562 (buffer_set_overlays_before, buffer_set_overlays_after):
1563 New function. Adjust users.
1564 (unchain_both): Add eassert.
1566 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1568 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1570 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1572 * gtkutil.c (xg_mark_data): Don't assume C99.
1574 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1576 * gtkutil.c (xg_frame_tb_info): New struct.
1577 (TB_INFO_KEY): New define.
1578 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1579 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1580 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1582 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1583 is up to date. Otherwise store new data.
1584 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1586 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1588 Use KSET for write access to Lisp_Object members of struct kboard.
1589 * keyboard.h (KSET): New macro.
1590 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1591 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1592 * xterm.c: Adjust users.
1594 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1596 Use BSET for write access to Lisp_Object members of struct buffer.
1597 * buffer.h (BSET): New macro.
1598 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1599 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1600 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1601 * window.c, xdisp.c, xfns.c: Adjust users.
1603 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1605 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1607 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1609 * nsterm.m (not_in_argv): New function.
1610 (application:openFile, application:openTempFile:):
1611 (application:openFileWithoutUI:, application:openFiles:): Open file
1612 if not_in_argv returns non-zero (bug#12171).
1614 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
1615 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
1616 Define for Gtk+ versions less than 3.2.
1617 (xg_get_font_name): Use those functions/macros here.
1618 Reported by Frans Oilinki <moilinki@gmail.com>.
1620 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1622 * unexmacosx.c (copy_data_segment): Copy initialized data in
1623 statically linked libraries from input file rather than memory.
1625 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1626 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1627 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1629 2012-08-10 Glenn Morris <rgm@gnu.org>
1631 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1632 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1634 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1636 Fix last change to allow compilation with low optimization levels.
1637 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1638 Reported by Jan Djärv <jan.h.d@swipnet.se>.
1640 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1642 Use common inline syntax in intervals.h.
1643 * intervals.h (INTERVALS_INLINE): New macro.
1644 Change all users from LISP_INLINE.
1646 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1648 Define Qnone once for all platforms.
1649 * frame.c (Qnone): Define here.
1650 (syms_of_frame): DEFSYM it.
1651 * lisp.h (Qnone): New declaration.
1652 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1653 * xfns.c: Remove duplication. Adjust users.
1655 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1657 Remove unused macros from intervals.h.
1658 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1659 * intervals.c: Adjust comment.
1661 2012-08-10 Eli Zaretskii <eliz@gnu.org>
1663 * w32fns.c <w32_unicode_gui>: New static variable.
1664 (globals_of_w32fns): Initialize it according to os_subtype.
1665 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1668 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
1669 Eli Zaretskii <eliz@gnu.org>
1671 Fix bug #10299 with Unicode characters sent by customized
1672 keyboards created by MSKLC.
1673 * w32fns.c (INIT_WINDOW_CLASS): New macro.
1674 (w32_init_class): Use it to initialize the Emacs class with either
1675 ANSI or Unicode API calls.
1676 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1678 (w32_wnd_proc): If the character code sent by WM_CHAR or
1679 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1680 original message. Call DefWindowProcW on NT and later.
1682 2012-08-10 Glenn Morris <rgm@gnu.org>
1684 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1686 * lisp.h (DIRECTORY_SEP): Let configure set it.
1688 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1690 Use TSET for write access to Lisp_Object slots of struct terminal.
1691 * termhooks.h (TSET): New macro.
1692 * coding.c, terminal.c, xselect.c: Adjust users.
1694 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1696 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1697 the failing expression, include them in the error message.
1698 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1699 * lisp.h (internal_condition_case_n): Update declaration.
1701 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1703 Inline functions to examine and change buffer overlays.
1704 * buffer.c (unchain_both): New function.
1705 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1706 (buffer_has_overlays): New function.
1707 (enum overlay_type): New enum.
1708 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1709 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1711 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1713 Inline functions to examine and change buffer intervals.
1714 * alloc.c (mark_interval_tree): Remove.
1715 (MARK_INTERVAL_TREE): Simplify.
1716 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1717 * intervals.c (buffer_balance_intervals): New function.
1718 (graft_intervals_into_buffer): Adjust indentation.
1719 (set_intervals_multibyte): Simplify.
1720 * buffer.h (BUF_INTERVALS): Remove.
1721 (buffer_get_intervals, buffer_set_intervals): New function.
1722 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1723 * intervals.c, textprop.c: Adjust users.
1725 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1727 Inline functions to examine and change string intervals.
1728 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1729 (string_get_intervals, string_set_intervals): New function.
1730 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1731 * lread.c, print.c, textprop.c: Adjust users.
1733 2012-08-08 Glenn Morris <rgm@gnu.org>
1735 * lisp.mk (lisp): Remove language/persian.elc.
1737 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1740 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1741 (NULL_INTERVAL_P): Likewise. Adjust users.
1742 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1743 Adjust comment. Move under #if 0.
1744 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1745 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1747 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1749 Check total length of intervals with eassert.
1750 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1751 * intervals.c: Change all users to eassert.
1753 2012-08-07 Eli Zaretskii <eliz@gnu.org>
1755 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1756 Rename fields to match removal of FGET and WGET and disuse of
1757 INTERNAL_FIELD in Lisp_Cons.
1759 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1761 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1762 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1763 name since all xname users are fixed long time ago. Do not
1765 (set_symbol_name, set_symbol_function, set_symbol_plist):
1766 (set_symbol_next, set_overlay_plist): New function.
1767 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1768 (struct Lisp_Overlay): Likewise.
1769 (CVAR, MVAR, SVAR): Remove.
1770 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1771 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1772 * xterm.c: Adjust users.
1773 * .gdbinit: Change to use name field of struct Lisp_Symbol
1776 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1778 Basic functions to set Lisp_Object and pointer slots of intervals.
1779 * intervals.h (interval_set_parent, interval_set_object):
1780 (interval_set_left, interval_set_right, interval_set_plist):
1781 (interval_copy_parent): New function.
1782 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
1783 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1785 (INTERVAL_SIZE): Remove. Adjust users.
1786 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1788 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1790 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1791 * process.h (PGET): Remove.
1792 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1793 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1795 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1797 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1798 * window.h (WGET): Remove.
1799 (struct window): Do not use INTERNAL_FIELD.
1800 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1801 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1802 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1803 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1804 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1807 2012-08-07 Chong Yidong <cyd@gnu.org>
1809 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1810 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1811 (Fdelete_window_internal): Signal an error if the window is not on
1812 a live frame (Bug#12025).
1814 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1816 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1817 * frame.h (FGET): Remove.
1818 (struct frame): Do not use INTERNAL_FIELD.
1819 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1820 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1821 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1822 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1824 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
1826 * w32.c: Silence compiler warnings.
1827 (map_w32_filename): Remove unused variable `is_fat'.
1828 (chase_symlinks): Add parentheses around expression.
1830 2012-08-06 Glenn Morris <rgm@gnu.org>
1832 * sysdep.c: Respect BROKEN_GETWD.
1834 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1835 Let configure handle it.
1836 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1838 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1840 Use GCALIGNMENT where appropriate.
1841 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1842 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1843 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1845 2012-08-06 Eli Zaretskii <eliz@gnu.org>
1847 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1848 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
1850 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1852 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1853 that should be sufficient for everyone.
1855 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1857 * keyboard.c (timer_check_2): Add break so timer_check returns next
1860 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1862 Fix Windows build errors introduced after converting to WGET and WSET.
1863 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1864 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1866 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1868 * nsterm.m (ns_frame_rehighlight): Use FSET.
1870 * nsmenu.m (ns_update_menubar): Use FSET.
1872 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1874 Separate read and write access to Lisp_Object slots of Lisp_Process.
1875 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1876 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1878 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1880 Separate read and write access to Lisp_Object slots of struct window.
1881 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1882 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1883 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1884 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1885 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1886 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1889 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1891 Fix Windows build errors introduced after converting to FGET and FSET.
1892 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1893 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1894 (w32_judge_scroll_bars): Change to use FSET.
1895 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1897 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1899 Fix replacement typo.
1900 * window.c (replace_window): Set root_window instead of
1901 selected_window. This fixes a total window subsystem
1902 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1904 2012-08-06 Glenn Morris <rgm@gnu.org>
1906 * lisp.mk (lisp): Add language/persian.elc.
1908 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1910 Separate read and write access to Lisp_Object slots of struct frame.
1911 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1912 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1913 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1914 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1915 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1917 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1919 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1921 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1923 Generalize common compile-time constants.
1924 * lisp.h (header_size, bool_header_size, word_size): Now here.
1925 (struct Lisp_Vector): Add comment.
1926 (struct Lisp_Bool_Vector): Move up to define handy constants.
1927 (VECSIZE, PSEUDOVECSIZE): Simplify.
1928 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1929 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1930 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1931 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1932 * xfont.c, xmenu.c: Use word_size where appropriate.
1934 2012-08-05 Lawrence Mitchell <wence@gmx.li>
1936 * search.c (Freplace_match): Treat \? in the replacement text
1937 literally (Bug#8161).
1939 2012-08-05 Chong Yidong <cyd@gnu.org>
1941 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1942 * frame.c (Vdelete_frame_functions):
1943 * emacs.c (Vkill_emacs_hook): Doc fix.
1945 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1947 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1948 --with-x-toolkit=no builds.
1949 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1951 2012-08-04 Chong Yidong <cyd@gnu.org>
1953 * syntax.c (Fmodify_syntax_entry): Doc fix.
1955 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1957 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1958 * w32.c (init_environment): Change the default values of many
1959 environment variables in dflt_envvars[] to NULL, to avoid pushing
1960 them into environment when they were not already defined.
1961 Remove the code that deletes site-lisp subdirectories from the default
1962 value of EMACSLOADPATH, as it is no longer needed.
1963 (check_windows_init_file): Now external, not static.
1964 Use Vload_path as is, without adding anything, as this function is now
1965 called when Vload_path is already set up.
1967 * w32.h (check_windows_init_file): Add prototype.
1969 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1970 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1971 compatibility with Posix platforms.
1972 (main): Move the call to check_windows_init_file to here from
1974 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1975 any, in the DEFALT argument into the root of the Emacs build or
1976 installation tree, as appropriate.
1978 * callproc.c (init_callproc_1): Call decode_env_path instead of
1979 doing its equivalent by hand.
1980 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1981 the code that sets Vexec_path run on MS-Windows.
1983 * lread.c (init_lread): Add comments to #ifdef's.
1985 * msdos.c (dos_set_window_size, IT_update_begin)
1986 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1987 instead of direct references.
1989 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1991 Export DEFAULT_REHASH_* to GDB.
1992 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1993 Now constants, not macros.
1995 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1997 Remove unnecessary casts involving pointers.
1998 These casts are no longer needed now that we assume C89 or later,
1999 since they involve casting to or from void *.
2000 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2001 (make_pure_float, make_pure_vector):
2002 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2003 * macros.c (Fstart_kbd_macro):
2004 * menu.c (find_and_return_menu_selection):
2005 * minibuf.c (read_minibuf_noninteractive):
2006 * sysdep.c (closedir):
2007 * xdisp.c (x_produce_glyphs):
2008 * xfaces.c (compare_fonts_by_sort_order):
2009 * xfns.c (x_real_positions, select_visual):
2010 * xselect.c (x_stop_queuing_selection_requests)
2011 (x_get_window_property, x_get_window_property_as_lisp_data):
2012 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2013 Remove unnecessary pointer casts.
2014 * alloc.c (record_xmalloc): New function.
2015 * lisp.h (record_xmalloc): New decl.
2016 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2017 more like a function. This is because the pointer cast is not
2018 needed. All uses changed.
2019 * print.c (print_string, print_error_message): Avoid length recalc.
2021 Improve fix for macroexp crash with debugging (Bug#12118).
2022 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2023 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2024 not supposed to be invoked from the garbage collector.
2025 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2026 (gc_aset): New function, which is like ASET but can be
2027 used in the garbage collector.
2028 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2029 (set_hash_index): Use it instead of ASET.
2031 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2033 Support symlinks on latest versions of MS-Windows.
2034 * w32.c: Include winioctl.h and aclapi.h.
2035 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2036 (revert_to_self): Forward declarations of static functions.
2037 <static BOOL g_b_init_get_security_info>:
2038 <g_b_init_create_symbolic_link>: New static flags.
2039 (globals_of_w32): Initialize them to zero.
2040 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2041 (map_w32_filename): Improve commentary. Simplify switch.
2042 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2043 headers (most versions of MinGW w32api don't).
2044 (get_security_info, create_symbolic_link)
2045 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2047 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2048 in the argument file name.
2049 (sys_access): Call unc_volume_file_attributes only if
2050 GetFileAttributes fails with network-related error codes.
2051 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2052 have the required privileges.
2053 (get_file_security_desc_by_name): Rename from
2054 get_file_security_desc.
2055 (stat_worker): New function, with most of the guts of 'stat', and
2056 with addition of handling of symlinks and support for 'lstat'.
2057 If possible, get file's attributes and security information by
2058 handle, not by name. Produce S_IFLNK bit for symlinks, when
2059 called from 'lstat'.
2060 (stat, lstat): New functions, call 'stat_worker'.
2061 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2062 symlinks when the underlying filesystem supports them.
2064 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2066 Fix macroexp crash on Windows with debugging (Bug#12118).
2067 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2068 checking subscripts; problem introduced with the recent
2069 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2070 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2071 since it's used in non-static inline functions now.
2073 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2074 Don't assume buffer size fits in 'int'. Remove unused local.
2076 Use C99-style 'extern inline' if available.
2077 * buffer.h (BUFFER_INLINE):
2078 * category.h (CATEGORY_INLINE):
2079 * character.h (CHARACTER_INLINE):
2080 * charset.h (CHARSET_INLINE):
2081 * composite.h (COMPOSITE_INLINE):
2082 * dispextern.h (DISPEXTERN_INLINE):
2083 * lisp.h (LISP_INLINE):
2084 * systime.h (SYSTIME_INLINE):
2085 New macro, replacing 'static inline' in this header.
2086 * buffer.h, category.h, character.h, charset.h, composite.h:
2087 * dispextern.h, lisp.h, systime.h:
2088 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2089 * alloc.c (LISP_INLINE):
2090 * buffer.c (BUFFER_INLINE):
2091 * category.c (CATEGORY_INLINE):
2092 * character.c (CHARACTER_INLINE):
2093 * charset.c (CHARSET_INLINE):
2094 * composite.c (COMPOSITE_INLINE):
2095 * dispnew.c (DISPEXTERN_INLINE):
2096 * sysdep.c (SYSTIME_INLINE):
2097 Define to EXTERN_INLINE, so that the corresponding functions
2098 are compiled into code.
2099 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2100 (INLINE_HEADER_END): New macros.
2101 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2102 since it's used in non-static inline functions now.
2103 (VALMASK) [!USE_LSB_TAG]: Likewise.
2105 2012-08-02 Glenn Morris <rgm@gnu.org>
2107 * s/: Remove empty directory.
2109 * s/ms-w32.h: Move to ../nt/inc.
2110 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2111 Update for new ms-w32.h location.
2113 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2116 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2118 2012-08-02 Glenn Morris <rgm@gnu.org>
2120 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2121 hard-coding the path separator.
2123 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2125 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2126 This how ASET and AREF are supposed to work, and makes
2127 it easier to think about future improvements. See
2128 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2129 * charset.h (set_charset_attr): New function.
2130 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2131 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2132 (aref_addr): New function. All uses of &AREF(...) changed.
2133 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2134 (set_hash_index): New functions. All lvalue-style uses of
2135 HASH_KEY etc. changed.
2136 * keyboard.c (set_prop): New function. All lvalue-style uses
2139 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2141 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2142 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2143 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2144 * nsfns.m (ns_set_name_as_filename): Likewise.
2145 * nsmenu.m (ns_update_menubar): Likewise.
2146 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2148 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2150 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2151 Adapt to latest changes in field names of the corresponding Lisp
2154 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2156 2012-08-01 Glenn Morris <rgm@gnu.org>
2158 * s/msdos.h: Remove file.
2159 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2160 * Makefile.in (S_FILE): Remove.
2161 (config_h): Remove S_FILE.
2163 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2165 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2166 Remove; moved to nt/config.nt.
2168 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2170 Use INTERNAL_FIELD for conses and overlays.
2171 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2172 Remove obsolete comment.
2174 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2175 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2177 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2179 Use INTERNAL_FIELD for symbols.
2180 * lisp.h (SVAR): New macro. Adjust users.
2181 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2182 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2184 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2186 Use INTERNAL_FIELD for processes.
2187 * process.h (PVAR): New macro. Adjust style.
2188 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2189 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2191 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2193 Use INTERNAL_FIELD for windows.
2194 * window.h (WVAR): New macro.
2195 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2196 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2197 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2198 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2199 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2200 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2202 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2204 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2206 2012-08-01 Glenn Morris <rgm@gnu.org>
2208 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2209 Move to configure.ac.
2211 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2213 * makefile.w32-in (CONFIG_H): Update dependencies.
2214 (CONF_POST_H): New macro.
2216 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2218 2012-07-31 Glenn Morris <rgm@gnu.org>
2220 * Makefile.in (S_FILE): No longer set by configure.
2222 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2224 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2226 * process.h (NULL_DEVICE):
2227 * emacs.c (SEPCHAR):
2228 * editfns.c (USER_FULL_NAME): Let configure set them.
2230 * s/README, s/template.h: Remove files.
2232 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2234 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2235 Move to configure.ac.
2237 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2239 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2240 resulting renaming of 'struct frame' members.
2242 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2244 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2245 after introduction of FVAR.
2247 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2249 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2251 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2252 instead of compositeToPoint.
2253 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2255 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2257 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2259 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2260 * lisp.h (INTERNAL_FIELD): New macro.
2261 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2262 (BVAR): Change to use INTERNAL_FIELD.
2263 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2264 (KVAR): Change to use INTERNAL_FIELD.
2265 * frame.h (FVAR): New macro.
2266 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2267 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2268 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2269 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2270 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2272 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2274 Miscellaneous fixes for non-default X toolkits.
2275 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2276 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2277 Move under #ifdef USE_LUCID.
2278 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2279 definition and usage to avoid warnings.
2281 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2283 * nsterm.m (openFiles): Fix previous checkin.
2285 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2287 * indent.c (compute_motion): Remove unused local.
2289 2012-07-31 Glenn Morris <rgm@gnu.org>
2291 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2293 * conf_post.h [USG5_4]:
2294 Move remaining contents of s/usg5-4-common.h here.
2295 * s/usg5-4-common.h: Remove file.
2297 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2298 * s/irix6-5.h: Remove file.
2300 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2301 * s/darwin.h: Remove file.
2303 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2304 * s/hpux10-20.h: Remove file, which is now empty.
2306 2012-07-30 Glenn Morris <rgm@gnu.org>
2308 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2309 * Makefile.in (config_h): Add conf_post.h.
2310 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2312 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2314 * nsterm.m (ns_do_open_file): New variable.
2315 (ns_term_init): Set ns_do_open_file to YES after run returns.
2316 (openFile, openTempFile, openFileWithoutUI, openFiles):
2317 Open files only if ns_do_open_file.
2319 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2321 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2322 This no-op macro hasn't been needed for many years.
2323 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2325 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2326 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2327 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2328 gdb_make_enums_visible.
2329 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2330 (DIRECTORY_SEP): Now a constant, not a macro.
2332 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2334 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2335 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2337 * w32term.c <w32_keyboard_codepage>: Renamed from
2338 keyboard_codepage and now external. All users changed.
2340 * w32term.h: Add declaration of w32_keyboard_codepage.
2342 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2343 the codepage to translate keys to Unicode. If this argument is
2344 -1, use the value returned by GetConsoleCP. All callers changed.
2346 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2348 Update .PHONY listings in makefiles.
2349 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2350 bootstrap-clean, distclean, maintainer-clean, versioclean,
2353 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2354 This is a bit clearer. Fix some commentary typos.
2356 2012-07-30 Glenn Morris <rgm@gnu.org>
2358 * s/netbsd.h: Let configure include signal.h if needed.
2359 Remove file, which is now empty.
2361 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2362 Let configure set them.
2363 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2364 No more need to undefine.
2366 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2368 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2369 non-single-byte char when adding meta modifier. (Bug#12090)
2371 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2373 Convert safe_call to use variable number of arguments.
2374 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2375 (safe_call2): Fix comment.
2376 * lisp.h (safe_call): Adjust prototype.
2377 * coding.c (encode_coding_object): Change to use safe_call2.
2378 * xfaces.c (merge_face_heights): Change to use safe_call1.
2380 2012-07-30 Glenn Morris <rgm@gnu.org>
2382 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2383 does that unconditionally. Remove file, which is now empty.
2385 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2388 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2390 Export to GDB most of lisp.h's remaining object-like macros.
2391 * lisp.h (min, max): Move earlier, because they're used earlier now.
2392 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2393 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2394 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2395 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2396 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2397 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2398 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2399 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2400 Now constants, for GDB. They need not be macros.
2401 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2402 Now constants, for GDB, as well as macros, for static initializers.
2403 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2404 Move to after the definition of struct Lisp_Char_Table,
2405 since the former now needs that type defined.
2406 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2407 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2408 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2409 New enums, for gdb_make_enums_visible.
2410 (GLYPH_MODE_LINE_FACE): Remove; unused.
2411 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2412 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2413 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2414 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2415 enum maxargs, enum MAX_ALLOCA.
2416 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2417 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2418 no longer needed, now that they are done in lisp.h.
2420 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2422 Cleanup string bytes checking.
2423 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2424 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2425 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2426 (check_sblock, compact_small_strings): Simplify.
2428 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2430 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2431 These macros are confusing and no longer need to be defined, as
2432 the enum values now suffice. All uses replaced with definiens.
2433 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2435 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
2437 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2438 ($(BLD)/w32console.$(O)): Update dependencies.
2440 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2442 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2443 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2445 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2447 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2449 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2450 setting sitelisp (Bug#12010).
2452 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2454 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2456 * w32heap.c (cache_system_info):
2457 * w32.c (sys_rename):
2458 * w32proc.c (find_child_console, sys_kill): All users changed.
2460 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2462 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2464 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2466 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2468 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2470 Cleanup statistics calculation in Fgarbage_collect.
2471 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2472 Fix zombies percentage calculation. Simplify elapsed time calculation.
2474 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2476 Generalize marker debugging code under MARKER_DEBUG and use eassert.
2477 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2478 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2479 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2480 (replace_range, replace_range_2, del_range_2): Change to eassert.
2481 * marker.c (byte_char_debug_check): Adjust style.
2483 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2485 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2486 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2487 long-ago-commented-out code that talks about "WIN32".
2488 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2491 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2493 Use Gnulib stdalign module (Bug#9772, Bug#9960).
2494 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2495 Simplify by using alignof.
2496 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2497 * lisp.h: Include <stdalign.h>.
2498 (GCALIGNMENT): New macro and constant.
2499 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
2500 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2501 (stdalign): New macro, if not already defined.
2503 2012-07-28 Eli Zaretskii <eliz@gnu.org>
2505 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
2506 * w32inevt.c: Include w32inevt.h.
2507 (w32_read_console_input): New inline function, calls either
2508 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2509 w32_console_unicode_input.
2510 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2511 (w32_kbd_patch_key, key_event): Use the codepage returned by
2512 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2513 (key_event): use uChar.UnicodeChar only if
2514 w32_console_unicode_input is non-zero.
2516 * w32console.c: Include w32heap.h.
2517 <w32_console_unicode_input>: New global variable.
2518 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2519 family of Windows, zero otherwise.
2521 * w32inevt.h: Declare w32_console_unicode_input.
2523 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2524 --without-x. (Bug#11742)
2526 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2528 Adjust GDB to reflect pvec_type changes (Bug#12036).
2529 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
2530 2012-07-04 changes to pseudovector representation.
2531 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
2533 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
2535 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2537 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2539 2012-07-27 Eli Zaretskii <eliz@gnu.org>
2541 * alloc.c (listn): Fix the order the arguments are consed onto the
2544 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2545 enumeration constants, as PURE and HEAP are too general, and clash
2546 with other headers and sources, such as gmalloc.c and the
2547 MS-Windows system headers. All users changed.
2549 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2551 Revert last save_excursion_save and save_excursion_restore changes.
2552 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2553 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2555 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2557 Fix recently-introduced typos in Windows port.
2558 Reported by Martin Rudalics <rudalics@gmx.at>.
2559 * w32.c (init_environment): Replace comma with semicolon.
2560 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
2562 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2564 Improve GDB symbol export (Bug#12036).
2565 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2566 arms of an 'if', not using conditional expressions; otherwise GDB
2567 complains about the types in the unevaluated arm when the argument
2568 is an integer literal.
2569 (xgetint): Simplify expression.
2570 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2571 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2572 Zaretskii in <http://bugs.gnu.org/12036#13>.
2573 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2574 needed now that we have gdb_make_enums_visible.
2575 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2576 (enum enum_USE_LSB_TAG):
2577 New enum types, packaging up enums that need to be exported to GDB.
2579 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2581 Utility function to make a list from specified amount of objects.
2582 * lisp.h (enum constype): New datatype.
2583 (listn): New prototype.
2584 * alloc.c (listn): New function.
2585 (Fmemory_use_count, syms_of_alloc): Use it.
2586 * buffer.c (syms_of_buffer): Likewise.
2587 * callint.c (syms_of_callint): Likewise.
2588 * charset.c (define_charset_internal): Likewise.
2589 * coding.c (syms_of_coding): Likewise.
2590 * keymap.c (syms_of_keymap): Likewise.
2591 * search.c (syms_of_search): Likewise.
2592 * syntax.c (syms_of_syntax): Likewise.
2593 * w32.c (init_environment): Likewise.
2594 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2595 * xdisp.c (syms_of_xdisp): Likewise.
2596 * xfns.c (syms_of_xfns): Likewise.
2598 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2600 Fast save_excursion_save and save_excursion_restore.
2601 * lisp.h (struct Lisp_Excursion): New data type.
2602 (PVEC_EXCURSION): New pseudovector type.
2603 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2604 to deal with it. Adjust comments.
2605 (init_marker, attach_marker): New prototype.
2606 (unchain_marker): Adjust prototype.
2607 * marker.c (attach_marker): Change to global.
2608 (init_marker): New function.
2609 * alloc.c (Fmake_marker, build_marker): Use it.
2610 (build_marker): More easserts.
2611 (mark_object): Handle struct Lisp_Excursion.
2612 * editfns.c (save_excursion_save, save_excursion_restore):
2613 Reimplement to use struct Lisp_Excursion. Add comments.
2615 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2617 Fix export of symbols to GDB (Bug#12036).
2618 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
2619 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2620 emacs.c, as this is a more-suitable home. Had this been done earlier
2621 the fix for 12036 would have avoided some of the problems noted in
2622 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2623 would have been more obvious.
2624 * emacs.c: Do not include <verify.h>; no longer needed.
2625 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
2626 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2627 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2628 Remove; now done in lisp.h.
2629 * lisp.h (PUBLISH_TO_GDB): New macro.
2630 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2631 (DATA_SEG_BITS): Use it.
2632 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2633 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2634 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2635 not be usable in #if. This simplifies things.
2637 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
2639 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2641 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2643 Simplify export of symbols to GDB (Bug#12036).
2644 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2645 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2646 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2647 Adjust to changes in lisp.h and emacs.c, by using
2648 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2649 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2650 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2651 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2652 instead of gdb_valbits.
2653 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2654 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2655 instead of gdb_array_mark_flag.
2656 (xboolvector): Get size from $->size, not $->header.size.
2657 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2658 (xreload, hook-run, hookpost-run): Remove.
2659 * emacs.c: Include <verify.h>.
2660 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2661 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2663 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2664 (gdb_USE_LSB_TAG): New enum constants.
2665 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2666 Also define these as enum constants, so they're visible to GDB.
2667 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2668 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2669 as constants, so they're visible to GDB.
2670 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2671 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2672 Now enum constants, not macros, so they're visible to GDB.
2673 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2674 more convenient now. All uses changed.
2675 (VALMASK) [USE_LSB_TAG]: Also define in this case.
2676 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2678 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2680 Explicitly free restriction data that are not needed anymore.
2681 * editfns.c (save_restriction_restore): Free restriction data.
2683 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2685 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2686 add argument, tune behavior, and adjust all callers.
2688 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2690 Use typedef for EMACS_INT, EMACS_UINT.
2691 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2692 than macros. This simplifies debugging in the usual case, since
2693 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2694 and it allows expressions involving EMACS_INT casts.
2695 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2697 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2699 * nsterm.m (ns_read_socket): Return early if there is a modal
2702 2012-07-25 Martin Rudalics <rudalics@gmx.at>
2704 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2705 that FOCUS-FRAME can be omitted.
2707 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2709 Adjust buffer text indirection counters at the end of Fkill_buffer.
2710 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2711 buffer is definitely dead. This should really fix an issue reported
2712 by Christoph Scholtes again. (Bug#12007).
2713 (init_buffer_once): Initialize indirection counters of
2714 buffer_defaults and buffer_local_symbols (for sanity and safety).
2716 2012-07-24 Eli Zaretskii <eliz@gnu.org>
2718 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2719 and continuation glyphs on tooltip frames, leave them at zero.
2720 Avoids continued lines in tooltips. (Bug#11832)
2722 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2724 Simplify copy_overlay.
2725 * buffer.c (copy_overlay): Simplify. Use build_marker.
2726 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2728 2012-07-23 Eli Zaretskii <eliz@gnu.org>
2730 * print.c (print_object): Don't crash when a frame's name is nil
2731 or invalid. (Bug#12025)
2733 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2734 it signals an error when a tooltip frame is being created.
2736 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2738 Cleanup miscellaneous objects allocation and initialization.
2739 * alloc.c (allocate_misc): Change to static. Add argument to
2740 specify the subtype. Adjust comment and users.
2741 (build_overlay): New function.
2742 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2743 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2744 (allocate_misc): Remove prototype.
2745 (build_overlay): Add prototype.
2747 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2749 Swap buffer text indirection counters in Fbuffer_swap_text.
2750 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2751 This avoids crash reported by Christoph Scholtes at
2752 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2754 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2756 * nsmenu.m (Popdown_data): New struct.
2757 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2759 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2760 (initWithContentRect): Make imgView and contentView non-static
2761 and autorelease them. Also autorelease img and matrix (Bug#12005).
2762 (dealloc): Remove (Bug#12005).
2764 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2766 Adjust consing_since_gc when objects are explicitly freed.
2767 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2768 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2769 (free_cons, free_misc): Subtract object size from consing_since_gc.
2771 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2773 Simplify and cleanup markers positioning code.
2774 * marker.c (attach_marker): More useful eassert.
2775 (live_buffer, set_marker_internal): New function.
2776 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2777 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2779 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2781 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2782 as it's limited by the amount of memory, not by INT_MAX.
2784 2012-07-21 Eli Zaretskii <eliz@gnu.org>
2786 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2787 in special-event-map. See the discussion at
2788 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2791 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2792 info.dwItemData. Fixes crashes on 64-bit Windows.
2793 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2795 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2797 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
2798 (conversationIdentifier): Return value is NSInteger.
2799 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
2801 2012-07-21 Chong Yidong <cyd@gnu.org>
2803 * window.c (decode_any_window): Signal an error if the window is
2804 on a dead frame (Bug#11984).
2806 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2808 Add indirection counting to speed up Fkill_buffer.
2809 * buffer.h (struct buffer): New member.
2810 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2811 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2812 base buffer indirection counter.
2813 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2814 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2815 through buffer list if indirection counter is 0.
2817 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2819 Extend the value returned by Fgarbage_collect with heap statistics.
2820 * alloc.c (Qheap): New symbol.
2821 (syms_of_alloc): DEFSYM it.
2822 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2823 (Fmemory_free): Remove.
2824 (syms_of_alloc): Don't defsubr it.
2825 * buffer.c (Fcompact_buffer): Remove.
2826 (syms_of_buffer): Don't defsubr it.
2828 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2830 Make maybe_gc inline.
2831 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2832 * lisp.h (consing_since_gc, gc_relative_threshold)
2833 (memory_full_cons_threshold): Revert declaration.
2834 (maybe_gc): Remove prototype, define as inline.
2835 * alloc.c: Remove old commented-out code.
2836 (consing_since_gc, gc_relative_threshold)
2837 (memory_full_cons_threshold): Revert to global.
2840 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2842 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2843 * lisp.h (build_unibyte_string): New function.
2844 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2845 * sysdep.c, w32fns.c, xfns.c: Use it.
2846 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2847 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2848 Adjust users accordingly.
2849 * font.h (font_open_by_name): Adjust prototype.
2851 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2853 Cleanup calls to Fgarbage_collect.
2854 * lisp.h (maybe_gc): New prototype.
2855 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2856 Remove declarations.
2857 * alloc.c (maybe_gc): New function.
2858 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2860 * bytecode.c (MAYBE_GC): Use maybe_gc.
2861 * eval.c (eval_sub, Ffuncall): Likewise.
2862 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2863 to avoid dependency from auto-save feature.
2865 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2867 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2868 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2869 'for_each_per_buffer_object_at'.
2870 All uses changed. It's better to use upper-case for macros that
2871 cannot be implemented as functions, to give the reader a clue
2872 that they're special.
2874 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2876 * alloc.c (Fgarbage_collect): Tweak docstring.
2878 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2880 Tweak the value returned from Fgarbage_collect again.
2881 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2882 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2883 Adjust documentation.
2884 (total_vector_bytes): Rename to total_vector_slots, adjust
2886 (total_free_vector_bytes): Rename to total_free_vector_slots,
2888 (Qstring_bytes, Qvector_slots): New symbols.
2889 (syms_of_alloc): DEFSYM them.
2891 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2893 Buffer compaction primitive which may be used from Lisp.
2894 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2895 (syms_of_buffer): Register Fcompact_buffer.
2896 * alloc.c (Fgarbage_collect): Use compact_buffer.
2897 * buffer.h (compact_buffer): New prototype.
2898 (struct buffer_text): New member.
2900 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2902 New macro to iterate over all buffers, miscellaneous cleanups.
2903 * lisp.h (all_buffers): Remove declaration.
2904 * buffer.h (all_buffers): Add declaration, with comment.
2905 (for_each_buffer): New macro.
2906 * alloc.c (Fgarbage_collect, mark_object): Use it.
2907 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2908 (init_buffer): Likewise.
2909 * data.c (Fset_default): Likewise.
2910 * coding.c (code_conversion_restore): Remove redundant check
2912 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2914 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2916 Fix bug that created negative-length intervals.
2917 * intervals.c (merge_interval_right, merge_interval_left):
2918 Do not zero out this interval if it is absorbed by its children,
2919 as this interval's total length doesn't change in that case. See
2920 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2922 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2924 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2925 when invoking (make-bool-vector N t) and N is a positive
2926 multiple of 8 -- the last 8 bits were mistakenly cleared.
2928 Remove some struct layout assumptions in bool vectors.
2929 * alloc.c (bool_header_size): New constant.
2930 (header_size, word_size): Move earlier, as they're now used earlier.
2931 Use 'word_size' in a few more places, where it's appropriate.
2932 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2933 padding before the data member of a bool vector.
2934 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2935 than doing the check by hand with an abort ().
2937 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2939 * eval.c (Fdefvar): Don't check constants since we only set the var if
2940 it's not yet defined anyway (bug#11904).
2942 * lisp.h (last_undo_boundary): Declare new var.
2943 * keyboard.c (command_loop_1): Set it.
2944 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2945 were auto-added by the command loop (bug#11774).
2947 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2949 * w32font.c (Qsymbol): Remove local definition.
2950 (syms_of_w32font): Don't DEFSYM it.
2952 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2954 Fix sweep_vectors to handle large bool vectors correctly.
2955 * alloc.c (sweep_vectors): Account total_vector_bytes for
2956 bool vectors larger than VBLOCK_BYTES_MAX.
2958 2012-07-18 Chong Yidong <cyd@gnu.org>
2960 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2961 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2963 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2965 Return more descriptive data from Fgarbage_collect.
2966 Suggested by Stefan Monnier in
2967 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2968 * alloc.c (bounded_number): New function.
2969 (total_buffers, total_vectors): New variable.
2970 (total_string_size): Rename to total_string_bytes, adjust users.
2971 (total_vector_size): Rename to total_vector_bytes, adjust users.
2972 (sweep_vectors): Account total_vectors and total_vector_bytes.
2973 (Fgarbage_collect): New return value. Adjust documentation.
2974 (gc_sweep): Account total_buffers.
2975 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2976 (VECTOR_SIZE): Remove.
2977 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2978 (Qinterval, Qmisc): New symbols.
2979 (syms_of_data): Initialize them.
2980 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2981 (Qcons, Qbuffer): New declarations.
2983 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2985 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2986 Round up, not down. Improve doc.
2988 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2990 Restore old code in allocate_string_data to avoid Faset breakage.
2991 Reported by Julien Danjou <julien@danjou.info> in
2992 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2993 * alloc.c (allocate_string_data): Restore old code with minor
2994 adjustments, fix comment to explain this subtle issue.
2996 2012-07-17 Eli Zaretskii <eliz@gnu.org>
2998 Remove FILE_SYSTEM_CASE.
2999 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3001 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3002 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3003 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3004 call-process-region passes it through expand-file-name.
3006 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3008 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3010 Fix crash when creating indirect buffer (Bug#11917)
3011 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3012 Don't handle unbound variables specially if non-zero.
3013 (Fbuffer_local_variables): Pass zero.
3014 (clone_per_buffer_values): Pass non-zero.
3016 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3018 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3019 to make the loop interruptible.
3021 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3023 * gnutls.c (emacs_gnutls_handshake): Only retry if
3024 GNUTLS_E_INTERRUPTED.
3026 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3028 Cleanup and convert miscellaneous checks to eassert.
3029 * alloc.c (mark_interval): Fix comment, partially rephrase
3030 old comment from intervals.h (see below).
3031 * intervals.c (find_interval, adjust_intervals_for_insertion)
3032 (delete_interval, adjust_intervals_for_deletion)
3033 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3035 (adjust_intervals_for_insertion, make_new_interval):
3036 Remove obsolete and unused code.
3037 * intervals.h (struct interval): Remove obsolete comment.
3038 * textprotp.c (erase_properties): Remove unused code.
3039 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3040 (Fremove_list_of_text_properties): Convert to eassert.
3042 2012-07-17 Chong Yidong <cyd@gnu.org>
3044 * editfns.c (Finsert_char): Doc fix.
3046 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3048 Fix previous change to make Fmemory_free always accurate.
3049 * alloc.c (make_interval): Update total_free_intervals.
3050 (make_float): Likewise for total_free_floats.
3051 (free_cons, Fcons): Likewise for total_free_conses.
3052 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3053 Likewise for total_free_vector_bytes.
3054 (Fmake_symbol): Likewise for total_free_symbols.
3055 (bytes_free): Remove.
3057 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3059 Simple free memory accounting feature.
3060 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3061 (sweep_vectors): Accumulate size of free vectors.
3062 (Fgarbage_collect): Setup bytes_free.
3063 (Fmemory_free): New function.
3064 (syms_of_alloc): Register it.
3066 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3068 Cleanup overlays checking.
3069 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3070 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3071 eassert and OVERLAYP.
3072 (sort_overlays): Change to use OVERLAYP.
3074 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3076 * editfns.c (Finsert_char): Make it interactive, and make the
3077 second arg optional. Copy interactive spec and docstring from
3080 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3082 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3083 Unlike the other wrapped functions, fabs has an unspecified
3086 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3088 * nsterm.m (keyDown): Interpret flags without left/right bits
3089 as the left key (Bug#11670).
3091 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3093 Remove empty and useless init functions.
3094 * lisp.h (init_character_once, init_fns, init_image)
3095 (init_filelock, init_sound): Remove prototype.
3096 * character.c (init_character_once): Remove.
3097 * filelock.c (init_filelock): Likewise.
3098 * fns.c (init_fns): Likewise.
3099 * image.c (init_image): Likewise.
3100 * sound.c (init_sound): Likewise.
3101 * emacs.c (main): Adjust accordingly.
3103 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3105 * gtkutil.h: Tiny cleanups.
3106 (use_old_gtk_file_dialog): Remove useless declaration.
3107 (xg_uses_old_file_dialog): Add suggested const attribute.
3109 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3111 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3112 (bidi_paragraph_init): Use it to limit search forward for a strong
3113 directional character in abnormally large paragraphs full of
3114 neutral or weak characters. (Bug#11943)
3116 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3118 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3119 the toolbar (Bug#9451).
3120 (xg_make_tool_item): Give the widget event box a transparent
3123 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3125 Cleanup basic allocation variables and functions.
3126 * alloc.c (ignore_warnings, init_intervals, init_float)
3127 (init_cons, init_symbol, init_marker): Remove.
3128 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3129 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3130 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3131 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3132 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3133 (staticidx, init_alloc_once, init_strings, free_ablock):
3134 Remove redundant initialization.
3135 * fns.c (init_weak_hash_tables): Remove.
3136 * lisp.h (init_weak_hash_tables): Remove prototype.
3138 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3140 Use zero_vector where appropriate.
3141 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3143 * lisp.h (zero_vector): New declaration.
3144 * font.c (null_vector): Remove.
3145 (syms_of_font): Remove initialization and staticpro.
3146 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3147 * keymap.c (Faccessible_keymaps): Likewise.
3149 2012-07-15 Leo Liu <sdl.web@gmail.com>
3151 * fringe.c: Fix typo in comments.
3153 2012-07-14 Leo Liu <sdl.web@gmail.com>
3155 * fringe.c: Add a new bitmap exclamation-mark.
3157 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3159 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3161 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3162 (HAVE_MENUS): Don't define, defined by editing config.in with
3164 (GMALLOC_INHIBIT_VALLOC): Don't define.
3165 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3167 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3169 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3171 2012-07-14 Glenn Morris <rgm@gnu.org>
3173 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3174 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3175 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3177 2012-07-13 Glenn Morris <rgm@gnu.org>
3179 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3181 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3182 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3184 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3186 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3187 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3188 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3189 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3191 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3192 as boolean expression.
3193 (x_set_window_size): Remove unused variable toolbar.
3194 (ns_get_color_default, ns_mod_to_lisp): Remove.
3195 (ns_mouse_position): Remove unused variables xchar and ychar.
3196 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3197 (ns_set_vertical_scroll_bar): Remove unused variable count.
3198 (ns_delete_terminal): Remove unused variable i.
3199 (ns_term_init): Remove unused variables r, g and b.
3200 (mouseDown): Remove unused variable window.
3201 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3202 (initFrameFromEmacs): Remove unused variable vbextra.
3203 (mouseEntered): Remove unused variables p and dpyinfo.
3204 (mouseExited): Remove unused variables p and r.
3205 (ns_define_frame_cursor, ns_clear_frame_area)
3206 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3207 (menuDown): Assign [sender tag] to variable and cast the variable.
3209 * nsterm.h (menuDown): Add id as type to argument sender.
3210 (ns_display_info_for_name): Add Lisp_Object argument.
3211 (ns_term_init): Add Lisp_Object argument.
3212 (ns_map_event_to_object): Add void argument.
3213 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3214 prototype with arguments and only declare if __OBJC__.
3215 (nxatoms_of_nsselect): Add void argument.
3216 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3217 (ns_alloc_autorelease_pool): Add void argument.
3218 (ns_release_autorelease_pool): Add void* argument.
3219 (ns_get_defaults_value): Add const char* argument.
3221 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3222 (initFromContents): Use SSDATA where appropriate.
3223 (ns_update_menubar): Add braces to ambigous if-else.
3224 (initWithTitle): Put () around assignment in if statement.
3225 (ns_menu_show): Remove unused variables window and keymap.
3226 (update_frame_tool_bar): Remove unused variable selected_p.
3227 (initWithContentRect): Remove unused variable this_cmd_name.
3229 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3231 (setXBMColor): Remove unused variable len.
3232 (setPixmapData): Put () around assignment in loop statement.
3234 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3235 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3237 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3238 around assignment in loop statement.
3239 (nsfont_open): Remove unused variable i.
3240 (nsfont_open): Remove unused variable len.
3241 (nsfont_draw): Remove unused variable cs.
3243 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3244 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3245 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3246 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3247 (Fns_font_name, Fns_perform_service)
3248 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3249 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3250 (ns_set_name): Remove unused variable view.
3251 (x_set_menu_bar_lines): Remove unused variable olines.
3252 (x_set_tool_bar_lines): Remove unused variable root_window.
3253 (Fns_list_colors): Put () around assignment in while statement.
3254 (Fns_perform_service): Remove unused variable len.
3255 (Fns_display_usable_bounds): Remove unused variable top.
3256 (syms_of_nsfns): Remove unused variable i.
3258 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3261 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3263 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3264 and free it with DestroyExceptionInfo (Bug#11558).
3266 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3268 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3269 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3270 Set here, not in nt/config.nt.
3272 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3274 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3275 cursor overflow into the last glyph on display line when the right
3276 fringe is off. (Bug#11832)
3278 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3280 * xdisp.c (produce_special_glyphs): Now static.
3281 * dispextern.h (produce_special_glyphs): Remove decl.
3283 2012-07-13 Glenn Morris <rgm@gnu.org>
3285 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3286 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3288 * s/usg5-4-common.h (USG, USG5):
3289 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3290 * s/sol2-6.h (SOLARIS2):
3291 * s/irix6-5.h (IRIX6_5):
3292 * s/hpux10-20.h (USG, USG5, HPUX):
3293 * s/gnu-linux.h (USG, GNU_LINUX):
3294 * s/freebsd.h (BSD_SYSTEM):
3295 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3296 * s/cygwin.h (CYGWIN):
3297 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3298 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3300 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3302 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3304 2012-07-13 Glenn Morris <rgm@gnu.org>
3306 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3308 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3310 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3311 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3313 2012-07-12 Glenn Morris <rgm@gnu.org>
3315 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3317 * process.c (init_process_emacs): Rename from init_process.
3318 The old name is also the name of a Mach system call.
3319 * lisp.h, emacs.c: Update for this name change.
3320 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3323 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3325 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3326 memmove call that removes glyphs covered by the left truncation
3327 glyph. Improve commentary.
3328 (display_line): Fix display of continuation glyphs on GUI frames
3329 when the right fringe is turned off and variable-size fonts are
3330 used in the window. Move the code that appends a stretch glyph to
3331 produce_special_glyphs, so that it could be used for truncation
3332 and continuation glyphs alike.
3333 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3334 glyph of a suitably computed width, to align the special glyphs at
3335 the window margin. Code moved from display_line. (Bug#11832)
3337 2012-07-12 Glenn Morris <rgm@gnu.org>
3339 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3341 * s/gnu-linux.h, s/hpux10-20.h:
3342 Do not unconditionally define HAVE_XRMSETDATABASE.
3344 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3346 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3348 Fix typos that broke OS X build.
3349 Reported by Randal L. Schwartz in
3350 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3351 * nsterm.m (ns_timeout): Add missing local decl.
3352 (ns_get_color): snprintf -> sprintf, to fix typo.
3354 2012-07-12 Glenn Morris <rgm@gnu.org>
3356 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3357 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3358 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3359 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3361 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3362 Move PTY_OPEN to configure.
3364 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3365 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3366 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3368 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3370 Use empty_unibyte_string where applicable.
3371 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3372 * lread.c (read1): Likewise.
3373 * xsettings.c (syms_of_xsettings): Likewise.
3375 2012-07-12 Glenn Morris <rgm@gnu.org>
3377 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3378 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3379 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3380 * s/hpux10-20.h (RUN_TIME_REMAP):
3381 * s/bsd-common.h (TABDLY): Move to configure.
3383 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3385 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3387 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3388 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3390 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3392 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3393 * s/template.h: Move NARROWPROTO to configure.
3395 2012-07-11 Glenn Morris <rgm@gnu.org>
3397 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3398 unused since 2011-01-17 change to systty.h.
3400 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3401 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3402 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3404 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3406 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3408 2012-07-11 Glenn Morris <rgm@gnu.org>
3410 * s/darwin.h, s/gnu-linux.h, s/template.h:
3411 Move INTERRUPT_INPUT to configure.
3413 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3415 Minor adjustments to interning code.
3416 * lisp.h (intern, intern_c_string): Redefine as static inline
3417 wrappers for intern_1 and intern_c_string_1, respectively.
3418 (intern_1, intern_c_string_1): Rename prototypes.
3419 * lread.c (intern_1, intern_c_string_1, oblookup):
3420 Simplify Vobarray checking.
3421 * font.c (font_intern_prop): Likewise. Adjust comment.
3422 * w32font.c (intern_font_name): Likewise.
3424 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3426 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3428 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3429 of Fcar/Fcdr if possible.
3430 * font.c (check_otf_features): Likewise.
3431 * fontset.c (Fnew_fontset): Likewise.
3432 * gnutls.c (Fgnutls_boot): Likewise.
3433 * minibuf.c (read_minibuf): Likewise.
3434 * msdos.c (IT_set_frame_parameters): Likewise.
3435 * xmenu.c (Fx_popup_dialog): Likewise.
3436 * w32menu.c (Fx_popup_dialog): Likewise.
3438 2012-07-11 Glenn Morris <rgm@gnu.org>
3440 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3441 since nothing has defined it on these platforms.
3443 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3444 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3446 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3447 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3448 Move CLASH_DETECTION to configure.
3450 * s/gnu.h: Remove file, which is now empty.
3452 * s/gnu.h, s/gnu-linux.h:
3453 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3455 2012-07-11 John Wiegley <johnw@newartisans.com>
3457 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3458 function attribute, so we only use it if it exists in the
3461 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3463 Avoid call to strlen in fast_c_string_match_ignore_case.
3464 * search.c (fast_c_string_match_ignore_case): Change to use
3465 length argument. Adjust users accordingly.
3466 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3468 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3470 Assume mkdir, rmdir.
3471 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3472 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3475 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3478 * s/hpux10-20.h (HAVE_PERROR): Remove.
3479 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3480 Remove dummy definition, as this problem was obsolete long ago.
3483 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3485 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3487 Avoid calls to strlen in font processing functions.
3488 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
3489 (font_open_by_name): Change to use length argument.
3490 Adjust users accordingly.
3491 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3493 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3494 Change to return ptrdiff_t.
3495 (xfont_list_pattern, xfont_match): Use length returned by
3496 xfont_decode_coding_xlfd.
3497 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3499 2012-07-11 Glenn Morris <rgm@gnu.org>
3501 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3502 Move DONT_REOPEN_PTY to configure.
3504 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3505 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3507 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3509 Remove "#define unix" that is no longer needed (Bug#11905).
3510 * s/aix4-2.h (unix): Remove; no longer needed.
3512 EMACS_TIME simplification (Bug#11875).
3513 This replaces macros (which typically do not work in GDB)
3514 with functions, typedefs and enums, making the code easier to debug.
3515 The functional style also makes code easier to read and maintain.
3516 * systime.h: Include <sys/time.h> on all hosts, not just if
3517 WINDOWSNT, since 'struct timeval' is needed in general.
3518 (EMACS_TIME): Now a typedef, not a macro.
3519 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3521 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3522 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3523 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3524 (EMACS_TIME_LE): Now functions, not macros.
3525 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3526 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3527 which are not functions. All uses rewritten to use:
3528 (make_emacs_time): New function.
3529 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3530 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3531 not functions. All uses rewritten to use the following, respectively:
3532 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3533 (add_emacs_time, sub_emacs_time): New functions.
3534 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
3535 * fileio.c (Fcopy_file):
3536 * xterm.c (XTflash): Get the current time closer to when it's used.
3537 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3539 * bytecode.c (targets): Suppress -Woverride-init warnings.
3541 Simplify by avoiding confusing use of strncpy etc.
3542 * doc.c (Fsnarf_documentation):
3543 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3544 * frame.c (Fmake_terminal_frame):
3545 * gtkutil.c (get_utf8_string):
3547 * nsmenu.m (ns_update_menubar):
3548 * regex.c (regerror):
3549 Prefer memcpy to strncpy and strncat when either will do.
3550 * fileio.c (Fsubstitute_in_file_name):
3551 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3552 (menu_separator_name_p):
3553 * nsmenu.m (ns_update_menubar):
3554 Prefer memcmp to strncmp when either will do.
3555 * nsterm.m: Include <ftoastr.h>.
3557 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3558 Prefer snprintf to strncpy.
3559 * nsterm.m (ns_term_init):
3560 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3561 * nsterm.m (ns_term_init):
3562 Avoid the need for strncpy, by using build_string or
3563 make_unibyte_string directly. Use dtoastr, not snprintf.
3564 * process.c (Fmake_network_process): Diagnose service names that
3565 are too long, rather than silently truncating them or creating
3566 non-null-terminated names.
3567 (Fnetwork_interface_info): Likewise, for interface names.
3568 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3569 Prefer sprintf to strncat.
3570 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3571 Prefer vsnprintf to vsprintf + strncpy.
3573 2012-07-10 Glenn Morris <rgm@gnu.org>
3575 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3576 Clarify fallback case.
3578 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3580 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3581 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3582 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
3583 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
3584 where argument type is known to be a Lisp_Cons.
3586 2012-07-10 Tom Tromey <tromey@redhat.com>
3588 * bytecode.c (BYTE_CODE_THREADED): New macro.
3589 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3590 (enum byte_code_op): New type.
3591 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3592 (exec_byte_code): Use them. Use token threading when applicable.
3594 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3596 Optimize pure C strings initialization.
3597 * lisp.h (make_pure_string): Fix prototype.
3598 (build_pure_c_string): New function, defined as static inline. This
3599 provides a better opportunity to optimize away calls to strlen when
3600 the function is called with compile-time constant argument.
3601 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
3602 argument, adjust users accordingly. Use build_pure_c_string where
3604 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3605 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3606 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3608 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3610 Avoid calls to strlen in miscellaneous functions.
3611 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3612 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
3613 * lread.c (openp): Likewise.
3615 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3617 Avoid calls to strlen in path processing functions.
3618 * fileio.c (file_name_as_directory): Add comment. Change to add
3619 srclen argument and return the length of result. Adjust users
3621 (directory_file_name): Fix comment. Change to add srclen argument,
3622 swap 1st and 2nd arguments to obey the common convention.
3623 Adjust users accordingly.
3624 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3626 2012-07-10 Glenn Morris <rgm@gnu.org>
3628 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3629 Move PENDING_OUTPUT_COUNT definition to configure.
3631 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3632 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3633 * s/gnu.h (DATA_START): Move definitions to configure.
3635 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3636 We include usg5-4-common.h, which defines them both.
3638 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3639 O_RDONLY already includes it).
3641 Stop ns builds setting the EMACSLOADPATH environment variable.
3642 * nsterm.m (ns_load_path): Rename from ns_init_paths.
3643 Now it does not set EMACSLOADPATH, just returns the load-path string.
3644 * nsterm.h: Update accordingly.
3645 * lread.c [HAVE_NS]: Include nsterm.h.
3646 (init_lread) [HAVE_NS]: Use ns_load_path.
3647 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3649 2012-07-09 Glenn Morris <rgm@gnu.org>
3651 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3652 since the included bsd-common.h does so.
3654 Stop ns builds setting the EMACSPATH environment variable.
3655 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3656 (ns_init_paths): Do not set EMACSPATH.
3657 * nsterm.h (ns_exec_path): Add it.
3658 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3661 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3663 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3665 * process.c (wait_reading_process_output): 'waitchannels' was unset
3666 when read_kbd || !NILP (wait_for_cell); fix this.
3668 Add GCC-style 'const' attribute to functions that can use it.
3669 * character.h (char_resolve_modifier_mask):
3670 * keyboard.h (make_ctrl_char):
3671 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3672 (init_character_once, next_almost_prime, init_fns, init_image)
3673 (flush_pending_output, init_sound):
3674 * mem-limits.h (start_of_data):
3675 * menu.h (finish_menu_items):
3676 Add ATTRIBUTE_CONST.
3677 * emacs.c (DEFINE_DUMMY_FUNCTION):
3678 Declare the dummy function with ATTRIBUTE_CONST.
3679 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3680 Add decls with ATTRIBUTE_CONST.
3682 Minor improvements to make_formatted_string.
3683 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3684 where int is good enough, as vsprintf returns an int.
3685 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3687 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3689 Use make_formatted_string to avoid double length calculation.
3690 * lisp.h (make_formatted_string): New prototype.
3691 * alloc.c (make_formatted_string): New function.
3692 * buffer.c (Fgenerate_new_buffer_name): Use it.
3693 * dbus.c (syms_of_dbusbind): Likewise.
3694 * editfns.c (Fcurrent_time_zone): Likewise.
3695 * filelock.c (get_boot_time): Likewise.
3696 * frame.c (make_terminal_frame, set_term_frame_name)
3697 (x_report_frame_params): Likewise.
3698 * image.c (gs_load): Likewise.
3699 * minibuf.c (get_minibuffer): Likewise.
3700 * msdos.c (dos_set_window_size): Likewise.
3701 * process.c (make_process): Likewise.
3702 * xdisp.c (ensure_echo_area_buffers): Likewise.
3703 * xsettings.c (apply_xft_settings): Likewise.
3705 2012-07-09 Glenn Morris <rgm@gnu.org>
3707 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3708 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3709 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3710 * nsterm.h (ns_etc_directory): Add it.
3711 * callproc.c [HAVE_NS]: Include nsterm.h.
3712 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3714 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3716 Move marker debugging code under MARKER_DEBUG.
3717 * marker.c (MARKER_DEBUG): Move marker debugging code under
3718 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3719 for bootstrap with --enable-checking (~3x slowdown reported
3720 by Juanma Barranquero <lekktu@gmail.com>).
3721 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3723 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3725 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3726 See <http://bugs.gnu.org/11825#29>.
3728 2012-07-08 Eli Zaretskii <eliz@gnu.org>
3730 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3731 has no font, use the frame's font. (Bug#11813)
3732 (display_line): Add commentary about displaying truncation glyphs
3734 (produce_special_glyphs): Move here from term.c.
3736 * term.c (produce_special_glyphs): Move to xdisp.c.
3738 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3741 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3743 * xdisp.c (display_line): Avoid warning about implicit declaration
3746 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3748 * lisp.h: Remove empty conditional.
3750 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3752 * lread.c (load_path_check): Now static.
3754 Fix some minor --with-ns problems found by static checking.
3755 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3756 (x_set_font) [!HAVE_X_WINDOWS]:
3757 * image.c (xpm_load_image) [HAVE_NS]:
3758 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3759 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3760 Remove unused local.
3761 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3762 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3763 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3764 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3765 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3766 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3767 Fix pointer signedness problem.
3768 * xfaces.c (FRAME_X_FONT_TABLE):
3769 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3771 2012-07-07 Glenn Morris <rgm@gnu.org>
3773 * lread.c (load_path_check): New function, split from init_lread.
3774 (init_lread): Reorganize. Motivation:
3775 If EMACSLOADPATH is set, check/warn about that rather than the
3776 defaults, which we are not going to use. Hence we can remove
3777 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3778 Don't warn if site-lisp directories are missing.
3779 If not installed, start from a blank load-path, since
3780 PATH_LOADSEARCH refers to the eventual installation directories.
3782 2012-07-07 Eli Zaretskii <eliz@gnu.org>
3784 Support truncation and continuation glyphs on GUI frames, when
3785 fringes are disabled. (Bug#11832)
3786 * xdisp.c (init_iterator): Get dimensions of truncation and
3787 continuation glyphs even if on GUI frames.
3788 Adjust it->last_visible_x on GUI frames when the left or right fringes,
3789 or both, are absent.
3790 (start_display, move_it_in_display_line_to): Handle the case of a
3791 GUI frame without a fringe to display continuation or truncation
3793 (insert_left_trunc_glyphs): Support GUI frames: make sure
3794 truncation glyphs overwrite enough glyphs from the current line to
3795 have sufficient space in pixels.
3796 (display_line): Support truncation and continuation glyphs on GUI
3797 frames. If some spare pixels are left on the line after inserting
3798 the truncation glyphs, fill that space with a stretch glyph of a
3799 suitably computed width.
3801 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3802 produce_glyphs, to support GUI sessions.
3804 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3806 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3808 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3810 Do not require float-time's arg to fit in time_t (Bug#11825).
3811 This works better on hosts where time_t is unsigned, and where
3812 float-time is applied to the (negative) difference between two times.
3813 * editfns.c (decode_time_components): Last arg is now double *,
3814 not int *, and means to store all the result as a double, without
3815 worrying about whether the seconds part fits in time_t.
3816 All callers changed.
3817 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3818 All callers changed.
3819 (Ffloat_time): Do not fail merely because the specified time falls
3820 outside of time_t range.
3822 2012-07-07 Glenn Morris <rgm@gnu.org>
3824 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3825 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3826 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3828 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
3830 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3831 Update dependencies.
3833 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3835 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3837 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3838 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3839 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3840 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3841 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3842 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3844 * xfont.c (compare_font_names): Redo to omit the need for casts.
3846 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3848 * xfns.c (Fx_change_window_property): Doc fix.
3849 * w32fns.c (Fx_change_window_property): Doc fix.
3851 * w32fns.c (Fx_window_property): Accept the same arguments as the
3852 X Windows version. Doc fix.
3853 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3855 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
3856 Eli Zaretskii <eliz@gnu.org>
3858 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3859 Windows-specific code from nt/config.nt moved here.
3860 Obsolete settings removed.
3862 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3864 * process.c: Avoid unnecessary calls to gettime.
3865 (wait_reading_process_output): Don't get the time of day
3866 when gobbling data immediately and not waiting, as there's no need
3867 for it in that case. This removes a FIXME.
3869 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3871 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3872 is defined (Bug#11768).
3874 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3876 Fix marker debugging code.
3877 * marker.c (byte_char_debug_check): Do not perform the check
3878 if buffer is not multibyte.
3879 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3880 Call byte_char_debug_check with correct arguments.
3882 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3884 Compile marker debugging code only if ENABLE_CHECKING is defined.
3885 * marker.c (byte_char_debug_check, count_markers):
3886 Use only if ENABLE_CHECKING is defined.
3887 (byte_debug_flag): Remove.
3888 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3889 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3891 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3893 Avoid code repetition in marker-related functions.
3894 * marker.c (attach_marker): New function.
3895 (Fset_marker, set_marker_restricted, set_marker_both)
3896 (set_marker_restricted_both): Use it.
3897 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3898 Consistently rename charno to charpos.
3899 (marker_position): Add eassert.
3900 (marker_byte_position): Convert to eassert.
3902 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3904 Simplify list operations in unchain_overlay and unchain_marker.
3905 * buffer.c (unchain_overlay): Simplify. Add comment.
3906 * marker.c (unchain_marker): Simplify. Fix comments.
3908 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3910 Introduce fast path for the widely used marker operation.
3911 * alloc.c (build_marker): New function.
3912 * lisp.h (build_marker): New prototype.
3913 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3914 * composite.c (autocmp_chars): Likewise.
3915 * editfns.c (buildmark): Remove.
3916 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3917 (save_restriction_save): Use build_marker.
3918 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3919 * window.c (save_window_save): Likewise.
3921 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3923 Do not use Fdelete_overlay in delete_all_overlays
3924 to avoid redundant calls to unchain_overlay.
3925 * buffer.c (drop_overlay): New function.
3926 (delete_all_overlays, Fdelete_overlay): Use it.
3927 * minibuf.c (get_minibuffer): Fix comment.
3929 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3931 Port to OpenBSD 5.1 amd64.
3932 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3933 This is needed for OpenBSD, and should be harmless on all BSD systems.
3934 Also, include <sys/sysctl.h>, as it should be available on all
3935 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3936 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3937 use p_pid member, not kp_proc.pid.
3939 2012-07-06 Glenn Morris <rgm@gnu.org>
3941 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3943 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3945 More xmalloc and related cleanup.
3946 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3947 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3948 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3949 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3950 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3951 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3952 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3953 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3954 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3956 Omit needless casts involving void * pointers and allocation.
3957 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3958 as the former is more robust if P's type is changed.
3959 Prefer xzalloc to xmalloc + memset 0.
3960 Simplify malloc-or-realloc to realloc.
3961 Don't worry about xmalloc returning a null pointer.
3962 Prefer xstrdup to xmalloc + strcpy.
3963 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3965 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3966 alloca of a constant.
3968 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3970 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3971 hscroll is larger than the line width. Fixes long and futile
3972 looping inside extend_face_to_end_of_line (on a TTY) producing
3973 glyphs that are not needed and thrown away.
3975 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3977 * marker.c (set_marker_restricted_both): Simplify by using
3980 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3982 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3984 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3986 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3987 not defined (Bug#11768).
3988 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3989 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3990 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3991 followed by gtk_box_set_homogeneous (Bug#11768).
3992 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
3993 (update_theme_scrollbar_width, xg_create_scroll_bar):
3994 Use gtk_scrollbar_new (Bug#11768).
3995 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3996 (is_box_type): New function (Bug#11768).
3997 (xg_tool_item_stale_p): Call is_box_type.
3998 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
3999 with default display (Bug#11768).
4001 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4003 * xdisp.c (window_hscroll_limited): New function.
4004 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4005 coordinates when window's hscroll is set to insanely large
4008 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4010 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4011 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4013 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4016 * lisp.h (xzalloc): New prototype. Omit needless casts.
4017 * alloc.c (xzalloc): New function. Omit needless casts.
4018 * charset.c: Omit needless casts. Convert all calls to
4019 xmalloc with following memset to xzalloc.
4020 * dispnew.c: Likewise.
4021 * fringe.c: Likewise.
4022 * image.c: Likewise.
4023 * sound.c: Likewise.
4025 * w32fns.c: Likewise.
4026 * w32font.c: Likewise.
4027 * w32term.c: Likewise.
4028 * xfaces.c: Likewise.
4030 * xterm.c: Likewise.
4031 * atimer.c: Omit needless casts.
4032 * buffer.c: Likewise.
4033 * callproc.c: Likewise.
4035 * coding.c: Likewise.
4036 * composite.c: Likewise.
4038 * doprnt.c: Likewise.
4039 * editfns.c: Likewise.
4040 * emacs.c: Likewise.
4042 * filelock.c: Likewise.
4044 * gtkutil.c: Likewise.
4045 * keyboard.c: Likewise.
4047 * lread.c: Likewise.
4048 * minibuf.c: Likewise.
4049 * msdos.c: Likewise.
4050 * print.c: Likewise.
4051 * process.c: Likewise.
4052 * region-cache.c: Likewise.
4053 * search.c: Likewise.
4054 * sysdep.c: Likewise.
4055 * termcap.c: Likewise.
4056 * terminal.c: Likewise.
4057 * tparam.c: Likewise.
4058 * w16select.c: Likewise.
4060 * w32reg.c: Likewise.
4061 * w32select.c: Likewise.
4062 * w32uniscribe.c: Likewise.
4063 * widget.c: Likewise.
4064 * xdisp.c: Likewise.
4065 * xmenu.c: Likewise.
4067 * xselect.c: Likewise.
4069 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4071 * fileio.c (time_error_value): Check the right error number.
4072 Problem reported by Troels Nielsen in
4073 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4075 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4077 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4078 This should be fixed in a better way; see Eli Zaretskii in
4079 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4080 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4082 * fileio.c (time_error_value): Rename from special_mtime.
4083 The old name's problems were noted by Eli Zaretskii in
4084 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4086 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4087 This variable's comment says Emacs needs at least one GDB-visible
4088 symbol of type enum pvec_type, to work around GDB problems.
4089 The symbol's value doesn't matter.
4091 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4092 that causes compilation to fail on pre-C99 compilers.
4094 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4096 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4097 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4099 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4101 * buffer.c (init_buffer_once): Fix initialization of
4102 headers for buffer_defaults and buffer_local_symbols.
4103 Reported by Juanma Barranquero <lekktu@gmail.com>.
4105 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4107 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4108 * lisp.h (enum pvec_type): Use fewer bits.
4109 (PSEUDOVECTOR_SIZE_BITS): New constant.
4110 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4111 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4112 change in pvec_type.
4113 (PSEUDOVECTOR_TYPEP): New macro.
4114 (TYPED_PSEUDOVECTORP): Use it.
4115 * fns.c (internal_equal): Adapt code to extract pvectype.
4116 * emacs.c (gdb_pvec_type): Update type.
4117 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4118 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4119 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4120 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4121 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4122 abusing vector->header.next.nbytes.
4123 (live_vector_p): Use PVEC_TYPE.
4124 (mark_object): Adapt code to extract pvectype. Use switch.
4126 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4128 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4129 Tighten new eassert a bit.
4131 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4133 Fix compilation with --enable-gcc-warnings and -O1
4135 * doprnt.c (doprnt): Change type of tem to int, initialize
4136 to avoid compiler warning. Add eassert.
4137 * search.c (simple_search): Initialize match_byte to avoid
4138 compiler warning. Add eassert.
4140 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4142 Avoid weird behavior with large horizontal scrolls.
4143 Without this change, for example, large hscroll values would
4144 mess up Emacs's display on Fedora 15 x86, presumably due to
4145 overflows in int calculations in the display code.
4146 Also, if buffers had long lines, Emacs would freeze.
4147 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4148 (set_window_hscroll): New function, containing the old guts of
4149 Fset_window_hscroll. Return the clipped value.
4150 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4151 This avoids the need to check against PTRDIFF_MAX.
4153 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4155 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4157 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4159 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4161 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4162 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4163 since GCC 4.4.6 issues a bogus warning for them.
4165 Fix bugs in file timestamp newness comparisons.
4166 * fileio.c (Ffile_newer_than_file_p):
4167 * lread.c (Fload): Use full timestamp resolution of files,
4168 not just the 1-second resolution, so that files that are only
4169 slightly newer still count as newer.
4170 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4171 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4173 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4175 * fileio.c: Improve handling of file time marker. (Bug#11852)
4176 (special_mtime): New function.
4177 (Finsert_file_contents, Fverify_visited_file_modtime):
4178 Use it to set special mtime values consistently.
4180 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4182 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4183 marker for non-existing file. (Bug#11852)
4185 2012-07-03 Glenn Morris <rgm@gnu.org>
4187 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4188 and did not make it into globals.h).
4190 2012-07-03 Tom Tromey <tromey@redhat.com>
4192 * window.c (Fset_window_margins, Fset_window_fringes)
4193 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4194 * textprop.c (Fprevious_property_change): No longer static.
4195 * syntax.c (Fsyntax_table_p): No longer static.
4196 * process.c (Fget_process, Fprocess_datagram_address): No longer
4198 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4199 * keyboard.c (Fcommand_execute): No longer static.
4201 * insdel.c (Fcombine_after_change_execute): No longer static.
4202 * image.c (Finit_image_library): No longer static.
4203 * fileio.c (Fmake_symbolic_link): No longer static.
4204 * eval.c (Ffetch_bytecode): No longer static.
4205 * editfns.c (Fuser_full_name): No longer static.
4206 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4208 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4210 * dired.c (Ffile_attributes): No longer static.
4211 * composite.c (Fcomposition_get_gstring): No longer static.
4212 * callproc.c (Fgetenv_internal): No longer static.
4214 * ccl.h: Remove EXFUNs.
4215 * buffer.h: Remove EXFUNs.
4216 * dispextern.h: Remove EXFUNs.
4217 * intervals.h: Remove EXFUNs.
4218 * fontset.h: Remove EXFUN.
4219 * font.h: Remove EXFUNs.
4220 * dosfns.c (system_process_attributes): Remove EXFUN.
4221 * keymap.h: Remove EXFUNs.
4222 * lisp.h: Remove EXFUNs.
4223 * w32term.h: Remove EXFUNs.
4224 * window.h: Remove EXFUNs.
4225 * xsettings.h: Remove EXFUN.
4226 * xterm.h: Remove EXFUN.
4228 2012-07-03 Glenn Morris <rgm@gnu.org>
4230 * lisp.h (Frandom): Make it visible to C.
4231 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4232 buffer for invisible buffers. (Bug#1229)
4234 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4236 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4237 values which aren't power of 2.
4238 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4239 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4242 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4244 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4246 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4248 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4250 * alloc.c (allocate_vector_block): Remove redundant
4251 calls to mallopt if DOUG_LEA_MALLOC is defined.
4252 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4253 avoid calls to mallopt if zero_vector is returned.
4255 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4257 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4258 is enabled, avoid dereferencing NULL current_sblock if
4261 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4263 Cleanup basic buffer management.
4264 * buffer.h (struct buffer): Change layout to use generic vector
4265 marking code. Fix some comments. Change type of 'clip_changed'
4266 to bitfield. Remove unused #ifndef old.
4267 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4268 (GET_OVERLAYS_AT): Fix indentation.
4269 (for_each_per_buffer_object_at): New macro.
4270 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4271 (Fbuffer_local_variables): Use it.
4272 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4273 * alloc.c (allocate_buffer): Adjust to match new layout of
4274 struct buffer. Fix comment.
4275 (mark_overlay): New function.
4276 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4277 Lisp area of struct buffer.
4278 (mark_object): Use it. Adjust marking of misc objects
4279 and related comments.
4281 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4283 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4284 wrapper that is not needed because the wrapped code is a no-op (zero
4285 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4286 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4288 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4290 * alloc.c (mark_buffer): Simplify. Remove prototype.
4291 (mark_object): Add comment. Reorganize marking of vector-like
4292 objects. Use CHECK_LIVE for all vector-like objects except buffers
4293 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4294 Avoid redundant calls to mark_vectorlike for bool vectors.
4296 2012-06-30 Glenn Morris <rgm@gnu.org>
4298 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4300 * epaths.in (PATH_SITELOADSEARCH): New.
4301 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4302 This is rather than relying on --enable-locallisppath elements
4303 having "site-lisp" in their names. (Bug#10208#25, 11658)
4305 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4307 * w32proc.c (sys_select): Accept and ignore one more argument.
4309 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4311 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4312 (pselect) [!MS_DOS]: Redirect to sys_select.
4314 * sysdep.c: Don't include dos.h and dosfns.h.
4316 * process.c (sys_select):
4317 * msdos.c (sys_select): Accept one more argument and ignore it.
4319 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4320 adapt data types and code to that.
4323 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4324 which clashes with the gnulib function of the same name.
4326 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4328 * font.c (font_style_to_value, font_style_symbolic)
4329 (font_prop_validate_style): Add type checks for values in
4332 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4334 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4337 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4339 * xdisp.c (try_window_id): Undo last change.
4341 * w32.c (getwd): Adjust commentary about startup_dir.
4342 (init_environment): Always call sys_access, even in non-MSVC
4343 builds. Don't chdir to the directory of the Emacs executable.
4344 This undoes code from 1997 which was justified by the need to
4345 "avoid conflicts when removing and renaming directories". But its
4346 downside was that every relative file name was being interpreted
4347 relative to the directory of the Emacs executable, which can never
4348 be TRT. In particular, it broke sys_access when called with
4349 relative file names.
4350 (sys_access): Map GetLastError to errno.
4352 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4354 * window.h (struct window): Change type of 'fringes_outside_margins'
4355 to bitfield. Fix comment. Adjust users accordingly.
4356 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4358 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4361 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4363 * gnutls.c (emacs_gnutls_handshake):
4364 Add QUIT to make the loop interruptible.
4366 2012-06-29 Glenn Morris <rgm@gnu.org>
4368 * charset.c (init_charset): Make lack of etc/charsets fatal.
4370 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4372 * editfns.c (region_limit): Fix type mismatch.
4374 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4376 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4377 undefined. Convert from xassert to eassert.
4378 * nsmenu.m: Convert from xassert to eassert.
4379 * nsterm.m: Likewise.
4381 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4383 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4385 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4387 Avoid integer overflow on scroll-left and scroll-right.
4388 * window.c (HSCROLL_MAX): New macro.
4389 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4390 overflow when requested scroll falls outside ptrdiff_t range.
4392 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4394 * window.h (struct window): Change type of 'hscroll',
4395 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4396 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4397 Adjust users accordingly.
4398 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4399 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4400 from EMACS_INT to ptrdiff_t.
4401 (make_window): Omit redundant initialization.
4403 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4405 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4407 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4409 * window.h (struct window): Change type of 'use_time' and
4410 'sequence_number' from Lisp_Object to int.
4411 * frame.c (make_frame): Adjust users accordingly.
4412 * print.c (print_object): Likewise.
4413 * window.c (select_window, Fwindow_use_time, make_parent_window)
4414 (make_window): Likewise.
4416 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4418 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4419 enabled with --enable-checking=[all,glyphs] configure option.
4420 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4421 adjust comments accordingly.
4422 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4423 undefined, adjust comments accordingly.
4424 * image.c: Likewise.
4425 * scroll.c: Likewise.
4426 * w32fns.c: Likewise.
4427 * w32term.c: Likewise.
4428 * xdisp.c: Likewise.
4429 * xfaces.c: Likewise.
4431 * xterm.c: Likewise.
4433 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4435 Generalize run-time debugging checks.
4436 * dispextern.h (XASSERTS): Remove.
4437 * fontset.c (xassert): Remove.
4438 Convert from xassert to eassert.
4439 * alloc.c: Convert from xassert to eassert.
4441 * dispnew.c: Likewise.
4443 * fringe.c: Likewise.
4444 * ftfont.c: Likewise.
4445 * gtkutil.c: Likewise.
4446 * image.c: Likewise.
4447 * keyboard.c: Likewise.
4449 * process.c: Likewise.
4450 * scroll.c: Likewise.
4451 * sound.c: Likewise.
4453 * w32console.c: Likewise.
4454 * w32fns.c: Likewise.
4455 * w32term.c: Likewise.
4456 * window.c: Likewise.
4457 * xdisp.c: Likewise.
4458 * xfaces.c: Likewise.
4460 * xselect.c: Likewise.
4461 * xterm.c: Likewise.
4463 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4465 * fns.c (maybe_resize_hash_table): Output message when growing the
4468 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4470 * alloc.c (allocate_string_data): Remove dead code.
4471 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4472 avoid GCC warning about unused macro.
4474 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4476 * alloc.c (allocate_string): Omit intervals initialization.
4477 * alloc.c (make_uninit_multibyte_string): Initialize intervals
4478 as in make_pure_string and make_pure_c_string.
4480 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4482 * alloc.c (allocate_string): Fix last change.
4484 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4486 * alloc.c (allocate_string): Remove two redundant calls
4487 to memset, add explicit initialization where appropriate.
4489 2012-06-27 Glenn Morris <rgm@gnu.org>
4491 * lisp.mk (lisp): Remove paths.elc.
4493 2012-06-27 Chong Yidong <cyd@gnu.org>
4495 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4497 2012-06-26 John Wiegley <johnw@newartisans.com>
4499 * unexmacosx.c (copy_data_segment): Add two section names used
4500 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4502 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4503 when building with Clang.
4505 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4507 * eval.c (Fapply): Allow calling it with a single argument.
4509 2012-06-26 Eli Zaretskii <eliz@gnu.org>
4511 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4512 _stricmp and _strnicmp.
4513 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4515 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4517 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4519 (allocate_process): Likewise for new process.
4520 (allocate_terminal): Change to use offsetof.
4521 (allocate_frame): Likewise.
4522 * frame.c (make_frame): Omit redundant initialization.
4523 * window.c (make_parent_window): Use memset.
4524 (make_window): Omit redundant initialization.
4525 * process.c (make_process): Omit redundant initialization.
4526 * terminal.c (create_terminal): Likewise.
4528 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4530 * term.c (delete_tty): Remove redundant call to memset.
4532 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4534 * alloc.c: Remove build_string.
4535 * lisp.h: Define build_string as static inline. This provides
4536 a better opportunity to optimize away calls to strlen when the
4537 function is called with compile-time constant argument.
4538 * image.c (imagemagick_error): Convert to build_string.
4539 * w32proc.c (sys_spawnve): Likewise.
4540 * xterm.c (x_term_init): Likewise.
4542 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4544 Use sprintf return value instead of invoking strlen on result.
4545 In the old days this wasn't portable, since some sprintf
4546 implementations returned char *. But they died out years ago and
4547 Emacs already assumes sprintf returns int.
4548 Similarly for float_to_string.
4549 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4550 * ccl.c (ccl_driver):
4551 * character.c (string_escape_byte8):
4552 * data.c (Fnumber_to_string):
4553 * doprnt.c (doprnt):
4554 * print.c (print_object):
4555 * xdisp.c (message_dolog):
4556 * xfns.c (syms_of_xfns):
4557 Use sprintf or float_to_string result to avoid need to call strlen.
4558 * data.c (Fnumber_to_string):
4559 Use make_unibyte_string, since the string must be ASCII.
4560 * lisp.h, print.c (float_to_string): Now returns int length.
4561 * term.c (produce_glyphless_glyph):
4562 Use sprintf result rather than recomputing it.
4564 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4565 * Makefile.in (ALL_CFLAGS):
4566 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4567 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4569 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4571 * dispextern.h (xstrcasecmp): Define to library function
4572 strcasecmp if available.
4573 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4575 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4577 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4578 Avoid comma operator.
4579 * menu.c (push_submenu_start, push_submenu_end)
4580 (push_left_right_boundary, push_menu_pane): Likewise.
4581 * msdos.c (dos_rawgetc): Likewise.
4583 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4585 * xfns.c (xic_create_fontsetname): Remove redundant calls
4588 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4590 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4591 sprintf already null-terminates its output.
4593 * xfns.c (x_window): Remove redundant cast.
4595 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4597 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4598 `const char *' to `char *' to avoid compiler warning.
4600 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4602 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4603 instead of truncating it to 63 (admittedly a generous limit).
4605 * process.c: Fix spelling and caps in comments.
4607 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4609 * emacs.c (setpgrp): Remove definition, unused.
4610 * sysdep.c (setpgrp): Remove definition, not used in this file.
4612 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
4614 * makefile.w32-in: Update dependencies.
4616 2012-06-24 Eli Zaretskii <eliz@gnu.org>
4618 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4619 (SYSTIME_H): Add nt/inc/sys/time.h.
4621 * systime.h [WINDOWSNT]: Include sys/time.h.
4623 * s/ms-w32.h (struct timespec): Definition moved from
4624 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4626 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4628 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4629 * buffer.h (buffer_slot_type_mismatch):
4630 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4631 * eval.c (unwind_to_catch):
4632 * image.c (my_png_error, my_error_exit):
4633 * keyboard.c (quit_throw_to_read_char, user_error)
4634 (Fexit_recursive_edit, Fabort_recursive_edit):
4635 * lisp.h (die, args_out_of_range, args_out_of_range_3)
4636 (wrong_type_argument, buffer_overflow, __executable_start)
4637 (memory_full, buffer_memory_full, string_overflow, Fthrow)
4638 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4639 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4641 (child_setup) [!DOS_NT]:
4642 * lread.c (end_of_file_error, invalid_syntax):
4643 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4644 * puresize.h (pure_write_error):
4645 * search.c (matcher_overflow):
4646 * sound.c (sound_perror, alsa_sound_perror):
4647 * sysdep.c, syssignal.h (croak):
4648 * term.c (maybe_fatal, vfatal):
4649 * textprop.c (text_read_only):
4650 * undo.c (user_error):
4651 * unexmacosx.c (unexec_error):
4652 * xterm.c (x_ins_del_lines, x_delete_glyphs):
4653 Use _Noreturn rather than NO_RETURN.
4654 No need for separate decl merely because of _Noreturn.
4655 * sound.c (sound_warning, parse_sound):
4656 Remove unnecessary forward decls.
4658 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4660 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4661 * lisp.h (WAIT_READING_MAX): New macro.
4662 * dispnew.c (Fsleep_for, sit_for):
4663 * keyboard.c (kbd_buffer_get_event):
4664 * process.c (Faccept_process_output):
4665 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4666 This improves on the previous patch, which introduced a bug
4667 when time_t is unsigned and as wide as intmax_t.
4668 See <http://bugs.gnu.org/9000#51>.
4670 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4672 * dispnew.c (sit_for, Fsleep_for):
4673 * keyboard.c (kbd_buffer_get_event):
4674 * process.c (Faccept_process_output): Avoid compiler warnings when
4675 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4677 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
4679 * makefile.w32-in: Update dependencies.
4681 * w32.c (ltime): Add return type and declare static.
4682 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4684 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4686 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4687 Privately reported by Herbert J. Skuhra.
4688 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4690 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4691 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4693 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4695 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4696 last argument of make_unibyte_string.
4698 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4699 language ID in the event parameters.
4701 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4702 event.code, not the obscure "character set ID".
4704 2012-06-23 Chong Yidong <cyd@gnu.org>
4706 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4708 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4710 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4711 * w32.c (fdutimens): New function.
4713 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4715 * s/ms-w32.h (pselect): Redirect to sys_select.
4717 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4719 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4720 in the logic of incrementing and decrementing the value of
4721 use_relocatable_buffers.
4723 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4725 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4726 Privately reported by Herbert J. Skuhra.
4727 [__FreeBSD__]: Remove "*/" typo after "#include".
4728 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4729 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4730 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4731 Don't assume EMACS_TIME and struct timeval are the same type.
4733 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4735 Support higher-resolution time stamps (Bug#9000).
4736 The time stamps are only nanosecond-resolution at the C level,
4737 since that's the best that any real-world system supports now.
4738 But they are picosecond-resolution at the Lisp level, as that's
4739 easy, and leaves room for future OS improvements.
4741 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4744 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4745 Don't get current time unless it's needed.
4747 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4748 now provides it if it's absent.
4749 (start_atimer): Port to higher-res time stamps.
4750 Check for time stamp overflow. Don't get current time more
4751 often than is needed.
4753 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4754 Include systime.h, not time.h.
4755 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4757 * dired.c: Include stat-time.h.
4758 (Ffile-attributes): File times now have higher resolution.
4760 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4761 (struct image): Timestamp now has higher resolution.
4763 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4764 has at least microseconds now. All uses removed.
4765 (update_frame, update_single_window, update_window, update_frame_1)
4766 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
4767 (duration_to_sec_usec): Remove; no longer needed.
4769 * editfns.c (time_overflow): Now extern.
4770 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4771 (float-time, Fformat_time_string, Fcurrent_time_string)
4772 (Fcurrent_time_zone): Accept and generate higher-resolution
4774 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4775 (decode_time_components, lisp_seconds_argument): New functions.
4776 (make_time): Now static.
4777 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4778 Report an error if the time is invalid, rather than having the caller
4781 * fileio.c: Include <stat-time.h>
4782 (Fcopy_file): Copy higher-resolution time stamps.
4783 Prefer to set the time stamp via a file descriptor if that works.
4784 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4785 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4786 (Fvisited_file_modtime, Fset_visited_file_modtime):
4787 Support higher-resolution time stamps.
4789 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4791 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4793 * image.c (prepare_image_for_display, clear_image_cache)
4794 (lookup_image): Port to higer-resolution time stamps.
4796 * keyboard.c (start_polling, bind_polling_period):
4797 Check for time stamp overflow.
4798 (read_char, kbd_buffer_get_event, timer_start_idle)
4799 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4800 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4801 Port to higher-resolution time stamps. Do not assume time_t is signed.
4802 (decode_timer): New function. Timers are now vectors of length 9,
4803 not 8, to accommodate the picosecond component.
4804 (timer_check_2): Use it.
4806 * nsterm.m (select_timeout, timeval_subtract): Remove.
4807 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4808 as they're a bit more accurate and handle overflow better.
4809 (ns_select): Change prototype to be compatible with pselect.
4810 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4811 * nsterm.h (ns_select): Adjust prototype.
4813 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4814 us-resolution time stamps.
4815 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4817 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4819 * lisp.h (time_overflow): New decl.
4820 (wait_reading_process_output): First arg is now intmax_t, not int,
4821 to accommodate larger waits.
4823 * process.h (struct Lisp_Process.read_output_delay):
4824 Now counts nanoseconds, not microseconds.
4825 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4827 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4828 (wait_reading_process_output):
4829 Port to ns-resolution time stamps.
4830 (Faccept_process_output, wait_reading_process_output):
4831 Check for time stamp overflow. Do not assume time_t is signed.
4832 (select_wrapper): Remove; we now use pselect.
4833 (Fprocess_attributes): Now generates ns-resolution time stamps.
4835 * sysdep.c: Include utimens.h. Don't include utime.h
4836 or worry about struct utimbuf; gnulib does that for us now.
4837 (gettimeofday): Remove; gnulib provides a substitute.
4838 (make_timeval): New function.
4839 (set_file_times): Now sets ns-resolution time stamps.
4840 New arg FD; all uses changed.
4841 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4842 (system_process_attributes):
4843 Now returns ns-resolution time stamp. All uses changed.
4844 Check for time stamp overflow.
4846 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4847 provides a substitute now.
4849 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4850 since it guarantees struct timespec.
4851 (EMACS_TIME): Now struct timespec, so that we can support
4852 ns-resolution time stamps.
4853 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4854 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4855 (EMACS_USECS): Remove.
4856 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4857 so multiply the arg by 1000 before storing it.
4858 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4860 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4861 Port to ns-resolution time stamps.
4862 (EMACS_TIME_NEG_P): Remove; replaced by....
4863 (EMACS_TIME_SIGN): New macro.
4864 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4865 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4866 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4867 (make_timeval, make_lisp_time, decode_time_components): New decls.
4868 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4869 that it mishandled time_t overflow. You can't compare by subtracting!
4870 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4871 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4873 * term.c: Include <sys/time.h>.
4874 (timeval_to_Time): New function, for proper overflow wraparound.
4875 (term_mouse_position, term_mouse_click): Use it.
4877 * undo.c (record_first_change): Support higher-resolution time stamps
4879 (Fprimitive_undo): Use them when restoring time stamps.
4881 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4882 (w32_get_internal_run_time):
4883 Port to higher-resolution Emacs time stamps.
4884 (ltime): Now accepts single 64-bit integer, as that's more convenient
4887 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4889 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4890 for compatibility with pselect. Support ns-resolution time stamps.
4892 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4894 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4895 Check for time stamp overflow, and support ns-resolution time stamps.
4897 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4898 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4899 (timeval_subtract): Remove; no longer needed.
4900 (XTflash, XTring_bell, x_wait_for_event):
4901 Port to ns-resolution time stamps. Don't assume time_t is signed.
4903 2012-06-22 Chong Yidong <cyd@gnu.org>
4905 * xdisp.c (x_consider_frame_title): Revert last change.
4907 2012-06-22 Eli Zaretskii <eliz@gnu.org>
4909 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4910 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4911 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4912 staticidx goes up to 1597 out of 1600 = 0x640.)
4914 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4916 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4917 Otherwise, the umask might be mistakenly 0 while handling input signals.
4919 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4921 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4923 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4925 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4926 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4927 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4928 access to `contents' member of Lisp_Vector objects with AREF and ASET
4931 2012-06-19 Chong Yidong <cyd@gnu.org>
4933 * frame.c (delete_frame): When selecting a frame on a different
4934 text terminal, do not alter the terminal's top-frame.
4936 * xdisp.c (format_mode_line_unwind_data): Record the target
4937 frame's selected window and its terminal's top-frame.
4938 (unwind_format_mode_line): Restore them.
4939 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4941 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4942 since tty frames can be explicitly named.
4943 (prepare_menu_bars): Likewise.
4945 * term.c (Ftty_top_frame): New function.
4947 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4949 Port byte-code-meter to modern targets.
4950 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4951 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
4952 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
4953 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4954 (METER_1, METER_2): Simplify.
4956 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4958 * data.c (Fdefalias): Return `symbol' (bug#11686).
4960 2012-06-18 Martin Rudalics <rudalics@gmx.at>
4962 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
4963 gets killed during executing of this function (Bug#11665).
4964 Try to always return Qt when the buffer has been actually killed.
4965 (Vkill_buffer_query_functions): In doc-string say that functions
4966 run by this hook should not change the current buffer.
4968 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4970 Fix recently-introduced process.c problems found by static checking.
4971 * process.c (write_queue_push, write_queue_pop, send_process):
4972 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4973 (write_queue_pop): Fix pointer signedness problem.
4974 (send_process): Remove unused local.
4976 2012-06-17 Chong Yidong <cyd@gnu.org>
4978 * xdisp.c (redisplay_internal): No need to redisplay terminal
4979 frames that are not on top.
4981 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
4983 * process.c (make_process): Initialize write_queue.
4984 (write_queue_push, write_queue_pop): New functions.
4985 (send_process): Use them to maintain correct ordering of process
4988 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4990 * lisp.h (eassert): Assume C89 or later.
4991 This removes the need for CHECK.
4992 (CHECK): Remove. Its comments about always evaluating its
4993 argument were confusing, as 'eassert' typically does not evaluate
4996 * coding.c (produce_chars): Use ptrdiff_t, not int.
4998 * xterm.c (x_draw_underwave): Check for integer overflow.
4999 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5001 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5003 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5004 referenced (Bug#11583).
5006 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5008 Implement wave-style variant of underlining.
5009 * dispextern.h (face_underline_type): New enum.
5010 (face): Add field for underline type.
5011 * nsterm.m (ns_draw_underwave): New function.
5012 (ns_draw_text_decoration): Use it.
5013 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5015 (x_draw_glyph_string): Use them.
5016 * xfaces.c (Qline, Qwave): New Lisp objects.
5017 (check_lface_attrs, merge_face_ref)
5018 (Finternal_set_lisp_face_attribute, realize_x_face):
5019 Handle wave-style underline face attributes.
5020 * xterm.c (x_draw_underwave): New function.
5021 (x_draw_glyph_string): Use it.
5023 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5025 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5026 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5027 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5028 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5029 ($(BLD)/w32select.$(O)): Update dependencies.
5031 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5033 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5034 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5035 * character.c (_fetch_multibyte_char_p): Remove.
5036 * alloc.c: Include "character.h" before "buffer.h".
5038 * buffer.c: Likewise.
5039 * bytecode.c: Likewise.
5040 * callint.c: Likewise.
5041 * callproc.c: Likewise.
5042 * casefiddle.c: Likewise.
5043 * casetab.c: Likewise.
5044 * category.c: Likewise.
5046 * coding.c: Likewise.
5047 * composite.c: Likewise.
5048 * dired.c: Likewise.
5049 * dispnew.c: Likewise.
5051 * dosfns.c: Likewise.
5052 * editfns.c: Likewise.
5053 * emacs.c: Likewise.
5054 * fileio.c: Likewise.
5055 * filelock.c: Likewise.
5057 * fontset.c: Likewise.
5058 * fringe.c: Likewise.
5059 * indent.c: Likewise.
5060 * insdel.c: Likewise.
5061 * intervals.c: Likewise.
5062 * keyboard.c: Likewise.
5063 * keymap.c: Likewise.
5064 * lread.c: Likewise.
5065 * macros.c: Likewise.
5066 * marker.c: Likewise.
5067 * minibuf.c: Likewise.
5068 * nsfns.m: Likewise.
5069 * nsmenu.m: Likewise.
5070 * print.c: Likewise.
5071 * process.c: Likewise.
5072 * regex.c: Likewise.
5073 * region-cache.c: Likewise.
5074 * search.c: Likewise.
5075 * syntax.c: Likewise.
5077 * textprop.c: Likewise.
5079 * unexsol.c: Likewise.
5080 * w16select.c: Likewise.
5081 * w32fns.c: Likewise.
5082 * w32menu.c: Likewise.
5083 * window.c: Likewise.
5084 * xdisp.c: Likewise.
5086 * xmenu.c: Likewise.
5088 * xselect.c: Likewise.
5090 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5092 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5093 If all the glyphs of the glyph row came from strings, and we have no
5094 cursor positioning clues, put the cursor on the first glyph of the
5096 (handle_face_prop): Use chunk-relative overlay string index when
5097 indexing into it->string_overlays array. (Bug#11653)
5098 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5099 the rightmost. (Bug#11720)
5101 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5103 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5104 (CATEGORY_MEMBER): Enforce 1/0 value.
5105 * category.c (_temp_category_set): Remove.
5107 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5109 * window.c (Fdelete_other_windows_internal)
5110 (Fdelete_window_internal): Don't access frame's mouse highlight
5111 info of the initial frame. (Bug#11677)
5113 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5115 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5116 Assume USE_2_TAGS_FOR_INTS.
5117 (xreload): Adjust $tagmask width to match recent lisp.h change.
5119 Simplify lisp.h in minor ways that should not affect code.
5120 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5121 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5122 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5123 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5124 (INTTYPEBITS): New macro, for clarity.
5125 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5126 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5127 Simplify now that USE_LSB_TAG is always defined.
5128 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5129 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5131 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5133 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5135 2012-06-13 Glenn Morris <rgm@gnu.org>
5137 * s/bsd-common.h (BSD4_3):
5138 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5140 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5142 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5145 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5147 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5148 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5149 * alloc.c (widen_to_Lisp_Object): Remove.
5150 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5151 * frame.c (delete_frame): Remove outdated comment.
5152 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5153 USE_LISP_UNION_TYPE.
5154 (Fw32_unregister_hot_key): Likewise.
5155 (Fw32_toggle_lock_key): Likewise.
5156 * w32menu.c (add_menu_item): Likewise.
5157 (w32_menu_display_help): Use XIL instead of checking
5158 USE_LISP_UNION_TYPE.
5159 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5160 (init_heap): Likewise.
5161 * w32term.c (w32_read_socket): Update comment.
5163 2012-06-13 Glenn Morris <rgm@gnu.org>
5165 * s/usg5-4-common.h, src/s/unixware.h:
5166 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5168 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5170 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5172 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5173 * alloc.c (make_number) [!defined make_number]:
5174 Remove, as lisp.h always defines this now.
5175 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5176 (roundup_size): Verify that it is a power of 2.
5177 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5178 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5179 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5180 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5181 USE_LSB_TAG now is always defined to be either 0 or 1.
5183 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5184 code works fine either way, and efficiency is not a concern here,
5185 as the union type is for debugging, not for production.
5186 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5187 Use an inline function on all platforms when using the union type,
5188 since this is simpler and 'static inline' can be used portably
5190 (LISP_INITIALLY_ZERO): New macro.
5191 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5192 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5194 2012-06-12 Glenn Morris <rgm@gnu.org>
5196 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5198 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5200 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5201 Move BROKEN_SIGIO to configure.
5203 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5204 Move NO_TERMIO to configure.
5206 2012-06-12 Chong Yidong <cyd@gnu.org>
5208 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5209 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5210 MagickExportImagePixels is undefined.
5212 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5214 * image.c (imagemagick_load_image): Remove unused label.
5216 2012-06-11 Glenn Morris <rgm@gnu.org>
5218 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5219 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5220 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5221 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5223 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5225 * alloc.c (make_byte_code): New function.
5226 (Fmake_byte_code): Use it. Don't purify here.
5227 * lread.c (read1): Use it as well to avoid extra allocation.
5229 2012-06-11 Chong Yidong <cyd@gnu.org>
5231 * image.c (imagemagick_load_image): Implement transparency.
5233 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5235 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5236 account for preceding backslashes. (Bug#11663)
5238 2012-06-09 Chong Yidong <cyd@gnu.org>
5240 * term.c: Support italics in capable terminals (Bug#9652).
5241 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5242 (turn_on_face): Output using TS_enter_italic_mode if available.
5243 Don't handle unused blinking and alt-charset cases.
5244 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5245 and tty_alt_charset_p cases.
5246 (tty_capable_p, init_tty): Support italics.
5248 * termchar.h (struct tty_display_info): Add field for italics.
5249 Remove unused blink field.
5251 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5254 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5255 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5256 tty_alt_charset_p. Add tty_italic_p.
5258 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5260 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5261 dbus_type_is_basic if available.
5262 (xd_extract_signed, xd_extract_unsigned): Rename from
5263 extract_signed and extract_unsigned, respectively. Adapt callers.
5265 2012-06-09 Chong Yidong <cyd@gnu.org>
5267 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5269 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5272 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5274 * xdisp.c (vmessage): Treat frame message as multibyte.
5275 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5276 would generate the diagnostic "Making \302\247 buffer-local while
5279 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5281 * dispnew.c (showing_window_margins_p): Undo last change, which
5282 was done due to an inadvertent commit.
5283 (adjust_frame_glyphs_for_frame_redisplay): Do call
5284 showing_window_margins_p.
5286 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5288 * eval.c (Fmake_var_non_special): New primitive.
5289 (syms_of_eval): Defsubr it.
5290 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5292 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5294 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5295 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5297 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5299 * alloc.c (allocate_vectorlike): Fix last change.
5301 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5303 Block-based vector allocation of small vectors.
5304 * lisp.h (struct vectorlike_header): New field `nbytes',
5305 adjust comment accordingly.
5306 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5307 to denote vector blocks. Adjust users (live_vector_p,
5308 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5309 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5310 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5311 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5312 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5313 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5314 (roundup_size): New constant.
5315 (struct vector_block): New data type.
5316 (vector_blocks, vector_free_lists, zero_vector): New variables.
5317 (all_vectors): Rename to `large_vectors'.
5318 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5319 (sweep_vectors): New functions.
5320 (allocate_vectorlike): Return `zero_vector' as the only vector of
5321 0 items. Allocate new vector from block if vector size is less than
5322 or equal to VBLOCK_BYTES_MAX.
5323 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5324 (init_alloc_once): Add call to init_vectors.
5326 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5328 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5330 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5332 * doprnt.c (doprnt): Truncate multibyte char correctly.
5333 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5334 would mishandle a string argument "Xc" if X was a multibyte
5335 character of length 2: it would truncate after X's first byte
5336 rather than including all of X.
5338 2012-06-06 Chong Yidong <cyd@gnu.org>
5340 * buffer.c (word_wrap): Doc fix.
5342 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5344 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5346 2012-06-03 Glenn Morris <rgm@gnu.org>
5348 * xdisp.c (tool-bar-style): Doc fix.
5350 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5352 * Makefile.in (PAXCTL): Define.
5353 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5354 binary via PaX flags if the paxctl utility is available.
5355 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5356 Restore PaX flags to their default. (Bug#11398)
5358 2012-06-03 Chong Yidong <cyd@gnu.org>
5360 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5363 2012-06-03 Chong Yidong <cyd@gnu.org>
5365 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5366 (note_mode_line_or_margin_highlight): If there is no help echo,
5367 use mode-line-default-help-echo. Handle the case where the mouse
5368 position is past the end of the mode line string.
5370 * buffer.c (buffer_local_value_1): New function, split from
5371 Fbuffer_local_value; can return Qunbound.
5372 (Fbuffer_local_value): Use it.
5373 (Vmode_line_format): Docstring tweaks.
5375 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5377 * sysdep.c (system_process_attributes): Improve comment.
5379 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5381 * keyboard.c: Export real-this-command to Elisp.
5382 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5383 and DEFVAR it. Update all users.
5385 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5387 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5389 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5390 Convert pctcpu and pctmem to Lisp float properly.
5391 Let the compiler fold better, as 100.0/0x8000 is exact.
5393 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5395 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5398 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5400 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5402 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5404 For a 'struct window', replace some Lisp_Object fields to
5405 bitfields where appropriate, remove unused fields.
5406 * window.h (struct window): Remove unused 'last_mark_x' and
5407 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5408 change it's type from Lisp_Object to bitfield.
5409 Change type of 'force_start', 'optional_new_start',
5410 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5411 fields from Lisp_Object to bitfield. Adjust users accordingly.
5413 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5415 Pacify gcc -Wdouble-precision when using Xaw.
5416 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5417 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5418 Use 'float' consistently, rather than 'float' in most places
5419 and 'double' in a couple of places.
5421 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5423 * xdisp.c (handle_stop): Detect whether we have overlay strings
5424 loaded by testing it->current.overlay_string_index to be
5425 non-negative, instead of checking whether n_overlay_strings is
5426 positive. (Bug#11587)
5428 2012-05-31 Chong Yidong <cyd@gnu.org>
5430 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5432 * doc.c (Fsubstitute_command_keys): Doc fix.
5434 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5436 * search.c (search_buffer): Remove calls to
5437 r_alloc_inhibit_buffer_relocation, as it is now called by
5438 maybe_unify_char, which was the cause of relocation of buffer text
5441 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5443 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5444 for the duration of call to load_charset, to avoid problems with
5445 callers of maybe_unify_char that access buffer text through C
5448 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5449 decrement the inhibition flag, instead of just setting or
5452 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5454 Remove obsolete '#define static' cruft.
5455 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5456 This #undef was "temporary" in 2000; it is no longer needed
5457 now that '#define static' has gone away.
5458 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5459 (gray_bitmap_bits): Remove; no longer needed.
5460 All uses replaced with definiens.
5461 * xterm.c: Include "bitmaps/gray.xbm".
5463 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5465 Clean up __executable_start, monstartup when --enable-profiling.
5466 The following changes affect the code only when profiling.
5467 * dispnew.c (__executable_start): Rename from safe_bcopy.
5468 Define only on platforms that need it.
5469 * emacs.c: Include <sys/gmon.h> when profiling.
5470 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5471 (__executable_start): Remove decl, since lisp.h does it now.
5472 (safe_bcopy): Remove decl; no longer has that name.
5473 (main): Coalesce #if into single bit of code, for simplicity.
5474 Cast pointers to uintptr_t, since standard libraries want integers
5476 * lisp.h (__executable_start): New decl.
5478 2012-05-31 Glenn Morris <rgm@gnu.org>
5480 * image.c (Fimagemagick_types): Doc fix.
5482 2012-05-30 Jim Meyering <meyering@redhat.com>
5484 * callproc.c (Fcall_process_region): Include directory component
5485 in mkstemp error message (Bug#11586).
5487 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5489 * alloc.c, lisp.h (make_pure_vector): Now static.
5491 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5493 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5494 Move to byte-run.el.
5495 (Fautoload): Do the hash-doc more carefully.
5496 * data.c (Fdefalias): Purify definition, except for keymaps.
5497 (Qdefun): Move from eval.c.
5498 * lisp.h (Qdefun): Remove.
5499 * lread.c (read1): Tiny simplification.
5501 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
5503 Do not create empty overlays with the evaporate property (Bug#9642).
5504 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5505 Bug#9642, but explicitly check that the buffer the overlay would
5506 be moved to is live and rearrange lines to make sure that errors
5507 will not put the overlay in an inconsistent state.
5508 (Fdelete_overlay): Cosmetics.
5510 2012-05-28 Eli Zaretskii <eliz@gnu.org>
5512 * w32term.c (my_bring_window_to_top): New function.
5513 (x_raise_frame): Use handle returned by DeferWindowPos, which
5514 could be different from the original one.
5515 Call my_bring_window_to_top instead of my_set_foreground_window.
5518 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5519 by calling BringWindowToTop.
5521 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5522 (WM_EMACS_END): Increase by one.
5524 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5526 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5527 This avoids undefined behavior that might cause the eassert
5528 to not catch an out-of-range value.
5530 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
5532 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5533 Update dependencies.
5535 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5537 * bidi.c (bidi_mirror_char): Fix last change.
5539 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5541 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5542 when referring to sectname field in printf format.
5544 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5546 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5547 Only r_alloc_inhibit_buffer_relocation needed to be added;
5548 the others were already declared.
5550 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5551 before checking whether it's out of range. Put the check inside
5553 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5555 2012-05-27 Ken Brown <kbrown@cornell.edu>
5557 * callproc.c (Fcall_process): Restore a line that was accidentally
5558 commented out in the 2011-02-13 change (bug#11547).
5560 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5562 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5563 defined on ralloc.c.
5565 * buffer.c [REL_ALLOC]: Remove prototypes of
5566 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5567 they are now on lisp.h.
5569 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5571 * search.c (search_buffer): Use it to inhibit relocation of buffer
5572 text while re_search_2 is doing its job, because re_search_2 is
5573 passed C pointers to buffer text. (Bug#11519)
5575 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5578 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5579 state after an additional call to move_it_in_display_line_to, keep
5580 the values of it->max_ascent and it->max_descent found for the
5582 (pos_visible_p): Revert the comparison against bottom_y to what it
5583 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5586 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5588 Fix coding-related core dumps with gcc -ftrapv.
5589 The code was computing A - B, where A and B are pointers, and B is
5590 random garbage. This can lead to core dumps on platforms that
5591 have special pointer registers, and it also leads to core dumps on
5592 x86-64 when compiled with gcc -ftrapv. The fix is to compute
5593 A - B only when B is initialized properly.
5594 * coding.c (coding_set_source, coding_set_destination): Return void.
5595 (coding_change_source, coding_change_destinations): New functions,
5596 with the old behaviors of coding_set_source and coding_set_destination.
5597 All callers that need an offset changed to use these new functions.
5599 2012-05-26 Glenn Morris <rgm@gnu.org>
5601 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5603 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5605 Extend mouse support on W32 text-mode console.
5606 * xdisp.c (draw_row_with_mouse_face):
5607 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
5609 * w32console.c: Include window.h.
5610 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5612 (initialize_w32_display): Initialize mouse-highlight data.
5614 * w32inevt.c: Include termchar.h and window.h.
5615 (do_mouse_event): Support mouse-autoselect-window. When the mouse
5616 moves, call note_mouse_highlight. If help_echo changed, call
5617 gen_help_event to produce help-echo message in the echo area.
5618 Call clear_mouse_face if mouse_face_hidden is set in the mouse
5621 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5623 * lread.c (read1): Simplify slightly to avoid an overflow warning
5624 with GCC 4.7.0 on x86-64.
5626 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5628 * bidi.c (bidi_mirror_char): Revert last change: an int is
5629 definitely wide enough here.
5631 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
5633 Fix integer width and related bugs (Bug#9874).
5634 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
5635 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5636 (string_bytes, check_sblock, allocate_string_data):
5637 (compact_small_strings, Fmake_bool_vector, make_string)
5638 (make_unibyte_string, make_multibyte_string)
5639 (make_string_from_bytes, make_specified_string)
5640 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5641 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5643 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5644 (allocate_pseudovector):
5645 Use int, not EMACS_INT, where int is wide enough.
5646 (inhibit_garbage_collection, Fgarbage_collect):
5647 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5648 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5649 int might not be wide enough.
5650 (bidi_cache_search, bidi_cache_find, bidi_init_it)
5651 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5652 (bidi_at_paragraph_end, bidi_find_paragraph_start)
5653 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5654 (bidi_level_of_next_char, bidi_move_to_visually_next):
5655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5656 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5657 (Fkill_buffer, Fset_buffer_major_mode)
5658 (advance_to_char_boundary, Fbuffer_swap_text)
5659 (Fset_buffer_multibyte, overlays_at, overlays_in)
5660 (overlay_touches_p, struct sortvec, record_overlay_string)
5661 (overlay_strings, recenter_overlay_lists)
5662 (adjust_overlays_for_insert, adjust_overlays_for_delete)
5663 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5664 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5665 (Foverlay_recenter, last_overlay_modification_hooks_used)
5666 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5667 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5668 (validate_region): Omit unnecessary test for b <= e,
5669 since that's guaranteed by the previous test.
5670 (adjust_overlays_for_delete): Avoid pos + length overflow.
5671 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5672 (report_overlay_modification):
5673 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5674 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5675 Omit pointer cast, which isn't needed anyway, and doesn't work
5676 after the EMACS_INT -> ptrdiff_t change.
5677 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
5678 * buffer.h: Adjust decls to match defn changes elsewhere.
5679 (struct buffer_text, struct buffer):
5680 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5681 Use EMACS_INT, not int, where int might not be wide enough.
5682 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5683 not int, to avoid needless 32-bit limit on 64-bit hosts.
5684 (exec_byte_code): Use tighter memory-full test, one that checks
5685 for alloca overflow. Don't compute the address of the object just
5686 before an array, as that's not portable. Use EMACS_INT, not
5687 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
5688 * callint.c (Fcall_interactively):
5689 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5690 * callproc.c (call_process_kill, Fcall_process):
5691 Don't assume pid_t fits into an Emacs fixnum.
5692 (call_process_cleanup, Fcall_process, child_setup):
5693 Don't assume pid_t fits into int.
5694 (call_process_cleanup, Fcall_process, delete_temp_file)
5695 (Fcall_process_region):
5696 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5697 (Fcall_process): Simplify handling of volatile integers.
5698 Use int, not EMACS_INT, where int will do.
5699 * casefiddle.c (casify_object, casify_region, operate_on_word)
5700 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5701 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5702 (casify_object): Avoid integer overflow when overallocating buffer.
5703 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
5704 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
5705 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5706 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5707 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5708 integers are now checked earlier. All uses replaced with XINT.
5710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5711 For CCL_MapSingle, check that content and value are in int range.
5712 (ccl_driver, Fregister_code_conversion_map):
5713 Check that Vcode_version_map_vector is a vector.
5714 (resolve_symbol_ccl_program): Check that vector header is in range.
5715 Always copy the vector, so that we can check its contents reliably
5716 now rather than having to recheck each instruction as it's being
5717 executed. Check that vector words fit in 'int'.
5718 (ccl_get_compiled_code, Fregister_ccl_program)
5719 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5720 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5721 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5722 contents are in range.
5723 (Fccl_execute_on_string): Check that status is in range.
5724 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5725 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5726 Accept and return EMACS_INT, not int, because callers can pass values
5728 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5729 (multibyte_chars_in_text, parse_str_as_multibyte)
5730 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5731 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5732 (string_escape_byte8, Fget_byte):
5733 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5734 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
5735 avoid mishandling large integers.
5736 * character.h: Adjust decls to match defn changes elsewhere.
5737 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5738 (Ffind_charset_region):
5739 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5740 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5741 (load_charset_map_from_vector, Fdefine_charset_internal):
5742 Don't assume fixnum fits in int.
5743 (load_charset_map_from_vector, Fmap_charset_chars):
5744 Remove now-unnecessary CHECK_NATNUMs.
5745 (Fdefine_charset_internal): Check ranges here, more carefully.
5746 Don't rely on undefined behavior with signed left shift overflow.
5747 Don't assume unsigned int fits into fixnum, or that fixnum fits
5748 into unsigned int. Don't require max_code to be a valid fixnum;
5749 that's not true for gb10830 4-byte on a 32-bit host. Allow
5750 invalid_code to be a cons, for the same reason. Require code_offset
5751 to be a character. Avoid int overflow if max_char is close
5753 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5754 this is intended anyway and avoids some undefined behavior.
5755 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5756 INDEX_TO_CODE_POINT, as that's what it expects.
5757 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
5758 * charset.h (DECODE_CHAR): Return int, not unsigned;
5759 this is what was intended anyway, and it avoids undefined behavior.
5760 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5761 integer-overflow issues.
5762 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5763 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5764 where the argument is EMACS_INT, and this behavior is not intended.
5765 * chartab.c (Fmake_char_table, Fset_char_table_range)
5766 (uniprop_get_decoder, uniprop_get_encoder):
5767 Don't assume fixnum fits in int.
5768 * cmds.c (move_point): New function, that does the gist of
5769 Fforward_char and Fbackward_char, but does so while checking
5770 for integer overflow more accurately.
5771 (Fforward_char, Fbackward_char): Use it.
5772 (Fforward_line, Fend_of_line, internal_self_insert)
5773 (internal_self_insert):
5774 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5775 Fix a FIXME, by checking for integer overflow when calculating
5776 target_clm and actual_clm.
5777 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
5778 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
5779 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5780 (coding_alloc_by_making_gap, alloc_destination)
5781 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5782 (encode_coding_utf_16, detect_coding_emacs_mule)
5783 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5784 (detect_coding_iso_2022, decode_coding_iso_2022)
5785 (encode_invocation_designation, encode_designation_at_bol)
5786 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5787 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5788 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5789 (encode_coding_ccl, encode_coding_raw_text)
5790 (detect_coding_charset, decode_coding_charset)
5791 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5792 (produce_composition, produce_charset, produce_annotation)
5793 (decode_coding, handle_composition_annotation)
5794 (handle_charset_annotation, consume_chars, decode_coding_gap)
5795 (decode_coding_object, encode_coding_object, detect_coding_system)
5796 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5797 (code_convert_region, code_convert_string)
5798 (Fdefine_coding_system_internal)
5799 (coding_set_source, coding_set_destination):
5800 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5801 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5802 (Fdefine_coding_system_internal):
5803 Don't assume fixnums fit in int.
5804 (decode_coding_gap, decode_coding_object, encode_coding_object)
5805 (Fread_coding_system, Fdetect_coding_region)
5806 (Funencodable_char_position, Fcheck_coding_systems_region)
5807 (get_translation, handle_composition_annotation, consume_chars):
5808 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5809 (consume_chars): Rewrite to not calculate an address outside buffer.
5810 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
5811 Don't access memory outside of the args array.
5812 (Fdefine_coding_system_internal): Check for charset-id overflow.
5813 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5814 result of ENCODE_CHAR.
5815 * coding.h: Adjust decls to match defn changes elsewhere.
5816 (struct coding_system):
5817 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5818 * composite.c (get_composition_id, find_composition)
5819 (run_composition_function, update_compositions)
5820 (compose_text, composition_gstring_put_cache)
5821 (composition_gstring_p, composition_gstring_width)
5822 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5823 (composition_compute_stop_pos, composition_reseat_it)
5824 (composition_update_it, struct position_record)
5825 (find_automatic_composition, composition_adjust_point)
5826 (Fcomposition_get_gstring, Ffind_composition_internal):
5827 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5828 (update_compositions):
5829 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5830 * composite.h: Adjust decls to match defn changes elsewhere.
5831 (struct composition):
5832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5833 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5834 Do not attempt to compute the address of the object just before a
5835 buffer; this is not portable.
5837 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5838 (Faset): Use int, not EMACS_INT, where int is wide enough.
5839 (Fstring_to_number): Don't assume fixnums fit in int.
5840 (Frem): Don't assume arg is nonnegative.
5841 * dbusbind.c (xd_append_arg): Check for integers out of range.
5842 (Fdbus_call_method): Don't overflow the timeout int.
5843 (extract_signed, extract_unsigned): New functions.
5844 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5845 (xd_get_connection_references): Return ptrdiff_t, not int.
5847 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5848 (xd_read_message_1):
5849 Use int, not unsigned, where the dbus API uses int.
5850 (Fdbus_message_internal): Don't overflow mtype.
5851 (syms_of_dbusbind): Allocate right-sized buffer for integers.
5852 * dired.c (directory_files_internal, file_name_completion, scmp)
5853 (file_name_completion_stat):
5854 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5855 (file_name_completion): Don't overflow matchcount.
5856 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5857 * dispextern.h: Adjust decls to match defn changes elsewhere.
5858 (struct text_pos, struct glyph, struct bidi_saved_info)
5859 (struct bidi_string_data, struct bidi_it, struct composition_it)
5861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5862 (struct display_pos, struct composition_it, struct it):
5863 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5864 * dispnew.c (increment_matrix_positions)
5865 (increment_row_positions, mode_line_string)
5866 (marginal_area_string):
5867 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5868 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
5869 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5870 (duration_to_sec_usec): New function, to check for overflow better.
5871 (Fsleep_for, sit_for): Use it.
5872 * doc.c (get_doc_string, store_function_docstring):
5873 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5874 (get_doc_string, Fsnarf_documentation):
5875 Use int, not EMACS_INT, where int is wide enough.
5877 Use SAFE_ALLOCA, not alloca.
5878 Check for overflow when converting EMACS_INT to off_t.
5879 * doprnt.c (doprnt):
5880 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5881 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5882 Don't assume uid_t fits into fixnum.
5883 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5884 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5885 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5886 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5887 (general_insert_function)
5888 (Finsert_char, make_buffer_string, make_buffer_string_both)
5889 (update_buffer_properties, Fbuffer_substring)
5890 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5891 (Fsubst_char_in_region, check_translation)
5892 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5893 (transpose_markers, Ftranspose_regions):
5894 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5895 (clip_to_bounds): Move to lisp.h as an inline function).
5896 (Fconstrain_to_field): Don't assume integers are nonnegative.
5897 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5898 (Fsubst_char_in_region, Fsave_restriction):
5899 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5900 (Femacs_pid): Don't assume pid_t fits into fixnum.
5901 (lo_time): Use int, not EMACS_INT, when int suffices.
5902 (lisp_time_argument): Check for usec out of range.
5903 (Fencode_time): Don't assume fixnum fits in int.
5904 (Fuser_login_name, Fuser_full_name): Signal an error
5905 if a uid argument is out of range, rather than relying on
5907 (Fformat_time_string): Remove now-unnecessary check.
5908 lisp_time_argument checks for out-of-range usec now.
5909 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
5910 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5911 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5912 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5913 (init_cmdargs, Fdump_emacs):
5914 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5915 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5916 the bottom (typically) 32 bits of the fixnum.
5917 * eval.c (specpdl_size, call_debugger):
5918 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5919 (when_entered_debugger, Fbacktrace_debug):
5920 Don't assume fixnum can fit in int.
5921 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5922 the object just before a buffer; this is not portable.
5923 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5924 (grow_specpdl, unbind_to):
5925 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5926 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5927 (grow_specpdl): Simplify allocation by using xpalloc.
5928 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
5929 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5930 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5931 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5932 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5934 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5935 (Fcopy_file, non_regular_nbytes, read_non_regular)
5936 (Finsert_file_contents):
5937 Use int, not EMACS_INT, where int is wide enough.
5938 (READ_BUF_SIZE): Verify that it fits in int.
5939 (Finsert_file_contents): Check that counts are in proper range,
5940 rather than assuming fixnums fit into ptrdiff_t etc.
5941 Don't assume fixnums fit into int.
5942 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5943 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5944 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
5945 (string_char_to_byte, string_byte_to_char)
5946 (string_make_multibyte, string_to_multibyte)
5947 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5948 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5949 (substring_both, Fdelete, internal_equal, Ffillarray)
5950 (Fclear_string, mapcar1)
5951 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5952 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5953 (larger_vector, make_hash_table, maybe_resize_hash_table)
5954 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5955 (Fmaphash, secure_hash):
5956 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5957 (concat): Check for string index and length overflow.
5958 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5960 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5961 (larger_vector): New API (vec, incr_min, size_max) replaces old
5962 one (vec, new_size, init). This catches size overflow.
5963 INIT was removed because it was always Qnil.
5964 All callers changed.
5965 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5966 the upper bound on a hash table index size.
5967 (make_hash_table, maybe_resize_hash_table): Use it.
5968 (secure_hash): Computer start_byte and end_byte only after
5969 they're known to be in ptrdiff_t range.
5970 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5971 (Ffont_get_glyphs, Ffont_at):
5972 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5973 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5974 (Flist_fonts, Fopen_font):
5975 Don't assume fixnum can fit in int.
5976 (check_gstring): Don't assume index can fit in int.
5977 (font_match_p): Check that fixnum is a character, not a nonnegative
5978 fixnum, since the later code needs to stuff it into an int.
5979 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5980 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5981 conversion overflow issues.
5982 (Fopen_font): Check for integer out of range.
5983 (Ffont_get_glyphs): Don't assume index can fit in int.
5984 * font.h: Adjust decls to match defn changes elsewhere.
5985 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5987 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5988 printmax_t, where ptrdiff_t is wide enough.
5989 (Finternal_char_font):
5990 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5991 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5992 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5993 (Fset_frame_position, x_set_frame_parameters)
5994 (x_set_line_spacing, x_set_border_width)
5995 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5996 Check that fixnums are in proper range for system types.
5997 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5998 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5999 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6000 Use SAFE_ALLOCA_LISP, not alloca.
6001 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6002 intptr_t is wide enough.
6003 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6004 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6005 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6006 Check for fixnum out of range.
6007 * ftfont.c (ftfont_list): Don't assume index fits in int.
6008 Check that fixnums are in proper range for system types.
6009 (ftfont_shape_by_flt):
6010 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6011 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6012 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6013 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6014 Check that fixnums are in proper range for system types.
6015 * gnutls.h: Adjust decls to match defn changes elsewhere.
6016 * gtkutil.c (xg_dialog_run):
6017 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6018 (update_frame_tool_bar):
6019 Check that fixnums are in proper range for system types.
6020 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6021 (lookup_image): Check that fixnums are in range for system types.
6022 * indent.c (last_known_column, last_known_column_point):
6023 (current_column_bol_cache):
6024 (skip_invisible, current_column, check_display_width):
6025 (check_display_width, scan_for_column, current_column_1)
6026 (Findent_to, Fcurrent_indentation, position_indentation)
6027 (indented_beyond_p, Fmove_to_column, compute_motion):
6028 (Fcompute_motion, Fvertical_motion):
6029 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6030 (last_known_column_modified): Use EMACS_INT, not int.
6031 (check_display_width):
6033 Check that fixnums and floats are in proper range for system types.
6034 (compute_motion): Don't assume index or fixnum fits in int.
6035 (compute_motion, Fcompute_motion):
6036 Use int, not EMACS_INT, when it is wide enough.
6037 (vmotion): Omit local var start_hpos that is always 0; that way
6038 we don't need to worry about overflow in expressions involving it.
6039 * indent.h: Adjust decls to match defn changes elsewhere.
6041 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6042 Use int, not EMACS_INT, where int is wide enough.
6043 Remove unused members ovstring_chars_done and tab_offset;
6045 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6046 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6047 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6048 (make_gap, copy_text, insert, insert_and_inherit)
6049 (insert_before_markers, insert_before_markers_and_inherit)
6050 (insert_1, count_combining_before, count_combining_after)
6051 (insert_1_both, insert_from_string)
6052 (insert_from_string_before_markers, insert_from_string_1)
6053 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6054 (adjust_after_replace, adjust_after_insert, replace_range)
6055 (replace_range_2, del_range, del_range_1, del_range_byte)
6056 (del_range_both, del_range_2, modify_region)
6057 (prepare_to_modify_buffer, signal_before_change)
6058 (signal_after_change, Fcombine_after_change_execute):
6059 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6060 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6061 (balance_an_interval, split_interval_right, split_interval_left)
6062 (find_interval, next_interval, update_interval)
6063 (adjust_intervals_for_insertion, delete_node, delete_interval)
6064 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6065 (static_offset_intervals, offset_intervals)
6066 (merge_interval_right, merge_interval_left, make_new_interval)
6067 (graft_intervals_into_buffer, temp_set_point_both)
6068 (temp_set_point, set_point, adjust_for_invis_intang)
6069 (set_point_both, move_if_not_intangible, get_property_and_range)
6070 (get_local_map, copy_intervals, copy_intervals_to_string)
6071 (compare_string_intervals, set_intervals_multibyte_1):
6072 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6073 * intervals.h: Adjust decls to match defn changes elsewhere.
6075 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6076 * keyboard.c (this_command_key_count, this_single_command_key_start)
6077 (before_command_key_count, before_command_echo_length, echo_now)
6078 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6079 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6080 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6081 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6083 (last_non_minibuf_size, last_point_position, echo_truncate)
6084 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6085 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6086 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6087 (stuff_buffered_input):
6088 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6089 (last_auto_save, command_loop_1, read_char):
6090 Use EMACS_INT, not int, to avoid integer overflow.
6091 (record_char): Avoid overflow in total_keys computation.
6092 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6093 * keyboard.h: Adjust decls to match defn changes elsewhere.
6094 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6095 (Fkey_description, Fdescribe_vector, Flookup_key):
6096 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6097 (click_position): New function, to check that positions are in range.
6098 (Fcurrent_active_maps):
6100 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6101 (Faccessible_keymaps, Fkey_description):
6102 (preferred_sequence_p):
6103 Don't assume fixnum can fit into int.
6104 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6105 Check for integer overflow in size calculations.
6106 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6107 avoid mishandling large integers.
6108 * lisp.h: Adjust decls to match defn changes elsewhere.
6109 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6110 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6111 (struct Lisp_Marker):
6112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6113 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6114 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6115 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6116 All callers changed.
6117 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6118 Assume the arg has valid form, since it always does.
6119 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6120 unsigned integer system type.
6121 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6122 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6123 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6124 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6125 (duration_to_sec_usec): New decl.
6126 * lread.c (read_from_string_index, read_from_string_index_byte)
6127 (read_from_string_limit, readchar, unreadchar, openp)
6128 (read_internal_start, read1, oblookup):
6129 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6130 (Fload, readevalloop, Feval_buffer, Feval_region):
6131 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6132 (openp): Check for out-of-range argument to 'access'.
6133 (read1): Use int, not EMACS_INT, where int is wide enough.
6134 Don't assume fixnum fits into int.
6135 Fix off-by-one error that can read outside a buffer.
6136 (read_filtered_event): Use duration_to_sec_usec
6137 to do proper overflow checking on durations.
6138 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6139 in size calculation.
6140 (Fexecute_kbd_macro):
6141 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6142 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6143 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6144 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6145 (set_marker_both, set_marker_restricted_both, marker_position)
6146 (marker_byte_position, Fbuffer_has_markers_at):
6147 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6148 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6149 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6150 It now merely ensures that the menu is large enough, without
6151 necessarily growing it, as this avoids some integer overflow issues.
6152 All callers changed.
6153 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6154 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6155 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6156 Use SAFE_ALLOCA_LISP, not alloca.
6157 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6158 to EMACS_INT. Check that fixnums are in proper range for system types.
6159 * minibuf.c (minibuf_prompt_width, string_to_object)
6160 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6161 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6162 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6163 (get_minibuffer, read_minibuf_unwind):
6164 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6165 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6166 this simplifies overflow checking. All callers changed.
6167 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6169 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6170 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6171 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6172 Check that fixnums are in proper range for system types.
6173 (Fx_create_frame, Fx_show_tip):
6174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6175 * nsfont.m (ns_findfonts, nsfont_list_family):
6176 Don't assume fixnum fits in long.
6177 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6178 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6179 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6181 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6182 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6183 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6184 (PRINTDECLARE, PRINTPREPARE):
6185 (strout, print_string):
6186 (print, print_preprocess, print_check_string_charset_prop)
6188 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6190 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6191 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6192 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6193 (printchar, strout): Use xpalloc to catch size calculation overflow.
6194 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6195 (print_error_message): Use SAFE_ALLOCA, not alloca.
6196 (print_object): Use int, not EMACS_INT, where int is wide enough.
6197 (print_depth, new_backquote_output, print_number_index):
6198 Use ptrdiff_t, not int, where int might not be wide enough.
6199 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6200 (Fset_process_window_size, Fformat_network_address)
6201 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6203 Check that fixnums are in proper range for system types.
6204 (Fsignal_process): Simplify by avoiding a goto.
6205 Check for process-ids out of pid_t range rather than relying on
6207 (process_tick, update_tick): Use EMACS_INT, not int.
6208 (Fformat_network_address, read_process_output, send_process)
6209 (Fprocess_send_region, status_notify):
6210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6211 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6212 (wait_reading_process_output, read_process_output, exec_sentinel):
6213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6214 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6215 (Faccept_process_output): Use duration_to_sec_usec to do proper
6216 overflow checking on durations.
6217 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6218 Don't assume pid_t fits in int.
6219 * process.h (struct Lisp_Process): Members tick and update_tick
6220 are now of type EMACS_INT, not int.
6221 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6222 configured --with-wide-int.
6223 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6224 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6225 * search.c (looking_at_1, string_match_1):
6226 (fast_string_match, fast_c_string_match_ignore_case)
6227 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6228 (scan_newline, find_before_next_newline, search_command)
6229 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6230 (set_search_regs, wordify):
6233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6234 (string_match_1, search_buffer, set_search_regs):
6236 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6237 (wordify): Check for overflow in size calculation.
6238 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6239 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6240 Check that fixnums are in proper range for system types.
6241 * sound.c (struct sound_device)
6242 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6243 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6244 (Fplay_sound_internal):
6245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6246 * syntax.c (struct lisp_parse_state, find_start_modiff)
6247 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6248 (Fparse_partial_sexp):
6249 Don't assume fixnums can fit in int.
6250 (struct lisp_parse_state, find_start_pos, find_start_value)
6251 (find_start_value_byte, find_start_begv)
6252 (update_syntax_table, char_quoted, dec_bytepos)
6253 (find_defun_start, prev_char_comend_first, back_comment):
6254 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6255 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6256 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6257 (Finternal_describe_syntax_value): Check that match_lisp is a
6258 character, not an integer, since the code stuffs it into int.
6259 (scan_words, scan_sexps_forward):
6260 Check that fixnums are in proper range for system types.
6262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6263 (scan_sexps_forward):
6264 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6265 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6266 * syntax.h: Adjust decls to match defn changes elsewhere.
6267 (struct gl_state_s):
6268 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6269 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6270 MOST_POSITIVE_FIXNUM.
6271 * sysdep.c (wait_for_termination_1, wait_for_termination)
6272 (interruptible_wait_for_termination, mkdir):
6273 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6274 (emacs_read, emacs_write):
6275 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6276 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6277 and double all fit in int.
6278 * term.c (set_tty_color_mode):
6279 Check that fixnums are in proper range for system types.
6280 * termhooks.h (struct input_event):
6281 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6282 * textprop.c (validate_interval_range, interval_of)
6283 (Fadd_text_properties, set_text_properties_1)
6284 (Fremove_text_properties, Fremove_list_of_text_properties)
6285 (Ftext_property_any, Ftext_property_not_all)
6286 (copy_text_properties, text_property_list, extend_property_ranges)
6287 (verify_interval_modification):
6288 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6289 (Fnext_single_char_property_change)
6290 (Fprevious_single_char_property_change):
6291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6292 (copy_text_properties):
6293 Check for integer overflow in index calculation.
6294 * undo.c (last_boundary_position, record_point, record_insert)
6295 (record_delete, record_marker_adjustment, record_change)
6296 (record_property_change):
6297 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6298 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6299 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6300 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6301 (Fx_hide_tip, Fx_file_dialog):
6302 * w32menu.c (set_frame_menubar):
6303 Use ptrdiff_t, not int, for consistency with rest of code.
6304 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6305 (select_window, Fdelete_other_windows_internal)
6306 (window_scroll_pixel_based, window_scroll_line_based)
6307 (Frecenter, Fset_window_configuration):
6308 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6309 (Fset_window_hscroll, run_window_configuration_change_hook)
6310 (set_window_buffer, temp_output_buffer_show, scroll_command)
6311 (Fscroll_other_window, Frecenter):
6312 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6313 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6314 Don't assume fixnum fits in int.
6315 (Fset_window_scroll_bars):
6316 Check that fixnums are in proper range for system types.
6317 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6318 (string_pos, c_string_pos, number_of_chars, init_iterator)
6319 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6320 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6321 (compute_display_string_end, handle_face_prop)
6322 (face_before_or_after_it_pos, handle_invisible_prop)
6323 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6324 (display_prop_intangible_p, string_buffer_position_lim)
6325 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6326 (get_overlay_strings_1, get_overlay_strings)
6327 (iterate_out_of_display_property, forward_to_next_line_start)
6328 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6329 (get_next_display_element, set_iterator_to_next)
6330 (get_visually_first_element, compute_stop_pos_backwards)
6331 (handle_stop_backwards, next_element_from_buffer)
6332 (move_it_in_display_line_to, move_it_in_display_line)
6333 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6334 (add_to_log, message_dolog, message_log_check_duplicate)
6335 (message2, message2_nolog, message3, message3_nolog
6336 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6337 (current_message_1, truncate_echo_area, truncate_message_1)
6338 (set_message, set_message_1, store_mode_line_noprop)
6339 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6340 (text_outside_line_unchanged_p, check_point_in_composition)
6341 (reconsider_clip_changes)
6342 (redisplay_internal, set_cursor_from_row, try_scrolling)
6343 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6344 (redisplay_window, find_last_unchanged_at_beg_row)
6345 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6346 (trailing_whitespace_p, find_row_edges, display_line)
6347 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6348 (display_mode_element, store_mode_line_string)
6349 (pint2str, pint2hrstr, decode_mode_spec)
6350 (display_count_lines, display_string, draw_glyphs)
6351 (x_produce_glyphs, x_insert_glyphs)
6352 (rows_from_pos_range, mouse_face_from_buffer_pos)
6353 (fast_find_string_pos, mouse_face_from_string_pos)
6354 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6356 (safe_call, init_from_display_pos, handle_fontified_prop)
6357 (handle_single_display_spec, load_overlay_strings)
6358 (with_echo_area_buffer, setup_echo_area_for_printing)
6359 (display_echo_area, echo_area_display)
6360 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6361 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6362 (redisplay_window, dump_glyph_row, display_mode_line)
6363 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6364 (handle_display_spec, display_prop_string_p):
6365 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6366 (handle_single_display_spec, build_desired_tool_bar_string)
6367 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6368 (get_specified_cursor_type):
6369 Check that fixnums are in proper range for system types.
6370 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6371 (Flookup_image_map):
6372 Don't assume fixnums fit in int.
6373 (compare_overlay_entries):
6374 Avoid mishandling comparisons due to subtraction overflow.
6375 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6376 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6377 (handle_tool_bar_click):
6378 Use int, not unsigned, since we prefer signed and the signedness
6379 doesn't matter here.
6380 (get_next_display_element, next_element_from_display_vector):
6381 Use int, not EMACS_INT, when int is wide enough.
6382 (start_hourglass): Use duration_to_sec_usec to do proper
6383 overflow checking on durations.
6384 * xfaces.c (Fbitmap_spec_p):
6385 Check that fixnums are in proper range for system types.
6386 (compare_fonts_by_sort_order):
6387 Avoid mishandling comparisons due to subtraction overflow.
6388 (Fx_family_fonts, realize_basic_faces):
6389 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6391 Don't assume fixnum fits in int.
6392 Use SAFE_ALLOCA_LISP, not alloca.
6393 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6394 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6395 (face_at_buffer_position, face_for_overlay_string)
6396 (face_at_string_position):
6397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6398 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6399 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6401 Check that fixnums are in proper range for system types.
6402 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6403 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6404 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6405 (Fx_change_window_property): Don't assume fixnums fit in int.
6406 * xfont.c (xfont_chars_supported):
6407 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6408 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6409 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6410 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6411 * xml.c (parse_region):
6412 * xrdb.c (magic_file_p):
6413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6414 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6415 (x_get_local_selection, x_reply_selection_request)
6416 (x_handle_selection_request, wait_for_property_change):
6417 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6418 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6419 short is wide enough.
6420 (x_send_client_event): Don't assume fixnum fits in int.
6421 * xterm.c (x_x_to_emacs_modifiers):
6422 Don't assume EMACS_INT overflows nicely into int.
6423 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6425 (handle_one_xevent): NATNUMP can eval its arg twice.
6426 (x_connection_closed):
6427 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6428 * xterm.h: Adjust decls to match defn changes elsewhere.
6429 (struct scroll_bar): Use struct vectorlike_header
6430 rather than rolling our own approximation.
6431 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6433 2012-05-25 Glenn Morris <rgm@gnu.org>
6435 * lisp.mk (lisp): Update for more files being compiled now.
6437 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6439 * lread.c: Remove `read_pure' which makes no difference.
6440 (read_pure): Remove var.
6441 (unreadpure): Remove function.
6442 (readevalloop): Don't call read_list with -1 flag.
6443 (read1, read_vector): Don't test read_pure any more.
6444 (read_list): Simplify.
6446 * fileio.c, character.h: Minor style tweaks.
6448 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6450 * window.h (clip_changed): Remove useless declaration.
6452 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
6454 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6455 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6457 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6460 This directory predates autoconf and is no longer needed nowadays.
6461 Move its few remaining bits of functionality to where they're needed.
6462 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6463 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6464 * m/template.h: Remove.
6465 * Makefile.in (M_FILE): Remove. All uses removed.
6466 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6467 * lisp.h (USE_LSB_TAG):
6468 * mem-limits.h (EXCEEDS_LISP_PTR):
6469 Use VAL_MAX, not VALBITS, in #if.
6470 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6471 (EMACS_UINT): Define unconditionally now.
6472 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6473 (BITS_PER_EMACS_INT): New constants, replacing
6474 what used to be in config.h, but not useful in #if.
6475 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6476 define them any more.
6477 (VAL_MAX): New macro.
6479 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6480 BITS_PER_EMACS_INT, in #if.
6481 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6482 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6483 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6484 * s/ms-w32.h (DATA_START):
6485 Move here from removed file m/intel386.h.
6486 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6487 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6489 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6491 Assume C89 or later.
6492 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6493 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6495 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6496 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6497 * textprop.c, tparam.c (NULL): Remove.
6498 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6499 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6500 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
6501 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6502 * xterm.c (input_signal_count): Assume volatile works.
6504 2012-05-21 Ken Brown <kbrown@cornell.edu>
6506 * xgselect.c (xg_select): Fix first argument in call to 'select'
6509 2012-05-20 Ken Brown <kbrown@cornell.edu>
6511 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
6512 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
6514 2012-05-19 Ken Brown <kbrown@cornell.edu>
6516 * xfns.c (x_in_use): Remove `static' qualifier.
6517 * xterm.h (x_in_use): Declare.
6518 * xgselect.c: Include xterm.h.
6519 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6520 and `display_arg' (bug#9754).
6522 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6524 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6526 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6527 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6529 2012-05-18 Eli Zaretskii <eliz@gnu.org>
6531 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6533 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
6534 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
6536 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6537 reference to image_cache->refcount.
6538 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6540 2012-05-17 Juri Linkov <juri@jurta.org>
6542 * search.c (Fword_search_regexp, Fword_search_backward)
6543 (Fword_search_forward, Fword_search_backward_lax)
6544 (Fword_search_forward_lax): Move functions to isearch.el
6545 (bug#10145, bug#11381).
6547 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6549 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6551 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6553 * lread.c (init_obarray): Declare Qt and Qnil as special.
6555 2012-05-14 Glenn Morris <rgm@gnu.org>
6557 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
6558 Put "libexec" before "bin", for the sake of init_callproc_1.
6560 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6562 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6564 * unexaix.c: Port to more-recent AIX compilers.
6565 (report_error, report_error_1, make_hdr, copy_sym)
6566 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6567 Make arguments const char *, not char *, to avoid violations of C
6568 standard and to fix some AIX warnings reported by Gilles Pion.
6570 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6572 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6573 already have overlays loaded.
6574 (handle_single_display_spec): Before returning without displaying
6575 fringe bitmap, synchronize the bidi iterator with the main display
6576 iterator, by calling iterate_out_of_display_property.
6577 (iterate_out_of_display_property): Detect buffer iteration by
6578 testing that it->string is a Lisp string.
6579 (get_next_display_element): When the current object is exhausted,
6580 and there's something on it->stack, call set_iterator_to_next to
6581 proceed with what's on the stack, instead of returning zero.
6582 (set_iterator_to_next): If called at the end of a Lisp string,
6583 proceed to consider_string_end without incrementing string
6584 position. Don't increment display vector index past the end of
6585 the display vector. (Bug#11417)
6586 (pos_visible_p): Don't report a position visible when move_it_to
6587 stopped at the last line of window, which happens to be scanned
6588 backwards by the bidi iteration. (Bug#11464)
6590 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6592 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6593 and right-margin display specs even if the spec is invalid or we
6594 are on a TTY, and thus unable to display on the fringes.
6595 That's because the text with the property will not be displayed anyway,
6596 so we need to signal to the caller that this is a "replacing"
6597 display spec. This fixes display when the spec is invalid or we
6600 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6602 * unexaix.c (make_hdr): Fix typo in prototype.
6603 This bug broke the build on AIX. Problem reported by Gilles Pion.
6605 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
6607 * keyboard.c (kbd_buffer_get_event): Read special events also in
6608 batch mode. (Bug#11415)
6610 2012-05-12 Glenn Morris <rgm@gnu.org>
6612 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6614 2012-05-12 Eli Zaretskii <eliz@gnu.org>
6616 * lisp.mk (lisp): Add newcomment.elc.
6618 2012-05-12 Glenn Morris <rgm@gnu.org>
6620 * Makefile.in (MKDIR_P): New, set by configure.
6621 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6623 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6625 Remove unused function hourglass_started.
6626 * dispextern.h (hourglass_started):
6627 * w32fns.c (hourglass_started):
6628 * xdisp.c (hourglass_started): Remove.
6630 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
6632 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6633 Update dependencies.
6635 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6637 * xgselect.c (xg_select): Put maxfds+1 into a var.
6638 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6640 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6642 2012-05-10 Dave Abrahams <dave@boostpro.com>
6644 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6645 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6647 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
6649 * dbusbind.c (xd_registered_buses): New internal Lisp object.
6650 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6651 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6652 Initialize xd_registered_buses.
6654 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6656 Untag more efficiently if USE_LSB_TAG.
6657 This is based on a proposal by YAMAMOTO Mitsuharu in
6658 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6659 For an admittedly artificial (nth 8000 longlist) benchmark on
6660 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
6661 Emacs's overall text size by 1%.
6662 * lisp.h (XUNTAG): New macro.
6663 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6664 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6665 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6666 * eval.c (Fautoload):
6667 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6668 * frame.h (XFRAME): Use XUNTAG.
6670 Port recent dbusbind.c changes to 32-bit --with-wide-int.
6671 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6672 Remove unportable assumptions about print widths of types like
6674 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6675 intptr_t when converting between pointer and integer, to avoid GCC
6676 warnings about wrong width.
6678 2012-05-09 Eli Zaretskii <eliz@gnu.org>
6680 * w32proc.c (new_child): Force Windows to reserve only 64KB of
6681 stack for each reader_thread, instead of defaulting to 8MB
6682 determined by the linker. This avoids failures in creating
6683 subprocesses on Windows 7, see the discussion in this thread:
6684 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6686 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6688 Fix up display of the *Minibuf-0* buffer in the mini window.
6689 * keyboard.c (read_char): Don't clear the echo area if there's no
6691 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
6692 contents of *Minibuf-0*) if there's no message displayed in its stead.
6694 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
6696 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6699 2012-05-06 Chong Yidong <cyd@gnu.org>
6701 * lisp.mk (lisp): Update.
6703 2012-05-05 Jim Meyering <meyering@redhat.com>
6705 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6707 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6709 * data.c (PUT_ERROR): New macro.
6710 (syms_of_data): Use it. Add new error type `user-error'.
6711 * undo.c (user_error): New function.
6712 (Fprimitive_undo): Use it.
6713 * print.c (print_error_message): Adjust print style for `user-error'.
6714 * keyboard.c (user_error): New function.
6715 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6717 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6719 Do not limit current-time-string to years 1000..9999.
6720 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6721 (Fcurrent_time_string): Support any year that is supported by the
6722 underlying localtime representation. Don't use asctime, as it
6723 has undefined behavior for years outside the range -999..9999.
6725 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6727 Fix race conditions involving setenv, gmtime, localtime, asctime.
6728 Without this fix, interrupts could mess up code that uses these
6729 nonreentrant functions, since setting TZ invalidates existing
6730 tm_zone or tzname values, and since most of these functions return
6731 pointers to static storage.
6732 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6733 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6734 Grow the critical sections to include not just invoking
6735 localtime/gmtime, but also accessing these functions' results
6736 including their tm_zone values if any, and any related TZ setting.
6737 (format_time_string): Last arg is now struct tm *, not struct tm **,
6738 so that the struct tm is saved in the critical section.
6739 All callers changed. Simplify allocation of initial buffer, partly
6740 motivated by the fact that memory allocation needs to be outside
6741 the critical section.
6743 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6745 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6746 with RESET_INTERVAL.
6748 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6749 Remove duplicated buffer name initialization.
6751 2012-05-02 Jim Meyering <jim@meyering.net>
6753 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6755 * xfns.c (x_window): Use xstrdup (Bug#11375).
6757 2012-05-02 Eli Zaretskii <eliz@gnu.org>
6759 * xdisp.c (pos_visible_p): If already at a newline from the
6760 display string before the 'while' loop, don't walk back the glyphs
6761 from it3.glyph_row. Solves assertion violation when the display
6762 string begins with a newline (egg.el). (Bug#11367)
6764 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6766 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6769 2012-05-01 Glenn Morris <rgm@gnu.org>
6771 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6772 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6773 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6774 All were removed before 23.1.
6776 * dispnew.c: Remove HAVE_LIBNCURSES test;
6777 it is always true on relevant platforms.
6779 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6780 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6782 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6784 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6786 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6787 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6790 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6792 Do not avoid creating empty evaporating overlays (Bug#9642).
6793 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6794 That is, do not delete an evaporating overlay if it becomes
6795 empty after its bounds are adjusted to fit within its buffer.
6796 This fix caused other problems, and I'm reverting it until we get
6797 to the bottom of them.
6799 2012-04-27 Chong Yidong <cyd@gnu.org>
6801 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6803 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6805 * xdisp.c (pos_visible_p): If the window start position is beyond
6806 ZV, start the display from buffer beginning. Prevents assertion
6807 violation in init_iterator when the minibuffer window is scrolled
6810 * window.c (window_scroll_pixel_based): Likewise.
6812 2012-04-27 Chong Yidong <cyd@gnu.org>
6814 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6816 2012-04-27 Glenn Morris <rgm@gnu.org>
6818 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6819 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6821 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6823 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6824 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
6826 2012-04-26 Eli Zaretskii <eliz@gnu.org>
6828 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6829 display element, check also the underlying string or buffer
6830 character. (Bug#11341)
6832 * w32menu.c: Include w32heap.h.
6833 (add_menu_item): If the call to AppendMenuW (via
6834 unicode_append_menu) fails, disable Unicode menus only if we are
6835 running on Windows 9X/Me.
6837 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6839 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6840 (xgetint): Add missing shift for LSB tags.
6842 2012-04-24 Martin Rudalics <rudalics@gmx.at>
6844 * keyboard.c (read_char): Don't wipe echo area for select window
6845 events: These might get delayed via `mouse-autoselect-window'
6848 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
6850 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6851 manipulation of :loaded-from data.
6853 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
6855 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6856 now a cons (bug#11311).
6858 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6860 Do not create empty overlays with the evaporate property (Bug#9642).
6861 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6862 if it becomes empty after its bounds are adjusted to fit within
6863 its buffer. Without this fix, in a nonempty buffer (let ((o
6864 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6865 yields an empty overlay that has the evaporate property, which is
6866 not supposed to happen.
6868 Fix minor GTK3 problems found by static checking.
6869 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6870 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6871 (struct _EmacsFixedClass, emacs_fixed_get_type):
6872 Move decls here from emacsgtkfixed.h, since they needn't be public.
6873 (emacs_fixed_get_type): Now static.
6874 (emacs_fixed_class_init): Omit unused local.
6875 (emacs_fixed_child_type): Remove; unused.
6876 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6877 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6878 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6879 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6880 (EMACS_FIXED_GET_CLASS): Remove; unused.
6881 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6883 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6884 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6886 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6888 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
6889 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
6890 (__malloc_size_t, __malloc_ptrdiff_t):
6891 Remove. All uses removed, replaced by the definiens if needed,
6892 since we can assume C89 or better now.
6893 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6894 (protect_malloc_state, align, get_contiguous_space)
6895 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6896 (malloc_atfork_handler_child, malloc_enable_thread)
6897 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6898 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6899 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6900 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6901 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6902 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6903 Define using prototypes, not old style.
6904 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6905 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6906 (align): Don't assume that signed integer overflow wraps around.
6907 Omit unused local var.
6908 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6909 (_free_internal_nolock, memalign, mallochook, reallochook):
6910 Omit no-longer-needed casts.
6911 (valloc): Use getpagesize, not __getpagesize.
6912 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6913 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6915 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6917 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
6919 Move functions from C to Lisp. Make non-blocking method calls
6920 the default. Implement further D-Bus standard interfaces.
6922 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6923 (QCdbus_request_name_allow_replacement)
6924 (QCdbus_request_name_replace_existing)
6925 (QCdbus_request_name_do_not_queue)
6926 (QCdbus_request_name_reply_primary_owner)
6927 (QCdbus_request_name_reply_in_queue)
6928 (QCdbus_request_name_reply_exists)
6929 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6930 (QCdbus_registered_serial, QCdbus_registered_method)
6931 (QCdbus_registered_signal): New Lisp objects.
6932 (XD_DEBUG_MESSAGE): Use sizeof.
6933 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6934 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6935 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6936 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6937 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6938 (xd_signature, xd_append_arg): Allow float for integer types.
6939 (xd_get_connection_references): New function.
6940 (xd_get_connection_address): Rename from xd_initialize.
6941 Return cached address.
6942 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6943 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6945 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
6946 Return number of refcounts.
6947 (Fdbus_get_unique_name): Make stronger parameter check.
6948 (Fdbus_message_internal): New defun.
6949 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6950 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6951 (Fdbus_send_signal, Fdbus_register_service)
6952 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6953 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6954 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6955 (Vdbus_compiled_version, Vdbus_runtime_version)
6956 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6957 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6958 (Vdbus_message_type_signal): New defvars.
6959 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6962 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6964 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6965 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6966 Do not assume ptrdiff_t is the same width as 'int'.
6968 * alloc.c: Handle unusual debugging option combinations.
6969 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6970 since the two debugging options are incompatible.
6971 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6973 (mem_init, mem_insert, mem_insert_fixup):
6974 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6975 (NEED_MEM_INSERT): Remove; no longer needed.
6977 2012-04-22 Leo Liu <sdl.web@gmail.com>
6979 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6981 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6983 * sysdep.c [__FreeBSD__]: Minor cleanups.
6984 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6985 Use Emacs indenting style more consistently. Avoid some casts.
6986 Use 'double' consistently rather than mixing 'float' and 'double'.
6988 2012-04-21 Eduard Wiebe <usenet@pusto.de>
6990 * sysdep.c (list_system_processes, system_process_attributes):
6991 Add implementation for FreeBSD (Bug#5243).
6993 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6995 * lisp.mk (lisp): Update.
6997 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6999 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7000 It is never used otherwise.
7002 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7004 * print.c (print_preprocess): Only check print_depth if print-circle
7006 (print_object): Check for cycles even when print-circle is nil and
7007 print-gensym is t, but only check print_depth if print-circle is nil.
7009 2012-04-20 Chong Yidong <cyd@gnu.org>
7011 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7012 set the status to "failed" and ensure that sentinel is run.
7014 2012-04-20 Glenn Morris <rgm@gnu.org>
7016 * process.c (Fset_process_inherit_coding_system_flag)
7017 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7018 (Fmake_network_process, Fmake_serial_process): Doc fix.
7020 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7022 * xdisp.c (string_buffer_position_lim): Limit starting position to
7024 (set_cursor_from_row): If called for a mode-line or header-line
7025 row, return zero immediately.
7026 (try_cursor_movement): If inside continuation line, don't back up
7027 farther than the first row after the header line, if any.
7028 Don't consider the header-line row as "partially visible", even if
7029 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7031 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7033 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7036 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7037 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7039 configure: new option --enable-gcc-warnings (Bug#11207)
7040 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7041 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7042 (ALL_CFLAGS): Use new macros rather than old.
7043 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7044 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7045 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7046 -Wunused-result, -Wunused-variable. This should go away once
7047 the Emacs and Gnulib regex code is merged.
7048 (xmalloc, xrealloc): Now static.
7050 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7052 * dired.c (Fsystem_groups): Remove unused local.
7054 2012-04-17 Glenn Morris <rgm@gnu.org>
7056 * dired.c (Fsystem_users): Doc fix.
7058 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7060 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7061 (syms_of_dired): Add them.
7063 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7065 Fix minor alloc.c problems found by static checking.
7066 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7067 New extern decls, to avoid calling undeclared functions.
7068 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7069 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7070 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7071 (NEED_MEM_INSERT): New macro.
7072 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7073 Remove one incorrect comment and fix another.
7075 Fix minor ralloc.c problems found by static checking.
7076 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7077 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7078 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7079 (r_alloc_sbrk): Now static.
7081 Improve ralloc.c interface checking.
7082 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7083 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7084 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7085 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7086 [REL_ALLOC]: ... to here, to check interface.
7087 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7088 Remove decls. This fixes an "It stinks!".
7090 * alloc.c (which_symbols): Fix alignment issue / type clash.
7092 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7094 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7095 (struct Lisp_Misc_Any): Likewise.
7096 (struct Lisp_Free): Likewise.
7097 * alloc.c (union aligned_Lisp_Symbol): Define.
7098 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7099 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7100 (union aligned_Lisp_Misc): Define.
7101 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7102 aligned_Lisp_Misc instead of union Lisp_Misc.
7103 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7105 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7107 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7108 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7109 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7110 * s/netbsd.h, s/sol2-6.h:
7111 Remove definition of GC_MARK_STACK, since the default now works.
7112 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7113 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7114 no longer the default.
7115 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7117 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7119 * lread.c (lisp_file_lexically_bound_p):
7120 Fix hang at ";-*-\n" (bug#11238).
7122 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7124 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7125 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7127 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7129 * nsterm.m (constrainFrameRect): Always constrain when there is only
7130 one screen (Bug#10962).
7132 2012-04-13 Ken Brown <kbrown@cornell.edu>
7134 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7136 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7138 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7140 2012-04-11 Daniel Colascione <dancol@dancol.org>
7142 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7143 against is gone. It's better to use vfork now so that when Cygwin
7144 gains a new, working vfork, we use it automatically (bug#10398).
7146 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7148 * window.c (save_window_save): Obey window-point-insertion-type.
7150 2012-04-11 Glenn Morris <rgm@gnu.org>
7152 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7154 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7156 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7158 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7160 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7161 (force_quit_count): New var.
7162 (handle_interrupt): Use it.
7164 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7166 * w32.c (w32_delayed_load): Record the full path of the library
7167 being loaded (bug#10424).
7169 2012-04-09 Glenn Morris <rgm@gnu.org>
7171 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7172 not just in the obarray, before snarfing them. (Bug#11036)
7174 * Makefile.in ($(leimdir)/leim-list.el):
7175 Pass EMACS rather than BUILT_EMACS.
7177 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7179 * process.c (make_process):
7180 * process.h: Add integer `gnutls_handshakes_tried' member to
7183 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7184 Add convenience `GNUTLS_LOG2i' macro.
7186 * gnutls.c (gnutls_log_function2i): Convenience log function.
7187 (emacs_gnutls_read): Use new log functions,
7188 `gnutls_handshakes_tried' process member, and
7189 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7190 attempts per process (connection).
7192 2012-04-09 Chong Yidong <cyd@gnu.org>
7194 * eval.c (Fuser_variable_p, user_variable_p_eh)
7195 (lisp_indirect_variable): Functions deleted.
7196 (Fdefvar): Caller changed.
7198 * callint.c (Finteractive, Fcall_interactively):
7199 * minibuf.c (Fread_variable): Callers changed.
7201 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7203 * xdisp.c (set_cursor_from_row): If the display string appears in
7204 the buffer at position that is closer to point than the position
7205 after the display string, display the cursor on the first glyph of
7206 the display string. Fixes cursor display when a 'display' text
7207 property immediately follows invisible text. (Bug#11094)
7209 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7211 composite.c: use 'double' consistently
7212 * composite.c (get_composition_id): Use 'double' consistently
7213 instead of converting 'float' to 'double' and vice versa; this is
7214 easier to understand and avoids a GCC warning.
7216 2012-04-09 Glenn Morris <rgm@gnu.org>
7218 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7219 preparation for dumping it with emacs. (Bug#4789)
7220 (leimdir): New variable.
7221 ($(leimdir)/leim-list.el): New rule.
7222 (emacs$(EXEEXT)): Depend on leim-list.el.
7224 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7225 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7226 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7228 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7230 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7233 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7235 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7236 Remove unused local variable.
7238 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7240 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7241 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7242 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7243 objects, as mark_maybe_pointer will catch them otherwise.
7244 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7245 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7247 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7249 Fix typo that broke non-Windows builds.
7250 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7252 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7254 Support building on MS-Windows with libxml2.
7256 * makefile.w32-in (OBJ2): Add xml.$(O).
7257 (GLOBAL_SOURCES): Add xml.c.
7258 ($(BLD)/xml.$(O)): New dependency list.
7260 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7261 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7262 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7263 [!WINDOWSNT]: New macros.
7264 (init_libxml2_functions, libxml2_loaded_p): New functions.
7265 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7266 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7267 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7268 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7270 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7271 Call init_libxml2_functions before calling libxml2 functions.
7272 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7274 * emacs.c: Don't include libxml/parser.h.
7275 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7276 xmlCleanupParser directly.
7278 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7280 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7282 * indent.c (Fvertical_motion): If there is a display string at
7283 point, use it.vpos to compute how many lines to backtrack after
7284 move_it_to point. (Bug#11133)
7286 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7288 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7289 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7290 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7291 macros related to unification of CJK characters. For the details,
7292 see the discussion following the message here:
7293 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7295 2012-04-04 Chong Yidong <cyd@gnu.org>
7297 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7299 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7301 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7302 instead of alloca. (Bug#11138)
7304 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7306 * w32menu.c (is_simple_dialog): Properly check lisp types.
7309 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7311 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7312 position we get to after a call to move_it_to fails the
7313 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7314 only if we wind up in a string from display property. (Bug#11063)
7316 * window.c (Fdelete_other_windows_internal): Invalidate the row
7317 and column information about mouse highlight, so that redisplay
7318 restores it after reallocating the glyph matrices. (Bug#7464)
7320 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7321 string comes from a `display' text property, use the buffer
7322 position of that property as if we actually saw that position in
7324 (move_it_by_lines): Remove the assertion that
7325 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7326 violated when there's a before-string at the beginning of a line.
7329 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7331 * xdisp.c (append_space_for_newline): If the default face was
7332 remapped, use the remapped face for the appended newline.
7333 (extend_face_to_end_of_line): Use the remapped default face for
7334 extending the face to the end of the line.
7335 (display_line): Call extend_face_to_end_of_line when the default
7336 face was remapped. (Bug#11068)
7338 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7340 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7342 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7344 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7346 2012-03-27 Glenn Morris <rgm@gnu.org>
7348 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7351 2012-03-26 Kenichi Handa <handa@m17n.org>
7353 * dispextern.h (struct glyph): Fix previous change. Change the
7354 bit length of glyphless.ch to 25 (Bug#11082).
7356 2012-03-26 Chong Yidong <cyd@gnu.org>
7358 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7359 (command_loop_1): Use it; inhibit selection update for
7360 handle-select-window too (Bug#8996).
7362 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7364 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7366 2012-03-25 Kenichi Handa <handa@m17n.org>
7368 * dispextern.h (struct glyph): Change the bit length of
7369 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7371 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7373 * s/ms-w32.h (tzname): Include time.h before redirecting to
7374 _tzname. Fixes the MSVC build. (Bug#9960)
7376 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7378 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7381 * xterm.c (XTread_socket): Only modify handling_signal if
7382 !SYNC_INPUT. (Bug#11080)
7384 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7386 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7387 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7388 when fetching a multibyte character consumes more bytes than
7389 CHAR_BYTES returns, due to unification of CJK characters in
7390 string_char. (Bug#11073)
7392 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7394 * process.c (wait_reading_process_output): Handle pty disconnect
7395 by refraining from sending oneself a SIGCHLD (bug#10933).
7397 2012-03-22 Chong Yidong <cyd@gnu.org>
7399 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7401 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7402 Mark string as coming from a prefix property.
7403 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7404 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7406 2012-03-21 Chong Yidong <cyd@gnu.org>
7408 * xfaces.c (Vface_remapping_alist): Doc fix.
7410 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7412 * w32proc.c (Fw32_set_console_codepage)
7413 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7416 2012-03-20 Chong Yidong <cyd@gnu.org>
7418 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7419 to reflect default non-nil value of redisplay-dont-pause.
7421 2012-03-19 Kenichi Handa <handa@m17n.org>
7423 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7424 it fit in a valid range (Bug#11003).
7426 2012-03-18 Eli Zaretskii <eliz@gnu.org>
7428 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7429 that is not from display property, accept the row as a "cursor
7430 row" if one of the string's character has a non-nil `cursor'
7431 property. Fixes cursor positioning when there are newlines in
7432 overlay strings, e.g. in icomplete.el. (Bug#11035)
7434 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7436 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7438 2012-03-12 Chong Yidong <cyd@gnu.org>
7440 * eval.c (inhibit_lisp_code): Rename from
7441 inhibit_window_configuration_change_hook; move from window.c.
7443 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7444 * window.c (run_window_configuration_change_hook)
7445 (syms_of_window): Callers changed.
7447 2012-03-11 Chong Yidong <cyd@gnu.org>
7449 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7451 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7453 2012-03-10 Chong Yidong <cyd@gnu.org>
7455 * frame.c (other_visible_frames): Don't assume the selected frame
7456 is visible (Bug#10955).
7458 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7460 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7462 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7464 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7465 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7468 2012-03-03 Glenn Morris <rgm@gnu.org>
7470 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
7472 2012-03-02 Eli Zaretskii <eliz@gnu.org>
7474 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7475 position past the first glyph_row that ends at ZV. (Bug#10902)
7476 (redisplay_window, next_element_from_string): Fix typos in
7478 (redisplay_window): Pass to move_it_vertically the margin in
7479 pixels, not in screen lines.
7481 2012-03-02 Glenn Morris <rgm@gnu.org>
7483 * buffer.c (buffer-list-update-hook): Doc fix.
7485 2012-02-29 Eli Zaretskii <eliz@gnu.org>
7487 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7488 push_it before setting up the iterator for the first overlay
7489 string, even if we have an empty string loaded.
7490 (next_overlay_string): If there's an empty string on the iterator
7491 stack, pop the stack. (Bug#10903)
7493 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7495 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7496 Suggested by Stefan Monnier in
7497 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7498 * alloc.c (widen_to_Lisp_Object): New static function.
7499 (mark_memory): Also mark Lisp_Objects by fetching pointer words
7500 and widening them to Lisp_Objects. This would work even if
7501 USE_LSB_TAG is defined and wide integers are used, which might
7502 happen in a future version of Emacs.
7504 2012-02-25 Chong Yidong <cyd@gnu.org>
7506 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7509 * xselect.c (Fx_selection_exists_p): Doc fix.
7510 (x_clipboard_manager_save_all): Print an informative message
7511 before saving to clipboard manager.
7513 2012-02-24 Chong Yidong <cyd@gnu.org>
7515 * keyboard.c (process_special_events): Handle all X selection
7516 requests in kbd_buffer, not just the next one (Bug#8869).
7518 2012-02-23 Chong Yidong <cyd@gnu.org>
7520 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7521 call when setting menu-bar-lines and tool-bar-lines parameters.
7522 (unwind_create_frame_1): New helper function.
7524 * window.c (inhibit_window_configuration_change_hook): New var.
7525 (run_window_configuration_change_hook): Obey it.
7526 (syms_of_window): Initialize it.
7528 2012-02-22 Chong Yidong <cyd@gnu.org>
7530 * xterm.c (x_draw_image_relief): Add missing type check for
7531 Vtool_bar_button_margin (Bug#10743).
7533 2012-02-21 Chong Yidong <cyd@gnu.org>
7535 * fileio.c (Vfile_name_handler_alist): Doc fix.
7537 * buffer.c (Fget_file_buffer): Protect against invalid file
7538 handler return value.
7540 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7542 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7543 when computing $valmask.
7545 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7546 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7547 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7548 It's useless in that case, and it can cause problems on hosts
7549 that allocate halves of EMACS_INT values separately.
7550 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7551 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7552 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7553 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7554 it avoids undefined behavior on hosts where shifting right by more
7555 than the word width has undefined behavior.
7557 2012-02-19 Chong Yidong <cyd@gnu.org>
7559 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7560 (Funhandled_file_name_directory, Ffile_name_as_directory)
7561 (Fdirectory_file_name, Fexpand_file_name)
7562 (Fsubstitute_in_file_name): Protect against invalid file handler
7563 return values (Bug#10845).
7565 2012-02-18 Eli Zaretskii <eliz@gnu.org>
7567 * .gdbinit (pitx): Fix incorrect references to fields of the
7570 2012-02-17 Chong Yidong <cyd@gnu.org>
7572 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7574 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7576 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7577 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7579 2012-02-15 Chong Yidong <cyd@gnu.org>
7581 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7582 marked as special. Also, starting docstrings with * is obsolete.
7584 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7586 * gnutls.c (emacs_gnutls_write): Fix last change.
7588 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7590 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7593 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7595 * keymap.c (Fsingle_key_description): Handle char ranges.
7597 2012-02-12 Chong Yidong <cyd@gnu.org>
7599 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7600 as that creates a dangerous corner case.
7602 * window.c (Fdelete_window_internal): Invalidate the mouse
7603 highlight (Bug#9904).
7605 2012-02-12 Glenn Morris <rgm@gnu.org>
7607 * xselect.c (Fx_own_selection_internal)
7608 (Fx_get_selection_internal, Fx_disown_selection_internal)
7609 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7610 * nsselect.m (Fx_own_selection_internal)
7611 (Fx_disown_selection_internal, Fx_selection_exists_p)
7612 (Fx_selection_owner_p, Fx_get_selection_internal):
7613 Sync docs and argument specs with the xselect.c versions.
7615 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
7617 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7619 2012-02-11 Eli Zaretskii <eliz@gnu.org>
7621 * w32select.c (Fx_selection_exists_p): Sync doc string and
7622 argument list with xselect.c. (Bug#10783)
7624 * w16select.c (Fx_selection_exists_p): Sync doc string and
7625 argument list with xselect.c. (Bug#10783)
7627 2012-02-10 Glenn Morris <rgm@gnu.org>
7629 * fns.c (Fsecure_hash): Doc fix.
7631 2012-02-09 Kenichi Handa <handa@m17n.org>
7633 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7635 2012-02-07 Chong Yidong <cyd@gnu.org>
7637 * buffer.c (Fbuffer_local_variables)
7638 (buffer_lisp_local_variables): Handle unbound vars correctly;
7639 don't let Qunbound leak into Lisp.
7641 2012-02-07 Glenn Morris <rgm@gnu.org>
7643 * image.c (Fimagemagick_types): Doc fix.
7645 * image.c (imagemagick-render-type): Change it from a lisp object
7646 to an integer. Move the doc here from the lisp manual.
7647 Treat all values not equal to 0 the same.
7649 2012-02-06 Chong Yidong <cyd@gnu.org>
7651 * doc.c (store_function_docstring): Avoid applying docstring of
7652 alias to base function (Bug#2603).
7654 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7656 * .gdbinit (pp1, pv1): Remove redundant defines.
7659 2012-02-04 Chong Yidong <cyd@gnu.org>
7661 * nsterm.m: Declare a global (Bug#10694).
7663 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7665 * w32.c (get_emacs_configuration_options):
7666 Include --enable-checking, if specified, in the return value.
7668 2012-02-04 Martin Rudalics <rudalics@gmx.at>
7670 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7671 after rounding frame sizes. (Bug#9723)
7673 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7675 * keyboard.c (adjust_point_for_property): Don't position point
7676 before BEGV. (Bug#10696)
7678 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7680 Handle overflow when computing char display width (Bug#9496).
7681 * character.c (char_width): Return EMACS_INT, not int.
7682 (char_width, c_string_width): Check for overflow when
7683 computing the width; this is possible now that individual
7684 characters can have unbounded width. Problem introduced
7685 by merge from Emacs 23 on 2012-01-19.
7687 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
7689 * dbusbind.c (Fdbus_register_method): Mention the return value
7690 :ignore in the docstring.
7692 2012-02-02 Glenn Morris <rgm@gnu.org>
7694 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7696 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7697 Unconditionally set to t. (Bug#10673)
7698 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7699 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7700 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7702 2012-02-02 Kenichi Handa <handa@m17n.org>
7704 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7705 0, do not call append_composite_glyph.
7707 2012-02-02 Kenichi Handa <handa@m17n.org>
7709 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7711 (x_produce_glyphs): If the component of a composition is a null
7712 string, set it->pixel_width to 1 to avoid zero-width glyph.
7714 2012-02-01 Eli Zaretskii <eliz@gnu.org>
7716 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7717 first 2 arguments are identical. This makes inserting large
7718 output from a subprocess an order of magnitude faster on
7719 MS-Windows, where all sbrk'ed memory is always contiguous.
7721 2012-01-31 Glenn Morris <rgm@gnu.org>
7723 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7724 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7725 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7727 2012-01-29 Glenn Morris <rgm@gnu.org>
7729 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7731 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7733 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7735 2012-01-28 Chong Yidong <cyd@gnu.org>
7737 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7739 2012-01-26 Chong Yidong <cyd@gnu.org>
7741 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7743 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7744 repeat counts (Bug#10507).
7746 2012-01-26 Glenn Morris <rgm@gnu.org>
7748 * lread.c (syms_of_lread): Doc fix.
7750 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7752 * coding.c (encode_designation_at_bol): Change return value to
7755 2012-01-25 Chong Yidong <cyd@gnu.org>
7757 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7759 2012-01-21 Chong Yidong <cyd@gnu.org>
7761 * floatfns.c (Fcopysign): Make the second argument non-optional,
7762 since nil is not allowed anyway.
7764 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7766 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7767 (send_process): Likewise.
7769 2012-01-19 Martin Rudalics <rudalics@gmx.at>
7771 * window.c (save_window_save, Fcurrent_window_configuration)
7772 (Vwindow_persistent_parameters): Do not use Qstate.
7773 Rewrite doc-strings.
7775 2012-01-19 Kenichi Handa <handa@m17n.org>
7777 * character.c (char_width): New function.
7778 (Fchar_width, c_string_width, lisp_string_width):
7779 Use char_width (Bug#9496).
7781 2012-01-16 Martin Rudalics <rudalics@gmx.at>
7783 * window.c (Vwindow_persistent_parameters): New variable.
7784 (Fset_window_configuration, save_window_save): Handle persistent
7787 2012-01-14 Eli Zaretskii <eliz@gnu.org>
7789 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7790 thrashing the stack of the thread. (Bug#9087)
7792 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7794 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7796 2012-01-11 Eli Zaretskii <eliz@gnu.org>
7798 * xdisp.c (rows_from_pos_range): Handle the case where the
7799 highlight ends on a newline. (Bug#10464)
7800 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7801 he end column for display of highlight that ends on a newline
7804 2012-01-11 Glenn Morris <rgm@gnu.org>
7806 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7807 from load-path also when installation-directory is nil. (Bug#10208)
7809 2012-01-10 Glenn Morris <rgm@gnu.org>
7811 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7813 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7814 Update template values to be closer to their typical values these days.
7816 2012-01-09 Eli Zaretskii <eliz@gnu.org>
7818 * xdisp.c (rows_from_pos_range): Accept additional argument
7819 DISP_STRING, and accept any glyph in a row whose object is that
7820 string as eligible for mouse highlight. Fixes mouse highlight of
7821 display strings from overlays. (Bug#10464)
7823 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
7825 emacs: fix an auto-save permissions race condition (Bug#10400)
7826 * fileio.c (auto_saving_dir_umask): New static var.
7827 (Fmake_directory_internal): Use it.
7828 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7829 creating the directory. The old code temporarily assigns
7830 too-generous permissions to the directory.
7831 (do_auto_save_eh): Clear it.
7832 (Fdo_auto_save): Catch all errors, not just file errors, so
7833 that the var is always cleared.
7835 2012-01-07 Eli Zaretskii <eliz@gnu.org>
7837 * search.c (scan_buffer): Pass character positions to
7838 know_region_cache, not byte positions. (Bug#6540)
7840 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
7842 * w32.c (sys_rename): Report EXDEV when rename of a directory
7843 fails because the target is on another logical disk. (Bug#10284)
7845 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7847 * xterm.c (x_embed_request_focus): New function.
7849 * xterm.h: Add prototype.
7851 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7853 2012-01-05 Glenn Morris <rgm@gnu.org>
7855 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7857 2012-01-01 Eli Zaretskii <eliz@gnu.org>
7859 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7860 Load gnutls_transport_set_lowat only if GnuTLS version is below
7862 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7863 GnuTLS versions below 2.11.1.
7865 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7867 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7868 to the doc string advising against its use for altering the way
7869 windows are scrolled.
7871 2011-12-28 Kenichi Handa <handa@m17n.org>
7873 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7874 coding-system ASCII compatible only when it does not produce BOM
7875 on encoding (Bug#10383).
7877 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7879 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7881 (create_and_show_popup_menu): Always use menu_position_func for
7884 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7886 * callint.c (Fcall_interactively): Don't truncate prompt string.
7888 2011-12-23 Eli Zaretskii <eliz@gnu.org>
7890 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7891 property that ends at ZV, so that the bidi iteration could be
7892 resumed from there (after widening). (Bug#10360)
7894 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7896 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7898 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7900 * nsterm.m (x_free_frame_resources):
7901 Release f->output_data.ns->miniimage.
7902 (ns_index_color): Fix indentation. Do not retain
7903 color_table->colors[i].
7905 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7908 * nsfns.m (x_set_background_color): Assign return value from
7909 ns_index_color to face-background instead of NSColor*.
7910 (ns_implicitly_set_icon_type): Fix indentation.
7911 Change assignment in for loop to comparison.
7913 * emacs.c (ns_pool): New variable.
7914 (main): Assign ns_pool.
7915 (Fkill_emacs): Call ns_release_autorelease_pool.
7917 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7918 autorelease fdesc, release fdAttrs and tdict.
7919 (ns_get_covering_families): Release charset.
7920 (ns_findfonts): Release NSFontDescriptor created with new.
7921 (ns_uni_to_glyphs): Fix indentation.
7922 (setString): Release attrStr before assigning new value.
7924 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7926 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7928 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7929 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7931 2011-12-18 David Reitter <reitter@cmu.edu>
7933 * nsterm.m (ns_term_init): Subscribe for notifications
7934 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7935 to method trackingNotification in EmacsMenu.
7937 * nsmenu.m (trackingMenu): New variable.
7938 (trackingNotification): New method (from Aquamacs).
7939 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
7940 from Aquamacs (Bug#7030).
7942 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7944 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7945 (symbol_to_nsstring): Fix indentation.
7946 (ns_symbol_to_pb): New function.
7947 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7948 (Fns_rotate_cut_buffers_internal): Remove.
7949 (Fns_store_selection_internal): Rename from
7950 Fns_store_cut_buffer_internal.
7951 (ns_get_foreign_selection, Fx_own_selection_internal)
7952 (Fx_disown_selection_internal, Fx_selection_exists_p)
7953 (Fns_get_selection_internal, Fns_store_selection_internal):
7954 Use ns_symbol_to_pb and check if return value is nil.
7955 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7956 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
7957 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7958 renamed to Sns_store_selection_internal.
7959 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7960 and remove this function.
7961 (ns_handle_selection_clear): Remove, never used.
7962 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7965 2011-12-17 Ken Brown <kbrown@cornell.edu>
7967 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7968 GID is unknown (Bug#10257).
7970 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7972 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7973 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7974 which caused a build failure on GNU/Linux IA-64. This problem was
7975 introduced by my 2011-10-07 patch.
7977 2011-12-15 Juri Linkov <juri@jurta.org>
7979 * image.c (imagemagick_error): New function. (Bug#10112)
7980 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7981 Use `imagemagick_error' where ImageMagick functions return
7983 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7986 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7988 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7989 fill background (Bug#8992).
7991 2011-12-13 Martin Rudalics <rudalics@gmx.at>
7993 * window.c (Vwindow_combination_resize)
7994 (Vwindow_combination_limit): Use t instead of non-nil in
7996 (Vrecenter_redisplay): Add first sentence of doc-string on
7998 (Frecenter): Fix doc-string typo.
8000 2011-12-11 Kenichi Handa <handa@m17n.org>
8002 * coding.c (Funencodable_char_position): Pay attention to the
8003 buffer text relocation (Bug#9389).
8005 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8007 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8008 gtk_init (Bug#10100).
8010 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8012 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8013 IT->string is nil. (Bug#10263)
8015 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8017 * nsterm.h (x_free_frame_resources): Declare.
8019 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8020 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8022 * nsterm.h (ns_get_defaults_value): Declare.
8024 * nsterm.m (ns_default): Call ns_get_defaults_value.
8026 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8028 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8031 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8033 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8034 that where the value of an _OBJC_* symbol points to is in the .bss
8035 section (Bug#10240).
8037 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8039 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8040 after the loop to call ccl_driver at least once (Bug#8619).
8042 2011-12-08 Kenichi Handa <handa@m17n.org>
8044 * ftfont.c (get_adstyle_property): Fix previous change
8047 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8049 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8050 dirs from the default value of EMACSLOADPATH (bug#10208).
8052 2011-12-07 Glenn Morris <rgm@gnu.org>
8054 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8055 installation and source directories as well. (Bug#10208)
8057 2011-12-06 Chong Yidong <cyd@gnu.org>
8059 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8061 2011-12-06 Glenn Morris <rgm@gnu.org>
8063 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8064 as an error, not just -1. (Bug#10217)
8066 2011-12-05 Chong Yidong <cyd@gnu.org>
8068 * keyboard.c (process_special_events): New function.
8069 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8071 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8073 * coding.c (encode_designation_at_bol): Don't use uninitialized
8074 local variable (Bug#9318).
8076 2011-12-05 Kenichi Handa <handa@m17n.org>
8078 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8079 return Qnil (Bug#8046, Bug#10193).
8081 2011-12-05 Kenichi Handa <handa@m17n.org>
8083 * coding.c (encode_designation_at_bol): New args charbuf_end and
8084 dst. Return the number of produced bytes. Callers changed.
8085 (coding_set_source): Return how many bytes coding->source was
8087 (coding_set_destination): Return how many bytes
8088 coding->destination was relocated.
8089 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8090 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8092 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8094 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8095 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8098 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8100 The following changes are to fix Bug#9318.
8102 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8103 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8104 (encode_coding_iso_2022, encode_coding_sjis)
8105 (encode_coding_big5, encode_coding_charset): Use the above macros.
8107 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8109 * lisp.h (process_quit_flag): Fix external declaration.
8111 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8113 Don't macro-inline non-performance-critical code.
8114 * eval.c (process_quit_flag): New function.
8115 * lisp.h (QUIT): Use it.
8117 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8119 * nsfns.m (get_geometry_from_preferences): New function.
8120 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8122 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8124 * emacs.c (Qkill_emacs): Define.
8125 (syms_of_emacs): Initialize it.
8126 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8127 Qquit_flag to `kill-emacs' instead.
8128 (quit_throw_to_read_char): Add parameter `from_signal'.
8129 All callers changed. Call Fkill_emacs if requested and safe.
8130 * lisp.h (QUIT): Call Fkill_emacs if requested.
8132 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8134 * widget.c (update_wm_hints): Return if wmshell is null.
8135 (widget_update_wm_size_hints): New function.
8137 * widget.h (widget_update_wm_size_hints): Declare.
8139 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8140 widget_update_wm_size_hints (Bug#10104).
8142 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8144 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8145 before a newline, prepare the bidi iterator for consuming the
8146 newline, and keep the current paragraph direction. (Bug#10183)
8147 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8149 2011-12-02 Juri Linkov <juri@jurta.org>
8151 * search.c (Fword_search_regexp): New Lisp function created from
8152 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8153 (Fword_search_backward, Fword_search_forward)
8154 (Fword_search_backward_lax, Fword_search_forward_lax):
8155 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8156 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8158 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8160 * fileio.c (Finsert_file_contents): Move after-change-function call
8161 to before the "handled:" label, since all "goto handled" appear in
8162 cases where the *-change-functions have already been properly called
8165 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8167 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8168 waiting for input. (Bug#10169)
8170 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8172 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8173 verifies glyph row's hash code--we have just reallocated the
8174 glyphs, so their contents can be complete garbage. (Bug#10164)
8176 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8178 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8180 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8182 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8183 attributes are tested _before_ calling verify_row_hash, to protect
8184 against GCC re-ordering of the tests. (Bug#10164)
8186 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8188 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8190 * xterm.c (handle_one_xevent): Only set async_visible and friends
8191 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8192 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8193 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8195 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8197 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8198 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8199 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8200 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8201 All uses changed to use GCPRO1 etc.
8202 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8203 Revert to old implementation (i.e., before 2011-03-11).
8205 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8207 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8208 of scroll runs so as to avoid assigning disabled bogus rows and
8209 unnecessary graphics copy operations.
8211 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8213 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8214 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8215 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8216 (malloc, free, realloc, calloc): Redirect to e_* only when
8219 * lisp.h (GCTYPEBITS): Move before first use.
8220 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8221 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8222 this macro definition.
8224 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8227 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8229 * gtkutil.c (xg_create_frame_widgets):
8230 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8231 present with Gtk+ 2.0.
8233 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8235 * fileio.c (Finsert_file_contents): Undo previous change; see
8236 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8238 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8240 Rename locals to avoid shadowing.
8241 * fileio.c (Finsert_file_contents):
8242 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8243 * process.c (wait_reading_process_output):
8244 Rename inner 'proc' to 'p' to avoid shadowing.
8245 Indent for consistency with usual Emacs style.
8247 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8249 * xdisp.c (redisplay_window): If cursor row is not fully visible
8250 after recentering, and scroll-conservatively is set to a large
8251 number, scroll window by a few more lines to make the cursor fully
8252 visible and out of scroll-margin. (Bug#10105)
8253 (start_display): Don't move to the next line if the display should
8254 start at a newline that is part of a display vector or an overlay
8257 2011-11-24 Juri Linkov <juri@jurta.org>
8259 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8260 after the `MagickPingImage' call. (Bug#10112)
8262 2011-11-23 Chong Yidong <cyd@gnu.org>
8264 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8266 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8268 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8269 making another buffer current. (Bug#10114)
8271 2011-11-23 Glenn Morris <rgm@gnu.org>
8273 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8275 2011-11-23 Chong Yidong <cyd@gnu.org>
8277 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8278 using it (Bug#5984).
8280 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8282 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8283 and header-lines, as they don't have one computed for them.
8286 * .gdbinit (prow): Make displayed values more self-explaining.
8287 Add row's hash code.
8289 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8291 * process.c (wait_reading_process_output): Fix asynchrounous
8292 GnuTLS socket handling on some versions of the GnuTLS library.
8293 (wait_reading_process_output): Add comment and URL.
8295 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8297 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8299 2011-11-21 Chong Yidong <cyd@gnu.org>
8301 * window.c (Fnext_window, Fprevious_window): Doc fix.
8303 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8305 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8307 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8309 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8311 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8313 * window.c (Fset_window_combination_limit): Rename argument
8315 (Vwindow_combination_limit): Remove "status" from doc-string.
8317 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8319 * m/ibms390.h: Remove.
8320 * m/ibms390x.h: Don't include "ibms390.h".
8322 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8324 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8325 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8327 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8329 * casetab.c (Fset_case_table):
8330 * charset.c (Fcharset_after): Fix typos.
8332 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8334 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8335 Otherwise, valgrind does not work on some platforms.
8336 Problem reported by Andreas Schwab in
8337 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8338 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8339 is set, removing the need for VIRT_ADDRESS_VARIES.
8340 (PURE_P): Use a more-efficient implementation that needs just one
8341 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8342 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8343 to 4 (xorl, subq, cmpq, setbe).
8344 * alloc.c (pure): Always extern now, since that's the
8345 VIRT_ADDR_VARIES behavior.
8346 (PURE_POINTER_P): Use a single comparison, not two, for
8347 consistency with the new puresize.h.
8348 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8349 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8350 Remove VIRT_ADDR_VARIES no longer needed.
8352 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8354 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8355 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8356 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8357 behave as if the cursor position were at the window margin.
8359 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8360 and the cursor position is out of bounds, behave as if the cursor
8361 position were at the window margin. (Bug#10075)
8363 2011-11-18 Chong Yidong <cyd@gnu.org>
8365 * window.c (Fwindow_combination_limit): Make first argument
8366 non-optional, since it is meaningless for live windows like the
8369 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8371 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8373 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8375 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8376 (graft_intervals_into_buffer): Simplify.
8378 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8380 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8381 hash values of the two rows.
8382 (copy_row_except_pointers): Preserve the used[] arrays and the
8383 hash values of the two rows. (Bug#10035)
8384 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8386 * xdisp.c (row_hash): New function, body extracted from
8387 compute_line_metrics.
8388 (compute_line_metrics): Call row_hash, instead of computing the
8391 * dispnew.c (verify_row_hash): Call row_hash for computing the
8392 hash code of a row, instead of duplicating code from xdisp.c.
8394 * dispextern.h (row_hash): Add prototype.
8396 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8398 * frame.c (delete_frame): Don't delete the terminal when the last
8399 X frame is closed if emacs is built with GTK toolkit.
8401 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8403 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8405 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8407 * window.c (Vwindow_splits): Rename to
8408 Vwindow_combination_resize. Suggested by Juri Linkov.
8409 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8412 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8414 * nsfns.m (Fns_font_name):
8415 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8417 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8419 * window.h (window): Rename slot "nest" to "combination_limit".
8420 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8421 (Fset_window_nest): Rename to Fset_window_combination_limit.
8422 (Vwindow_nest): Rename to Vwindow_combination_limit.
8423 (recombine_windows, make_parent_window, make_window)
8424 (Fsplit_window_internal, saved_window)
8425 (Fset_window_configuration, save_window_save): Rename all
8426 occurrences of window_nest to window_combination_limit.
8428 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
8430 * image.c (imagemagick_load_image): Fix typo.
8432 2011-11-14 Eli Zaretskii <eliz@gnu.org>
8434 * xdisp.c (display_line): Move the call to
8435 highlight_trailing_whitespace before the call to
8436 compute_line_metrics, since the latter needs to see the final
8437 faces of all the glyphs to compute ROW's hash value.
8438 Fixes assertion violations in row_equal_p. (Bug#10035)
8440 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
8442 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8443 just return (bug#10044).
8445 2011-11-12 Eli Zaretskii <eliz@gnu.org>
8447 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8448 with user-defined heap size. Bump the default size of the temacs
8449 heap to 27MB, to avoid memory warning when running temacs.
8450 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8452 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8453 current_matrix and desired_matrix. (Bug#9990)
8454 (verify_row_hash) [XASSERTS]: New function.
8455 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8456 that the hash value of glyph rows is correct.
8458 2011-11-12 Martin Rudalics <rudalics@gmx.at>
8460 * window.h (window): Remove splits slot.
8461 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8462 (Fdelete_other_windows_internal, make_parent_window)
8463 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8464 (Fset_window_configuration, save_window_save): Don't deal with
8465 split status of windows.
8466 (saved_window): Remove splits slot.
8467 (Vwindow_splits): Rewrite doc-string.
8469 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8471 * xfns.c (unwind_create_frame):
8472 * nsfns.m (unwind_create_frame):
8473 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8474 Vframe_list (Bug#9999).
8476 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8478 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
8480 2011-11-11 Kenichi Handa <handa@m17n.org>
8482 * callproc.c (Fcall_process): Set the member dst_multibyte of
8485 2011-11-11 Johan Bockgård <bojohan@gnu.org>
8487 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8488 avoid a crash (bug#9496).
8490 2011-11-09 Chong Yidong <cyd@gnu.org>
8492 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8493 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8495 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8497 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8499 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8501 Avoid some portability problems by eschewing 'extern inline' functions.
8502 The trivial performance wins aren't worth the portability hassles; see
8503 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8505 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8506 (window_box_width, window_box_left, window_box_left_offset)
8507 (window_box_right, window_box_right_offset): Undo previous change,
8508 by removing the "extern"s.
8509 * intervals.c (adjust_intervals_for_insertion)
8510 (adjust_intervals_for_deletion): Undo previous change,
8511 making these static again.
8512 (offset_intervals, temp_set_point_both, temp_set_point)
8513 (copy_intervals_to_string): No longer inline.
8514 * xdisp.c (window_text_bottom_y, window_box_width)
8515 (window_box_height, window_box_left_offset)
8516 (window_box_right_offset, window_box_left, window_box_right)
8517 (window_box): No longer inline.
8519 2011-11-08 Chong Yidong <cyd@gnu.org>
8521 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
8522 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8523 Signal an error if not a live window.
8524 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8525 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8527 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
8529 * lisp.h (syms_of_abbrev): Remove declaration.
8530 Reported by CHENG Gao <chenggao@royau.me>.
8532 2011-11-07 Eli Zaretskii <eliz@gnu.org>
8534 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8535 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
8536 of temacs in GUI mode.
8538 2011-11-07 Martin Rudalics <rudalics@gmx.at>
8540 * window.h: Declare delete_all_child_windows instead of
8541 delete_all_subwindows.
8542 * window.c (Fwindow_nest, Fset_window_nest)
8543 (Fset_window_new_total, Fset_window_new_normal)
8544 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8545 (delete_all_subwindows): Rename to delete_all_child_windows.
8546 (Fdelete_other_windows_internal, Fset_window_configuration):
8547 Call delete_all_child_windows instead of delete_all_subwindows.
8548 * frame.c (delete_frame): Call delete_all_child_windows instead
8549 of delete_all_subwindows.
8551 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8553 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8554 This is also needed for porting to any host where GC_MARK_STACK is
8555 not GC_MAKE_GCPROS_NOOPS.
8556 (which_symbols): Use it.
8558 2011-11-07 Kenichi Handa <handa@m17n.org>
8560 * coding.c (coding_set_destination): Check coding->src_pos only
8561 when coding->src_object is a buffer (bug#9910).
8563 * process.c (send_process): Set the member src_multibyte of coding
8564 to 0 (bug#9911) when sending a unibyte text.
8566 * callproc.c (Fcall_process): Set the member src_multibyte of
8567 process_coding to 0 (bug#9912).
8569 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8571 * xmenu.c (cleanup_widget_value_tree): New function.
8572 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8573 calling free_menubar_widget_value_tree directly (Bug#9830).
8575 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8577 Fix some portability problems with 'inline'.
8578 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8579 (window_box_width, window_box_left, window_box_left_offset)
8580 (window_box_right, window_box_right_offset): Declare extern.
8581 Otherwise, these inline functions do not conform to C99 and
8582 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8583 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8584 * intervals.c (adjust_intervals_for_insertion)
8585 (adjust_intervals_for_deletion): Now extern, because otherwise the
8586 extern inline functions 'offset_intervals' couldn't refer to it.
8587 (static_offset_intervals): Remove.
8588 (offset_intervals): Rewrite using the old contents of
8589 static_offset_intervals. The old version didn't conform to C99
8590 because an extern inline function contained a reference to an
8591 identifier with static linkage.
8593 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8595 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8598 2011-11-06 Eli Zaretskii <eliz@gnu.org>
8600 * xdisp.c (init_iterator, reseat_to_string): Don't set the
8601 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
8602 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8603 return Qleft_to_right.
8605 2011-11-06 Chong Yidong <cyd@gnu.org>
8607 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8608 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8609 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8610 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8611 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8612 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8613 (Fwindow_vscroll): Doc fix.
8614 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
8615 argument, since it makes no sense to pass a live window and for
8616 consistency with window-child.
8618 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
8620 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8623 2011-11-05 Jason Rumney <jasonr@gnu.org>
8625 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8626 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8628 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8629 bitwise arithmetic preventing use of unicode-sip and non-truetype
8632 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8634 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8637 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8638 initialization code to keep similarity to xfns.c after changes
8641 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8643 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8644 (unwind_create_frame): New function (Bug#9943).
8645 (Fx_create_frame): Restructure code to be more similar to the one in
8646 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
8647 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8648 Move terminal->reference_count++ just before making the frame official
8651 * nsterm.m (x_free_frame_resources): New function.
8652 (x_destroy_window): Move code to x_free_frame_resources.
8654 * xfns.c (unwind_create_frame): Fix comment.
8655 (Fx_create_frame, x_create_tip_frame):
8656 Move terminal->reference_count++ just before making the frame
8657 official. Move initialization of image_cache_refcount and
8658 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8660 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8662 Support MSVC build with newer versions of Visual Studio.
8663 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8664 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
8667 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8668 which are not supported by MSVC.
8669 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8670 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8672 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8674 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8676 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8678 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
8680 Support MSVC build with newer versions of Visual Studio.
8681 * w32.c: Don't include w32api.h for MSVC.
8682 (init_environment) [_MSC_VER]: Call sys_access, not _access.
8684 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8685 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8686 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8687 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8689 (alloca) [_MSC_VER]: Define to _alloca.
8691 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8693 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8695 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8697 * xdisp.c (note_mouse_highlight): If either of
8698 previous/next-single-property-change returns nil, treat that as
8699 the beginning or the end of the buffer. (Bug#9955)
8701 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8703 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
8704 label is not null (Bug#9951).
8705 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8708 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8710 * window.c (Fwindow_body_size): Mention in the doc string that the
8711 return value is in frame's canonical units. (Bug#9949)
8713 2011-11-03 Eli Zaretskii <eliz@gnu.org>
8715 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8717 * w32fns.c (unwind_create_frame): If needed, free the glyph
8718 matrices of the partially constructed frame. (Bug#9943)
8719 * xfns.c (unwind_create_frame): Likewise.
8721 2011-11-01 Eli Zaretskii <eliz@gnu.org>
8723 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8724 Don't stop backward scan on the continuation glyph, even though
8725 its CHARPOS is positive.
8726 (mouse_face_from_buffer_pos, note_mouse_highlight):
8727 Rename cover_string to disp_string.
8729 2011-11-01 Martin Rudalics <rudalics@gmx.at>
8731 * window.c (temp_output_buffer_show): Don't use
8732 Vtemp_buffer_show_specifiers.
8733 (Vtemp_buffer_show_specifiers): Remove unused variable.
8735 2011-10-30 Eli Zaretskii <eliz@gnu.org>
8737 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8738 past the beginning of the current glyph matrix.
8740 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
8742 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8743 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8744 HAVE_GTK3 (Bug#9869).
8746 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8747 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8749 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8751 * xterm.c: Declare x_handle_net_wm_state to return int.
8752 (handle_one_xevent): Check if we are iconified but don't have
8753 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8754 (get_current_wm_state): Return non-zero if not hidden,
8755 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8756 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8757 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8758 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8760 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8762 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8763 so that this new function doesn't get optimized away by a
8764 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8766 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8768 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8770 2011-10-29 Eli Zaretskii <eliz@gnu.org>
8772 Fix the `xbytecode' command.
8773 * .gdbinit (xprintbytestr): New command.
8774 (xwhichsymbols): Rename from `which'; all callers changed.
8775 (xbytecode): Print the byte-code string as well.
8777 2011-10-29 Kim Storm <storm@cua.dk>
8779 * alloc.c (which_symbols): New function.
8781 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8783 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8786 2011-10-29 Glenn Morris <rgm@gnu.org>
8788 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8789 Not clear what it was for, and it causes various bugs. (Bug#9839)
8791 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8793 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8794 possible random value that matches one of those tested as
8795 condition to clear the mouse face.
8797 2011-10-28 Chong Yidong <cyd@gnu.org>
8799 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8801 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8803 * window.c (make_window): Initialize phys_cursor_on_p.
8805 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8807 * lisp.h (struct Lisp_Symbol): Update comments.
8809 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
8811 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8813 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8815 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8816 <oslsachem@gmail.com> for helping to debug this.
8818 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8819 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8820 (g_b_init_get_glyph_outline_w): New static variables.
8821 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8822 (GetGlyphOutlineW_Proc): New typedefs.
8823 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
8824 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8826 (w32font_open_internal, compute_metrics):
8827 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
8828 instead of calling the "wide" APIs directly.
8830 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8832 * w32.h (syms_of_w32font): Add prototype.
8834 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8836 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8837 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8838 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8839 (Fmove_to_window_line): Doc fix.
8841 2011-10-27 Chong Yidong <cyd@gnu.org>
8843 * process.c (make_process): Set gnutls_state to NULL.
8845 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8846 non-NULL, regardless of GNUTLS_INITSTAGE.
8847 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8848 an error. Set process slots as soon as we allocate them.
8850 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8852 2011-10-27 Chong Yidong <cyd@gnu.org>
8854 * gnutls.c (emacs_gnutls_deinit): New function.
8855 Deallocate credentials structures as well as calling gnutls_deinit.
8856 (Fgnutls_deinit, Fgnutls_boot): Use it.
8858 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8859 (deactivate_process): Call emacs_gnutls_deinit.
8861 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8863 * image.c (x_create_x_image_and_pixmap):
8864 * w32.c (sys_rename, w32_delayed_load):
8865 * w32font.c (fill_in_logfont):
8866 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8868 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
8870 * w32fns.c (w32_default_color_map): New function,
8871 extracted from Fw32_default_color_map.
8872 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
8874 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8876 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8878 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8880 * keyboard.c (test_undefined): New function (bug#9751).
8881 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8883 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8885 * sysdep.c (init_sys_modes): Fix the check for the controlling
8886 terminal (Bug#6649).
8888 2011-10-20 Eli Zaretskii <eliz@gnu.org>
8890 * dispextern.h (struct bidi_it): New member next_en_type.
8892 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8893 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8894 current character, check also for next_en_type being WEAK_EN.
8895 (bidi_resolve_weak): Don't enter the expensive loop if the current
8896 position is before next_en_pos. Record the bidi type of the first
8897 non-ET, non-BN character we find, in addition to its position.
8898 (bidi_level_of_next_char): Invalidate next_en_type when
8899 next_en_pos is over-stepped.
8901 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8903 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8904 * editfns.c: Rewrite current-time-zone so that it invokes
8905 the equivalent of (format-time-string "%Z") to get the time zone name.
8906 This fixes a bug when the time zone name contains characters that
8907 need converting from the system time locale to Emacs internal format.
8908 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8909 that patch fixed format-time-string to do the conversion, but
8910 I forgot to fix current-time-zone.
8911 (format_time_string): New function, containing most of
8912 what Fformat_time_string used to contain.
8913 (Fformat_time_string): Rewrite in terms of format_time_string.
8914 This doesn't change this function's behavior.
8915 (current-time-zone): Rewrite to use format_time_string.
8916 This fixes the bug reported by Michael Schierl in
8917 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8918 Jason Rumney's 2007-06-07 change worked around this bug, but
8920 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8922 2011-10-19 Eli Zaretskii <eliz@gnu.org>
8924 * xdisp.c (start_display): If the character at POS is displayed
8925 via a display vector, reset IT->current.dpvec_index to zero.
8926 (try_window_reusing_current_matrix): If a line ends in a display
8927 vector or the next line starts in a display vector, continue
8928 redrawing the window even though the character position of
8929 start_row was reached.
8932 2011-10-18 Chong Yidong <cyd@gnu.org>
8934 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8935 with nobreak-char-display too.
8937 2011-10-18 Eli Zaretskii <eliz@gnu.org>
8939 Fix part 3 of bug#9771.
8940 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8941 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8942 non-neutral characters if the current character is a paragraph
8943 separator (a.k.a. Newline). This avoids running the same
8944 expensive loop twice, once when we consume the preceding newline
8945 and the other time when the line actually needs to be displayed.
8946 Avoid the loop when we see neutrals on the base embedding level
8947 following a character whose directionality is the same as the
8948 paragraph's. This avoids running the expensive loop when a line
8949 ends in a long sequence of neutrals, like control characters.
8950 Add assertion against STRONG_AL type. Slightly rearrange code
8951 that determines the type of a neutral given the first non-neutral
8953 (bidi_level_of_next_char): Set next_en_pos to zero when
8954 invalidating its info.
8956 2011-10-17 Eli Zaretskii <eliz@gnu.org>
8958 * xdisp.c (push_display_prop): Determine whether to record string
8959 or buffer position by IT->string, not by IT->method. Allow
8960 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
8961 (move_it_vertically_backward): Don't look for character position
8962 immediately after the newline when in a continuation line.
8965 2011-10-15 Martin Rudalics <rudalics@gmx.at>
8967 * window.c (coordinates_in_window): Rewrite and delabelize
8968 vertical border check. (Bug#5357) (Bug#9618)
8970 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8972 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8973 errors in XSetWindowBorder (bug#9310).
8975 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8977 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8978 avoid crash when xmalloc overrun checking is enabled.
8980 2011-10-13 Eli Zaretskii <eliz@gnu.org>
8982 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8983 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8984 cursor motion with <left> and <right> arrow keys.
8986 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8987 some callers set that themselves.
8989 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8991 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8992 display string and the previous row comes from the same string and
8993 is empty. (Bug#9739) (Bug#9738)
8995 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8997 * doc.c (get_doc_string): Encode file name (bug#9735).
8999 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9001 * bidi.c (bidi_level_of_next_char):
9002 * xdisp.c (get_visually_first_element): Remove old incorrect
9003 comments regarding the Unicode Line Separator character.
9005 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9007 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9009 * alloc.c (Fgc_status): Do not access beyond zombies array
9010 boundary if nzombies > MAX_ZOMBIES.
9011 * alloc.c (dump_zombies): Add missing format specifier.
9013 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9015 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9016 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9018 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9019 Some packages use them to denote characters with modifiers.
9021 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9023 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9024 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9025 matching a pp-number. Rename parameter var to var1.
9027 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9029 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9031 2011-10-08 Glenn Morris <rgm@gnu.org>
9033 * callint.c (Fcall_interactively): Give a more explicit error for the
9034 'c' case with a non-character input. (Bug#8479)
9036 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9038 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9040 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9041 lines that are hscrolled on the left.
9043 * dispnew.c (buffer_posn_from_coords): Account for a possible
9044 presence of header-line. (Bug#4426)
9046 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9048 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9049 Don't advertise functionality which we discourage or doesn't work.
9051 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9053 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9054 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9055 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9056 this makes Emacs dump core during garbage collection on rare
9057 occasions. sizeof is obviously inferior to offsetof here, so
9058 stick with offsetof.
9059 (GC_POINTER_ALIGNMENT): New macro.
9060 (mark_memory): Omit 3rd (offset) arg; caller changed.
9061 Don't assume EMACS_INT alignment is the same as pointer alignment.
9063 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9065 * keyboard.c (read_key_sequence_remapped): New var.
9066 (read_key_sequence): Compute remapping in the right buffer.
9067 (command_loop_1): Use read_key_sequence's remapping directly.
9069 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9071 * dired.c (file_name_completion): Don't expand file name.
9072 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9073 before checking file name handler.
9075 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9076 they've been requested explicitly (bug#9591).
9078 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9080 * keymap.c (Fsingle_key_description): Use make_specified_string
9081 instead of build_string to build string from push_key_description.
9084 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9086 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9087 This fixes a Y2038 bug on 64-bit hosts.
9088 * buffer.c (reset_buffer):
9089 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9090 (Fclear_buffer_auto_save_failure):
9091 Use 0, not -1, to represent an unset failure time, since time_t
9092 might not be signed.
9094 Remove dependency on glibc malloc internals.
9095 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9096 Move back here from lisp.h, but with their new implementations.
9097 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9098 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9099 * charset.c (charset_table_init): New static var.
9100 (syms_of_charset): Use it instead of xmalloc. This removes a
9101 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9102 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9103 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9104 Move back to alloc.c.
9105 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9106 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9108 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9110 * nsterm.m (windowDidResize): Call x_set_window_size only when
9111 ns_in_resize is true. Otherwise set pixelwidth/height and
9112 call change_frame_size (Bug#9628).
9114 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9116 Port --enable-checking=all to Fedora 14 x86-64.
9117 * charset.c (syms_of_charset): Also account for glibc malloc's
9118 internal overhead when calculating the initial malloc maximum.
9120 Port --enable-checking=all to Fedora 14 x86.
9121 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9123 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9124 (overrun_check_realloc, overrun_check_free):
9125 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9126 That way, xmalloc returns a properly-aligned pointer even if
9127 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9128 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9129 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9130 into account when calculating the initial malloc maximum.
9131 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9132 Move here from alloc.c, so that charset.c can use it too.
9133 Properly align; the old code wasn't right for common 32-bit hosts
9134 when configured with --enable-checking=all.
9135 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9136 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9138 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9140 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9143 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9145 * xdisp.c (compute_display_string_end): If there's no display
9146 string at CHARPOS, return -1.
9148 * bidi.c (bidi_fetch_char): When compute_display_string_end
9149 returns a negative value, treat the character as a normal
9150 character not covered by a display string. (Bug#9624)
9152 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9154 * lread.c (Fread_from_string): Fix typo in docstring.
9156 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9158 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9159 newline, reseat the iterator instead of bidi-iterating there one
9160 character at a time. (Bug#9610)
9161 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9162 TO_CHARPOS if the bidi iterator is at base embedding level.
9164 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9166 * lread.c (readevalloop): Use correct code for NBSP.
9167 (read1): Likewise. (Bug#9608)
9169 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9171 * dbusbind.c (Fdbus_register_signal): When service is not
9172 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9174 2011-09-25 Glenn Morris <rgm@gnu.org>
9176 * buffer.c (truncate-lines): Doc fix.
9178 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9180 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9181 (Fset_window_next_buffers): Doc fix.
9183 2011-09-24 Glenn Morris <rgm@gnu.org>
9185 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9187 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9189 Fix minor problems found by static checking.
9190 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9191 * indent.c (Fvertical_motion): Fix == vs = typo.
9193 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9195 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9196 Default value is now t. Doc fix.
9198 * indent.c (Fvertical_motion): Compute and apply the overshoot
9199 logic when moving up, not only when moving down. Fix the
9200 confusing name and values of the it_overshoot_expected variable;
9201 logic changes accordingly. (Bug#9254) (Bug#9549)
9203 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9204 CHARPOS is covered by a display string which includes newlines.
9205 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9206 is covered by a display string with embedded newlines.
9208 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9210 * dbusbind.c (Fdbus_register_signal): Add match rule to
9211 Vdbus_registered_objects_table. (Bug#9581)
9212 (Fdbus_register_method, Vdbus_registered_objects_table):
9215 2011-09-24 Jim Meyering <meyering@redhat.com>
9217 do not ignore write error for any output size
9218 The previous change was incomplete.
9219 While it makes emacs --batch detect the vast majority of stdout
9220 write failures, errors were still ignored whenever the output size is
9221 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9222 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9223 && echo FAIL: ignored write error
9224 FAIL: ignored write error
9225 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9226 && echo FAIL: ignored write error
9227 FAIL: ignored write error
9228 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9230 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9232 * emacs.c (Fkill_emacs): In noninteractive mode exit
9233 non-successfully if a write error occurred on stdout. (Bug#9574)
9235 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9237 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9240 * dispextern.h (struct it): Update the comment documenting what
9243 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9245 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9246 a display string, extend search for cursor position to end of row.
9247 (find_row_edges): If the row ends in a newline from a display
9248 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9249 Handle the case of a display string with multiple newlines.
9250 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9251 non-empty line. Fixes confusing cursor motion with arrow keys at
9252 the beginning of a line that starts with whitespace.
9254 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9256 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9259 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9261 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9264 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9266 * xdisp.c (display_line): Record maximum and minimum buffer
9267 positions even if no glyphs were produced (e.g., by a zero-width
9268 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9269 buffer positions that will be removed from the glyph row because
9271 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9272 column is beyond frame width: don't subtract 1 "pixel" when
9273 computing width of the stretch.
9274 (reseat_at_next_visible_line_start): Undo the change made on
9275 2011-09-17 that saved paragraph information and restored it after
9276 the call to `reseat'. (Bug#9545)
9278 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9280 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9281 and turn window cursor on if cleared (Bug#9415).
9283 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9285 * search.c (boyer_moore): Take unibyte characters from pattern
9286 literally. (Bug#9458)
9288 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9290 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9292 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9294 Fix minor problem found by static checking.
9295 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9296 initialized, to pacify gcc -Wuninitialized.
9298 * fileio.c: Report proper errno when syscall falls.
9299 (Finsert_file_contents): Save and restore errno,
9300 so that report_file_error outputs the correct diagnostic.
9301 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9303 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9305 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9307 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9309 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9310 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9312 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9314 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9315 about the current paragraph and restore it after the call to reseat.
9317 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9318 (bidi_find_paragraph_start): Search back for paragraph beginning
9319 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9320 (bidi_move_to_visually_next): Only trigger paragraph-related
9321 computations when the last character is a newline or at EOB, not
9322 just any NEUTRAL_B. (Bug#9470)
9324 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9325 truncated lines if point is covered by a display string. (Bug#9524)
9327 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9329 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9330 (cons_to_x_long): New function.
9331 (lisp_data_to_selection_data): Use it. Correct the test for
9332 short-versus-long data; it was negated. Break out of vector
9333 loop, for efficiency, when a long datum is discovered.
9335 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9337 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9339 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9341 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9342 GCC PR/17406) by declaring this function with external scope.
9344 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9346 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9347 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9349 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9351 * editfns.c (Fformat): Correctly handle text properties on "%%".
9353 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9355 * xterm.c (x_draw_composite_glyph_string_foreground):
9356 * w32term.c (x_draw_composite_glyph_string_foreground):
9357 * term.c (encode_terminal_code):
9358 * composite.c (composition_update_it, get_composition_id):
9359 * xdisp.c (get_next_display_element)
9360 (fill_composite_glyph_string): Add comments about special meaning
9361 of TAB characters in a composition.
9363 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9365 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9366 This occurs when processing a multibyte format.
9367 Problem reported by Wolfgang Jenker.
9369 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9371 * xdisp.c (try_cursor_movement): Only check for exact match if
9372 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9374 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9376 Remove unused external symbols.
9377 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9378 * xdisp.c (calc_pixel_width_or_height): Now static.
9379 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9380 * indent.c (check_display_width):
9381 * w32term.c: Fix comment to match code.
9382 * xterm.c, xterm.h (x_catching_errors): Remove.
9384 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9386 * xselect.c: Use signed conversions more consistently (Bug#9498).
9387 (selection_data_to_lisp_data): Assume incoming selection data are
9388 signed integers, not unsigned. This is to be consistent with
9389 outgoing selection data, which was modified to use signed integers
9390 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9391 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9392 expects long, not unsigned long.
9394 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9396 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9397 computation of loop end. Reported by Johan Bockgård
9400 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9402 * frame.c (Fother_visible_frames_p): Function deleted.
9404 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9406 * indent.c (compute_motion): Process display vector front to back
9407 rather than the other way around. (Bug#2496)
9409 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9411 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9413 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9415 * minibuf.c (Fread_from_minibuffer): Doc fix.
9417 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9419 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9420 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9422 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9424 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9425 value for non-existent files.
9427 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9429 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9430 set its "size" to -1. This will set the modtime_size field of
9431 the corresponding buffer to -1, which is what
9432 verify-visited-file-modtime expects for files that do not exist.
9435 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9437 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9439 * lisp.h: ... from here. push_key_description is no longer
9440 defined in keyboard.c, so its declaration should not be in
9441 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9442 logically belongs with push_key_description.
9444 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9446 * buffer.h: Include <sys/types.h> instead of <time.h>.
9447 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9448 Problem reported by Herbert J. Skuhra.
9450 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9452 * xml.c (parse_region): Make the parsing work for
9453 non-comment-starting XML files again (bug#9144).
9455 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9457 * image.c (gif_load): Fix calculation of bottom and right corner.
9460 2011-09-10 Eli Zaretskii <eliz@gnu.org>
9462 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9463 redisplay in small windows.
9465 2011-09-09 Eli Zaretskii <eliz@gnu.org>
9467 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9469 2011-09-08 Martin Rudalics <rudalics@gmx.at>
9471 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9472 Operate on live windows only.
9474 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
9476 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9478 2011-09-07 Eli Zaretskii <eliz@gnu.org>
9480 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9481 only under bidi iteration.
9483 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9485 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9487 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9489 isnan: Fix porting problem to Solaris 10 with bundled gcc.
9490 Without this fix, the command to link temacs failed due to an
9491 undefined symbol __builtin_isnan. This is because
9492 /usr/include/iso/math_c99.h #defines isnan(x) to
9493 __builtin_isnan(x), but the bundled gcc, which identifies itself
9494 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9496 * floatfns.c (isnan): #undef, and then #define to a clone of
9498 (Fisnan): Always define, since it's always available now.
9499 (syms_of_floatfns): Always define isnan at the Lisp level.
9501 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9503 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9505 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9507 * fileio.c: Fix bugs with large file offsets (Bug#9428).
9508 The previous code assumed that file offsets (off_t values) fit in
9509 EMACS_INT variables, which is not true on typical 32-bit hosts.
9510 The code messed up by falsely reporting buffer overflow in cases
9511 such as (insert-file-contents "big" nil 1 2) into an empty buffer
9512 when "big" contains more than 2**29 bytes, even though this
9513 inserts just one byte and does not overflow the buffer.
9514 (Finsert_file_contents): Store file offsets as off_t
9515 values, not as EMACS_INT values. Check for overflow when
9516 converting between EMACS_INT and off_t. When checking for
9517 buffer overflow or for overlap, take the offsets into account.
9518 Don't use EMACS_INT for small values where int suffices.
9519 When checking for overlap, fix a typo: ZV was used where
9520 ZV_BYTE was intended.
9521 (Fwrite_region): Don't assume off_t fits into 'long'.
9522 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9524 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
9526 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9528 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9530 sprintf-related integer and memory overflow issues (Bug#9412).
9532 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
9533 (esprintf, exprintf, evxprintf): New functions.
9534 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
9535 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
9536 (modify_event_symbol): Do not assume that the length of
9537 name_alist_or_stem is safe to alloca and fits in int.
9538 (Fexecute_extended_command): Likewise for function name and binding.
9539 (Frecursion_depth): Wrap around reliably on integer overflow.
9540 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9541 since some callers pass EMACS_INT values.
9542 (Fsingle_key_description): Don't crash if symbol name contains more
9543 than MAX_ALLOCA bytes.
9544 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9545 (get_minibuffer): Arg is now EMACS_INT, not int.
9546 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
9547 (esprintf, exprintf, evxprintf): New decls.
9548 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9550 * dbusbind.c (signature_cat): New function.
9551 (xd_signature, Fdbus_register_signal):
9552 Do not overrun buffer; instead, report string overflow.
9554 * dispnew.c (add_window_display_history): Don't overrun buffer.
9555 Truncate instead; this is OK since it's just a log.
9557 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9558 even if the time zone offset is outlandishly large.
9559 Don't mishandle offset == INT_MIN.
9561 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9562 when creating daemon; the previous buffer-overflow check was incorrect.
9564 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9565 which has the guts of the old verror function.
9567 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9568 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9570 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9571 (font_unparse_xlfd): Don't blindly alloca long strings.
9572 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
9573 fits in int, when using sprintf. Use single snprintf to count
9574 length of string rather than counting it via multiple sprintfs;
9575 that's simpler and more reliable.
9576 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9577 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9578 sprintf, in case result does not fit in int.
9580 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9581 (fontset_from_font): Print it.
9583 * frame.c (tty_frame_count): Now printmax_t, not int.
9584 (make_terminal_frame, set_term_frame_name): Print it.
9585 (x_report_frame_params): In X, window IDs are unsigned long,
9586 not signed long, so print them as unsigned.
9587 (validate_x_resource_name): Check for implausibly long names,
9588 and don't assume name length fits in 'int'.
9589 (x_get_resource_string): Don't blindly alloca invocation name;
9590 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9593 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9594 (xg_check_special_colors, xg_set_geometry):
9595 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9597 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9598 Use esprintf, not sprintf, in case result does not fit in int.
9600 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9601 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9602 it as a large positive number.
9603 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9604 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9606 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9607 in case result does not fit in int.
9609 * print.c (float_to_string): Detect width overflow more reliably.
9610 (print_object): Make sprintf buffer a bit bigger, to avoid potential
9611 buffer overrun. Don't assume list length fits in 'int'. Treat
9612 print length of 0 as 0, not as infinity; to be consistent with other
9613 uses of print length in this function. Don't overflow print length
9614 index. Don't assume hash table size fits in 'long', or that
9615 vectorlike size fits in 'unsigned long'.
9617 * process.c (make_process): Use printmax_t, not int, to format
9618 process-name gensyms.
9620 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9622 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9623 to avoid potential buffer overrun.
9625 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9626 if X resource line is longer than 512 bytes.
9628 * xfns.c (x_window): Make sprintf buffer a bit bigger
9629 to avoid potential buffer overrun.
9631 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9633 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9635 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9637 Integer overflow fixes for scrolling, etc.
9638 Without these, Emacs silently mishandles large integers sometimes.
9639 For example, "C-u 4294967297 M-x recenter" was treated as if
9640 it were "C-u 1 M-x recenter" on a typical 64-bit host.
9642 * xdisp.c (try_window_id): Check Emacs fixnum range before
9643 converting to 'int'.
9645 * window.c (window_scroll_line_based, Frecenter):
9646 Check that an Emacs fixnum is in range before assigning it to 'int'.
9647 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9648 values converted from Emacs fixnums.
9649 (Frecenter): Don't wrap around a line count if it is out of 'int'
9650 range; instead, treat it as an extreme value.
9651 (Fset_window_configuration, compare_window_configurations):
9652 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9654 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9655 that can exceed INT_MAX. Check that EMACS_INT value is in range
9656 before assigning it to the (possibly-narrower) index.
9657 (match_limit): Don't assume that a fixnum can fit in 'int'.
9659 * print.c (print_object): Use ptrdiff_t, not int, for index that can
9662 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
9663 (Fvertical_motion): Don't wrap around LINES values that don't fit
9664 in 'int'. Instead, treat them as extreme values. This is good
9665 enough for windows, which can't have more than INT_MAX lines anyway.
9667 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9669 * Require libxml/parser.h to avoid compilation warning.
9671 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9673 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9674 since this reportedly can destroy thread storage.
9676 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
9678 * syntax.c (find_defun_start): Update all cache variables if
9679 exiting early (Bug#9401).
9681 2011-08-30 Eli Zaretskii <eliz@gnu.org>
9683 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9685 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9686 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9687 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9689 * term.c (tty_append_glyph): New function.
9690 (produce_stretch_glyph): Static function and its prototype deleted.
9692 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9695 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9697 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9698 when checking :margin (Bug#9390).
9699 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
9700 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
9701 so that the name doesn't mislead. All uses changed.
9703 2011-08-28 Johan Bockgård <bojohan@gnu.org>
9705 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9708 2011-08-27 Eli Zaretskii <eliz@gnu.org>
9710 * xdisp.c (move_it_to): Don't bail out early when reaching
9711 position beyond to_charpos, if we are scanning backwards.
9712 (move_it_vertically_backward): When DY == 0, make sure we get to
9713 the first character in the line after the newline.
9715 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9717 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9718 (ccl_driver): Do not generate an out-of-range pointer.
9719 (Fccl_execute_on_string): Remove unnecessary check for
9720 integer overflow, noted by Stefan Monnier in
9721 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9722 Remove a FIXME that didn't need fixing.
9723 Simplify the newly-introduced buffer reallocation code.
9725 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
9727 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9729 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
9731 Integer and memory overflow issues (Bug#9196).
9733 * doc.c (get_doc_string): Rework so that
9734 get_doc_string_buffer_size is the actual buffer size, rather than
9735 being 1 less than the actual buffer size; this makes xpalloc more
9738 * image.c (x_allocate_bitmap_record, cache_image):
9739 * xselect.c (Fx_register_dnd_atom):
9740 Simplify previous changes by using xpalloc.
9742 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9743 since either will do and ptrdiff_t is convenient with xpalloc.
9745 * charset.c (charset_table_size)
9746 (struct charset_sort_data.priority): Now ptrdiff_t.
9747 (charset_compare): Don't overflow if priorities differ greatly.
9748 (Fsort_charsets): Don't assume list length fits in int.
9749 Check for size-calculation overflow when allocating sort data.
9750 (syms_of_charset): Allocate an initial charset table that is
9751 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9753 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9755 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9756 The actual value is always <= INT_MAX, and leaving it unsigned made
9757 overflow checking harder.
9759 * dispextern.h (struct glyph_matrix.rows_allocated)
9760 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9761 with xpalloc. The values are still always <= INT_MAX.
9763 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9765 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9766 (SAFE_NALLOCA): New macro.
9768 * region-cache.c (struct boundary.pos, find_cache_boundary)
9769 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9770 (set_cache_region, invalidate_region_cache)
9771 (revalidate_region_cache, know_region_cache, region_cache_forward)
9772 (region_cache_backward, pp_cache):
9773 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9774 so that ptrdiff_t * can be passed to xpalloc.
9775 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9776 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9777 (pp_cache): Don't assume cache_len fits in int.
9778 * region-cache.h: Adjust extern decls to match.
9780 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9781 EMACS_INT, since either will do, for xpalloc.
9783 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9784 (xnmalloc, xnrealloc, xpalloc): New functions.
9786 * bidi.c (bidi_shelve_header_size): New constant.
9787 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9788 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9790 * bidi.c (bidi_cache_shrink):
9791 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9793 Don't update size of array until after memory allocation succeeds,
9794 because xmalloc/xrealloc may not return.
9795 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9796 now that we have proper integer overflow checking.
9797 (record_overlay_string, overlay_strings): Catch overflows when
9798 calculating size of overlay_str_buf.
9800 * callproc.c (Fcall_process): Check for size overflow when
9801 calculating size of args2.
9802 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9803 Normally we prefer signed values, but sticking with ptrdiff_t would
9804 require adding more-complicated checks.
9806 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9807 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9808 Redo buffer-overflow calculations to avoid integer overflow.
9809 Add a FIXME comment where memory seems to be over-allocated.
9811 * character.c (Fstring): Check for size-calculation overflow.
9813 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9814 unnecessary integer overflow. Check for size overflow.
9815 (encode_coding_object): Don't update size until xmalloc succeeds.
9817 * composite.c (get_composition_id): Check for overflow in glyph
9818 length calculations.
9820 Integer and memory overflow fixes for display code.
9821 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9822 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9823 (scrolling_window): Check for overflow in size calculations.
9824 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9825 Don't assume glyph table len fits in int.
9826 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9827 (row_table_size): Now ptrdiff_t, not int.
9828 (scrolling_window): Avoid overflow in size calculations.
9829 Don't update size until allocation succeeds.
9830 * fns.c (concat): Check for overflow in size calculations.
9831 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9832 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9833 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9835 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9836 (get_doc_string): Check for size calculation overflow.
9837 Don't update size until allocation succeeds.
9838 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9839 EMACS_INT, where ptrdiff_t will do.
9840 (Fsubstitute_command_keys): Check for string overflow.
9842 * editfns.c (set_time_zone_rule): Don't assume environment length
9844 (message_length): Now ptrdiff_t, not int.
9845 (Fmessage_box): Don't update size until allocation succeeds.
9846 Don't assume message length fits in int.
9847 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9849 * emacs.c (main): Do not reallocate argv, since there is a null at
9850 the end that can be overwritten, and this way there's no need to
9851 worry about size-calculation overflow.
9852 (sort_args): Check for size-calculation overflow.
9854 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9856 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9858 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9859 (x_set_scroll_bar_width, x_figure_window_size):
9860 Check for integer overflow.
9861 (x_set_alpha): Do not assume XINT fits in int.
9863 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9864 This is for the members text_lines, text_cols, total_lines, total_cols,
9865 where the system imposes an 'int' limit.
9867 * fringe.c (Fdefine_fringe_bitmap):
9868 Don't update size until alloc works.
9870 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9871 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9873 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9874 Check for size-calculation overflow.
9875 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9876 do, as we prefer signed integers.
9877 (id_to_widget.max_size, id_to_widget.used)
9878 (xg_store_widget_in_map, xg_remove_widget_from_map)
9879 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9880 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9881 Use and return ptrdiff_t, not int.
9882 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9883 * gtkutil.h: Change prototypes to match the above.
9885 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9886 are duplicate now that they've been promoted to lisp.h.
9887 (x_allocate_bitmap_record, x_alloc_image_color)
9888 (make_image_cache, cache_image, xpm_load):
9889 Don't update size until alloc is done.
9890 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9892 Check for size calculation overflow.
9893 (ct_colors_allocated_max): New constant.
9894 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9897 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9898 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9899 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9900 Use ptrdiff_t, not int, to count maps.
9901 (read_char_minibuf_menu_prompt): Check for overflow in size
9902 calculations. Don't update size until allocation succeeds.
9903 Redo calculations to avoid overflow.
9904 * keyboard.h: Change prototypes to match the above.
9906 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9908 (current_minor_maps): Check for size calculation overflow.
9909 * keymap.h: Change prototypes to match the above.
9911 * lread.c (read1, init_obarray): Don't update size until alloc done.
9913 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9914 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9916 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9917 Now ptrdiff_t, not int.
9918 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9919 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9921 * process.c (Fnetwork_interface_list): Check for overflow
9922 in size calculation.
9924 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9926 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9927 overflow. Don't bother calling xmalloc when xrealloc will do.
9929 * search.c (Freplace_match): Check for size calculation overflow.
9930 (Fset_match_data): Don't assume list lengths fit in 'int'.
9932 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9933 for command line length. Do not attempt to address one before the
9934 beginning of an array, as that's not portable.
9936 * term.c (max_frame_lines): Remove; unused.
9937 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9939 (encode_terminal_code, calculate_costs): Check for size
9940 calculation overflow.
9941 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9942 table lengths and related sizes. Don't update size until alloc
9943 done. Redo calculations to avoid overflow.
9944 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9946 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9947 subtracting pointers.
9948 (gobble_line): Check for overflow more carefully. Don't update size
9951 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9952 Don't update size until alloc done.
9953 Redo size calculations to avoid overflow.
9954 Check for size calculation overflow.
9955 (main) [DEBUG]: Fix typo in invoking tparam1.
9957 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9958 Use ptrdiff_t, not int, for sizes.
9959 (store_mode_line_noprop_char): Don't update size until alloc done.
9961 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9962 Use ptrdiff_t, not int, for sizes.
9963 (Finternal_make_lisp_face, cache_face):
9964 Check for size calculation overflow.
9965 (cache_face): Treat size calculation overflows as if they were
9966 memory exhaustion (the usual treatment), rather than aborting.
9968 * xfns.c (x_encode_text, x_set_name_internal)
9969 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9970 sizes, since they can exceed INT_MAX in size. Check for size
9971 calculation overflow.
9973 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9974 (xg_select): Check for size calculation overflow.
9975 Don't update size until alloc done.
9977 * xrdb.c (get_environ_db): Don't assume path length fits in int,
9978 as sprintf is limited to int lengths.
9980 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9981 (X_LONG_MIN): New macros.
9982 Use them to make the following changes clearer.
9983 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9984 This change doesn't affect the value now, but it may help remind
9985 future maintainers not to raise the value too much later.
9986 (SELECTION_QUANTUM): Remove, replacing with ...
9987 (selection_quantum): ... new function, which avoids overflow.
9989 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9990 assumption that selection length fits in 'int'.
9991 (x_reply_selection_request, x_handle_selection_request)
9992 (x_get_window_property, receive_incremental_selection)
9993 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9994 (lisp_data_to_selection_data, clean_local_selection_data):
9995 Use ptrdiff_t, not int, to record length of selection.
9996 (x_reply_selection_request, x_get_window_property)
9997 (receive_incremental_selection, x_property_data_to_lisp):
9998 Redo calculations to avoid overflow.
9999 (x_reply_selection_request): When sending hint, ceiling it at
10000 X_LONG_MAX rather than relying on wraparound overflow to send
10002 (x_get_window_property, receive_incremental_selection)
10003 (lisp_data_to_selection_data, x_property_data_to_lisp):
10004 Check for size-calculation overflow.
10005 (x_get_window_property, receive_incremental_selection)
10006 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10007 Don't store size until memory allocation succeeds.
10008 (x_get_window_property): Plug memory leak on memory exhaustion.
10009 Don't double-block input; malloc is safe here. Don't assume 2**34
10010 - 4 fits in unsigned long. Add an xassert to check
10011 XGetWindowProperty overflow. Be more careful about overflow
10012 calculations, and distinguish size from memory overflow better.
10013 (receive_incremental_selection): When tracing, don't assume
10014 unsigned int is less than INT_MAX.
10015 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10016 harmful) conversions of unsigned short to int.
10017 (lisp_data_to_selection_data): Don't assume that integers
10018 in the range -65535 through -1 fit in an X unsigned short.
10019 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10020 result parameters unless successful. Rely on cons_to_unsigned
10021 to report problems with elements; the old code wasn't right anyway.
10022 (x_check_property_data): Check for int overflow; we cannot use
10023 a wider type due to X limits.
10024 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10026 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10028 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10029 (x_term_init): Check for size calculation overflow.
10030 (x_color_cells): Don't store size until memory allocation succeeds.
10031 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10032 Don't assume alloca size is less than MAX_ALLOCA.
10033 (x_term_init): Don't assume length fits in int (sprintf is limited
10036 Use ptrdiff_t for composition IDs.
10037 * character.c (lisp_string_width):
10038 * composite.c (composition_table_size, n_compositions)
10039 (get_composition_id, composition_gstring_from_id):
10040 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10041 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10042 * window.c (Frecenter):
10043 Use ptrdiff_t, not int, for composition IDs.
10044 * composite.c (get_composition_id): Check for integer overflow.
10045 * composite.h: Adjust prototypes to match the above changes.
10047 Use ptrdiff_t for hash table indexes.
10048 * category.c (hash_get_category_set):
10049 * ccl.c (ccl_driver):
10050 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10051 * coding.c (coding_system_charset_list, detect_coding_system):
10052 * coding.h (struct coding_system.id):
10053 * composite.c (get_composition_id, gstring_lookup_cache):
10054 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10055 * image.c (xpm_get_color_table_h):
10056 * lisp.h (hash_lookup, hash_put):
10057 * minibuf.c (Ftest_completion):
10058 Use ptrdiff_t for hash table indexes, not int (which is too
10059 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10060 32-bit --with-wide-int hosts).
10062 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10063 Add a FIXME comment about memory leaks.
10064 (syms_of_charset): Don't assume xmalloc returns.
10066 Don't assume that stated character widths fit in int.
10067 * character.c (Fchar_width, c_string_width, lisp_string_width):
10068 * character.h (CHAR_WIDTH):
10069 * indent.c (MULTIBYTE_BYTES_WIDTH):
10070 Use sanitize_char_width to avoid undefined and/or bad behavior
10071 with outlandish widths.
10072 * character.h (sanitize_tab_width): Rename from sanitize_width,
10073 now that we have two such functions. All uses changed.
10074 (sanitize_char_width): New inline function.
10076 Don't assume that tab-width fits in int.
10077 * character.h (sanitize_width): New inline function.
10078 (SANE_TAB_WIDTH): New macro.
10079 (ASCII_CHAR_WIDTH): Use it.
10080 * indent.c (sane_tab_width): Remove. All uses replaced by
10081 SANE_TAB_WIDTH (current_buffer).
10082 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10084 * fileio.c: Integer overflow issues with file modes.
10085 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10087 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10088 Remove unreachable code.
10089 (read_hex, load_charset_map_from_file): Check for integer overflow.
10091 * xterm.c: Don't go over XClientMessageEvent limit.
10092 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10093 (x_send_scroll_bar_event): Likewise. Check that the size does not
10094 exceed limits imposed by XClientMessageEvent, as well as the usual
10095 ptrdiff_t and size_t limits.
10097 * keyboard.c: Overflow, signedness and related fixes.
10098 (make_lispy_movement): Use same integer type in forward decl
10099 that is used in the definition.
10100 (read_key_sequence, keyremap_step):
10101 Change bufsize argument back to int, undoing my 2011-03-30 change.
10102 We prefer signed types, and int is wide enough here.
10103 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10104 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10105 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10106 length, not size_t. Use ptrdiff_t for index, not int.
10107 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10108 possibility of integer overflow.
10110 Overflow, signedness and related fixes for images.
10112 * dispextern.h (struct it.stack[0].u.image.image_id)
10113 (struct_it.image_id, struct image.id, struct image_cache.size)
10114 (struct image_cache.used, struct image_cache.ref_count):
10115 * gtkutil.c (update_frame_tool_bar):
10116 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10117 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10118 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10119 * nsmenu.m (update_frame_tool_bar):
10120 * xdisp.c (calc_pixel_width_or_height):
10121 * xfns.c (image_cache_refcount):
10122 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10123 on typical 64-bit hosts.
10125 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10126 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10127 Omit unnecessary casts to int.
10128 (parse_image_spec): Check that integers fall into 'int' range
10129 when the callers expect that.
10130 (image_ascent): Redo ascent calculation to avoid int overflow.
10131 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10132 (lookup_image): Remove unnecessary tests.
10133 (xbm_image_p): Locals are now of int, not EMACS_INT,
10134 since parse_image_check makes sure they fit into int.
10135 (png_load, gif_load, svg_load_image):
10136 Prefer int to unsigned where either will do.
10137 (tiff_handler): New function, combining the cores of the
10138 old tiff_error_handler and tiff_warning_handler.
10139 This function is rewritten to use vsnprintf and thereby avoid
10140 stack buffer overflows. It uses only the features of vsnprintf
10141 that are common to both POSIX and native Microsoft.
10142 (tiff_error_handler, tiff_warning_handler): Use it.
10143 (tiff_load, gif_load, imagemagick_load_image):
10144 Don't assume :index value fits in 'int'.
10145 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10146 (imagemagick_load_image): Check that crop parameters fit into
10147 the integer types that MagickCropImage accepts. Don't assume
10148 Vimagemagick_render_type has a nonnegative value. Don't assume
10149 size_t fits in 'long'.
10150 (gs_load): Use printmax_t to print the widest integers possible.
10151 Check for integer overflow when computing image height and width.
10153 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10155 * xdisp.c (redisplay_window): Don't force window start if point
10156 will be invisible in the resulting window. (Bug#9324)
10158 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10160 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10161 the display spec is of the form `(space ...)'.
10162 (handle_display_spec): Return the value returned by
10163 handle_single_display_spec, not just 1 or zero.
10164 (handle_single_display_spec): If the display spec is of the form
10165 `(space ...)', and specifies display in the text area, return 2
10167 (try_cursor_movement): Check for the need to scroll more
10168 accurately, and prefer exact match for point under bidi.
10169 Don't advance `row' beyond the last row of the window.
10171 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10172 into disp_prop; all users changed.
10174 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10175 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10176 for the text covered by the display property.
10178 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10180 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10181 Change return value to nil.
10182 (Frecord_buffer): Delete unused function.
10184 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10186 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10187 buffers, return left-to-right.
10188 (set_cursor_from_row): Consider candidate row a win if its glyph
10189 represents a newline and point is on that newline. Fixes cursor
10190 positioning on the newline at EOL of R2L text within L2R
10191 paragraph, and vice versa.
10192 (try_cursor_movement): Check continued rows, in addition to
10193 continuation rows. Fixes unwarranted scroll when point enters a
10194 continued line of R2L text within an L2R paragraph, or vice versa.
10195 (cursor_row_p): Consider the case of point being equal to
10196 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10197 from the end of a short line to the beginning of a continued line
10198 of R2L text within L2R paragraph.
10199 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10200 composed characters.
10202 * bidi.c (bidi_check_type): Use xassert.
10203 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10206 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10208 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10211 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10213 * nsfont.m (ns_otf_to_script): Fix typo.
10215 2011-08-22 Kenichi Handa <handa@m17n.org>
10217 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10218 extra slot even if the purpose is char-code-property-table.
10220 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10222 * xdisp.c (redisplay_window): When computing centering_position,
10223 account for the height of the header line. (Bug#8874)
10225 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10226 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10227 candidate is selected by the mouse, and that candidate has a
10228 composed character under the mouse.
10230 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10231 coordinates reported by pos-visible-in-window-p for a composed
10232 character in column zero.
10234 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10236 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10238 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10240 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10241 consider it a hit if to_charpos is anywhere in the range of the
10242 composed buffer positions.
10244 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10246 * image.c (gif_load): Don't assume that each subimage has the same
10247 dimensions as the base image. Handle disposal method that is
10248 "undefined" by the gif spec (Bug#9335).
10250 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10252 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10253 (Fcondition_case): Document `debug' symbol in error handler.
10255 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10257 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10258 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10259 from an Org mode buffer to a Speedbar frame.
10261 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10262 a composition, take its buffer position from IT->cmp_it.charpos.
10263 Fixes cursor positioning at the beginning of a line that begins
10264 with a composed character.
10266 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10268 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10269 character bidirectional type, use STRONG_L instead. Fixes crashes
10270 in a buffer produced by `describe-categories'.
10272 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10273 members before the level stack, so they would be saved and
10274 restored when copying iterator state. Fixes incorrect reordering
10275 around TABs covered by display properties.
10277 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10279 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10281 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10283 * eval.c (internal_condition_case, internal_condition_case_1)
10284 (internal_condition_case_2, internal_condition_case_n):
10285 Remove unnecessary aborts (Bug#9081).
10287 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10289 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10290 has no `load' handler, try opening the file locally. (Bug#9311)
10292 2011-08-16 Ken Brown <kbrown@cornell.edu>
10294 * gmalloc.c: Expand comment.
10296 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10298 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10299 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10301 2011-08-16 Ken Brown <kbrown@cornell.edu>
10303 Fix memory allocation problems in Cygwin build (Bug#9273).
10305 * unexcw.c ( __malloc_initialized): Declare external variable.
10306 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10308 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10310 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10312 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10313 in the static heap.
10314 [CYGWIN] (special_realloc): New function.
10315 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10316 requests to realloc storage in the static heap.
10318 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10320 * bidi.c (bidi_initialize): Remove unused local.
10322 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10325 * biditype.h: Remove file.
10326 * makefile.w32-in ($(BLD)/bidi.$(O)):
10327 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10329 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10331 * chartab.c: Improve commentary for the uniprop_table API.
10333 * bidi.c (bidi_paragraph_init): Support zero value of
10334 bidi_ignore_explicit_marks_for_paragraph_level.
10335 (bidi_initialize): Use uniprop_table instead of including
10336 biditype.h and bidimirror.h.
10338 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10339 coordinates of the iterator when restoring from ppos_it.
10342 2011-08-14 Kenichi Handa <handa@m17n.org>
10344 * process.c (create_process): Call setup_process_coding_systems
10345 after the pid of the process is set to -1 (Bug#8162).
10347 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10349 * xdisp.c (move_it_in_display_line_to): Don't invoke
10350 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10351 ppos_it. Fixes vertical cursor motion when line beginning is
10352 covered by an image. (Bug#9296)
10354 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10356 * nsterm.h (ns_run_ascript): Declare.
10357 (NSAPP_DATA2_RUNASSCRIPT): Define.
10359 * nsfns.m (as_script, as_result, as_status): New static variables.
10360 (ns_run_ascript): New function.
10361 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10362 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10363 the event loop. Get status from as_status (Bug#7276).
10365 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10366 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10367 the event loop (Bug#7276).
10369 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10371 * gnutls.c (QCgnutls_bootprop_priority)
10372 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10373 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10374 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10375 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10376 (QCgnutls_bootprop_verify_hostname_error)
10377 (QCgnutls_bootprop_callbacks_verify): Rename from
10378 Qgnutls_bootprop_..., all uses changed.
10380 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10383 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10385 * xfaces.c (Qframe_set_background_mode): Now static.
10386 * dispextern.h (Qframe_set_background_mode): Remove decl.
10388 * process.c (Fnetwork_interface_info): Declare local only if needed.
10390 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10392 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10393 (Fnetwork_interface_list): Allocate in increments of bytes instead
10394 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10395 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10397 (struct ifflag_def): notrailers is smart on OSX.
10398 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10399 Get hardware address with getifaddrs if available.
10401 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10403 * xdisp.c (iterate_out_of_display_property): xassert that
10404 IT->position is set to within IT->object's boundaries. Break from
10405 the loop as soon as EOB is reached; avoids infloops in redisplay
10406 when IT->position is set up wrongly due to some bug.
10407 Set IT->current to match the bidi iterator unconditionally.
10408 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10409 entry. Force push_it to save on the stack the current
10410 buffer/string position, to be restored by pop_it. Fix flags in
10411 the iterator structure wrt the object coming from a display
10412 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10413 properties. (Bug#9284)
10415 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10417 * fontset.c (fontset_get_font_group): Add proper type checks.
10420 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10422 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10423 and LC_VERSION_MIN_MACOSX.
10424 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10425 (dump_it) [LC_FUNCTION_STARTS]: Use it.
10427 2011-08-08 Eli Zaretskii <eliz@gnu.org>
10429 * xdisp.c (forward_to_next_line_start): Allow to use the
10430 no-display-properties-and-no-overlays under bidi display.
10431 Set disp_pos in the bidi iterator to avoid searches for display
10432 properties and overlays.
10434 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
10436 * editfns.c (Fset_time_zone_rule): Document relationship with the
10439 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10440 the font entity extracted from the cache (Bug#8109).
10442 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
10444 * composite.c (autocmp_chars): Don't reset point. That is done by
10445 restore_point_unwind (Bug#5984).
10447 2011-08-07 Juri Linkov <juri@jurta.org>
10449 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10450 to show the arg `TIME' instead of `TIMEVAL'.
10452 2011-08-06 Eli Zaretskii <eliz@gnu.org>
10454 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10455 display property strides EOL and includes a newline, as in
10456 longlines-mode. (Bug#9254)
10457 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10458 word-wrap under bidirectional display. (Bug#9224)
10460 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10461 is non-zero, even if the data buffer is NULL. Fixes a crash in
10462 vertical-motion with longlines-mode. (Bug#9254)
10464 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10466 * bidi.c <bidi_cache_total_alloc>: Now static.
10467 (bidi_initialize): Initialize bidi_cache_total_alloc.
10469 * xdisp.c (display_line): Release buffer allocated for shelved bidi
10472 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10473 amount allocated this far in `bidi_cache_total_alloc'.
10474 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10475 non-zero, only free the data buffer without restoring the cache
10476 contents. All callers changed.
10478 * dispextern.h (bidi_unshelve_cache): Update prototype.
10480 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10481 (move_it_in_display_line, move_it_to)
10482 (move_it_vertically_backward, move_it_by_lines): Replace the call
10483 to xfree to an equivalent call to bidi_unshelve_cache.
10484 (move_it_in_display_line_to): Fix logic of returning
10485 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
10487 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10489 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10490 came from a string character with a `cursor' property. (Bug#9229)
10492 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10494 * Makefile.in (LIB_PTHREAD): New variable.
10495 (LIBES): Add LIB_PTHREAD (Bug#9216).
10497 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10498 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10500 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10502 * regex.c (re_iswctype): Remove some redundant boolean conversions.
10504 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10506 * xterm.c (x_find_topmost_parent): New function.
10507 (x_set_frame_alpha): Find topmost parent window with
10508 x_find_topmost_parent and set the property there also (bug#9181).
10509 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10511 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10513 * callproc.c (Fcall_process): Avoid vfork clobbering
10514 the local vars buffer, coding_systems, current_dir.
10516 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10518 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10520 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10522 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10523 so that it is not optimized away.
10525 * xdisp.c (compute_display_string_pos): Remove unused local.
10527 2011-08-02 Eli Zaretskii <eliz@gnu.org>
10529 Fix slow cursor motion and scrolling in large buffers with
10530 selective display, like Org Mode buffers. (Bug#9218)
10532 * dispextern.h (struct bidi_it): New member disp_prop_p.
10534 * xdisp.c: Remove one-slot cache of display string positions.
10535 (compute_display_string_pos): Accept an additional argument
10536 DISP_PROP_P; callers changed. Scan at most 5K characters forward
10537 for a display string or property. If found, set DISP_PROP_P
10540 * bidi.c (bidi_fetch_char): Accept an additional argument
10541 DISP_PROP_P, and pass it to compute_display_string_pos.
10542 Only handle text covered by a display string if DISP_PROP_P is returned
10543 non-zero. All callers of bidi_fetch_char changed.
10545 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10547 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10549 2010-12-03 Don March <don@ohspite.net>
10551 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10552 last character M-[char] is translated to ESC [char] (bug#7541).
10554 2011-08-02 Kenichi Handa <handa@m17n.org>
10556 * lisp.h (uniprop_table): Extern it.
10558 * chartab.c (uniprop_table): Make it non-static.
10560 2011-08-01 Eli Zaretskii <eliz@gnu.org>
10562 * xdisp.c (forward_to_next_line_start): Accept additional argument
10563 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10565 (reseat_at_next_visible_line_start): Use the bidi iterator state
10566 returned by forward_to_next_line_start to restore the state of
10567 it->bidi_it after backing up to previous newline. (Bug#9212)
10569 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10571 * regex.c (re_comp): Protoize.
10572 (re_exec): Fix return type.
10573 (regexec): Fix type of `ret'. (Bug#9203)
10575 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10577 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10578 This is needed if max-image-size is a floating-point number.
10580 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10582 * print.c (print_object): Print empty symbol as ##.
10584 * lread.c (read1): Read ## as empty symbol.
10586 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10588 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10589 setting frame foreground color (Bug#9175).
10590 (x_set_background_color): Likewise.
10592 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10593 contents (Bug#9176).
10594 (EmacsTooltip -init): Remove bezels and add shadows to
10597 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10598 or scroll bar (Bug#8470).
10600 * nsfont.m (nsfont_open): Remove assignment to voffset and
10601 unnecessary vars hshink, expand, hd, full_height, min_height.
10602 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10604 * nsterm.h (nsfont_info): Remove voffset field.
10606 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10608 Implement strike-through and overline on NextStep (Bug#8863).
10610 * nsfont.m (nsfont_open): Use underline position provided by font,
10611 instead of hard-coded value of 2.
10612 (nsfont_draw): Call ns_draw_text_decoration instead.
10614 * nsterm.h: Add declaration for ns_draw_text_decoration.
10616 * nsterm.m (ns_draw_text_decoration): New function for drawing
10617 underline, overline, and strike-through.
10618 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
10619 ns_draw_text_decoration. Change treatment of cursor drawing to
10620 accommodate underlining, etc.
10622 2011-07-28 Eli Zaretskii <eliz@gnu.org>
10624 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10627 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10629 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10630 Without this fix, if a signal arrives just after memory fills up,
10631 'malloc' might be invoked reentrantly.
10633 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10634 In other words, assume that every image size is allowed, on non-X
10635 hosts. This assumption is probably wrong, but it lets Emacs compile.
10637 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10639 * regex.c (re_iswctype): Convert return values to boolean.
10641 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10643 * xdisp.c (compute_display_string_pos): Don't use cached display
10644 string position if the buffer had its restriction changed.
10647 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10649 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10651 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10653 Integer signedness and overflow and related fixes. (Bug#9079)
10655 * bidi.c: Integer size and overflow fixes.
10656 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10657 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10658 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10659 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10660 (bidi_find_other_level_edge):
10661 Use ptrdiff_t instead of EMACS_INT where either will do.
10662 This works better on 32-bit hosts configured --with-wide-int.
10663 (bidi_cache_ensure_space): Check for size-calculation overflow.
10664 Use % rather than repeated addition, for better worst-case speed.
10665 Don't set bidi_cache_size until after xrealloc returns, because it
10667 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
10668 (bidi_cache_ensure_space): Also check that the bidi cache size
10669 does not exceed that of the largest Lisp string or buffer. See Eli
10670 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
10672 * alloc.c (__malloc_size_t): Remove.
10673 All uses replaced by size_t. See Andreas Schwab's note
10674 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10676 * image.c: Improve checking for integer overflow.
10677 (check_image_size): Assume that f is nonnull, since
10678 it is always nonnull in practice. This is one less thing to
10679 worry about when checking for integer overflow later.
10680 (x_check_image_size): New function, which checks for integer
10681 overflow issues inside X.
10682 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10683 This removes the need for a memory_full check.
10684 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10685 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10686 (xbm_read_bitmap_data): Change locals back to 'int', since
10687 their values must fit in 'int'.
10688 (xpm_load_image, png_load, tiff_load):
10689 Invoke x_create_x_image_and_pixmap earlier,
10690 to avoid much needless work if the image is too large.
10691 (tiff_load): Treat overly large images as if
10692 x_create_x_image_and_pixmap failed, not as malloc failures.
10693 (gs_load): Use x_check_image_size.
10695 * gtkutil.c: Omit integer casts.
10696 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10697 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10699 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10701 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10702 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10703 would wrongly return t on a 64-bit host.
10705 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10706 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10707 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10708 and therefore cause GCC to emit a bogus diagnostic in some cases.
10710 * image.c: Integer signedness and overflow and related fixes.
10711 This is not an exhaustive set of fixes, but it's time to
10712 record what I've got.
10713 (lookup_pixel_color, check_image_size): Remove redundant decls.
10714 (check_image_size): Don't assume that arbitrary EMACS_INT values
10715 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10716 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10717 (tiff_load, imagemagick_load_image):
10718 Check for overflow in size calculations.
10719 (x_create_x_image_and_pixmap): Remove unnecessary test for
10720 xmalloc returning NULL; that can't happen.
10721 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10722 (xpm_color_bucket): Use better integer hashing function.
10723 (xpm_cache_color): Don't possibly over-allocate memory.
10724 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10725 (gif_memory_source):
10726 Use ptrdiff_t, not int or size_t, to record sizes.
10727 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10728 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10729 either works, as we prefer signed integers.
10730 (tiff_read_from_memory, tiff_write_from_memory):
10731 Return tsize_t, not size_t, since that's what the TIFF API wants.
10732 (tiff_read_from_memory): Don't fail simply because the read would
10733 go past EOF; instead, return a short read.
10734 (tiff_load): Omit no-longer-needed casts.
10735 (Fimagemagick_types): Don't assume size fits into 'int'.
10737 Improve hashing quality when configured --with-wide-int.
10738 * fns.c (hash_string): New function, taken from sxhash_string.
10739 Do not discard information about ASCII character case; this
10740 discarding is no longer needed.
10741 (sxhash-string): Use it. Change sig to match it. Caller changed.
10742 * lisp.h: Declare it.
10743 * lread.c (hash_string): Remove, since we now use fns.c's version.
10744 The fns.c version returns a wider integer if --with-wide-int is
10745 specified, so this should help the quality of the hashing a bit.
10747 * emacs.c: Integer overflow minor fix.
10748 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10749 Define only if GNU_LINUX.
10750 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10752 * dispnew.c: Integer signedness and overflow fixes.
10753 Remove unnecessary forward decls, that were a maintenance hassle.
10754 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10756 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10757 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10758 (prepare_desired_row, line_draw_cost):
10759 Use int, not unsigned, where either works.
10760 (save_current_matrix, restore_current_matrix):
10761 Use ptrdiff_t, not size_t, where either works.
10762 (init_display): Check for overflow more accurately, and without
10763 relying on undefined behavior.
10765 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10766 Remove, replacing with the new symbols in lisp.h. All uses changed.
10767 * fileio.c (make_temp_name):
10768 * filelock.c (lock_file_1, lock_file):
10769 * xdisp.c (message_dolog):
10770 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10771 Use pMd etc. instead.
10772 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10773 replacing the pWIDE etc. symbols removed from editfns.c.
10775 * keyboard.h (num_input_events): Now uintmax_t.
10776 This is (very slightly) less likely to mess up due to wraparound.
10779 * buffer.c: Integer signedness fixes.
10780 (alloc_buffer_text, enlarge_buffer_text):
10781 Use ptrdiff_t rather than size_t when either will do, as we prefer
10784 * alloc.c: Integer signedness and overflow fixes.
10785 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10786 (__malloc_size_t): Default to size_t, not to int.
10787 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10788 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10789 Prefer ptrdiff_t to size_t when either would do, as we prefer
10791 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10792 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10793 Now const. Initialize with values that are in range even if char
10795 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10796 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10797 These functions do the right thing with sizes > 2**32.
10798 (check_depth): Now ptrdiff_t, not int.
10799 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10800 Adjust to new way of storing sizes. Check for size overflow bugs
10802 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10803 slightly wrong anyway, as it missed one instance of
10804 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10805 (refill_memory_reserve): Omit needless cast to size_t.
10806 (mark_object_loop_halt): Mark as externally visible.
10808 * xselect.c: Integer signedness and overflow fixes.
10809 (Fx_register_dnd_atom, x_handle_dnd_message):
10810 Use ptrdiff_t, not size_t, since we prefer signed.
10811 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10812 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10813 x_dnd_atoms_size and x_dnd_atoms_length.
10815 * doprnt.c: Prefer signed to unsigned when either works.
10817 * doprnt.c (doprnt):
10819 * xdisp.c (vmessage):
10820 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10821 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10822 prefer signed arithmetic to avoid comparison confusion.
10823 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10824 but is a bit tricky.
10826 Assume freestanding C89 headers, string.h, stdlib.h.
10827 * data.c, doprnt.c, floatfns.c, print.c:
10828 Include float.h unconditionally.
10829 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10830 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10831 * regex.c: Likewise for stddef.h, string.h.
10832 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10833 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10834 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10835 (STDC_HEADERS): Remove obsolete defines.
10836 * sysdep.c: Include limits.h unconditionally.
10838 Assume support for memcmp, memcpy, memmove, memset.
10839 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10840 * regex.c (memcmp, memcpy):
10841 Remove; we assume C89 now.
10843 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10844 (__malloc_safe_bcopy): Remove; no longer needed.
10846 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
10847 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10848 well either way, and we prefer signed to unsigned.
10850 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10852 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10853 closes the connection while we're reading (bug#9182).
10855 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
10857 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10858 are specified (Bug#9168).
10860 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10862 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10863 Found by GCC static checking and --with-wide-int on a 32-bit host.
10865 2011-07-25 Eli Zaretskii <eliz@gnu.org>
10867 * xdisp.c (compute_display_string_pos): Fix logic of caching
10868 previous display string position. Initialize cached_prev_pos to
10869 -1. Fixes slow-down at the beginning of a buffer.
10871 2011-07-24 Eli Zaretskii <eliz@gnu.org>
10873 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10874 for attrs[LFACE_FONTSET_INDEX].
10876 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10878 * xml.c (parse_region): Remove unused local
10879 that was recently introduced.
10881 2011-07-23 Eli Zaretskii <eliz@gnu.org>
10883 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10884 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10886 * xdisp.c (move_it_in_display_line_to): Record the best matching
10887 position for TO_CHARPOS while scanning the line, and restore it on
10888 exit if none of the characters scanned was an exact match.
10889 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
10890 when exact match is impossible due to invisible text, and the
10891 lines are truncated.
10893 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10895 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10898 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10900 Fix a significant slow-down of cursor motion with C-n, C-p,
10901 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10902 auto-repeat under bidi redisplay in fontified buffers.
10903 * xdisp.c (compute_stop_pos_backwards): New function.
10904 (next_element_from_buffer): Call compute_stop_pos_backwards to
10905 find a suitable prev_stop when we find ourselves before
10907 (reseat): Don't look for prev_stop, as that could mean a very long
10909 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10910 <cached_disp_overlay_modiff>: Cache for last found display string
10912 (compute_display_string_pos): Return the cached position if asked
10913 about the same buffer in the same area of character positions, and
10914 the buffer wasn't changed since the time the display string
10915 position was cached.
10917 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10919 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10920 is an integer, which is important for empty lines. (Bug#9149)
10922 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
10924 * frame.c (Fmodify_frame_parameters): In tty case, update the
10925 default face if necessary (Bug#4238).
10927 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
10929 * editfns.c (Fstring_to_char): No need to explain what a character
10930 is in the docstring (Bug#6576).
10932 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10934 * xml.c (parse_region): Make sure we always return a tree.
10936 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10938 * xml.c (parse_region): If a document contains only comments,
10941 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10943 * xml.c (make_dom): Return comments, too.
10945 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10948 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10949 and the surrounding thread.
10950 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10951 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10952 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10954 * s/openbsd.h (BROKEN_SIGIO): Define.
10955 * unexelf.c (unexec) [__OpenBSD__]:
10956 Don't update the .mdebug section of the Alpha COFF symbol table.
10958 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10960 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10963 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10965 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10966 This fixes some race conditions on the permissions of any newly
10969 * alloc.c (valid_pointer_p): Use pipe, not open.
10970 This fixes some permissions issues when debugging.
10972 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10973 If fchown fails to set both uid and gid, try to set just gid,
10974 as that is sometimes allowed. Adjust the file's mode to eliminate
10975 setuid or setgid bits that are inappropriate if fchown fails.
10977 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10979 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10980 to compare Lisp_Objects.
10981 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10982 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10983 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10985 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10987 * lread.c (read_integer): Unread even EOF character.
10988 (read1): Likewise. Properly record start position of symbol.
10990 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10991 symbol character follows.
10993 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10995 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10996 This works around a problem with the previous change to Fcopy_file.
10997 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10998 and without this change, GCC might complain about discarding
10999 fchown's return value.
11001 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11003 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11005 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11007 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11009 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11011 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11012 it's used from the C level.
11014 * process.c: Use the same condition for POLL_FOR_INPUT in both
11015 keyboard.c and process.c (bug#1858).
11017 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11019 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11020 (Fgnutls_boot): Use it.
11022 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11024 * doc.c (Fsubstitute_command_keys): Revert last change.
11026 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11028 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11029 quotes the next character, and doesn't affect other longer
11030 sequences (bug#8935).
11032 * lread.c (syms_of_lread): Clarify that is isn't only
11033 `eval-buffer' and `eval-defun' that's affected by
11034 `lexical-binding' (bug#8460).
11036 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11038 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11039 bidi redisplay when a line includes both an image and is truncated.
11041 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11043 Fix minor problems found by static checking.
11044 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11045 (elsz): Now a signed constant, not a size_t var. We prefer signed
11046 types to unsigned, to avoid integer comparison confusion. Without
11047 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11048 "cannot optimize loop, the loop counter may overflow", a symptom
11050 * indent.c (Fvertical_motion): Mark locals as initialized.
11051 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11053 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11055 * search.c (Fre_search_backward): Mention `case-fold-search' in
11056 all the re_search_* functions (bug#8138).
11058 * keyboard.c (Fopen_dribble_file): Document when the file is
11061 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11063 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11066 Support bidi reordering of display and overlay strings.
11067 * xdisp.c (compute_display_string_pos)
11068 (compute_display_string_end): Accept additional argument STRING.
11069 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11070 (reseat_to_string): Initialize bidi_it->string.s and
11071 bidi_it->string.schars.
11072 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11073 NULL (avoids a crash in bidi_paragraph_init).
11074 Initialize itb.string.lstring.
11075 (init_iterator): Call bidi_init_it only of a valid
11076 buffer position was specified. Initialize paragraph_embedding to
11078 (reseat_to_string): Initialize the bidi iterator.
11079 (display_string): If we need to ignore text properties of
11080 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11081 original value of -1 will not work with bidi.)
11082 (compute_display_string_pos): First arg is now struct
11083 `text_pos *'; all callers changed. Support display properties on
11085 (compute_display_string_end): Support display properties on Lisp
11087 (init_iterator, reseat_1, reseat_to_string): Initialize the
11088 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11089 when iterating on a string not from display properties).
11090 (compute_display_string_pos, compute_display_string_end):
11091 Fix calculation of the object to scan. Fixes an error when using
11093 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11094 base_level_stop; instead, set base_level_stop to BEGV.
11095 Fixes crashes in vertical-motion.
11096 (next_element_from_buffer): Improve commentary for when
11097 the iterator is before prev_stop.
11098 (init_iterator): Initialize bidi_p from the default value of
11099 bidi-display-reordering, not from buffer-local value. Use the
11100 buffer-local value only if initializing for buffer iteration.
11101 (handle_invisible_prop): Support invisible properties on strings
11102 that are being bidi-reordered.
11103 (set_iterator_to_next): Support bidi reordering of C strings and
11105 (next_element_from_string): Support bidi reordering of Lisp
11107 (handle_stop_backwards): Support Lisp strings as well.
11108 (display_string): Support display of R2L glyph rows.
11109 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11110 (init_iterator): Don't initialize it->bidi_p for strings
11112 (reseat_to_string): Initialize it->bidi_p for strings here.
11113 (next_element_from_string, next_element_from_c_string)
11114 (next_element_from_buffer): Add xassert's for correspondence
11115 between IT's object being iterated and it->bidi_it.string
11117 (face_before_or_after_it_pos): Support bidi iteration.
11118 (next_element_from_c_string): Handle the case of the first string
11119 character that is not the first one in the visual order.
11120 (get_visually_first_element): New function, refactored from common
11121 parts of next_element_from_buffer, next_element_from_string, and
11122 next_element_from_c_string.
11123 (tool_bar_lines_needed, redisplay_tool_bar)
11124 (display_menu_bar): Force left-to-right direction. Add a FIXME
11125 comment for making that be controlled by a user option.
11126 (push_it, pop_it): Save and restore the state of the
11127 bidi iterator. Save and restore the bidi_p flag.
11128 (pop_it): Iterate out of display property for string iteration as
11130 (iterate_out_of_display_property): Support iteration over strings.
11131 (handle_single_display_spec): Set up it->bidi_it for iteration
11132 over a display string, and call bidi_init_it.
11133 (handle_single_display_spec, next_overlay_string)
11134 (get_overlay_strings_1, push_display_prop): Set up the bidi
11135 iterator for displaying display or overlay strings.
11136 (forward_to_next_line_start): Don't use the shortcut if
11138 (back_to_previous_visible_line_start): If handle_display_prop
11139 pushed the iterator stack, restore the internal state of the bidi
11140 iterator by calling bidi_pop_it same number of times.
11141 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11142 and we are bidi-iterating, don't decrement the iterator position;
11143 instead, set the first_elt flag in the bidi iterator, to produce
11145 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11146 (push_display_prop): xassert that we are iterating a buffer.
11147 (push_it, pop_it): Save and restore paragraph_embedding member.
11148 (handle_single_display_spec, next_overlay_string)
11149 (get_overlay_strings_1, reseat_1, reseat_to_string)
11150 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11151 correctly. Don't assume unibyte strings are not bidi-reordered.
11152 (compute_display_string_pos)
11153 (compute_display_string_end): Fix handling the case of C string.
11154 (push_it, pop_it): Save and restore from_disp_prop_p.
11155 (handle_single_display_spec, push_display_prop): Set the
11156 from_disp_prop_p flag.
11157 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11158 (pop_it): Call iterate_out_of_display_property only if we are
11159 popping after iteration over a string that came from a display
11160 property. Fix a typo in popping stretch info. Add an assertion
11161 for verifying that the iterator position is in sync with the bidi
11163 (handle_single_display_spec, get_overlay_strings_1)
11164 (push_display_prop): Fix initialization of paragraph direction for
11165 string when that of the parent object is not yet determined.
11166 (reseat_1): Call bidi_init_it to resync the bidi
11167 iterator with IT's position. (Bug#7616)
11168 (find_row_edges): If ROW->start.pos gives position
11169 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11170 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11171 Reset the from_disp_prop_p flag.
11172 (SAVE_IT, RESTORE_IT): New macros.
11173 (pos_visible_p, face_before_or_after_it_pos)
11174 (back_to_previous_visible_line_start)
11175 (move_it_in_display_line_to, move_it_in_display_line)
11176 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11177 (try_scrolling, redisplay_window, display_line): Use them when
11178 saving a temporary copy of the iterator and restoring it back.
11179 (back_to_previous_visible_line_start, reseat_1)
11180 (init_iterator): Empty the bidi cache "stack".
11181 (move_it_in_display_line_to): If iterator ended up at
11182 EOL, but we never saw any buffer positions smaller than
11183 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11184 motion in bidi-reordered lines.
11185 (move_it_in_display_line_to): Record prev_method and prev_pos
11186 immediately before the call to set_iterator_to_next. Fixes cursor
11187 motion in bidi-reordered lines with stretch glyphs and strings
11188 displayed in margins. (Bug#8133) (Bug#8867)
11189 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11191 (pos_visible_p): Support positions in bidi-reordered lines.
11192 Save and restore bidi cache.
11194 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11195 (bidi_paragraph_info): Delete unused struct.
11196 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11197 (bidi_cache_start): New variable.
11198 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11200 (bidi_cache_fetch_state, bidi_cache_search)
11201 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11202 (bidi_cache_find, bidi_peek_at_next_level)
11203 (bidi_level_of_next_char, bidi_find_other_level_edge)
11204 (bidi_move_to_visually_next): Compare cache index with
11205 bidi_cache_start rather than with zero.
11206 (bidi_fetch_char): Accept new argument STRING; all callers
11207 changed. Support iteration over a string. Support strings with
11208 display properties. Support unibyte strings. Fix the type of
11209 `len' according to what STRING_CHAR_AND_LENGTH expects.
11210 (bidi_paragraph_init, bidi_resolve_explicit_1)
11211 (bidi_resolve_explicit, bidi_resolve_weak)
11212 (bidi_level_of_next_char, bidi_move_to_visually_next):
11213 Support iteration over a string.
11214 (bidi_set_sor_type, bidi_resolve_explicit_1)
11215 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11216 can now be zero (for strings); special values 0 and -1 were
11217 changed to -1 and -2, respectively.
11218 (bidi_char_at_pos): New function.
11219 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11220 Call it instead of FETCH_MULTIBYTE_CHAR.
11221 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11222 initialized to valid values.
11223 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11225 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11226 the test for valid cached positions. Fix the logic for looking up
11227 the sentinel state in the cache. GCPRO the Lisp string we are
11229 (bidi_push_it, bidi_pop_it): New functions.
11230 (bidi_initialize): Initialize the bidi cache start stack pointer.
11231 (bidi_cache_ensure_space): New function, refactored from part of
11232 bidi_cache_iterator_state. Don't assume the required size is just
11233 one BIDI_CACHE_CHUNK away.
11234 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11235 (bidi_count_bytes, bidi_char_at_pos): New functions.
11236 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11237 always valid if bidi_cache_idx is valid.
11238 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11239 is valid if it's going to be used.
11240 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11241 (bidi_cache_fetch_state, bidi_cache_search)
11242 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11243 (bidi_cache_iterator_state, bidi_cache_find)
11244 (bidi_find_other_level_edge, bidi_cache_start_stack):
11245 All variables related to cache indices are now EMACS_INT.
11247 * dispextern.h (struct bidi_string_data): New structure.
11248 (struct bidi_it): New member `string'. Make flag members be 1-bit
11249 fields, and put them last in the struct.
11250 (compute_display_string_pos, compute_display_string_end):
11252 (bidi_push_it, bidi_pop_it): Add prototypes.
11253 (struct iterator_stack_entry): New members bidi_p,
11254 paragraph_embedding, and from_disp_prop_p.
11255 (struct it): Member bidi_p is now a bit field 1 bit wide.
11256 (bidi_shelve_cache, bidi_unshelve_cache):
11257 Declare prototypes.
11259 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11260 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11261 and vector-like objects.
11263 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11264 cache around display iteration.
11266 * window.c (Fwindow_end, window_scroll_pixel_based)
11267 (displayed_window_lines, Frecenter): Save and restore the bidi
11268 cache around display iteration.
11270 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11272 * editfns.c (Fdelete_region): Clarify the use of the named
11273 parameters (bug#6788).
11275 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11277 * indent.c (Fvertical_motion): Set and restore w->pointm when
11278 saving and restoring the window's buffer (Bug#9006).
11280 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11282 * editfns.c (Fstring_to_char): Clarify just what is returned
11283 (bug#6576). Text by Eli Zaretskii.
11285 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11287 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11289 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11291 * buffer.c (mmap_find): Fix a typo.
11293 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11295 Fix execution of x selection hooks.
11296 * xselect.c (Qx_lost_selection_functions)
11297 (Qx_sent_selection_functions): New vars.
11298 (syms_of_xselect): DEFSYM them.
11299 (x_handle_selection_request): Pass Qx_sent_selection_functions
11300 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11301 (x_handle_selection_clear,x_clear_frame_selections):
11302 Pass Qx_lost_selection_functions rather than
11303 Vx_lost_selection_functions to Frun_hook_with_args.
11305 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11307 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11308 The old code sometimes used this field without initializing it.
11310 * alloc.c (gc_sweep): Don't read past end of array.
11311 In theory, the old code could also have corrupted Emacs internals,
11312 though it'd be very unlikely.
11314 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11316 * character.c (Fcharacterp): Don't advertise optional ignored
11317 argument. (Bug#4026)
11319 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11321 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11324 * window.c (Fset_window_start): Doc fix (bug#4199).
11325 (Fset_window_hscroll): Ditto.
11327 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11329 Fix minor new problems caught by GCC 4.6.1.
11330 * term.c (init_tty): Remove unused local.
11331 * xsettings.c (store_monospaced_changed): Define this function only
11332 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11333 not used otherwise.
11335 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11337 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11339 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11341 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11342 are the mini-buffer and the echo area (bug#3320).
11344 * term.c (init_tty): Remove support for supdup, c10 and perq
11345 terminals, which are no longer supported (bug#1482).
11347 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11349 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11351 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11353 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11354 for non-popups (Bug#3642).
11356 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11358 * alloc.c (reset_malloc_hooks): Protoize.
11359 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11360 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11361 * cm.c (losecursor): Likewise.
11362 * data.c (fmod): Likewise.
11363 * dispnew.c (swap_glyphs_in_rows): Likewise.
11364 * emacs.c (memory_warning_signal): Likewise.
11365 * floatfns.c (float_error): Likewise.
11366 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11367 (otf_open, font_otf_capability, generate_otf_features)
11368 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11370 * image.c (pbm_read_file): Likewise.
11371 * indent.c (string_display_width): Likewise.
11372 * intervals.c (check_for_interval, search_for_interval)
11373 (inc_interval_count, count_intervals, root_interval)
11374 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11375 * lread.c (defalias): Likewise.
11376 * ralloc.c (r_alloc_check): Likewise.
11377 * regex.c (set_image_of_range_1, set_image_of_range)
11378 (regex_grow_registers): Likewise.
11379 * sysdep.c (strerror): Likewise.
11380 * termcap.c (valid_filename_p, tprint, main): Likewise.
11381 * tparam.c (main): Likewise.
11382 * unexhp9k800.c (run_time_remap, save_data_space)
11383 (update_file_ptrs, read_header, write_header, calculate_checksum)
11384 (copy_file, copy_rest, display_header): Likewise.
11385 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11387 * xdisp.c (check_it): Likewise.
11388 * xfaces.c (register_color, unregister_color, unregister_colors):
11390 * xfns.c (print_fontset_result): Likewise.
11391 * xrdb.c (member, fatal, main): Likewise.
11393 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11395 Fix minor problems found by static checking (Bug#9031).
11396 * chartab.c (char_table_set_range, map_sub_char_table):
11397 Remove unused locals.
11398 (uniprop_table): Now static.
11399 * composite.c (_work_char): Remove unused static var.
11401 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11403 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11405 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11407 * gtkutil.c (qttip_cb): Remove code without function.
11409 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11411 * w32.c (pthread_sigmask): New stub.
11413 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11415 Use pthread_sigmask, not sigprocmask (Bug#9010).
11416 sigprocmask is portable only for single-threaded applications, and
11417 Emacs can be multi-threaded when it uses GTK.
11418 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11420 * callproc.c (Fcall_process):
11421 * process.c (create_process):
11422 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11423 Use pthread_sigmask, not sigprocmask.
11425 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11427 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11428 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11431 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11433 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11434 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11435 (xg_hide_tooltip): Fix comment.
11437 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11438 in registerServicesMenuSendTypes.
11439 (validRequestorForSendType): Don't check ns_return_types.
11441 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11444 2011-07-08 Jason Rumney <jasonr@gnu.org>
11446 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11447 SH_SHOW for hidden windows (Bug#5482).
11449 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11450 frame struct members of non-existent frames (Bug#6284).
11452 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11454 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11455 variable firstTime not needed on OSX >= 10.6.
11456 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11457 >= 10.5. Use setKnobProportion, setDoubleValue.
11459 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11460 (MAC_OS_X_VERSION_10_5): Define if not defined.
11461 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11462 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11463 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11465 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11466 cString and lossyCString on OSX >= 10.4.
11468 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11469 sizeToFit on OSX >= 10.2.
11471 * nsimage.m (allocInitFromFile): Don't use deprecated method
11472 bestRepresentationForDevice on OSX >= 10.6.
11474 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11477 * emacs.c: Declare unexec_init_emacs_zone.
11479 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11481 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11483 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11484 on svcsMenu (Bug#8842).
11486 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11488 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11490 * nsterm.m (QUTF8_STRING): Declare.
11491 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11492 (validRequestorForSendType): Return type is (id).
11493 Change indexOfObjectIdenticalTo to indexOfObject.
11494 Check if we have local selection before returning self (Bug#8842).
11495 (writeSelectionToPasteboard): Put local selection into paste board
11496 if we have a local selection (Bug#8842).
11497 (syms_of_nsterm): DEFSYM QUTF8_STRING.
11499 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11500 (ns_get_local_selection): Declare.
11502 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11504 * keymap.c (describe_map_tree): Don't insert a double newline at
11505 the end of the buffer (bug#1169) and return whether we inserted
11508 * callint.c (Fcall_interactively): Change "reading args" to
11509 "providing args" to try to clarify what it does (bug#1010).
11511 2011-07-07 Kenichi Handa <handa@m17n.org>
11513 * composite.c (composition_compute_stop_pos): Ignore a static
11514 composition starting before CHARPOS (Bug#8915).
11516 * xdisp.c (handle_composition_prop): Likewise.
11518 2011-07-07 Eli Zaretskii <eliz@gnu.org>
11520 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11523 2011-07-07 Kenichi Handa <handa@m17n.org>
11525 * character.h (unicode_category_t): New enum type.
11527 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11528 (Qchar_code_property_table): New variable.
11529 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11530 (UNIPROP_COMPRESSED_FORM_P): New macros.
11531 (char_table_ascii): Uncompress the compressed values.
11532 (sub_char_table_ref): New arg is_uniprop. Callers changed.
11533 Uncompress the compressed values.
11534 (sub_char_table_ref_and_range): Likewise.
11535 (char_table_ref_and_range): Uncompress the compressed values.
11536 (sub_char_table_set): New arg is_uniprop. Callers changed.
11537 Uncompress the compressed values.
11538 (sub_char_table_set_range): Args changed. Callers changed.
11539 (char_table_set_range): Adjuted for the above change.
11540 (map_sub_char_table): Delete args default_val and parent. Add arg
11541 top. Give decoded values to a Lisp function.
11542 (map_char_table): Adjust for the above change. Give decoded
11543 values to a Lisp function. Gcpro more variables.
11544 (uniprop_table_uncompress)
11545 (uniprop_decode_value_run_length): New functions.
11546 (uniprop_decoder, uniprop_decoder_count): New variables.
11547 (uniprop_get_decoder, uniprop_encode_value_character)
11548 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11550 (uniprop_encoder, uniprop_encoder_count): New variables.
11551 (uniprop_get_encoder, uniprop_table)
11552 (Funicode_property_table_internal, Fget_unicode_property_internal)
11553 (Fput_unicode_property_internal): New functions.
11554 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11555 Sunicode_property_table_internal, Sget_unicode_property_internal,
11556 and Sput_unicode_property_internal. Defvar_lisp
11557 char-code-property-alist.
11559 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
11560 Vunicode_category_table.
11562 * font.c (font_range): Adjust for the change of
11563 Vunicode_category_table.
11565 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11567 * m/iris4d.h: Remove file, move contents ...
11568 * s/irix6-5.h: ... here.
11570 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11572 Remove unportable assumption about struct layout (Bug#8884).
11573 * alloc.c (mark_buffer):
11574 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11575 (clone_per_buffer_values): Don't assume that
11576 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11577 This isn't true in general, and it's particularly not true
11578 if Emacs is configured with --with-wide-int.
11579 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11580 New macros, used in the buffer.c change.
11582 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11584 * xsettings.c: Use both GConf and GSettings if both are available.
11585 (store_config_changed_event): Add comment.
11586 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11587 (store_tool_bar_style_changed): New functions.
11588 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
11589 (struct xsettings): Move font inside HAVE_XFT.
11590 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
11591 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
11592 Move inside HAVE_XFT.
11593 (something_changed_gsettingsCB): Rename from something_changedCB.
11594 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11596 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
11597 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
11598 (something_changed_gconfCB): Rename from something_changedCB.
11599 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11600 (parse_settings): Move check for font inside HAVE_XFT.
11601 (read_settings, apply_xft_settings): Add comment.
11602 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
11603 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
11604 call store_font_name_changed.
11605 (xft_settings_event): Add comment.
11606 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
11607 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
11608 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
11609 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
11610 (xsettings_initialize): Call init_gsettings last.
11611 (xsettings_get_system_font, xsettings_get_system_normal_font):
11614 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
11616 Random fixes. E.g., (random) never returned negative values.
11617 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
11618 subseconds part to the entropy, as that's a bit more random.
11619 Prefer signed to unsigned, since the signedness doesn't matter and
11620 in general we prefer signed. When given a limit, use a
11621 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11622 latter isn't right if USE_2_TAGS_FOR_INTS.
11623 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11624 not 0..VALMASK. Don't discard "excess" bits that random () returns.
11626 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11628 * textprop.c (text_property_stickiness):
11629 Obey Vtext_property_default_nonsticky.
11630 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11631 * w32fns.c (syms_of_w32fns):
11632 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11634 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11636 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11637 This is more efficient than Ffile_directory_p and avoids a minor race.
11639 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11641 * buffer.c (Foverlay_put): Say what the return value is
11644 * fileio.c (barf_or_query_if_file_exists): Check first if the file
11645 is a directory before asking whether to use the file name
11647 (barf_or_query_if_file_exists): Make the "File is a directory"
11648 error be more correct.
11650 * fns.c (Frequire): Remove the mention of the .gz files, since
11651 that's installation-specific, but keep the mention of
11652 `get-load-suffixes'.
11654 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11656 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11657 Report string overflow if the output is too long.
11659 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
11661 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11662 (syms_of_gnutls): Remove duplicate DEFSYM for
11663 Qgnutls_bootprop_verify_hostname_error, an error for
11664 Qgnutls_bootprop_verify_error (which is no longer used).
11666 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11667 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
11668 Also (re)move comments that are misplaced or no longer relevant.
11670 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11672 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11674 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
11676 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11677 and background color parameters if they have been changed.
11679 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11681 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11683 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11685 * xsettings.c (SYSTEM_FONT): Define only when used.
11686 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11688 * keymap.c (access_keymap_1): Now static.
11690 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
11692 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11693 leave any prefix arg for the up event (Bug#1586).
11695 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11697 * lread.c (syms_of_lread): Mention single symbols defined by
11698 `defvar' or `defconst' (bug#7154).
11700 * fns.c (Frequire): Mention .el.gz files (bug#7314).
11701 (Frequire): Mention get-load-suffixes.
11703 2011-07-02 Martin Rudalics <rudalics@gmx.at>
11705 * window.h (window): Remove clone_number slot.
11706 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11708 (make_parent_window, make_window, saved_window)
11709 (Fset_window_configuration, save_window_save): Don't deal with
11711 * buffer.c (Qclone_number): Remove declaration.
11712 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11714 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11716 Add multiple inheritance to keymaps.
11717 * keymap.c (Fmake_composed_keymap): New function.
11718 (Fset_keymap_parent): Simplify.
11719 (fix_submap_inheritance): Remove.
11720 (access_keymap_1): New function extracted from access_keymap to handle
11721 embedded parents and handle lists of maps.
11722 (access_keymap): Use it.
11723 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11724 (Fcopy_keymap): Handle embedded parents.
11725 (Fcommand_remapping, define_as_prefix): Simplify.
11726 (Fkey_binding): Simplify.
11727 (syms_of_keymap): Move minibuffer-local-completion-map,
11728 minibuffer-local-filename-completion-map,
11729 minibuffer-local-must-match-map, and
11730 minibuffer-local-filename-must-match-map to Elisp.
11731 (syms_of_keymap): Defsubr make-composed-keymap.
11732 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11733 (parse_menu_item): Trivial simplification.
11735 2011-07-01 Glenn Morris <rgm@gnu.org>
11737 * Makefile.in (SETTINGS_LIBS): Fix typo.
11739 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11741 * coding.c (Fencode_coding_string): Record the last coding system
11742 used, as the function doc string says (bug#8738).
11744 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11746 * xsettings.c (store_monospaced_changed): Take new font as arg and
11747 check for change against current_mono_font.
11748 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11749 (emacs_settings_constructor, emacs_settings_get_property)
11750 (emacs_settings_set_property, emacs_settings_class_init)
11751 (emacs_settings_init, gsettings_obj): Remove.
11752 (something_changedCB): New function for HAVE_GSETTINGS.
11753 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11754 with value as argument.
11755 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11756 g_settings_new (Bug#8967). Do not create gsettings_obj.
11757 Remove calls to g_settings_bind. Connect something_changedCB to
11760 * xgselect.c: Add defined (HAVE_GSETTINGS).
11761 (xgselect_initialize): Ditto.
11763 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11764 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11767 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11769 * eval.c (struct backtrace): Simplify and port the data structure.
11770 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11771 signed bit field, as this assumption is not portable and it makes
11772 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11773 "char debug_on_exit : 1" as this is not portable either; instead,
11774 use the portable "unsigned int debug_on_exit : 1". Remove unused
11775 member evalargs. Remove obsolete comments about cc bombing out.
11777 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11779 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
11780 Let HAVE_GSETTINGS override HAVE_GCONF.
11781 (store_monospaced_changed): New function.
11782 (EMACS_SETTINGS): A new type derived from GObject to handle
11783 GSettings notifications.
11784 (emacs_settings_constructor, emacs_settings_get_property)
11785 (emacs_settings_set_property, emacs_settings_class_init):
11787 (gsettings_client, gsettings_obj): New variables.
11788 (GSETTINGS_SCHEMA): New define.
11789 (something_changedCB): Call store_monospaced_changed.
11790 (init_gsettings): New function.
11791 (xsettings_initialize): Call init_gsettings.
11792 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11795 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
11798 2011-06-29 Martin Rudalics <rudalics@gmx.at>
11800 * window.c (resize_root_window, grow_mini_window)
11801 (shrink_mini_window): Rename Qresize_root_window to
11802 Qwindow_resize_root_window and Qresize_root_window_vertically to
11803 Qwindow_resize_root_window_vertically.
11805 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11807 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11809 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
11811 * makefile.w32-in: Redesign dependencies so they reflect more
11812 clearly which files are directly included by each source file,
11813 and not through other includes.
11815 2011-06-27 Martin Rudalics <rudalics@gmx.at>
11817 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11818 (sort_overlays, overlay_strings): When an overlay's clone number
11819 matches the window's clone number process the overlay even if
11820 the overlay's window property doesn't match the current window.
11822 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11823 (Fwindow_hchild): Rename to Fwindow_left_child.
11824 (Fwindow_next): Rename to Fwindow_next_sibling.
11825 (Fwindow_prev): Rename to Fwindow_prev_sibling.
11826 (resize_window_check): Rename to window_resize_check.
11827 (resize_window_apply): Rename to window_resize_apply.
11828 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11829 (Fdelete_other_windows_internal, resize_frame_windows)
11830 (Fsplit_window_internal, Fdelete_window_internal)
11831 (grow_mini_window, shrink_mini_window)
11832 (Fresize_mini_window_internal): Fix callers accordingly.
11834 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11836 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11837 (emacs_fixed_set_min_size): Remove.
11838 (emacs_fixed_new): Take frame as argument.
11840 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11841 (_EmacsFixedPrivate): Remove minwidth/height.
11842 Add struct frame *f.
11843 (emacs_fixed_init): Initialize priv->f.
11844 (get_parent_class, emacs_fixed_set_min_size): Remove.
11845 (emacs_fixed_new): Set priv->f to argument.
11846 (emacs_fixed_get_preferred_width)
11847 (emacs_fixed_get_preferred_height): Use min_width/height from
11848 frames size_hint to set minimum and natural (Bug#8919).
11849 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11850 and use min_width/height from frames size_hint to set
11851 min_width/height (Bug#8919).
11853 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
11854 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11857 2011-06-26 Eli Zaretskii <eliz@gnu.org>
11859 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11860 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11863 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
11865 * process.c (wait_reading_process_output): Bypass select if
11866 waiting for a cell while ignoring keyboard input, and input is
11867 pending. Suggested by Jan Djärv (Bug#8869).
11869 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11871 Use gnulib's dup2 module instead of rolling our own.
11872 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11874 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11876 * dispnew.c (scrolling_window): Before scrolling, turn off a
11877 mouse-highlight in the window being scrolled.
11879 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
11881 Move DEFSYM to lisp.h and use everywhere.
11883 * character.h (DEFSYM): Move declaration...
11884 * lisp.h (DEFSYM): ...here.
11890 * w32select.c: Don't include character.h.
11892 * alloc.c (syms_of_alloc):
11893 * buffer.c (syms_of_buffer):
11894 * bytecode.c (syms_of_bytecode):
11895 * callint.c (syms_of_callint):
11896 * casefiddle.c (syms_of_casefiddle):
11897 * casetab.c (init_casetab_once):
11898 * category.c (init_category_once, syms_of_category):
11899 * ccl.c (syms_of_ccl):
11900 * cmds.c (syms_of_cmds):
11901 * composite.c (syms_of_composite):
11902 * dbusbind.c (syms_of_dbusbind):
11903 * dired.c (syms_of_dired):
11904 * dispnew.c (syms_of_display):
11905 * doc.c (syms_of_doc):
11906 * editfns.c (syms_of_editfns):
11907 * emacs.c (syms_of_emacs):
11908 * eval.c (syms_of_eval):
11909 * fileio.c (syms_of_fileio):
11910 * fns.c (syms_of_fns):
11911 * frame.c (syms_of_frame):
11912 * fringe.c (syms_of_fringe):
11913 * insdel.c (syms_of_insdel):
11914 * keymap.c (syms_of_keymap):
11915 * lread.c (init_obarray, syms_of_lread):
11916 * macros.c (syms_of_macros):
11917 * msdos.c (syms_of_msdos):
11918 * print.c (syms_of_print):
11919 * process.c (syms_of_process):
11920 * search.c (syms_of_search):
11921 * sound.c (syms_of_sound):
11922 * syntax.c (init_syntax_once, syms_of_syntax):
11923 * terminal.c (syms_of_terminal):
11924 * textprop.c (syms_of_textprop):
11925 * undo.c (syms_of_undo):
11926 * w32.c (globals_of_w32):
11927 * window.c (syms_of_window):
11928 * xdisp.c (syms_of_xdisp):
11929 * xfaces.c (syms_of_xfaces):
11930 * xfns.c (syms_of_xfns):
11931 * xmenu.c (syms_of_xmenu):
11932 * xsettings.c (syms_of_xsettings):
11933 * xterm.c (syms_of_xterm): Use DEFSYM.
11935 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11937 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
11939 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11941 Integer and buffer overflow fixes (Bug#8873).
11943 * print.c (printchar, strout): Check for string overflow.
11944 (PRINTPREPARE, printchar, strout):
11945 Don't set size unless allocation succeeds.
11947 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11948 for sizes. Check for string overflow more accurately.
11949 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11951 * macros.c: Integer and buffer overflow fixes.
11952 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11953 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11954 Use ptrdiff_t, not int, for sizes.
11955 Don't increment bufsize until after realloc succeeds.
11956 Check for size-calculation overflow.
11957 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11959 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11961 * lread.c: Integer overflow fixes.
11962 (read_integer): Radix is now EMACS_INT, not int,
11963 to improve quality of diagnostics for out-of-range radices.
11964 Calculate buffer size correctly for out-of-range radices.
11965 (read1): Check for integer overflow in radices, and in
11966 read-circle numbers.
11967 (read_escape): Avoid int overflow.
11968 (Fload, openp, read_buffer_size, read1)
11969 (substitute_object_recurse, read_vector, read_list, map_obarray):
11970 Use ptrdiff_t, not int, for sizes.
11971 (read1): Use EMACS_INT, not int, for sizes.
11972 Check for size overflow.
11974 * image.c (cache_image): Check for size arithmetic overflow.
11976 * lread.c: Integer overflow issues.
11977 (saved_doc_string_size, saved_doc_string_length)
11978 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11979 Now ptrdiff_t, not int.
11980 (read1): Don't assume doc string length fits in int. Check for
11981 out-of-range doc string lengths.
11982 (read_list): Don't assume file position fits in int.
11983 (read_escape): Check for hex character overflow.
11985 2011-06-22 Leo Liu <sdl.web@gmail.com>
11987 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11988 Move to minibuffer.el.
11990 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11992 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
11993 The following patches are for when GLYPH_DEBUG && !XASSERT.
11994 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11995 * dispnew.c (flush_stdout):
11996 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11997 Mark as externally visible.
11998 * dispnew.c (check_window_matrix_pointers): Now static.
11999 * dispnew.c (window_to_frame_vpos):
12000 * xfns.c (unwind_create_frame):
12001 * xterm.c (x_check_font): Remove unused local.
12002 * scroll.c (CHECK_BOUNDS):
12003 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12004 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12005 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12006 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12007 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12009 (debug_method_add): Use va_list and vsprintf rather than relying
12010 on undefined behavior with wrong number of arguments.
12011 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12012 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12013 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12014 since we're not interested in debugging glyphs with old libraries.
12015 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12016 GCC 4.6.0's static checking.
12018 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12020 Integer overflow and signedness fixes (Bug#8873).
12021 A few related buffer overrun fixes, too.
12023 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12025 * dispextern.h (struct face.stipple):
12026 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12027 (x_bitmap_mask, x_allocate_bitmap_record)
12028 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12029 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12030 (x_create_bitmap_from_xpm_data):
12031 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12032 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12034 * xfaces.c (load_pixmap):
12035 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12036 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12037 (.bitmaps_last, struct x_output.icon_bitmap):
12038 Use ptrdiff_t, not int, for bitmap indexes.
12039 (x_allocate_bitmap_record): Check for size overflow.
12040 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12042 Use ptrdiff_t, not int, for overlay counts.
12043 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12044 * editfns.c (overlays_around, get_pos_property):
12045 * textprop.c (get_char_property_and_overlay):
12046 * xdisp.c (next_overlay_change, note_mouse_highlight):
12047 * xfaces.c (face_at_buffer_position):
12048 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12049 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12050 (Fnext_overlay_change, Fprevious_overlay_change)
12051 (mouse_face_overlay_overlaps, Foverlays_in):
12052 Use ptrdiff_t, not int, for sizes.
12053 (overlays_at, overlays_in): Check for size-calculation overflow.
12055 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12057 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12058 (x_session_initialize): Do not assume string length fits in int.
12060 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12061 This is unlikely, but can occur if DPI is outlandish.
12063 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12064 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12066 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12067 * xrdb.c (magic_file_p, search_magic_path):
12068 Omit last arg SUFFIX; it was always 0. All callers changed.
12069 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12071 * xfont.c (xfont_match): Avoid need for strlen.
12073 * xfns.c: Don't assume strlen fits in int.
12074 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12076 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12077 not unsigned long, as we prefer signed integers. All callers changed.
12078 Detect integer overflow in repeat count.
12079 (message_dolog): Don't assume print length fits in 39 bytes.
12080 (display_mode_element): Don't assume strlen fits in int.
12082 * termcap.c: Don't assume sizes fit in int and never overflow.
12083 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12084 (gobble_line): Check for size-calculation overflow.
12086 * minibuf.c (Fread_buffer):
12087 * lread.c (intern, intern_c_string):
12088 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12089 Don't assume string length fits in int.
12091 * keyboard.c (parse_tool_bar_item):
12092 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12094 * font.c: Don't assume string length fits in int.
12095 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12096 Use ptrdiff_t, not int.
12097 (font_intern_prop): Don't assume string length fits in int.
12098 Don't assume integer property fits in fixnum.
12099 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12101 * filelock.c: Fix some buffer overrun and integer overflow issues.
12102 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12103 Reformulate so as not to need the command string.
12104 Invoke gzip -cd rather than gunzip, as it's more portable.
12105 (lock_info_type, lock_file_1, lock_file):
12106 Don't assume pid_t and time_t fit in unsigned long.
12107 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12108 (current_lock_owner): Prefer signed type for sizes.
12109 Use memcpy, not strncpy, where memcpy is what is really wanted.
12110 Don't assume (via atoi) that time_t and pid_t fit in int.
12111 Check for time_t and/or pid_t out of range, e.g., via a network share.
12112 Don't alloca where an auto var works fine.
12114 * fileio.c: Fix some integer overflow issues.
12115 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12116 Don't assume string length fits in int.
12117 (directory_file_name): Don't assume string length fits in long.
12118 (make_temp_name): Don't assume pid fits in int, or that its print
12119 length is less than 20.
12121 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12123 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12125 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12127 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12128 We prefer signed integers, even for size calculations.
12130 * emacs.c: Don't assume string length fits in 'int'.
12131 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12132 (main): Don't invoke strlen when not needed.
12134 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12135 (XD_DEBUG_MESSAGE): Don't waste a byte.
12137 * callproc.c (getenv_internal_1, getenv_internal)
12138 (Fgetenv_internal):
12139 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12141 * lread.c (invalid_syntax): Omit length argument.
12142 All uses changed. This doesn't fix a bug, but it simplifies the
12143 code away from its former Hollerith-constant appearance, and it's
12144 one less 'int' to worry about when looking at integer-overflow issues.
12145 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12147 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12148 This didn't break anything, but it didn't help either.
12149 It's confusing to put a bogus integer in a place where the actual
12150 value does not matter.
12151 (LIST_END_P): Remove unused macro and its bogus comment.
12152 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12154 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12155 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12157 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12158 We prefer signed types, and the value cannot exceed the EMACS_INT
12159 range anyway (because otherwise the length would not be representable).
12160 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12161 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12162 This avoids a GCC warning when WIDE_EMACS_INT.
12164 * indent.c (sane_tab_width): New function.
12165 (current_column, scan_for_column, Findent_to, position_indentation)
12166 (compute_motion): Use it. This is just for clarity.
12167 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12169 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12171 * lisp.h (lint_assume): New macro.
12172 * composite.c (composition_gstring_put_cache):
12173 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12175 * editfns.c, insdel.c:
12176 Omit unnecessary forward decls, to simplify future changes.
12178 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12180 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12182 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12183 Use much-faster test for byte-length change.
12184 Don't assume string byte-length fits in 'int'.
12185 Check that character arg fits in 'int'.
12186 (mapcar1): Declare byte as byte, for clarity.
12188 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12190 * fns.c (concat): Catch string overflow earlier.
12191 Do not rely on integer wraparound.
12193 * dispextern.h (struct it.overlay_strings_charpos)
12194 (struct it.selective): Now EMACS_INT, not int.
12195 * xdisp.c (forward_to_next_line_start)
12196 (back_to_previous_visible_line_start)
12197 (reseat_at_next_visible_line_start, next_element_from_buffer):
12198 Don't arbitrarily truncate the value of 'selective' to int.
12200 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12202 * composite.c: Don't truncate sizes to 'int'.
12203 (composition_gstring_p, composition_reseat_it)
12204 (composition_adjust_point): Use EMACS_INT, not int.
12205 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12206 not EMACS_UINT, for indexes.
12208 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12210 * buffer.c: Include <verify.h>.
12211 (struct sortvec.priority, struct sortstr.priority):
12212 Now EMACS_INT, not int.
12213 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12214 (struct sortstr.size, record_overlay_string)
12215 (struct sortstrlist.size, struct sortlist.used):
12216 Don't truncate size to int.
12217 (record_overlay_string): Check for size-calculation overflow.
12218 (init_buffer_once): Check at compile-time, not run-time.
12220 2011-06-22 Jim Meyering <meyering@redhat.com>
12222 Don't leak an XBM-image-sized buffer
12223 * image.c (xbm_load): Free the image buffer after using it.
12225 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12228 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12229 that Sun C diagnosed.
12230 * fns.c (secure_hash): Fix pointer signedness issue.
12231 * intervals.c (static_offset_intervals): New function.
12232 (offset_intervals): Use it.
12234 2011-06-21 Leo Liu <sdl.web@gmail.com>
12237 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12240 * fns.c (secure_hash): Rename from crypto_hash_function and change
12241 the first arg to accept symbols.
12242 (Fsecure_hash): New primitive.
12243 (syms_of_fns): New symbols.
12245 2011-06-20 Deniz Dogan <deniz@dogan.se>
12247 * process.c (Fset_process_buffer): Clarify return value in
12250 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12252 * dispnew.c (add_window_display_history): Use BVAR.
12254 * xdisp.c (debug_method_add): Use BVAR.
12255 (check_window_end, dump_glyph_matrix, dump_glyph)
12256 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12258 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12261 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12262 check till after the cache is created in init_frame_faces.
12264 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12266 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12268 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12270 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12271 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12272 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12274 Improve buffer-overflow checking (Bug#8873).
12275 * fileio.c (Finsert_file_contents):
12276 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12277 Remove the old (too-loose) buffer overflow checks.
12278 They weren't needed, since make_gap checks for buffer overflow.
12279 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12280 The old code merely checked for Emacs fixnum overflow, and relied
12281 on undefined (wraparound) behavior. The new code avoids undefined
12282 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12284 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12285 Tune. Don't use wider integers than needed. Don't use alloca.
12286 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12288 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12290 * insdel.c, lisp.h (buffer_overflow): New function.
12291 (insert_from_buffer_1, replace_range, replace_range_2):
12292 * insdel.c (make_gap_larger):
12293 * editfns.c (Finsert_char):
12294 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12296 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12298 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12300 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12302 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12303 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12305 * fileio.c: Don't assume EMACS_INT fits in off_t.
12306 (emacs_lseek): New static function.
12307 (Finsert_file_contents, Fwrite_region): Use it.
12308 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12310 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12312 * fns.c: Don't overflow int when computing a list length.
12313 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12314 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12315 truncation on 64-bit hosts. Check for QUIT every
12316 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12317 faster and is responsive enough.
12318 (Flength): Report an error instead of overflowing an integer.
12319 (Fsafe_length): Return a float if the value is not representable
12320 as a fixnum. This shouldn't happen except in contrived situations.
12321 (Fnthcdr, Fsort): Don't assume list length fits in int.
12322 (Fcopy_sequence): Don't assume vector length fits in int.
12324 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12325 (header_size, word_size): New constants.
12326 (allocate_vectorlike): Don't check size overflow here.
12327 (allocate_vector): Check it here instead, since this is the only
12328 caller of allocate_vectorlike that could cause overflow.
12329 Check that the new vector's length is representable as a fixnum.
12331 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12332 The previous code was bogus. For example, next_almost_prime (32)
12333 returned 39, which is undesirable as it is a multiple of 3; and
12334 next_almost_prime (24) returned 25, which is a multiple of 5 so
12335 why was the code bothering to check for multiples of 7?
12337 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12339 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12341 Variadic C functions now count arguments with ptrdiff_t.
12342 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12343 Back then I didn't know that the Emacs coding style prefers signed int.
12344 Also, in the meantime I found a few more instances where arguments
12345 were being counted with int, which may truncate counts on 64-bit
12346 machines, or EMACS_INT, which may be unnecessarily wide.
12347 * lisp.h (struct Lisp_Subr.function.aMANY)
12348 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12349 Arg counts are now ptrdiff_t, not size_t.
12350 All variadic functions and their callers changed accordingly.
12351 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12352 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12353 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12354 * callint.c (Fcall_interactively): Check arg count for overflow,
12355 to avoid potential buffer overrun. Use signed char, not 'int',
12356 for 'varies' array, so that we needn't bother to check its size
12357 calculation for overflow.
12358 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12359 * eval.c (apply_lambda):
12360 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12361 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12362 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12364 * callint.c (Fcall_interactively): Don't use index var as event count.
12366 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12367 * mem-limits.h (SIZE): Remove; no longer used.
12369 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12371 Remove unnecessary casts.
12372 * xterm.c (x_term_init):
12373 * xfns.c (x_set_border_pixel):
12374 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12375 These aren't needed now that we assume ANSI C.
12377 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12378 It's more likely to cause problems (due to unsigned overflow)
12381 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12383 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12385 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12387 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12389 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12391 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12393 GLYPH_CODE_FACE returns EMACS_INT, not int.
12394 * dispextern.h (merge_faces):
12395 * xfaces.c (merge_faces):
12396 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12397 Don't assume EMACS_INT fits in int.
12399 * character.h (CHAR_VALID_P): Remove unused parameter.
12400 * fontset.c, lisp.h, xdisp.c: All uses changed.
12402 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12404 * fns.c (concat): Minor tuning based on overflow analysis.
12405 This doesn't fix any bugs. Use int to hold character, instead
12406 of constantly refetching from Emacs object. Use XFASTINT, not
12407 XINT, for value known to be a character. Don't bother comparing
12408 a single byte to 0400, as it's always less.
12410 * floatfns.c (Fexpt):
12411 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12413 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12416 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12418 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12419 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12420 incorrectly succeed when S was a string, because 4294967386 was
12421 truncated before it was used.
12423 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12424 Otherwise, an out-of-range integer could cause undefined behavior
12427 * composite.c: Use int, not EMACS_INT, for characters.
12428 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12429 EMACS_INT, for values that are known to be in character range.
12430 This doesn't fix any bugs but is the usual style inside Emacs and
12431 may generate better code on 32-bit machines.
12433 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12434 This is for reasons similar to the recent CHAR_STRING fix.
12435 * charset.c (Fencode_char): Check that character arg is actually
12436 a character. Pass an int to ENCODE_CHAR.
12437 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12438 wider than 'int', as a compile-time check to prevent future regressions
12441 * character.c (char_string): Remove unnecessary casts.
12443 Make sure a 64-bit char is never passed to CHAR_STRING.
12444 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12445 by silently ignoring the top 32 bits, allowing some values
12446 that were far too large to be valid characters.
12447 * character.h: Include <verify.h>.
12448 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12449 arguments are no wider than unsigned, as a compile-time check
12450 to prevent future regressions in this area.
12452 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12453 (Fsubst_char_in_region):
12455 * xdisp.c (decode_mode_spec_coding):
12456 Adjust to CHAR_STRING's new requirement.
12457 * editfns.c (Finsert_char, Fsubst_char_in_region):
12458 * fns.c (concat): Check that character args are actually
12459 characters. Without this test, these functions did the wrong
12460 thing with wildly out-of-range values on 64-bit hosts.
12462 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12463 These casts should not be needed on 32-bit hosts, either.
12464 * keyboard.c (read_char):
12465 * lread.c (Fload): Remove casts to unsigned.
12467 * lisp.h (UNSIGNED_CMP): New macro.
12468 This fixes comparison bugs on 64-bit hosts.
12469 (ASCII_CHAR_P): Use it.
12470 * casefiddle.c (casify_object):
12471 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
12472 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12473 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12474 * dispextern.h (FACE_FROM_ID):
12475 * keyboard.c (read_char): Use UNSIGNED_CMP.
12477 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12478 not to EMACS_INT, to avoid GCC warning.
12480 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12482 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12483 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12484 isn't needed on 32-bit machines.
12486 * buffer.c (Fgenerate_new_buffer_name):
12487 Use EMACS_INT for count, not int.
12488 (advance_to_char_boundary): Return EMACS_INT, not int.
12490 * data.c (Qcompiled_function): Now static.
12492 * window.c (window_body_lines): Now static.
12494 * image.c (gif_load): Rename local to avoid shadowing.
12496 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12497 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12498 * alloc.c (make_save_value): Integer argument is now of type
12499 ptrdiff_t, not int.
12500 (mark_object): Use ptrdiff_t, not int.
12501 * lisp.h (pD): New macro.
12502 * print.c (print_object): Use it.
12504 * alloc.c: Use EMACS_INT, not int, to count objects.
12505 (total_conses, total_markers, total_symbols, total_vector_size)
12506 (total_free_conses, total_free_markers, total_free_symbols)
12507 (total_free_floats, total_floats, total_free_intervals)
12508 (total_intervals, total_strings, total_free_strings):
12509 Now EMACS_INT, not int. All uses changed.
12510 (Fgarbage_collect): Compute overall total using a double, so that
12511 integer overflow is less likely to be a problem. Check for overflow
12512 when converting back to an integer.
12513 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12514 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12515 These were 'int' variables that could overflow on 64-bit hosts;
12516 they were never used, so remove them instead of repairing them.
12517 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
12518 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12519 Previously, this ceilinged at INT_MAX, but that doesn't work on
12521 (allocate_pseudovector): Don't use EMACS_INT when int would do.
12523 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
12524 (allocate_vectorlike): Check for ptrdiff_t overflow.
12525 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12526 when a (possibly-narrower) signed value would do just as well.
12527 We prefer using signed arithmetic, to avoid comparison confusion.
12529 * alloc.c: Catch some string size overflows that we were missing.
12530 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12531 for convenience in STRING_BYTES_MAX.
12532 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12533 The definition here is exact; the one in lisp.h was approximate.
12534 (allocate_string_data): Check for string overflow. This catches
12535 some instances we weren't catching before. Also, it catches
12536 size_t overflow on (unusual) hosts where SIZE_MAX <= min
12537 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12538 and ptrdiff_t and EMACS_INT are both 64 bits.
12540 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12541 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
12542 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
12544 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12546 * alloc.c (Fmake_string): Check for out-of-range init.
12548 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12550 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12552 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12554 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12555 xg_get_default_scrollbar_width.
12557 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12558 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12559 (style_changed_cb): Call update_theme_scrollbar_width and call
12560 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12561 all frames (Bug#8505).
12562 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12563 Call gtk_window_set_resizable if HAVE_GTK3.
12564 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12565 and height if HAVE_GTK3 (Bug#8505).
12566 (scroll_bar_width_for_theme): New variable.
12567 (update_theme_scrollbar_width): New function.
12568 (xg_get_default_scrollbar_width): Move code to
12569 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12570 (xg_initialize): Call update_theme_scrollbar_width.
12572 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12574 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12576 2011-06-12 Martin Rudalics <rudalics@gmx.at>
12578 * frame.c (make_frame): Call other_buffer_safely instead of
12581 * window.c (temp_output_buffer_show): Call display_buffer with
12582 second argument Vtemp_buffer_show_specifiers and reset latter
12583 immediately after the call.
12584 (Vtemp_buffer_show_specifiers): New variable.
12585 (auto_window_vscroll_p, next_screen_context_lines)
12586 (Vscroll_preserve_screen_position): Remove leading asterisks from
12589 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
12591 Fix minor problems found by GCC 4.6.0 static checking.
12592 * buffer.c (Qclone_number): Remove for now, as it's unused.
12593 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12594 (record_buffer): Remove unused local.
12595 * frame.c (other_visible_frames, frame_buffer_list): Now static.
12596 (set_frame_buffer_list): Remove; unused.
12597 * frame.h (other_visible_frames): Remove decl.
12598 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12599 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12600 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12602 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12603 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12604 Define only if HAVE_GPM.
12605 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12606 (update_hints_inhibit): Remove; never set. All uses removed.
12607 * widgetprv.h (emacsFrameClassRec): Remove decl.
12608 * window.c (delete_deletable_window): Now returns void, since it
12609 wasn't returning anything.
12610 (compare_window_configurations): Remove unused locals.
12611 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12612 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
12613 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
12614 the same widths as pointers. This follows up on the 2011-05-06 patch.
12615 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
12616 * xterm.h: Likewise.
12617 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
12619 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
12621 * makefile.w32-in: Update dependencies.
12622 (LISP_H): Add lib/intprops.h.
12624 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12626 * image.c (gif_load): Add animation frame delay to the metadata.
12627 (syms_of_image): Use DEFSYM. New symbol `delay'.
12629 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12631 * window.c (delete_deletable_window): Re-add.
12632 (Fset_window_configuration): Rewrite to handle dead buffers and
12633 consequently deletable windows.
12634 (window_tree, Fwindow_tree): Remove. Supply functionality in
12636 (compare_window_configurations): Simplify code.
12638 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12640 * image.c (imagemagick_load_image): Fix type mismatch.
12641 (Fimagemagick_types): Likewise.
12643 * window.h (replace_buffer_in_windows): Declare.
12645 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12647 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12648 Qclone_number. Remove external declaration of Qdelete_window.
12649 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
12651 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12652 Run Qbuffer_list_update_hook if allowed.
12653 (Fother_buffer): Rewrite doc-string. Major rewrite for new
12654 buffer list implementation.
12655 (other_buffer_safely): New function.
12656 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12657 calls to replace_buffer_in_windows and
12658 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
12660 (record_buffer): Inhibit quitting and rewrite using quittable
12661 functions. Run Qbuffer_list_update_hook if allowed.
12662 (Frecord_buffer, Funrecord_buffer): New functions.
12663 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12664 Move switch-to-buffer to window.el.
12665 (bury-buffer): Move to window.el.
12666 (Vbuffer_list_update_hook): New variable.
12668 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12671 * window.h (resize_frame_windows): Move up in code.
12672 (Fwindow_frame): Remove EXFUN.
12673 (replace_buffer_in_all_windows): Remove prototype.
12674 (replace_buffer_in_windows_safely): Add prototype.
12676 * window.c: Declare Qdelete_window static again. Move down
12677 declaration of select_count.
12678 (Fnext_window, Fprevious_window): Rewrite doc-strings.
12679 (Fother_window): Move to window.el.
12680 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12681 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12682 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12684 (replace_buffer_in_windows): Implement by calling
12685 Qreplace_buffer_in_windows.
12686 (replace_buffer_in_all_windows): Remove with some functionality
12687 moved into replace_buffer_in_windows_safely.
12688 (replace_buffer_in_windows_safely): New function.
12689 (select_window_norecord, select_frame_norecord): Move in front
12690 of run_window_configuration_change_hook. Remove now obsolete
12692 (Fset_window_buffer): Rewrite doc-string.
12693 Call Qrecord_window_buffer.
12694 (keys_of_window): Move binding for other-window to window.el.
12696 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12698 * dispextern.h (struct image): Replace data member, whose int_val
12699 and ptr_val fields were not used by anything, with a single
12702 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12703 (gif_clear_image, gif_load, imagemagick_load_image)
12704 (gs_clear_image, gs_load): Callers changed.
12706 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12708 * buffer.h: Include <time.h>, for time_t.
12709 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12711 Fix minor problems found by static checking.
12713 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12715 Make identifiers static if they are not used in other modules.
12716 * data.c (Qcompiled_function, Qframe, Qvector):
12717 * image.c (QimageMagick, Qsvg):
12718 * minibuf.c (Qmetadata):
12719 * window.c (resize_window_check, resize_root_window): Now static.
12720 * window.h (resize_window_check, resize_root_window): Remove decls.
12722 * window.c (window_deletion_count, delete_deletable_window):
12724 (window_body_lines): Now static.
12725 (Fdelete_other_windows_internal): Mark vars as initialized.
12726 Make sure 'resize_failed' is initialized.
12727 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12728 (resize_window_apply): Remove unused local.
12729 * window.h (delete_deletable_window): Remove decl.
12731 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
12732 (imagemagick_load_image): Fix pointer signedness problem by changing
12733 last arg from unsigned char * to char *. All uses changed.
12734 Also, fix a local for similar reasons.
12735 Remove unused locals. Remove locals to avoid shadowing.
12736 (fn_rsvg_handle_free): Remove; unused.
12737 (svg_load, svg_load_image): Fix pointer signedness problem.
12738 (imagemagick_load_image): Don't use garbage pointer image_wand.
12740 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12742 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
12744 * image.c (gif_load): Fix omitted cast error introduced by
12747 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12749 * window.h (resize_proportionally, orig_total_lines)
12750 (orig_top_line): Remove from window structure.
12751 (set_window_height, set_window_width, change_window_heights)
12752 (Fdelete_window): Remove prototypes.
12753 (resize_frame_windows): Remove duplicate declaration.
12755 2011-06-10 Eli Zaretskii <eliz@gnu.org>
12757 * window.h (resize_frame_windows, resize_window_check)
12758 (delete_deletable_window, resize_root_window)
12759 (resize_frame_windows): Declare prototypes.
12761 * window.c (resize_window_apply): Make definition be "static" to
12762 match the prototype.
12764 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12766 * window.c: Remove declarations of Qwindow_size_fixed,
12767 window_min_size_1, window_min_size_2, window_min_size,
12768 size_window, window_fixed_size_p, enlarge_window, delete_window.
12769 Remove static from declaration of Qdelete_window, it's
12770 temporarily needed by Fbury_buffer.
12771 (replace_window): Don't assign orig_top_line and
12773 (Fdelete_window, delete_window): Remove. Window deletion is
12774 handled by window.el.
12775 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12776 Replace Fdelete_window calls with calls to Qdelete_window.
12777 (Fdelete_other_windows): Remove. Deleting other windows is
12778 handled by window.el.
12779 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12780 handled in window.el.
12781 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12782 Window minimum sizes are handled in window.el.
12783 (shrink_windows, size_window, set_window_height)
12784 (set_window_width, change_window_heights, window_height)
12785 (window_width, CURBEG, CURSIZE, enlarge_window)
12786 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12787 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12788 handled in window.el.
12789 (make_dummy_parent): Rename to make_parent_window and give it a
12790 second argument horflag.
12791 (make_window): Don't set resize_proportionally any more.
12792 (Fsplit_window): Remove. Windows are split in window.el.
12793 (save_restore_action, save_restore_orig_size)
12794 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12795 Resize mini windows in window.el.
12796 (grow_mini_window, shrink_mini_window): Implement by calling
12797 Qresize_root_window_vertically, resize_window_check and
12798 resize_window_apply.
12799 (saved_window, Fset_window_configuration, save_window_save):
12800 Do not handle orig_top_line, orig_total_lines, and
12801 resize_proportionally.
12802 (window_min_height, window_min_width): Move to window.el.
12803 (keys_of_window): Move bindings for delete-other-windows,
12804 split-window, delete-window and enlarge-window to window.el.
12806 * buffer.c: Temporarily extern Qdelete_window.
12807 (Fbury_buffer): Temporarily call Qdelete_window instead of
12808 Fdelete_window (Fbury_buffer will move to window.el soon).
12810 * frame.c (set_menu_bar_lines_1): Remove code handling
12811 orig_top_line and orig_total_lines.
12813 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12814 set_window_height but set heights directly.
12815 (change_frame_size_1): Use resize_frame_windows.
12817 * xdisp.c (init_xdisp): Don't use set_window_height but set
12820 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12821 Use resize_frame_windows instead of change_window_heights and run
12822 run_window_configuration_change_hook.
12824 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12825 instead of change_window_heights and run
12826 run_window_configuration_change_hook.
12828 2011-06-09 Martin Rudalics <rudalics@gmx.at>
12830 * window.c (replace_window): Rename second argument REPLACEMENT to
12831 NEW. New third argument SETFLAG. Rewrite.
12832 (delete_window, make_dummy_parent): Call replace_window with
12834 (window_list_1): Move down in code.
12835 (run_window_configuration_change_hook): Move set_buffer part
12836 before select_frame_norecord part in order to unwind correctly.
12837 Rename count1 to count.
12838 (recombine_windows, delete_deletable_window, resize_root_window)
12839 (Fdelete_other_windows_internal)
12840 (Frun_window_configuration_change_hook, make_parent_window)
12841 (resize_window_check, resize_window_apply, Fresize_window_apply)
12842 (resize_frame_windows, Fsplit_window_internal)
12843 (Fdelete_window_internal, Fresize_mini_window_internal):
12845 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12847 2011-06-08 Martin Rudalics <rudalics@gmx.at>
12849 * window.h (window): Add some new members to window structure -
12850 normal_lines, normal_cols, new_total, new_normal, clone_number,
12851 splits, nest, prev_buffers, next_buffers.
12852 (WINDOW_TOTAL_SIZE): Move here from window.c.
12853 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
12855 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12857 (make_dummy_parent): Set new members of windows structure.
12858 (make_window): Move down in code. Handle new members of window
12860 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12861 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12862 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12863 (Fset_window_prev_buffers, Fwindow_next_buffers)
12864 (Fset_window_next_buffers, Fset_window_clone_number):
12866 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12867 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12869 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12870 Argument WINDOW can be now internal window too.
12871 (Fwindow_use_time): Move up in code.
12872 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12873 Rewrite doc-string.
12874 (Fset_window_configuration, saved_window)
12875 (Fcurrent_window_configuration, save_window_save): Handle new
12876 members of window structure.
12877 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12878 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12879 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12880 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12881 Qget_mru_window, Qresize_root_window,
12882 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12883 Qauto_buffer_name; staticpro them.
12885 2011-06-07 Martin Rudalics <rudalics@gmx.at>
12887 * window.c (Fwindow_total_size, Fwindow_left_column)
12888 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12889 (Fwindow_list_1): New functions.
12890 (window_box_text_cols): Replace with window_body_cols.
12891 (Fwindow_width, Fscroll_left, Fscroll_right):
12892 Use window_body_cols instead of window_box_text_cols.
12893 (delete_window, Fset_window_configuration):
12894 Call delete_all_subwindows with window as argument.
12895 (delete_all_subwindows): Take a window as argument and not a
12896 structure. Rewrite.
12897 (window_loop): Remove handling of GET_LRU_WINDOW and
12898 GET_LARGEST_WINDOW.
12899 (Fget_lru_window, Fget_largest_window): Move to window.el.
12901 * window.h: Extern window_body_cols instead of
12902 window_box_text_cols. delete_all_subwindows now takes a
12903 Lisp_Object as argument.
12905 * indent.c (compute_motion, Fcompute_motion):
12906 Use window_body_cols instead of window_box_text_cols.
12908 * frame.c (delete_frame): Call delete_all_subwindows with root
12909 window as argument.
12911 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12913 * fns.c (Fputhash): Document return value.
12915 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
12917 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12919 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12921 Cons<->int and similar integer overflow fixes (Bug#8794).
12923 Check for overflow when converting integer to cons and back.
12924 * charset.c (Fdefine_charset_internal, Fdecode_char):
12925 Use cons_to_unsigned to catch overflow.
12926 (Fencode_char): Use INTEGER_TO_CONS.
12927 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12928 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12929 * data.c (long_to_cons, cons_to_long): Remove.
12930 (cons_to_unsigned, cons_to_signed): New functions.
12931 These signal an error for invalid or out-of-range values.
12932 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12933 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12934 * font.c (Ffont_variation_glyphs):
12935 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12936 * lisp.h: Include <intprops.h>.
12937 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12938 (cons_to_signed, cons_to_unsigned): New decls.
12939 (long_to_cons, cons_to_long): Remove decls.
12940 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12941 (Fprimitive_undo): Use CONS_TO_INTEGER.
12942 * xfns.c (Fx_window_property): Likewise.
12943 * xselect.c: Include <limits.h>.
12944 (x_own_selection, selection_data_to_lisp_data):
12945 Use INTEGER_TO_CONS.
12946 (x_handle_selection_request, x_handle_selection_clear)
12947 (x_get_foreign_selection, Fx_disown_selection_internal)
12948 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12949 (lisp_data_to_selection_data): Use cons_to_unsigned.
12950 (x_fill_property_data): Use cons_to_signed.
12951 Report values out of range.
12953 Check for buffer and string overflow more precisely.
12954 * buffer.h (BUF_BYTES_MAX): New macro.
12955 * lisp.h (STRING_BYTES_MAX): New macro.
12956 * alloc.c (Fmake_string):
12957 * character.c (string_escape_byte8):
12958 * coding.c (coding_alloc_by_realloc):
12959 * doprnt.c (doprnt):
12960 * editfns.c (Fformat):
12962 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12963 since they may not be the same number.
12964 * editfns.c (Finsert_char):
12965 * fileio.c (Finsert_file_contents):
12966 Likewise for BUF_BYTES_MAX.
12968 * image.c: Use ptrdiff_t, not int, for sizes.
12969 (slurp_file): Switch from int to ptrdiff_t.
12971 (slurp_file): Check that file size fits in both size_t (for
12972 malloc) and ptrdiff_t (for sanity and safety).
12974 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12975 if b->modtime has its maximal value.
12977 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12979 Don't assume time_t can fit into int.
12980 * buffer.h (struct buffer.modtime): Now time_t, not int.
12981 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12982 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12984 Minor fixes for signed vs unsigned integers.
12985 * character.h (MAYBE_UNIFY_CHAR):
12986 * charset.c (maybe_unify_char):
12987 * keyboard.c (read_char, reorder_modifiers):
12988 XINT -> XFASTINT, since the integer must be nonnegative.
12989 * ftfont.c (ftfont_spec_pattern):
12990 * keymap.c (access_keymap, silly_event_symbol_error):
12991 XUINT -> XFASTINT, since the integer must be nonnegative.
12992 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12993 since it makes no difference and we prefer signed.
12994 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12995 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12998 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13000 * window.h (Fwindow_frame): Declare.
13002 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13004 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13005 (SPARE_MEMORY): Always define.
13006 (LARGE_REQUEST): Remove.
13007 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13009 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13011 * lisp.h: Move EXFUNS for Fframe_root_window,
13012 Fframe_first_window and Fset_frame_selected_window to window.h.
13014 * window.h: Move EXFUNS for Fframe_root_window,
13015 Fframe_first_window and Fset_frame_selected_window here from
13018 * frame.c (Fwindow_frame, Fframe_first_window)
13019 (Fframe_root_window, Fframe_selected_window)
13020 (Fset_frame_selected_window): Move to window.c.
13021 (Factive_minibuffer_window): Move to minibuf.c.
13022 (Fother_visible_frames_p): New function.
13024 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13026 * window.c (decode_window, decode_any_window): Move up in code.
13027 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13028 (inhibit_frame_unsplittable): Remove unused variable.
13029 (Fwindow_buffer): Move up and rewrite doc-string.
13030 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13031 (Fwindow_prev): New functions.
13032 (Fwindow_frame): Move here from frame.c. Accept any window as
13034 (Fframe_root_window, Fframe_first_window)
13035 (Fframe_selected_window): Move here from frame.c. Accept frame
13036 or arbitrary window as argument. Update doc-strings.
13037 (Fminibuffer_window): Move up in code.
13038 (Fwindow_minibuffer_p): Move up in code and simplify.
13039 (Fset_frame_selected_window): Move here from frame.c.
13041 (Fselected_window, select_window, Fselect_window): Move up in
13042 code. Minor doc-string fixes.
13044 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13046 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13047 Do not assume that spare memory exists; that assumption is valid
13048 only if SYSTEM_MALLOC.
13049 (LARGE_REQUEST): New macro, so that the issue of large requests
13050 is separated from the issue of spare memory.
13052 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13054 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13057 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13059 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13062 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13064 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13066 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13068 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13069 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13071 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13073 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13075 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13077 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13078 (x_clipboard_manager_save): Add return value.
13079 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13080 New error handlers.
13081 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13082 Obey Vx_select_enable_clipboard_manager. Catch errors in
13083 x_clipboard_manager_save (Bug#8779).
13084 (Vx_select_enable_clipboard_manager): New variable.
13085 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13087 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13089 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13091 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13093 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13094 in the current matrix if keep_current_p is non-zero.
13096 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13098 * bidi.c (bidi_level_of_next_char): Fix last change.
13100 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13102 Support bidi reordering of text covered by display properties.
13104 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13105 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13106 (bidi_cache_search, bidi_cache_iterator_state)
13107 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13108 (bidi_level_of_next_char, bidi_move_to_visually_next):
13109 Support character positions inside a run of characters covered by a
13111 (bidi_paragraph_init, bidi_resolve_explicit_1)
13112 (bidi_level_of_next_char): Call bidi_fetch_char and
13113 bidi_fetch_char_advance instead of FETCH_CHAR and
13114 FETCH_CHAR_ADVANCE.
13115 (bidi_init_it): Initialize new members.
13116 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13118 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13119 instead of using explicit *_CHAR codes.
13120 (bidi_resolve_explicit, bidi_resolve_weak):
13121 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13122 bidirectional text is supported only in multibyte buffers.
13123 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13124 it to initialize the frame_window_p member of struct bidi_it.
13125 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13126 (bidi_resolve_explicit, bidi_resolve_weak)
13127 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13128 bidi_it->nchars is non-positive.
13129 (bidi_level_of_next_char): Don't try to lookup the cache for the
13130 next/previous character if nothing is cached there yet, or if we
13131 were just reseat()'ed to a new position.
13133 * xdisp.c (set_cursor_from_row): Set start and stop points
13134 according to the row's direction when priming the loop that looks
13135 for the glyph on which to display cursor.
13136 (single_display_spec_intangible_p): Function deleted.
13137 (display_prop_intangible_p): Reimplement to call
13138 handle_display_spec instead of single_display_spec_intangible_p.
13139 Accept 3 additional arguments needed by handle_display_spec.
13140 This fixes incorrect cursor motion across display property with complex
13141 values: lists, `(when COND...)' forms, etc.
13142 (single_display_spec_string_p): Support property values that are
13143 lists with the argument STRING its top-level element.
13144 (display_prop_string_p): Fix the condition for processing a
13145 property that is a list to be consistent with handle_display_spec.
13146 (handle_display_spec): New function, refactored from the
13147 last portion of handle_display_prop.
13148 (compute_display_string_pos): Accept additional argument
13149 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13150 value of a `display' property is a "replacing spec".
13151 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13152 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13153 the display property, but just return a value indicating whether
13154 the display property will replace the characters it covers.
13155 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13156 frame_window_p members of struct bidi_it.
13157 (compute_display_string_pos, compute_display_string_end):
13159 (push_it): Accept second argument POSITION, where pop_it should
13160 jump to continue iteration.
13161 (reseat_1): Initialize bidi_it.disp_pos.
13163 * keyboard.c (adjust_point_for_property): Adjust the call to
13164 display_prop_intangible_p to its new signature.
13166 * dispextern.h (struct bidi_it): New member frame_window_p.
13167 (bidi_init_it): Update prototypes.
13168 (display_prop_intangible_p): Update prototype.
13169 (compute_display_string_pos, compute_display_string_end):
13170 Declare prototypes.
13171 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13174 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13176 Malloc failure behavior now depends on size of allocation.
13177 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13178 * lisp.h: Change signatures accordingly.
13179 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13180 All callers changed. (Bug#8762)
13182 * gnutls.c: Use Emacs's memory allocators.
13183 Without this change, the gnutls library would invoke malloc etc.
13184 directly, which causes problems on non-SYNC_INPUT hosts, and which
13185 runs afoul of improving memory_full behavior. (Bug#8761)
13186 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13187 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13188 xfree instead of the default malloc, realloc, free.
13189 (Fgnutls_boot): No need to check for memory allocation failure,
13190 since xmalloc does that for us.
13192 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13193 * category.c (hash_get_category_set):
13194 * ccl.c (ccl_driver):
13195 * charset.c (Fdefine_charset_internal):
13196 * charset.h (struct charset.hash_index):
13197 * composite.c (get_composition_id, gstring_lookup_cache)
13198 (composition_gstring_put_cache):
13199 * composite.h (struct composition.hash_index):
13200 * dispextern.h (struct image.hash):
13201 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13202 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13203 (hashfn_equal, hashfn_user_defined, make_hash_table)
13204 (maybe_resize_hash_table, hash_lookup, hash_put)
13205 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13206 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13207 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13208 * image.c (make_image, search_image_cache, lookup_image)
13209 (xpm_put_color_table_h):
13210 * lisp.h (struct Lisp_Hash_Table):
13211 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13212 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13213 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13214 * alloc.c (allocate_vectorlike):
13215 Check for overflow in vector size calculations.
13216 * ccl.c (ccl_driver):
13217 Check for overflow when converting EMACS_INT to int.
13218 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13219 need to be updated by these changes.
13220 * fns.c (make_hash_table, maybe_resize_hash_table):
13221 Check for integer overflow with large hash tables.
13222 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13223 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13224 (SXHASH_REDUCE): New macro.
13225 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13226 Use it instead of discarding useful hash info with large hash values.
13227 (sxhash_float): New function.
13228 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13229 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13230 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13231 Rewrite to use FIXNUM_BITS, as this simplifies things.
13232 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13233 Adjust signatures to match updated version of code.
13234 (consing_since_gc): Now EMACS_INT, since a single hash table can
13235 use more than INT_MAX bytes.
13237 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13239 Make it possible to build with GCC-4.6+ -O2 -flto.
13241 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13243 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13245 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13246 Call minibuffer-inactive-mode.
13248 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13250 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13251 Update dependencies.
13253 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13255 * data.c (init_data): Remove code for UTS, this system is not
13258 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13260 Don't force ./temacs to start in terminal mode.
13262 * frame.c (make_initial_frame): Initialize faces in all cases, not
13263 only when CANNOT_DUMP is defined.
13264 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13266 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13268 * dispnew.c (add_window_display_history): Use const for the string
13269 pointer. Remove declaration, not needed.
13271 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13273 Use 'inline', not 'INLINE'.
13274 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13275 * alloc.c, fontset.c (INLINE): Remove.
13276 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13277 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13278 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13279 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13280 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13282 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13284 Make it possible to run ./temacs.
13286 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13287 syms_of_callproc does the same thing. Remove test for
13288 "initialized", do it in the caller.
13289 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13291 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13293 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13294 (read_minibuf): Use get_minibuffer.
13295 (syms_of_minibuf): Use DEFSYM.
13296 (Qmetadata): New var.
13297 * data.c (Qbuffer): Don't make it static.
13298 (syms_of_data): Use DEFSYM.
13300 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13302 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13303 (CCL_CODE_MIN): New macro.
13305 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13307 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13309 * eval.c (Qdebug): Now static.
13310 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13311 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13312 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13314 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13316 * image.c: Various fixes to ImageMagick code comments.
13317 (Fimagemagick_types): Doc fix.
13319 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13321 Minor fixes prompted by GCC 4.6.0 warnings.
13323 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13325 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13326 (x_clipboard_manager_save_all): Move extern decl to ...
13327 * xterm.h: ... here, so that it can be checked for consistency.
13329 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13331 * xselect.c (x_clipboard_manager_save_frame)
13332 (x_clipboard_manager_save_all): New functions.
13333 (Fx_clipboard_manager_save): Lisp function deleted.
13335 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13336 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13338 * xterm.h: Update prototype.
13340 2011-05-28 William Xu <william.xwl@gmail.com>
13342 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13343 exiting (Bug#8239).
13345 2011-05-28 Jim Meyering <meyering@redhat.com>
13347 Avoid a sign-extension bug in crypto_hash_function.
13348 * fns.c (to_uchar): Define.
13349 (crypto_hash_function): Use it to convert some newly-signed
13350 variables to unsigned, to avoid sign-extension bugs. For example,
13351 without this change, (md5 "truc") would evaluate to
13352 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13353 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13354 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13356 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13358 Integer overflow fixes.
13360 * dbusbind.c: Serial number integer overflow fixes.
13361 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13362 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13363 to hold a serial number that is too large for a fixnum.
13364 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13365 Check for serial numbers out of range. Decode any serial number
13366 that was so large that it became a float. (Bug#8722)
13368 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13369 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13370 Use XFASTINT rather than XUINT when numbers are nonnegative.
13371 (xd_append_arg, Fdbus_method_return_internal):
13372 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13373 arguments, check that Lisp number is nonnegative, rather than
13374 silently wrapping negative numbers around. (Bug#8722)
13375 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13378 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13380 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13382 ccl: Add integer overflow checks.
13383 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13384 (IN_INT_RANGE): New macros.
13385 (ccl_driver): Use them to check for integer overflow when
13386 decoding a CCL program. Many of the new checks are whether XINT (x)
13387 fits in int; it doesn't always, on 64-bit hosts. The new version
13388 doesn't catch all possible integer overflows, but it's an
13389 improvement. (Bug#8719)
13391 * alloc.c (make_event_array): Use XINT, not XUINT.
13392 There's no need for unsigned here.
13394 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13395 This follows up to the 2011-05-06 change that substituted uintptr_t
13396 for EMACS_INT. This case wasn't caught back then.
13398 Rework Fformat to avoid integer overflow issues.
13399 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13400 now (part of C89). Include <verify.h>.
13401 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13402 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13403 (Fformat): Avoid the prepass trying to compute sizes; it was only
13404 approximate and thus did not catch overflow reliably. Instead, walk
13405 through the format just once, formatting and computing sizes as we go,
13406 checking for integer overflow at every step, and allocating a larger
13407 buffer as needed. Keep track separately whether the format is
13408 multibyte. Keep only the most-recently calculated precision, rather
13409 than them all. Record whether each argument has been converted to
13410 string. Use EMACS_INT, not int, for byte and char and arg counts.
13411 Support field widths and precisions larger than INT_MAX. Avoid
13412 sprintf's undefined behavior with conversion specifications such as %#d
13413 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13414 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13415 formatting out-of-range floating point numbers with int
13416 formats. (Bug#8668)
13418 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13420 * data.c: Avoid integer truncation in expressions involving floats.
13421 * data.c: Include <intprops.h>.
13422 (arith_driver): When there's an integer overflow in an expression
13423 involving floating point, convert the integers to floating point
13424 so that the resulting value does not suffer from catastrophic
13425 integer truncation. For example, on a 64-bit host (* 4
13426 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13427 Do not rely on undefined behavior after integer overflow.
13429 merge count_size_as_multibyte, parse_str_to_multibyte
13430 * character.c, character.h (count_size_as_multibyte):
13431 Rename from parse_str_to_multibyte; all uses changed.
13432 Check for integer overflow.
13433 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13434 since it's now a duplicate of the other. This is more of
13435 a character than a buffer op, so better that it's in character.c.
13436 * fns.c, print.c: Adjust to above changes.
13438 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13440 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13442 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13444 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13445 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13446 (x_clipboard_manager_save): Now static.
13447 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13449 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13450 (crypto_hash_function): Now static.
13451 Fix pointer signedness problems. Avoid unnecessary initializations.
13453 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
13455 * termhooks.h (Vselection_alist): Make it terminal-local.
13457 * terminal.c (create_terminal): Initialize it.
13459 * xselect.c: Support for clipboard managers.
13460 (Vselection_alist): Move to termhooks.h as terminal-local var.
13461 (LOCAL_SELECTION): New macro.
13462 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13463 (symbol_to_x_atom): Remove gratuitous arg.
13464 (x_handle_selection_request, lisp_data_to_selection_data)
13465 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
13466 (x_own_selection, x_get_local_selection, x_convert_selection):
13467 New arg, specifying work frame. Use terminal-local Vselection_alist.
13468 (some_frame_on_display): Delete unused function.
13469 (Fx_own_selection_internal, Fx_get_selection_internal)
13470 (Fx_disown_selection_internal, Fx_selection_owner_p)
13471 (Fx_selection_exists_p): New optional frame arg.
13472 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13473 (x_handle_selection_clear): Don't treat other terminals with the
13474 same keyboard specially. Use the terminal-local Vselection_alist.
13475 (x_clear_frame_selections): Use Frun_hook_with_args.
13477 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13479 * xterm.h: Add support for those atoms.
13481 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
13483 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13484 (converted_selections, conversion_fail_tag): New global variables.
13485 (x_selection_request_lisp_error): Free the above.
13486 (x_get_local_selection): Remove unnecessary code.
13487 (x_reply_selection_request): Args changed; handle arbitrary array
13488 of converted selections stored in converted_selections.
13489 Separate the XChangeProperty and SelectionNotify steps.
13490 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13491 (x_convert_selection): New function.
13492 (x_handle_selection_event): Simplify.
13493 (x_get_foreign_selection): Don't ignore incoming requests while
13494 waiting for an answer; this will fail when we implement
13495 SAVE_TARGETS, and seems unnecessary anyway.
13496 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13497 (Vx_sent_selection_functions): Doc fix.
13499 2011-05-26 Leo Liu <sdl.web@gmail.com>
13501 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13503 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13505 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13507 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13508 for fringe update if it has periodic bitmap.
13509 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
13510 and fringe_bitmap_periodic_p.
13512 * fringe.c (get_fringe_bitmap_data): New function.
13513 (draw_fringe_bitmap_1, update_window_fringes): Use it.
13514 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13515 row. Mark glyph row for fringe update if periodicity changed.
13517 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13518 for fringe update unless it has periodic bitmap.
13520 2011-05-25 Kenichi Handa <handa@m17n.org>
13522 * xdisp.c (get_next_display_element): Set correct it->face_id for
13523 a static composition.
13525 2011-05-24 Leo Liu <sdl.web@gmail.com>
13528 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13530 * fns.c (crypto_hash_function, Fsha1): New function.
13531 (Fmd5): Use crypto_hash_function.
13532 (syms_of_fns): Add Ssha1.
13534 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13536 * gnutls.c: Remove unused macros.
13537 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13538 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13539 Remove macros that are defined and never used.
13540 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13542 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13544 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13545 (Fx_get_selection_internal): Minor cleanup.
13546 (Fx_own_selection_internal): Rename arguments for consistency with
13549 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13551 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13553 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13555 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13557 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13559 * dispnew.c (scrolling_window): Don't exclude the case that the
13560 last enabled row in the desired matrix touches the bottom boundary.
13562 2011-05-21 Glenn Morris <rgm@gnu.org>
13564 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
13565 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13566 and add some more files.
13568 2011-05-20 Eli Zaretskii <eliz@gnu.org>
13570 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13571 report_file_error introduced by the change from 2011-05-07.
13573 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13575 * systime.h (Time): Define only if emacs is defined.
13576 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13577 where the include path doesn't have X11/X.h by default. See
13578 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13580 2011-05-20 Kenichi Handa <handa@m17n.org>
13582 * composite.c (find_automatic_composition): Fix previous change.
13584 2011-05-20 Glenn Morris <rgm@gnu.org>
13586 * lisp.mk: New file, split from Makefile.in.
13587 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13588 (shortlisp): Remove.
13589 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13591 2011-05-19 Glenn Morris <rgm@gnu.org>
13593 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13594 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13595 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13596 (lisp): Set the order to that of loadup.el.
13597 (shortlisp): Make it a copy of $lisp.
13598 (SOME_MACHINE_LISP): Remove.
13599 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13600 Use just $shortlisp, not $SOME_MACHINE_LISP too.
13602 2011-05-18 Kenichi Handa <handa@m17n.org>
13604 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13605 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13606 (find_automatic_composition): Mostly rewrite for efficiency.
13608 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
13610 * makefile.w32-in: Update dependencies.
13612 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13614 * menu.c: Include limits.h (fixes the MS-Windows build broken by
13615 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
13617 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
13619 Fix some integer overflow issues, such as string length overflow.
13621 * insdel.c (count_size_as_multibyte): Check for string overflow.
13623 * character.c (lisp_string_width): Check for string overflow.
13624 Use EMACS_INT, not int, for string indexes and lengths; in
13625 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
13626 the resulting string length overflows an EMACS_INT; instead,
13627 report a string overflow if no precision given. When checking for
13628 precision exhaustion, use a check that cannot possibly have
13629 integer overflow. (Bug#8675)
13630 * character.h (lisp_string_width): Adjust to new signature.
13632 * alloc.c (string_overflow): New function.
13633 (Fmake_string): Use it. This doesn't change behavior, but saves
13634 a few bytes and will simplify future changes.
13635 * character.c (string_escape_byte8): Likewise.
13636 * lisp.h (string_overflow): New decl.
13638 Fixups, following up to the user-interface timestamp change.
13639 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13640 for UI timestamps, instead of unsigned long.
13641 * msdos.c (mouse_get_pos): Likewise.
13642 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
13643 * w32gui.h (Time): Define by including "systime.h" rather than by
13644 declaring it ourselves. (Bug#8664)
13646 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13647 * image.c (clear_image_cache): Likewise.
13649 * term.c (term_mouse_position): Don't assume time_t wraparound.
13651 Be more systematic about user-interface timestamps.
13652 Before, the code sometimes used 'Time', sometimes 'unsigned long',
13653 and sometimes 'EMACS_UINT', to represent these timestamps.
13654 This change causes it to use 'Time' uniformly, as that's what X uses.
13655 This makes the code easier to follow, and makes it easier to catch
13656 integer overflow bugs such as Bug#8664.
13657 * frame.c (Fmouse_position, Fmouse_pixel_position):
13658 Use Time, not unsigned long, for user-interface timestamps.
13659 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13660 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13661 * keyboard.h (last_event_timestamp): Likewise.
13662 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13663 * menu.h (xmenu_show): Likewise.
13664 * term.c (term_mouse_position): Likewise.
13665 * termhooks.h (struct input_event.timestamp): Likewise.
13666 (struct terminal.mouse_position_hook): Likewise.
13667 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13668 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13669 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
13670 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13671 what it was before.
13672 * menu.h, termhooks.h: Include "systime.h", for Time.
13674 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13675 Don't assume that the difference between two unsigned long values
13676 can fit into an integer. At this point, we know button_down_time
13677 <= event->timestamp, so the difference must be nonnegative, so
13678 there's no need to cast the result if double-click-time is
13679 nonnegative, as it should be; check that it's nonnegative, just in
13680 case. This bug is triggered when events are more than 2**31 ms
13681 apart (about 25 days). (Bug#8664)
13683 * xselect.c (last_event_timestamp): Remove duplicate decl.
13684 (x_own_selection): Remove needless cast to unsigned long.
13686 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13687 that always fit in int. Use a sentinel instead of a counter, to
13688 avoid a temp and to allay GCC's concerns about possible int overflow.
13689 * frame.h (struct frame): Use int for menu_bar_items_used
13690 instead of EMACS_INT, since it always fits in int.
13692 * menu.c (grow_menu_items): Check for int overflow.
13694 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13696 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13697 Before, the code was not consistent. These values cannot exceed
13698 2**31 - 1 so there's no need to make them unsigned.
13699 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13700 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13701 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13703 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13705 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13706 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13707 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13708 presumably because the widths might not match.
13710 * window.c (size_window): Avoid needless test at loop start.
13712 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13714 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13716 2011-05-12 Drew Adams <drew.adams@oracle.com>
13718 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13720 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13722 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13723 `width' to `bar_area_x' and `bar_area_width', respectively.
13724 (x_scroll_run): Take account of fringe background extension.
13726 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13727 Rename local vars `left' and `width' to `bar_area_x' and
13728 `bar_area_width', respectively.
13729 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13730 background extension.
13732 2011-05-10 Jim Meyering <meyering@redhat.com>
13734 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13736 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
13738 * image.c (Finit_image_library): Return t for built-in image types,
13739 like pbm and xbm. (Bug#8640)
13741 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13743 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13745 2011-05-07 Eli Zaretskii <eliz@gnu.org>
13747 * w32console.c (Fset_screen_color): Doc fix.
13748 (Fget_screen_color): New function.
13749 (syms_of_ntterm): Defsubr it.
13751 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13752 unlink the temporary file if Fcall_process didn't create it in the
13754 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13755 child process will be redirected to a file specified with `:file'.
13756 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13757 cue to call_process_cleanup not to close that handle.
13759 2011-05-07 Ben Key <bkey76@gmail.com>
13761 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13762 one of two shell specific rules, either bootstrap-temacs-CMD or
13763 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13764 to the previous implementation of the bootstrap-temacs rule.
13765 The bootstrap-temacs-CMD rule is similar to the previous
13766 implementation of the bootstrap-temacs rule except that it
13767 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13770 These changes, along with some changes to nt/configure.bat,
13771 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13772 earlier fix to add support for --cflags and --ldflags options
13773 that include quotes so that it works whether make uses cmd or
13776 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
13778 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13779 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13781 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13782 a string. Handle both cases.
13783 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13784 (Fdbus_register_method): Use Qinvalid_function.
13786 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13788 * makefile.w32-in: Update dependencies.
13789 (LISP_H): Add inttypes.h and stdin.h.
13790 (PROCESS_H): Add unistd.h.
13792 2011-05-06 Eli Zaretskii <eliz@gnu.org>
13794 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13795 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13797 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
13799 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13801 * term.c (vfatal): Remove stray call to va_end.
13802 It's not needed and the C Standard doesn't allow it here anyway.
13804 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13805 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13807 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13810 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13812 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13814 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13816 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13818 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13820 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13821 * charset.c (Fdefine_charset_internal): Don't initialize
13822 charset.code_space[15]. The value was garbage, on hosts with
13823 32-bit int (Bug#8600).
13825 * lread.c (read_integer): Be more consistent with string-to-number.
13826 Use string_to_number to do the actual conversion; this avoids
13827 rounding errors and fixes some other screwups. Without this fix,
13828 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13829 (digit_to_number): Move earlier, for benefit of read_integer.
13830 Return -1 if the digit is out of range for the base, -2 if it is
13831 not a digit in any supported base. (Bug#8602)
13833 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13835 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13836 to match comment at start of function. This also removes a
13837 GCC warning about overflow in a 32+64-bit port.
13839 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13841 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13842 Reported by Stefan Monnier in
13843 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
13844 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13845 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
13847 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13848 (EMACS_UINTPTR): Likewise, with uintptr_t.
13850 * lisp.h: Prefer 64-bit EMACS_INT if available.
13851 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13852 on 32-bit hosts that have 64-bit int, so that they can access
13854 However, temporarily disable this change unless the temporary
13855 symbol WIDE_EMACS_INT is defined.
13857 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13859 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13860 This removes an assumption that EMACS_INT and long are the same
13861 width as pointers. The assumption is true for Emacs porting targets
13862 now, but we want to make other targets possible.
13863 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13864 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13865 In the rest of the code, change types of integers that hold casted
13866 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13867 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13868 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13869 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13870 No need to cast type when ORing.
13871 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13872 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13873 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13874 assume EMACS_INT is the same width as char *.
13875 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13876 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13877 Remove no-longer-needed casts.
13878 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13879 (xg_tool_bar_help_callback, xg_make_tool_item):
13880 Use EMACS_INTPTR to hold an integer
13881 that will be cast to void *; this can avoid a GCC warning
13882 if EMACS_INT is not the same width as void *.
13883 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13884 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13885 (current_message_1, set_message_1):
13886 Use a local to convert to proper width without a cast.
13887 * xmenu.c (dialog_selection_callback): Likewise.
13889 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13890 Also, don't assume VALBITS / RAND_BITS is less than 5,
13891 and don't rely on undefined behavior when shifting a 1 left into
13893 * lisp.h (get_random): Change signature to match.
13895 * lread.c (hash_string): Use size_t, not int, for hash computation.
13896 Normally we prefer signed values; but hashing is special, because
13897 it's better to use unsigned division on hash table sizes so that
13898 the remainder is nonnegative. Also, size_t is the natural width
13899 for hashing into memory. The previous code used 'int', which doesn't
13900 retain enough info to hash well into very large tables.
13901 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13903 * dbusbind.c: Don't possibly lose pointer info when converting.
13904 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13905 Use XPNTR rather than XHASH, so that the high-order bits of
13906 the pointer aren't lost when converting through void *.
13908 * eval.c (Fautoload): Don't double-shift a pointer.
13910 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13912 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13914 * gnutls.c (DEF_GNUTLS_FN):
13915 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13917 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13919 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13922 2011-05-05 Eli Zaretskii <eliz@gnu.org>
13924 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13925 New version that can reserve upto 2GB of heap space.
13927 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
13929 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13931 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13933 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13934 `gnutls_certificate_set_x509_key_file'.
13936 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
13938 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13939 Update dependencies.
13941 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13943 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13944 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13945 Remove unused parameter `fildes'.
13946 * process.c (read_process_output, send_process): Don't pass it.
13948 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13950 Fix previous change: the library cache is defined in w32.c.
13951 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13952 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13954 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13956 Implement dynamic loading of GnuTLS on Windows.
13958 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13959 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13960 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13963 * gnutls.c (Qgnutls_dll): Define.
13964 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13965 (gnutls_*): Declare function pointers.
13966 (init_gnutls_functions): New function to initialize function pointers.
13967 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13968 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13969 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13970 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13971 (emacs_gnutls_write, emacs_gnutls_read)
13972 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13973 (Fgnutls_available_p): New function.
13974 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13975 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13976 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13978 * image.c: Include w32.h.
13979 (Vimage_type_cache): Delete.
13980 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13981 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13982 (w32_delayed_load): Move to w32.c.
13984 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13986 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13987 (w32_delayed_load): Move from image.c. When loading a library, record
13988 its filename in the :loaded-from property of the library id.
13989 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13990 Initialize and staticpro them.
13991 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13993 * process.c: Include lisp.h before w32.h, not after.
13994 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13995 instead of gnutls_record_check_pending.
13997 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13999 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14001 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14002 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14005 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14007 * xterm.c (x_set_frame_alpha): Do not set property on anything
14008 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14010 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14012 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14014 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14016 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14017 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14018 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14019 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14020 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14021 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14022 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14023 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14024 (Qgnutls_bootprop_callbacks_verify): Make static.
14026 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14028 * callproc.c: Indentation fixup.
14030 * sysdep.c (wait_for_termination_1): Make static.
14031 (wait_for_termination, interruptible_wait_for_termination):
14032 Move after wait_for_termination_1.
14034 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14036 * sysdep.c (interruptible_wait_for_termination): New function
14037 which is like wait_for_termination, but allows keyboard
14040 * callproc.c (Fcall_process): Add (:file "file") as an option for
14042 (Fcall_process_region): Ditto.
14044 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14046 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14047 rather than `XVECTOR (FOO)->size'.
14049 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14050 inttypes.h, as a gnulib replacement is used if it not available in
14053 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14055 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14056 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14057 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14059 * coding.c (coding_alloc_by_realloc): Error out if destination
14060 will grow beyond MOST_POSITIVE_FIXNUM.
14061 (decode_coding_emacs_mule): Abort if there isn't enough place in
14062 charbuf for the composition carryover bytes. Reserve an extra
14063 space for up to 2 characters produced in a loop.
14064 (decode_coding_iso_2022): Abort if there isn't enough place in
14065 charbuf for the composition carryover bytes.
14067 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14069 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14070 aborting when %lld or %lll format is passed.
14071 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14072 %llo or %llx format is passed. (Bug#8545)
14074 * window.c (window_scroll_line_based): Use a marker instead of
14075 simple variables to record original value of point. (Bug#7952)
14077 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14078 produced by %s or %c overflows available buffer space. (Bug#8545)
14080 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14082 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14083 (SIZE_MAX): Move defn after all includes, as they might #define it.
14085 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14087 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14089 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14091 * keyboard.c (Qdelayed_warnings_hook): Define.
14092 (command_loop_1): Run `delayed-warnings-hook'
14093 if Vdelayed_warnings_list is non-nil.
14094 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14095 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14097 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14099 * doprnt.c (doprnt): Don't return value smaller than the buffer
14100 size if the message was truncated. (Bug#8545).
14102 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14104 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14105 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14107 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14109 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14111 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14113 * makefile.w32-in: Update dependencies.
14115 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14117 Improve `doprnt' and its usage. (Bug#8545)
14118 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14119 `format_end'. Remove support for %l as a conversion specifier.
14120 Don't use xrealloc. Improve diagnostics when the %l size modifier
14121 is used. Update the commentary.
14123 * eval.c (verror): Simplify calculation of size_t.
14125 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14128 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14130 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14133 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14135 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14136 This makes this file independent of the recent pseudovector change.
14138 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14140 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14142 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14143 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14144 Remove unused local.
14145 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14147 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14148 GCC 4.6.0 optimizes based on type-based alias analysis.
14149 For example, if b is of type struct buffer * and v of type struct
14150 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14151 != &v->size, and therefore "v->size = 1; b->size = 2; return
14152 v->size;" must therefore return 1. This assumption is incorrect
14153 for Emacs, since it type-puns struct Lisp_Vector * with many other
14154 types. To fix this problem, this patch adds a new type struct
14155 vectorlike_header that documents the constraints on layout of vectors
14156 and pseudovectors, and helps optimizing compilers not get fooled
14157 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14158 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14159 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14161 (XSETPVECTYPE): Rewrite in terms of new macro.
14162 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14163 This is a bit clearer, and further avoids the possibility of
14164 undesirable aliasing.
14165 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14166 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14167 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14168 since Lisp_Subr is a special case (no "next" field).
14169 (ASIZE): Now uses header.size rather than size.
14170 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14171 to avoid the hassle of writing XVECTOR (foo)->header.size.
14172 (struct vectorlike_header): New type.
14173 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14174 object, to help avoid aliasing.
14175 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14176 (SUBRP): Likewise, since Lisp_Subr is a special case.
14177 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14178 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14179 (struct Lisp_Hash_Table): Combine first two members into a single
14180 struct vectorlike_header member. All uses of "size" and "next" members
14181 changed to be "header.size" and "header.next".
14182 * buffer.h (struct buffer): Likewise.
14183 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14184 * frame.h (struct frame): Likewise.
14185 * process.h (struct Lisp_Process): Likewise.
14186 * termhooks.h (struct terminal): Likewise.
14187 * window.c (struct save_window_data, struct saved_window): Likewise.
14188 * window.h (struct window): Likewise.
14189 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14190 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14191 * buffer.c (init_buffer_once): Likewise.
14192 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14194 * process.c (Fformat_network_address): Use local var for size,
14197 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14199 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14200 * data.c (atof): Remove decl; no longer used or needed.
14201 (digit_to_number): Move to lread.c.
14202 (Fstring_to_number): Use new string_to_number function, to be
14203 consistent with how the Lisp reader treats infinities and NaNs.
14204 Do not assume that floating-point numbers represent EMACS_INT
14205 without losing information; this is not true on most 64-bit hosts.
14206 Avoid double-rounding errors, by insisting on integers when
14207 parsing non-base-10 numbers, as the documentation specifies.
14208 * lisp.h (string_to_number): New decl, replacing ...
14209 (isfloat_string): Remove.
14210 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14211 (read1): Do not accept +. and -. as integers; this
14212 appears to have been a coding error. Similarly, do not accept
14213 strings like +-1e0 as floating point numbers. Do not report
14214 overflow for integer overflows unless the base is not 10 which
14215 means we have no simple and reliable way to continue.
14216 Break out the floating-point parsing into a new
14217 function string_to_number, so that Fstring_to_number parses
14218 floating point numbers consistently with the Lisp reader.
14219 (digit_to_number): Move here from data.c. Make it static inline.
14220 (E_CHAR, EXP_INT): Remove, replacing with ...
14221 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14222 (string_to_number): New function, replacing isfloat_string.
14223 This function checks for valid syntax and produces the resulting
14224 Lisp float number too. Rework it so that string-to-number
14225 no longer mishandles examples like "1.0e+". Use strtoumax,
14226 so that overflow for non-base-10 numbers is reported only when
14227 there's no portable and simple way to convert to floating point.
14229 * textprop.c (set_text_properties_1): Rewrite for clarity,
14230 and to avoid GCC warning about integer overflow.
14232 * intervals.h (struct interval): Use EMACS_INT for members
14233 where EMACS_UINT might cause problems. See
14234 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14235 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14236 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14238 (offset_intervals): Tell GCC not to worry about length overflow
14239 when negating a negative length.
14241 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14242 (overrun_check_free): Likewise.
14244 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14245 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14248 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14249 (gnutls_make_error): Rename local to avoid shadowing.
14250 (gnutls_emacs_global_deinit): ifdef out; not used.
14251 (Fgnutls_boot): Use const for pointer to readonly storage.
14252 Comment out unused local. Fix pointer signedness problems.
14254 * lread.c (openp): Don't stuff size_t into an 'int'.
14255 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14256 about possible signed overflow.
14258 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14259 (GDK_KEY_g): Don't define if already defined.
14260 (xg_prepare_tooltip): Avoid pointer signedness problem.
14261 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14263 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14264 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14266 * xfns.c (Fx_window_property): Simplify a bit,
14267 to make a bit faster and to avoid GCC 4.6.0 warning.
14268 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14270 * fns.c (internal_equal): Don't assume size_t fits in int.
14272 * alloc.c (compact_small_strings): Tighten assertion a little.
14274 Replace pEd with more-general pI, and fix some printf arg casts.
14275 * lisp.h (pI): New macro, generalizing old pEd macro to other
14276 conversion specifiers. For example, use "...%"pI"d..." rather
14277 than "...%"pEd"...".
14278 (pEd): Remove. All uses replaced with similar uses of pI.
14279 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14280 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14281 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14282 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14283 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14284 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14285 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14287 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14288 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14289 * print.c (safe_debug_print, print_object): Likewise.
14290 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14292 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14293 avoiding the 0 flag, which is not portable.
14294 * process.c (Fmake_network_process): Use pI to avoid cast.
14295 * region-cache.c (pp_cache): Likewise.
14296 * xdisp.c (decode_mode_spec): Likewise.
14297 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14298 behavior on 64-bit hosts with printf arg.
14299 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14300 (x_stop_queuing_selection_requests): Likewise.
14301 (x_get_window_property): Don't truncate byte count to an 'int'
14304 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14305 here, since it parses constructs like leading '-' and spaces,
14306 which are not wanted; and it overflows with large numbers.
14307 Instead, simply match F[0-9]+, which is what is wanted anyway.
14309 * alloc.c: Remove unportable assumptions about struct layout.
14310 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14311 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14312 (allocate_vectorlike, make_pure_vector): Use the new macros,
14313 plus offsetof, to remove unportable assumptions about struct layout.
14314 These assumptions hold on all porting targets that I know of, but
14315 they are not guaranteed, they're easy to remove, and removing them
14316 makes further changes easier.
14318 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14319 This doesn't fix a bug but makes the code clearer.
14320 (string_overrun_cookie): Now const. Use initializers that
14321 don't formally overflow signed char, to avoid warnings.
14322 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14323 can cause Emacs to crash when string overrun checking is enabled.
14324 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14325 multiple of sizeof (EMACS_INT); it need not be, if
14326 alignof(EMACS_INT) < sizeof (EMACS_INT).
14327 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14329 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14331 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14333 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14335 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14336 supposed to be handshaking. (Bug#8556)
14337 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14339 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14341 * lisp.h (Qdebug): List symbol.
14342 * eval.c (Qdebug): Restore global linkage.
14343 * keyboard.c (debug-on-event): New variable.
14344 (handle_user_signal): Break into debugger when debug-on-event
14345 matches the current signal symbol.
14347 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14349 * alloc.c (check_sblock, check_string_bytes)
14350 (check_string_free_list): Convert to standard C.
14352 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14354 * w32.c (emacs_gnutls_push): Fix typo.
14356 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14358 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14359 "cast to pointer from integer of different size".
14361 Improve doprnt and its use in verror. (Bug#8545)
14362 * doprnt.c (doprnt): Document the set of format control sequences
14363 supported by the function. Use SAFE_ALLOCA instead of always
14366 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14367 is one byte too soon. Don't use xrealloc; instead xfree and
14370 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14372 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14375 * gnutls.c: Renamed global_initialized to
14376 gnutls_global_initialized. Added internals for the
14377 :verify-hostname-error, :verify-error, and :verify-flags
14378 parameters of `gnutls-boot' and documented those parameters in the
14379 docstring. Start callback support.
14380 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14381 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14382 on error. Return error code.
14383 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14384 (emacs_gnutls_read): Likewise.
14385 (Fgnutls_boot): Return handshake error code.
14386 (emacs_gnutls_handle_error): New function.
14387 (wsaerror_to_errno): Likewise.
14389 * w32.h (emacs_gnutls_pull): Add prototype.
14390 (emacs_gnutls_push): Likewise.
14392 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14393 (emacs_gnutls_push): Likewise.
14395 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14397 * process.c (wait_reading_process_output): Check if GnuTLS
14398 buffered some data internally if no FDs are set for TLS
14401 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14402 (LIBS): Link to USER_LIBS.
14403 ($(BLD)/gnutls.$(0)): New target.
14405 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14407 * xdisp.c (handle_single_display_spec): Rename the
14408 display_replaced_before_p argument into display_replaced_p, to
14409 make it consistent with the commentary. Fix typos in the
14412 * textprop.c (syms_of_textprop): Remove dead code.
14413 (copy_text_properties): Delete obsolete commentary about an
14414 interface that was deleted long ago. Fix typos in the description
14417 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14418 to changes in oldXMenu/XMenu.h from 2011-04-16.
14419 <menu_help_message, prev_menu_help_message>: Constify.
14420 (IT_menu_make_room): menu->help_text is now `const char **';
14423 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14424 to changes in oldXMenu/XMenu.h from 2011-04-16.
14425 (struct XMenu): Declare `help_text' `const char **'.
14427 * xfaces.c <Qunspecified>: Make extern again.
14429 * syntax.c: Include sys/types.h before including regex.h, as
14432 * doc.c (get_doc_string): Improve the format passed to `error'.
14434 * doprnt.c (doprnt): Improve commentary.
14436 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14438 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14441 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14442 changes in globals.h immediately force recompilation.
14443 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14444 $(CURDIR)/s/ms-w32.h.
14445 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
14447 * character.c (Fchar_direction): Function deleted.
14448 (syms_of_character): Don't defsubr it.
14449 <char-direction-table>: Deleted.
14451 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14453 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14454 * doprnt.c: Include limits.h.
14455 (SIZE_MAX): New macro.
14456 (doprnt): Return a size_t value. 2nd arg is now size_t.
14457 Many local variables are now size_t instead of int or unsigned.
14458 Improve overflow protection. Support `l' modifier for integer
14459 conversions. Support %l conversion. Don't assume an EMACS_INT
14460 argument for integer conversions and for %c.
14462 * lisp.h (doprnt): Restore prototype.
14464 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14465 $(SRC)/character.h.
14467 * Makefile.in (base_obj): Add back doprnt.o.
14469 * deps.mk (doprnt.o): Add back prerequisites.
14470 (callint.o): Depend on character.h.
14472 * eval.c (internal_lisp_condition_case): Include the handler
14473 representation in the error message.
14474 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
14475 when breaking from the loop.
14477 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14479 * callint.c (Fcall_interactively): When displaying error message
14480 about invalid control letter, pass the character's codepoint, not
14481 a pointer to its multibyte form. Improve display of the character
14482 in octal and display also its hex code.
14484 * character.c (char_string): Use %x to display the (unsigned)
14485 codepoint of an invalid character, to avoid displaying a bogus
14488 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14489 `error', not SYMBOL_NAME itself.
14491 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14492 character arguments to `error'.
14494 * charset.c (check_iso_charset_parameter): Fix incorrect argument
14495 to `error' in error message about FINAL_CHAR argument. Make sure
14496 FINAL_CHAR is a character, and use %c when it is passed as
14497 argument to `error'.
14499 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14501 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14503 * w32.c: Include <time.h>.
14504 (sys_localtime): New function.
14506 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
14508 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14510 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
14512 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
14514 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14515 zombies (Bug#8467).
14517 2011-04-19 Eli Zaretskii <eliz@gnu.org>
14519 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14520 gl_state.e_property when gl_state.object is Qt.
14522 * insdel.c (make_gap_larger): Remove limitation of buffer size
14525 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
14527 * xdisp.c (lookup_glyphless_char_display)
14528 (produce_glyphless_glyph): Handle cons cell entry in
14529 glyphless-char-display.
14530 (Vglyphless_char_display): Document it.
14532 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14533 glyphless-char-display.
14535 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
14537 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14539 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14541 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14542 definition for no-X builds.
14544 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
14546 Static checks with GCC 4.6.0 and non-default toolkits.
14548 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14550 * process.c (keyboard_bit_set): Define only if SIGIO.
14551 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14552 (send_process): Repair possible setjmp clobbering.
14554 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14556 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14558 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14560 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14561 Define only if needed.
14563 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14564 by pacifying GCC about it. Maybe it's time to retire it?
14565 * xfaces.c (USG, __TIMEVAL__): Likewise.
14567 * dispextern.h (struct redisplay_interface): Rename param
14568 to avoid shadowing.
14569 * termhooks.h (struct terminal): Likewise.
14570 * xterm.c (xembed_send_message): Likewise.
14572 * insdel.c (make_gap_smaller): Define only if
14573 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14575 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14578 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14579 so that we aren't warned about unused symbols.
14581 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14583 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
14585 * xfns.c (x_real_positions): Mark locals as initialized.
14587 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14589 * xterm.c: Fix problems found by static analysis with other toolkits.
14590 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
14591 (x_dispatch_event): Declare static if USE_GTK, and
14592 define if USE_GTK || USE_X_TOOLKIT.
14593 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
14594 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
14595 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14596 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
14598 * xmenu.c (menu_help_callback): Pointer type fixes.
14599 Use const pointers when pointing at readonly data. Avoid pointer
14600 signedness clashes.
14601 (FALSE): Remove unused macro.
14602 (update_frame_menubar): Remove unused decl.
14604 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14606 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14607 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14608 (single_menu_item): Rename local to avoid shadowing.
14610 * keyboard.c (make_lispy_event): Remove unused local var.
14612 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14613 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14615 * bitmaps: Change bitmaps from unsigned char back to the X11
14616 compatible char. Avoid the old compiler warnings about
14617 out-of-range initializers by using, for example, '\xab' rather
14620 * xgselect.c (xgselect_initialize): Check vs interface
14621 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14623 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14625 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14626 to read-only memory.
14628 * fns.c (vector): Remove; this old hack is no longer needed.
14630 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
14632 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
14634 * xrdb.c (x_load_resources): Omit unused local.
14636 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
14637 (x_window): Rename locals to avoid shadowing.
14638 (USG): Use the kludged USG macro, to pacify gcc.
14640 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
14641 (x_term_init): Remove local to avoid shadowing.
14643 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
14645 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14646 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14648 2011-04-16 Eli Zaretskii <eliz@gnu.org>
14650 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14652 Fix regex.c, syntax.c and friends for buffers > 2GB.
14653 * syntax.h (struct gl_state_s): Declare character position members
14656 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14658 * textprop.c (verify_interval_modification, interval_of):
14659 Declare arguments EMACS_INT.
14661 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14664 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14666 * indent.c (Fvertical_motion): Local variable it_start is now
14669 * regex.c (re_match, re_match_2, re_match_2_internal)
14670 (bcmp_translate, regcomp, regexec, print_double_string)
14671 (group_in_compile_stack, re_search, re_search_2, regex_compile)
14672 (re_compile_pattern, re_exec): Declare arguments and local
14673 variables `size_t' and `ssize_t' and return values `regoff_t', as
14675 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14676 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14677 <compile_stack_type>: `size' and `avail' are now `size_t'.
14679 * regex.h <regoff_t>: Use ssize_t, not int.
14680 (re_search, re_search_2, re_match, re_match_2): Arguments that
14681 specify buffer/string position and length are now ssize_t and
14682 size_t. Return type is regoff_t.
14684 2011-04-16 Ben Key <bkey76@gmail.com>
14686 * nsfont.m: Fixed bugs in ns_get_family and
14687 ns_descriptor_to_entity that were caused by using free to
14688 deallocate memory blocks that were allocated by xmalloc (via
14689 xstrdup). This caused Emacs to crash when compiled with
14690 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14691 --enable-checking=xmallocoverrun). xfree is now used to
14692 deallocate these memory blocks.
14694 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
14696 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14698 emacs_write: Accept and return EMACS_INT for sizes.
14699 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14701 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14702 Accept and return EMACS_INT.
14703 (emacs_gnutls_write): Return the number of bytes written on
14705 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
14706 (emacs_read, emacs_write): Remove check for negative size, as the
14707 Emacs source code has been audited now.
14708 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14709 (emacs_read, emacs_write): Use it.
14710 * process.c (send_process): Adjust to the new signatures of
14711 emacs_write and emacs_gnutls_write. Do not attempt to store
14712 a byte offset into an 'int'; it might overflow.
14713 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
14715 * sound.c: Don't assume sizes fit in 'int'.
14716 (struct sound_device.period_size, alsa_period_size):
14717 Return EMACS_INT, not int.
14718 (struct sound_device.write, vox_write, alsa_write):
14719 Accept EMACS_INT, not int.
14720 (wav_play, au_play): Use EMACS_INT to store sizes and to
14721 record read return values.
14723 2011-04-15 Ben Key <bkey76@gmail.com>
14725 * keyboard.c (Qundefined): Don't declare static since it is used
14727 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14728 static since they are used in nsfont.m.
14730 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14732 * process.c (Qprocessp): Don't declare static.
14733 * lisp.h (Qprocessp): Declare again.
14735 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
14737 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14739 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14741 Improve C-level modularity by making more things 'static'.
14743 Don't publish debugger-only interfaces to other modules.
14744 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14745 (verify_bytepos, count_markers): Move decls to the only modules
14747 * region-cache.h (pp_cache): Likewise.
14748 * window.h (check_all_windows): Likewise.
14749 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14751 * sysdep.c (croak): Now static, if
14752 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14753 * syssignal.h (croak): Declare only if not static.
14755 * alloc.c (refill_memory_reserve): Now static if
14756 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14757 * lisp.h (refill_memory_reserve): Declare only if not static.
14759 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14760 Define only if USE_LUCID.
14762 * xrdb.c (x_customization_string, x_rm_string): Now static.
14764 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14765 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14767 * xdisp.c (draw_row_with_mouse_face): Now static.
14768 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14770 * window.h (check_all_windows): Mark externally visible.
14772 * window.c (window_deletion_count): Now static.
14774 * undo.c: Make symbols static if they're not exported.
14775 (last_undo_buffer, last_boundary_position, pending_boundary):
14778 * textprop.c (interval_insert_behind_hooks): Now static.
14779 (interval_insert_in_front_hooks): Likewise.
14781 * term.c: Make symbols static if they're not exported.
14782 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14783 (max_frame_lines, tty_set_terminal_modes):
14784 (tty_reset_terminal_modes, tty_turn_off_highlight):
14785 (get_tty_terminal): Now static.
14786 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14787 * termhooks.h (term_mouse_moveto): Do not declare if
14788 HAVE_WINDOW_SYSTEM.
14789 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14790 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14792 * sysdep.c: Make symbols static if they're not exported.
14793 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14795 (sigprocmask_set, full_mask): Remove; unused.
14796 (wait_debugging): Mark as visible.
14797 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14798 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14800 * syntax.c (syntax_temp): Define only if !__GNUC__.
14802 * sound.c (current_sound_device, current_sound): Now static.
14804 * search.c (searchbufs, searchbuf_head): Now static.
14806 * scroll.c (scroll_cost): Remove; unused.
14807 * dispextern.h (scroll_cost): Remove decl.
14809 * region-cache.h (pp_cache): Mark as externally visible.
14811 * process.c: Make symbols static if they're not exported.
14812 (process_tick, update_tick, create_process, chan_process):
14813 (Vprocess_alist, proc_buffered_char, datagram_access):
14814 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14815 (deactivate_process): Mark defn as static, as well as decl.
14816 * lisp.h (create_process): Remove decl.
14817 * process.h (chan_process, Vprocess_alist): Remove decls.
14819 * print.c: Make symbols static if they're not exported.
14820 (print_depth, new_backquote_output, being_printed, print_buffer):
14821 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14822 (print_interval, print_number_index, initial_stderr_stream):
14824 * lisp.h (Fprinc): Remove decl.
14825 (debug_output_compilation_hack): Mark as externally visible.
14827 * sysdep.c (croak): Move decl from here to syssignal.h.
14828 * syssignal.h (croak): Put it here, so the API can be checked when
14829 'croak' is called from dissociate_if_controlling_tty.
14831 * minibuf.c: Make symbols static if they're not exported.
14832 (minibuf_save_list, choose_minibuf_frame): Now static.
14833 * lisp.h (choose_minibuf_frame): Remove decl.
14835 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14837 * lread.c: Make symbols static if they're not exported.
14838 (read_objects, initial_obarray, oblookup_last_bucket_number):
14840 (make_symbol): Remove; unused.
14841 * lisp.h (initial_obarray, make_symbol): Remove decls.
14843 * keyboard.c: Make symbols static if they're not exported.
14844 (single_kboard, recent_keys_index, total_keys, recent_keys):
14845 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14846 (this_single_command_key_start, echoing, last_auto_save):
14847 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14848 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14849 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14850 (Vlispy_mouse_stem, double_click_count):
14852 (force_auto_save_soon): Define only if SIGDANGER.
14853 (ignore_mouse_drag_p): Now static if
14854 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14855 (print_help): Remove; unused.
14856 (stop_character, last_timer_event): Mark as externally visible.
14857 * keyboard.h (ignore_mouse_drag_p): Declare only if
14858 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14859 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14860 * lisp.h (echoing): Remove decl.
14861 (force_auto_save_soon): Declare only if SIGDANGER.
14862 * xdisp.c (redisplay_window): Simplify code, to make it more
14863 obvious that ignore_mouse_drag_p is not accessed if !defined
14864 USE_GTK && !defined HAVE_NS.
14866 * intervals.c: Make symbols static if they're not exported.
14867 (merge_properties_sticky, merge_interval_right, delete_interval):
14869 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14871 * insdel.c: Make symbols static if they're not exported.
14872 However, leave prepare_to_modify_buffer alone. It's never
14873 called from outside this function, but that appears to be a bug.
14874 (combine_after_change_list, combine_after_change_buffer):
14875 (adjust_after_replace, signal_before_change): Now static.
14876 (adjust_after_replace_noundo): Remove; unused.
14877 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
14878 (signal_before_change): Remove decls.
14880 * indent.c (val_compute_motion, val_vmotion): Now static.
14882 * image.c: Make symbols static if they're not exported.
14883 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14885 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14886 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14888 * fringe.c (standard_bitmaps): Now static.
14889 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14891 * frame.c: Make symbols static if they're not exported.
14892 (x_report_frame_params, make_terminal_frame): Now static.
14893 (get_frame_param): Now static, unless HAVE_NS.
14894 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14895 (x_get_resource_string): Remove; not used.
14896 * frame.h (make_terminal_frame, x_report_frame_params):
14897 (x_get_resource_string); Remove decls.
14898 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14899 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14901 * font.c, fontset.c: Make symbols static if they're not exported.
14902 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14903 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14904 * font.c (font_close_object): Now static.
14905 * font.h (font_close_object): Remove.
14906 * fontset.c (FONTSET_OBJLIST): Remove.
14907 (free_realized_fontset) #if-0 the body, which does nothing.
14908 (face_suitable_for_char_p): #if-0, as it's never called.
14909 * fontset.h (face_suitable_for_char_p): Remove decl.
14910 * xfaces.c (face_at_string_position):
14911 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
14912 since 0 is always ASCII.
14914 * fns.c (weak_hash_tables): Now static.
14916 * fileio.c: Make symbols static if they're not exported.
14917 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14918 (Vwrite_region_annotation_buffers): Now static.
14920 * eval.c: Make symbols static if they're not exported.
14921 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14922 * lisp.h (backtrace_list): Remove decl.
14924 * emacs.c: Make symbols static if they're not exported.
14925 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14926 (fatal_error_code, fatal_error_signal_hook, standard_args):
14928 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14929 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14930 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14931 * lisp.h (fatal_error_signal_hook): Remove decl.
14932 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14934 * editfns.c: Move a (normally-unused) function to its only use.
14935 * editfns.c, lisp.h (get_operating_system_release): Remove.
14936 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14937 worth the hassle of breaking this out.
14939 * xterm.c: Make symbols static if they're not exported.
14940 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14941 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14942 (x_destroy_window, x_delete_display):
14944 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14945 (x_mouse_leave): Remove; unused.
14946 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14947 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14948 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14950 (x_mouse_leave): Declare only if WINDOWSNT.
14951 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14952 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14955 * ftxfont.c: Make symbols static if they're not exported.
14956 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14958 * font.h (ftxfont_driver): Likewise.
14960 * xfns.c: Make symbols static if they're not exported.
14961 (x_last_font_name, x_display_info_for_name):
14962 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14963 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14964 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14965 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14966 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14967 (last_show_tip_args): Now static.
14968 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14969 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14970 (x_screen_planes): Remove; unused.
14971 * dispextern.h (x_screen_planes): Remove decl.
14973 * dispnew.c: Make symbols static if they're not exported.
14974 * dispextern.h (redraw_garbaged_frames, scrolling):
14975 (increment_row_positions): Remove.
14976 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14977 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14979 (redraw_garbaged_frames): Remove; unused.
14981 * xfaces.c: Make symbols static if they're not exported.
14982 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14984 * xterm.h (defined_color): Remove decls.
14985 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14986 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14987 (menu_face_changed_default, defined_color, free_realized_face):
14988 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14989 (ascii_face_of_lisp_face): Remove; unused.
14991 * xdisp.c: Make symbols static if they're not exported.
14992 * dispextern.h (scratch_glyph_row, window_box_edges):
14993 (glyph_to_pixel_coords, set_cursor_from_row):
14994 (get_next_display_element, set_iterator_to_next):
14995 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14996 (show_mouse_face): Remove decls
14997 * frame.h (message_buf_print): Likewise.
14998 * lisp.h (pop_message, set_message, check_point_in_composition):
15000 * xterm.h (set_vertical_scroll_bar): Likewise.
15001 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15002 (message_buf_print, scratch_glyph_row, displayed_buffer):
15003 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15004 (get_next_display_element, show_mouse_face, window_box_edges):
15005 (frame_to_window_pixel_xy, check_point_in_composition):
15006 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15007 (glyph_to_pixel_coords): Remove; unused.
15009 * dired.c (file_name_completion): Now static.
15011 * dbusbind.c (xd_in_read_queued_messages): Now static.
15013 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15014 * data.c (circular_list_error): Remove.
15016 * commands.h (last_point_position, last_point_position_buffer):
15017 (last_point_position_window): Remove decls.
15018 * keyboard.c: Make these variables static.
15020 * coding.h (coding, code_convert_region, encode_coding_gap):
15022 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15023 (iso_code_class, detect_coding, code_convert_region): Now static.
15024 (encode_coding_gap): Remove; unused.
15026 * chartab.c (chartab_chars, chartab_bits): Now static.
15028 * charset.h (charset_iso_8859_1): Remove decl.
15029 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15032 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15033 * ccl.c (Vccl_program_table): Now static.
15034 (check_ccl_update): Remove; unused.
15036 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15037 * category.h: ... from here.
15038 * category.c (check_category_table, set_category_set): Now static.
15040 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15041 * lisp.h: Remove these decls.
15043 * buffer.c (buffer_count): Remove unused var.
15045 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15046 so that it's not optimized away.
15047 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15048 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15049 exported only to the debugger.
15051 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15052 * atimer.h (run_all_atimers): Remove; not exported.
15054 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15055 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15056 was inaccessible from Lisp.
15057 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15058 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15060 alloc.c: Import and export fewer symbols, and remove unused items.
15061 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15063 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15064 it's not optimized away by whole-program optimization.
15065 (message_enable_multibyte, free_misc): Remove.
15066 (catchlist, handlerlist, mark_backtrace):
15067 Declare only if BYTE_MARK_STACK.
15068 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15069 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15070 (message_enable_multibyte): Remove decl.
15071 (free_misc, interval_free_list, float_block, float_block_index):
15072 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15073 (cons_free_list, last_marked_index):
15075 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15076 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15077 (mark_backtrace): Define only if BYTE_MARK_STACK.
15078 * xdisp.c (message_enable_multibyte): Now static.
15080 Declare Lisp_Object Q* variables to be 'static' if not exported.
15081 This makes it easier for human readers (and static analyzers)
15082 to see whether these variables are used from other modules.
15083 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15084 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15085 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15086 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15087 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15088 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15089 * xmenu.c, xselect.c:
15090 Declare Q* vars static if they are not used in other modules.
15091 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15092 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15093 Remove decls of unexported vars.
15094 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15096 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15098 Make Emacs functions such as Fatom 'static' by default.
15099 This makes it easier for human readers (and static analyzers)
15100 to see whether these functions can be called from other modules.
15101 DEFUN now defines a static function. To make the function external
15102 so that it can be used in other C modules, use the new macro DEFUE.
15103 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15104 (Finit_image_library):
15105 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15106 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15107 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15108 Remove decls, since these functions are now static.
15109 (Funintern, Fget_internal_run_time): New decls, since these functions
15110 were already external.
15112 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15113 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15114 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15115 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15116 * keyboard.c, keymap.c, lread.c:
15117 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15118 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15119 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15120 Mark functions with DEFUE instead of DEFUN,
15121 if they are used in other modules.
15122 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15123 decls for now-static functions.
15124 * buffer.h (Fdelete_overlay): Remove decl.
15125 * callproc.c (Fgetenv_internal): Mark as internal.
15126 * composite.c (Fremove_list_of_text_properties): Remove decl.
15127 (Fcomposition_get_gstring): New forward static decl.
15128 * composite.h (Fcomposite_get_gstring): Remove decl.
15129 * dired.c (Ffile_attributes): New forward static decl.
15130 * doc.c (Fdocumntation_property): New forward static decl.
15131 * eval.c (Ffetch_bytecode): New forward static decl.
15132 (Funintern): Remove extern decl; now in .h file where it belongs.
15133 * fileio.c (Fmake_symbolic_link): New forward static decl.
15134 * image.c (Finit_image_library): New forward static decl.
15135 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15136 * intervals.h (Fprevious_property_change):
15137 (Fremove_list_of_text_properties): Remove decls.
15138 * keyboard.c (Fthis_command_keys): Remove decl.
15139 (Fcommand_execute): New forward static decl.
15140 * keymap.c (Flookup_key): New forward static decl.
15141 (Fcopy_keymap): Now static.
15142 * keymap.h (Flookup_key): Remove decl.
15143 * process.c (Fget_process): New forward static decl.
15144 (Fprocess_datagram_address): Mark as internal.
15145 * syntax.c (Fsyntax_table_p): New forward static decl.
15146 (skip_chars): Remove duplicate decl.
15147 * textprop.c (Fprevious_property_change): New forward static decl.
15148 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15150 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15151 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15153 * editfns.c (Fformat): Remove unreachable code.
15155 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15157 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15160 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15162 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15163 when at ZV. (Bug#8487)
15165 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15167 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15169 * keyboard.c (parse_tool_bar_item): Likewise.
15170 * sound.c (sound_cleanup, alsa_close): Likewise.
15171 * termcap.c (tgetent): Likewise.
15172 * xfns.c (x_default_font_parameter): Likewise.
15173 * xsettings.c (read_and_apply_settings): Likewise.
15175 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15176 (overrun_check_free): Protoize.
15178 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15180 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15181 since callers should never pass a negative size.
15182 Change the signature to match that of plain 'read' and 'write'; see
15183 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15184 * lisp.h: Update prototypes of emacs_write and emacs_read.
15186 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15188 * xdisp.c (redisplay_window): Don't try to determine the character
15189 position of the scroll margin if the window start point w->startp
15190 is outside the buffer's accessible region. (Bug#8468)
15192 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15194 Fix write-region and its subroutines for buffers > 2GB.
15195 * fileio.c (a_write, e_write): Modify declaration of arguments and
15196 local variables to support buffers larger than 2GB.
15197 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15199 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15200 argument, local variables, and return value.
15202 * lisp.h: Update prototypes of emacs_write and emacs_read.
15204 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15206 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15208 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15210 Fix more problems found by GCC 4.6.0's static checks.
15212 * xdisp.c (vmessage): Use a better test for character truncation.
15214 * charset.c (load_charset_map): <, not <=, for optimization,
15215 and to avoid potential problems with integer overflow.
15216 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15217 * casetab.c (set_identity, shuffle): Likewise.
15218 * editfns.c (Fformat): Likewise.
15219 * syntax.c (skip_chars): Likewise.
15221 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15222 This also lets GCC 4.6.0 generate slightly better loop code.
15224 * callint.c (Fcall_interactively): <, not <=, for optimization.
15225 (Fcall_interactively): Count the number of arguments produced,
15226 not the number of arguments given. This is simpler and lets GCC
15227 4.6.0 generate slightly better code.
15229 * ftfont.c: Distingish more carefully between FcChar8 and char.
15230 The previous code passed unsigned char * to a functions like
15231 strlen and xstrcasecmp that expect char *, which does not
15232 conform to the C standard.
15233 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15234 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15235 char * when the C standard requires it.
15237 * keyboard.c (read_char): Remove unused var.
15239 * eval.c: Port to Windows vsnprintf (Bug#8435).
15240 Include <limits.h>.
15241 (SIZE_MAX): Define if the headers do not.
15242 (verror): Do not give up if vsnprintf returns a negative count.
15243 Instead, grow the buffer. This ports to Windows vsnprintf, which
15244 does not conform to C99. Problem reported by Eli Zaretskii.
15245 Also, simplify the allocation scheme, by avoiding the need for
15246 calling realloc, and removing the ALLOCATED variable.
15248 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15250 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15251 But keep the doprint source code for now, as we might revamp it
15252 and use it again (Bug#8435).
15253 * lisp.h (doprnt): Remove.
15254 * Makefile.in (base_obj): Remove doprnt.o.
15255 * deps.mk (doprnt.o): Remove.
15257 error: Print 32- and 64-bit integers portably (Bug#8435).
15258 Without this change, on typical 64-bit hosts error ("...%d...", N)
15259 was used to print both 32- and 64-bit integers N, which relied on
15260 undefined behavior.
15261 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15262 * lisp.h (error, verror): Mark as printf-like functions.
15263 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15264 Report overflow in size calculations when allocating printf buffer.
15265 Do not truncate output string at its first null byte.
15266 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15267 Truncate the output at a character boundary, since vsnprintf does not
15269 * charset.c (check_iso_charset_parameter): Convert internal
15270 character to string before calling 'error', since %c now has the
15272 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15273 overflow when computing char to be passed to 'error'. Do not
15274 pass Lisp_Object to 'error'; pass the integer instead.
15275 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15276 formatted with plain %d.
15278 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15280 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15282 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15284 * xterm.c (x_catch_errors): Remove duplicate declaration.
15286 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15288 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15290 2011-04-10 Jim Meyering <meyering@redhat.com>
15292 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15293 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15294 return ssize_t not "int", and use size_t as the buffer length.
15295 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15296 * gnutls.h: Update declarations.
15297 * process.c (read_process_output): Use ssize_t, to match.
15298 (send_process): Likewise.
15300 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15302 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15304 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15306 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15307 Use unsigned char, to match FcChar8 type definition.
15309 * xterm.c (handle_one_xevent):
15310 * xmenu.c (create_and_show_popup_menu):
15311 * xselect.c (x_decline_selection_request)
15312 (x_reply_selection_request): Avoid type-punned deref of X events.
15314 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15316 Fix some uses of `int' instead of EMACS_INT.
15317 * search.c (string_match_1, fast_string_match)
15318 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15319 (scan_buffer, find_next_newline_no_quit)
15320 (find_before_next_newline, search_command, Freplace_match)
15321 (Fmatch_data): Make some `int' variables be EMACS_INT.
15323 * xdisp.c (display_count_lines): 3rd argument and return value now
15324 EMACS_INT. All callers changed.
15325 (pint2hrstr): Last argument is now EMACS_INT.
15327 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15328 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15329 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15330 (decode_coding_utf_16, decode_coding_emacs_mule)
15331 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15332 (decode_coding_ccl, decode_coding_charset)
15333 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15334 (decode_coding_iso_2022, decode_coding_emacs_mule)
15335 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15336 <char_offset, last_offset>: Declare EMACS_INT.
15337 (encode_coding_utf_8, encode_coding_utf_16)
15338 (encode_coding_emacs_mule, encode_invocation_designation)
15339 (encode_designation_at_bol, encode_coding_iso_2022)
15340 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15341 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15343 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15344 (encode_invocation_designation): Last argument P_NCHARS is now
15346 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15347 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15349 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15352 * ccl.c (Fccl_execute_on_string): Declare some variables
15355 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15357 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15359 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15361 * process.c (Fformat_network_address): Doc fix.
15363 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15365 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15367 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15369 * keyboard.c (read_char): Call Lisp function help-form-show,
15370 instead of using internal_with_output_to_temp_buffer.
15371 (Qhelp_form_show): New var.
15372 (syms_of_keyboard): Use DEFSYM macro.
15374 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15376 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15378 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15380 * process.c (Flist_processes): Remove to Lisp.
15381 (list_processes_1): Delete.
15383 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15385 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15387 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15389 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15391 Fix more problems found by GCC 4.6.0's static checks.
15393 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15395 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15397 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15399 * xdisp.c (vmessage): Mark as a printf-like function.
15401 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15403 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15405 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15406 printf-like functions.
15407 (tiff_load): Add casts to remove these marks before passing them
15408 to system-supplied API.
15410 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15412 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15413 This avoids several warnings with gcc -Wstrict-overflow.
15414 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15415 directly, rather than having caller test rule sign. This avoids
15416 some unnecessary tests.
15417 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15418 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15419 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
15421 * xfont.c (xfont_text_extents): Remove var that was set but not used.
15422 (xfont_open): Avoid unnecessary tests.
15424 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15426 * composite.h, composite.c (composition_gstring_put_cache):
15427 Use EMACS_INT, not int, for length.
15429 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15430 breaking out part of COMPOSITION_DECODE_RULE.
15431 (COMPOSITION_DECODE_RULE): Use it.
15432 * composite.c (get_composition_id): Remove unused local vars,
15433 by using the new macro.
15435 * textprop.c (set_text_properties_1): Change while to do-while,
15436 since the condition is always true at first.
15438 * intervals.c (graft_intervals_into_buffer): Mark var as used.
15439 (interval_deletion_adjustment): Return unsigned value.
15442 * process.c (list_processes_1, create_pty, read_process_output):
15443 (exec_sentinel): Remove vars that were set but not used.
15444 (create_pty): Remove unnecessary "volatile"s.
15445 (Fnetwork_interface_info): Avoid possibility of int overflow.
15446 (read_process_output): Do adaptive read buffering even if carryover.
15447 (read_process_output): Simplify nbytes computation if buffered.
15449 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15451 * syntax.c (scan_words): Remove var that was set but not used.
15452 (update_syntax_table): Use unsigned instead of int.
15454 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
15455 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
15456 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
15458 * print.c (print_error_message): Avoid int overflow.
15460 * font.c (font_list_entities): Redo for clarity,
15461 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15463 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15464 (font_score): Avoid potential overflow in diff calculation.
15466 * fns.c (substring_both): Remove var that is set but not used.
15467 (sxhash): Redo loop for clarity and to avoid wraparound warning.
15469 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15471 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15472 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15473 can always succeed if overflow has undefined behavior.
15475 * search.c (boyer_moore, wordify): Remove vars set but not used.
15476 (wordify): Omit three unnecessary tests.
15478 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15479 All callers changed. This avoids the need for an unused var.
15481 * casefiddle.c (casify_region): Remove var that is set but not used.
15483 * dired.c (file_name_completion): Remove var that is set but not used.
15485 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15487 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
15488 (Finsert_file_contents): Remove unnecessary code checking fd.
15490 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15491 Check for integer overflow on size calculations.
15493 * buffer.c (Fprevious_overlay_change): Remove var that is set
15496 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15497 Remove vars that are set but not used.
15498 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
15499 (timer_check_2): Mark vars as initialized.
15501 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15503 * image.c (lookup_image): Remove var that is set but not used.
15504 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
15506 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15507 that are set but not used.
15509 * xfns.c (make_invisible_cursor): Don't return garbage
15510 if XCreateBitmapFromData fails (Bug#8410).
15512 * xselect.c (x_get_local_selection, x_handle_property_notify):
15513 Remove vars that are set but not used.
15515 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
15516 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
15518 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15519 Remove var that is set but not used.
15520 (scroll_bar_windows_size): Now size_t, not int.
15521 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15522 Check for overflow.
15524 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15525 (map_tty_color) [!defined MSDOS]: Likewise.
15527 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15529 * coding.c: Remove vars that are set but not used.
15530 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15531 All callers changed.
15532 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15533 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15534 (decode_coding_charset): Remove vars that are set but not used.
15536 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15537 that is set but not used.
15539 * print.c (print_object): Remove var that is set but not used.
15541 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
15542 The gnulib version avoids calling malloc in the usual case,
15543 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15544 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15545 * filelock.c (current_lock_owner): Likewise.
15546 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15547 * sysdep.c: Include allocator.h, careadlinkat.h.
15548 (emacs_no_realloc_allocator): New static constant.
15549 (emacs_readlink): New function.
15550 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15551 ../lib/careadlinkat.h.
15553 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15555 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15556 first non-nil return value).
15558 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15560 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15561 if not defined (Bug#8403).
15563 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15565 * xdisp.c (display_count_lines): Remove parameter `start',
15566 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15567 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15568 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15569 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15570 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15571 and thereabouts. All callers changed.
15572 (get_per_char_metric): Remove parameter `f', unused since
15573 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15575 2011-04-02 Jim Meyering <meyering@redhat.com>
15577 do not dereference NULL upon failed strdup
15578 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15579 (ns_get_family): Likewise.
15581 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15583 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15585 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15587 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15590 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15592 Add lexical binding.
15594 * window.c (Ftemp_output_buffer_show): New fun.
15595 (Fsave_window_excursion):
15596 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15598 * lread.c (lisp_file_lexically_bound_p): New function.
15599 (Fload): Bind Qlexical_binding.
15600 (readevalloop): Remove `evalfun' arg.
15601 Bind Qinternal_interpreter_environment.
15602 (Feval_buffer): Bind Qlexical_binding.
15603 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15605 (syms_of_lread): Declare `lexical-binding'.
15607 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15609 * keyboard.c (eval_dyn): New fun.
15610 (menu_item_eval_property): Use it.
15612 * image.c (parse_image_spec): Use Ffunctionp.
15614 * fns.c (concat, mapcar1): Accept byte-code-functions.
15616 * eval.c (Fsetq): Handle lexical vars.
15617 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
15618 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
15619 (FletX, Flet): Obey lexical binding.
15620 (Fcommandp): Handle closures.
15621 (Feval): New `lexical' arg.
15622 (eval_sub): New function extracted from Feval. Use it almost
15623 everywhere where Feval was used. Look up vars in lexical env.
15625 (Ffunctionp): Move from subr.el.
15626 (Ffuncall): Handle closures.
15627 (apply_lambda): Remove `eval_flags'.
15628 (funcall_lambda): Handle closures and new byte-code-functions.
15629 (Fspecial_variable_p): New function.
15630 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15631 but without exporting it to Lisp.
15633 * doc.c (Fdocumentation, store_function_docstring):
15634 * data.c (Finteractive_form): Handle closures.
15636 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15639 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15641 (exec_byte_code): New function extracted from Fbyte_code to handle new
15642 calling convention for byte-code-functions. Add new byte-codes.
15644 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
15646 * alloc.c (Fmake_symbol): Init new `declared_special' field.
15648 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15650 * xdisp.c (redisplay_internal): Fix prototype.
15652 2011-03-31 Eli Zaretskii <eliz@gnu.org>
15654 * xdisp.c (SCROLL_LIMIT): New macro.
15655 (try_scrolling): Use it when setting scroll_limit.
15656 Limit scrolling to 100 screen lines.
15657 (redisplay_window): Even when falling back on "recentering",
15658 position point in the window according to scroll-conservatively,
15659 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
15661 (try_scrolling): When point is above the window, allow searching
15662 as far as scroll_max, or one screenful, to compute vertical
15663 distance from PT to the scroll margin position. This prevents
15664 try_scrolling from unnecessarily failing when
15665 scroll-conservatively is set to a value slightly larger than the
15666 window height. Clean up the case of PT below the margin at bottom
15667 of window: scroll_max can no longer be INT_MAX. When aggressive
15668 scrolling is in use, don't let point enter the opposite scroll
15669 margin as result of the scroll.
15670 (syms_of_xdisp) <scroll-conservatively>: Document the
15671 threshold of 100 lines for never-recentering scrolling.
15673 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15675 * dispextern.h (move_it_by_lines):
15676 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15677 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
15678 (message_log_check_duplicate): Remove parameters `prev_bol' and
15679 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15680 (redisplay_internal): Remove parameter `preserve_echo_area',
15681 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
15683 * indent.c (Fvertical_motion):
15684 * window.c (window_scroll_pixel_based, Frecenter):
15685 Don't pass `need_y_p' to `move_it_by_lines'.
15687 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15689 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15690 steal a few bits to be more compact.
15691 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15692 Remove unneeded casts.
15694 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15696 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15698 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15699 binding" message (bug#7967).
15701 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15703 Fix more problems found by GCC 4.6.0's static checks.
15705 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15706 Remove unused local var.
15708 * editfns.c (Fmessage_box): Remove unused local var.
15710 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15711 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15712 Omit unused local vars.
15713 * window.c (shrink_windows): Omit unused local var.
15714 * menu.c (digest_single_submenu): Omit unused local var.
15715 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15716 Omit unused local var.
15718 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15719 Don't assume string length fits in int.
15720 (keyremap_step, read_key_sequence): Use size_t for sizes.
15721 (read_key_sequence): Don't check last_real_key_start redundantly.
15723 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15724 instead of alloca (Bug#8344).
15726 * eval.c (Fbacktrace): Don't assume nargs fits in int.
15727 (Fbacktrace_frame): Don't assume nframes fits in int.
15729 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15731 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15734 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15736 * cm.c (calccost): Turn while-do into do-while, for clarity.
15738 * keyboard.c (syms_of_keyboard): Use the same style as later
15739 in this function when indexing through an array. This also
15740 works around GCC bug 48267.
15742 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15744 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15746 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15747 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15749 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15750 This avoids undefined behavior on integer overflow, and is a bit
15751 more convenient anyway since it is compared to a size_t variable.
15753 Variadic C functions now count arguments with size_t, not int.
15754 This avoids an unnecessary limitation on 64-bit machines, which
15755 caused (substring ...) to crash on large vectors (Bug#8344).
15756 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15757 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
15758 All variadic functions and their callers changed accordingly.
15759 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15760 * data.c (arith_driver, float_arith_driver): Likewise.
15761 * editfns.c (general_insert_function): Likewise.
15762 * eval.c (struct backtrace.nargs, interactive_p)
15763 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15764 (funcall_lambda, mark_backtrace): Likewise.
15765 * fns.c (concat): Likewise.
15766 * frame.c (x_set_frame_parameters): Likewise.
15767 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15768 0 if not found, not -1. All callers changed.
15770 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15771 (stack_copy_size): Now size_t, not int.
15772 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15774 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15776 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15777 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15778 All callers changed.
15780 * lisp.h (multibyte_char_to_unibyte):
15781 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15782 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15783 * character.h (CHAR_TO_BYTE8):
15784 * cmds.c (internal_self_insert):
15785 * editfns.c (general_insert_function):
15786 * keymap.c (push_key_description):
15787 * search.c (Freplace_match):
15788 * xdisp.c (message_dolog, set_message_1): All callers changed.
15790 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15792 * keyboard.c (safe_run_hook_funcall): New function.
15793 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15794 don't set the hook to nil, but remove the offending function instead.
15795 (Qcommand_hook_internal): Remove, unused.
15796 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15797 Vcommand_hook_internal.
15799 * eval.c (enum run_hooks_condition): Remove.
15800 (funcall_nil, funcall_not): New functions.
15801 (run_hook_with_args): Call each function through a `funcall' argument.
15802 Remove `cond' argument, now redundant.
15803 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15804 (Frun_hook_with_args_until_failure): Adjust accordingly.
15805 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15807 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15809 * dispextern.h (string_buffer_position): Remove declaration.
15811 * print.c (strout): Remove parameter `multibyte', unused since
15812 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15814 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15815 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15816 All callers changed.
15818 * w32.c (_wsa_errlist): Use braces for struct initializers.
15820 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15821 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15822 All callers changed.
15823 (string_buffer_position): Likewise. Also, make static (it's never
15824 used outside xdisp.c).
15825 (cursor_row_p): Remove parameter `w', unused since
15826 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15827 (decode_mode_spec): Remove parameter `precision', introduced during
15828 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15829 All callers changed.
15831 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15833 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15835 2011-03-27 Anders Lindgren <andlind@gmail.com>
15837 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15838 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15839 (ns_update_auto_hide_menu_bar): New functions.
15840 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15841 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15842 ns_constrain_all_frames.
15843 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15844 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15846 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15848 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15850 2011-03-27 Glenn Morris <rgm@gnu.org>
15852 * syssignal.h: Replace RETSIGTYPE with void.
15853 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15854 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15855 Replace SIGTYPE with void everywhere.
15856 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15857 * s/template.h (SIGTYPE): Remove commented out definition.
15859 2011-03-26 Eli Zaretskii <eliz@gnu.org>
15861 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15862 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15864 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
15866 * w32.c (read_unc_volume): Use parameter `henum', instead of
15867 global variable `wget_enum_handle'.
15869 * keymap.c (describe_vector): Remove parameters `indices' and
15870 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15871 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15873 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15875 * keyboard.c (timer_check): Remove parameter `do_it_now',
15876 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15877 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15878 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15880 * keyboard.c (read_char):
15881 * w32menu.c (w32_menu_display_help):
15882 * xmenu.c (show_help_event, menu_help_callback):
15883 Adjust calls to `show_help_echo'.
15885 * gtkutil.c (xg_maybe_add_timer):
15886 * keyboard.c (readable_events):
15887 * process.c (wait_reading_process_output):
15888 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15890 * insdel.c (adjust_markers_gap_motion):
15891 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15892 (gap_left, gap_right): Don't call it.
15894 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
15896 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15897 incurred during fontification.
15899 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15901 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15902 (DEFVAR_PER_BUFFER): Don't pass it.
15904 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15905 (scrolling_window): Don't pass it.
15907 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15909 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15911 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15913 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15914 of variables specific to SELinux and computation of `encoded_absname'.
15916 * image.c (XPutPixel): Remove unused variable `height'.
15918 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15920 * unexw32.c (get_section_info): Remove unused variable `section'.
15922 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15923 (system_process_attributes): Remove unused variable `sess'.
15924 (sys_read): Remove unused variable `err'.
15926 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15927 (w32_wnd_proc): Remove unused variable `isdead'.
15928 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15929 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15930 (x_create_tip_frame): Remove unused variable `tem'.
15932 * w32inevt.c (w32_console_read_socket):
15933 Remove unused variable `no_events'.
15935 * w32term.c (x_draw_composite_glyph_string_foreground):
15936 Remove unused variable `width'.
15938 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
15940 * w32term.c (x_set_glyph_string_clipping):
15941 Don't pass uninitialized region to CombineRgn.
15943 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
15945 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15946 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15947 (Fx_close_connection): Remove unused variable `i'.
15949 * w32font.c (w32font_draw): Return number of glyphs.
15950 (w32font_open_internal): Remove unused variable `i'.
15951 (w32font_driver): Add missing initializer.
15953 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15954 (fill_in_menu): Remove unused variable `items_added'.
15956 * w32term.c (last_mouse_press_frame): Remove static global variable.
15957 (w32_clip_to_row): Remove unused variable `f'.
15958 (x_delete_terminal): Remove unused variable `i'.
15960 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15961 (NOTHING): Remove unused static global variable.
15962 (uniscribe_check_otf): Remove unused variable `table'.
15963 (uniscribe_font_driver): Add missing initializers.
15965 2011-03-23 Julien Danjou <julien@danjou.info>
15967 * term.c (Fsuspend_tty, Fresume_tty):
15968 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15969 * window.c (temp_output_buffer_show):
15970 * insdel.c (signal_before_change):
15971 * frame.c (Fhandle_switch_frame):
15972 * fileio.c (Fdo_auto_save):
15973 * emacs.c (Fkill_emacs):
15974 * editfns.c (save_excursion_restore):
15975 * cmds.c (internal_self_insert):
15976 * callint.c (Fcall_interactively):
15977 * buffer.c (Fkill_all_local_variables):
15978 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15980 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
15981 unconditionally since it does the check itself.
15983 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
15985 Fix more problems found by GCC 4.5.2's static checks.
15987 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15988 the first time through the loop, since we know p0 < p1 then.
15989 This also avoids a gcc -Wstrict-overflow warning.
15991 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15992 leading to a memory leak, possible in functions like
15993 load_charset_map_from_file that can allocate an unbounded number
15994 of objects (Bug#8318).
15996 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15997 that could (at least in theory) be that large.
15999 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16000 This is less likely to overflow, and avoids undefined behavior if
16001 overflow does occur. All callers changed. Use strtoul to scan
16002 for the unsigned long integer.
16003 (pint2hrstr): Simplify and tune code slightly.
16004 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16006 * scroll.c (do_scrolling): Work around GCC bug 48228.
16007 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16009 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16010 This also avoids a warning with gcc -Wstrict-overflow.
16011 (validate_x_resource_name): Simplify count usage.
16012 This also avoids a warning with gcc -Wstrict-overflow.
16014 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16017 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16019 * process.c (Fmake_network_process): Use socklen_t, not int,
16020 where POSIX says socklen_t is required in portable programs.
16021 This fixes a porting bug on hosts like 64-bit HP-UX, where
16022 socklen_t is wider than int (Bug#8277).
16023 (Fmake_network_process, server_accept_connection):
16024 (wait_reading_process_output, read_process_output):
16027 * process.c: Rename or move locals to avoid shadowing.
16028 (list_processes_1, Fmake_network_process):
16029 (read_process_output_error_handler, exec_sentinel_error_handler):
16030 Rename or move locals.
16031 (Fmake_network_process): Define label "retry_connect" only if needed.
16032 (Fnetwork_interface_info): Fix pointer signedness.
16033 (process_send_signal): Add cast to avoid pointer signedness problem.
16034 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16035 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16037 Make tparam.h and terminfo.c consistent.
16038 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16039 Include tparam.h instead, since it declares them.
16040 * cm.h (PC): Remove extern decl; tparam.h now does this.
16041 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16042 * terminfo.c: Include tparam.h, to check interfaces.
16043 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16044 (tparam): Adjust signature to match interface in tparam.h;
16045 this removes some undefined behavior. Check that outstring and len
16046 are zero, which they always are with Emacs.
16047 * tparam.h (PC, BC, UP): New extern decls.
16049 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16050 (xftfont_open): Rename locals to avoid shadowing.
16052 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16053 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16054 (OTF_TAG_SYM): Omit macro if not needed.
16055 (ftfont_list): Remove unused local.
16056 (get_adstyle_property, ftfont_pattern_entity):
16057 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16058 Rename locals to avoid shadowing.
16060 * xfont.c (xfont_list_family): Mark var as initialized.
16062 * xml.c (make_dom): Now static.
16064 * composite.c (composition_compute_stop_pos): Rename local to
16066 (composition_reseat_it): Remove unused locals.
16067 (find_automatic_composition, composition_adjust_point): Likewise.
16068 (composition_update_it): Mark var as initialized.
16069 (find_automatic_composition): Mark vars as initialized,
16070 with a FIXME (Bug#8290).
16072 character.h: Rename locals to avoid shadowing.
16073 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16074 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16075 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16076 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16077 to avoid shadowing.
16079 * textprop.c (property_change_between_p): Remove; unused.
16081 * intervals.c (interval_start_pos): Now static.
16083 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16085 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16086 Rename locals to avoid shadowing.
16088 * sound.c (wav_play, au_play, Fplay_sound_internal):
16089 Fix pointer signedness.
16090 (alsa_choose_format): Remove unused local var.
16091 (wav_play): Initialize a variable to 0, to prevent undefined
16092 behavior (Bug#8278).
16094 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16096 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16098 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16099 clobbering (Bug#8298).
16100 * sysdep.c (sys_subshell): Likewise.
16101 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16103 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16104 This should get cleaned up, so that child_setup has the
16105 same signature on all platforms.
16107 * callproc.c (call_process_cleanup): Now static.
16108 (relocate_fd): Rename locals to avoid shadowing.
16110 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16112 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16113 not to be necessary, and produces flickering.
16115 2011-03-20 Glenn Morris <rgm@gnu.org>
16117 * config.in: Remove file.
16119 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16121 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16122 are now in src/globals.h.
16123 (syms_of_minibuf): Remove spurious & from previous change.
16125 2011-03-20 Leo Liu <sdl.web@gmail.com>
16127 * minibuf.c (completing-read-function): New variable.
16128 (completing-read-default): Rename from completing-read.
16129 (completing-read): Call completing-read-function.
16131 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16133 * xfaces.c (Fx_load_color_file):
16134 Read color file from absolute filename (bug#8250).
16136 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16138 * makefile.w32-in: Update dependencies.
16140 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16142 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16144 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16146 Fix more problems found by GCC 4.5.2's static checks.
16148 * process.c (make_serial_process_unwind, send_process_trap):
16149 (sigchld_handler): Now static.
16151 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16152 That way, the code declares only the vars that it needs.
16153 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16154 * s/cygwin.h (PTY_ITERATION): Likewise.
16155 * s/darwin.h (PTY_ITERATION): Likewise.
16156 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16158 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16159 * process.c (allocate_pty): Don't declare stb unless it's needed.
16161 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16162 (CONSTANTLIM): Remove; unused.
16163 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16164 Define only if needed.
16166 * unexelf.c (unexec): Name an expression,
16167 to avoid gcc -Wbad-function-cast warning.
16168 Use a different way to cause a compilation error if anyone uses
16169 n rather than nn, a way that does not involve shadowing.
16170 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16172 * deps.mk (unexalpha.o): Remove; unused.
16174 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16175 * unexec.h: New file.
16176 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16177 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16178 Depend on unexec.h.
16179 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16180 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16181 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16182 Change as necessary to match prototype in unexec.h.
16184 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16186 (back_comment, skip_chars): Mark vars as initialized.
16188 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16189 Rename locals to avoid shadowing.
16191 * lread.c (read1): Rewrite so as not to use empty "else".
16192 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16194 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16196 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16197 warning when compiling print.c.
16199 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16200 instead of using an uninitialized var.
16201 (font_sort_entities): Mark var as initialized.
16203 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16205 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16206 pointers to constants.
16207 (font_parse_fcname): Remove unused vars.
16208 (font_delete_unmatched): Now static.
16209 (font_get_spec): Remove; unused.
16210 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16211 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16212 Rename or move locals to avoid shadowing.
16214 * fns.c (require_nesting_list, require_unwind): Now static.
16215 (Ffillarray): Rename locals to avoid shadowing.
16217 * floatfns.c (domain_error2): Define only if needed.
16218 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16220 * alloc.c (mark_backtrace): Move decl from here ...
16221 * lisp.h: ... to here, so that it can be checked.
16223 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16224 (Fdefvar): Rewrite so as not to use empty "else".
16225 (lisp_indirect_variable): Name an expression,
16226 to avoid gcc -Wbad-function-cast warning.
16227 (Fdefvar): Rename locals to avoid shadowing.
16229 * callint.c (quotify_arg, quotify_args): Now static.
16230 (Fcall_interactively): Rename locals to avoid shadowing.
16231 Use const pointer when appropriate.
16233 * lisp.h (get_system_name, get_operating_system_release):
16234 Move decls here, to check interfaces.
16235 * process.c (get_operating_system_release): Move decl to lisp.h.
16236 * xrdb.c (get_system_name): Likewise.
16237 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16238 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16239 some of which prompt warnings from gcc -Wbad-function-cast.
16240 (Fformat_time_string, Fencode_time, Finsert_char):
16241 (Ftranslate_region_internal, Fformat):
16242 Rename or remove local vars to avoid shadowing.
16243 (Ftranslate_region_internal): Mark var as initialized.
16245 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16248 * lisp.h (eassert): Check that the argument compiles, even if
16249 ENABLE_CHECKING is not defined.
16251 * data.c (Findirect_variable): Name an expression, to avoid
16252 gcc -Wbad-function-cast warning.
16253 (default_value, arithcompare, arith_driver, arith_error): Now static.
16254 (store_symval_forwarding): Rename local to avoid shadowing.
16255 (Fmake_variable_buffer_local, Fmake_local_variable):
16256 Mark variables as initialized.
16257 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16259 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16260 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16261 Rename locals to avoid shadowing.
16262 (mark_stack): Move local variables into the #ifdef region where
16264 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16265 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16267 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16268 (GC_STRING_CHARS): Remove; not used.
16269 (Fmemory_limit): Cast sbrk's returned value to char *.
16271 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16272 avoids undefined behavior in theory.
16274 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16276 Use functions, not macros, for up- and down-casing (Bug#8254).
16277 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16278 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16279 to use the following functions instead of these macros.
16280 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16281 EMACS_INT, since callers assume the returned value fits in int.
16282 (upcase1): Likewise, for UPCASE_TABLE.
16283 (uppercasep, lowercasep, upcase): New static inline functions.
16284 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16285 the race-condition problem in the old DOWNCASE.
16287 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16288 Rename locals to avoid shadowing.
16289 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16290 (regex_compile, re_search_2, re_match_2_internal):
16291 Remove unused local vars.
16292 (FREE_VAR): Rewrite so as not to use empty "else",
16293 which gcc can warn about.
16294 (regex_compile, re_match_2_internal): Mark locals as initialized.
16295 (RETALLOC_IF): Define only if needed.
16296 (WORDCHAR_P): Likewise. This one is never needed, but is used
16297 only in a comment talking about a compiler bug, so put inside
16298 the #if 0 of that comment.
16299 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16300 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16303 * search.c (boyer_moore): Rename locals to avoid shadowing.
16304 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16305 (PREV_CHAR_BOUNDARY): Likewise.
16307 * search.c (simple_search): Remove unused var.
16309 * dired.c (compile_pattern): Move decl from here ...
16310 * lisp.h: ... to here, so that it can be checked.
16311 (struct re_registers): New forward decl.
16313 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16315 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16317 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16318 Rename locals to avoid shadowing.
16319 (Fvertical_motion): Mark locals as initialized.
16321 * casefiddle.c (casify_object, casify_region): Now static.
16322 (casify_region): Mark local as initialized.
16324 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16326 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16327 New macros, so that the caller can use some names other than
16328 gcpro1, gcpro2, etc.
16329 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16331 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16332 argument, for consistency with GCPRO2_VAR, etc: it is now the
16333 prefix of the variable, not the variable itself. All uses
16335 * dired.c (directory_files_internal, file_name_completion):
16336 Rename locals to avoid shadowing.
16338 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16339 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16340 dired.c's scmp function, had undefined behavior.
16341 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16342 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16343 * buffer.h: ... to here, because these macros use current_buffer,
16344 and the new implementation with inline functions needs to have
16345 current_buffer in scope now, rather than later when the macros
16347 (downcase, upcase1): New static inline functions.
16348 (DOWNCASE, UPCASE1): Reimplement using these functions.
16349 This avoids undefined behavior in expressions like
16350 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16351 from race conditions in accessing the global variables
16352 case_temp1 and case_temp2.
16353 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16354 * lisp.h (case_temp1, case_temp2): Remove their decls.
16355 * character.h (ASCII_CHAR_P): Move from here ...
16356 * lisp.h: ... to here, so that the inline functions mentioned
16357 above can use them.
16359 * dired.c (directory_files_internal_unwind): Now static.
16361 * fileio.c (file_name_as_directory, directory_file_name):
16362 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16364 (file_name_as_directory): Use const pointers when appropriate.
16365 (Fexpand_file_name): Likewise. In particular, newdir might
16366 point at constant storage, so make it a const pointer.
16367 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16368 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16370 (Fset_file_times, Finsert_file_contents, auto_save_error):
16371 Rename locals to avoid shadowing.
16373 * minibuf.c (choose_minibuf_frame_1): Now static.
16374 (Ftry_completion, Fall_completions): Rename or remove locals
16375 to avoid shadowing.
16377 * marker.c (bytepos_to_charpos): Remove; unused.
16379 * lisp.h (verify_bytepos, count_markers): New decls,
16380 so that gcc does not warn that these functions aren't declared.
16382 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16383 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16384 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16385 (copy_text): Remove unused local var.
16387 * filelock.c (within_one_second): Now static.
16388 (lock_file_1): Rename local to avoid shadowing.
16390 * buffer.c (fix_overlays_before): Mark locals as initialized.
16391 (fix_start_end_in_overlays): Likewise. This function should be
16392 simplified by using pointers-to-pointers, but that's a different
16394 (switch_to_buffer_1): Now static.
16395 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16396 (report_overlay_modification): Rename locals to avoid shadowing.
16398 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16399 Fix pointer signedness issue.
16400 (sys_subshell): Mark local as volatile if checking for lint,
16401 to suppress a gcc -Wclobbered warning that does not seem to be right.
16402 (MAXPATHLEN): Define only if needed.
16404 * process.c (serial_open, serial_configure): Move decls from here ...
16405 * systty.h: ... to here, so that they can be checked.
16407 * fns.c (get_random, seed_random): Move extern decls from here ...
16408 * lisp.h: ... to here, so that they can be checked.
16410 * sysdep.c (reset_io): Now static.
16411 (wait_for_termination_signal): Remove; unused.
16413 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16414 (copy_keymap_item, append_key, push_text_char_description):
16416 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
16417 (DENSE_TABLE_SIZE): Remove; unused.
16418 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16419 (describe_map_tree):
16420 Rename locals to avoid shadowing.
16422 * keyboard.c: Declare functions static if they are not used elsewhere.
16423 (echo_char, echo_dash, cmd_error, top_level_2):
16424 (poll_for_input, handle_async_input): Now static.
16425 (read_char, kbd_buffer_get_event, make_lispy_position):
16426 (make_lispy_event, make_lispy_movement, apply_modifiers):
16427 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16428 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16429 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
16430 (read_key_sequence, read_char): Mark locals as initialized.
16431 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
16433 * keyboard.h (make_ctrl_char): New decl.
16434 (mark_kboards): Move decl here ...
16435 * alloc.c (mark_kboards): ... from here.
16437 * lisp.h (force_auto_save_soon): New decl.
16439 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
16440 (DEFINE_DUMMY_FUNCTION): New macro.
16441 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16443 (main): Add casts to avoid warnings
16444 if GCC considers string literals to be constants.
16446 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16448 * dbusbind.c: Pointer signedness fixes.
16449 (xd_signature, xd_append_arg, xd_initialize):
16450 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16451 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16452 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16453 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16455 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16456 if GCC considers string literals to be constants.
16457 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
16459 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16461 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16462 (print_preprocess, print_object): New macro to fix last change.
16464 * print.c (print_preprocess): Don't forget font objects.
16466 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
16468 * emacs.c (USAGE3): Doc fixes.
16470 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16472 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16475 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
16477 * lisp.h (VWindow_system, Qfile_name_history):
16478 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16479 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16480 (w32_system_caret_x, w32_system_caret_y): Declare extern.
16482 * w32select.c: Don't #include "keyboard.h".
16483 (run_protected): Add extern declaration for waiting_for_input.
16485 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16486 * w32console.c (detect_input_pending, read_input_pending)
16487 (encode_terminal_code):
16488 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16489 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16490 (w32_system_caret_y, Qfile_name_history):
16491 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16492 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16493 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16494 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16495 * w32proc.c (Qlocal, report_file_error):
16496 * w32term.c (Vwindow_system, updating_frame):
16497 * w32uniscribe.c (initialized, uniscribe_font_driver):
16498 Remove unneeded extern declarations.
16500 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
16502 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
16504 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
16506 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16507 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16508 These macros can no longer be used for assignment.
16510 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16511 Assign struct members directly, instead of using BUF_BEGV etc.
16512 (record_buffer_markers, fetch_buffer_markers): New functions for
16513 recording and fetching special buffer markers.
16514 (set_buffer_internal_1, set_buffer_temp): Use them.
16516 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16518 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16520 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16521 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16523 * xdisp.c (hscroll_window_tree):
16524 (reconsider_clip_changes): Use PT instead of BUF_PT.
16526 2011-03-13 Eli Zaretskii <eliz@gnu.org>
16528 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16529 $(EMACS_ROOT)/lib/intprops.h.
16531 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16533 Fix more problems found by GCC 4.5.2's static checks.
16535 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16536 to unsigned char * to avoid compiler diagnostic.
16537 (xg_free_frame_widgets): Make it clear that a local variable is
16538 needed only if USE_GTK_TOOLTIP.
16539 (gdk_window_get_screen): Make it clear that this macro is needed
16540 only if USE_GTK_TOOLTIP.
16541 (int_gtk_range_get_value): New function, which avoids a diagnostic
16542 from gcc -Wbad-function-cast.
16543 (xg_set_toolkit_scroll_bar_thumb): Use it.
16544 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16545 diagnostic from gcc -Wbad-function-cast.
16546 (get_utf8_string, xg_get_file_with_chooser):
16547 Rename locals to avoid shadowing.
16548 (create_dialog): Move locals to avoid shadowing.
16550 * xgselect.c (xg_select): Remove unused var.
16552 * image.c (four_corners_best): Mark locals as initialized.
16553 (gif_load): Initialize transparent_p to zero (Bug#8238).
16554 Mark another local as initialized.
16555 (my_png_error, my_error_exit): Mark with NO_RETURN.
16557 * image.c (clear_image_cache): Now static.
16558 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
16559 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
16560 (x_edge_detection): Remove unnecessary cast that
16561 gcc -Wbad-function-cast diagnoses.
16562 (gif_load): Fix pointer signedness.
16563 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16564 (jpeg_load, gif_load): Rename locals to avoid shadowing.
16566 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
16568 Improve quality of tests for time stamp overflow.
16569 For example, without this patch (encode-time 0 0 0 1 1
16570 1152921504606846976) returns the obviously-bogus value (-948597
16571 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16572 reports time overflow. See
16573 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
16574 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16575 * editfns.c: Include limits.h and intprops.h.
16576 (TIME_T_MIN, TIME_T_MAX): New macros.
16577 (time_overflow): Move earlier, to before first use.
16578 (hi_time, lo_time): New functions, for an accurate test for
16579 out-of-range times.
16580 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16581 (Fget_internal_run_time): Don't assume time_t fits in int.
16582 (make_time): Use list2 instead of Fcons twice.
16583 (Fdecode_time): More accurate test for out-of-range times.
16584 (check_tm_member): New function.
16585 (Fencode_time): Use it, to test for out-of-range times.
16586 (lisp_time_argument): Don't rely on undefined left-shift and
16587 right-shift behavior when checking for time stamp overflow.
16589 * editfns.c (time_overflow): New function, refactoring common code.
16590 (Fformat_time_string, Fdecode_time, Fencode_time):
16591 (Fcurrent_time_string): Use it.
16593 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16594 * dired.c (make_time): Move to ...
16595 * editfns.c (make_time): ... here.
16596 * systime.h: Note the move.
16598 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16600 * fringe.c (update_window_fringes): Remove unused variables.
16602 * unexmacosx.c (copy_data_segment): Also copy __got section.
16605 2011-03-12 Eli Zaretskii <eliz@gnu.org>
16607 * termcap.c [MSDOS]: Include "msdos.h".
16608 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16609 Constify `char *' arguments and their references according to
16610 prototypes in tparam.h.
16612 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
16614 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16615 Adapt all references accordingly.
16617 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16619 2011-03-11 Tom Tromey <tromey@redhat.com>
16621 * buffer.c (syms_of_buffer): Remove obsolete comment.
16623 2011-03-11 Eli Zaretskii <eliz@gnu.org>
16625 * termhooks.h (encode_terminal_code): Declare prototype.
16627 * msdos.c (encode_terminal_code): Don't declare prototype.
16629 * term.c (encode_terminal_code): Now external again, used by
16630 w32console.c and msdos.c.
16632 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16633 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
16635 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
16637 Fix some minor problems found by GCC 4.5.2's static checks.
16639 * fringe.c (update_window_fringes): Mark locals as initialized
16641 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
16643 * alloc.c (mark_fringe_data): Move decl from here ...
16644 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16645 to check its interface.
16646 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16648 * fontset.c (free_realized_fontset): Now static.
16649 (Fset_fontset_font): Rename local to avoid shadowing.
16650 (fontset_font): Mark local as initialized.
16651 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
16653 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16655 * xselect.c (x_disown_buffer_selections): Remove; not used.
16656 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
16657 (x_own_selection, Fx_disown_selection_internal): Rename locals
16658 to avoid shadowing.
16659 (x_handle_dnd_message): Remove local to avoid shadowing.
16661 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16662 so that the caller can use some name other than gcpro1.
16663 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
16664 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16665 (Fx_backspace_delete_keys_p):
16666 Use them to avoid shadowing, and rename vars to avoid shadowing.
16667 (x_decode_color, x_set_name, x_window): Now static.
16668 (Fx_create_frame): Add braces to silence GCC warning.
16669 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
16670 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16671 Remove unused locals.
16672 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16673 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16674 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16677 * xterm.h (x_mouse_leave): New decl.
16679 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16680 Remove unused functions.
16681 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16682 (x_calc_absolute_position): Now static.
16683 (XTread_socket): Don't define label "out" unless it's used.
16684 Don't declare local "event" unless it's used.
16685 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16686 unless they are used.
16687 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16688 (x_fatal_error_signal): Remove; not used.
16689 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16690 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16691 (x_error_catcher, x_connection_closed, x_error_handler):
16692 (x_error_quitter, xembed_send_message, x_iconify_frame):
16693 (my_log_handler): Rename locals to avoid shadowing.
16694 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
16695 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
16697 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16698 Rename or move locals to avoid shadowing.
16699 (tty_defined_color, merge_face_heights): Now static.
16700 (free_realized_faces_for_fontset): Remove; not used.
16701 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16702 does not deduce is never used uninitialized.
16703 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16704 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
16706 * terminal.c (store_terminal_param): Now static.
16708 * xmenu.c (menu_highlight_callback): Now static.
16709 (set_frame_menubar): Remove unused local.
16710 (xmenu_show): Rename parameter to avoid shadowing.
16711 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16712 since they might point to immutable storage.
16713 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16714 since it's unused otherwise.
16716 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
16717 Add a FIXME, since the code still doesn't look right. (Bug#8215)
16718 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16719 avoids a gcc -Wuninitialized diagnostic.
16720 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
16721 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16722 does not deduce are never used uninitialized.
16724 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16726 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
16727 * window.c (window_loop, size_window):
16728 (run_window_configuration_change_hook, enlarge_window): Likewise.
16730 * window.c (display_buffer): Now static.
16731 (size_window): Mark variables that gcc -Wuninitialized
16732 does not deduce are never used uninitialized.
16733 * window.h (check_all_windows): New decl, to forestall
16734 gcc -Wmissing-prototypes diagnostic.
16735 * dispextern.h (bidi_dump_cached_states): Likewise.
16737 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16739 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
16740 Include <limits.h>.
16741 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16742 and to avoid gcc -Wuninitialized warning.
16743 (load_charset_map): Mark variables that gcc -Wuninitialized
16744 does not deduce are never used uninitialized.
16745 (load_charset): Abort instead of using uninitialized var (Bug#8229).
16747 * coding.c (coding_set_source, coding_set_destination):
16748 Use "else { /* comment */ }" rather than "else /* comment */;"
16749 for clarity, and to avoid gcc -Wempty-body warning.
16750 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16751 a block, when the outer 'i' will do.
16752 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16753 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16754 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16755 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16756 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16757 Rename locals to avoid shadowing.
16758 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
16759 * coding.c (emacs_mule_char, encode_invocation_designation):
16760 Now static, since they're not used elsewhere.
16761 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
16762 (decode_coding_object, encode_coding_object, detect_coding_system):
16763 (decode_coding_emacs_mule): Mark variables that gcc
16764 -Wuninitialized does not deduce are never used uninitialized.
16765 (detect_coding_iso_2022): Initialize a local variable that might
16766 be used uninitialized. Leave a FIXME because it's not clear that
16767 this initialization is needed. (Bug#8211)
16768 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16769 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16770 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16771 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16772 Remove unused macros.
16774 * category.c (hash_get_category_set): Remove unused local var.
16775 (copy_category_table): Now static, since it's not used elsewhere.
16776 * character.c (string_count_byte8): Likewise.
16778 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16779 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16781 * chartab.c (copy_sub_char_table): Now static, since it's not used
16783 (sub_char_table_ref_and_range, char_table_ref_and_range):
16784 Rename locals to avoid shadowing.
16785 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
16787 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
16788 (BIDI_BOB): Remove unused macro.
16790 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16791 deduce are never used uninitialized.
16792 * term.c (encode_terminal_code): Likewise.
16794 * term.c (encode_terminal_code): Now static. Remove unused local.
16796 * tparam.h: New file.
16797 * term.c, tparam.h: Include it.
16798 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16799 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16800 Move these decls to tparam.h, and make them agree with what
16801 is actually in tparam.c. The previous trick of using incompatible
16802 decls in different modules does not conform to the C standard.
16803 All callers of tparam changed to use tparam's actual API.
16804 * tparam.c (tparam1, tparam, tgoto):
16805 Use const pointers where appropriate.
16807 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16808 * cm.h (struct cm): Likewise.
16809 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16810 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16811 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16812 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16813 (turn_on_face, init_tty): Likewise.
16814 * termchar.h (struct tty_display_info): Likewise.
16816 * term.c (term_mouse_position): Rename local to avoid shadowing.
16818 * alloc.c (mark_ttys): Move decl from here ...
16819 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16821 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16823 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16825 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
16827 * search.c (compile_pattern_1): Remove argument regp, unused since
16828 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16829 (compile_pattern): Don't pass it.
16831 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16833 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16834 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16836 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16838 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16840 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16841 gdk_window_get_screen, gdk_window_get_geometry,
16842 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16843 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16844 (xg_get_pixbuf_from_pixmap): New function.
16845 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16846 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16847 Call xg_get_pixbuf_from_pixmap instead of
16848 gdk_pixbuf_get_from_drawable.
16849 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16850 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16851 (xg_check_special_colors): Use GtkStyleContext and its functions
16853 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16854 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16855 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
16856 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16857 Call gtk_widget_get_preferred_size.
16858 (xg_frame_resized): gdk_window_get_geometry only takes 5
16860 (xg_win_to_widget, xg_event_is_for_menubar):
16861 Call gdk_x11_window_lookup_for_display.
16862 (xg_set_widget_bg): New function.
16863 (delete_cb): New function.
16864 (xg_create_frame_widgets): Connect delete-event to delete_cb.
16865 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
16866 (xg_set_background_color): Call xg_set_widget_bg.
16867 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16868 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16869 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16870 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16872 (update_frame_tool_bar): Call gtk_widget_hide.
16873 (xg_initialize): Use GDK_KEY_g.
16875 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16877 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16879 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16880 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16881 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16883 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
16885 * w32xfns.c (select_palette): Check success of RealizePalette against
16886 GDI_ERROR, not zero.
16888 See ChangeLog.11 for earlier changes.
16890 ;; Local Variables:
16894 Copyright (C) 2011-2012 Free Software Foundation, Inc.
16896 This file is part of GNU Emacs.
16898 GNU Emacs is free software: you can redistribute it and/or modify
16899 it under the terms of the GNU General Public License as published by
16900 the Free Software Foundation, either version 3 of the License, or
16901 (at your option) any later version.
16903 GNU Emacs is distributed in the hope that it will be useful,
16904 but WITHOUT ANY WARRANTY; without even the implied warranty of
16905 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16906 GNU General Public License for more details.
16908 You should have received a copy of the GNU General Public License
16909 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.