More signal-handler cleanup.
[bpt/emacs.git] / src / ChangeLog
1 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2
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".
17
18 2012-09-07 Eli Zaretskii <eliz@gnu.org>
19
20 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
21
22 * w32.c (sigemptyset): Empty the set.
23 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
24
25 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
26
27 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
28
29 * alloc.c (mark_buffer): Revert unsafe marking optimization.
30 (mark_object): Likewise for frame objects.
31
32 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
33
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.
37
38 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
39
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.
58 All uses replaced.
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
64 old member 'handler'.
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.
91
92 2012-09-06 Eli Zaretskii <eliz@gnu.org>
93
94 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
95 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
96
97 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
98
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
106 not here.
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.
111
112 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
113
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.
134 All users removed.
135 * fontset.c, xftfont.c: Omit unnecessary static decls.
136
137 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
138
139 * alloc.c (mark_object): Revert window marking code
140 since it's unsafe for the Fset_window_configuration.
141
142 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
143
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]:
174 Move to sysdep.c.
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
181 contents.
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.
191
192 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
193
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.
201
202 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
203
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.
207
208 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
209
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.
213
214 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
215
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)
224 (Fdo_auto_save):
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.
240
241 * xdisp.c (set_message): Simplify and reindent last change.
242
243 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
244
245 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
246
247 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
248
249 * eval.c (call_debugger): Make the function non-static so that we
250 can call it from set_message.
251
252 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
253 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
254
255 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
256
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
262 do most of the work.
263 (fatal_error_backtrace): New function, taken from the guts
264 of the old fatal_error_signal, but with a new option to output
265 a backtrace.
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.
273
274 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
275
276 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
277 eager (load-time) macro-expansion.
278 * lisp.mk (lisp): Add macroexp.
279
280 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
281
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.
299
300 2012-09-04 Eli Zaretskii <eliz@gnu.org>
301
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)
307
308 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
309
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.
321
322 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
323
324 Fix minor problem found by static checking.
325 * buffer.c (Fdelete_all_overlays): Return nil.
326
327 2012-09-03 Martin Rudalics <rudalics@gmx.at>
328
329 * buffer.c (Fdelete_all_overlays): New function.
330
331 2012-09-03 Chong Yidong <cyd@gnu.org>
332
333 * gtkutil.c: Add extern decl for Qxft.
334
335 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
336
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.
349 All callers changed.
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
359 of incrementing it.
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.
363
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):
370 * font.h (Qxft):
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]:
376 * doc.c (Qclosure):
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):
392 Now static.
393 * xfaces.c: Remove unnecessary static decls.
394 * xterm.c (updating_frame): Remove decl of nonexistent object.
395
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.
399
400 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
401
402 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
403
404 * frame.h: Add missing prototype for x_wm_set_size_hint.
405
406 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
407
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.
434
435 2012-09-02 Chong Yidong <cyd@gnu.org>
436
437 * keymap.c (push_key_description): Print M-TAB as C-M-i
438 (Bug#11758).
439
440 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
441
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.
449
450 2012-09-01 Eli Zaretskii <eliz@gnu.org>
451
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)
455
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.
459
460 2012-09-01 Daniel Colascione <dancol@dancol.org>
461
462 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
463 system used too early.
464
465 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
466
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.
473
474 2012-09-01 Daniel Colascione <dancol@dancol.org>
475
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.
483
484 * xfaces.c: Include TERM_HEADER instead of listing all possible
485 window-system headers.
486
487 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
488 to match header.
489
490 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
491 directly accessing frame internals.
492
493 * w32font.h: Include font.h. Define syms_of_w32font and
494 globals_of_w32font.
495
496 * process.c: Include TERM_HEADER instead of listing all possible
497 window-system headers.
498
499 * nsterm.h: Remove declarations now in frame.h. Define
500 FRAME_X_SCREEN, FRAME_X_VISUAL.
501
502 * menu.c: Include TERM_HEADER instead of listing all possible
503 window-system headers.
504
505 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
506 window system.
507
508 * keyboard.c: Include TERM_HEADER instead of listing all possible
509 window-system headers.
510
511 * image.c: Include TERM_HEADER instead of listing all possible
512 window-system headers. Declare Vlibrary_cache when compiling for
513 Windows.
514
515 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
516 window system declarations.
517
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,
526 and x_query_colors.
527
528 * frame.c: Include TERM_HEADER instead of listing all possible
529 window-system headers.
530
531 * font.c: Include TERM_HEADER instead of listing all possible
532 window-system headers.
533
534 * emacs.c: Include TERM_HEADER.
535
536 * dispnew.c: Include TERM_HEADER instead of listing all possible
537 window-system headers.
538
539 * ccl.h: Include character.h.
540
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
543 Emacs.
544
545 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
546
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.
554
555 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
556
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.
563
564 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
565
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.
569
570 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
571
572 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
573 does not become zero (Bug#12234).
574
575 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
576
577 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
578 for GCC 4.7.1 x86-64.
579
580 2012-08-30 Glenn Morris <rgm@gnu.org>
581
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)
585
586 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
587
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
594 in button_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.
606
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.
611
612 2012-08-28 Eli Zaretskii <eliz@gnu.org>
613
614 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
615 is not one of the heaps we manage. (Bug#12242)
616
617 2012-08-28 Glenn Morris <rgm@gnu.org>
618
619 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
620
621 2012-08-28 Martin Rudalics <rudalics@gmx.at>
622
623 * window.c (Fset_window_configuration): Remove handling of
624 auto-buffer-name window parameter. Install revision of reverted
625 fix.
626
627 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
628
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
633 nested declaration.
634
635 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
636
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.
643
644 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
645
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.
656
657 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
658
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.
679 All callers changed.
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.)
686
687 2012-08-27 Martin Rudalics <rudalics@gmx.at>
688
689 * window.c (Fset_window_configuration): Revert first part of
690 last change.
691
692 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
693
694 * nsterm.h (NSPanel): New class variable dialog_return.
695
696 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
697 dialog_return.
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
701 event.
702 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
703 modal loop returns.
704
705 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
706
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.
721 All uses changed.
722 * composite.h, lisp.h: Reflect above API changes.
723
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'.
761
762 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
763
764 Fix spare memory change (Bug#12286).
765 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
766 (valid_lisp_object_p): Likewise.
767
768 2012-08-27 Martin Rudalics <rudalics@gmx.at>
769
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
773 point (Bug#12208).
774
775 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
776
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.
782
783 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
784
785 Spelling fixes.
786 * Makefile.in (.PHONY): versioclean -> versionclean.
787
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):
796 Remove decls.
797
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.
818
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>.
824
825 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
826
827 * lisp.h (functionp): New function (extracted from Ffunctionp).
828 (FUNCTIONP): Use it.
829 * eval.c (Ffunctionp): Use it.
830
831 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
832
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.
840
841 * emacs.c (fatal_error_signal_hook): Remove.
842 All uses removed. This leftover from old code was always 0.
843
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.
850
851 2012-08-25 Eli Zaretskii <eliz@gnu.org>
852
853 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
854
855 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
856
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.
861 (LIBES): Use it.
862
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'.
873
874 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
875
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.
891
892 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
893
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):
899 Now bool.
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.
908
909 2012-08-23 Martin Rudalics <rudalics@gmx.at>
910
911 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
912 argument.
913
914 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
915
916 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
917 * atimer.h: Include <stdbool.h>.
918
919 2012-08-22 Dan Nicolaescu <dann@gnu.org>
920
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
923 not use them.
924 (FRAME_MAC_P): Remove leftover from deleted code.
925 * frame.c (syms_of_frame): Remove leftover from deleted code.
926
927 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
928
929 * nsterm.m (insertText:): Don't clear modifiers if code is space.
930
931 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
932
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.
937
938 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
939
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]:
952 Remove unused local.
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)
957 (Fdo_auto_save):
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
965 alloc.c's changes.
966
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.
974
975 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
976
977 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
978 the loop (Bug#12247).
979
980 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
981
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.
987
988 2012-08-21 Eli Zaretskii <eliz@gnu.org>
989
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.
997
998 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
999
1000 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1001
1002 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1003
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.
1015
1016 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1017
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.
1022
1023 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1024
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.
1029 Adjust users.
1030
1031 2012-08-20 Glenn Morris <rgm@gnu.org>
1032
1033 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1034 Don't assume that `ln -f' works.
1035
1036 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1037
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
1041 details.
1042
1043 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1044
1045 Inline setter functions for Lisp_Objects slots of struct specbinding.
1046 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1047 Adjust users.
1048
1049 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1050
1051 * window.c (select_window): Always make selected window's buffer
1052 current.
1053
1054 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1055
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.
1060
1061 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1062
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.
1069
1070 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1071
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.
1077
1078 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1079
1080 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1081
1082 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1083
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'.
1092
1093 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1094 (start_of_data): Remove decl; mem-limits.h provides it.
1095
1096 * xdisp.c (handle_invisible_prop): Make it a bit faster
1097 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1098
1099 2012-08-19 Chong Yidong <cyd@gnu.org>
1100
1101 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1102 ends (Bug#3874).
1103
1104 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1105
1106 * .gdbinit: Use call instead of set when calling a function in the
1107 inferior.
1108
1109 * data.c (set_internal): Don't use set_blv_found.
1110 (Fkill_local_variable): Likewise.
1111
1112 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1113
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.
1117
1118 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1119
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.
1126
1127 2012-08-18 Chong Yidong <cyd@gnu.org>
1128
1129 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1130 for the string case (Bug#3874).
1131
1132 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1133
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)
1143 (bset_width_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.
1166
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.
1181
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.
1205
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.
1215
1216 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1217
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.
1234
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.
1250
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.
1257 All uses changed.
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
1262 interval_set_left.
1263 (set_interval_right): Move here from intervals.h, and rename from
1264 interval_set_right.
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.
1272
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>.
1278
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.
1287
1288 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1289
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.
1295
1296 2012-08-17 Chong Yidong <cyd@gnu.org>
1297
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.
1302
1303 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1304
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.
1309
1310 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1311
1312 * lisp.h (duration_to_sec_usec): Remove unused decl.
1313
1314 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1315
1316 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1317 to an allocated instance of NSString, not to the class itself.
1318
1319 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1320
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.
1325
1326 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1327
1328 Use ASCII tests for character types.
1329 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1330 * xfns.c, xterm.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.
1353
1354 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1355
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.
1391
1392 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1393
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.
1397
1398 2012-08-16 Chong Yidong <cyd@gnu.org>
1399
1400 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1401
1402 * xfont.c (xfont_open):
1403 * xftfont.c (xftfont_open): Set the font's max_width field.
1404
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.
1410
1411 * font.h (struct font): Update comments.
1412
1413 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1414
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.
1421
1422 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1423
1424 * eval.c (eval_sub): Bind lexical-binding.
1425 * lread.c (Qlexical_binding): Make non-static.
1426
1427 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1428
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.
1436
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.
1457
1458 * nsterm.h (EmacsApp): fd_handler takes id argument.
1459 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1460
1461 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1462
1463 2012-08-15 Eli Zaretskii <eliz@gnu.org>
1464
1465 * region-cache.c (move_cache_gap): Update gap_len using the actual
1466 growth of the boundaries array. Do not change cache_len.
1467 (Bug#12196)
1468
1469 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1470
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.
1475
1476 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1477
1478 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1479
1480 2012-08-15 Chong Yidong <cyd@gnu.org>
1481
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.
1487
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.
1490
1491 * xfaces.c: Make font weight and style symbols non-static.
1492
1493 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1494
1495 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1496 (bug#12117).
1497
1498 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1499
1500 * alloc.c (Fgarbage_collect): Use plural form consistently.
1501
1502 2012-08-14 Eli Zaretskii <eliz@gnu.org>
1503
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.
1507
1508 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1509
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.
1518
1519 2012-08-14 Chong Yidong <cyd@gnu.org>
1520
1521 * character.c (Fcharacterp): Doc fix (Bug#12076).
1522
1523 * data.c (Findirect_variable): Doc fix (Bug#11040).
1524
1525 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1526
1527 * editfns.c (Fformat): Doc fix (Bug#12059).
1528 (Fsave_current_buffer): Doc fix (Bug#11542).
1529
1530 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1531
1532 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1533 (bug#12022).
1534
1535 2012-08-14 Martin Rudalics <rudalics@gmx.at>
1536
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).
1543
1544 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1545
1546 * intervals.c (offset_intervals): Remove obsolete comment.
1547
1548 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1549
1550 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1551
1552 2012-08-14 Gergely Risko <gergely@risko.hu>
1553
1554 * coding.c (decode_coding): Record buffer modification before
1555 disabling undo_list (Bug#11773).
1556
1557 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1558
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.
1565
1566 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1567
1568 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1569
1570 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1571
1572 * gtkutil.c (xg_mark_data): Don't assume C99.
1573
1574 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1575
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
1581 if not present.
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.
1585
1586 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1587
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.
1593
1594 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1595
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.
1602
1603 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1604
1605 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1606
1607 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1608
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).
1613
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>.
1619
1620 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1621
1622 * unexmacosx.c (copy_data_segment): Copy initialized data in
1623 statically linked libraries from input file rather than memory.
1624
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.
1628
1629 2012-08-10 Glenn Morris <rgm@gnu.org>
1630
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.
1633
1634 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1635
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>.
1639
1640 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1641
1642 Use common inline syntax in intervals.h.
1643 * intervals.h (INTERVALS_INLINE): New macro.
1644 Change all users from LISP_INLINE.
1645
1646 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1647
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.
1654
1655 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1656
1657 Remove unused macros from intervals.h.
1658 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1659 * intervals.c: Adjust comment.
1660
1661 2012-08-10 Eli Zaretskii <eliz@gnu.org>
1662
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
1666 testing os_subtype.
1667
1668 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
1669 Eli Zaretskii <eliz@gnu.org>
1670
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
1677 later.
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.
1681
1682 2012-08-10 Glenn Morris <rgm@gnu.org>
1683
1684 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1685
1686 * lisp.h (DIRECTORY_SEP): Let configure set it.
1687
1688 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1689
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.
1693
1694 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1695
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.
1700
1701 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1702
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.
1710
1711 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1712
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.
1724
1725 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1726
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.
1732
1733 2012-08-08 Glenn Morris <rgm@gnu.org>
1734
1735 * lisp.mk (lisp): Remove language/persian.elc.
1736
1737 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1738
1739 Cleanup intervals.
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.
1746
1747 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1748
1749 Check total length of intervals with eassert.
1750 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1751 * intervals.c: Change all users to eassert.
1752
1753 2012-08-07 Eli Zaretskii <eliz@gnu.org>
1754
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.
1758
1759 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1760
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
1764 use INTERNAL_FIELD.
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
1774 where appropriate.
1775
1776 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1777
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):
1784 Adjust indentation.
1785 (INTERVAL_SIZE): Remove. Adjust users.
1786 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1787
1788 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1789
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.
1794
1795 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1796
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:
1805 Adjust users.
1806
1807 2012-08-07 Chong Yidong <cyd@gnu.org>
1808
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).
1813
1814 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1815
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.
1823
1824 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
1825
1826 * w32.c: Silence compiler warnings.
1827 (map_w32_filename): Remove unused variable `is_fat'.
1828 (chase_symlinks): Add parentheses around expression.
1829
1830 2012-08-06 Glenn Morris <rgm@gnu.org>
1831
1832 * sysdep.c: Respect BROKEN_GETWD.
1833
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.
1837
1838 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1839
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.
1844
1845 2012-08-06 Eli Zaretskii <eliz@gnu.org>
1846
1847 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1848 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
1849
1850 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1851
1852 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1853 that should be sufficient for everyone.
1854
1855 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1856
1857 * keyboard.c (timer_check_2): Add break so timer_check returns next
1858 timeout.
1859
1860 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1861
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>.
1865
1866 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1867
1868 * nsterm.m (ns_frame_rehighlight): Use FSET.
1869
1870 * nsmenu.m (ns_update_menubar): Use FSET.
1871
1872 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1873
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.
1877
1878 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1879
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:
1887 Adjust users.
1888
1889 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1890
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>.
1896
1897 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1898
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>.
1903
1904 2012-08-06 Glenn Morris <rgm@gnu.org>
1905
1906 * lisp.mk (lisp): Add language/persian.elc.
1907
1908 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1909
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.
1916
1917 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1918
1919 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1920
1921 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1922
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.
1933
1934 2012-08-05 Lawrence Mitchell <wence@gmx.li>
1935
1936 * search.c (Freplace_match): Treat \? in the replacement text
1937 literally (Bug#8161).
1938
1939 2012-08-05 Chong Yidong <cyd@gnu.org>
1940
1941 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1942 * frame.c (Vdelete_frame_functions):
1943 * emacs.c (Vkill_emacs_hook): Doc fix.
1944
1945 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1946
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>.
1950
1951 2012-08-04 Chong Yidong <cyd@gnu.org>
1952
1953 * syntax.c (Fmodify_syntax_entry): Doc fix.
1954
1955 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1956
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.
1966
1967 * w32.h (check_windows_init_file): Add prototype.
1968
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
1973 w32.c.
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.
1977
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.
1982
1983 * lread.c (init_lread): Add comments to #ifdef's.
1984
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.
1988
1989 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1990
1991 Export DEFAULT_REHASH_* to GDB.
1992 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1993 Now constants, not macros.
1994
1995 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1996
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.
2020
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.
2030
2031 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2032
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):
2046 New functions.
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.
2063
2064 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2065
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.
2072
2073 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2074 Don't assume buffer size fits in 'int'. Remove unused local.
2075
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.
2104
2105 2012-08-02 Glenn Morris <rgm@gnu.org>
2106
2107 * s/: Remove empty directory.
2108
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.
2112
2113 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2114
2115 Port to Solaris 8.
2116 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2117
2118 2012-08-02 Glenn Morris <rgm@gnu.org>
2119
2120 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2121 hard-coding the path separator.
2122
2123 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2124
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
2137 of PROP changed.
2138
2139 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2140
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.
2147
2148 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2149
2150 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2151 Adapt to latest changes in field names of the corresponding Lisp
2152 objects.
2153
2154 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2155
2156 2012-08-01 Glenn Morris <rgm@gnu.org>
2157
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.
2162
2163 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2164
2165 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2166 Remove; moved to nt/config.nt.
2167
2168 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2169
2170 Use INTERNAL_FIELD for conses and overlays.
2171 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2172 Remove obsolete comment.
2173 (MVAR): New macro.
2174 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2175 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2176
2177 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2178
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.
2183
2184 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2185
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.
2190
2191 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2192
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.
2201
2202 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2203
2204 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2205
2206 2012-08-01 Glenn Morris <rgm@gnu.org>
2207
2208 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2209 Move to configure.ac.
2210
2211 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2212
2213 * makefile.w32-in (CONFIG_H): Update dependencies.
2214 (CONF_POST_H): New macro.
2215
2216 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2217
2218 2012-07-31 Glenn Morris <rgm@gnu.org>
2219
2220 * Makefile.in (S_FILE): No longer set by configure.
2221
2222 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2223 is available.
2224 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2225
2226 * process.h (NULL_DEVICE):
2227 * emacs.c (SEPCHAR):
2228 * editfns.c (USER_FULL_NAME): Let configure set them.
2229
2230 * s/README, s/template.h: Remove files.
2231
2232 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2233
2234 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2235 Move to configure.ac.
2236
2237 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2238
2239 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2240 resulting renaming of 'struct frame' members.
2241
2242 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2243
2244 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2245 after introduction of FVAR.
2246
2247 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2248
2249 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2250
2251 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2252 instead of compositeToPoint.
2253 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2254
2255 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2256
2257 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2258
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.
2271
2272 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2273
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.
2280
2281 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2282
2283 * nsterm.m (openFiles): Fix previous checkin.
2284
2285 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2286
2287 * indent.c (compute_motion): Remove unused local.
2288
2289 2012-07-31 Glenn Morris <rgm@gnu.org>
2290
2291 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2292
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.
2296
2297 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2298 * s/irix6-5.h: Remove file.
2299
2300 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2301 * s/darwin.h: Remove file.
2302
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.
2305
2306 2012-07-30 Glenn Morris <rgm@gnu.org>
2307
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.
2311
2312 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2313
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.
2318
2319 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2320
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.
2324
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.
2331
2332 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2333
2334 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2335 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2336
2337 * w32term.c <w32_keyboard_codepage>: Renamed from
2338 keyboard_codepage and now external. All users changed.
2339
2340 * w32term.h: Add declaration of w32_keyboard_codepage.
2341
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.
2345
2346 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2347
2348 Update .PHONY listings in makefiles.
2349 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2350 bootstrap-clean, distclean, maintainer-clean, versioclean,
2351 extraclean, frc.
2352
2353 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2354 This is a bit clearer. Fix some commentary typos.
2355
2356 2012-07-30 Glenn Morris <rgm@gnu.org>
2357
2358 * s/netbsd.h: Let configure include signal.h if needed.
2359 Remove file, which is now empty.
2360
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.
2365
2366 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2367
2368 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2369 non-single-byte char when adding meta modifier. (Bug#12090)
2370
2371 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2372
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.
2379
2380 2012-07-30 Glenn Morris <rgm@gnu.org>
2381
2382 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2383 does that unconditionally. Remove file, which is now empty.
2384
2385 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2386 Remove empty files.
2387
2388 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2389
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.
2419
2420 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2421
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.
2427
2428 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2429
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.
2434
2435 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
2436
2437 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2438 ($(BLD)/w32console.$(O)): Update dependencies.
2439
2440 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2441
2442 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2443 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2444 time. Adjust users.
2445 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2446
2447 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2448
2449 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2450 setting sitelisp (Bug#12010).
2451
2452 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2453
2454 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2455
2456 * w32heap.c (cache_system_info):
2457 * w32.c (sys_rename):
2458 * w32proc.c (find_child_console, sys_kill): All users changed.
2459
2460 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2461
2462 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2463
2464 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2465
2466 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2467
2468 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2469
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.
2473
2474 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2475
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.
2482
2483 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2484
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.
2489 All uses changed.
2490
2491 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2492
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.
2502
2503 2012-07-28 Eli Zaretskii <eliz@gnu.org>
2504
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.
2515
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.
2520
2521 * w32inevt.h: Declare w32_console_unicode_input.
2522
2523 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2524 --without-x. (Bug#11742)
2525
2526 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2527
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>.
2532
2533 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
2534
2535 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2536 bus address.
2537 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2538
2539 2012-07-27 Eli Zaretskii <eliz@gnu.org>
2540
2541 * alloc.c (listn): Fix the order the arguments are consed onto the
2542 list.
2543
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.
2548
2549 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2550
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>.
2554
2555 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2556
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.
2561
2562 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2563
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.
2578
2579 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2580
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.
2597
2598 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2599
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.
2614
2615 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2616
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.
2636
2637 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
2638
2639 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2640
2641 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2642
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):
2662 Remove.
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.
2677
2678 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2679
2680 Explicitly free restriction data that are not needed anymore.
2681 * editfns.c (save_restriction_restore): Free restriction data.
2682
2683 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2684
2685 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2686 add argument, tune behavior, and adjust all callers.
2687
2688 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2689
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.
2696
2697 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2698
2699 * nsterm.m (ns_read_socket): Return early if there is a modal
2700 window (Bug#12043).
2701
2702 2012-07-25 Martin Rudalics <rudalics@gmx.at>
2703
2704 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2705 that FOCUS-FRAME can be omitted.
2706
2707 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2708
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).
2715
2716 2012-07-24 Eli Zaretskii <eliz@gnu.org>
2717
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)
2721
2722 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2723
2724 Simplify copy_overlay.
2725 * buffer.c (copy_overlay): Simplify. Use build_marker.
2726 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2727
2728 2012-07-23 Eli Zaretskii <eliz@gnu.org>
2729
2730 * print.c (print_object): Don't crash when a frame's name is nil
2731 or invalid. (Bug#12025)
2732
2733 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2734 it signals an error when a tooltip frame is being created.
2735
2736 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2737
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.
2746
2747 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2748
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.
2753
2754 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2755
2756 * nsmenu.m (Popdown_data): New struct.
2757 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2758 free Popdown_data.
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).
2763
2764 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2765
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.
2770
2771 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2772
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.
2778
2779 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2780
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.
2783
2784 2012-07-21 Eli Zaretskii <eliz@gnu.org>
2785
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
2789 for the reasons.
2790
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>.
2794
2795 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2796
2797 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
2798 (conversationIdentifier): Return value is NSInteger.
2799 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
2800
2801 2012-07-21 Chong Yidong <cyd@gnu.org>
2802
2803 * window.c (decode_any_window): Signal an error if the window is
2804 on a dead frame (Bug#11984).
2805
2806 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2807
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.
2816
2817 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2818
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.
2827
2828 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2829
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.
2838 (maybe_gc): Remove.
2839
2840 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2841
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.
2850
2851 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2852
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):
2859 Make them static.
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.
2864
2865 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2866
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.
2873
2874 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2875
2876 * alloc.c (Fgarbage_collect): Tweak docstring.
2877
2878 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2879
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
2885 accounting.
2886 (total_free_vector_bytes): Rename to total_free_vector_slots,
2887 adjust accounting.
2888 (Qstring_bytes, Qvector_slots): New symbols.
2889 (syms_of_alloc): DEFSYM them.
2890
2891 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2892
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.
2899
2900 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2901
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
2911 for dead buffer.
2912 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2913
2914 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2915
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>.
2921
2922 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2923
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.
2927
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 ().
2936
2937 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2938
2939 * eval.c (Fdefvar): Don't check constants since we only set the var if
2940 it's not yet defined anyway (bug#11904).
2941
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).
2946
2947 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2948
2949 * w32font.c (Qsymbol): Remove local definition.
2950 (syms_of_w32font): Don't DEFSYM it.
2951
2952 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2953
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.
2957
2958 2012-07-18 Chong Yidong <cyd@gnu.org>
2959
2960 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2961 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2962
2963 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2964
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.
2982
2983 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2984
2985 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2986 Round up, not down. Improve doc.
2987
2988 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2989
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.
2995
2996 2012-07-17 Eli Zaretskii <eliz@gnu.org>
2997
2998 Remove FILE_SYSTEM_CASE.
2999 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3000
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.
3005
3006 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3007
3008 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3009
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.
3015
3016 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3017
3018 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3019 to make the loop interruptible.
3020
3021 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3022
3023 * gnutls.c (emacs_gnutls_handshake): Only retry if
3024 GNUTLS_E_INTERRUPTED.
3025
3026 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3027
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):
3034 Convert to eassert.
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.
3041
3042 2012-07-17 Chong Yidong <cyd@gnu.org>
3043
3044 * editfns.c (Finsert_char): Doc fix.
3045
3046 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3047
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.
3056
3057 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3058
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.
3065
3066 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3067
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.
3073
3074 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3075
3076 * editfns.c (Finsert_char): Make it interactive, and make the
3077 second arg optional. Copy interactive spec and docstring from
3078 ucs-insert.
3079
3080 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3081
3082 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3083 Unlike the other wrapped functions, fabs has an unspecified
3084 effect on errno.
3085
3086 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3087
3088 * nsterm.m (keyDown): Interpret flags without left/right bits
3089 as the left key (Bug#11670).
3090
3091 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3092
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.
3102
3103 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3104
3105 * gtkutil.h: Tiny cleanups.
3106 (use_old_gtk_file_dialog): Remove useless declaration.
3107 (xg_uses_old_file_dialog): Add suggested const attribute.
3108
3109 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3110
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)
3115
3116 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3117
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
3121 background.
3122
3123 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3124
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.
3137
3138 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3139
3140 Use zero_vector where appropriate.
3141 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3142 accordingly.
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.
3148
3149 2012-07-15 Leo Liu <sdl.web@gmail.com>
3150
3151 * fringe.c: Fix typo in comments.
3152
3153 2012-07-14 Leo Liu <sdl.web@gmail.com>
3154
3155 * fringe.c: Add a new bitmap exclamation-mark.
3156
3157 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3158
3159 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3160
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
3163 msdos/sed2v2.inp.
3164 (GMALLOC_INHIBIT_VALLOC): Don't define.
3165 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3166
3167 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3168
3169 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3170
3171 2012-07-14 Glenn Morris <rgm@gnu.org>
3172
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.
3176
3177 2012-07-13 Glenn Morris <rgm@gnu.org>
3178
3179 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3180
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.
3183
3184 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3185
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
3190 where appropriate.
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.
3208
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.
3220
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.
3228
3229 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3230 appropriate.
3231 (setXBMColor): Remove unused variable len.
3232 (setPixmapData): Put () around assignment in loop statement.
3233
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
3236 where appropriate.
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.
3242
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.
3257
3258 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3259 memcpy (Bug#11907).
3260
3261 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3262
3263 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3264 and free it with DestroyExceptionInfo (Bug#11558).
3265
3266 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3267
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.
3271
3272 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3273
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)
3277
3278 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3279
3280 * xdisp.c (produce_special_glyphs): Now static.
3281 * dispextern.h (produce_special_glyphs): Remove decl.
3282
3283 2012-07-13 Glenn Morris <rgm@gnu.org>
3284
3285 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3286 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3287
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.
3299
3300 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3301
3302 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3303
3304 2012-07-13 Glenn Morris <rgm@gnu.org>
3305
3306 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3307
3308 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3309
3310 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3311 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3312
3313 2012-07-12 Glenn Morris <rgm@gnu.org>
3314
3315 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3316
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
3321 longer needed.
3322
3323 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3324
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)
3336
3337 2012-07-12 Glenn Morris <rgm@gnu.org>
3338
3339 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3340
3341 * s/gnu-linux.h, s/hpux10-20.h:
3342 Do not unconditionally define HAVE_XRMSETDATABASE.
3343
3344 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3345
3346 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3347
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.
3353
3354 2012-07-12 Glenn Morris <rgm@gnu.org>
3355
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.
3360
3361 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3362 Move PTY_OPEN to configure.
3363
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.
3367
3368 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3369
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.
3374
3375 2012-07-12 Glenn Morris <rgm@gnu.org>
3376
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.
3382
3383 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3384
3385 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3386
3387 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3388 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3389
3390 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3391
3392 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3393 * s/template.h: Move NARROWPROTO to configure.
3394
3395 2012-07-11 Glenn Morris <rgm@gnu.org>
3396
3397 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3398 unused since 2011-01-17 change to systty.h.
3399
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.
3403
3404 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3405
3406 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3407
3408 2012-07-11 Glenn Morris <rgm@gnu.org>
3409
3410 * s/darwin.h, s/gnu-linux.h, s/template.h:
3411 Move INTERRUPT_INPUT to configure.
3412
3413 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3414
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.
3423
3424 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3425
3426 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3427
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.
3437
3438 2012-07-11 Glenn Morris <rgm@gnu.org>
3439
3440 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3441 since nothing has defined it on these platforms.
3442
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.
3445
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.
3449
3450 * s/gnu.h: Remove file, which is now empty.
3451
3452 * s/gnu.h, s/gnu-linux.h:
3453 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3454
3455 2012-07-11 John Wiegley <johnw@newartisans.com>
3456
3457 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3458 function attribute, so we only use it if it exists in the
3459 compiler.
3460
3461 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3462
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.
3467
3468 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3469
3470 Assume mkdir, rmdir.
3471 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3472 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3473
3474 Assume rename.
3475 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3476
3477 Assume perror.
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.
3481
3482 Assume strerror.
3483 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3484
3485 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3486
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):
3492 Adjust prototypes.
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.
3498
3499 2012-07-11 Glenn Morris <rgm@gnu.org>
3500
3501 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3502 Move DONT_REOPEN_PTY to configure.
3503
3504 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3505 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3506
3507 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3508
3509 Remove "#define unix" that is no longer needed (Bug#11905).
3510 * s/aix4-2.h (unix): Remove; no longer needed.
3511
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,
3520 not macros.
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.
3538
3539 * bytecode.c (targets): Suppress -Woverride-init warnings.
3540
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):
3546 * lread.c (openp):
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>.
3556 (ns_get_color):
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.
3572
3573 2012-07-10 Glenn Morris <rgm@gnu.org>
3574
3575 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3576 Clarify fallback case.
3577
3578 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3579
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.
3585
3586 2012-07-10 Tom Tromey <tromey@redhat.com>
3587
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.
3593
3594 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3595
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
3603 appropriate.
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.
3607
3608 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3609
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.
3614
3615 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3616
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
3620 accordingly.
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.
3625
3626 2012-07-10 Glenn Morris <rgm@gnu.org>
3627
3628 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3629 Move PENDING_OUTPUT_COUNT definition to configure.
3630
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.
3634
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.
3637
3638 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3639 O_RDONLY already includes it).
3640
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.
3648
3649 2012-07-09 Glenn Morris <rgm@gnu.org>
3650
3651 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3652 since the included bsd-common.h does so.
3653
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]:
3659 Use ns_exec_path.
3660
3661 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3662
3663 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3664
3665 * process.c (wait_reading_process_output): 'waitchannels' was unset
3666 when read_kbd || !NILP (wait_for_cell); fix this.
3667
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.
3681
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.
3686
3687 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3688
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.
3704
3705 2012-07-09 Glenn Morris <rgm@gnu.org>
3706
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.
3713
3714 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3715
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.
3722
3723 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3724
3725 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3726 See <http://bugs.gnu.org/11825#29>.
3727
3728 2012-07-08 Eli Zaretskii <eliz@gnu.org>
3729
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
3733 on GUI frames.
3734 (produce_special_glyphs): Move here from term.c.
3735
3736 * term.c (produce_special_glyphs): Move to xdisp.c.
3737
3738 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3739 section.
3740
3741 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3742
3743 * xdisp.c (display_line): Avoid warning about implicit declaration
3744 of FRAME_FONT.
3745
3746 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3747
3748 * lisp.h: Remove empty conditional.
3749
3750 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3751
3752 * lread.c (load_path_check): Now static.
3753
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.
3770
3771 2012-07-07 Glenn Morris <rgm@gnu.org>
3772
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.
3781
3782 2012-07-07 Eli Zaretskii <eliz@gnu.org>
3783
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
3792 glyphs.
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.
3800
3801 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3802 produce_glyphs, to support GUI sessions.
3803
3804 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3805
3806 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3807
3808 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3809
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.
3821
3822 2012-07-07 Glenn Morris <rgm@gnu.org>
3823
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).
3827
3828 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
3829
3830 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3831 Update dependencies.
3832
3833 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3834
3835 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3836
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.
3843
3844 * xfont.c (compare_font_names): Redo to omit the need for casts.
3845
3846 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3847
3848 * xfns.c (Fx_change_window_property): Doc fix.
3849 * w32fns.c (Fx_change_window_property): Doc fix.
3850
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)
3854
3855 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
3856 Eli Zaretskii <eliz@gnu.org>
3857
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.
3861
3862 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3863
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.
3868
3869 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3870
3871 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3872 is defined (Bug#11768).
3873
3874 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3875
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.
3881
3882 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3883
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.
3890
3891 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3892
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.
3901
3902 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3903
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.
3907
3908 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3909
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.
3920
3921 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3922
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.
3928
3929 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3930
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.
3938
3939 2012-07-06 Glenn Morris <rgm@gnu.org>
3940
3941 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3942
3943 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3944
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:
3955 * xterm.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
3964 growing it.
3965 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3966 alloca of a constant.
3967
3968 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3969
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.
3974
3975 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3976
3977 * marker.c (set_marker_restricted_both): Simplify by using
3978 clip_to_bounds.
3979
3980 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3981
3982 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3983
3984 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3985
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).
4000
4001 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4002
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
4006 values. (Bug#11857)
4007
4008 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4009
4010 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4011 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4012
4013 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4014
4015 Cleanup xmalloc.
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.
4024 * term.c: Likewise.
4025 * w32fns.c: Likewise.
4026 * w32font.c: Likewise.
4027 * w32term.c: Likewise.
4028 * xfaces.c: Likewise.
4029 * xfns.c: Likewise.
4030 * xterm.c: Likewise.
4031 * atimer.c: Omit needless casts.
4032 * buffer.c: Likewise.
4033 * callproc.c: Likewise.
4034 * ccl.c: Likewise.
4035 * coding.c: Likewise.
4036 * composite.c: Likewise.
4037 * doc.c: Likewise.
4038 * doprnt.c: Likewise.
4039 * editfns.c: Likewise.
4040 * emacs.c: Likewise.
4041 * eval.c: Likewise.
4042 * filelock.c: Likewise.
4043 * fns.c: Likewise.
4044 * gtkutil.c: Likewise.
4045 * keyboard.c: Likewise.
4046 * lisp.h: 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.
4059 * w32.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.
4066 * xrdb.c: Likewise.
4067 * xselect.c: Likewise.
4068
4069 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4070
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>.
4074
4075 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4076
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.
4081
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>.
4085
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.
4090
4091 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4092 that causes compilation to fail on pre-C99 compilers.
4093
4094 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4095
4096 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4097 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4098
4099 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4100
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>.
4104
4105 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4106
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.
4125
4126 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4127
4128 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4129 Tighten new eassert a bit.
4130
4131 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4132
4133 Fix compilation with --enable-gcc-warnings and -O1
4134 optimization level.
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.
4139
4140 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4141
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.
4152
4153 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4154
4155 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4156
4157 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4158
4159 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4160
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.
4164
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.
4172
4173 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4174
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.
4179
4180 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4181
4182 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4183 marker for non-existing file. (Bug#11852)
4184
4185 2012-07-03 Glenn Morris <rgm@gnu.org>
4186
4187 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4188 and did not make it into globals.h).
4189
4190 2012-07-03 Tom Tromey <tromey@redhat.com>
4191
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
4197 static.
4198 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4199 * keyboard.c (Fcommand_execute): No longer static.
4200 Remove EXFUN.
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):
4207 No longer static.
4208 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4209 static.
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.
4213
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.
4227
4228 2012-07-03 Glenn Morris <rgm@gnu.org>
4229
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)
4233
4234 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4235
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
4240 accordingly.
4241
4242 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4243
4244 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4245
4246 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4247
4248 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4249
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.
4254
4255 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4256
4257 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4258 is enabled, avoid dereferencing NULL current_sblock if
4259 running undumped.
4260
4261 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4262
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.
4280
4281 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4282
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.
4287
4288 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4289
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.
4295
4296 2012-06-30 Glenn Morris <rgm@gnu.org>
4297
4298 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4299
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)
4304
4305 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4306
4307 * w32proc.c (sys_select): Accept and ignore one more argument.
4308
4309 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4310
4311 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4312 (pselect) [!MS_DOS]: Redirect to sys_select.
4313
4314 * sysdep.c: Don't include dos.h and dosfns.h.
4315
4316 * process.c (sys_select):
4317 * msdos.c (sys_select): Accept one more argument and ignore it.
4318
4319 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4320 adapt data types and code to that.
4321
4322 * dosfns.c:
4323 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4324 which clashes with the gnulib function of the same name.
4325
4326 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4327
4328 * font.c (font_style_to_value, font_style_symbolic)
4329 (font_prop_validate_style): Add type checks for values in
4330 font_style_table.
4331
4332 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4333 argument.
4334 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4335 uses.
4336
4337 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4338
4339 * xdisp.c (try_window_id): Undo last change.
4340
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.
4351
4352 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4353
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.
4357 Adjust comment.
4358 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4359 to ptrdiff_t.
4360
4361 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4362
4363 * gnutls.c (emacs_gnutls_handshake):
4364 Add QUIT to make the loop interruptible.
4365
4366 2012-06-29 Glenn Morris <rgm@gnu.org>
4367
4368 * charset.c (init_charset): Make lack of etc/charsets fatal.
4369
4370 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4371
4372 * editfns.c (region_limit): Fix type mismatch.
4373
4374 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4375
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.
4380
4381 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4382
4383 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4384
4385 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4386
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.
4391
4392 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4393
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.
4402
4403 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4404
4405 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4406
4407 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4408
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.
4415
4416 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4417
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.
4430 * xfns.c: Likewise.
4431 * xterm.c: Likewise.
4432
4433 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4434
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.
4440 * bidi.c: Likewise.
4441 * dispnew.c: Likewise.
4442 * fns.c: Likewise.
4443 * fringe.c: Likewise.
4444 * ftfont.c: Likewise.
4445 * gtkutil.c: Likewise.
4446 * image.c: Likewise.
4447 * keyboard.c: Likewise.
4448 * menu.c: Likewise.
4449 * process.c: Likewise.
4450 * scroll.c: Likewise.
4451 * sound.c: Likewise.
4452 * term.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.
4459 * xfns.c: Likewise.
4460 * xselect.c: Likewise.
4461 * xterm.c: Likewise.
4462
4463 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4464
4465 * fns.c (maybe_resize_hash_table): Output message when growing the
4466 purify-hashtable.
4467
4468 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4469
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.
4473
4474 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4475
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.
4479
4480 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4481
4482 * alloc.c (allocate_string): Fix last change.
4483
4484 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4485
4486 * alloc.c (allocate_string): Remove two redundant calls
4487 to memset, add explicit initialization where appropriate.
4488
4489 2012-06-27 Glenn Morris <rgm@gnu.org>
4490
4491 * lisp.mk (lisp): Remove paths.elc.
4492
4493 2012-06-27 Chong Yidong <cyd@gnu.org>
4494
4495 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4496
4497 2012-06-26 John Wiegley <johnw@newartisans.com>
4498
4499 * unexmacosx.c (copy_data_segment): Add two section names used
4500 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4501
4502 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4503 when building with Clang.
4504
4505 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4506
4507 * eval.c (Fapply): Allow calling it with a single argument.
4508
4509 2012-06-26 Eli Zaretskii <eliz@gnu.org>
4510
4511 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4512 _stricmp and _strnicmp.
4513 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4514
4515 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4516
4517 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4518 allocated window.
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.
4527
4528 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4529
4530 * term.c (delete_tty): Remove redundant call to memset.
4531
4532 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4533
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.
4541
4542 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4543
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.
4563
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.
4568
4569 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4570
4571 * dispextern.h (xstrcasecmp): Define to library function
4572 strcasecmp if available.
4573 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4574
4575 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4576
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.
4582
4583 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4584
4585 * xfns.c (xic_create_fontsetname): Remove redundant calls
4586 to memset.
4587
4588 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4589
4590 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4591 sprintf already null-terminates its output.
4592
4593 * xfns.c (x_window): Remove redundant cast.
4594
4595 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4596
4597 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4598 `const char *' to `char *' to avoid compiler warning.
4599
4600 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4601
4602 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4603 instead of truncating it to 63 (admittedly a generous limit).
4604
4605 * process.c: Fix spelling and caps in comments.
4606
4607 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4608
4609 * emacs.c (setpgrp): Remove definition, unused.
4610 * sysdep.c (setpgrp): Remove definition, not used in this file.
4611
4612 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
4613
4614 * makefile.w32-in: Update dependencies.
4615
4616 2012-06-24 Eli Zaretskii <eliz@gnu.org>
4617
4618 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4619 (SYSTIME_H): Add nt/inc/sys/time.h.
4620
4621 * systime.h [WINDOWSNT]: Include sys/time.h.
4622
4623 * s/ms-w32.h (struct timespec): Definition moved from
4624 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4625
4626 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4627
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)
4640 (fatal):
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.
4657
4658 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4659
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>.
4669
4670 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4671
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.
4676
4677 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
4678
4679 * makefile.w32-in: Update dependencies.
4680
4681 * w32.c (ltime): Add return type and declare static.
4682 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4683
4684 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4685
4686 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4687 Privately reported by Herbert J. Skuhra.
4688 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4689 All uses changed.
4690 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4691 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4692
4693 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4694
4695 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4696 last argument of make_unibyte_string.
4697
4698 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4699 language ID in the event parameters.
4700
4701 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4702 event.code, not the obscure "character set ID".
4703
4704 2012-06-23 Chong Yidong <cyd@gnu.org>
4705
4706 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4707
4708 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4709
4710 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4711 * w32.c (fdutimens): New function.
4712
4713 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4714
4715 * s/ms-w32.h (pselect): Redirect to sys_select.
4716
4717 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4718
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.
4722
4723 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4724
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.
4732
4733 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4734
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.
4740
4741 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4742 (LIBES): Use it.
4743
4744 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4745 Don't get current time unless it's needed.
4746
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.
4752
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.
4756
4757 * dired.c: Include stat-time.h.
4758 (Ffile-attributes): File times now have higher resolution.
4759
4760 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4761 (struct image): Timestamp now has higher resolution.
4762
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.
4768
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
4773 time stamps.
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
4779 do that.
4780
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.
4788
4789 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4790
4791 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4792
4793 * image.c (prepare_image_for_display, clear_image_cache)
4794 (lookup_image): Port to higer-resolution time stamps.
4795
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.
4805
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.
4812
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.
4816
4817 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4818
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.
4822
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
4826 EMACS_HAS_USECS.
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.
4834
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.
4845
4846 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4847 provides a substitute now.
4848
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):
4859 New macros.
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.
4872
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.
4876
4877 * undo.c (record_first_change): Support higher-resolution time stamps
4878 in the undo buffer.
4879 (Fprimitive_undo): Use them when restoring time stamps.
4880
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
4885 for callers.
4886
4887 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4888
4889 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4890 for compatibility with pselect. Support ns-resolution time stamps.
4891
4892 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4893
4894 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4895 Check for time stamp overflow, and support ns-resolution time stamps.
4896
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.
4902
4903 2012-06-22 Chong Yidong <cyd@gnu.org>
4904
4905 * xdisp.c (x_consider_frame_title): Revert last change.
4906
4907 2012-06-22 Eli Zaretskii <eliz@gnu.org>
4908
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.)
4913
4914 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4915
4916 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4917 Otherwise, the umask might be mistakenly 0 while handling input signals.
4918
4919 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4920
4921 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4922
4923 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4924
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
4929 where appropriate.
4930
4931 2012-06-19 Chong Yidong <cyd@gnu.org>
4932
4933 * frame.c (delete_frame): When selecting a frame on a different
4934 text terminal, do not alter the terminal's top-frame.
4935
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):
4940 Callers changed.
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.
4944
4945 * term.c (Ftty_top_frame): New function.
4946
4947 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4948
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.
4955
4956 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4957
4958 * data.c (Fdefalias): Return `symbol' (bug#11686).
4959
4960 2012-06-18 Martin Rudalics <rudalics@gmx.at>
4961
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.
4967
4968 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4969
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.
4975
4976 2012-06-17 Chong Yidong <cyd@gnu.org>
4977
4978 * xdisp.c (redisplay_internal): No need to redisplay terminal
4979 frames that are not on top.
4980
4981 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
4982
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
4986 writes (Bug#10815).
4987
4988 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4989
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
4994 its argument.
4995
4996 * coding.c (produce_chars): Use ptrdiff_t, not int.
4997
4998 * xterm.c (x_draw_underwave): Check for integer overflow.
4999 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5000
5001 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5002
5003 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5004 referenced (Bug#11583).
5005
5006 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5007
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):
5014 New functions.
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.
5022
5023 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5024
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.
5030
5031 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5032
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".
5037 * bidi.c: Likewise.
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.
5045 * cmds.c: Likewise.
5046 * coding.c: Likewise.
5047 * composite.c: Likewise.
5048 * dired.c: Likewise.
5049 * dispnew.c: Likewise.
5050 * doc.c: Likewise.
5051 * dosfns.c: Likewise.
5052 * editfns.c: Likewise.
5053 * emacs.c: Likewise.
5054 * fileio.c: Likewise.
5055 * filelock.c: Likewise.
5056 * font.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.
5076 * term.c: Likewise.
5077 * textprop.c: Likewise.
5078 * undo.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.
5085 * xfns.c: Likewise.
5086 * xmenu.c: Likewise.
5087 * xml.c: Likewise.
5088 * xselect.c: Likewise.
5089
5090 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5091
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
5095 row.
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)
5100
5101 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5102
5103 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5104 (CATEGORY_MEMBER): Enforce 1/0 value.
5105 * category.c (_temp_category_set): Remove.
5106
5107 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5108
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)
5112
5113 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5114
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.
5118
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.
5130
5131 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5132
5133 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5134
5135 2012-06-13 Glenn Morris <rgm@gnu.org>
5136
5137 * s/bsd-common.h (BSD4_3):
5138 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5139
5140 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5141
5142 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5143 instead of union.
5144 (XLI, XIL): Define.
5145 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5146 Use them.
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.
5162
5163 2012-06-13 Glenn Morris <rgm@gnu.org>
5164
5165 * s/usg5-4-common.h, src/s/unixware.h:
5166 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5167
5168 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5169
5170 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5171
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.
5182 All uses changed.
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
5189 within Emacs now.
5190 (LISP_INITIALLY_ZERO): New macro.
5191 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5192 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5193
5194 2012-06-12 Glenn Morris <rgm@gnu.org>
5195
5196 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5197
5198 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5199
5200 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5201 Move BROKEN_SIGIO to configure.
5202
5203 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5204 Move NO_TERMIO to configure.
5205
5206 2012-06-12 Chong Yidong <cyd@gnu.org>
5207
5208 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5209 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5210 MagickExportImagePixels is undefined.
5211
5212 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5213
5214 * image.c (imagemagick_load_image): Remove unused label.
5215
5216 2012-06-11 Glenn Morris <rgm@gnu.org>
5217
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.
5222
5223 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5224
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.
5228
5229 2012-06-11 Chong Yidong <cyd@gnu.org>
5230
5231 * image.c (imagemagick_load_image): Implement transparency.
5232
5233 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5234
5235 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5236 account for preceding backslashes. (Bug#11663)
5237
5238 2012-06-09 Chong Yidong <cyd@gnu.org>
5239
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.
5247
5248 * termchar.h (struct tty_display_info): Add field for italics.
5249 Remove unused blink field.
5250
5251 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5252 Handle slant.
5253
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.
5257
5258 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5259
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.
5264
5265 2012-06-09 Chong Yidong <cyd@gnu.org>
5266
5267 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5268
5269 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5270 case (Bug#9752).
5271
5272 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5273
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
5277 let-bound!".
5278
5279 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5280
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.
5285
5286 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5287
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.
5291
5292 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5293
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).
5296
5297 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5298
5299 * alloc.c (allocate_vectorlike): Fix last change.
5300
5301 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5302
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.
5325
5326 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5327
5328 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5329
5330 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5331
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.
5337
5338 2012-06-06 Chong Yidong <cyd@gnu.org>
5339
5340 * buffer.c (word_wrap): Doc fix.
5341
5342 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5343
5344 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5345
5346 2012-06-03 Glenn Morris <rgm@gnu.org>
5347
5348 * xdisp.c (tool-bar-style): Doc fix.
5349
5350 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5351
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)
5357
5358 2012-06-03 Chong Yidong <cyd@gnu.org>
5359
5360 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5361 buffer (Bug#11226).
5362
5363 2012-06-03 Chong Yidong <cyd@gnu.org>
5364
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.
5369
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.
5374
5375 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5376
5377 * sysdep.c (system_process_attributes): Improve comment.
5378
5379 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5380
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.
5384
5385 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5386
5387 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5388
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.
5392
5393 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5394
5395 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5396 cons_block.
5397
5398 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5399
5400 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5401
5402 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5403
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.
5412
5413 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5414
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.
5420
5421 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5422
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)
5427
5428 2012-05-31 Chong Yidong <cyd@gnu.org>
5429
5430 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5431
5432 * doc.c (Fsubstitute_command_keys): Doc fix.
5433
5434 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5435
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
5439 in bug#11519.
5440
5441 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5442
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
5446 pointers.
5447
5448 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5449 decrement the inhibition flag, instead of just setting or
5450 resetting it.
5451
5452 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5453
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".
5462
5463 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5464
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
5475 and not pointers.
5476 * lisp.h (__executable_start): New decl.
5477
5478 2012-05-31 Glenn Morris <rgm@gnu.org>
5479
5480 * image.c (Fimagemagick_types): Doc fix.
5481
5482 2012-05-30 Jim Meyering <meyering@redhat.com>
5483
5484 * callproc.c (Fcall_process_region): Include directory component
5485 in mkstemp error message (Bug#11586).
5486
5487 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5488
5489 * alloc.c, lisp.h (make_pure_vector): Now static.
5490
5491 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5492
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.
5500
5501 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
5502
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.
5509
5510 2012-05-28 Eli Zaretskii <eliz@gnu.org>
5511
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.
5516 (Bug#11513)
5517
5518 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5519 by calling BringWindowToTop.
5520
5521 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5522 (WM_EMACS_END): Increase by one.
5523
5524 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5525
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.
5529
5530 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
5531
5532 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5533 Update dependencies.
5534
5535 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5536
5537 * bidi.c (bidi_mirror_char): Fix last change.
5538
5539 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5540
5541 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5542 when referring to sectname field in printf format.
5543
5544 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5545
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.
5549
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
5552 eassert. See
5553 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5554
5555 2012-05-27 Ken Brown <kbrown@cornell.edu>
5556
5557 * callproc.c (Fcall_process): Restore a line that was accidentally
5558 commented out in the 2011-02-13 change (bug#11547).
5559
5560 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5561
5562 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5563 defined on ralloc.c.
5564
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.
5568
5569 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5570
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)
5574
5575 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5576 Update value to 24.
5577
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
5581 entire line.
5582 (pos_visible_p): Revert the comparison against bottom_y to what it
5583 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5584 (Bug#11464)
5585
5586 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5587
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.
5598
5599 2012-05-26 Glenn Morris <rgm@gnu.org>
5600
5601 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5602
5603 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5604
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.
5608
5609 * w32console.c: Include window.h.
5610 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5611 New functions.
5612 (initialize_w32_display): Initialize mouse-highlight data.
5613
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
5619 highlight info.
5620
5621 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5622
5623 * lread.c (read1): Simplify slightly to avoid an overflow warning
5624 with GCC 4.7.0 on x86-64.
5625
5626 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5627
5628 * bidi.c (bidi_mirror_char): Revert last change: an int is
5629 definitely wide enough here.
5630
5631 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
5632
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)
5642 (mark_vectorlike):
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.
5709 (ccl_driver):
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
5727 out of 'int' range.
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
5752 to INT_MAX.
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.
5836 (Faref, Faset):
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.
5846 All uses changed.
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)
5860 (struct 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.
5876 (get_doc_string):
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
5906 undefined behavior.
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)
5933 (a_write, e_write):
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.
5959 (Frequire):
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
5986 integer overflow.
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):
6032 (Fcompute_motion):
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.
6040 (struct position):
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;
6044 all uses removed.
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.
6074 (struct interval):
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):
6099 (describe_command):
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)
6168 (Ftest_completion):
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
6180 wide enough.
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)
6187 (print_object):
6188 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6189 (PRINTDECLARE):
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)
6202 (sigchld_handler):
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
6206 undefined behavior.
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):
6231 (Freplace_match):
6232 (Fmatch_data):
6233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6234 (string_match_1, search_buffer, set_search_regs):
6235 (Fmatch_data):
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.
6261 (Fforward_word):
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.
6390 (Fx_family_fonts):
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)
6400 (Fx_show_tip):
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
6424 may come from Lisp.
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.
6432
6433 2012-05-25 Glenn Morris <rgm@gnu.org>
6434
6435 * lisp.mk (lisp): Update for more files being compiled now.
6436
6437 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6438
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.
6445
6446 * fileio.c, character.h: Minor style tweaks.
6447
6448 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6449
6450 * window.h (clip_changed): Remove useless declaration.
6451
6452 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
6453
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.
6456
6457 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6458
6459 Remove src/m/*.
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.
6478 (VALMASK): Use it.
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.
6488
6489 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6490
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)
6494 (xrealloc):
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.
6503
6504 2012-05-21 Ken Brown <kbrown@cornell.edu>
6505
6506 * xgselect.c (xg_select): Fix first argument in call to 'select'
6507 (bug#11508).
6508
6509 2012-05-20 Ken Brown <kbrown@cornell.edu>
6510
6511 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
6512 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
6513
6514 2012-05-19 Ken Brown <kbrown@cornell.edu>
6515
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).
6521
6522 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6523
6524 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6525
6526 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6527 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6528
6529 2012-05-18 Eli Zaretskii <eliz@gnu.org>
6530
6531 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6532
6533 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
6534 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
6535
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.
6539
6540 2012-05-17 Juri Linkov <juri@jurta.org>
6541
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).
6546
6547 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6548
6549 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6550
6551 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6552
6553 * lread.c (init_obarray): Declare Qt and Qnil as special.
6554
6555 2012-05-14 Glenn Morris <rgm@gnu.org>
6556
6557 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
6558 Put "libexec" before "bin", for the sake of init_callproc_1.
6559
6560 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6561
6562 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6563
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.
6569
6570 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6571
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)
6589
6590 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6591
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
6598 are on a TTY.
6599
6600 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6601
6602 * unexaix.c (make_hdr): Fix typo in prototype.
6603 This bug broke the build on AIX. Problem reported by Gilles Pion.
6604
6605 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
6606
6607 * keyboard.c (kbd_buffer_get_event): Read special events also in
6608 batch mode. (Bug#11415)
6609
6610 2012-05-12 Glenn Morris <rgm@gnu.org>
6611
6612 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6613
6614 2012-05-12 Eli Zaretskii <eliz@gnu.org>
6615
6616 * lisp.mk (lisp): Add newcomment.elc.
6617
6618 2012-05-12 Glenn Morris <rgm@gnu.org>
6619
6620 * Makefile.in (MKDIR_P): New, set by configure.
6621 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6622
6623 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6624
6625 Remove unused function hourglass_started.
6626 * dispextern.h (hourglass_started):
6627 * w32fns.c (hourglass_started):
6628 * xdisp.c (hourglass_started): Remove.
6629
6630 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
6631
6632 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6633 Update dependencies.
6634
6635 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6636
6637 * xgselect.c (xg_select): Put maxfds+1 into a var.
6638 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6639
6640 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6641
6642 2012-05-10 Dave Abrahams <dave@boostpro.com>
6643
6644 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6645 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6646
6647 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
6648
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.
6653
6654 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6655
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.
6669
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
6673 dbus_uint32_t.
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.
6677
6678 2012-05-09 Eli Zaretskii <eliz@gnu.org>
6679
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.
6685
6686 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6687
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
6690 message to clear.
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.
6693
6694 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
6695
6696 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6697 batch mode.
6698
6699 2012-05-06 Chong Yidong <cyd@gnu.org>
6700
6701 * lisp.mk (lisp): Update.
6702
6703 2012-05-05 Jim Meyering <meyering@redhat.com>
6704
6705 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6706
6707 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6708
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.
6716
6717 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6718
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.
6724
6725 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6726
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.
6742
6743 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6744
6745 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6746 with RESET_INTERVAL.
6747
6748 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6749 Remove duplicated buffer name initialization.
6750
6751 2012-05-02 Jim Meyering <jim@meyering.net>
6752
6753 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6754
6755 * xfns.c (x_window): Use xstrdup (Bug#11375).
6756
6757 2012-05-02 Eli Zaretskii <eliz@gnu.org>
6758
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)
6763
6764 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6765
6766 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6767 Move to simple.el.
6768
6769 2012-05-01 Glenn Morris <rgm@gnu.org>
6770
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.
6775
6776 * dispnew.c: Remove HAVE_LIBNCURSES test;
6777 it is always true on relevant platforms.
6778
6779 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6780 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6781
6782 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6783
6784 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6785
6786 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6787 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6788 Remove.
6789
6790 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6791
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.
6798
6799 2012-04-27 Chong Yidong <cyd@gnu.org>
6800
6801 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6802
6803 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6804
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
6808 via the scroll bar.
6809
6810 * window.c (window_scroll_pixel_based): Likewise.
6811
6812 2012-04-27 Chong Yidong <cyd@gnu.org>
6813
6814 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6815
6816 2012-04-27 Glenn Morris <rgm@gnu.org>
6817
6818 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6819 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6820
6821 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6822
6823 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6824 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
6825
6826 2012-04-26 Eli Zaretskii <eliz@gnu.org>
6827
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)
6831
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.
6836
6837 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6838
6839 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6840 (xgetint): Add missing shift for LSB tags.
6841
6842 2012-04-24 Martin Rudalics <rudalics@gmx.at>
6843
6844 * keyboard.c (read_char): Don't wipe echo area for select window
6845 events: These might get delayed via `mouse-autoselect-window'
6846 (Bug#11304).
6847
6848 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
6849
6850 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6851 manipulation of :loaded-from data.
6852
6853 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
6854
6855 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6856 now a cons (bug#11311).
6857
6858 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6859
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.
6867
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.
6882
6883 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6884 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6885
6886 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6887
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.
6914
6915 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6916
6917 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
6918
6919 Move functions from C to Lisp. Make non-blocking method calls
6920 the default. Implement further D-Bus standard interfaces.
6921
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
6944 level.
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):
6960 Adapt docstring.
6961
6962 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6963
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'.
6967
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
6972 is defined.
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.
6976
6977 2012-04-22 Leo Liu <sdl.web@gmail.com>
6978
6979 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6980
6981 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6982
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'.
6987
6988 2012-04-21 Eduard Wiebe <usenet@pusto.de>
6989
6990 * sysdep.c (list_system_processes, system_process_attributes):
6991 Add implementation for FreeBSD (Bug#5243).
6992
6993 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6994
6995 * lisp.mk (lisp): Update.
6996
6997 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6998
6999 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7000 It is never used otherwise.
7001
7002 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7003
7004 * print.c (print_preprocess): Only check print_depth if print-circle
7005 is nil.
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.
7008
7009 2012-04-20 Chong Yidong <cyd@gnu.org>
7010
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.
7013
7014 2012-04-20 Glenn Morris <rgm@gnu.org>
7015
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.
7019
7020 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7021
7022 * xdisp.c (string_buffer_position_lim): Limit starting position to
7023 BEGV.
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)
7030
7031 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7032
7033 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7034 (bug#11238).
7035
7036 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7037 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7038
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.
7049
7050 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7051
7052 * dired.c (Fsystem_groups): Remove unused local.
7053
7054 2012-04-17 Glenn Morris <rgm@gnu.org>
7055
7056 * dired.c (Fsystem_users): Doc fix.
7057
7058 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7059
7060 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7061 (syms_of_dired): Add them.
7062
7063 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7064
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.
7074
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.
7080
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!".
7089
7090 * alloc.c (which_symbols): Fix alignment issue / type clash.
7091
7092 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7093
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.
7104
7105 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7106
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.
7116
7117 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7118
7119 * lread.c (lisp_file_lexically_bound_p):
7120 Fix hang at ";-*-\n" (bug#11238).
7121
7122 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7123
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)
7126
7127 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7128
7129 * nsterm.m (constrainFrameRect): Always constrain when there is only
7130 one screen (Bug#10962).
7131
7132 2012-04-13 Ken Brown <kbrown@cornell.edu>
7133
7134 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7135
7136 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7137
7138 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7139
7140 2012-04-11 Daniel Colascione <dancol@dancol.org>
7141
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).
7145
7146 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7147
7148 * window.c (save_window_save): Obey window-point-insertion-type.
7149
7150 2012-04-11 Glenn Morris <rgm@gnu.org>
7151
7152 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7153
7154 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7155
7156 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7157
7158 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7159
7160 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7161 (force_quit_count): New var.
7162 (handle_interrupt): Use it.
7163
7164 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7165
7166 * w32.c (w32_delayed_load): Record the full path of the library
7167 being loaded (bug#10424).
7168
7169 2012-04-09 Glenn Morris <rgm@gnu.org>
7170
7171 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7172 not just in the obarray, before snarfing them. (Bug#11036)
7173
7174 * Makefile.in ($(leimdir)/leim-list.el):
7175 Pass EMACS rather than BUILT_EMACS.
7176
7177 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7178
7179 * process.c (make_process):
7180 * process.h: Add integer `gnutls_handshakes_tried' member to
7181 process struct.
7182
7183 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7184 Add convenience `GNUTLS_LOG2i' macro.
7185
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).
7191
7192 2012-04-09 Chong Yidong <cyd@gnu.org>
7193
7194 * eval.c (Fuser_variable_p, user_variable_p_eh)
7195 (lisp_indirect_variable): Functions deleted.
7196 (Fdefvar): Caller changed.
7197
7198 * callint.c (Finteractive, Fcall_interactively):
7199 * minibuf.c (Fread_variable): Callers changed.
7200
7201 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7202
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)
7208
7209 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7210
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.
7215
7216 2012-04-09 Glenn Morris <rgm@gnu.org>
7217
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.
7223
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.
7227
7228 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7229
7230 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7231 proper alignment.
7232
7233 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7234
7235 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7236 Remove unused local variable.
7237
7238 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7239
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.
7246
7247 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7248
7249 Fix typo that broke non-Windows builds.
7250 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7251
7252 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7253
7254 Support building on MS-Windows with libxml2.
7255
7256 * makefile.w32-in (OBJ2): Add xml.$(O).
7257 (GLOBAL_SOURCES): Add xml.c.
7258 ($(BLD)/xml.$(O)): New dependency list.
7259
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
7269 linked in).
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.
7273
7274 * emacs.c: Don't include libxml/parser.h.
7275 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7276 xmlCleanupParser directly.
7277
7278 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7279
7280 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7281
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)
7285
7286 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7287
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.
7294
7295 2012-04-04 Chong Yidong <cyd@gnu.org>
7296
7297 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7298
7299 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7300
7301 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7302 instead of alloca. (Bug#11138)
7303
7304 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7305
7306 * w32menu.c (is_simple_dialog): Properly check lisp types.
7307 (Bug#11141)
7308
7309 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7310
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)
7315
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)
7319
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
7323 the row's glyphs.
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.
7327 (Bug#11063)
7328
7329 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7330
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)
7337
7338 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7339
7340 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7341
7342 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7343
7344 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7345
7346 2012-03-27 Glenn Morris <rgm@gnu.org>
7347
7348 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7349 Doc fixes.
7350
7351 2012-03-26 Kenichi Handa <handa@m17n.org>
7352
7353 * dispextern.h (struct glyph): Fix previous change. Change the
7354 bit length of glyphless.ch to 25 (Bug#11082).
7355
7356 2012-03-26 Chong Yidong <cyd@gnu.org>
7357
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).
7361
7362 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7363
7364 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7365
7366 2012-03-25 Kenichi Handa <handa@m17n.org>
7367
7368 * dispextern.h (struct glyph): Change the bit length of
7369 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7370
7371 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7372
7373 * s/ms-w32.h (tzname): Include time.h before redirecting to
7374 _tzname. Fixes the MSVC build. (Bug#9960)
7375
7376 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7377
7378 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7379 characters.
7380
7381 * xterm.c (XTread_socket): Only modify handling_signal if
7382 !SYNC_INPUT. (Bug#11080)
7383
7384 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7385
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)
7391
7392 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7393
7394 * process.c (wait_reading_process_output): Handle pty disconnect
7395 by refraining from sending oneself a SIGCHLD (bug#10933).
7396
7397 2012-03-22 Chong Yidong <cyd@gnu.org>
7398
7399 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7400
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.
7405
7406 2012-03-21 Chong Yidong <cyd@gnu.org>
7407
7408 * xfaces.c (Vface_remapping_alist): Doc fix.
7409
7410 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7411
7412 * w32proc.c (Fw32_set_console_codepage)
7413 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7414 Doc fixes.
7415
7416 2012-03-20 Chong Yidong <cyd@gnu.org>
7417
7418 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7419 to reflect default non-nil value of redisplay-dont-pause.
7420
7421 2012-03-19 Kenichi Handa <handa@m17n.org>
7422
7423 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7424 it fit in a valid range (Bug#11003).
7425
7426 2012-03-18 Eli Zaretskii <eliz@gnu.org>
7427
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)
7433
7434 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7435
7436 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7437
7438 2012-03-12 Chong Yidong <cyd@gnu.org>
7439
7440 * eval.c (inhibit_lisp_code): Rename from
7441 inhibit_window_configuration_change_hook; move from window.c.
7442
7443 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7444 * window.c (run_window_configuration_change_hook)
7445 (syms_of_window): Callers changed.
7446
7447 2012-03-11 Chong Yidong <cyd@gnu.org>
7448
7449 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7450
7451 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7452
7453 2012-03-10 Chong Yidong <cyd@gnu.org>
7454
7455 * frame.c (other_visible_frames): Don't assume the selected frame
7456 is visible (Bug#10955).
7457
7458 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7459
7460 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7461
7462 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7463
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
7466 zero (Bug#10954).
7467
7468 2012-03-03 Glenn Morris <rgm@gnu.org>
7469
7470 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
7471
7472 2012-03-02 Eli Zaretskii <eliz@gnu.org>
7473
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
7477 comments.
7478 (redisplay_window): Pass to move_it_vertically the margin in
7479 pixels, not in screen lines.
7480
7481 2012-03-02 Glenn Morris <rgm@gnu.org>
7482
7483 * buffer.c (buffer-list-update-hook): Doc fix.
7484
7485 2012-02-29 Eli Zaretskii <eliz@gnu.org>
7486
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)
7492
7493 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7494
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.
7503
7504 2012-02-25 Chong Yidong <cyd@gnu.org>
7505
7506 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7507 Doc fix.
7508
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.
7512
7513 2012-02-24 Chong Yidong <cyd@gnu.org>
7514
7515 * keyboard.c (process_special_events): Handle all X selection
7516 requests in kbd_buffer, not just the next one (Bug#8869).
7517
7518 2012-02-23 Chong Yidong <cyd@gnu.org>
7519
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.
7523
7524 * window.c (inhibit_window_configuration_change_hook): New var.
7525 (run_window_configuration_change_hook): Obey it.
7526 (syms_of_window): Initialize it.
7527
7528 2012-02-22 Chong Yidong <cyd@gnu.org>
7529
7530 * xterm.c (x_draw_image_relief): Add missing type check for
7531 Vtool_bar_button_margin (Bug#10743).
7532
7533 2012-02-21 Chong Yidong <cyd@gnu.org>
7534
7535 * fileio.c (Vfile_name_handler_alist): Doc fix.
7536
7537 * buffer.c (Fget_file_buffer): Protect against invalid file
7538 handler return value.
7539
7540 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7541
7542 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7543 when computing $valmask.
7544
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.
7556
7557 2012-02-19 Chong Yidong <cyd@gnu.org>
7558
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).
7564
7565 2012-02-18 Eli Zaretskii <eliz@gnu.org>
7566
7567 * .gdbinit (pitx): Fix incorrect references to fields of the
7568 iterator stack.
7569
7570 2012-02-17 Chong Yidong <cyd@gnu.org>
7571
7572 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7573
7574 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7575
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>.
7578
7579 2012-02-15 Chong Yidong <cyd@gnu.org>
7580
7581 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7582 marked as special. Also, starting docstrings with * is obsolete.
7583
7584 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7585
7586 * gnutls.c (emacs_gnutls_write): Fix last change.
7587
7588 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7589
7590 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7591 send_process.
7592
7593 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7594
7595 * keymap.c (Fsingle_key_description): Handle char ranges.
7596
7597 2012-02-12 Chong Yidong <cyd@gnu.org>
7598
7599 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7600 as that creates a dangerous corner case.
7601
7602 * window.c (Fdelete_window_internal): Invalidate the mouse
7603 highlight (Bug#9904).
7604
7605 2012-02-12 Glenn Morris <rgm@gnu.org>
7606
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.
7614
7615 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
7616
7617 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7618
7619 2012-02-11 Eli Zaretskii <eliz@gnu.org>
7620
7621 * w32select.c (Fx_selection_exists_p): Sync doc string and
7622 argument list with xselect.c. (Bug#10783)
7623
7624 * w16select.c (Fx_selection_exists_p): Sync doc string and
7625 argument list with xselect.c. (Bug#10783)
7626
7627 2012-02-10 Glenn Morris <rgm@gnu.org>
7628
7629 * fns.c (Fsecure_hash): Doc fix.
7630
7631 2012-02-09 Kenichi Handa <handa@m17n.org>
7632
7633 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7634
7635 2012-02-07 Chong Yidong <cyd@gnu.org>
7636
7637 * buffer.c (Fbuffer_local_variables)
7638 (buffer_lisp_local_variables): Handle unbound vars correctly;
7639 don't let Qunbound leak into Lisp.
7640
7641 2012-02-07 Glenn Morris <rgm@gnu.org>
7642
7643 * image.c (Fimagemagick_types): Doc fix.
7644
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.
7648
7649 2012-02-06 Chong Yidong <cyd@gnu.org>
7650
7651 * doc.c (store_function_docstring): Avoid applying docstring of
7652 alias to base function (Bug#2603).
7653
7654 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7655
7656 * .gdbinit (pp1, pv1): Remove redundant defines.
7657 (pr): Use pp.
7658
7659 2012-02-04 Chong Yidong <cyd@gnu.org>
7660
7661 * nsterm.m: Declare a global (Bug#10694).
7662
7663 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7664
7665 * w32.c (get_emacs_configuration_options):
7666 Include --enable-checking, if specified, in the return value.
7667
7668 2012-02-04 Martin Rudalics <rudalics@gmx.at>
7669
7670 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7671 after rounding frame sizes. (Bug#9723)
7672
7673 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7674
7675 * keyboard.c (adjust_point_for_property): Don't position point
7676 before BEGV. (Bug#10696)
7677
7678 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7679
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.
7686
7687 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
7688
7689 * dbusbind.c (Fdbus_register_method): Mention the return value
7690 :ignore in the docstring.
7691
7692 2012-02-02 Glenn Morris <rgm@gnu.org>
7693
7694 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7695
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.
7701
7702 2012-02-02 Kenichi Handa <handa@m17n.org>
7703
7704 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7705 0, do not call append_composite_glyph.
7706
7707 2012-02-02 Kenichi Handa <handa@m17n.org>
7708
7709 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7710 NULL (Bug#6988).
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.
7713
7714 2012-02-01 Eli Zaretskii <eliz@gnu.org>
7715
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.
7720
7721 2012-01-31 Glenn Morris <rgm@gnu.org>
7722
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.
7726
7727 2012-01-29 Glenn Morris <rgm@gnu.org>
7728
7729 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7730
7731 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7732
7733 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7734
7735 2012-01-28 Chong Yidong <cyd@gnu.org>
7736
7737 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7738
7739 2012-01-26 Chong Yidong <cyd@gnu.org>
7740
7741 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7742
7743 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7744 repeat counts (Bug#10507).
7745
7746 2012-01-26 Glenn Morris <rgm@gnu.org>
7747
7748 * lread.c (syms_of_lread): Doc fix.
7749
7750 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7751
7752 * coding.c (encode_designation_at_bol): Change return value to
7753 EMACS_INT.
7754
7755 2012-01-25 Chong Yidong <cyd@gnu.org>
7756
7757 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7758
7759 2012-01-21 Chong Yidong <cyd@gnu.org>
7760
7761 * floatfns.c (Fcopysign): Make the second argument non-optional,
7762 since nil is not allowed anyway.
7763
7764 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7765
7766 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7767 (send_process): Likewise.
7768
7769 2012-01-19 Martin Rudalics <rudalics@gmx.at>
7770
7771 * window.c (save_window_save, Fcurrent_window_configuration)
7772 (Vwindow_persistent_parameters): Do not use Qstate.
7773 Rewrite doc-strings.
7774
7775 2012-01-19 Kenichi Handa <handa@m17n.org>
7776
7777 * character.c (char_width): New function.
7778 (Fchar_width, c_string_width, lisp_string_width):
7779 Use char_width (Bug#9496).
7780
7781 2012-01-16 Martin Rudalics <rudalics@gmx.at>
7782
7783 * window.c (Vwindow_persistent_parameters): New variable.
7784 (Fset_window_configuration, save_window_save): Handle persistent
7785 window parameters.
7786
7787 2012-01-14 Eli Zaretskii <eliz@gnu.org>
7788
7789 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7790 thrashing the stack of the thread. (Bug#9087)
7791
7792 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7793
7794 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7795
7796 2012-01-11 Eli Zaretskii <eliz@gnu.org>
7797
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
7802 before a R2L line.
7803
7804 2012-01-11 Glenn Morris <rgm@gnu.org>
7805
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)
7808
7809 2012-01-10 Glenn Morris <rgm@gnu.org>
7810
7811 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7812
7813 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7814 Update template values to be closer to their typical values these days.
7815
7816 2012-01-09 Eli Zaretskii <eliz@gnu.org>
7817
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)
7822
7823 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
7824
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.
7834
7835 2012-01-07 Eli Zaretskii <eliz@gnu.org>
7836
7837 * search.c (scan_buffer): Pass character positions to
7838 know_region_cache, not byte positions. (Bug#6540)
7839
7840 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
7841
7842 * w32.c (sys_rename): Report EXDEV when rename of a directory
7843 fails because the target is on another logical disk. (Bug#10284)
7844
7845 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7846
7847 * xterm.c (x_embed_request_focus): New function.
7848
7849 * xterm.h: Add prototype.
7850
7851 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7852
7853 2012-01-05 Glenn Morris <rgm@gnu.org>
7854
7855 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7856
7857 2012-01-01 Eli Zaretskii <eliz@gnu.org>
7858
7859 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7860 Load gnutls_transport_set_lowat only if GnuTLS version is below
7861 2.11.1.
7862 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7863 GnuTLS versions below 2.11.1.
7864
7865 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7866
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.
7870
7871 2011-12-28 Kenichi Handa <handa@m17n.org>
7872
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).
7876
7877 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7878
7879 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7880 can scroll.
7881 (create_and_show_popup_menu): Always use menu_position_func for
7882 Gtk3 (Bug#10361).
7883
7884 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7885
7886 * callint.c (Fcall_interactively): Don't truncate prompt string.
7887
7888 2011-12-23 Eli Zaretskii <eliz@gnu.org>
7889
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)
7893
7894 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7895
7896 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7897
7898 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7899
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].
7904
7905 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7906 before returning.
7907
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.
7912
7913 * emacs.c (ns_pool): New variable.
7914 (main): Assign ns_pool.
7915 (Fkill_emacs): Call ns_release_autorelease_pool.
7916
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.
7923
7924 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7925
7926 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7927 and NS_IMPL_COCOA.
7928 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7929 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7930
7931 2011-12-18 David Reitter <reitter@cmu.edu>
7932
7933 * nsterm.m (ns_term_init): Subscribe for notifications
7934 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7935 to method trackingNotification in EmacsMenu.
7936
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).
7941
7942 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7943
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
7963 here.
7964
7965 2011-12-17 Ken Brown <kbrown@cornell.edu>
7966
7967 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7968 GID is unknown (Bug#10257).
7969
7970 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7971
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.
7976
7977 2011-12-15 Juri Linkov <juri@jurta.org>
7978
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
7982 `MagickFalse'.
7983 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7984 proper order.
7985
7986 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7987
7988 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7989 fill background (Bug#8992).
7990
7991 2011-12-13 Martin Rudalics <rudalics@gmx.at>
7992
7993 * window.c (Vwindow_combination_resize)
7994 (Vwindow_combination_limit): Use t instead of non-nil in
7995 doc-strings.
7996 (Vrecenter_redisplay): Add first sentence of doc-string on
7997 separate line.
7998 (Frecenter): Fix doc-string typo.
7999
8000 2011-12-11 Kenichi Handa <handa@m17n.org>
8001
8002 * coding.c (Funencodable_char_position): Pay attention to the
8003 buffer text relocation (Bug#9389).
8004
8005 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8006
8007 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8008 gtk_init (Bug#10100).
8009
8010 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8011
8012 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8013 IT->string is nil. (Bug#10263)
8014
8015 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8016
8017 * nsterm.h (x_free_frame_resources): Declare.
8018
8019 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8020 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8021
8022 * nsterm.h (ns_get_defaults_value): Declare.
8023
8024 * nsterm.m (ns_default): Call ns_get_defaults_value.
8025
8026 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8027
8028 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8029 (Bug#10170)
8030
8031 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8032
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).
8036
8037 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8038
8039 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8040 after the loop to call ccl_driver at least once (Bug#8619).
8041
8042 2011-12-08 Kenichi Handa <handa@m17n.org>
8043
8044 * ftfont.c (get_adstyle_property): Fix previous change
8045 (Bug#10233).
8046
8047 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8048
8049 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8050 dirs from the default value of EMACSLOADPATH (bug#10208).
8051
8052 2011-12-07 Glenn Morris <rgm@gnu.org>
8053
8054 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8055 installation and source directories as well. (Bug#10208)
8056
8057 2011-12-06 Chong Yidong <cyd@gnu.org>
8058
8059 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8060
8061 2011-12-06 Glenn Morris <rgm@gnu.org>
8062
8063 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8064 as an error, not just -1. (Bug#10217)
8065
8066 2011-12-05 Chong Yidong <cyd@gnu.org>
8067
8068 * keyboard.c (process_special_events): New function.
8069 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8070
8071 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8072
8073 * coding.c (encode_designation_at_bol): Don't use uninitialized
8074 local variable (Bug#9318).
8075
8076 2011-12-05 Kenichi Handa <handa@m17n.org>
8077
8078 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8079 return Qnil (Bug#8046, Bug#10193).
8080
8081 2011-12-05 Kenichi Handa <handa@m17n.org>
8082
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
8086 relocated.
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.
8091
8092 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8093
8094 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8095 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8096 macro (Bug#9318).
8097
8098 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8099
8100 The following changes are to fix Bug#9318.
8101
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.
8106
8107 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8108
8109 * lisp.h (process_quit_flag): Fix external declaration.
8110
8111 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8112
8113 Don't macro-inline non-performance-critical code.
8114 * eval.c (process_quit_flag): New function.
8115 * lisp.h (QUIT): Use it.
8116
8117 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8118
8119 * nsfns.m (get_geometry_from_preferences): New function.
8120 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8121
8122 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8123
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.
8131
8132 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8133
8134 * widget.c (update_wm_hints): Return if wmshell is null.
8135 (widget_update_wm_size_hints): New function.
8136
8137 * widget.h (widget_update_wm_size_hints): Declare.
8138
8139 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8140 widget_update_wm_size_hints (Bug#10104).
8141
8142 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8143
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)
8148
8149 2011-12-02 Juri Linkov <juri@jurta.org>
8150
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)
8157
8158 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8159
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
8163 (bug#10117).
8164
8165 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8166
8167 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8168 waiting for input. (Bug#10169)
8169
8170 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8171
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)
8175
8176 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8177
8178 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8179
8180 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8181
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)
8185
8186 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8187
8188 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8189
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.
8194
8195 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8196
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).
8204
8205 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8206
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.
8210
8211 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8212
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
8217 compiling Emacs.
8218
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.
8223
8224 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8225 _MSC_VER.
8226
8227 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8228
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.
8232
8233 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8234
8235 * fileio.c (Finsert_file_contents): Undo previous change; see
8236 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8237
8238 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8239
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.
8246
8247 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8248
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
8255 string. (Bug#10119)
8256
8257 2011-11-24 Juri Linkov <juri@jurta.org>
8258
8259 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8260 after the `MagickPingImage' call. (Bug#10112)
8261
8262 2011-11-23 Chong Yidong <cyd@gnu.org>
8263
8264 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8265
8266 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8267
8268 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8269 making another buffer current. (Bug#10114)
8270
8271 2011-11-23 Glenn Morris <rgm@gnu.org>
8272
8273 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8274
8275 2011-11-23 Chong Yidong <cyd@gnu.org>
8276
8277 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8278 using it (Bug#5984).
8279
8280 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8281
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.
8284 (Bug#10098)
8285
8286 * .gdbinit (prow): Make displayed values more self-explaining.
8287 Add row's hash code.
8288
8289 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8290
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.
8294
8295 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8296
8297 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8298
8299 2011-11-21 Chong Yidong <cyd@gnu.org>
8300
8301 * window.c (Fnext_window, Fprevious_window): Doc fix.
8302
8303 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8304
8305 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8306
8307 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8308
8309 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8310
8311 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8312
8313 * window.c (Fset_window_combination_limit): Rename argument
8314 STATUS to LIMIT.
8315 (Vwindow_combination_limit): Remove "status" from doc-string.
8316
8317 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8318
8319 * m/ibms390.h: Remove.
8320 * m/ibms390x.h: Don't include "ibms390.h".
8321
8322 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8323
8324 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8325 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8326
8327 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8328
8329 * casetab.c (Fset_case_table):
8330 * charset.c (Fcharset_after): Fix typos.
8331
8332 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8333
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.
8351
8352 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8353
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.
8358
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)
8362
8363 2011-11-18 Chong Yidong <cyd@gnu.org>
8364
8365 * window.c (Fwindow_combination_limit): Make first argument
8366 non-optional, since it is meaningless for live windows like the
8367 selected window.
8368
8369 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8370
8371 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8372
8373 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8374
8375 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8376 (graft_intervals_into_buffer): Simplify.
8377
8378 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8379
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.
8385
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
8389 hash code inline.
8390
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.
8393
8394 * dispextern.h (row_hash): Add prototype.
8395
8396 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8397
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.
8400
8401 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8402
8403 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8404
8405 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8406
8407 * window.c (Vwindow_splits): Rename to
8408 Vwindow_combination_resize. Suggested by Juri Linkov.
8409 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8410 of Vwindow_splits.
8411
8412 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8413
8414 * nsfns.m (Fns_font_name):
8415 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8416
8417 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8418
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.
8427
8428 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
8429
8430 * image.c (imagemagick_load_image): Fix typo.
8431
8432 2011-11-14 Eli Zaretskii <eliz@gnu.org>
8433
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)
8439
8440 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
8441
8442 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8443 just return (bug#10044).
8444
8445 2011-11-12 Eli Zaretskii <eliz@gnu.org>
8446
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.
8451
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.
8457
8458 2011-11-12 Martin Rudalics <rudalics@gmx.at>
8459
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.
8468
8469 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8470
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).
8475
8476 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8477
8478 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
8479
8480 2011-11-11 Kenichi Handa <handa@m17n.org>
8481
8482 * callproc.c (Fcall_process): Set the member dst_multibyte of
8483 process_coding.
8484
8485 2011-11-11 Johan Bockgård <bojohan@gnu.org>
8486
8487 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8488 avoid a crash (bug#9496).
8489
8490 2011-11-09 Chong Yidong <cyd@gnu.org>
8491
8492 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8493 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8494
8495 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8496
8497 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8498
8499 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8500
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>
8504 et seq.
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.
8518
8519 2011-11-08 Chong Yidong <cyd@gnu.org>
8520
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.
8526
8527 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
8528
8529 * lisp.h (syms_of_abbrev): Remove declaration.
8530 Reported by CHENG Gao <chenggao@royau.me>.
8531
8532 2011-11-07 Eli Zaretskii <eliz@gnu.org>
8533
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.
8537
8538 2011-11-07 Martin Rudalics <rudalics@gmx.at>
8539
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.
8550
8551 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8552
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.
8557
8558 2011-11-07 Kenichi Handa <handa@m17n.org>
8559
8560 * coding.c (coding_set_destination): Check coding->src_pos only
8561 when coding->src_object is a buffer (bug#9910).
8562
8563 * process.c (send_process): Set the member src_multibyte of coding
8564 to 0 (bug#9911) when sending a unibyte text.
8565
8566 * callproc.c (Fcall_process): Set the member src_multibyte of
8567 process_coding to 0 (bug#9912).
8568
8569 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8570
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).
8574
8575 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8576
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.
8592
8593 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8594
8595 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8596 GC.
8597
8598 2011-11-06 Eli Zaretskii <eliz@gnu.org>
8599
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.
8604
8605 2011-11-06 Chong Yidong <cyd@gnu.org>
8606
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.
8617
8618 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
8619
8620 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8621 support MSVC.
8622
8623 2011-11-05 Jason Rumney <jasonr@gnu.org>
8624
8625 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8626 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8627 fonts (Bug#6029).
8628 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8629 bitwise arithmetic preventing use of unicode-sip and non-truetype
8630 opentype fonts.
8631
8632 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8633
8634 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8635 "emacs"-only part.
8636
8637 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8638 initialization code to keep similarity to xfns.c after changes
8639 from 2011-11-05.
8640
8641 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8642
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
8649 (Bug#9943).
8650
8651 * nsterm.m (x_free_frame_resources): New function.
8652 (x_destroy_window): Move code to x_free_frame_resources.
8653
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).
8659
8660 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8661
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
8665 nt/gmake.defs.
8666
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
8671 bitfields.
8672 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8673 types in bitfields.
8674 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8675
8676 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8677
8678 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
8679
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.
8683
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
8688 e_* cousins.
8689 (alloca) [_MSC_VER]: Define to _alloca.
8690
8691 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8692
8693 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8694
8695 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8696
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)
8700
8701 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8702
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
8706 may be NULL.
8707
8708 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8709
8710 * window.c (Fwindow_body_size): Mention in the doc string that the
8711 return value is in frame's canonical units. (Bug#9949)
8712
8713 2011-11-03 Eli Zaretskii <eliz@gnu.org>
8714
8715 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8716
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.
8720
8721 2011-11-01 Eli Zaretskii <eliz@gnu.org>
8722
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.
8728
8729 2011-11-01 Martin Rudalics <rudalics@gmx.at>
8730
8731 * window.c (temp_output_buffer_show): Don't use
8732 Vtemp_buffer_show_specifiers.
8733 (Vtemp_buffer_show_specifiers): Remove unused variable.
8734
8735 2011-10-30 Eli Zaretskii <eliz@gnu.org>
8736
8737 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8738 past the beginning of the current glyph matrix.
8739
8740 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
8741
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).
8745
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).
8748
8749 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8750
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.
8759
8760 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8761
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.
8765
8766 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8767
8768 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8769
8770 2011-10-29 Eli Zaretskii <eliz@gnu.org>
8771
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.
8776
8777 2011-10-29 Kim Storm <storm@cua.dk>
8778
8779 * alloc.c (which_symbols): New function.
8780
8781 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8782
8783 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8784 line. (Bug#9903)
8785
8786 2011-10-29 Glenn Morris <rgm@gnu.org>
8787
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)
8790
8791 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8792
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.
8796
8797 2011-10-28 Chong Yidong <cyd@gnu.org>
8798
8799 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8800
8801 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8802
8803 * window.c (make_window): Initialize phys_cursor_on_p.
8804
8805 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8806
8807 * lisp.h (struct Lisp_Symbol): Update comments.
8808
8809 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
8810
8811 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8812
8813 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8814
8815 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8816 <oslsachem@gmail.com> for helping to debug this.
8817
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):
8825 New functions.
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.
8829
8830 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8831
8832 * w32.h (syms_of_w32font): Add prototype.
8833
8834 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8835
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.
8840
8841 2011-10-27 Chong Yidong <cyd@gnu.org>
8842
8843 * process.c (make_process): Set gnutls_state to NULL.
8844
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.
8849
8850 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8851
8852 2011-10-27 Chong Yidong <cyd@gnu.org>
8853
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.
8857
8858 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8859 (deactivate_process): Call emacs_gnutls_deinit.
8860
8861 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8862
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.
8867
8868 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
8869
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)
8873
8874 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8875
8876 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8877
8878 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8879
8880 * keyboard.c (test_undefined): New function (bug#9751).
8881 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8882
8883 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8884
8885 * sysdep.c (init_sys_modes): Fix the check for the controlling
8886 terminal (Bug#6649).
8887
8888 2011-10-20 Eli Zaretskii <eliz@gnu.org>
8889
8890 * dispextern.h (struct bidi_it): New member next_en_type.
8891
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.
8900
8901 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8902
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
8919 didn't fix it.
8920 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8921
8922 2011-10-19 Eli Zaretskii <eliz@gnu.org>
8923
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.
8930 (Bug#9771, part 2)
8931
8932 2011-10-18 Chong Yidong <cyd@gnu.org>
8933
8934 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8935 with nobreak-char-display too.
8936
8937 2011-10-18 Eli Zaretskii <eliz@gnu.org>
8938
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
8952 that follows it.
8953 (bidi_level_of_next_char): Set next_en_pos to zero when
8954 invalidating its info.
8955
8956 2011-10-17 Eli Zaretskii <eliz@gnu.org>
8957
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.
8963 (Bug#9771, part 1)
8964
8965 2011-10-15 Martin Rudalics <rudalics@gmx.at>
8966
8967 * window.c (coordinates_in_window): Rewrite and delabelize
8968 vertical border check. (Bug#5357) (Bug#9618)
8969
8970 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8971
8972 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8973 errors in XSetWindowBorder (bug#9310).
8974
8975 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8976
8977 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8978 avoid crash when xmalloc overrun checking is enabled.
8979
8980 2011-10-13 Eli Zaretskii <eliz@gnu.org>
8981
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.
8985
8986 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8987 some callers set that themselves.
8988
8989 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8990
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)
8994
8995 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8996
8997 * doc.c (get_doc_string): Encode file name (bug#9735).
8998
8999 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9000
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.
9004
9005 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9006
9007 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9008
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.
9012
9013 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9014
9015 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9016 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9017
9018 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9019 Some packages use them to denote characters with modifiers.
9020
9021 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9022
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.
9026
9027 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9028
9029 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9030
9031 2011-10-08 Glenn Morris <rgm@gnu.org>
9032
9033 * callint.c (Fcall_interactively): Give a more explicit error for the
9034 'c' case with a non-character input. (Bug#8479)
9035
9036 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9037
9038 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9039 lines.
9040 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9041 lines that are hscrolled on the left.
9042
9043 * dispnew.c (buffer_posn_from_coords): Account for a possible
9044 presence of header-line. (Bug#4426)
9045
9046 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9047
9048 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9049 Don't advertise functionality which we discourage or doesn't work.
9050
9051 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9052
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.
9062
9063 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9064
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.
9068
9069 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9070
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.
9074
9075 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9076 they've been requested explicitly (bug#9591).
9077
9078 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9079
9080 * keymap.c (Fsingle_key_description): Use make_specified_string
9081 instead of build_string to build string from push_key_description.
9082 (Bug#5193)
9083
9084 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9085
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.
9093
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.
9107
9108 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9109
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).
9113
9114 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9115
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.
9119
9120 Port --enable-checking=all to Fedora 14 x86.
9121 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9122 Move to lisp.h.
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.
9137
9138 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9139
9140 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9141 use EDOM.
9142
9143 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9144
9145 * xdisp.c (compute_display_string_end): If there's no display
9146 string at CHARPOS, return -1.
9147
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)
9151
9152 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9153
9154 * lread.c (Fread_from_string): Fix typo in docstring.
9155
9156 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9157
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.
9163
9164 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9165
9166 * lread.c (readevalloop): Use correct code for NBSP.
9167 (read1): Likewise. (Bug#9608)
9168
9169 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9170
9171 * dbusbind.c (Fdbus_register_signal): When service is not
9172 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9173
9174 2011-09-25 Glenn Morris <rgm@gnu.org>
9175
9176 * buffer.c (truncate-lines): Doc fix.
9177
9178 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9179
9180 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9181 (Fset_window_next_buffers): Doc fix.
9182
9183 2011-09-24 Glenn Morris <rgm@gnu.org>
9184
9185 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9186
9187 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9188
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.
9192
9193 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9194
9195 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9196 Default value is now t. Doc fix.
9197
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)
9202
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.
9207
9208 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9209
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):
9213 Fix docstring.
9214
9215 2011-09-24 Jim Meyering <meyering@redhat.com>
9216
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)
9229
9230 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9231
9232 * emacs.c (Fkill_emacs): In noninteractive mode exit
9233 non-successfully if a write error occurred on stdout. (Bug#9574)
9234
9235 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9236
9237 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9238 the xassert test.
9239
9240 * dispextern.h (struct it): Update the comment documenting what
9241 can it->OBJECT be.
9242
9243 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9244
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.
9253
9254 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9255
9256 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9257 (bug#9493).
9258
9259 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9260
9261 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9262 boolean (Bug#9154).
9263
9264 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9265
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
9270 they don't fit.
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)
9277
9278 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9279
9280 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9281 and turn window cursor on if cleared (Bug#9415).
9282
9283 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9284
9285 * search.c (boyer_moore): Take unibyte characters from pattern
9286 literally. (Bug#9458)
9287
9288 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9289
9290 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9291
9292 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9293
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.
9297
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.
9302
9303 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9304
9305 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9306
9307 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9308
9309 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9310 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9311
9312 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9313
9314 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9315 about the current paragraph and restore it after the call to reseat.
9316
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)
9323
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)
9326
9327 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9328
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.
9334
9335 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9336
9337 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9338
9339 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9340
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.
9343
9344 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9345
9346 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9347 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9348
9349 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9350
9351 * editfns.c (Fformat): Correctly handle text properties on "%%".
9352
9353 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9354
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.
9362
9363 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9364
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.
9368
9369 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9370
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)
9373
9374 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9375
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.
9383
9384 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9385
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.
9393
9394 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9395
9396 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9397 computation of loop end. Reported by Johan Bockgård
9398 <bojohan@gnu.org>.
9399
9400 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9401
9402 * frame.c (Fother_visible_frames_p): Function deleted.
9403
9404 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9405
9406 * indent.c (compute_motion): Process display vector front to back
9407 rather than the other way around. (Bug#2496)
9408
9409 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9410
9411 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9412
9413 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9414
9415 * minibuf.c (Fread_from_minibuffer): Doc fix.
9416
9417 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9418
9419 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9420 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9421
9422 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9423
9424 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9425 value for non-existent files.
9426
9427 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9428
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.
9433 (Bug#9139)
9434
9435 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9436
9437 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9438 here ...
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.
9443
9444 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9445
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.
9449
9450 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9451
9452 * xml.c (parse_region): Make the parsing work for
9453 non-comment-starting XML files again (bug#9144).
9454
9455 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9456
9457 * image.c (gif_load): Fix calculation of bottom and right corner.
9458 (Bug#9468)
9459
9460 2011-09-10 Eli Zaretskii <eliz@gnu.org>
9461
9462 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9463 redisplay in small windows.
9464
9465 2011-09-09 Eli Zaretskii <eliz@gnu.org>
9466
9467 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9468
9469 2011-09-08 Martin Rudalics <rudalics@gmx.at>
9470
9471 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9472 Operate on live windows only.
9473
9474 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
9475
9476 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9477
9478 2011-09-07 Eli Zaretskii <eliz@gnu.org>
9479
9480 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9481 only under bidi iteration.
9482
9483 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9484
9485 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9486
9487 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9488
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
9495 a __builtin_isnan.
9496 * floatfns.c (isnan): #undef, and then #define to a clone of
9497 what's in data.c.
9498 (Fisnan): Always define, since it's always available now.
9499 (syms_of_floatfns): Always define isnan at the Lisp level.
9500
9501 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9502
9503 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9504
9505 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9506
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.
9523
9524 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
9525
9526 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9527
9528 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9529
9530 sprintf-related integer and memory overflow issues (Bug#9412).
9531
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.
9549
9550 * dbusbind.c (signature_cat): New function.
9551 (xd_signature, Fdbus_register_signal):
9552 Do not overrun buffer; instead, report string overflow.
9553
9554 * dispnew.c (add_window_display_history): Don't overrun buffer.
9555 Truncate instead; this is OK since it's just a log.
9556
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.
9560
9561 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9562 when creating daemon; the previous buffer-overflow check was incorrect.
9563
9564 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9565 which has the guts of the old verror function.
9566
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.
9569
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.
9579
9580 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9581 (fontset_from_font): Print it.
9582
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
9591 not fit in int.
9592
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.
9596
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.
9599
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.
9605
9606 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9607 in case result does not fit in int.
9608
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'.
9616
9617 * process.c (make_process): Use printmax_t, not int, to format
9618 process-name gensyms.
9619
9620 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9621
9622 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9623 to avoid potential buffer overrun.
9624
9625 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9626 if X resource line is longer than 512 bytes.
9627
9628 * xfns.c (x_window): Make sprintf buffer a bit bigger
9629 to avoid potential buffer overrun.
9630
9631 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9632
9633 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9634
9635 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9636
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.
9641
9642 * xdisp.c (try_window_id): Check Emacs fixnum range before
9643 converting to 'int'.
9644
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.
9653
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'.
9658
9659 * print.c (print_object): Use ptrdiff_t, not int, for index that can
9660 exceed INT_MAX.
9661
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.
9666
9667 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9668
9669 * Require libxml/parser.h to avoid compilation warning.
9670
9671 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9672
9673 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9674 since this reportedly can destroy thread storage.
9675
9676 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
9677
9678 * syntax.c (find_defun_start): Update all cache variables if
9679 exiting early (Bug#9401).
9680
9681 2011-08-30 Eli Zaretskii <eliz@gnu.org>
9682
9683 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9684
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)
9688
9689 * term.c (tty_append_glyph): New function.
9690 (produce_stretch_glyph): Static function and its prototype deleted.
9691
9692 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9693 Add prototypes.
9694
9695 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9696
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.
9702
9703 2011-08-28 Johan Bockgård <bojohan@gnu.org>
9704
9705 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9706 set_tty_hooks.
9707
9708 2011-08-27 Eli Zaretskii <eliz@gnu.org>
9709
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.
9714
9715 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9716
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.
9724
9725 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
9726
9727 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9728
9729 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
9730
9731 Integer and memory overflow issues (Bug#9196).
9732
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
9736 convenient.
9737
9738 * image.c (x_allocate_bitmap_record, cache_image):
9739 * xselect.c (Fx_register_dnd_atom):
9740 Simplify previous changes by using xpalloc.
9741
9742 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9743 since either will do and ptrdiff_t is convenient with xpalloc.
9744
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.
9752
9753 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9754
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.
9758
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.
9762
9763 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9764
9765 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9766 (SAFE_NALLOCA): New macro.
9767
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.
9779
9780 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9781 EMACS_INT, since either will do, for xpalloc.
9782
9783 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9784 (xnmalloc, xnrealloc, xpalloc): New functions.
9785
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.
9789
9790 * bidi.c (bidi_cache_shrink):
9791 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9792 (overlay_strings):
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.
9799
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.
9805
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.
9810
9811 * character.c (Fstring): Check for size-calculation overflow.
9812
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.
9816
9817 * composite.c (get_composition_id): Check for overflow in glyph
9818 length calculations.
9819
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.
9834
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.
9841
9842 * editfns.c (set_time_zone_rule): Don't assume environment length
9843 fits in int.
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.
9848
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.
9853
9854 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9855 alloc succeeds.
9856 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9857
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.
9862
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.
9866
9867 * fringe.c (Fdefine_fringe_bitmap):
9868 Don't update size until alloc works.
9869
9870 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9871 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9872
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.
9884
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)
9891 (x_detect_edges):
9892 Check for size calculation overflow.
9893 (ct_colors_allocated_max): New constant.
9894 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9895 overflow.
9896
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.
9905
9906 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9907 to count maps.
9908 (current_minor_maps): Check for size calculation overflow.
9909 * keymap.h: Change prototypes to match the above.
9910
9911 * lread.c (read1, init_obarray): Don't update size until alloc done.
9912
9913 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9914 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9915
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.
9920
9921 * process.c (Fnetwork_interface_list): Check for overflow
9922 in size calculation.
9923
9924 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9925
9926 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9927 overflow. Don't bother calling xmalloc when xrealloc will do.
9928
9929 * search.c (Freplace_match): Check for size calculation overflow.
9930 (Fset_match_data): Don't assume list lengths fit in 'int'.
9931
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.
9935
9936 * term.c (max_frame_lines): Remove; unused.
9937 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9938 not int.
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.
9945
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
9949 until alloc done.
9950
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.
9956
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.
9960
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.
9967
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.
9972
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.
9976
9977 * xrdb.c (get_environ_db): Don't assume path length fits in int,
9978 as sprintf is limited to int lengths.
9979
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.
9988 All uses changed.
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
10001 something.
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.
10025
10026 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10027
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
10034 to int size).
10035
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.
10046
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).
10061
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.
10065
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.
10075
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.
10083
10084 * fileio.c: Integer overflow issues with file modes.
10085 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10086
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.
10090
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.
10096
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.
10109
10110 Overflow, signedness and related fixes for images.
10111
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.
10124
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.
10152
10153 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10154
10155 * xdisp.c (redisplay_window): Don't force window start if point
10156 will be invisible in the resulting window. (Bug#9324)
10157
10158 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10159
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
10166 rather than 1.
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.
10170
10171 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10172 into disp_prop; all users changed.
10173
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.
10177
10178 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10179
10180 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10181 Change return value to nil.
10182 (Frecord_buffer): Delete unused function.
10183
10184 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10185
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.
10201
10202 * bidi.c (bidi_check_type): Use xassert.
10203 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10204 members.
10205
10206 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10207
10208 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10209 a character.
10210
10211 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10212
10213 * nsfont.m (ns_otf_to_script): Fix typo.
10214
10215 2011-08-22 Kenichi Handa <handa@m17n.org>
10216
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.
10219
10220 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10221
10222 * xdisp.c (redisplay_window): When computing centering_position,
10223 account for the height of the header line. (Bug#8874)
10224
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.
10229
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.
10233
10234 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10235
10236 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10237
10238 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10239
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.
10243
10244 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10245
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).
10249
10250 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10251
10252 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10253 (Fcondition_case): Document `debug' symbol in error handler.
10254
10255 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10256
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.
10260
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.
10265
10266 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10267
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'.
10271
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.
10276
10277 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10278
10279 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10280
10281 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10282
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).
10286
10287 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10288
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)
10291
10292 2011-08-16 Ken Brown <kbrown@cornell.edu>
10293
10294 * gmalloc.c: Expand comment.
10295
10296 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10297
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.
10300
10301 2011-08-16 Ken Brown <kbrown@cornell.edu>
10302
10303 Fix memory allocation problems in Cygwin build (Bug#9273).
10304
10305 * unexcw.c ( __malloc_initialized): Declare external variable.
10306 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10307
10308 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10309 New variables.
10310 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10311 dumped emacs.
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.
10317
10318 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10319
10320 * bidi.c (bidi_initialize): Remove unused local.
10321
10322 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10323
10324 * bidimirror.h:
10325 * biditype.h: Remove file.
10326 * makefile.w32-in ($(BLD)/bidi.$(O)):
10327 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10328
10329 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10330
10331 * chartab.c: Improve commentary for the uniprop_table API.
10332
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.
10337
10338 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10339 coordinates of the iterator when restoring from ppos_it.
10340 (Bug#9296)
10341
10342 2011-08-14 Kenichi Handa <handa@m17n.org>
10343
10344 * process.c (create_process): Call setup_process_coding_systems
10345 after the pid of the process is set to -1 (Bug#8162).
10346
10347 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10348
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)
10353
10354 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10355
10356 * nsterm.h (ns_run_ascript): Declare.
10357 (NSAPP_DATA2_RUNASSCRIPT): Define.
10358
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).
10364
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).
10368
10369 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10370
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.
10379
10380 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10381 uses changed.
10382
10383 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10384
10385 * xfaces.c (Qframe_set_background_mode): Now static.
10386 * dispextern.h (Qframe_set_background_mode): Remove decl.
10387
10388 * process.c (Fnetwork_interface_info): Declare local only if needed.
10389
10390 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10391
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
10396 sockaddr.
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.
10400
10401 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10402
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)
10414
10415 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10416
10417 * fontset.c (fontset_get_font_group): Add proper type checks.
10418 (Bug#9172)
10419
10420 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10421
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.
10426
10427 2011-08-08 Eli Zaretskii <eliz@gnu.org>
10428
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.
10433
10434 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
10435
10436 * editfns.c (Fset_time_zone_rule): Document relationship with the
10437 setenv function.
10438
10439 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10440 the font entity extracted from the cache (Bug#8109).
10441
10442 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
10443
10444 * composite.c (autocmp_chars): Don't reset point. That is done by
10445 restore_point_unwind (Bug#5984).
10446
10447 2011-08-07 Juri Linkov <juri@jurta.org>
10448
10449 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10450 to show the arg `TIME' instead of `TIMEVAL'.
10451
10452 2011-08-06 Eli Zaretskii <eliz@gnu.org>
10453
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)
10459
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)
10463
10464 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10465
10466 * bidi.c <bidi_cache_total_alloc>: Now static.
10467 (bidi_initialize): Initialize bidi_cache_total_alloc.
10468
10469 * xdisp.c (display_line): Release buffer allocated for shelved bidi
10470 cache. (Bug#9221)
10471
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.
10477
10478 * dispextern.h (bidi_unshelve_cache): Update prototype.
10479
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)
10486
10487 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10488
10489 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10490 came from a string character with a `cursor' property. (Bug#9229)
10491
10492 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10493
10494 * Makefile.in (LIB_PTHREAD): New variable.
10495 (LIBES): Add LIB_PTHREAD (Bug#9216).
10496
10497 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10498 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10499
10500 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10501
10502 * regex.c (re_iswctype): Remove some redundant boolean conversions.
10503
10504 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10505
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.
10510
10511 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10512
10513 * callproc.c (Fcall_process): Avoid vfork clobbering
10514 the local vars buffer, coding_systems, current_dir.
10515
10516 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10517
10518 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10519
10520 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10521
10522 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10523 so that it is not optimized away.
10524
10525 * xdisp.c (compute_display_string_pos): Remove unused local.
10526
10527 2011-08-02 Eli Zaretskii <eliz@gnu.org>
10528
10529 Fix slow cursor motion and scrolling in large buffers with
10530 selective display, like Org Mode buffers. (Bug#9218)
10531
10532 * dispextern.h (struct bidi_it): New member disp_prop_p.
10533
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
10538 non-zero.
10539
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.
10544
10545 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10546
10547 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10548
10549 2010-12-03 Don March <don@ohspite.net>
10550
10551 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10552 last character M-[char] is translated to ESC [char] (bug#7541).
10553
10554 2011-08-02 Kenichi Handa <handa@m17n.org>
10555
10556 * lisp.h (uniprop_table): Extern it.
10557
10558 * chartab.c (uniprop_table): Make it non-static.
10559
10560 2011-08-01 Eli Zaretskii <eliz@gnu.org>
10561
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
10564 on the newline.
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)
10568
10569 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10570
10571 * regex.c (re_comp): Protoize.
10572 (re_exec): Fix return type.
10573 (regexec): Fix type of `ret'. (Bug#9203)
10574
10575 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10576
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.
10579
10580 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10581
10582 * print.c (print_object): Print empty symbol as ##.
10583
10584 * lread.c (read1): Read ## as empty symbol.
10585
10586 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10587
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.
10591
10592 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10593 contents (Bug#9176).
10594 (EmacsTooltip -init): Remove bezels and add shadows to
10595 tooltip windows.
10596
10597 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10598 or scroll bar (Bug#8470).
10599
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).
10603
10604 * nsterm.h (nsfont_info): Remove voffset field.
10605
10606 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10607
10608 Implement strike-through and overline on NextStep (Bug#8863).
10609
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.
10613
10614 * nsterm.h: Add declaration for ns_draw_text_decoration.
10615
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.
10621
10622 2011-07-28 Eli Zaretskii <eliz@gnu.org>
10623
10624 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10625 default.
10626
10627 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10628
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.
10632
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.
10636
10637 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10638
10639 * regex.c (re_iswctype): Convert return values to boolean.
10640
10641 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10642
10643 * xdisp.c (compute_display_string_pos): Don't use cached display
10644 string position if the buffer had its restriction changed.
10645 (Bug#9184)
10646
10647 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10648
10649 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10650
10651 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10652
10653 Integer signedness and overflow and related fixes. (Bug#9079)
10654
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
10666 might not return.
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>.
10671
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>.
10675
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.
10694
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.
10698
10699 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10700
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.
10704
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.
10709
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'.
10736
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.
10746
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.
10751
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.
10755 All uses changed.
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.
10764
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.
10774
10775 * keyboard.h (num_input_events): Now uintmax_t.
10776 This is (very slightly) less likely to mess up due to wraparound.
10777 All uses changed.
10778
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
10782 signed integers.
10783
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
10790 signed integers.
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
10794 is signed.
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
10801 in rest of code.
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.
10807
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.
10814
10815 * doprnt.c: Prefer signed to unsigned when either works.
10816 * eval.c (verror):
10817 * doprnt.c (doprnt):
10818 * lisp.h (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.
10825
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.
10837
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.
10842
10843 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10844 (__malloc_safe_bcopy): Remove; no longer needed.
10845
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.
10849
10850 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10851
10852 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10853 closes the connection while we're reading (bug#9182).
10854
10855 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
10856
10857 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10858 are specified (Bug#9168).
10859
10860 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10861
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.
10864
10865 2011-07-25 Eli Zaretskii <eliz@gnu.org>
10866
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.
10870
10871 2011-07-24 Eli Zaretskii <eliz@gnu.org>
10872
10873 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10874 for attrs[LFACE_FONTSET_INDEX].
10875
10876 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10877
10878 * xml.c (parse_region): Remove unused local
10879 that was recently introduced.
10880
10881 2011-07-23 Eli Zaretskii <eliz@gnu.org>
10882
10883 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10884 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10885
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.
10892
10893 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10894
10895 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10896 for OSX >= 10.7.
10897
10898 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10899
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
10906 base_level_stop.
10907 (reseat): Don't look for prev_stop, as that could mean a very long
10908 run.
10909 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10910 <cached_disp_overlay_modiff>: Cache for last found display string
10911 position.
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.
10916
10917 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10918
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)
10921
10922 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
10923
10924 * frame.c (Fmodify_frame_parameters): In tty case, update the
10925 default face if necessary (Bug#4238).
10926
10927 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
10928
10929 * editfns.c (Fstring_to_char): No need to explain what a character
10930 is in the docstring (Bug#6576).
10931
10932 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10933
10934 * xml.c (parse_region): Make sure we always return a tree.
10935
10936 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10937
10938 * xml.c (parse_region): If a document contains only comments,
10939 return that, too.
10940
10941 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10942
10943 * xml.c (make_dom): Return comments, too.
10944
10945 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10946
10947 Port to OpenBSD.
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
10953 timer goes off.
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.
10957
10958 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10959
10960 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10961 (bug#8460).
10962
10963 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10964
10965 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10966 This fixes some race conditions on the permissions of any newly
10967 created file.
10968
10969 * alloc.c (valid_pointer_p): Use pipe, not open.
10970 This fixes some permissions issues when debugging.
10971
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.
10976
10977 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10978
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.
10984
10985 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10986
10987 * lread.c (read_integer): Unread even EOF character.
10988 (read1): Likewise. Properly record start position of symbol.
10989
10990 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10991 symbol character follows.
10992
10993 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10994
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.
11000
11001 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11002
11003 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11004
11005 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11006
11007 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11008
11009 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11010
11011 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11012 it's used from the C level.
11013
11014 * process.c: Use the same condition for POLL_FOR_INPUT in both
11015 keyboard.c and process.c (bug#1858).
11016
11017 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11018
11019 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11020 (Fgnutls_boot): Use it.
11021
11022 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11023
11024 * doc.c (Fsubstitute_command_keys): Revert last change.
11025
11026 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11027
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).
11031
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).
11035
11036 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11037
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.
11040
11041 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11042
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
11049 of the confusion.
11050 * indent.c (Fvertical_motion): Mark locals as initialized.
11051 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11052
11053 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11054
11055 * search.c (Fre_search_backward): Mention `case-fold-search' in
11056 all the re_search_* functions (bug#8138).
11057
11058 * keyboard.c (Fopen_dribble_file): Document when the file is
11059 closed (bug#8056).
11060
11061 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11062
11063 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11064 bidi_cache_idx.
11065
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
11077 L2R.
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
11084 Lisp strings.
11085 (compute_display_string_end): Support display properties on Lisp
11086 strings.
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
11092 arrow keys.
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
11104 Lisp strings.
11105 (next_element_from_string): Support bidi reordering of Lisp
11106 strings.
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
11111 here.
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
11116 structure.
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
11129 well.
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
11137 bidi-iterating.
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
11144 the same effect.
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
11162 iterator.
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
11190 TO_CHARPOS.
11191 (pos_visible_p): Support positions in bidi-reordered lines.
11192 Save and restore bidi cache.
11193
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
11199 to zero.
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
11224 values.
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
11228 iterating.
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.
11246
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):
11251 Update prototypes.
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.
11258
11259 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11260 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11261 and vector-like objects.
11262
11263 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11264 cache around display iteration.
11265
11266 * window.c (Fwindow_end, window_scroll_pixel_based)
11267 (displayed_window_lines, Frecenter): Save and restore the bidi
11268 cache around display iteration.
11269
11270 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11271
11272 * editfns.c (Fdelete_region): Clarify the use of the named
11273 parameters (bug#6788).
11274
11275 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11276
11277 * indent.c (Fvertical_motion): Set and restore w->pointm when
11278 saving and restoring the window's buffer (Bug#9006).
11279
11280 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11281
11282 * editfns.c (Fstring_to_char): Clarify just what is returned
11283 (bug#6576). Text by Eli Zaretskii.
11284
11285 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11286
11287 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11288
11289 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11290
11291 * buffer.c (mmap_find): Fix a typo.
11292
11293 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11294
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.
11304
11305 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11306
11307 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11308 The old code sometimes used this field without initializing it.
11309
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.
11313
11314 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11315
11316 * character.c (Fcharacterp): Don't advertise optional ignored
11317 argument. (Bug#4026)
11318
11319 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11320
11321 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11322 key" (bug#4257).
11323
11324 * window.c (Fset_window_start): Doc fix (bug#4199).
11325 (Fset_window_hscroll): Ditto.
11326
11327 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11328
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.
11334
11335 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11336
11337 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11338
11339 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11340
11341 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11342 are the mini-buffer and the echo area (bug#3320).
11343
11344 * term.c (init_tty): Remove support for supdup, c10 and perq
11345 terminals, which are no longer supported (bug#1482).
11346
11347 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11348
11349 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11350
11351 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11352
11353 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11354 for non-popups (Bug#3642).
11355
11356 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11357
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):
11369 Likewise.
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):
11386 Likewise.
11387 * xdisp.c (check_it): Likewise.
11388 * xfaces.c (register_color, unregister_color, unregister_colors):
11389 Likewise.
11390 * xfns.c (print_fontset_result): Likewise.
11391 * xrdb.c (member, fatal, main): Likewise.
11392
11393 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11394
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.
11400
11401 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11402
11403 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11404
11405 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11406
11407 * gtkutil.c (qttip_cb): Remove code without function.
11408
11409 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11410
11411 * w32.c (pthread_sigmask): New stub.
11412
11413 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11414
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.
11419 (LIBES): Use it.
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.
11424
11425 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11426
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
11429 wrong (Bug#8591).
11430
11431 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11432
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.
11436
11437 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11438 in registerServicesMenuSendTypes.
11439 (validRequestorForSendType): Don't check ns_return_types.
11440
11441 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11442 ns_return_type.
11443
11444 2011-07-08 Jason Rumney <jasonr@gnu.org>
11445
11446 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11447 SH_SHOW for hidden windows (Bug#5482).
11448
11449 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11450 frame struct members of non-existent frames (Bug#6284).
11451
11452 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11453
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.
11458
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.
11464
11465 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11466 cString and lossyCString on OSX >= 10.4.
11467
11468 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11469 sizeToFit on OSX >= 10.2.
11470
11471 * nsimage.m (allocInitFromFile): Don't use deprecated method
11472 bestRepresentationForDevice on OSX >= 10.6.
11473
11474 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11475 to avoid warning.
11476
11477 * emacs.c: Declare unexec_init_emacs_zone.
11478
11479 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11480
11481 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11482
11483 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11484 on svcsMenu (Bug#8842).
11485
11486 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11487 ns_return_types.
11488 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11489
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.
11498
11499 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11500 (ns_get_local_selection): Declare.
11501
11502 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11503
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
11506 something.
11507
11508 * callint.c (Fcall_interactively): Change "reading args" to
11509 "providing args" to try to clarify what it does (bug#1010).
11510
11511 2011-07-07 Kenichi Handa <handa@m17n.org>
11512
11513 * composite.c (composition_compute_stop_pos): Ignore a static
11514 composition starting before CHARPOS (Bug#8915).
11515
11516 * xdisp.c (handle_composition_prop): Likewise.
11517
11518 2011-07-07 Eli Zaretskii <eliz@gnu.org>
11519
11520 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11521 (Bug#9015)
11522
11523 2011-07-07 Kenichi Handa <handa@m17n.org>
11524
11525 * character.h (unicode_category_t): New enum type.
11526
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):
11549 New functions.
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.
11558
11559 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
11560 Vunicode_category_table.
11561
11562 * font.c (font_range): Adjust for the change of
11563 Vunicode_category_table.
11564
11565 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11566
11567 * m/iris4d.h: Remove file, move contents ...
11568 * s/irix6-5.h: ... here.
11569
11570 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11571
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.
11581
11582 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11583
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
11595 also.
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):
11612 Add comment.
11613
11614 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
11615
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.
11625
11626 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11627
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.
11633
11634 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11635
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.
11638
11639 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11640
11641 * buffer.c (Foverlay_put): Say what the return value is
11642 (bug#7835).
11643
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
11646 (bug#7564).
11647 (barf_or_query_if_file_exists): Make the "File is a directory"
11648 error be more correct.
11649
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'.
11653
11654 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11655
11656 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11657 Report string overflow if the output is too long.
11658
11659 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
11660
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).
11665
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.
11669
11670 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11671
11672 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11673
11674 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
11675
11676 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11677 and background color parameters if they have been changed.
11678
11679 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11680
11681 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11682
11683 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11684
11685 * xsettings.c (SYSTEM_FONT): Define only when used.
11686 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11687
11688 * keymap.c (access_keymap_1): Now static.
11689
11690 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
11691
11692 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11693 leave any prefix arg for the up event (Bug#1586).
11694
11695 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11696
11697 * lread.c (syms_of_lread): Mention single symbols defined by
11698 `defvar' or `defconst' (bug#7154).
11699
11700 * fns.c (Frequire): Mention .el.gz files (bug#7314).
11701 (Frequire): Mention get-load-suffixes.
11702
11703 2011-07-02 Martin Rudalics <rudalics@gmx.at>
11704
11705 * window.h (window): Remove clone_number slot.
11706 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11707 Remove.
11708 (make_parent_window, make_window, saved_window)
11709 (Fset_window_configuration, save_window_save): Don't deal with
11710 clone numbers.
11711 * buffer.c (Qclone_number): Remove declaration.
11712 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11713
11714 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11715
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.
11734
11735 2011-07-01 Glenn Morris <rgm@gnu.org>
11736
11737 * Makefile.in (SETTINGS_LIBS): Fix typo.
11738
11739 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11740
11741 * coding.c (Fencode_coding_string): Record the last coding system
11742 used, as the function doc string says (bug#8738).
11743
11744 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11745
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
11758 "changed".
11759
11760 * xgselect.c: Add defined (HAVE_GSETTINGS).
11761 (xgselect_initialize): Ditto.
11762
11763 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11764 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11765 xg_select.
11766
11767 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11768
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.
11776
11777 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11778
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):
11786 New functions.
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
11793 to NULL.
11794
11795 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
11796 GCONF_CFLAGS/LIBS.
11797
11798 2011-06-29 Martin Rudalics <rudalics@gmx.at>
11799
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.
11804
11805 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11806
11807 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11808
11809 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
11810
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.
11814
11815 2011-06-27 Martin Rudalics <rudalics@gmx.at>
11816
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.
11821
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.
11833
11834 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11835
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.
11839
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).
11852
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.
11855 Fix indentation.
11856
11857 2011-06-26 Eli Zaretskii <eliz@gnu.org>
11858
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
11861 called at ZV.
11862
11863 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
11864
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).
11868
11869 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11870
11871 Use gnulib's dup2 module instead of rolling our own.
11872 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11873
11874 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11875
11876 * dispnew.c (scrolling_window): Before scrolling, turn off a
11877 mouse-highlight in the window being scrolled.
11878
11879 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
11880
11881 Move DEFSYM to lisp.h and use everywhere.
11882
11883 * character.h (DEFSYM): Move declaration...
11884 * lisp.h (DEFSYM): ...here.
11885
11886 * gnutls.c:
11887 * minibuf.c:
11888 * w32menu.c:
11889 * w32proc.c:
11890 * w32select.c: Don't include character.h.
11891
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.
11934
11935 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11936
11937 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
11938
11939 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11940
11941 Integer and buffer overflow fixes (Bug#8873).
11942
11943 * print.c (printchar, strout): Check for string overflow.
11944 (PRINTPREPARE, printchar, strout):
11945 Don't set size unless allocation succeeds.
11946
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.
11950
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.
11958
11959 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11960
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.
11973
11974 * image.c (cache_image): Check for size arithmetic overflow.
11975
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.
11984
11985 2011-06-22 Leo Liu <sdl.web@gmail.com>
11986
11987 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11988 Move to minibuffer.el.
11989
11990 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11991
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):
12008 Now static.
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.
12017
12018 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12019
12020 Integer overflow and signedness fixes (Bug#8873).
12021 A few related buffer overrun fixes, too.
12022
12023 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12024
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)
12033 (.bitmaps_last):
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.
12041
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.
12054
12055 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12056
12057 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12058 (x_session_initialize): Do not assume string length fits in int.
12059
12060 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12061 This is unlikely, but can occur if DPI is outlandish.
12062
12063 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12064 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12065
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.
12070
12071 * xfont.c (xfont_match): Avoid need for strlen.
12072
12073 * xfns.c: Don't assume strlen fits in int.
12074 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12075
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.
12081
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.
12085
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.
12090
12091 * keyboard.c (parse_tool_bar_item):
12092 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12093
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.
12100
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.
12113
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.
12120
12121 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12122
12123 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12124
12125 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12126
12127 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12128 We prefer signed integers, even for size calculations.
12129
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.
12133
12134 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12135 (XD_DEBUG_MESSAGE): Don't waste a byte.
12136
12137 * callproc.c (getenv_internal_1, getenv_internal)
12138 (Fgetenv_internal):
12139 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12140
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.
12146
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.
12153
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,
12156 implementation.
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.
12163
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.
12168
12169 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12170
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.
12174
12175 * editfns.c, insdel.c:
12176 Omit unnecessary forward decls, to simplify future changes.
12177
12178 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12179
12180 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12181
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.
12187
12188 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12189
12190 * fns.c (concat): Catch string overflow earlier.
12191 Do not rely on integer wraparound.
12192
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.
12199
12200 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12201
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.
12207
12208 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12209
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.
12219
12220 2011-06-22 Jim Meyering <meyering@redhat.com>
12221
12222 Don't leak an XBM-image-sized buffer
12223 * image.c (xbm_load): Free the image buffer after using it.
12224
12225 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12226
12227 Port to Sun C.
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.
12233
12234 2011-06-21 Leo Liu <sdl.web@gmail.com>
12235
12236 * deps.mk (fns.o):
12237 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12238 sha512.h.
12239
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.
12244
12245 2011-06-20 Deniz Dogan <deniz@dogan.se>
12246
12247 * process.c (Fset_process_buffer): Clarify return value in
12248 docstring.
12249
12250 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12251
12252 * dispnew.c (add_window_display_history): Use BVAR.
12253
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.
12257
12258 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12259 Likewise.
12260
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.
12263
12264 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12265
12266 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12267
12268 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12269
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".
12273
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.
12283
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.
12287
12288 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12289
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.
12295
12296 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12297
12298 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12299
12300 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12301
12302 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12303 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12304
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.
12309
12310 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12311
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.
12323
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.
12330
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?
12336
12337 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12338
12339 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12340
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.
12363
12364 * callint.c (Fcall_interactively): Don't use index var as event count.
12365
12366 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12367 * mem-limits.h (SIZE): Remove; no longer used.
12368
12369 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12370
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.
12376
12377 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12378 It's more likely to cause problems (due to unsigned overflow)
12379 than to cure them.
12380
12381 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12382
12383 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12384
12385 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12386
12387 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12388
12389 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12390
12391 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12392
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.
12398
12399 * character.h (CHAR_VALID_P): Remove unused parameter.
12400 * fontset.c, lisp.h, xdisp.c: All uses changed.
12401
12402 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12403
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.
12409
12410 * floatfns.c (Fexpt):
12411 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12412
12413 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12414 for characters.
12415
12416 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12417
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.
12422
12423 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12424 Otherwise, an out-of-range integer could cause undefined behavior
12425 on a 64-bit host.
12426
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.
12432
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
12439 in this area.
12440
12441 * character.c (char_string): Remove unnecessary casts.
12442
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.
12451 * data.c (Faset):
12452 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12453 (Fsubst_char_in_region):
12454 * fns.c (concat):
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.
12461
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.
12466
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.
12476
12477 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12478 not to EMACS_INT, to avoid GCC warning.
12479
12480 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12481
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.
12485
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.
12489
12490 * data.c (Qcompiled_function): Now static.
12491
12492 * window.c (window_body_lines): Now static.
12493
12494 * image.c (gif_load): Rename local to avoid shadowing.
12495
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.
12503
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
12520 64-bit machines.
12521 (allocate_pseudovector): Don't use EMACS_INT when int would do.
12522
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.
12528
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.
12539
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.
12543
12544 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12545
12546 * alloc.c (Fmake_string): Check for out-of-range init.
12547
12548 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12549
12550 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12551
12552 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12553
12554 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12555 xg_get_default_scrollbar_width.
12556
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.
12571
12572 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12573
12574 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12575
12576 2011-06-12 Martin Rudalics <rudalics@gmx.at>
12577
12578 * frame.c (make_frame): Call other_buffer_safely instead of
12579 other_buffer.
12580
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
12587 doc-strings.
12588
12589 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
12590
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
12601 if HAVE_GPM.
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.
12618
12619 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
12620
12621 * makefile.w32-in: Update dependencies.
12622 (LISP_H): Add lib/intprops.h.
12623
12624 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12625
12626 * image.c (gif_load): Add animation frame delay to the metadata.
12627 (syms_of_image): Use DEFSYM. New symbol `delay'.
12628
12629 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12630
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
12635 window.el.
12636 (compare_window_configurations): Simplify code.
12637
12638 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12639
12640 * image.c (imagemagick_load_image): Fix type mismatch.
12641 (Fimagemagick_types): Likewise.
12642
12643 * window.h (replace_buffer_in_windows): Declare.
12644
12645 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12646
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
12650 code.
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
12659 if allowed.
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.
12667
12668 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12669 section.
12670
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.
12675
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
12683 window.el.
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
12691 declarations.
12692 (Fset_window_buffer): Rewrite doc-string.
12693 Call Qrecord_window_buffer.
12694 (keys_of_window): Move binding for other-window to window.el.
12695
12696 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12697
12698 * dispextern.h (struct image): Replace data member, whose int_val
12699 and ptr_val fields were not used by anything, with a single
12700 lisp_val object.
12701
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.
12705
12706 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12707
12708 * buffer.h: Include <time.h>, for time_t.
12709 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12710
12711 Fix minor problems found by static checking.
12712
12713 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12714
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.
12721
12722 * window.c (window_deletion_count, delete_deletable_window):
12723 Remove; unused.
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.
12730
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.
12739
12740 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12741
12742 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
12743
12744 * image.c (gif_load): Fix omitted cast error introduced by
12745 2011-06-06 change.
12746
12747 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12748
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.
12754
12755 2011-06-10 Eli Zaretskii <eliz@gnu.org>
12756
12757 * window.h (resize_frame_windows, resize_window_check)
12758 (delete_deletable_window, resize_root_window)
12759 (resize_frame_windows): Declare prototypes.
12760
12761 * window.c (resize_window_apply): Make definition be "static" to
12762 match the prototype.
12763
12764 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12765
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
12772 orig_total_lines.
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.
12805
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).
12809
12810 * frame.c (set_menu_bar_lines_1): Remove code handling
12811 orig_top_line and orig_total_lines.
12812
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.
12816
12817 * xdisp.c (init_xdisp): Don't use set_window_height but set
12818 heights directly.
12819
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.
12823
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.
12827
12828 2011-06-09 Martin Rudalics <rudalics@gmx.at>
12829
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
12833 third argument 1.
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):
12844 New functions.
12845 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12846
12847 2011-06-08 Martin Rudalics <rudalics@gmx.at>
12848
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.
12854
12855 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12856 Remove.
12857 (make_dummy_parent): Set new members of windows structure.
12858 (make_window): Move down in code. Handle new members of window
12859 structure.
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):
12865 New functions.
12866 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12867 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12868 Doc-string fixes.
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.
12884
12885 2011-06-07 Martin Rudalics <rudalics@gmx.at>
12886
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.
12900
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.
12904
12905 * indent.c (compute_motion, Fcompute_motion):
12906 Use window_body_cols instead of window_box_text_cols.
12907
12908 * frame.c (delete_frame): Call delete_all_subwindows with root
12909 window as argument.
12910
12911 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12912
12913 * fns.c (Fputhash): Document return value.
12914
12915 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
12916
12917 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12918
12919 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12920
12921 Cons<->int and similar integer overflow fixes (Bug#8794).
12922
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.
12952
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):
12961 * eval.c (verror):
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.
12967
12968 * image.c: Use ptrdiff_t, not int, for sizes.
12969 (slurp_file): Switch from int to ptrdiff_t.
12970 All uses changed.
12971 (slurp_file): Check that file size fits in both size_t (for
12972 malloc) and ptrdiff_t (for sanity and safety).
12973
12974 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12975 if b->modtime has its maximal value.
12976
12977 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12978
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.
12983
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
12996 nonnegative.
12997
12998 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12999
13000 * window.h (Fwindow_frame): Declare.
13001
13002 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13003
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.
13008
13009 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13010
13011 * lisp.h: Move EXFUNS for Fframe_root_window,
13012 Fframe_first_window and Fset_frame_selected_window to window.h.
13013
13014 * window.h: Move EXFUNS for Fframe_root_window,
13015 Fframe_first_window and Fset_frame_selected_window here from
13016 lisp.h.
13017
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.
13023
13024 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13025
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
13033 argument.
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.
13040 Marginal rewrite.
13041 (Fselected_window, select_window, Fselect_window): Move up in
13042 code. Minor doc-string fixes.
13043
13044 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13045
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.
13051
13052 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13053
13054 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13055 format. (Bug#8806)
13056
13057 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13058
13059 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13060 before statements.
13061
13062 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13063
13064 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13065
13066 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13067
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).
13070
13071 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13072
13073 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13074
13075 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13076
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).
13086
13087 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13088
13089 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13090
13091 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13092
13093 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13094 in the current matrix if keep_current_p is non-zero.
13095
13096 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13097
13098 * bidi.c (bidi_level_of_next_char): Fix last change.
13099
13100 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13101
13102 Support bidi reordering of text covered by display properties.
13103
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
13110 display string.
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
13117 definitions.
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.
13132
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):
13158 New functions.
13159 (push_it): Accept second argument POSITION, where pop_it should
13160 jump to continue iteration.
13161 (reseat_1): Initialize bidi_it.disp_pos.
13162
13163 * keyboard.c (adjust_point_for_property): Adjust the call to
13164 display_prop_intangible_p to its new signature.
13165
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
13172 EMACS_INT.
13173
13174 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13175
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)
13181
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.
13191
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.
13236
13237 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13238
13239 Make it possible to build with GCC-4.6+ -O2 -flto.
13240
13241 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13242
13243 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13244
13245 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13246 Call minibuffer-inactive-mode.
13247
13248 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13249
13250 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13251 Update dependencies.
13252
13253 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13254
13255 * data.c (init_data): Remove code for UTS, this system is not
13256 supported anymore.
13257
13258 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13259
13260 Don't force ./temacs to start in terminal mode.
13261
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.
13265
13266 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13267
13268 * dispnew.c (add_window_display_history): Use const for the string
13269 pointer. Remove declaration, not needed.
13270
13271 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13272
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__.
13281
13282 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13283
13284 Make it possible to run ./temacs.
13285
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.
13290
13291 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13292
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.
13299
13300 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13301
13302 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13303 (CCL_CODE_MIN): New macro.
13304
13305 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13306
13307 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13308
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.
13313
13314 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13315
13316 * image.c: Various fixes to ImageMagick code comments.
13317 (Fimagemagick_types): Doc fix.
13318
13319 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13320
13321 Minor fixes prompted by GCC 4.6.0 warnings.
13322
13323 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13324
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.
13328
13329 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13330
13331 * xselect.c (x_clipboard_manager_save_frame)
13332 (x_clipboard_manager_save_all): New functions.
13333 (Fx_clipboard_manager_save): Lisp function deleted.
13334
13335 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13336 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13337
13338 * xterm.h: Update prototype.
13339
13340 2011-05-28 William Xu <william.xwl@gmail.com>
13341
13342 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13343 exiting (Bug#8239).
13344
13345 2011-05-28 Jim Meyering <meyering@redhat.com>
13346
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.
13355
13356 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13357
13358 Integer overflow fixes.
13359
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)
13367
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.
13376 (Bug#8722)
13377
13378 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13379
13380 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13381
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)
13390
13391 * alloc.c (make_event_array): Use XINT, not XUINT.
13392 There's no need for unsigned here.
13393
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.
13397
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)
13417
13418 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13419
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.
13428
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.
13437
13438 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13439
13440 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13441
13442 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13443
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.
13448
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.
13452
13453 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
13454
13455 * termhooks.h (Vselection_alist): Make it terminal-local.
13456
13457 * terminal.c (create_terminal): Initialize it.
13458
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.
13476
13477 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13478
13479 * xterm.h: Add support for those atoms.
13480
13481 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
13482
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.
13498
13499 2011-05-26 Leo Liu <sdl.web@gmail.com>
13500
13501 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13502
13503 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13504
13505 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13506
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.
13511
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.
13516
13517 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13518 for fringe update unless it has periodic bitmap.
13519
13520 2011-05-25 Kenichi Handa <handa@m17n.org>
13521
13522 * xdisp.c (get_next_display_element): Set correct it->face_id for
13523 a static composition.
13524
13525 2011-05-24 Leo Liu <sdl.web@gmail.com>
13526
13527 * deps.mk (fns.o):
13528 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13529
13530 * fns.c (crypto_hash_function, Fsha1): New function.
13531 (Fmd5): Use crypto_hash_function.
13532 (syms_of_fns): Add Ssha1.
13533
13534 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13535
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).
13541
13542 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13543
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
13547 select.el.
13548
13549 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13550
13551 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13552
13553 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13554
13555 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13556
13557 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13558
13559 * dispnew.c (scrolling_window): Don't exclude the case that the
13560 last enabled row in the desired matrix touches the bottom boundary.
13561
13562 2011-05-21 Glenn Morris <rgm@gnu.org>
13563
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.
13567
13568 2011-05-20 Eli Zaretskii <eliz@gnu.org>
13569
13570 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13571 report_file_error introduced by the change from 2011-05-07.
13572
13573 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13574
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>.
13579
13580 2011-05-20 Kenichi Handa <handa@m17n.org>
13581
13582 * composite.c (find_automatic_composition): Fix previous change.
13583
13584 2011-05-20 Glenn Morris <rgm@gnu.org>
13585
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.
13590
13591 2011-05-19 Glenn Morris <rgm@gnu.org>
13592
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.
13601
13602 2011-05-18 Kenichi Handa <handa@m17n.org>
13603
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.
13607
13608 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
13609
13610 * makefile.w32-in: Update dependencies.
13611
13612 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13613
13614 * menu.c: Include limits.h (fixes the MS-Windows build broken by
13615 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
13616
13617 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
13618
13619 Fix some integer overflow issues, such as string length overflow.
13620
13621 * insdel.c (count_size_as_multibyte): Check for string overflow.
13622
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.
13631
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.
13637
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)
13645
13646 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13647 * image.c (clear_image_cache): Likewise.
13648
13649 * term.c (term_mouse_position): Don't assume time_t wraparound.
13650
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.
13673
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)
13682
13683 * xselect.c (last_event_timestamp): Remove duplicate decl.
13684 (x_own_selection): Remove needless cast to unsigned long.
13685
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.
13691
13692 * menu.c (grow_menu_items): Check for int overflow.
13693
13694 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13695
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
13702 as modifiers.
13703 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13704
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.
13709
13710 * window.c (size_window): Avoid needless test at loop start.
13711
13712 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13713
13714 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13715
13716 2011-05-12 Drew Adams <drew.adams@oracle.com>
13717
13718 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13719
13720 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13721
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.
13725
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.
13731
13732 2011-05-10 Jim Meyering <meyering@redhat.com>
13733
13734 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13735
13736 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
13737
13738 * image.c (Finit_image_library): Return t for built-in image types,
13739 like pbm and xbm. (Bug#8640)
13740
13741 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13742
13743 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13744
13745 2011-05-07 Eli Zaretskii <eliz@gnu.org>
13746
13747 * w32console.c (Fset_screen_color): Doc fix.
13748 (Fget_screen_color): New function.
13749 (syms_of_ntterm): Defsubr it.
13750
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
13753 first place.
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.
13758
13759 2011-05-07 Ben Key <bkey76@gmail.com>
13760
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
13768 variable.
13769
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
13774 sh as the shell.
13775
13776 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
13777
13778 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13779 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13780 is a constant.
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.
13785
13786 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13787
13788 * makefile.w32-in: Update dependencies.
13789 (LISP_H): Add inttypes.h and stdin.h.
13790 (PROCESS_H): Add unistd.h.
13791
13792 2011-05-06 Eli Zaretskii <eliz@gnu.org>
13793
13794 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13795 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13796
13797 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
13798
13799 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13800
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.
13803
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)
13806
13807 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13808 bytes.
13809
13810 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13811
13812 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13813
13814 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13815
13816 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13817
13818 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13819
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).
13824
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)
13832
13833 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13834
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.
13838
13839 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13840
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.
13846
13847 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13848 (EMACS_UINTPTR): Likewise, with uintptr_t.
13849
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
13853 large files.
13854 However, temporarily disable this change unless the temporary
13855 symbol WIDE_EMACS_INT is defined.
13856
13857 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13858
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.
13888
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
13892 the sign bit.
13893 * lisp.h (get_random): Change signature to match.
13894
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.
13902
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 *.
13907
13908 * eval.c (Fautoload): Don't double-shift a pointer.
13909
13910 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13911
13912 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13913
13914 * gnutls.c (DEF_GNUTLS_FN):
13915 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13916
13917 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13918
13919 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13920 marker. (Bug#8610)
13921
13922 2011-05-05 Eli Zaretskii <eliz@gnu.org>
13923
13924 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13925 New version that can reserve upto 2GB of heap space.
13926
13927 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
13928
13929 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13930
13931 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13932
13933 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13934 `gnutls_certificate_set_x509_key_file'.
13935
13936 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
13937
13938 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13939 Update dependencies.
13940
13941 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13942
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.
13947
13948 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13949
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".
13953
13954 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13955
13956 Implement dynamic loading of GnuTLS on Windows.
13957
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):
13961 Declare.
13962
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.
13977
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.
13983
13984 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13985
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.
13992
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.
13996
13997 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13998
13999 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14000
14001 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14002 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14003 as passed in.
14004
14005 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14006
14007 * xterm.c (x_set_frame_alpha): Do not set property on anything
14008 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14009
14010 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14011
14012 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14013
14014 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14015
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.
14025
14026 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14027
14028 * callproc.c: Indentation fixup.
14029
14030 * sysdep.c (wait_for_termination_1): Make static.
14031 (wait_for_termination, interruptible_wait_for_termination):
14032 Move after wait_for_termination_1.
14033
14034 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14035
14036 * sysdep.c (interruptible_wait_for_termination): New function
14037 which is like wait_for_termination, but allows keyboard
14038 interruptions.
14039
14040 * callproc.c (Fcall_process): Add (:file "file") as an option for
14041 the STDOUT buffer.
14042 (Fcall_process_region): Ditto.
14043
14044 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14045
14046 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14047 rather than `XVECTOR (FOO)->size'.
14048
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
14051 system headers.
14052
14053 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14054
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)
14058
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.
14066
14067 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14068
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)
14073
14074 * window.c (window_scroll_line_based): Use a marker instead of
14075 simple variables to record original value of point. (Bug#7952)
14076
14077 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14078 produced by %s or %c overflows available buffer space. (Bug#8545)
14079
14080 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14081
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.
14084
14085 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14086
14087 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14088
14089 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14090
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.
14096
14097 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14098
14099 * doprnt.c (doprnt): Don't return value smaller than the buffer
14100 size if the message was truncated. (Bug#8545).
14101
14102 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14103
14104 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14105 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14106
14107 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14108
14109 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14110
14111 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14112
14113 * makefile.w32-in: Update dependencies.
14114
14115 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14116
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.
14122
14123 * eval.c (verror): Simplify calculation of size_t.
14124
14125 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14126 messages.
14127
14128 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14129
14130 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14131 change.
14132
14133 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14134
14135 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14136 This makes this file independent of the recent pseudovector change.
14137
14138 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14139
14140 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14141
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.
14146
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
14160 the size member.
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
14193 special case.
14194 * process.c (Fformat_network_address): Use local var for size,
14195 for brevity.
14196
14197 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14198
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.
14228
14229 * textprop.c (set_text_properties_1): Rewrite for clarity,
14230 and to avoid GCC warning about integer overflow.
14231
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.
14237 All uses changed.
14238 (offset_intervals): Tell GCC not to worry about length overflow
14239 when negating a negative length.
14240
14241 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14242 (overrun_check_free): Likewise.
14243
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
14246 word size.
14247
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.
14253
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.
14257
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.
14262
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.
14265
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.
14269
14270 * fns.c (internal_equal): Don't assume size_t fits in int.
14271
14272 * alloc.c (compact_small_strings): Tighten assertion a little.
14273
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
14286 64-bit hosts.
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
14291 to int.
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'
14302 when tracing.
14303
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.
14308
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.
14317
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.
14328
14329 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14330
14331 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14332
14333 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14334
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>.
14338
14339 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14340
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.
14346
14347 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14348
14349 * alloc.c (check_sblock, check_string_bytes)
14350 (check_string_free_list): Convert to standard C.
14351
14352 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14353
14354 * w32.c (emacs_gnutls_push): Fix typo.
14355
14356 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14357
14358 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14359 "cast to pointer from integer of different size".
14360
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
14364 using `alloca'.
14365
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
14368 xmalloc anew.
14369
14370 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14371
14372 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14373 callbacks stage.
14374
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.
14388
14389 * w32.h (emacs_gnutls_pull): Add prototype.
14390 (emacs_gnutls_push): Likewise.
14391
14392 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14393 (emacs_gnutls_push): Likewise.
14394
14395 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14396
14397 * process.c (wait_reading_process_output): Check if GnuTLS
14398 buffered some data internally if no FDs are set for TLS
14399 connections.
14400
14401 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14402 (LIBS): Link to USER_LIBS.
14403 ($(BLD)/gnutls.$(0)): New target.
14404
14405 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14406
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
14410 commentary.
14411
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
14415 of arguments.
14416
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 **';
14421 adjust.
14422
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 **'.
14426
14427 * xfaces.c <Qunspecified>: Make extern again.
14428
14429 * syntax.c: Include sys/types.h before including regex.h, as
14430 required by POSIX.
14431
14432 * doc.c (get_doc_string): Improve the format passed to `error'.
14433
14434 * doprnt.c (doprnt): Improve commentary.
14435
14436 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14437
14438 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14439 them with etags.
14440
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.
14446
14447 * character.c (Fchar_direction): Function deleted.
14448 (syms_of_character): Don't defsubr it.
14449 <char-direction-table>: Deleted.
14450
14451 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14452
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.
14461
14462 * lisp.h (doprnt): Restore prototype.
14463
14464 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14465 $(SRC)/character.h.
14466
14467 * Makefile.in (base_obj): Add back doprnt.o.
14468
14469 * deps.mk (doprnt.o): Add back prerequisites.
14470 (callint.o): Depend on character.h.
14471
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.
14476
14477 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14478
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.
14483
14484 * character.c (char_string): Use %x to display the (unsigned)
14485 codepoint of an invalid character, to avoid displaying a bogus
14486 negative value.
14487
14488 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14489 `error', not SYMBOL_NAME itself.
14490
14491 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14492 character arguments to `error'.
14493
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'.
14498
14499 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14500
14501 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14502
14503 * w32.c: Include <time.h>.
14504 (sys_localtime): New function.
14505
14506 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
14507
14508 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14509
14510 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
14511
14512 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
14513
14514 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14515 zombies (Bug#8467).
14516
14517 2011-04-19 Eli Zaretskii <eliz@gnu.org>
14518
14519 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14520 gl_state.e_property when gl_state.object is Qt.
14521
14522 * insdel.c (make_gap_larger): Remove limitation of buffer size
14523 to <= INT_MAX.
14524
14525 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
14526
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.
14531
14532 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14533 glyphless-char-display.
14534
14535 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
14536
14537 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14538
14539 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14540
14541 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14542 definition for no-X builds.
14543
14544 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
14545
14546 Static checks with GCC 4.6.0 and non-default toolkits.
14547
14548 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14549
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.
14553
14554 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14555
14556 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14557
14558 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14559
14560 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14561 Define only if needed.
14562
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.
14566
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.
14571
14572 * insdel.c (make_gap_smaller): Define only if
14573 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14574
14575 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14576 it.
14577
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.
14580
14581 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14582
14583 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
14584
14585 * xfns.c (x_real_positions): Mark locals as initialized.
14586
14587 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14588
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.
14597
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.
14603
14604 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14605
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.
14609
14610 * keyboard.c (make_lispy_event): Remove unused local var.
14611
14612 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14613 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14614
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
14618 than 0xab.
14619
14620 * xgselect.c (xgselect_initialize): Check vs interface
14621 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14622
14623 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14624
14625 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14626 to read-only memory.
14627
14628 * fns.c (vector): Remove; this old hack is no longer needed.
14629
14630 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
14631 Remove unused var.
14632 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
14633
14634 * xrdb.c (x_load_resources): Omit unused local.
14635
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.
14639
14640 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
14641 (x_term_init): Remove local to avoid shadowing.
14642
14643 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
14644
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.
14647
14648 2011-04-16 Eli Zaretskii <eliz@gnu.org>
14649
14650 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14651
14652 Fix regex.c, syntax.c and friends for buffers > 2GB.
14653 * syntax.h (struct gl_state_s): Declare character position members
14654 EMACS_INT.
14655
14656 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14657
14658 * textprop.c (verify_interval_modification, interval_of):
14659 Declare arguments EMACS_INT.
14660
14661 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14662 EMACS_INT.
14663
14664 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14665
14666 * indent.c (Fvertical_motion): Local variable it_start is now
14667 EMACS_INT.
14668
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
14674 appropriate.
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'.
14678
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.
14683
14684 2011-04-16 Ben Key <bkey76@gmail.com>
14685
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.
14693
14694 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
14695
14696 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14697
14698 emacs_write: Accept and return EMACS_INT for sizes.
14699 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14700 et seq.
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
14704 partial writes.
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
14714
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.
14722
14723 2011-04-15 Ben Key <bkey76@gmail.com>
14724
14725 * keyboard.c (Qundefined): Don't declare static since it is used
14726 in nsfns.m.
14727 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14728 static since they are used in nsfont.m.
14729
14730 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14731
14732 * process.c (Qprocessp): Don't declare static.
14733 * lisp.h (Qprocessp): Declare again.
14734
14735 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
14736
14737 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14738
14739 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14740
14741 Improve C-level modularity by making more things 'static'.
14742
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
14746 that need them.
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.
14750
14751 * sysdep.c (croak): Now static, if
14752 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14753 * syssignal.h (croak): Declare only if not static.
14754
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.
14758
14759 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14760 Define only if USE_LUCID.
14761
14762 * xrdb.c (x_customization_string, x_rm_string): Now static.
14763
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.
14766
14767 * xdisp.c (draw_row_with_mouse_face): Now static.
14768 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14769
14770 * window.h (check_all_windows): Mark externally visible.
14771
14772 * window.c (window_deletion_count): Now static.
14773
14774 * undo.c: Make symbols static if they're not exported.
14775 (last_undo_buffer, last_boundary_position, pending_boundary):
14776 Now static.
14777
14778 * textprop.c (interval_insert_behind_hooks): Now static.
14779 (interval_insert_in_front_hooks): Likewise.
14780
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.
14791
14792 * sysdep.c: Make symbols static if they're not exported.
14793 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14794 Now static.
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.
14799
14800 * syntax.c (syntax_temp): Define only if !__GNUC__.
14801
14802 * sound.c (current_sound_device, current_sound): Now static.
14803
14804 * search.c (searchbufs, searchbuf_head): Now static.
14805
14806 * scroll.c (scroll_cost): Remove; unused.
14807 * dispextern.h (scroll_cost): Remove decl.
14808
14809 * region-cache.h (pp_cache): Mark as externally visible.
14810
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.
14818
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):
14823 Now static.
14824 * lisp.h (Fprinc): Remove decl.
14825 (debug_output_compilation_hack): Mark as externally visible.
14826
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.
14830
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.
14834
14835 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14836
14837 * lread.c: Make symbols static if they're not exported.
14838 (read_objects, initial_obarray, oblookup_last_bucket_number):
14839 Now static.
14840 (make_symbol): Remove; unused.
14841 * lisp.h (initial_obarray, make_symbol): Remove decls.
14842
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):
14851 Now static.
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.
14865
14866 * intervals.c: Make symbols static if they're not exported.
14867 (merge_properties_sticky, merge_interval_right, delete_interval):
14868 Now static.
14869 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14870
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.
14879
14880 * indent.c (val_compute_motion, val_vmotion): Now static.
14881
14882 * image.c: Make symbols static if they're not exported.
14883 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14884 if USE_GTK.
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.
14887
14888 * fringe.c (standard_bitmaps): Now static.
14889 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14890
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.
14900
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.
14913
14914 * fns.c (weak_hash_tables): Now static.
14915
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.
14919
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.
14923
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):
14927 Now static.
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.
14933
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.
14938
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):
14943 Now static.
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):
14949 Remove decls.
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 &&
14953 USE_X_TOOLKIT.
14954
14955 * ftxfont.c: Make symbols static if they're not exported.
14956 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14957 HAVE_FREETYPE.
14958 * font.h (ftxfont_driver): Likewise.
14959
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.
14972
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):
14978 Now static.
14979 (redraw_garbaged_frames): Remove; unused.
14980
14981 * xfaces.c: Make symbols static if they're not exported.
14982 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14983 Remove decls.
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.
14990
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):
14999 Likewise.
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.
15008
15009 * dired.c (file_name_completion): Now static.
15010
15011 * dbusbind.c (xd_in_read_queued_messages): Now static.
15012
15013 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15014 * data.c (circular_list_error): Remove.
15015
15016 * commands.h (last_point_position, last_point_position_buffer):
15017 (last_point_position_window): Remove decls.
15018 * keyboard.c: Make these variables static.
15019
15020 * coding.h (coding, code_convert_region, encode_coding_gap):
15021 Remove decls.
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.
15025
15026 * chartab.c (chartab_chars, chartab_bits): Now static.
15027
15028 * charset.h (charset_iso_8859_1): Remove decl.
15029 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15030 Now static.
15031
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.
15035
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.
15039
15040 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15041 * lisp.h: Remove these decls.
15042
15043 * buffer.c (buffer_count): Remove unused var.
15044
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.
15050
15051 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15052 * atimer.h (run_all_atimers): Remove; not exported.
15053
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.
15059
15060 alloc.c: Import and export fewer symbols, and remove unused items.
15061 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15062 is defined.
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):
15074 Now static.
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.
15079
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.
15095
15096 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15097
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.
15111
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):
15149 Now internal.
15150 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15151 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15152
15153 * editfns.c (Fformat): Remove unreachable code.
15154
15155 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15156
15157 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15158 change. (Bug#8496)
15159
15160 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15161
15162 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15163 when at ZV. (Bug#8487)
15164
15165 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15166
15167 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15168 (Bug#8437)
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.
15174
15175 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15176 (overrun_check_free): Protoize.
15177
15178 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15179
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.
15185
15186 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15187
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)
15191
15192 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15193
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.
15198
15199 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15200 argument, local variables, and return value.
15201
15202 * lisp.h: Update prototypes of emacs_write and emacs_read.
15203
15204 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15205
15206 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15207
15208 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15209
15210 Fix more problems found by GCC 4.6.0's static checks.
15211
15212 * xdisp.c (vmessage): Use a better test for character truncation.
15213
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.
15220
15221 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15222 This also lets GCC 4.6.0 generate slightly better loop code.
15223
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.
15228
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.
15236
15237 * keyboard.c (read_char): Remove unused var.
15238
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.
15247
15248 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15249
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.
15256
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
15268 do that.
15269 * charset.c (check_iso_charset_parameter): Convert internal
15270 character to string before calling 'error', since %c now has the
15271 printf meaning.
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.
15277
15278 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15279
15280 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15281
15282 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15283
15284 * xterm.c (x_catch_errors): Remove duplicate declaration.
15285
15286 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15287
15288 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15289
15290 2011-04-10 Jim Meyering <meyering@redhat.com>
15291
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.
15299
15300 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15301
15302 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15303
15304 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15305
15306 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15307 Use unsigned char, to match FcChar8 type definition.
15308
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.
15313
15314 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15315
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.
15322
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.
15326
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>:
15342 Declare EMACS_INT.
15343 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15344 (encode_invocation_designation): Last argument P_NCHARS is now
15345 EMACS_INT.
15346 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15347 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15348
15349 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15350 All users changed.
15351
15352 * ccl.c (Fccl_execute_on_string): Declare some variables
15353 EMACS_INT.
15354
15355 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15356
15357 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15358
15359 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15360
15361 * process.c (Fformat_network_address): Doc fix.
15362
15363 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15364
15365 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15366
15367 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15368
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.
15373
15374 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15375
15376 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15377
15378 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15379
15380 * process.c (Flist_processes): Remove to Lisp.
15381 (list_processes_1): Delete.
15382
15383 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15384
15385 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15386
15387 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15388
15389 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15390
15391 Fix more problems found by GCC 4.6.0's static checks.
15392
15393 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15394
15395 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15396
15397 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15398
15399 * xdisp.c (vmessage): Mark as a printf-like function.
15400
15401 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15402
15403 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15404
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.
15409
15410 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15411
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.
15420
15421 * xfont.c (xfont_text_extents): Remove var that was set but not used.
15422 (xfont_open): Avoid unnecessary tests.
15423
15424 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15425
15426 * composite.h, composite.c (composition_gstring_put_cache):
15427 Use EMACS_INT, not int, for length.
15428
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.
15434
15435 * textprop.c (set_text_properties_1): Change while to do-while,
15436 since the condition is always true at first.
15437
15438 * intervals.c (graft_intervals_into_buffer): Mark var as used.
15439 (interval_deletion_adjustment): Return unsigned value.
15440 All uses changed.
15441
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.
15448
15449 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15450
15451 * syntax.c (scan_words): Remove var that was set but not used.
15452 (update_syntax_table): Use unsigned instead of int.
15453
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.
15457
15458 * print.c (print_error_message): Avoid int overflow.
15459
15460 * font.c (font_list_entities): Redo for clarity,
15461 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15462
15463 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15464 (font_score): Avoid potential overflow in diff calculation.
15465
15466 * fns.c (substring_both): Remove var that is set but not used.
15467 (sxhash): Redo loop for clarity and to avoid wraparound warning.
15468
15469 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15470
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.
15474
15475 * search.c (boyer_moore, wordify): Remove vars set but not used.
15476 (wordify): Omit three unnecessary tests.
15477
15478 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15479 All callers changed. This avoids the need for an unused var.
15480
15481 * casefiddle.c (casify_region): Remove var that is set but not used.
15482
15483 * dired.c (file_name_completion): Remove var that is set but not used.
15484
15485 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15486
15487 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
15488 (Finsert_file_contents): Remove unnecessary code checking fd.
15489
15490 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15491 Check for integer overflow on size calculations.
15492
15493 * buffer.c (Fprevious_overlay_change): Remove var that is set
15494 but not used.
15495
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.
15500
15501 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15502
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.
15505
15506 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15507 that are set but not used.
15508
15509 * xfns.c (make_invisible_cursor): Don't return garbage
15510 if XCreateBitmapFromData fails (Bug#8410).
15511
15512 * xselect.c (x_get_local_selection, x_handle_property_notify):
15513 Remove vars that are set but not used.
15514
15515 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
15516 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
15517
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.
15523
15524 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15525 (map_tty_color) [!defined MSDOS]: Likewise.
15526
15527 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15528
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.
15535
15536 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15537 that is set but not used.
15538
15539 * print.c (print_object): Remove var that is set but not used.
15540
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.
15552
15553 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15554
15555 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15556 first non-nil return value).
15557
15558 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15559
15560 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15561 if not defined (Bug#8403).
15562
15563 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15564
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.
15574
15575 2011-04-02 Jim Meyering <meyering@redhat.com>
15576
15577 do not dereference NULL upon failed strdup
15578 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15579 (ns_get_family): Likewise.
15580
15581 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15582
15583 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15584
15585 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15586
15587 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15588 later (Bug#8403).
15589
15590 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15591
15592 Add lexical binding.
15593
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.
15597
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):
15604 Mark as dynamic.
15605 (syms_of_lread): Declare `lexical-binding'.
15606
15607 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15608
15609 * keyboard.c (eval_dyn): New fun.
15610 (menu_item_eval_property): Use it.
15611
15612 * image.c (parse_image_spec): Use Ffunctionp.
15613
15614 * fns.c (concat, mapcar1): Accept byte-code-functions.
15615
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.
15624 Handle closures.
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.
15632
15633 * doc.c (Fdocumentation, store_function_docstring):
15634 * data.c (Finteractive_form): Handle closures.
15635
15636 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15637 interactive spec.
15638
15639 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15640 New byte-codes.
15641 (exec_byte_code): New function extracted from Fbyte_code to handle new
15642 calling convention for byte-code-functions. Add new byte-codes.
15643
15644 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
15645
15646 * alloc.c (Fmake_symbol): Init new `declared_special' field.
15647
15648 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15649
15650 * xdisp.c (redisplay_internal): Fix prototype.
15651
15652 2011-03-31 Eli Zaretskii <eliz@gnu.org>
15653
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)
15660
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.
15672
15673 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15674
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.
15682
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'.
15686
15687 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15688
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.
15693
15694 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15695
15696 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15697
15698 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15699 binding" message (bug#7967).
15700
15701 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15702
15703 Fix more problems found by GCC 4.6.0's static checks.
15704
15705 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15706 Remove unused local var.
15707
15708 * editfns.c (Fmessage_box): Remove unused local var.
15709
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.
15717
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.
15722
15723 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15724 instead of alloca (Bug#8344).
15725
15726 * eval.c (Fbacktrace): Don't assume nargs fits in int.
15727 (Fbacktrace_frame): Don't assume nframes fits in int.
15728
15729 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15730
15731 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15732 concerns.
15733
15734 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15735
15736 * cm.c (calccost): Turn while-do into do-while, for clarity.
15737
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.
15741
15742 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15743
15744 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15745
15746 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15747 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15748
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.
15752
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.
15769
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.
15773
15774 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15775
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.
15779
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.
15789
15790 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15791
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.
15798
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.
15806
15807 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15808
15809 * dispextern.h (string_buffer_position): Remove declaration.
15810
15811 * print.c (strout): Remove parameter `multibyte', unused since
15812 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15813
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.
15817
15818 * w32.c (_wsa_errlist): Use braces for struct initializers.
15819
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.
15830
15831 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15832
15833 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15834
15835 2011-03-27 Anders Lindgren <andlind@gmail.com>
15836
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.
15845
15846 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15847
15848 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15849
15850 2011-03-27 Glenn Morris <rgm@gnu.org>
15851
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.
15858
15859 2011-03-26 Eli Zaretskii <eliz@gnu.org>
15860
15861 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15862 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15863
15864 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
15865
15866 * w32.c (read_unc_volume): Use parameter `henum', instead of
15867 global variable `wget_enum_handle'.
15868
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'.
15872
15873 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15874
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.
15879
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'.
15884
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'.
15889
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.
15893
15894 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
15895
15896 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15897 incurred during fontification.
15898
15899 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15900
15901 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15902 (DEFVAR_PER_BUFFER): Don't pass it.
15903
15904 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15905 (scrolling_window): Don't pass it.
15906
15907 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15908
15909 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15910
15911 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15912 and `suffix'.
15913 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15914 of variables specific to SELinux and computation of `encoded_absname'.
15915
15916 * image.c (XPutPixel): Remove unused variable `height'.
15917
15918 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15919
15920 * unexw32.c (get_section_info): Remove unused variable `section'.
15921
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'.
15925
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'.
15931
15932 * w32inevt.c (w32_console_read_socket):
15933 Remove unused variable `no_events'.
15934
15935 * w32term.c (x_draw_composite_glyph_string_foreground):
15936 Remove unused variable `width'.
15937
15938 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
15939
15940 * w32term.c (x_set_glyph_string_clipping):
15941 Don't pass uninitialized region to CombineRgn.
15942
15943 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
15944
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'.
15948
15949 * w32font.c (w32font_draw): Return number of glyphs.
15950 (w32font_open_internal): Remove unused variable `i'.
15951 (w32font_driver): Add missing initializer.
15952
15953 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15954 (fill_in_menu): Remove unused variable `items_added'.
15955
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'.
15959
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.
15964
15965 2011-03-23 Julien Danjou <julien@danjou.info>
15966
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):
15979 Use Frun_hooks.
15980 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
15981 unconditionally since it does the check itself.
15982
15983 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
15984
15985 Fix more problems found by GCC 4.5.2's static checks.
15986
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.
15990
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).
15995
15996 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15997 that could (at least in theory) be that large.
15998
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.
16005
16006 * scroll.c (do_scrolling): Work around GCC bug 48228.
16007 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16008
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.
16013
16014 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16015 fail (Bug#8306).
16016
16017 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16018
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):
16025 Likewise.
16026
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).
16036
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.
16048
16049 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16050 (xftfont_open): Rename locals to avoid shadowing.
16051
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.
16059
16060 * xfont.c (xfont_list_family): Mark var as initialized.
16061
16062 * xml.c (make_dom): Now static.
16063
16064 * composite.c (composition_compute_stop_pos): Rename local to
16065 avoid shadowing.
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).
16071
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.
16078
16079 * textprop.c (property_change_between_p): Remove; unused.
16080
16081 * intervals.c (interval_start_pos): Now static.
16082
16083 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16084
16085 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16086 Rename locals to avoid shadowing.
16087
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).
16093
16094 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16095
16096 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16097
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.
16102
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.
16106
16107 * callproc.c (call_process_cleanup): Now static.
16108 (relocate_fd): Rename locals to avoid shadowing.
16109
16110 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16111
16112 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16113 not to be necessary, and produces flickering.
16114
16115 2011-03-20 Glenn Morris <rgm@gnu.org>
16116
16117 * config.in: Remove file.
16118
16119 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16120
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.
16124
16125 2011-03-20 Leo Liu <sdl.web@gmail.com>
16126
16127 * minibuf.c (completing-read-function): New variable.
16128 (completing-read-default): Rename from completing-read.
16129 (completing-read): Call completing-read-function.
16130
16131 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16132
16133 * xfaces.c (Fx_load_color_file):
16134 Read color file from absolute filename (bug#8250).
16135
16136 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16137
16138 * makefile.w32-in: Update dependencies.
16139
16140 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16141
16142 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16143
16144 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16145
16146 Fix more problems found by GCC 4.5.2's static checks.
16147
16148 * process.c (make_serial_process_unwind, send_process_trap):
16149 (sigchld_handler): Now static.
16150
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.
16157
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.
16160
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.
16165
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.
16171
16172 * deps.mk (unexalpha.o): Remove; unused.
16173
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.
16183
16184 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16185 shadowing.
16186 (back_comment, skip_chars): Mark vars as initialized.
16187
16188 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16189 Rename locals to avoid shadowing.
16190
16191 * lread.c (read1): Rewrite so as not to use empty "else".
16192 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16193
16194 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16195
16196 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16197 warning when compiling print.c.
16198
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.
16202
16203 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16204
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.
16213
16214 * fns.c (require_nesting_list, require_unwind): Now static.
16215 (Ffillarray): Rename locals to avoid shadowing.
16216
16217 * floatfns.c (domain_error2): Define only if needed.
16218 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16219
16220 * alloc.c (mark_backtrace): Move decl from here ...
16221 * lisp.h: ... to here, so that it can be checked.
16222
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.
16228
16229 * callint.c (quotify_arg, quotify_args): Now static.
16230 (Fcall_interactively): Rename locals to avoid shadowing.
16231 Use const pointer when appropriate.
16232
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.
16244
16245 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16246 avoid shadowing.
16247
16248 * lisp.h (eassert): Check that the argument compiles, even if
16249 ENABLE_CHECKING is not defined.
16250
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.
16258
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
16263 they're used.
16264 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16265 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16266 needed otherwise.
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 *.
16270
16271 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16272 avoids undefined behavior in theory.
16273
16274 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16275
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.
16286
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):
16301 Remove; unused.
16302
16303 * search.c (boyer_moore): Rename locals to avoid shadowing.
16304 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16305 (PREV_CHAR_BOUNDARY): Likewise.
16306
16307 * search.c (simple_search): Remove unused var.
16308
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.
16312
16313 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16314
16315 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16316 All uses changed.
16317 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16318 Rename locals to avoid shadowing.
16319 (Fvertical_motion): Mark locals as initialized.
16320
16321 * casefiddle.c (casify_object, casify_region): Now static.
16322 (casify_region): Mark local as initialized.
16323
16324 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16325
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
16330 of the new macros.
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
16334 changed.
16335 * dired.c (directory_files_internal, file_name_completion):
16336 Rename locals to avoid shadowing.
16337
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
16346 are used.
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.
16358
16359 * dired.c (directory_files_internal_unwind): Now static.
16360
16361 * fileio.c (file_name_as_directory, directory_file_name):
16362 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16363 Now static.
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
16369 signedness issues.
16370 (Fset_file_times, Finsert_file_contents, auto_save_error):
16371 Rename locals to avoid shadowing.
16372
16373 * minibuf.c (choose_minibuf_frame_1): Now static.
16374 (Ftry_completion, Fall_completions): Rename or remove locals
16375 to avoid shadowing.
16376
16377 * marker.c (bytepos_to_charpos): Remove; unused.
16378
16379 * lisp.h (verify_bytepos, count_markers): New decls,
16380 so that gcc does not warn that these functions aren't declared.
16381
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.
16386
16387 * filelock.c (within_one_second): Now static.
16388 (lock_file_1): Rename local to avoid shadowing.
16389
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
16393 matter.
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.
16397
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.
16403
16404 * process.c (serial_open, serial_configure): Move decls from here ...
16405 * systty.h: ... to here, so that they can be checked.
16406
16407 * fns.c (get_random, seed_random): Move extern decls from here ...
16408 * lisp.h: ... to here, so that they can be checked.
16409
16410 * sysdep.c (reset_io): Now static.
16411 (wait_for_termination_signal): Remove; unused.
16412
16413 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16414 (copy_keymap_item, append_key, push_text_char_description):
16415 Now static.
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.
16421
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.
16432
16433 * keyboard.h (make_ctrl_char): New decl.
16434 (mark_kboards): Move decl here ...
16435 * alloc.c (mark_kboards): ... from here.
16436
16437 * lisp.h (force_auto_save_soon): New decl.
16438
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):
16442 Use it.
16443 (main): Add casts to avoid warnings
16444 if GCC considers string literals to be constants.
16445
16446 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16447
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 *.
16454
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.
16458
16459 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16460
16461 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16462 (print_preprocess, print_object): New macro to fix last change.
16463
16464 * print.c (print_preprocess): Don't forget font objects.
16465
16466 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
16467
16468 * emacs.c (USAGE3): Doc fixes.
16469
16470 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16471
16472 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16473 structure.
16474
16475 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
16476
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.
16481
16482 * w32select.c: Don't #include "keyboard.h".
16483 (run_protected): Add extern declaration for waiting_for_input.
16484
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.
16499
16500 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
16501
16502 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
16503
16504 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
16505
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.
16509
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.
16515
16516 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16517
16518 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16519
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.
16522
16523 * xdisp.c (hscroll_window_tree):
16524 (reconsider_clip_changes): Use PT instead of BUF_PT.
16525
16526 2011-03-13 Eli Zaretskii <eliz@gnu.org>
16527
16528 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16529 $(EMACS_ROOT)/lib/intprops.h.
16530
16531 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16532
16533 Fix more problems found by GCC 4.5.2's static checks.
16534
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.
16549
16550 * xgselect.c (xg_select): Remove unused var.
16551
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.
16556
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.
16565
16566 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
16567
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.
16588
16589 * editfns.c (time_overflow): New function, refactoring common code.
16590 (Fformat_time_string, Fdecode_time, Fencode_time):
16591 (Fcurrent_time_string): Use it.
16592
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.
16597
16598 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16599
16600 * fringe.c (update_window_fringes): Remove unused variables.
16601
16602 * unexmacosx.c (copy_data_segment): Also copy __got section.
16603 (Bug#8223)
16604
16605 2011-03-12 Eli Zaretskii <eliz@gnu.org>
16606
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.
16611
16612 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
16613
16614 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16615 Adapt all references accordingly.
16616
16617 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16618
16619 2011-03-11 Tom Tromey <tromey@redhat.com>
16620
16621 * buffer.c (syms_of_buffer): Remove obsolete comment.
16622
16623 2011-03-11 Eli Zaretskii <eliz@gnu.org>
16624
16625 * termhooks.h (encode_terminal_code): Declare prototype.
16626
16627 * msdos.c (encode_terminal_code): Don't declare prototype.
16628
16629 * term.c (encode_terminal_code): Now external again, used by
16630 w32console.c and msdos.c.
16631
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.
16634
16635 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
16636
16637 Fix some minor problems found by GCC 4.5.2's static checks.
16638
16639 * fringe.c (update_window_fringes): Mark locals as initialized
16640 (Bug#8227).
16641 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
16642
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.
16647
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.
16652
16653 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16654
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.
16660
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
16675 macros.
16676
16677 * xterm.h (x_mouse_leave): New decl.
16678
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.
16696
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.
16705
16706 * terminal.c (store_terminal_param): Now static.
16707
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.
16715
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.
16723
16724 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16725
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.
16729
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.
16736
16737 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16738 shadowing.
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).
16746
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.
16773
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.
16777
16778 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16779 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16780
16781 * chartab.c (copy_sub_char_table): Now static, since it's not used
16782 elsewhere.
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.
16786
16787 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
16788 (BIDI_BOB): Remove unused macro.
16789
16790 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16791 deduce are never used uninitialized.
16792 * term.c (encode_terminal_code): Likewise.
16793
16794 * term.c (encode_terminal_code): Now static. Remove unused local.
16795
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.
16806
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.
16815
16816 * term.c (term_mouse_position): Rename local to avoid shadowing.
16817
16818 * alloc.c (mark_ttys): Move decl from here ...
16819 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16820
16821 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16822
16823 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16824
16825 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
16826
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.
16830
16831 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16832
16833 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16834 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16835 for ! HAVE_GTK3.
16836 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16837
16838 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16839
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
16852 for HAVE_GTK3.
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
16859 parameters.
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
16871 if ! HAVE_GTK3.
16872 (update_frame_tool_bar): Call gtk_widget_hide.
16873 (xg_initialize): Use GDK_KEY_g.
16874
16875 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16876 if ! HAVE_GTK3
16877 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16878
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.
16882
16883 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
16884
16885 * w32xfns.c (select_palette): Check success of RealizePalette against
16886 GDI_ERROR, not zero.
16887
16888 See ChangeLog.11 for earlier changes.
16889
16890 ;; Local Variables:
16891 ;; coding: utf-8
16892 ;; End:
16893
16894 Copyright (C) 2011-2012 Free Software Foundation, Inc.
16895
16896 This file is part of GNU Emacs.
16897
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.
16902
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.
16907
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/>.