Fix doc of local-variable-if-set-p.
[bpt/emacs.git] / src / ChangeLog
1 2012-09-07 Chong Yidong <cyd@gnu.org>
2
3 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
4
5 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6
7 More signal-handler cleanup (Bug#12327).
8 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
9 Problem introduced when merging patches. Noted by Eli Zaretskii in
10 <http://bugs.gnu.org/12327#67>.
11 * floatfns.c: Comment fix.
12 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
13 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
14 and anyway the declaration is harmless even if SIGDANGER is not defined.
15 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
16 defined BROKEN_FIONREAD). systty.h formerly did this, but other
17 source files not surprisingly expected syssignal.h to define, or
18 not define, SIGIO, and it's cleaner to do it that way, for consistency.
19 Include <sys/ioctl.h>, for FIONREAD.
20 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
21 This eliminates a problem whereby other files mysteriously had
22 to include "syssignal.h" before including "systty.h" if they
23 wanted to use "#ifdef SIGIO".
24
25 2012-09-07 Eli Zaretskii <eliz@gnu.org>
26
27 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
28
29 * w32.c (sigemptyset): Empty the set.
30 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
31
32 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
33
34 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
35
36 * alloc.c (mark_buffer): Revert unsafe marking optimization.
37 (mark_object): Likewise for frame objects.
38
39 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
40
41 * syssignal.h (handle_on_main_thread): Always declare,
42 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
43 This ports to platforms without HAVE_PTHREAD.
44
45 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
46
47 Signal-handler cleanup (Bug#12327).
48 Emacs's signal handlers were written in the old 4.2BSD style with
49 sigblock and sigmask and so forth, and this led to some
50 inefficiencies and confusion. Rewrite these to use
51 pthread_sigmask etc. without copying signal sets around. Also,
52 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
53 'signal', and instead use functions that do not attempt to take
54 over the system name space. This patch causes Emacs's text
55 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
56 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
57 Do not include <signal.h> or "syssignal.h", as these
58 modules do not use signals.
59 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
60 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
61 Do not include <signal.h>, as "syssignal.h" does that for us now.
62 * atimer.c (sigmask_atimers): New function.
63 (block_atimers, unblock_atimers): New functions,
64 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
65 All uses replaced.
66 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
67 no longer needed here.
68 * emacs.c (main): Inspect existing signal handler with sigaction,
69 so that there's no need to block and unblock SIGHUP.
70 * sysdep.c (struct save_signal): New member 'action', replacing
71 old member 'handler'.
72 (save_signal_handlers, restore_signal_handlers):
73 Use sigaction instead of 'signal' to save and restore.
74 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
75 New function. All users of 'signal' modified to use set_sighandler
76 if they're writeonly, and to use sys_signal if they're read+write.
77 (emacs_sigaction_init, forwarded_signal): New functions.
78 (sys_signal): Remove. All uses replaced by calls to sigaction
79 and emacs_sigaction_init, or by direct calls to 'signal'.
80 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
81 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
82 all uses replaced by pthread_sigmask etc. calls.
83 * syssignal.h: Include <signal.h>.
84 (emacs_sigaction_init, forwarded_signal): New decls.
85 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
86 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
87 (sigmask, sys_sigmask): Remove; no longer needed.
88 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
89 (sigblock, sigunblock, sigfree):
90 (sigsetmask) [!defined sigsetmask]:
91 Remove. All uses replaced by pthread_sigmask.
92 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
93 no longer need to be replaced, and its typical old uses
94 are now done via emacs_sigaction_init and sigaction.
95 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
96 (sys_sigdel): Remove; unused.
97 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
98
99 2012-09-06 Eli Zaretskii <eliz@gnu.org>
100
101 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
102 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
103
104 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
105
106 Explicitly mark buffer_defaults and buffer_local_symbols.
107 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
108 mark_local_symbols here.
109 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
110 since special buffers aren't marked here any more.
111 (allocate_buffer): Chain new buffer with all_buffers here...
112 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
113 not here.
114 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
115 (syms_of_buffer): Remove staticpro of the above.
116 (init_buffer_once): Set names for buffer_defaults and
117 buffer_local_symbols.
118
119 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
120
121 Use bool for booleans in font-related modules.
122 * font.c (font_intern_prop, font_style_to_value)
123 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
124 (generate_otf_features, font_check_otf_features, font_check_otf)
125 (font_match_p, font_list_entities, font_at):
126 * fontset.c (fontset_id_valid_p, reorder_font_vector
127 (fontset_find_font, Fset_fontset_font)
128 (face_suitable_for_char_p) [0]:
129 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
130 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
131 (m17n_flt_initialized, ftfont_shape_by_flt):
132 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
133 * nsfont.m (nsfont_draw):
134 * w32font.c (w32font_draw):
135 * w32term.c (x_draw_glyphless_glyph_string_foreground):
136 Use bool for booleans.
137 * font.h: Adjust to above API changes.
138 (struct font, struct font_driver, struct font_driver_list):
139 Use bool for booleans.
140 (struct font): Remove useless member encoding_type.
141 All users removed.
142 * fontset.c, xftfont.c: Omit unnecessary static decls.
143
144 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
145
146 * alloc.c (mark_object): Revert window marking code
147 since it's unsafe for the Fset_window_configuration.
148
149 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
150
151 Fix race conditions with signal handlers and errno (Bug#12327).
152 Be more systematic about preserving errno whenever a signal
153 handler returns, even if it's not in the main thread. Do this by
154 renaming signal handlers to distinguish between signal delivery
155 and signal handling. All uses changed.
156 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
157 * data.c (deliver_arith_signal): Rename from arith_error.
158 * dispnew.c (deliver_window_change_signal): Rename from
159 window_change_signal.
160 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
161 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
162 * keyboard.c (deliver_input_available_signal): Rename from
163 input_available_signal.
164 (deliver_user_signal): Rename from handle_user_signal.
165 (deliver_interrupt_signal): Rename from interrupt_signal.
166 * process.c (deliver_pipe_signal): Rename from send_process_trap.
167 (deliver_child_signal): Rename from sigchld_handler.
168 * atimer.c (handle_alarm_signal):
169 * data.c (handle_arith_signal):
170 * dispnew.c (handle_window_change_signal):
171 * emacs.c (handle_fatal_signal, handle_danger_signal):
172 * keyboard.c (handle_input_available_signal):
173 * keyboard.c (handle_user_signal, handle_interrupt_signal):
174 * process.c (handle_pipe_signal, handle_child_signal):
175 New functions, with the actual signal-handling code taken from the
176 original respective signal handlers, sans the sporadic attempts to
177 preserve errno, since that's now done by handle_on_main_thread.
178 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
179 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
180 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
181 Move to sysdep.c.
182 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
183 Move initialization of main_thread to sysdep.c's init_signals.
184 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
185 our usage, and simplifies the mainline code.
186 (record_child_status_change): New static function, as a helper
187 for handle_child_signal, and with most of the old child handler's
188 contents.
189 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
190 (handle_child_signal): Use the above.
191 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
192 Moved here from emacs.c.
193 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
194 code moved here from emacs.c's main function.
195 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
196 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
197 lets callers save and restore errno properly.
198
199 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
200
201 Remove redundant or unused things here and there.
202 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
203 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
204 * editfns.c (Fcompare_buffer_substrings): Likewise.
205 * frame.h (struct terminal, struct font_driver_list):
206 Remove redundant declarations.
207 * window.h (Qleft, Qright): Likewise.
208
209 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
210
211 Do not mark objects from deleted buffers, windows and frames.
212 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
213 (mark_object): Likewise for windows and frames.
214
215 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
216
217 * alloc.c (valid_lisp_object_p): Treat killed buffers,
218 buffer_defaults and buffer_local_symbols as valid objects.
219 Return special value to denote them.
220
221 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
222
223 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
224 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
225 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
226 (file_name_absolute_p, Fsubstitute_in_file_name):
227 (check_executable, check_writable, Ffile_accessible_directory_p)
228 (Fset_file_selinux_context, Fdefault_file_modes)
229 (Finsert_file_contents, choose_write_coding_system)
230 (Fwrite_region, build_annotations, a_write, e_write)
231 (Fdo_auto_save):
232 * filelock.c (boot_time_initialized, get_boot_time)
233 (get_boot_time_1, lock_file_1, within_one_second):
234 * floatfns.c (in_float):
235 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
236 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
237 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
238 * lisp.h (struct Lisp_Hash_Table.cmpfn):
239 * window.c (compare_window_configurations):
240 Use bool for booleans.
241 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
242 (Fdefault_file_modes): Now mode_t, not int, for modes.
243 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
244 (internal_delete_file): Now returns void, not a (boolean) int,
245 since nobody was looking at the return value.
246 * lisp.h, window.h: Adjust to above API changes.
247
248 * xdisp.c (set_message): Simplify and reindent last change.
249
250 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
251
252 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
253
254 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
255
256 * eval.c (call_debugger): Make the function non-static so that we
257 can call it from set_message.
258
259 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
260 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
261
262 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
263
264 Give more-useful info on a fatal error (Bug#12328).
265 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
266 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
267 of doing the work ourselves.
268 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
269 do most of the work.
270 (fatal_error_backtrace): New function, taken from the guts
271 of the old fatal_error_signal, but with a new option to output
272 a backtrace.
273 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
274 info about the signal than just its number.
275 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
276 * sysdep.c: Include <execinfo.h>
277 (emacs_backtrace): New function, taken partly from the previous
278 code of the 'die' function.
279 (emacs_abort): Call fatal_error_backtrace rather than abort.
280
281 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
282
283 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
284 eager (load-time) macro-expansion.
285 * lisp.mk (lisp): Add macroexp.
286
287 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
288
289 Simplify redefinition of 'abort' (Bug#12316).
290 Do not try to redefine the 'abort' function. Instead, redo
291 the code so that it calls 'emacs_abort' rather than 'abort'.
292 This removes the need for the NO_ABORT configure-time macro
293 and makes it easier to change the abort code to do a backtrace.
294 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
295 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
296 Remove; sysdep.c's emacs_abort now takes its place.
297 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
298 'abort' changed to use 'emacs_abort'.
299 * msdos.c (dos_abort) [defined abort]: Remove; not used.
300 (abort) [!defined abort]: Rename to ...
301 (emacs_abort): ... new name.
302 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
303 the place of the old 'abort' in emacs.c.
304 * w32.c, w32fns.c (abort): Do not #undef.
305 * w32.c (emacs_abort): Rename from w32_abort.
306
307 2012-09-04 Eli Zaretskii <eliz@gnu.org>
308
309 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
310 offsets[j].dv, since the y axis of the screen coordinates points
311 down, while the y axis of the font definition coordinates points
312 up. This fixes display of Arabic diacritics such as KASRA and
313 KASRATAN. (Bug#11860)
314
315 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
316
317 Be more systematic about _setjmp vs setjmp.
318 * alloc.c (test_setjmp, mark_stack):
319 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
320 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
321 (png_load, my_error_exit, jpeg_load):
322 * process.c (send_process_trap, send_process):
323 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
324 The underscored versions are up to 30x faster on some hosts.
325 Formerly, the code used setjmp+longjmp sometimes and
326 _setjmp+_longjmp at other times, with no particular reason to
327 prefer setjmp+longjmp.
328
329 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
330
331 Fix minor problem found by static checking.
332 * buffer.c (Fdelete_all_overlays): Return nil.
333
334 2012-09-03 Martin Rudalics <rudalics@gmx.at>
335
336 * buffer.c (Fdelete_all_overlays): New function.
337
338 2012-09-03 Chong Yidong <cyd@gnu.org>
339
340 * gtkutil.c: Add extern decl for Qxft.
341
342 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
343
344 * emacs.c, eval.c: Use bool for boolean.
345 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
346 (malloc_using_checking) [DOUG_LEA_MALLOC]:
347 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
348 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
349 (main, decode_env_path, Fdaemon_initialized):
350 * eval.c (call_debugger, Finteractive_p, interactive_p):
351 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
352 (maybe_call_debugger, Fbacktrace):
353 * process.c (read_process_output, exec_sentinel):
354 Use bool for booleans.
355 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
356 All callers changed.
357 * eval.c (interactive_p): Omit always-true boolean argument
358 EXCLUDE_SUBRS_P. All callers changed.
359 * dispextern.h, lisp.h: Reflect above API changes.
360 * firstfile.c (dummy): Use the address of 'main', whose signature
361 won't change, instead of the address of 'initialize', whose
362 signature just changed from int to bool.
363 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
364 * msdos.c (fatal_error_in_progress): ... from here.
365 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
366 of incrementing it.
367 (redisplay_internal, unwind_redisplay): Simply clear
368 REDISPLAYING_P when unwinding, instead of saving its previous,
369 always-false value and then restoring it.
370
371 Clean up some extern decls.
372 Mostly, this hoists extern decls out of .c files and into .h files.
373 That way, we're more likely to catch errors if the interfaces change.
374 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
375 declare xg_mark_data.
376 * dispextern.h (x_frame_parm_handlers):
377 * font.h (Qxft):
378 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
379 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
380 (Qultra_bold, Qoblique, Qitalic):
381 Move extern decl here from .c file.
382 * alloc.c (xg_mark_data) [USE_GTK]:
383 * doc.c (Qclosure):
384 * eval.c (Qlexical_binding):
385 * fns.c (time) [!HAVE_UNISTD_H]:
386 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
387 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
388 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
389 * lread.c (Qinternal_interpreter_environment):
390 * minibuf.c (Qbuffer):
391 * process.c (QCfamily, QCfilter):
392 * widget.c (free_frame_faces):
393 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
394 * xfont.c (x_clear_errors):
395 * xterm.c (x_frame_parm_handlers):
396 Remove now-redundant extern decls.
397 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
398 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
399 Now static.
400 * xfaces.c: Remove unnecessary static decls.
401 * xterm.c (updating_frame): Remove decl of nonexistent object.
402
403 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
404 when building globals.h, as the objects that are not built on
405 this host are not needed to compile C files on this host.
406
407 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
408
409 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
410
411 * frame.h: Add missing prototype for x_wm_set_size_hint.
412
413 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
414
415 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
416 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
417 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
418 (Fsubstitute_command_keys):
419 * editfns.c (region_limit, find_field, Fconstrain_to_field)
420 (save_excursion_save, save_excursion_restore)
421 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
422 (format_time_string, general_insert_function)
423 (make_buffer_string, make_buffer_string_both)
424 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
425 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
426 (copy_text, insert_1, insert_1_both, insert_from_string)
427 (insert_from_string_before_markers, insert_from_string_1)
428 (insert_from_buffer, insert_from_buffer_1, replace_range)
429 (replace_range_2, del_range_1, del_range_byte, del_range_both)
430 (del_range_2, modify_region):
431 * intervals.c (intervals_equal, balance_possible_root_interval)
432 (adjust_intervals_for_insertion, merge_properties_sticky)
433 (graft_intervals_into_buffer, lookup_char_property)
434 (adjust_for_invis_intang, set_point_both)
435 (get_property_and_range, compare_string_intervals)
436 (set_intervals_multibyte_1, set_intervals_multibyte):
437 * keyboard.c (decode_timer):
438 Use bool for boolean.
439 * intervals.h, lisp.h, systime.h: Reflect above API changes.
440 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
441
442 2012-09-02 Chong Yidong <cyd@gnu.org>
443
444 * keymap.c (push_key_description): Print M-TAB as C-M-i
445 (Bug#11758).
446
447 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
448
449 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
450 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
451 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
452 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
453 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
454 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
455 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
456
457 2012-09-01 Eli Zaretskii <eliz@gnu.org>
458
459 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
460 more than one grapheme cluster passed to the shaper: compute the
461 offset adjustment values separately for each cluster. (Bug#11860)
462
463 * image.c: Restore mistakenly removed inclusion of w32.h. Without
464 it, GCC doesn't see prototypes of w32_delayed_load, and complains
465 about implicit conversions from integer to pointer.
466
467 2012-09-01 Daniel Colascione <dancol@dancol.org>
468
469 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
470 system used too early.
471
472 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
473
474 Better seed support for (random).
475 * emacs.c (main): Call init_random.
476 * fns.c (Frandom): Set the seed from a string argument, if given.
477 Remove long-obsolete Gentzel cruft.
478 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
479 (init_random): New function.
480
481 2012-09-01 Daniel Colascione <dancol@dancol.org>
482
483 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
484 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
485 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
486 x_wm_set_size_hint, x_query_colors, x_real_positions,
487 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
488 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
489 all of which have been moved to common code.
490
491 * xfaces.c: Include TERM_HEADER instead of listing all possible
492 window-system headers.
493
494 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
495 to match header.
496
497 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
498 directly accessing frame internals.
499
500 * w32font.h: Include font.h. Define syms_of_w32font and
501 globals_of_w32font.
502
503 * process.c: Include TERM_HEADER instead of listing all possible
504 window-system headers.
505
506 * nsterm.h: Remove declarations now in frame.h. Define
507 FRAME_X_SCREEN, FRAME_X_VISUAL.
508
509 * menu.c: Include TERM_HEADER instead of listing all possible
510 window-system headers.
511
512 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
513 window system.
514
515 * keyboard.c: Include TERM_HEADER instead of listing all possible
516 window-system headers.
517
518 * image.c: Include TERM_HEADER instead of listing all possible
519 window-system headers. Declare Vlibrary_cache when compiling for
520 Windows.
521
522 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
523 window system declarations.
524
525 * frame.h: Move common functions here: set_frame_menubar,
526 x_set_window_size, x_sync, x_get_focus_frame,
527 x_set_mouse_position, x_set_mouse_pixel_position,
528 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
529 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
530 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
531 x_activate_menubar, x_real_positions, x_bitmap_icon,
532 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
533 and x_query_colors.
534
535 * frame.c: Include TERM_HEADER instead of listing all possible
536 window-system headers.
537
538 * font.c: Include TERM_HEADER instead of listing all possible
539 window-system headers.
540
541 * emacs.c: Include TERM_HEADER.
542
543 * dispnew.c: Include TERM_HEADER instead of listing all possible
544 window-system headers.
545
546 * ccl.h: Include character.h.
547
548 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
549 the current window system; include in list of objects to link into
550 Emacs.
551
552 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
553
554 Remove mark_ttys function and fix tty_display_info initialization.
555 * lisp.h (mark_ttys): Remove prototype.
556 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
557 to mark_ttys because all possible values of 'top_frame' slot are
558 the frames which are reachable from Vframe_list.
559 * term.c (mark_ttys): Remove.
560 (init_tty): Safely initialize 'top_frame' slot with Qnil.
561
562 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
563
564 Change struct frame bitfields from unsigned char to unsigned.
565 * frame.h (struct frame): Change type of 'display_preempted',
566 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
567 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
568 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
569 bitfields from unsigned char to unsigned.
570
571 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
572
573 Remove unused member of struct x_output and struct w32_output.
574 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
575 * w32term.h (struct w32_output): Likewise.
576
577 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
578
579 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
580 does not become zero (Bug#12234).
581
582 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
583
584 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
585 for GCC 4.7.1 x86-64.
586
587 2012-08-30 Glenn Morris <rgm@gnu.org>
588
589 * lread.c (init_lread): For out-of-tree builds, only add the
590 source directory's site-lisp dir to the load-path if it exists,
591 consistent with in-tree builds. (Bug#12302)
592
593 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
594
595 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
596 button_values to NULL. Call setStykeMask so dialogs get a close button.
597 (windowShouldClose:): Set window_closed.
598 (dealloc): New member, free button_values.
599 (process_dialog:): Make member function. Remove window argument,
600 replace window with self. Count buttons and allocate and store values
601 in button_values.
602 (addButton:value:row:): value is int with the name tag. Call setTag
603 with tag. Remove return self, declare return value as void.
604 (addString:row:): Remove return self, declare return value as void.
605 (addSplit): Remove return self, declare return value as void.
606 (clicked:): Remove return self, declare return value as void.
607 Set dialog_return to button_values[seltag]. Code formatting change.
608 (initFromContents:isQuestion:): Adjust call to process_dialog.
609 Code formatting change.
610 (timeout_handler:): Set timer_fired to YES.
611 (runDialogAt:): Set timer_fired to NO.
612 Handle click on close button as quit.
613
614 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
615 Add window_closed and button_values. Add void as return value for
616 add(Button|String|Split). addButton takes int instead of Lisp_Object.
617 Add process_dialog as new member.
618
619 2012-08-28 Eli Zaretskii <eliz@gnu.org>
620
621 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
622 is not one of the heaps we manage. (Bug#12242)
623
624 2012-08-28 Glenn Morris <rgm@gnu.org>
625
626 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
627
628 2012-08-28 Martin Rudalics <rudalics@gmx.at>
629
630 * window.c (Fset_window_configuration): Remove handling of
631 auto-buffer-name window parameter. Install revision of reverted
632 fix.
633
634 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
635
636 Do not allow to set major mode for a dead buffer.
637 * buffer.c (Fset_buffer_major_mode): Signal an error
638 if the buffer is dead.
639 (Fother_buffer, other_buffer_safely): Remove redundant
640 nested declaration.
641
642 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
643
644 Always use set_buffer_if_live to restore original buffer at unwind.
645 * buffer.h (record_unwind_current_buffer): New function.
646 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
647 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
648 * undo.c, window.c: Adjust users.
649 * buffer.c (set_buffer_if_live): Fix comment.
650
651 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
652
653 Fix usage of set_buffer_internal.
654 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
655 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
656 * coding.c (decode_coding): Omit redundant test.
657 * fileio.c (decide_coding_unwind): Likewise.
658 * fns.c (secure_hash): Likewise.
659 * insdel.c (modify_region): Likewise.
660 * keyboard.c (command_loop_1): Likewise.
661 * print.c (PRINTFINISH): Likewise.
662 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
663
664 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
665
666 * dispnew.c: Use bool for boolean.
667 (frame_garbaged, display_completed, delayed_size_change)
668 (fonts_changed_p, add_window_display_history)
669 (add_frame_display_history, verify_row_hash)
670 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
671 (row_equal_p, realloc_glyph_pool)
672 (allocate_matrices_for_frame_redisplay)
673 (showing_window_margins_p)
674 (adjust_frame_glyphs_for_frame_redisplay)
675 (build_frame_matrix_from_leaf_window, make_current)
676 (mirrored_line_dance, mirror_line_dance, update_frame)
677 (update_window_tree, update_single_window)
678 (check_current_matrix_flags, update_window, update_text_area)
679 (update_window_line, set_window_update_flags, scrolling_window)
680 (update_frame_1, scrolling, buffer_posn_from_coords)
681 (do_pending_window_change, change_frame_size)
682 (change_frame_size_1, sit_for):
683 Use bool for boolean.
684 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
685 and remove last int (actually boolean) argument, which was always 0.
686 All callers changed.
687 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
688 * dispextern.h (struct composition_it): Use bool for boolean.
689 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
690 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
691 * dired.c (file_name_completion):
692 Use bool for boolean. (This was missed in an earlier change.)
693
694 2012-08-27 Martin Rudalics <rudalics@gmx.at>
695
696 * window.c (Fset_window_configuration): Revert first part of
697 last change.
698
699 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
700
701 * nsterm.h (NSPanel): New class variable dialog_return.
702
703 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
704 dialog_return.
705 (windowShouldClose:): Use stop instead of stopModalWithCode.
706 (clicked:): Ditto, and also set dialog_return (Bug#12258).
707 (timeout_handler:): Use stop instead of abortModal. Send a dummy
708 event.
709 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
710 modal loop returns.
711
712 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
713
714 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
715 * composite.c (find_composition, composition_gstring_p)
716 (composition_reseat_it, find_automatic_composition):
717 * data.c (let_shadows_buffer_binding_p)
718 (let_shadows_global_binding_p, set_internal, make_blv)
719 (Fmake_variable_buffer_local, Fmake_local_variable)
720 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
721 (cons_to_signed, arith_driver):
722 * dbusbind.c (xd_in_read_queued_messages):
723 * dired.c (directory_files_internal, file_name_completion):
724 Use bool for booleans.
725 * dired.c (file_name_completion):
726 * process.h (fd_callback):
727 Omit int (actually boolean) argument. It wasn't being used.
728 All uses changed.
729 * composite.h, lisp.h: Reflect above API changes.
730
731 * cmds.c, coding.c: Use bool for booleans.
732 * cmds.c (move_point, Fself_insert_command):
733 * coding.h (struct composition status, struct coding_system):
734 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
735 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
736 (emacs_mule_char, decode_coding_emacs_mule)
737 (encode_coding_emacs_mule, detect_coding_iso_2022)
738 (decode_coding_iso_2022, encode_invocation_designation)
739 (encode_designation_at_bol, encode_coding_iso_2022)
740 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
741 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
742 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
743 (encode_coding_raw_text, detect_coding_charset)
744 (decode_coding_charset, encode_coding_charset, detect_eol)
745 (detect_coding, get_translation_table, produce_chars)
746 (consume_chars, reused_workbuf_in_use)
747 (make_conversion_work_buffer, code_conversion_save)
748 (decode_coding_object, encode_coding_object)
749 (detect_coding_system, char_encodable_p)
750 (Funencodable_char_position, code_convert_region)
751 (code_convert_string, code_convert_string_norecord)
752 (Fset_coding_system_priority):
753 * fileio.c (Finsert_file_contents):
754 Use bool for booleans.
755 * coding.h, lisp.h: Reflect above API changes.
756 * coding.c: Remove unnecessary static function decls.
757 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
758 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
759 not a boolean 'int', since callers never look at the return value.
760 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
761 * coding.h (decoding_buffer_size, encoding_buffer_size)
762 (emacs_mule_string_char): Remove unused extern decls.
763 (struct iso_2022_spec, struct coding_system):
764 Use 'unsigned int : 1' for boolean fields, since there's more than one.
765 (struct emacs_mule_spec): Remove unused field 'full_support'.
766 All initializations removed.
767 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
768
769 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
770
771 Fix spare memory change (Bug#12286).
772 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
773 (valid_lisp_object_p): Likewise.
774
775 2012-08-27 Martin Rudalics <rudalics@gmx.at>
776
777 * window.c (Fset_window_configuration): Record any window's old
778 buffer if it's replaced (see Bug#8789). If the new current
779 buffer doesn't appear in the selected window, go to its old
780 point (Bug#12208).
781
782 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
783
784 Special MEM_TYPE_SPARE to denote reserved memory.
785 * alloc.c (enum mem_type): New memory type.
786 (refill_memory_reserve): Use new type for spare memory.
787 This prevents live_cons_p and live_string_p from incorrect
788 detection of uninitialized objects from spare memory as live.
789
790 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
791
792 Spelling fixes.
793 * Makefile.in (.PHONY): versioclean -> versionclean.
794
795 Remove unused external symbols.
796 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
797 * window.c (Qwindow_valid_p, decode_valid_window):
798 Now static, not extern.
799 * data.c (Qinterval): Remove; unused.
800 (syms_of_data): Do not define 'interval'.
801 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
802 * window.h (decode_valid_window):
803 Remove decls.
804
805 * character.c, charset.c, chartab.c: Use bool for booleans.
806 * character.c (lisp_string_width, string_count_byte8)
807 (string_escape_byte8):
808 * charset.c (charset_map_loaded, load_charset_map, read_hex):
809 (load_charset_map_from_file, map_charset_chars)
810 (Fdefine_charset_internal, define_charset_internal)
811 (Fdeclare_equiv_charset, find_charsets_in_text)
812 (Ffind_charset_region, char_charset, Fiso_charset):
813 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
814 (sub_char_table_set, sub_char_table_set_range)
815 (char_table_set_range, optimize_sub_char_table)
816 (map_sub_char_table):
817 Use bool for boolean.
818 * character.c (str_to_unibyte): Omit last boolean argument; it was
819 always 0. All callers changed.
820 * character.h, charset.h: Adjust to match previous changes.
821 * character.h (char_printable_p): Remove decl of nonexistent function.
822 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
823 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
824 are all boolean, so make them single-bit bitfields.
825
826 * lisp.h (ASET): Remove attempt to detect side effects.
827 It was meant to be temporary and it often doesn't work,
828 because when IDX has side effects the behavior of IDX==IDX
829 is undefined. See Stefan Monnier in
830 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
831
832 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
833
834 * lisp.h (functionp): New function (extracted from Ffunctionp).
835 (FUNCTIONP): Use it.
836 * eval.c (Ffunctionp): Use it.
837
838 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
839
840 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
841 as that's faster and simpler than static storage. Don't bother
842 with the g_main_context_query overhead if g_main_context_pending
843 says no events are pending.
844 (gfds, gfds_size): Remove these static vars.
845 (xgselect_initialize): Remove; no longer needed.
846 All uses and decls removed.
847
848 * emacs.c (fatal_error_signal_hook): Remove.
849 All uses removed. This leftover from old code was always 0.
850
851 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
852 * casefiddle.c (casify_object, casify_region):
853 * casetab.c (set_case_table):
854 * category.c, category.h (word_boundary_p):
855 * category.h (CHAR_HAS_CATEGORY):
856 Use bool for booleans, instead of int.
857
858 2012-08-25 Eli Zaretskii <eliz@gnu.org>
859
860 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
861
862 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
863
864 On assertion failure, print backtrace if available.
865 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
866 (die) [ENABLE_CHECKING]: Print a backtrace if available.
867 * Makefile.in (LIB_EXECINFO): New macro.
868 (LIBES): Use it.
869
870 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
871 * bytecode.c (exec_byte_code):
872 * callint.c (check_mark, Fcall_interactively):
873 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
874 (getenv_internal, sync_process_alive, call_process_exited):
875 * lisp.h (USE_SAFE_ALLOCA):
876 Use bool for booleans, instead of int.
877 * lisp.h, process.h: Adjust prototypes to match above changes.
878 * callint.c (Fcall_interactively): Don't assume the mark's
879 offset fits in 'int'.
880
881 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
882
883 * buffer.c, buffer.h: Use bool for boolean.
884 * buffer.c (reset_buffer_local_variables)
885 (buffer_lisp_local_variables, Fset_buffer_modified_p)
886 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
887 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
888 (overlay_touches_p, overlay_strings, Foverlay_put)
889 (report_overlay_modification, call_overlay_mod_hooks):
890 (mmap_enlarge, mmap_set_vars):
891 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
892 Use bool for booleans, instead of int.
893 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
894 since the 1-or-0 return value is always ignored anyway.
895 (mmap_initialized_p):
896 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
897 * buffer.h, lisp.h: Adjust prototypes to match above changes.
898
899 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
900
901 * bidi.c: Use bool for boolean.
902 This is a bit more readable, and makes the text segment of bidi.o
903 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
904 Presumably it's faster too.
905 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
906 Now bool.
907 (bidi_cache_find_level_change, bidi_cache_iterator_state)
908 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
909 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
910 (bidi_explicit_dir_char, bidi_level_of_next_char)
911 (bidi_find_other_level_edge, bidi_move_to_visually_next):
912 Use bool for booleans, instead of int.
913 * dispextern.h (bidi_init_it, bidi_paragraph_init)
914 (bidi_unshelve_cache): Adjust decls to match code.
915
916 2012-08-23 Martin Rudalics <rudalics@gmx.at>
917
918 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
919 argument.
920
921 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
922
923 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
924 * atimer.h: Include <stdbool.h>.
925
926 2012-08-22 Dan Nicolaescu <dann@gnu.org>
927
928 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
929 compile time tests instead of run time tests on systems that do
930 not use them.
931 (FRAME_MAC_P): Remove leftover from deleted code.
932 * frame.c (syms_of_frame): Remove leftover from deleted code.
933
934 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
935
936 * nsterm.m (insertText:): Don't clear modifiers if code is space.
937
938 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
939
940 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
941 Otherwise, the compiler complains about (A?B:C) where B is void
942 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
943 (fontset_add): Return void, for FONTSET_ADD.
944
945 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
946
947 * alloc.c: Use bool for booleans.
948 (gc_in_progress, abort_on_gc)
949 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
950 (dont_register_blocks) [GC_MALLOC_CHECK]:
951 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
952 (check_string_bytes, make_specified_string, memory_full)
953 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
954 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
955 (mark_stack, valid_pointer_p, make_pure_string)
956 (Fgarbage_collect, survives_gc_p, gc_sweep):
957 Use bool for booleans, instead of int.
958 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
959 Remove unused local.
960 * alloc.c (PURE_POINTER_P):
961 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
962 * editfns.c (Fformat):
963 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
964 (Fdo_auto_save):
965 * fns.c (sweep_weak_table):
966 * lisp.h (suppress_checking, push_message, survives_gc_p)
967 (make_pure_string, gc_in_progress, abort_on_gc):
968 * lread.c (readchar, read1):
969 * print.c (Fprin1_to_string):
970 * xdisp.c (push_message):
971 Use bool for booleans affected directly or indirectly by
972 alloc.c's changes.
973
974 Make recently-introduced setters macros.
975 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
976 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
977 (set_fontset_default, set_fontset_fallback): Rename from their
978 upper-case counterparts, and make them functions rather than macros.
979 This is more consistent with the other recently-introduced setters.
980 These don't need to be inline, since they're local.
981
982 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
983
984 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
985 the loop (Bug#12247).
986
987 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
988
989 * lisp.h (vcopy): Use memcpy rather than our own loop.
990 This fixes a performance regression introduced by the recent
991 addition of vcopy. This means 'vcopy' will need to be modified
992 for a copying collector, but that's OK. Also, tighten the
993 checking in the assertion.
994
995 2012-08-21 Eli Zaretskii <eliz@gnu.org>
996
997 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
998 components for RTL text (Bug#11860). Adjust X-OFFSET of each
999 non-base glyph for the width of the base character, according to
1000 what x_draw_composite_glyph_string_foreground expects.
1001 Generate WADJUST value according to composition_gstring_width's
1002 expectations, to produce correct width of the composed character.
1003 Reverse the sign of the DU offset produced by ScriptPlace.
1004
1005 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1006
1007 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1008
1009 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1010
1011 Avoid direct writes to contents member of struct Lisp_Vector.
1012 * lisp.h (vcopy): New function to copy data into vector.
1013 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1014 * fns.c (Ffillarray): Use ASET.
1015 * keyboard.c (timer_check_2): Use AREF and ASET.
1016 (append_tool_bar_item, Frecent_keys): Use vcopy.
1017 * lread.c (read_vector): Use ASET.
1018 * msdos.c (Frecent_doskeys): Use vcopy.
1019 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1020 (Finternal_merge_in_global_face): Use ASET and vcopy.
1021 * xfont.c (xfont_list_pattern): Likewise.
1022
1023 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1024
1025 * window.c (Fwindow_point): For the selected window always return
1026 the position of its buffer's point.
1027 (Fset_window_point): For the selected window always go in its
1028 buffer to the specified position.
1029
1030 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1031
1032 Setter macros for fontsets.
1033 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1034 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1035 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1036 Adjust users.
1037
1038 2012-08-20 Glenn Morris <rgm@gnu.org>
1039
1040 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1041 Don't assume that `ln -f' works.
1042
1043 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1044
1045 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1046 and later about non-assignments with no effect. See discussion at
1047 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1048 details.
1049
1050 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1051
1052 Inline setter functions for Lisp_Objects slots of struct specbinding.
1053 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1054 Adjust users.
1055
1056 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1057
1058 * window.c (select_window): Always make selected window's buffer
1059 current.
1060
1061 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1062
1063 Use AREF and ASET for docstrings of category tables.
1064 * category.h (CATEGORY_DOCSTRING): Use AREF.
1065 (SET_CATEGORY_DOCSTRING): Use ASET.
1066 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1067
1068 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1069
1070 Inline setter functions for hash table members.
1071 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1072 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1073 (set_hash_key_and_value, set_hash_index, set_hash_next)
1074 (set_hash_hash): New functions.
1075 * charset.c, fns.c: Adjust users.
1076
1077 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1078
1079 Inline getter and setter functions for per-buffer values.
1080 * buffer.h (per_buffer_default, set_per_buffer_default)
1081 (per_buffer_value, set_per_buffer_value): New functions.
1082 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1083 * buffer.c, data.c: Adjust users.
1084
1085 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1086
1087 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1088
1089 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1090
1091 Rely on <config.h> + <unistd.h> to declare 'environ',
1092 as gnulib does this if the system doesn't.
1093 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1094 Remove declaration. MS-Windows declares it on stdlib.h which is
1095 included by conf_post.h.
1096 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1097 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1098 * vm-limit.c: Include <unistd.h>, for 'environ'.
1099
1100 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1101 (start_of_data): Remove decl; mem-limits.h provides it.
1102
1103 * xdisp.c (handle_invisible_prop): Make it a bit faster
1104 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1105
1106 2012-08-19 Chong Yidong <cyd@gnu.org>
1107
1108 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1109 ends (Bug#3874).
1110
1111 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1112
1113 * .gdbinit: Use call instead of set when calling a function in the
1114 inferior.
1115
1116 * data.c (set_internal): Don't use set_blv_found.
1117 (Fkill_local_variable): Likewise.
1118
1119 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1120
1121 * nsfont.m (ns_ascii_average_width): Ensure the string
1122 ascii_printable is initialized with a null-terminated character
1123 array. Otherwise, it can contain undesired extra characters.
1124
1125 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1126
1127 port new setting code to Sun C 5.8 2005/10/13
1128 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1129 Return void, not Lisp_Object. Otherwise, the compiler
1130 complains about (A?B:C) where B is void and C is Lisp_Object
1131 when compiling CHAR_TABLE_SET, due to the recent change to
1132 the API of sub_char_table_set_contents.
1133
1134 2012-08-18 Chong Yidong <cyd@gnu.org>
1135
1136 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1137 for the string case (Bug#3874).
1138
1139 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1140
1141 * buffer.h (BSET): Remove (Bug#12215).
1142 Replace all uses with calls to new setter functions.
1143 (bset_bidi_paragraph_direction, bset_case_canon_table)
1144 (bset_case_eqv_table, bset_directory, bset_display_count)
1145 (bset_display_time, bset_downcase_table)
1146 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1147 (bset_last_selected_window, bset_local_var_alist)
1148 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1149 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1150 (bset_width_table):
1151 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1152 (bset_auto_fill_function, bset_auto_save_file_format)
1153 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1154 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1155 (bset_cache_long_line_scans, bset_case_fold_search)
1156 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1157 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1158 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1159 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1160 (bset_header_line_format, bset_indicate_buffer_boundaries)
1161 (bset_indicate_empty_lines, bset_invisibility_spec)
1162 (bset_left_fringe_width, bset_major_mode, bset_mark)
1163 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1164 (bset_name, bset_overwrite_mode, bset_pt_marker)
1165 (bset_right_fringe_width, bset_save_length)
1166 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1167 (bset_scroll_up_aggressively, bset_selective_display)
1168 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1169 (bset_word_wrap, bset_zv_marker):
1170 * category.c (bset_category_table):
1171 * syntax.c (bset_syntax_table):
1172 New setter functions.
1173
1174 * process.h (PSET): Remove (Bug#12215).
1175 Replace all uses with calls to new setter functions.
1176 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1177 (PROCESS_INLINE): New macro.
1178 (pset_childp): New setter function.
1179 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1180 * process.c (PROCESS_INLINE):
1181 Define to EXTERN_INLINE, so that the corresponding functions
1182 are compiled into code.
1183 (pset_buffer, pset_command, pset_decode_coding_system)
1184 (pset_decoding_buf, pset_encode_coding_system)
1185 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1186 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1187 (pset_type, pset_write_queue): New setter functions.
1188
1189 * window.h (WSET): Remove (Bug#12215).
1190 Replace all uses with calls to new setter functions.
1191 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1192 (WINDOW_INLINE): New macro.
1193 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1194 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1195 (wset_total_lines, wset_vertical_scroll_bar)
1196 (wset_window_end_pos, wset_window_end_valid)
1197 (wset_window_end_vpos): New setter functions.
1198 * window.c (WINDOW_INLINE):
1199 Define to EXTERN_INLINE, so that the corresponding functions
1200 are compiled into code.
1201 (wset_combination_limit, wset_dedicated, wset_display_table)
1202 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1203 (wset_new_normal, wset_new_total, wset_next_buffers)
1204 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1205 (wset_prev_buffers, wset_right_fringe_width)
1206 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1207 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1208 (wset_window_parameters):
1209 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1210 (wset_column_number_displayed, wset_region_showing):
1211 New setter functions.
1212
1213 * termhooks.h (TSET): Remove (Bug#12215).
1214 Replace all uses with calls to new setter functions.
1215 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1216 (TERMHOOKS_INLINE): New macro.
1217 (tset_charset_list, tset_selection_alist): New setter functions.
1218 * terminal.c (TERMHOOKS_INLINE):
1219 Define to EXTERN_INLINE, so that the corresponding functions
1220 are compiled into code.
1221 (tset_param_alist): New setter function.
1222
1223 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1224
1225 * keyboard.h (KSET): Remove (Bug#12215).
1226 Replace all uses with calls to new setter functions.
1227 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1228 (KEYBOARD_INLINE): New macro.
1229 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1230 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1231 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1232 New setter functions.
1233 * keyboard.c (KEYBOARD_INLINE):
1234 Define to EXTERN_INLINE, so that the corresponding functions
1235 are compiled into code.
1236 (kset_echo_string, kset_kbd_queue)
1237 (kset_keyboard_translate_table, kset_last_prefix_arg)
1238 (kset_last_repeatable_command, kset_local_function_key_map)
1239 (kset_overriding_terminal_local_map, kset_real_last_command)
1240 (kset_system_key_syms): New setter functions.
1241
1242 * frame.h (FSET): Remove (Bug#12215).
1243 Replace all uses with calls to new setter functions.
1244 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1245 (FRAME_INLINE): New macro.
1246 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1247 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1248 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1249 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1250 (fset_param_alist, fset_root_window, fset_scroll_bars)
1251 (fset_selected_window, fset_title, fset_tool_bar_items)
1252 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1253 * frame.c (FRAME_INLINE):
1254 Define to EXTERN_INLINE, so that the corresponding functions
1255 are compiled into code.
1256 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1257
1258 A few more naming-convention fixes for getters and setters.
1259 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1260 and rename from buffer_overlays_set_before.
1261 (set_buffer_overlays_after): Move here from buffer.h, and rename
1262 from buffer_overlays_set_after.
1263 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1264 All uses changed.
1265 (set_buffer_intervals): Rename from buffer_set_intervals.
1266 * intervals.c (set_interval_object): Move here from intervals.h,
1267 and rename from interval_set_object.
1268 (set_interval_left): Move here from intervals.h, and rename from
1269 interval_set_left.
1270 (set_interval_right): Move here from intervals.h, and rename from
1271 interval_set_right.
1272 (copy_interval_parent): Move here from intervals.h, and rename from
1273 interval_copy_parent.
1274 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1275 (set_interval_plist): Rename from interval_set_plist.
1276 Return void, not Lisp_Object, since no caller uses the result.
1277 * lisp.h (string_intervals): Rename from string_get_intervals.
1278 (set_string_intervals): Rename from string_set_intervals.
1279
1280 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1281 (set_char_table_contents): Rename from char_table_set_contents.
1282 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1283 All uses changed. See the end of
1284 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1285
1286 * lisp.h (CSET): Remove (Bug#12215).
1287 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1288 (set_char_table_purpose): New functions,
1289 replacing CSET. All uses changed. For example, replace
1290 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1291 "set_char_table_parent (char_table, parent);".
1292 The old version was confusing because it used the same name
1293 'parent' for two different things.
1294
1295 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1296
1297 Functions to get and set Lisp_Object fields of buffer-local variables.
1298 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1299 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1300 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1301 * data.c, eval.c, frame.c: Adjust users.
1302
1303 2012-08-17 Chong Yidong <cyd@gnu.org>
1304
1305 * xfaces.c (merge_face_vectors): If the target font specfies a
1306 font spec, make the font's attributes take precedence over
1307 directly-specified attributes.
1308 (merge_face_ref): Recognize :font.
1309
1310 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1311
1312 Do not use memcpy for copying intervals.
1313 * intervals.c (reproduce_interval): New function.
1314 (reproduce_tree, reproduce_tree_obj): Use it.
1315 (reproduce_tree_obj): Remove prototype.
1316
1317 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1318
1319 * lisp.h (duration_to_sec_usec): Remove unused decl.
1320
1321 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1322
1323 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1324 to an allocated instance of NSString, not to the class itself.
1325
1326 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1327
1328 * makefile.w32-in (C_CTYPE_H): New macro.
1329 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1330 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1331 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1332
1333 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1334
1335 Use ASCII tests for character types.
1336 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1337 * xfns.c, xterm.c:
1338 Don't include <ctype.h>; was not needed.
1339 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1340 * sysdep.c, xfaces.c:
1341 Include <c-ctype.h> instead of <ctype.h>.
1342 * nsterm.m: Include <c-ctype.h>.
1343 * charset.c (read_hex):
1344 * doc.c (Fsnarf_documentation):
1345 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1346 (DRIVE_LETTER) [DOS_NT]:
1347 (Ffile_name_directory, Fexpand_file_name)
1348 (Fsubstitute_in_file_name):
1349 * font.c (font_parse_xlfd, font_parse_fcname):
1350 * frame.c (x_set_font_backend):
1351 * gtkutil.c (xg_get_font):
1352 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1353 * nsimage.m (hexchar):
1354 * nsterm.m (ns_xlfd_to_fontname):
1355 * sysdep.c (system_process_attributes):
1356 * xfaces.c (hash_string_case_insensitive):
1357 Use C-locale tests instead of locale-specific tests for character
1358 types, since we want the ASCII interpretation here, not the
1359 interpretation suitable for whatever happens to be the current locale.
1360
1361 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1362
1363 Consistently check windows for validity/liveness
1364 (Bug#11984, Bug#12025, Bug#12026).
1365 * lisp.h (CHECK_VALID_WINDOW): New macro.
1366 * window.c (decode_window): Rename to decode_live_window.
1367 (decode_valid_window, Fwindow_valid_p): New functions.
1368 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1369 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1370 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1371 (Fwindow_prev_sibling, Fwindow_combination_limit)
1372 (Fset_window_combination_limit, Fwindow_use_time)
1373 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1374 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1375 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1376 (Fwindow_hscroll, Fset_window_hscroll)
1377 (Fwindow_redisplay_end_trigger)
1378 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1379 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1380 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1381 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1382 (Fwindow_end, Fset_window_point, Fset_window_start)
1383 (Fpos_visible_in_window_p, Fwindow_line_height)
1384 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1385 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1386 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1387 (Fset_window_parameter, Fwindow_display_table)
1388 (Fset_window_display_table, Fdelete_other_windows_internal)
1389 (Fset_window_buffer, Fset_window_new_total)
1390 (Fset_window_new_normal, Fdelete_window_internal)
1391 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1392 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1393 (Fwindow_scroll_bars): Check whether argument window is a valid or
1394 live window. Update doc-strings.
1395 (syms_of_window): New symbol Qwindow_valid_p.
1396 * keyboard.c (Fposn_at_x_y): Check whether argument
1397 frame_or_window denotes a valid window.
1398
1399 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1400
1401 Fix previous char table change.
1402 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1403 * chartab.c (optimize_sub_char_table): Likewise.
1404
1405 2012-08-16 Chong Yidong <cyd@gnu.org>
1406
1407 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1408
1409 * xfont.c (xfont_open):
1410 * xftfont.c (xftfont_open): Set the font's max_width field.
1411
1412 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1413 min_width to space_width and average_width to the average over
1414 printable ASCII characters.
1415 (ns_char_width): Code cleanup.
1416 (ns_ascii_average_width): New utility function.
1417
1418 * font.h (struct font): Update comments.
1419
1420 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1421
1422 Simple interface to set Lisp_Object fields of character tables.
1423 * lisp.h (CSET): New macro.
1424 (char_table_set_extras, char_table_set_contents)
1425 (sub_char_table_set_contents): New function.
1426 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1427 * syntax.c: Adjust users.
1428
1429 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1430
1431 * eval.c (eval_sub): Bind lexical-binding.
1432 * lread.c (Qlexical_binding): Make non-static.
1433
1434 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1435
1436 * nsmenu.m (popupSession): Remove.
1437 (pop_down_menu): Remove endModalSession.
1438 (timeout_handler:): New method.
1439 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1440 Call runModalForWindow. Check timer_fired when it returns.
1441 If not set, cancel timer and break out of loop.
1442 Otherwise loop again, with a new timeout.
1443
1444 * nsterm.m: Include fcntl.h if present.
1445 (fd_entry, t_readfds, inNsSelect): Remove.
1446 (select_writefds, select_valid, select_timeout, selfds)
1447 (select_mutex, apploopnr): Add.
1448 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1449 Otherwise call kbd_buffer_store_event.
1450 (ns_send_appdefined): Remove release of fd_entry.
1451 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1452 Increment and decrement apploopnr.
1453 (ns_select): If no file descriptors, just do a NSTimer.
1454 Otherwise copy read/write masks and start select thread (fd_handler).
1455 Start main loop and wait for application defined event.
1456 Inform select thread to stop selecting after main loop is exited.
1457 (ns_term_init): Create selfds pipe and set non-blocking.
1458 Initialize select_mutex. Start the select thread (fd_handler).
1459 (fd_handler:): Loop forever, wait for info from the main thread
1460 to either start or stop selecting. When select returns, send
1461 and appdefined event.
1462 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1463 If not call kbd_buffer_store_event.
1464
1465 * nsterm.h (EmacsApp): fd_handler takes id argument.
1466 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1467
1468 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1469
1470 2012-08-15 Eli Zaretskii <eliz@gnu.org>
1471
1472 * region-cache.c (move_cache_gap): Update gap_len using the actual
1473 growth of the boundaries array. Do not change cache_len.
1474 (Bug#12196)
1475
1476 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1477
1478 Generalize and cleanup font subsystem checks.
1479 * font.h (FONT_DEBUG, font_assert): Remove.
1480 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1481 Change font_assert to eassert. Use eassert where appropriate.
1482
1483 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1484
1485 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1486
1487 2012-08-15 Chong Yidong <cyd@gnu.org>
1488
1489 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1490 When using the new font chooser, use gtk_font_chooser_get_font_desc to
1491 extract the font descriptor instead of just the font name.
1492 In that case, return a font spec instead of a string.
1493 (x_last_font_name): Move to this file from xfns.c.
1494
1495 * xfns.c (Fx_select_font): The return value can also be a font
1496 spec. Move x_last_font_name management to gtkutil.c.
1497
1498 * xfaces.c: Make font weight and style symbols non-static.
1499
1500 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1501
1502 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1503 (bug#12117).
1504
1505 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1506
1507 * alloc.c (Fgarbage_collect): Use plural form consistently.
1508
1509 2012-08-14 Eli Zaretskii <eliz@gnu.org>
1510
1511 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1512 iteration through the command loop. Fixes a problem whereby mouse
1513 movements are ignored until the first mouse click.
1514
1515 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1516
1517 Use bool, not int, for Lisp booleans.
1518 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1519 makes Emacs a bit smaller and presumably a bit faster.
1520 * lisp.h: Include <stdbool.h>.
1521 (struct Lisp_Boolfwd, defvar_bool):
1522 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1523 * regex.c [!emacs]: Include <stdbool.h>.
1524 (false, true): Remove; <stdbool.h> does this for us now.
1525
1526 2012-08-14 Chong Yidong <cyd@gnu.org>
1527
1528 * character.c (Fcharacterp): Doc fix (Bug#12076).
1529
1530 * data.c (Findirect_variable): Doc fix (Bug#11040).
1531
1532 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1533
1534 * editfns.c (Fformat): Doc fix (Bug#12059).
1535 (Fsave_current_buffer): Doc fix (Bug#11542).
1536
1537 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1538
1539 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1540 (bug#12022).
1541
1542 2012-08-14 Martin Rudalics <rudalics@gmx.at>
1543
1544 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1545 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1546 * minibuf.c (choose_minibuf_frame, read_minibuf):
1547 * w32fns.c (x_create_tip_frame):
1548 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1549 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1550
1551 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1552
1553 * intervals.c (offset_intervals): Remove obsolete comment.
1554
1555 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1556
1557 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1558
1559 2012-08-14 Gergely Risko <gergely@risko.hu>
1560
1561 * coding.c (decode_coding): Record buffer modification before
1562 disabling undo_list (Bug#11773).
1563
1564 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1565
1566 Revert and cleanup some recent overlay changes.
1567 * buffer.h (enum overlay_type): Remove.
1568 (buffer_get_overlays, buffer_set_overlays): Likewise.
1569 (buffer_set_overlays_before, buffer_set_overlays_after):
1570 New function. Adjust users.
1571 (unchain_both): Add eassert.
1572
1573 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1574
1575 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1576
1577 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1578
1579 * gtkutil.c (xg_mark_data): Don't assume C99.
1580
1581 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1582
1583 * gtkutil.c (xg_frame_tb_info): New struct.
1584 (TB_INFO_KEY): New define.
1585 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1586 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1587 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1588 if not present.
1589 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1590 is up to date. Otherwise store new data.
1591 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1592
1593 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1594
1595 Use KSET for write access to Lisp_Object members of struct kboard.
1596 * keyboard.h (KSET): New macro.
1597 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1598 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1599 * xterm.c: Adjust users.
1600
1601 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1602
1603 Use BSET for write access to Lisp_Object members of struct buffer.
1604 * buffer.h (BSET): New macro.
1605 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1606 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1607 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1608 * window.c, xdisp.c, xfns.c: Adjust users.
1609
1610 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1611
1612 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1613
1614 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1615
1616 * nsterm.m (not_in_argv): New function.
1617 (application:openFile, application:openTempFile:):
1618 (application:openFileWithoutUI:, application:openFiles:): Open file
1619 if not_in_argv returns non-zero (bug#12171).
1620
1621 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
1622 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
1623 Define for Gtk+ versions less than 3.2.
1624 (xg_get_font_name): Use those functions/macros here.
1625 Reported by Frans Oilinki <moilinki@gmail.com>.
1626
1627 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1628
1629 * unexmacosx.c (copy_data_segment): Copy initialized data in
1630 statically linked libraries from input file rather than memory.
1631
1632 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1633 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1634 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1635
1636 2012-08-10 Glenn Morris <rgm@gnu.org>
1637
1638 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1639 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1640
1641 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1642
1643 Fix last change to allow compilation with low optimization levels.
1644 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1645 Reported by Jan Djärv <jan.h.d@swipnet.se>.
1646
1647 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1648
1649 Use common inline syntax in intervals.h.
1650 * intervals.h (INTERVALS_INLINE): New macro.
1651 Change all users from LISP_INLINE.
1652
1653 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1654
1655 Define Qnone once for all platforms.
1656 * frame.c (Qnone): Define here.
1657 (syms_of_frame): DEFSYM it.
1658 * lisp.h (Qnone): New declaration.
1659 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1660 * xfns.c: Remove duplication. Adjust users.
1661
1662 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1663
1664 Remove unused macros from intervals.h.
1665 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1666 * intervals.c: Adjust comment.
1667
1668 2012-08-10 Eli Zaretskii <eliz@gnu.org>
1669
1670 * w32fns.c <w32_unicode_gui>: New static variable.
1671 (globals_of_w32fns): Initialize it according to os_subtype.
1672 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1673 testing os_subtype.
1674
1675 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
1676 Eli Zaretskii <eliz@gnu.org>
1677
1678 Fix bug #10299 with Unicode characters sent by customized
1679 keyboards created by MSKLC.
1680 * w32fns.c (INIT_WINDOW_CLASS): New macro.
1681 (w32_init_class): Use it to initialize the Emacs class with either
1682 ANSI or Unicode API calls.
1683 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1684 later.
1685 (w32_wnd_proc): If the character code sent by WM_CHAR or
1686 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1687 original message. Call DefWindowProcW on NT and later.
1688
1689 2012-08-10 Glenn Morris <rgm@gnu.org>
1690
1691 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1692
1693 * lisp.h (DIRECTORY_SEP): Let configure set it.
1694
1695 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1696
1697 Use TSET for write access to Lisp_Object slots of struct terminal.
1698 * termhooks.h (TSET): New macro.
1699 * coding.c, terminal.c, xselect.c: Adjust users.
1700
1701 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1702
1703 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1704 the failing expression, include them in the error message.
1705 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1706 * lisp.h (internal_condition_case_n): Update declaration.
1707
1708 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1709
1710 Inline functions to examine and change buffer overlays.
1711 * buffer.c (unchain_both): New function.
1712 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1713 (buffer_has_overlays): New function.
1714 (enum overlay_type): New enum.
1715 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1716 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1717
1718 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1719
1720 Inline functions to examine and change buffer intervals.
1721 * alloc.c (mark_interval_tree): Remove.
1722 (MARK_INTERVAL_TREE): Simplify.
1723 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1724 * intervals.c (buffer_balance_intervals): New function.
1725 (graft_intervals_into_buffer): Adjust indentation.
1726 (set_intervals_multibyte): Simplify.
1727 * buffer.h (BUF_INTERVALS): Remove.
1728 (buffer_get_intervals, buffer_set_intervals): New function.
1729 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1730 * intervals.c, textprop.c: Adjust users.
1731
1732 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1733
1734 Inline functions to examine and change string intervals.
1735 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1736 (string_get_intervals, string_set_intervals): New function.
1737 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1738 * lread.c, print.c, textprop.c: Adjust users.
1739
1740 2012-08-08 Glenn Morris <rgm@gnu.org>
1741
1742 * lisp.mk (lisp): Remove language/persian.elc.
1743
1744 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1745
1746 Cleanup intervals.
1747 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1748 (NULL_INTERVAL_P): Likewise. Adjust users.
1749 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1750 Adjust comment. Move under #if 0.
1751 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1752 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1753
1754 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1755
1756 Check total length of intervals with eassert.
1757 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1758 * intervals.c: Change all users to eassert.
1759
1760 2012-08-07 Eli Zaretskii <eliz@gnu.org>
1761
1762 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1763 Rename fields to match removal of FGET and WGET and disuse of
1764 INTERNAL_FIELD in Lisp_Cons.
1765
1766 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1767
1768 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1769 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1770 name since all xname users are fixed long time ago. Do not
1771 use INTERNAL_FIELD.
1772 (set_symbol_name, set_symbol_function, set_symbol_plist):
1773 (set_symbol_next, set_overlay_plist): New function.
1774 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1775 (struct Lisp_Overlay): Likewise.
1776 (CVAR, MVAR, SVAR): Remove.
1777 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1778 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1779 * xterm.c: Adjust users.
1780 * .gdbinit: Change to use name field of struct Lisp_Symbol
1781 where appropriate.
1782
1783 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1784
1785 Basic functions to set Lisp_Object and pointer slots of intervals.
1786 * intervals.h (interval_set_parent, interval_set_object):
1787 (interval_set_left, interval_set_right, interval_set_plist):
1788 (interval_copy_parent): New function.
1789 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
1790 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1791 Adjust indentation.
1792 (INTERVAL_SIZE): Remove. Adjust users.
1793 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1794
1795 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1796
1797 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1798 * process.h (PGET): Remove.
1799 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1800 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1801
1802 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1803
1804 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1805 * window.h (WGET): Remove.
1806 (struct window): Do not use INTERNAL_FIELD.
1807 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1808 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1809 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1810 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1811 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1812 Adjust users.
1813
1814 2012-08-07 Chong Yidong <cyd@gnu.org>
1815
1816 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1817 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1818 (Fdelete_window_internal): Signal an error if the window is not on
1819 a live frame (Bug#12025).
1820
1821 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1822
1823 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1824 * frame.h (FGET): Remove.
1825 (struct frame): Do not use INTERNAL_FIELD.
1826 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1827 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1828 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1829 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1830
1831 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
1832
1833 * w32.c: Silence compiler warnings.
1834 (map_w32_filename): Remove unused variable `is_fat'.
1835 (chase_symlinks): Add parentheses around expression.
1836
1837 2012-08-06 Glenn Morris <rgm@gnu.org>
1838
1839 * sysdep.c: Respect BROKEN_GETWD.
1840
1841 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1842 Let configure handle it.
1843 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1844
1845 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1846
1847 Use GCALIGNMENT where appropriate.
1848 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1849 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1850 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1851
1852 2012-08-06 Eli Zaretskii <eliz@gnu.org>
1853
1854 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1855 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
1856
1857 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1858
1859 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1860 that should be sufficient for everyone.
1861
1862 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1863
1864 * keyboard.c (timer_check_2): Add break so timer_check returns next
1865 timeout.
1866
1867 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1868
1869 Fix Windows build errors introduced after converting to WGET and WSET.
1870 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1871 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1872
1873 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1874
1875 * nsterm.m (ns_frame_rehighlight): Use FSET.
1876
1877 * nsmenu.m (ns_update_menubar): Use FSET.
1878
1879 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1880
1881 Separate read and write access to Lisp_Object slots of Lisp_Process.
1882 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1883 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1884
1885 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1886
1887 Separate read and write access to Lisp_Object slots of struct window.
1888 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1889 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1890 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1891 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1892 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1893 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1894 Adjust users.
1895
1896 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1897
1898 Fix Windows build errors introduced after converting to FGET and FSET.
1899 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1900 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1901 (w32_judge_scroll_bars): Change to use FSET.
1902 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1903
1904 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1905
1906 Fix replacement typo.
1907 * window.c (replace_window): Set root_window instead of
1908 selected_window. This fixes a total window subsystem
1909 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1910
1911 2012-08-06 Glenn Morris <rgm@gnu.org>
1912
1913 * lisp.mk (lisp): Add language/persian.elc.
1914
1915 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1916
1917 Separate read and write access to Lisp_Object slots of struct frame.
1918 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1919 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1920 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1921 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1922 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1923
1924 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1925
1926 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1927
1928 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1929
1930 Generalize common compile-time constants.
1931 * lisp.h (header_size, bool_header_size, word_size): Now here.
1932 (struct Lisp_Vector): Add comment.
1933 (struct Lisp_Bool_Vector): Move up to define handy constants.
1934 (VECSIZE, PSEUDOVECSIZE): Simplify.
1935 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1936 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1937 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1938 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1939 * xfont.c, xmenu.c: Use word_size where appropriate.
1940
1941 2012-08-05 Lawrence Mitchell <wence@gmx.li>
1942
1943 * search.c (Freplace_match): Treat \? in the replacement text
1944 literally (Bug#8161).
1945
1946 2012-08-05 Chong Yidong <cyd@gnu.org>
1947
1948 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1949 * frame.c (Vdelete_frame_functions):
1950 * emacs.c (Vkill_emacs_hook): Doc fix.
1951
1952 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1953
1954 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1955 --with-x-toolkit=no builds.
1956 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1957
1958 2012-08-04 Chong Yidong <cyd@gnu.org>
1959
1960 * syntax.c (Fmodify_syntax_entry): Doc fix.
1961
1962 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1963
1964 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1965 * w32.c (init_environment): Change the default values of many
1966 environment variables in dflt_envvars[] to NULL, to avoid pushing
1967 them into environment when they were not already defined.
1968 Remove the code that deletes site-lisp subdirectories from the default
1969 value of EMACSLOADPATH, as it is no longer needed.
1970 (check_windows_init_file): Now external, not static.
1971 Use Vload_path as is, without adding anything, as this function is now
1972 called when Vload_path is already set up.
1973
1974 * w32.h (check_windows_init_file): Add prototype.
1975
1976 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1977 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1978 compatibility with Posix platforms.
1979 (main): Move the call to check_windows_init_file to here from
1980 w32.c.
1981 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1982 any, in the DEFALT argument into the root of the Emacs build or
1983 installation tree, as appropriate.
1984
1985 * callproc.c (init_callproc_1): Call decode_env_path instead of
1986 doing its equivalent by hand.
1987 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1988 the code that sets Vexec_path run on MS-Windows.
1989
1990 * lread.c (init_lread): Add comments to #ifdef's.
1991
1992 * msdos.c (dos_set_window_size, IT_update_begin)
1993 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1994 instead of direct references.
1995
1996 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1997
1998 Export DEFAULT_REHASH_* to GDB.
1999 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2000 Now constants, not macros.
2001
2002 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2003
2004 Remove unnecessary casts involving pointers.
2005 These casts are no longer needed now that we assume C89 or later,
2006 since they involve casting to or from void *.
2007 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2008 (make_pure_float, make_pure_vector):
2009 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2010 * macros.c (Fstart_kbd_macro):
2011 * menu.c (find_and_return_menu_selection):
2012 * minibuf.c (read_minibuf_noninteractive):
2013 * sysdep.c (closedir):
2014 * xdisp.c (x_produce_glyphs):
2015 * xfaces.c (compare_fonts_by_sort_order):
2016 * xfns.c (x_real_positions, select_visual):
2017 * xselect.c (x_stop_queuing_selection_requests)
2018 (x_get_window_property, x_get_window_property_as_lisp_data):
2019 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2020 Remove unnecessary pointer casts.
2021 * alloc.c (record_xmalloc): New function.
2022 * lisp.h (record_xmalloc): New decl.
2023 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2024 more like a function. This is because the pointer cast is not
2025 needed. All uses changed.
2026 * print.c (print_string, print_error_message): Avoid length recalc.
2027
2028 Improve fix for macroexp crash with debugging (Bug#12118).
2029 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2030 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2031 not supposed to be invoked from the garbage collector.
2032 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2033 (gc_aset): New function, which is like ASET but can be
2034 used in the garbage collector.
2035 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2036 (set_hash_index): Use it instead of ASET.
2037
2038 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2039
2040 Support symlinks on latest versions of MS-Windows.
2041 * w32.c: Include winioctl.h and aclapi.h.
2042 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2043 (revert_to_self): Forward declarations of static functions.
2044 <static BOOL g_b_init_get_security_info>:
2045 <g_b_init_create_symbolic_link>: New static flags.
2046 (globals_of_w32): Initialize them to zero.
2047 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2048 (map_w32_filename): Improve commentary. Simplify switch.
2049 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2050 headers (most versions of MinGW w32api don't).
2051 (get_security_info, create_symbolic_link)
2052 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2053 New functions.
2054 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2055 in the argument file name.
2056 (sys_access): Call unc_volume_file_attributes only if
2057 GetFileAttributes fails with network-related error codes.
2058 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2059 have the required privileges.
2060 (get_file_security_desc_by_name): Rename from
2061 get_file_security_desc.
2062 (stat_worker): New function, with most of the guts of 'stat', and
2063 with addition of handling of symlinks and support for 'lstat'.
2064 If possible, get file's attributes and security information by
2065 handle, not by name. Produce S_IFLNK bit for symlinks, when
2066 called from 'lstat'.
2067 (stat, lstat): New functions, call 'stat_worker'.
2068 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2069 symlinks when the underlying filesystem supports them.
2070
2071 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2072
2073 Fix macroexp crash on Windows with debugging (Bug#12118).
2074 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2075 checking subscripts; problem introduced with the recent
2076 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2077 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2078 since it's used in non-static inline functions now.
2079
2080 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2081 Don't assume buffer size fits in 'int'. Remove unused local.
2082
2083 Use C99-style 'extern inline' if available.
2084 * buffer.h (BUFFER_INLINE):
2085 * category.h (CATEGORY_INLINE):
2086 * character.h (CHARACTER_INLINE):
2087 * charset.h (CHARSET_INLINE):
2088 * composite.h (COMPOSITE_INLINE):
2089 * dispextern.h (DISPEXTERN_INLINE):
2090 * lisp.h (LISP_INLINE):
2091 * systime.h (SYSTIME_INLINE):
2092 New macro, replacing 'static inline' in this header.
2093 * buffer.h, category.h, character.h, charset.h, composite.h:
2094 * dispextern.h, lisp.h, systime.h:
2095 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2096 * alloc.c (LISP_INLINE):
2097 * buffer.c (BUFFER_INLINE):
2098 * category.c (CATEGORY_INLINE):
2099 * character.c (CHARACTER_INLINE):
2100 * charset.c (CHARSET_INLINE):
2101 * composite.c (COMPOSITE_INLINE):
2102 * dispnew.c (DISPEXTERN_INLINE):
2103 * sysdep.c (SYSTIME_INLINE):
2104 Define to EXTERN_INLINE, so that the corresponding functions
2105 are compiled into code.
2106 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2107 (INLINE_HEADER_END): New macros.
2108 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2109 since it's used in non-static inline functions now.
2110 (VALMASK) [!USE_LSB_TAG]: Likewise.
2111
2112 2012-08-02 Glenn Morris <rgm@gnu.org>
2113
2114 * s/: Remove empty directory.
2115
2116 * s/ms-w32.h: Move to ../nt/inc.
2117 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2118 Update for new ms-w32.h location.
2119
2120 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2121
2122 Port to Solaris 8.
2123 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2124
2125 2012-08-02 Glenn Morris <rgm@gnu.org>
2126
2127 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2128 hard-coding the path separator.
2129
2130 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2131
2132 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2133 This how ASET and AREF are supposed to work, and makes
2134 it easier to think about future improvements. See
2135 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2136 * charset.h (set_charset_attr): New function.
2137 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2138 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2139 (aref_addr): New function. All uses of &AREF(...) changed.
2140 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2141 (set_hash_index): New functions. All lvalue-style uses of
2142 HASH_KEY etc. changed.
2143 * keyboard.c (set_prop): New function. All lvalue-style uses
2144 of PROP changed.
2145
2146 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2147
2148 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2149 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2150 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2151 * nsfns.m (ns_set_name_as_filename): Likewise.
2152 * nsmenu.m (ns_update_menubar): Likewise.
2153 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2154
2155 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2156
2157 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2158 Adapt to latest changes in field names of the corresponding Lisp
2159 objects.
2160
2161 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2162
2163 2012-08-01 Glenn Morris <rgm@gnu.org>
2164
2165 * s/msdos.h: Remove file.
2166 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2167 * Makefile.in (S_FILE): Remove.
2168 (config_h): Remove S_FILE.
2169
2170 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2171
2172 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2173 Remove; moved to nt/config.nt.
2174
2175 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2176
2177 Use INTERNAL_FIELD for conses and overlays.
2178 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2179 Remove obsolete comment.
2180 (MVAR): New macro.
2181 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2182 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2183
2184 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2185
2186 Use INTERNAL_FIELD for symbols.
2187 * lisp.h (SVAR): New macro. Adjust users.
2188 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2189 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2190
2191 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2192
2193 Use INTERNAL_FIELD for processes.
2194 * process.h (PVAR): New macro. Adjust style.
2195 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2196 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2197
2198 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2199
2200 Use INTERNAL_FIELD for windows.
2201 * window.h (WVAR): New macro.
2202 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2203 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2204 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2205 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2206 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2207 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2208
2209 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2210
2211 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2212
2213 2012-08-01 Glenn Morris <rgm@gnu.org>
2214
2215 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2216 Move to configure.ac.
2217
2218 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2219
2220 * makefile.w32-in (CONFIG_H): Update dependencies.
2221 (CONF_POST_H): New macro.
2222
2223 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2224
2225 2012-07-31 Glenn Morris <rgm@gnu.org>
2226
2227 * Makefile.in (S_FILE): No longer set by configure.
2228
2229 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2230 is available.
2231 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2232
2233 * process.h (NULL_DEVICE):
2234 * emacs.c (SEPCHAR):
2235 * editfns.c (USER_FULL_NAME): Let configure set them.
2236
2237 * s/README, s/template.h: Remove files.
2238
2239 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2240
2241 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2242 Move to configure.ac.
2243
2244 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2245
2246 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2247 resulting renaming of 'struct frame' members.
2248
2249 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2250
2251 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2252 after introduction of FVAR.
2253
2254 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2255
2256 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2257
2258 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2259 instead of compositeToPoint.
2260 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2261
2262 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2263
2264 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2265
2266 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2267 * lisp.h (INTERNAL_FIELD): New macro.
2268 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2269 (BVAR): Change to use INTERNAL_FIELD.
2270 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2271 (KVAR): Change to use INTERNAL_FIELD.
2272 * frame.h (FVAR): New macro.
2273 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2274 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2275 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2276 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2277 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2278
2279 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2280
2281 Miscellaneous fixes for non-default X toolkits.
2282 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2283 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2284 Move under #ifdef USE_LUCID.
2285 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2286 definition and usage to avoid warnings.
2287
2288 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2289
2290 * nsterm.m (openFiles): Fix previous checkin.
2291
2292 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2293
2294 * indent.c (compute_motion): Remove unused local.
2295
2296 2012-07-31 Glenn Morris <rgm@gnu.org>
2297
2298 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2299
2300 * conf_post.h [USG5_4]:
2301 Move remaining contents of s/usg5-4-common.h here.
2302 * s/usg5-4-common.h: Remove file.
2303
2304 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2305 * s/irix6-5.h: Remove file.
2306
2307 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2308 * s/darwin.h: Remove file.
2309
2310 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2311 * s/hpux10-20.h: Remove file, which is now empty.
2312
2313 2012-07-30 Glenn Morris <rgm@gnu.org>
2314
2315 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2316 * Makefile.in (config_h): Add conf_post.h.
2317 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2318
2319 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2320
2321 * nsterm.m (ns_do_open_file): New variable.
2322 (ns_term_init): Set ns_do_open_file to YES after run returns.
2323 (openFile, openTempFile, openFileWithoutUI, openFiles):
2324 Open files only if ns_do_open_file.
2325
2326 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2327
2328 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2329 This no-op macro hasn't been needed for many years.
2330 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2331
2332 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2333 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2334 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2335 gdb_make_enums_visible.
2336 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2337 (DIRECTORY_SEP): Now a constant, not a macro.
2338
2339 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2340
2341 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2342 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2343
2344 * w32term.c <w32_keyboard_codepage>: Renamed from
2345 keyboard_codepage and now external. All users changed.
2346
2347 * w32term.h: Add declaration of w32_keyboard_codepage.
2348
2349 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2350 the codepage to translate keys to Unicode. If this argument is
2351 -1, use the value returned by GetConsoleCP. All callers changed.
2352
2353 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2354
2355 Update .PHONY listings in makefiles.
2356 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2357 bootstrap-clean, distclean, maintainer-clean, versioclean,
2358 extraclean, frc.
2359
2360 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2361 This is a bit clearer. Fix some commentary typos.
2362
2363 2012-07-30 Glenn Morris <rgm@gnu.org>
2364
2365 * s/netbsd.h: Let configure include signal.h if needed.
2366 Remove file, which is now empty.
2367
2368 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2369 Let configure set them.
2370 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2371 No more need to undefine.
2372
2373 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2374
2375 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2376 non-single-byte char when adding meta modifier. (Bug#12090)
2377
2378 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2379
2380 Convert safe_call to use variable number of arguments.
2381 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2382 (safe_call2): Fix comment.
2383 * lisp.h (safe_call): Adjust prototype.
2384 * coding.c (encode_coding_object): Change to use safe_call2.
2385 * xfaces.c (merge_face_heights): Change to use safe_call1.
2386
2387 2012-07-30 Glenn Morris <rgm@gnu.org>
2388
2389 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2390 does that unconditionally. Remove file, which is now empty.
2391
2392 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2393 Remove empty files.
2394
2395 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2396
2397 Export to GDB most of lisp.h's remaining object-like macros.
2398 * lisp.h (min, max): Move earlier, because they're used earlier now.
2399 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2400 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2401 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2402 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2403 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2404 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2405 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2406 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2407 Now constants, for GDB. They need not be macros.
2408 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2409 Now constants, for GDB, as well as macros, for static initializers.
2410 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2411 Move to after the definition of struct Lisp_Char_Table,
2412 since the former now needs that type defined.
2413 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2414 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2415 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2416 New enums, for gdb_make_enums_visible.
2417 (GLYPH_MODE_LINE_FACE): Remove; unused.
2418 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2419 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2420 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2421 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2422 enum maxargs, enum MAX_ALLOCA.
2423 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2424 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2425 no longer needed, now that they are done in lisp.h.
2426
2427 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2428
2429 Cleanup string bytes checking.
2430 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2431 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2432 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2433 (check_sblock, compact_small_strings): Simplify.
2434
2435 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2436
2437 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2438 These macros are confusing and no longer need to be defined, as
2439 the enum values now suffice. All uses replaced with definiens.
2440 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2441
2442 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
2443
2444 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2445 ($(BLD)/w32console.$(O)): Update dependencies.
2446
2447 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2448
2449 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2450 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2451 time. Adjust users.
2452 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2453
2454 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2455
2456 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2457 setting sitelisp (Bug#12010).
2458
2459 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2460
2461 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2462
2463 * w32heap.c (cache_system_info):
2464 * w32.c (sys_rename):
2465 * w32proc.c (find_child_console, sys_kill): All users changed.
2466
2467 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2468
2469 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2470
2471 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2472
2473 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2474
2475 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2476
2477 Cleanup statistics calculation in Fgarbage_collect.
2478 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2479 Fix zombies percentage calculation. Simplify elapsed time calculation.
2480
2481 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2482
2483 Generalize marker debugging code under MARKER_DEBUG and use eassert.
2484 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2485 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2486 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2487 (replace_range, replace_range_2, del_range_2): Change to eassert.
2488 * marker.c (byte_char_debug_check): Adjust style.
2489
2490 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2491
2492 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2493 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2494 long-ago-commented-out code that talks about "WIN32".
2495 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2496 All uses changed.
2497
2498 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2499
2500 Use Gnulib stdalign module (Bug#9772, Bug#9960).
2501 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2502 Simplify by using alignof.
2503 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2504 * lisp.h: Include <stdalign.h>.
2505 (GCALIGNMENT): New macro and constant.
2506 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
2507 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2508 (stdalign): New macro, if not already defined.
2509
2510 2012-07-28 Eli Zaretskii <eliz@gnu.org>
2511
2512 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
2513 * w32inevt.c: Include w32inevt.h.
2514 (w32_read_console_input): New inline function, calls either
2515 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2516 w32_console_unicode_input.
2517 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2518 (w32_kbd_patch_key, key_event): Use the codepage returned by
2519 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2520 (key_event): use uChar.UnicodeChar only if
2521 w32_console_unicode_input is non-zero.
2522
2523 * w32console.c: Include w32heap.h.
2524 <w32_console_unicode_input>: New global variable.
2525 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2526 family of Windows, zero otherwise.
2527
2528 * w32inevt.h: Declare w32_console_unicode_input.
2529
2530 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2531 --without-x. (Bug#11742)
2532
2533 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2534
2535 Adjust GDB to reflect pvec_type changes (Bug#12036).
2536 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
2537 2012-07-04 changes to pseudovector representation.
2538 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
2539
2540 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
2541
2542 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2543 bus address.
2544 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2545
2546 2012-07-27 Eli Zaretskii <eliz@gnu.org>
2547
2548 * alloc.c (listn): Fix the order the arguments are consed onto the
2549 list.
2550
2551 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2552 enumeration constants, as PURE and HEAP are too general, and clash
2553 with other headers and sources, such as gmalloc.c and the
2554 MS-Windows system headers. All users changed.
2555
2556 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2557
2558 Revert last save_excursion_save and save_excursion_restore changes.
2559 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2560 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2561
2562 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2563
2564 Fix recently-introduced typos in Windows port.
2565 Reported by Martin Rudalics <rudalics@gmx.at>.
2566 * w32.c (init_environment): Replace comma with semicolon.
2567 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
2568
2569 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2570
2571 Improve GDB symbol export (Bug#12036).
2572 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2573 arms of an 'if', not using conditional expressions; otherwise GDB
2574 complains about the types in the unevaluated arm when the argument
2575 is an integer literal.
2576 (xgetint): Simplify expression.
2577 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2578 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2579 Zaretskii in <http://bugs.gnu.org/12036#13>.
2580 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2581 needed now that we have gdb_make_enums_visible.
2582 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2583 (enum enum_USE_LSB_TAG):
2584 New enum types, packaging up enums that need to be exported to GDB.
2585
2586 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2587
2588 Utility function to make a list from specified amount of objects.
2589 * lisp.h (enum constype): New datatype.
2590 (listn): New prototype.
2591 * alloc.c (listn): New function.
2592 (Fmemory_use_count, syms_of_alloc): Use it.
2593 * buffer.c (syms_of_buffer): Likewise.
2594 * callint.c (syms_of_callint): Likewise.
2595 * charset.c (define_charset_internal): Likewise.
2596 * coding.c (syms_of_coding): Likewise.
2597 * keymap.c (syms_of_keymap): Likewise.
2598 * search.c (syms_of_search): Likewise.
2599 * syntax.c (syms_of_syntax): Likewise.
2600 * w32.c (init_environment): Likewise.
2601 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2602 * xdisp.c (syms_of_xdisp): Likewise.
2603 * xfns.c (syms_of_xfns): Likewise.
2604
2605 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2606
2607 Fast save_excursion_save and save_excursion_restore.
2608 * lisp.h (struct Lisp_Excursion): New data type.
2609 (PVEC_EXCURSION): New pseudovector type.
2610 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2611 to deal with it. Adjust comments.
2612 (init_marker, attach_marker): New prototype.
2613 (unchain_marker): Adjust prototype.
2614 * marker.c (attach_marker): Change to global.
2615 (init_marker): New function.
2616 * alloc.c (Fmake_marker, build_marker): Use it.
2617 (build_marker): More easserts.
2618 (mark_object): Handle struct Lisp_Excursion.
2619 * editfns.c (save_excursion_save, save_excursion_restore):
2620 Reimplement to use struct Lisp_Excursion. Add comments.
2621
2622 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2623
2624 Fix export of symbols to GDB (Bug#12036).
2625 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
2626 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2627 emacs.c, as this is a more-suitable home. Had this been done earlier
2628 the fix for 12036 would have avoided some of the problems noted in
2629 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2630 would have been more obvious.
2631 * emacs.c: Do not include <verify.h>; no longer needed.
2632 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
2633 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2634 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2635 Remove; now done in lisp.h.
2636 * lisp.h (PUBLISH_TO_GDB): New macro.
2637 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2638 (DATA_SEG_BITS): Use it.
2639 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2640 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2641 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2642 not be usable in #if. This simplifies things.
2643
2644 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
2645
2646 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2647
2648 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2649
2650 Simplify export of symbols to GDB (Bug#12036).
2651 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2652 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2653 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2654 Adjust to changes in lisp.h and emacs.c, by using
2655 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2656 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2657 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2658 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2659 instead of gdb_valbits.
2660 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2661 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2662 instead of gdb_array_mark_flag.
2663 (xboolvector): Get size from $->size, not $->header.size.
2664 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2665 (xreload, hook-run, hookpost-run): Remove.
2666 * emacs.c: Include <verify.h>.
2667 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2668 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2669 Remove.
2670 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2671 (gdb_USE_LSB_TAG): New enum constants.
2672 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2673 Also define these as enum constants, so they're visible to GDB.
2674 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2675 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2676 as constants, so they're visible to GDB.
2677 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2678 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2679 Now enum constants, not macros, so they're visible to GDB.
2680 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2681 more convenient now. All uses changed.
2682 (VALMASK) [USE_LSB_TAG]: Also define in this case.
2683 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2684
2685 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2686
2687 Explicitly free restriction data that are not needed anymore.
2688 * editfns.c (save_restriction_restore): Free restriction data.
2689
2690 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2691
2692 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2693 add argument, tune behavior, and adjust all callers.
2694
2695 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2696
2697 Use typedef for EMACS_INT, EMACS_UINT.
2698 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2699 than macros. This simplifies debugging in the usual case, since
2700 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2701 and it allows expressions involving EMACS_INT casts.
2702 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2703
2704 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2705
2706 * nsterm.m (ns_read_socket): Return early if there is a modal
2707 window (Bug#12043).
2708
2709 2012-07-25 Martin Rudalics <rudalics@gmx.at>
2710
2711 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2712 that FOCUS-FRAME can be omitted.
2713
2714 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2715
2716 Adjust buffer text indirection counters at the end of Fkill_buffer.
2717 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2718 buffer is definitely dead. This should really fix an issue reported
2719 by Christoph Scholtes again. (Bug#12007).
2720 (init_buffer_once): Initialize indirection counters of
2721 buffer_defaults and buffer_local_symbols (for sanity and safety).
2722
2723 2012-07-24 Eli Zaretskii <eliz@gnu.org>
2724
2725 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2726 and continuation glyphs on tooltip frames, leave them at zero.
2727 Avoids continued lines in tooltips. (Bug#11832)
2728
2729 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2730
2731 Simplify copy_overlay.
2732 * buffer.c (copy_overlay): Simplify. Use build_marker.
2733 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2734
2735 2012-07-23 Eli Zaretskii <eliz@gnu.org>
2736
2737 * print.c (print_object): Don't crash when a frame's name is nil
2738 or invalid. (Bug#12025)
2739
2740 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2741 it signals an error when a tooltip frame is being created.
2742
2743 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2744
2745 Cleanup miscellaneous objects allocation and initialization.
2746 * alloc.c (allocate_misc): Change to static. Add argument to
2747 specify the subtype. Adjust comment and users.
2748 (build_overlay): New function.
2749 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2750 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2751 (allocate_misc): Remove prototype.
2752 (build_overlay): Add prototype.
2753
2754 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2755
2756 Swap buffer text indirection counters in Fbuffer_swap_text.
2757 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2758 This avoids crash reported by Christoph Scholtes at
2759 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2760
2761 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2762
2763 * nsmenu.m (Popdown_data): New struct.
2764 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2765 free Popdown_data.
2766 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2767 (initWithContentRect): Make imgView and contentView non-static
2768 and autorelease them. Also autorelease img and matrix (Bug#12005).
2769 (dealloc): Remove (Bug#12005).
2770
2771 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2772
2773 Adjust consing_since_gc when objects are explicitly freed.
2774 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2775 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2776 (free_cons, free_misc): Subtract object size from consing_since_gc.
2777
2778 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2779
2780 Simplify and cleanup markers positioning code.
2781 * marker.c (attach_marker): More useful eassert.
2782 (live_buffer, set_marker_internal): New function.
2783 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2784 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2785
2786 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2787
2788 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2789 as it's limited by the amount of memory, not by INT_MAX.
2790
2791 2012-07-21 Eli Zaretskii <eliz@gnu.org>
2792
2793 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2794 in special-event-map. See the discussion at
2795 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2796 for the reasons.
2797
2798 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2799 info.dwItemData. Fixes crashes on 64-bit Windows.
2800 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2801
2802 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2803
2804 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
2805 (conversationIdentifier): Return value is NSInteger.
2806 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
2807
2808 2012-07-21 Chong Yidong <cyd@gnu.org>
2809
2810 * window.c (decode_any_window): Signal an error if the window is
2811 on a dead frame (Bug#11984).
2812
2813 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2814
2815 Add indirection counting to speed up Fkill_buffer.
2816 * buffer.h (struct buffer): New member.
2817 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2818 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2819 base buffer indirection counter.
2820 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2821 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2822 through buffer list if indirection counter is 0.
2823
2824 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2825
2826 Extend the value returned by Fgarbage_collect with heap statistics.
2827 * alloc.c (Qheap): New symbol.
2828 (syms_of_alloc): DEFSYM it.
2829 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2830 (Fmemory_free): Remove.
2831 (syms_of_alloc): Don't defsubr it.
2832 * buffer.c (Fcompact_buffer): Remove.
2833 (syms_of_buffer): Don't defsubr it.
2834
2835 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2836
2837 Make maybe_gc inline.
2838 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2839 * lisp.h (consing_since_gc, gc_relative_threshold)
2840 (memory_full_cons_threshold): Revert declaration.
2841 (maybe_gc): Remove prototype, define as inline.
2842 * alloc.c: Remove old commented-out code.
2843 (consing_since_gc, gc_relative_threshold)
2844 (memory_full_cons_threshold): Revert to global.
2845 (maybe_gc): Remove.
2846
2847 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2848
2849 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2850 * lisp.h (build_unibyte_string): New function.
2851 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2852 * sysdep.c, w32fns.c, xfns.c: Use it.
2853 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2854 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2855 Adjust users accordingly.
2856 * font.h (font_open_by_name): Adjust prototype.
2857
2858 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2859
2860 Cleanup calls to Fgarbage_collect.
2861 * lisp.h (maybe_gc): New prototype.
2862 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2863 Remove declarations.
2864 * alloc.c (maybe_gc): New function.
2865 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2866 Make them static.
2867 * bytecode.c (MAYBE_GC): Use maybe_gc.
2868 * eval.c (eval_sub, Ffuncall): Likewise.
2869 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2870 to avoid dependency from auto-save feature.
2871
2872 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2873
2874 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2875 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2876 'for_each_per_buffer_object_at'.
2877 All uses changed. It's better to use upper-case for macros that
2878 cannot be implemented as functions, to give the reader a clue
2879 that they're special.
2880
2881 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2882
2883 * alloc.c (Fgarbage_collect): Tweak docstring.
2884
2885 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2886
2887 Tweak the value returned from Fgarbage_collect again.
2888 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2889 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2890 Adjust documentation.
2891 (total_vector_bytes): Rename to total_vector_slots, adjust
2892 accounting.
2893 (total_free_vector_bytes): Rename to total_free_vector_slots,
2894 adjust accounting.
2895 (Qstring_bytes, Qvector_slots): New symbols.
2896 (syms_of_alloc): DEFSYM them.
2897
2898 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2899
2900 Buffer compaction primitive which may be used from Lisp.
2901 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2902 (syms_of_buffer): Register Fcompact_buffer.
2903 * alloc.c (Fgarbage_collect): Use compact_buffer.
2904 * buffer.h (compact_buffer): New prototype.
2905 (struct buffer_text): New member.
2906
2907 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2908
2909 New macro to iterate over all buffers, miscellaneous cleanups.
2910 * lisp.h (all_buffers): Remove declaration.
2911 * buffer.h (all_buffers): Add declaration, with comment.
2912 (for_each_buffer): New macro.
2913 * alloc.c (Fgarbage_collect, mark_object): Use it.
2914 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2915 (init_buffer): Likewise.
2916 * data.c (Fset_default): Likewise.
2917 * coding.c (code_conversion_restore): Remove redundant check
2918 for dead buffer.
2919 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2920
2921 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2922
2923 Fix bug that created negative-length intervals.
2924 * intervals.c (merge_interval_right, merge_interval_left):
2925 Do not zero out this interval if it is absorbed by its children,
2926 as this interval's total length doesn't change in that case. See
2927 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2928
2929 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2930
2931 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2932 when invoking (make-bool-vector N t) and N is a positive
2933 multiple of 8 -- the last 8 bits were mistakenly cleared.
2934
2935 Remove some struct layout assumptions in bool vectors.
2936 * alloc.c (bool_header_size): New constant.
2937 (header_size, word_size): Move earlier, as they're now used earlier.
2938 Use 'word_size' in a few more places, where it's appropriate.
2939 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2940 padding before the data member of a bool vector.
2941 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2942 than doing the check by hand with an abort ().
2943
2944 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2945
2946 * eval.c (Fdefvar): Don't check constants since we only set the var if
2947 it's not yet defined anyway (bug#11904).
2948
2949 * lisp.h (last_undo_boundary): Declare new var.
2950 * keyboard.c (command_loop_1): Set it.
2951 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2952 were auto-added by the command loop (bug#11774).
2953
2954 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2955
2956 * w32font.c (Qsymbol): Remove local definition.
2957 (syms_of_w32font): Don't DEFSYM it.
2958
2959 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2960
2961 Fix sweep_vectors to handle large bool vectors correctly.
2962 * alloc.c (sweep_vectors): Account total_vector_bytes for
2963 bool vectors larger than VBLOCK_BYTES_MAX.
2964
2965 2012-07-18 Chong Yidong <cyd@gnu.org>
2966
2967 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2968 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2969
2970 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2971
2972 Return more descriptive data from Fgarbage_collect.
2973 Suggested by Stefan Monnier in
2974 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2975 * alloc.c (bounded_number): New function.
2976 (total_buffers, total_vectors): New variable.
2977 (total_string_size): Rename to total_string_bytes, adjust users.
2978 (total_vector_size): Rename to total_vector_bytes, adjust users.
2979 (sweep_vectors): Account total_vectors and total_vector_bytes.
2980 (Fgarbage_collect): New return value. Adjust documentation.
2981 (gc_sweep): Account total_buffers.
2982 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2983 (VECTOR_SIZE): Remove.
2984 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2985 (Qinterval, Qmisc): New symbols.
2986 (syms_of_data): Initialize them.
2987 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2988 (Qcons, Qbuffer): New declarations.
2989
2990 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2991
2992 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2993 Round up, not down. Improve doc.
2994
2995 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2996
2997 Restore old code in allocate_string_data to avoid Faset breakage.
2998 Reported by Julien Danjou <julien@danjou.info> in
2999 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3000 * alloc.c (allocate_string_data): Restore old code with minor
3001 adjustments, fix comment to explain this subtle issue.
3002
3003 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3004
3005 Remove FILE_SYSTEM_CASE.
3006 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3007
3008 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3009 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3010 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3011 call-process-region passes it through expand-file-name.
3012
3013 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3014
3015 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3016
3017 Fix crash when creating indirect buffer (Bug#11917)
3018 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3019 Don't handle unbound variables specially if non-zero.
3020 (Fbuffer_local_variables): Pass zero.
3021 (clone_per_buffer_values): Pass non-zero.
3022
3023 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3024
3025 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3026 to make the loop interruptible.
3027
3028 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3029
3030 * gnutls.c (emacs_gnutls_handshake): Only retry if
3031 GNUTLS_E_INTERRUPTED.
3032
3033 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3034
3035 Cleanup and convert miscellaneous checks to eassert.
3036 * alloc.c (mark_interval): Fix comment, partially rephrase
3037 old comment from intervals.h (see below).
3038 * intervals.c (find_interval, adjust_intervals_for_insertion)
3039 (delete_interval, adjust_intervals_for_deletion)
3040 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3041 Convert to eassert.
3042 (adjust_intervals_for_insertion, make_new_interval):
3043 Remove obsolete and unused code.
3044 * intervals.h (struct interval): Remove obsolete comment.
3045 * textprotp.c (erase_properties): Remove unused code.
3046 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3047 (Fremove_list_of_text_properties): Convert to eassert.
3048
3049 2012-07-17 Chong Yidong <cyd@gnu.org>
3050
3051 * editfns.c (Finsert_char): Doc fix.
3052
3053 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3054
3055 Fix previous change to make Fmemory_free always accurate.
3056 * alloc.c (make_interval): Update total_free_intervals.
3057 (make_float): Likewise for total_free_floats.
3058 (free_cons, Fcons): Likewise for total_free_conses.
3059 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3060 Likewise for total_free_vector_bytes.
3061 (Fmake_symbol): Likewise for total_free_symbols.
3062 (bytes_free): Remove.
3063
3064 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3065
3066 Simple free memory accounting feature.
3067 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3068 (sweep_vectors): Accumulate size of free vectors.
3069 (Fgarbage_collect): Setup bytes_free.
3070 (Fmemory_free): New function.
3071 (syms_of_alloc): Register it.
3072
3073 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3074
3075 Cleanup overlays checking.
3076 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3077 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3078 eassert and OVERLAYP.
3079 (sort_overlays): Change to use OVERLAYP.
3080
3081 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3082
3083 * editfns.c (Finsert_char): Make it interactive, and make the
3084 second arg optional. Copy interactive spec and docstring from
3085 ucs-insert.
3086
3087 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3088
3089 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3090 Unlike the other wrapped functions, fabs has an unspecified
3091 effect on errno.
3092
3093 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3094
3095 * nsterm.m (keyDown): Interpret flags without left/right bits
3096 as the left key (Bug#11670).
3097
3098 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3099
3100 Remove empty and useless init functions.
3101 * lisp.h (init_character_once, init_fns, init_image)
3102 (init_filelock, init_sound): Remove prototype.
3103 * character.c (init_character_once): Remove.
3104 * filelock.c (init_filelock): Likewise.
3105 * fns.c (init_fns): Likewise.
3106 * image.c (init_image): Likewise.
3107 * sound.c (init_sound): Likewise.
3108 * emacs.c (main): Adjust accordingly.
3109
3110 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3111
3112 * gtkutil.h: Tiny cleanups.
3113 (use_old_gtk_file_dialog): Remove useless declaration.
3114 (xg_uses_old_file_dialog): Add suggested const attribute.
3115
3116 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3117
3118 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3119 (bidi_paragraph_init): Use it to limit search forward for a strong
3120 directional character in abnormally large paragraphs full of
3121 neutral or weak characters. (Bug#11943)
3122
3123 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3124
3125 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3126 the toolbar (Bug#9451).
3127 (xg_make_tool_item): Give the widget event box a transparent
3128 background.
3129
3130 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3131
3132 Cleanup basic allocation variables and functions.
3133 * alloc.c (ignore_warnings, init_intervals, init_float)
3134 (init_cons, init_symbol, init_marker): Remove.
3135 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3136 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3137 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3138 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3139 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3140 (staticidx, init_alloc_once, init_strings, free_ablock):
3141 Remove redundant initialization.
3142 * fns.c (init_weak_hash_tables): Remove.
3143 * lisp.h (init_weak_hash_tables): Remove prototype.
3144
3145 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3146
3147 Use zero_vector where appropriate.
3148 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3149 accordingly.
3150 * lisp.h (zero_vector): New declaration.
3151 * font.c (null_vector): Remove.
3152 (syms_of_font): Remove initialization and staticpro.
3153 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3154 * keymap.c (Faccessible_keymaps): Likewise.
3155
3156 2012-07-15 Leo Liu <sdl.web@gmail.com>
3157
3158 * fringe.c: Fix typo in comments.
3159
3160 2012-07-14 Leo Liu <sdl.web@gmail.com>
3161
3162 * fringe.c: Add a new bitmap exclamation-mark.
3163
3164 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3165
3166 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3167
3168 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3169 (HAVE_MENUS): Don't define, defined by editing config.in with
3170 msdos/sed2v2.inp.
3171 (GMALLOC_INHIBIT_VALLOC): Don't define.
3172 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3173
3174 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3175
3176 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3177
3178 2012-07-14 Glenn Morris <rgm@gnu.org>
3179
3180 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3181 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3182 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3183
3184 2012-07-13 Glenn Morris <rgm@gnu.org>
3185
3186 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3187
3188 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3189 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3190
3191 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3192
3193 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3194 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3195 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3196 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3197 where appropriate.
3198 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3199 as boolean expression.
3200 (x_set_window_size): Remove unused variable toolbar.
3201 (ns_get_color_default, ns_mod_to_lisp): Remove.
3202 (ns_mouse_position): Remove unused variables xchar and ychar.
3203 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3204 (ns_set_vertical_scroll_bar): Remove unused variable count.
3205 (ns_delete_terminal): Remove unused variable i.
3206 (ns_term_init): Remove unused variables r, g and b.
3207 (mouseDown): Remove unused variable window.
3208 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3209 (initFrameFromEmacs): Remove unused variable vbextra.
3210 (mouseEntered): Remove unused variables p and dpyinfo.
3211 (mouseExited): Remove unused variables p and r.
3212 (ns_define_frame_cursor, ns_clear_frame_area)
3213 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3214 (menuDown): Assign [sender tag] to variable and cast the variable.
3215
3216 * nsterm.h (menuDown): Add id as type to argument sender.
3217 (ns_display_info_for_name): Add Lisp_Object argument.
3218 (ns_term_init): Add Lisp_Object argument.
3219 (ns_map_event_to_object): Add void argument.
3220 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3221 prototype with arguments and only declare if __OBJC__.
3222 (nxatoms_of_nsselect): Add void argument.
3223 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3224 (ns_alloc_autorelease_pool): Add void argument.
3225 (ns_release_autorelease_pool): Add void* argument.
3226 (ns_get_defaults_value): Add const char* argument.
3227
3228 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3229 (initFromContents): Use SSDATA where appropriate.
3230 (ns_update_menubar): Add braces to ambigous if-else.
3231 (initWithTitle): Put () around assignment in if statement.
3232 (ns_menu_show): Remove unused variables window and keymap.
3233 (update_frame_tool_bar): Remove unused variable selected_p.
3234 (initWithContentRect): Remove unused variable this_cmd_name.
3235
3236 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3237 appropriate.
3238 (setXBMColor): Remove unused variable len.
3239 (setPixmapData): Put () around assignment in loop statement.
3240
3241 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3242 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3243 where appropriate.
3244 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3245 around assignment in loop statement.
3246 (nsfont_open): Remove unused variable i.
3247 (nsfont_open): Remove unused variable len.
3248 (nsfont_draw): Remove unused variable cs.
3249
3250 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3251 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3252 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3253 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3254 (Fns_font_name, Fns_perform_service)
3255 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3256 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3257 (ns_set_name): Remove unused variable view.
3258 (x_set_menu_bar_lines): Remove unused variable olines.
3259 (x_set_tool_bar_lines): Remove unused variable root_window.
3260 (Fns_list_colors): Put () around assignment in while statement.
3261 (Fns_perform_service): Remove unused variable len.
3262 (Fns_display_usable_bounds): Remove unused variable top.
3263 (syms_of_nsfns): Remove unused variable i.
3264
3265 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3266 memcpy (Bug#11907).
3267
3268 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3269
3270 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3271 and free it with DestroyExceptionInfo (Bug#11558).
3272
3273 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3274
3275 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3276 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3277 Set here, not in nt/config.nt.
3278
3279 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3280
3281 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3282 cursor overflow into the last glyph on display line when the right
3283 fringe is off. (Bug#11832)
3284
3285 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3286
3287 * xdisp.c (produce_special_glyphs): Now static.
3288 * dispextern.h (produce_special_glyphs): Remove decl.
3289
3290 2012-07-13 Glenn Morris <rgm@gnu.org>
3291
3292 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3293 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3294
3295 * s/usg5-4-common.h (USG, USG5):
3296 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3297 * s/sol2-6.h (SOLARIS2):
3298 * s/irix6-5.h (IRIX6_5):
3299 * s/hpux10-20.h (USG, USG5, HPUX):
3300 * s/gnu-linux.h (USG, GNU_LINUX):
3301 * s/freebsd.h (BSD_SYSTEM):
3302 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3303 * s/cygwin.h (CYGWIN):
3304 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3305 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3306
3307 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3308
3309 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3310
3311 2012-07-13 Glenn Morris <rgm@gnu.org>
3312
3313 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3314
3315 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3316
3317 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3318 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3319
3320 2012-07-12 Glenn Morris <rgm@gnu.org>
3321
3322 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3323
3324 * process.c (init_process_emacs): Rename from init_process.
3325 The old name is also the name of a Mach system call.
3326 * lisp.h, emacs.c: Update for this name change.
3327 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3328 longer needed.
3329
3330 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3331
3332 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3333 memmove call that removes glyphs covered by the left truncation
3334 glyph. Improve commentary.
3335 (display_line): Fix display of continuation glyphs on GUI frames
3336 when the right fringe is turned off and variable-size fonts are
3337 used in the window. Move the code that appends a stretch glyph to
3338 produce_special_glyphs, so that it could be used for truncation
3339 and continuation glyphs alike.
3340 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3341 glyph of a suitably computed width, to align the special glyphs at
3342 the window margin. Code moved from display_line. (Bug#11832)
3343
3344 2012-07-12 Glenn Morris <rgm@gnu.org>
3345
3346 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3347
3348 * s/gnu-linux.h, s/hpux10-20.h:
3349 Do not unconditionally define HAVE_XRMSETDATABASE.
3350
3351 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3352
3353 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3354
3355 Fix typos that broke OS X build.
3356 Reported by Randal L. Schwartz in
3357 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3358 * nsterm.m (ns_timeout): Add missing local decl.
3359 (ns_get_color): snprintf -> sprintf, to fix typo.
3360
3361 2012-07-12 Glenn Morris <rgm@gnu.org>
3362
3363 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3364 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3365 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3366 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3367
3368 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3369 Move PTY_OPEN to configure.
3370
3371 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3372 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3373 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3374
3375 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3376
3377 Use empty_unibyte_string where applicable.
3378 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3379 * lread.c (read1): Likewise.
3380 * xsettings.c (syms_of_xsettings): Likewise.
3381
3382 2012-07-12 Glenn Morris <rgm@gnu.org>
3383
3384 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3385 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3386 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3387 * s/hpux10-20.h (RUN_TIME_REMAP):
3388 * s/bsd-common.h (TABDLY): Move to configure.
3389
3390 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3391
3392 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3393
3394 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3395 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3396
3397 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3398
3399 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3400 * s/template.h: Move NARROWPROTO to configure.
3401
3402 2012-07-11 Glenn Morris <rgm@gnu.org>
3403
3404 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3405 unused since 2011-01-17 change to systty.h.
3406
3407 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3408 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3409 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3410
3411 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3412
3413 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3414
3415 2012-07-11 Glenn Morris <rgm@gnu.org>
3416
3417 * s/darwin.h, s/gnu-linux.h, s/template.h:
3418 Move INTERRUPT_INPUT to configure.
3419
3420 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3421
3422 Minor adjustments to interning code.
3423 * lisp.h (intern, intern_c_string): Redefine as static inline
3424 wrappers for intern_1 and intern_c_string_1, respectively.
3425 (intern_1, intern_c_string_1): Rename prototypes.
3426 * lread.c (intern_1, intern_c_string_1, oblookup):
3427 Simplify Vobarray checking.
3428 * font.c (font_intern_prop): Likewise. Adjust comment.
3429 * w32font.c (intern_font_name): Likewise.
3430
3431 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3432
3433 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3434
3435 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3436 of Fcar/Fcdr if possible.
3437 * font.c (check_otf_features): Likewise.
3438 * fontset.c (Fnew_fontset): Likewise.
3439 * gnutls.c (Fgnutls_boot): Likewise.
3440 * minibuf.c (read_minibuf): Likewise.
3441 * msdos.c (IT_set_frame_parameters): Likewise.
3442 * xmenu.c (Fx_popup_dialog): Likewise.
3443 * w32menu.c (Fx_popup_dialog): Likewise.
3444
3445 2012-07-11 Glenn Morris <rgm@gnu.org>
3446
3447 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3448 since nothing has defined it on these platforms.
3449
3450 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3451 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3452
3453 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3454 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3455 Move CLASH_DETECTION to configure.
3456
3457 * s/gnu.h: Remove file, which is now empty.
3458
3459 * s/gnu.h, s/gnu-linux.h:
3460 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3461
3462 2012-07-11 John Wiegley <johnw@newartisans.com>
3463
3464 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3465 function attribute, so we only use it if it exists in the
3466 compiler.
3467
3468 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3469
3470 Avoid call to strlen in fast_c_string_match_ignore_case.
3471 * search.c (fast_c_string_match_ignore_case): Change to use
3472 length argument. Adjust users accordingly.
3473 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3474
3475 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3476
3477 Assume mkdir, rmdir.
3478 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3479 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3480
3481 Assume rename.
3482 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3483
3484 Assume perror.
3485 * s/hpux10-20.h (HAVE_PERROR): Remove.
3486 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3487 Remove dummy definition, as this problem was obsolete long ago.
3488
3489 Assume strerror.
3490 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3491
3492 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3493
3494 Avoid calls to strlen in font processing functions.
3495 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
3496 (font_open_by_name): Change to use length argument.
3497 Adjust users accordingly.
3498 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3499 Adjust prototypes.
3500 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3501 Change to return ptrdiff_t.
3502 (xfont_list_pattern, xfont_match): Use length returned by
3503 xfont_decode_coding_xlfd.
3504 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3505
3506 2012-07-11 Glenn Morris <rgm@gnu.org>
3507
3508 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3509 Move DONT_REOPEN_PTY to configure.
3510
3511 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3512 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3513
3514 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3515
3516 Remove "#define unix" that is no longer needed (Bug#11905).
3517 * s/aix4-2.h (unix): Remove; no longer needed.
3518
3519 EMACS_TIME simplification (Bug#11875).
3520 This replaces macros (which typically do not work in GDB)
3521 with functions, typedefs and enums, making the code easier to debug.
3522 The functional style also makes code easier to read and maintain.
3523 * systime.h: Include <sys/time.h> on all hosts, not just if
3524 WINDOWSNT, since 'struct timeval' is needed in general.
3525 (EMACS_TIME): Now a typedef, not a macro.
3526 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3527 not macros.
3528 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3529 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3530 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3531 (EMACS_TIME_LE): Now functions, not macros.
3532 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3533 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3534 which are not functions. All uses rewritten to use:
3535 (make_emacs_time): New function.
3536 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3537 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3538 not functions. All uses rewritten to use the following, respectively:
3539 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3540 (add_emacs_time, sub_emacs_time): New functions.
3541 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
3542 * fileio.c (Fcopy_file):
3543 * xterm.c (XTflash): Get the current time closer to when it's used.
3544 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3545
3546 * bytecode.c (targets): Suppress -Woverride-init warnings.
3547
3548 Simplify by avoiding confusing use of strncpy etc.
3549 * doc.c (Fsnarf_documentation):
3550 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3551 * frame.c (Fmake_terminal_frame):
3552 * gtkutil.c (get_utf8_string):
3553 * lread.c (openp):
3554 * nsmenu.m (ns_update_menubar):
3555 * regex.c (regerror):
3556 Prefer memcpy to strncpy and strncat when either will do.
3557 * fileio.c (Fsubstitute_in_file_name):
3558 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3559 (menu_separator_name_p):
3560 * nsmenu.m (ns_update_menubar):
3561 Prefer memcmp to strncmp when either will do.
3562 * nsterm.m: Include <ftoastr.h>.
3563 (ns_get_color):
3564 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3565 Prefer snprintf to strncpy.
3566 * nsterm.m (ns_term_init):
3567 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3568 * nsterm.m (ns_term_init):
3569 Avoid the need for strncpy, by using build_string or
3570 make_unibyte_string directly. Use dtoastr, not snprintf.
3571 * process.c (Fmake_network_process): Diagnose service names that
3572 are too long, rather than silently truncating them or creating
3573 non-null-terminated names.
3574 (Fnetwork_interface_info): Likewise, for interface names.
3575 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3576 Prefer sprintf to strncat.
3577 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3578 Prefer vsnprintf to vsprintf + strncpy.
3579
3580 2012-07-10 Glenn Morris <rgm@gnu.org>
3581
3582 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3583 Clarify fallback case.
3584
3585 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3586
3587 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3588 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3589 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
3590 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
3591 where argument type is known to be a Lisp_Cons.
3592
3593 2012-07-10 Tom Tromey <tromey@redhat.com>
3594
3595 * bytecode.c (BYTE_CODE_THREADED): New macro.
3596 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3597 (enum byte_code_op): New type.
3598 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3599 (exec_byte_code): Use them. Use token threading when applicable.
3600
3601 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3602
3603 Optimize pure C strings initialization.
3604 * lisp.h (make_pure_string): Fix prototype.
3605 (build_pure_c_string): New function, defined as static inline. This
3606 provides a better opportunity to optimize away calls to strlen when
3607 the function is called with compile-time constant argument.
3608 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
3609 argument, adjust users accordingly. Use build_pure_c_string where
3610 appropriate.
3611 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3612 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3613 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3614
3615 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3616
3617 Avoid calls to strlen in miscellaneous functions.
3618 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3619 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
3620 * lread.c (openp): Likewise.
3621
3622 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3623
3624 Avoid calls to strlen in path processing functions.
3625 * fileio.c (file_name_as_directory): Add comment. Change to add
3626 srclen argument and return the length of result. Adjust users
3627 accordingly.
3628 (directory_file_name): Fix comment. Change to add srclen argument,
3629 swap 1st and 2nd arguments to obey the common convention.
3630 Adjust users accordingly.
3631 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3632
3633 2012-07-10 Glenn Morris <rgm@gnu.org>
3634
3635 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3636 Move PENDING_OUTPUT_COUNT definition to configure.
3637
3638 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3639 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3640 * s/gnu.h (DATA_START): Move definitions to configure.
3641
3642 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3643 We include usg5-4-common.h, which defines them both.
3644
3645 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3646 O_RDONLY already includes it).
3647
3648 Stop ns builds setting the EMACSLOADPATH environment variable.
3649 * nsterm.m (ns_load_path): Rename from ns_init_paths.
3650 Now it does not set EMACSLOADPATH, just returns the load-path string.
3651 * nsterm.h: Update accordingly.
3652 * lread.c [HAVE_NS]: Include nsterm.h.
3653 (init_lread) [HAVE_NS]: Use ns_load_path.
3654 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3655
3656 2012-07-09 Glenn Morris <rgm@gnu.org>
3657
3658 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3659 since the included bsd-common.h does so.
3660
3661 Stop ns builds setting the EMACSPATH environment variable.
3662 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3663 (ns_init_paths): Do not set EMACSPATH.
3664 * nsterm.h (ns_exec_path): Add it.
3665 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3666 Use ns_exec_path.
3667
3668 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3669
3670 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3671
3672 * process.c (wait_reading_process_output): 'waitchannels' was unset
3673 when read_kbd || !NILP (wait_for_cell); fix this.
3674
3675 Add GCC-style 'const' attribute to functions that can use it.
3676 * character.h (char_resolve_modifier_mask):
3677 * keyboard.h (make_ctrl_char):
3678 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3679 (init_character_once, next_almost_prime, init_fns, init_image)
3680 (flush_pending_output, init_sound):
3681 * mem-limits.h (start_of_data):
3682 * menu.h (finish_menu_items):
3683 Add ATTRIBUTE_CONST.
3684 * emacs.c (DEFINE_DUMMY_FUNCTION):
3685 Declare the dummy function with ATTRIBUTE_CONST.
3686 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3687 Add decls with ATTRIBUTE_CONST.
3688
3689 Minor improvements to make_formatted_string.
3690 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3691 where int is good enough, as vsprintf returns an int.
3692 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3693
3694 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3695
3696 Use make_formatted_string to avoid double length calculation.
3697 * lisp.h (make_formatted_string): New prototype.
3698 * alloc.c (make_formatted_string): New function.
3699 * buffer.c (Fgenerate_new_buffer_name): Use it.
3700 * dbus.c (syms_of_dbusbind): Likewise.
3701 * editfns.c (Fcurrent_time_zone): Likewise.
3702 * filelock.c (get_boot_time): Likewise.
3703 * frame.c (make_terminal_frame, set_term_frame_name)
3704 (x_report_frame_params): Likewise.
3705 * image.c (gs_load): Likewise.
3706 * minibuf.c (get_minibuffer): Likewise.
3707 * msdos.c (dos_set_window_size): Likewise.
3708 * process.c (make_process): Likewise.
3709 * xdisp.c (ensure_echo_area_buffers): Likewise.
3710 * xsettings.c (apply_xft_settings): Likewise.
3711
3712 2012-07-09 Glenn Morris <rgm@gnu.org>
3713
3714 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3715 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3716 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3717 * nsterm.h (ns_etc_directory): Add it.
3718 * callproc.c [HAVE_NS]: Include nsterm.h.
3719 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3720
3721 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3722
3723 Move marker debugging code under MARKER_DEBUG.
3724 * marker.c (MARKER_DEBUG): Move marker debugging code under
3725 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3726 for bootstrap with --enable-checking (~3x slowdown reported
3727 by Juanma Barranquero <lekktu@gmail.com>).
3728 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3729
3730 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3731
3732 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3733 See <http://bugs.gnu.org/11825#29>.
3734
3735 2012-07-08 Eli Zaretskii <eliz@gnu.org>
3736
3737 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3738 has no font, use the frame's font. (Bug#11813)
3739 (display_line): Add commentary about displaying truncation glyphs
3740 on GUI frames.
3741 (produce_special_glyphs): Move here from term.c.
3742
3743 * term.c (produce_special_glyphs): Move to xdisp.c.
3744
3745 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3746 section.
3747
3748 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3749
3750 * xdisp.c (display_line): Avoid warning about implicit declaration
3751 of FRAME_FONT.
3752
3753 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3754
3755 * lisp.h: Remove empty conditional.
3756
3757 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3758
3759 * lread.c (load_path_check): Now static.
3760
3761 Fix some minor --with-ns problems found by static checking.
3762 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3763 (x_set_font) [!HAVE_X_WINDOWS]:
3764 * image.c (xpm_load_image) [HAVE_NS]:
3765 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3766 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3767 Remove unused local.
3768 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3769 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3770 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3771 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3772 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3773 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3774 Fix pointer signedness problem.
3775 * xfaces.c (FRAME_X_FONT_TABLE):
3776 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3777
3778 2012-07-07 Glenn Morris <rgm@gnu.org>
3779
3780 * lread.c (load_path_check): New function, split from init_lread.
3781 (init_lread): Reorganize. Motivation:
3782 If EMACSLOADPATH is set, check/warn about that rather than the
3783 defaults, which we are not going to use. Hence we can remove
3784 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3785 Don't warn if site-lisp directories are missing.
3786 If not installed, start from a blank load-path, since
3787 PATH_LOADSEARCH refers to the eventual installation directories.
3788
3789 2012-07-07 Eli Zaretskii <eliz@gnu.org>
3790
3791 Support truncation and continuation glyphs on GUI frames, when
3792 fringes are disabled. (Bug#11832)
3793 * xdisp.c (init_iterator): Get dimensions of truncation and
3794 continuation glyphs even if on GUI frames.
3795 Adjust it->last_visible_x on GUI frames when the left or right fringes,
3796 or both, are absent.
3797 (start_display, move_it_in_display_line_to): Handle the case of a
3798 GUI frame without a fringe to display continuation or truncation
3799 glyphs.
3800 (insert_left_trunc_glyphs): Support GUI frames: make sure
3801 truncation glyphs overwrite enough glyphs from the current line to
3802 have sufficient space in pixels.
3803 (display_line): Support truncation and continuation glyphs on GUI
3804 frames. If some spare pixels are left on the line after inserting
3805 the truncation glyphs, fill that space with a stretch glyph of a
3806 suitably computed width.
3807
3808 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3809 produce_glyphs, to support GUI sessions.
3810
3811 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3812
3813 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3814
3815 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3816
3817 Do not require float-time's arg to fit in time_t (Bug#11825).
3818 This works better on hosts where time_t is unsigned, and where
3819 float-time is applied to the (negative) difference between two times.
3820 * editfns.c (decode_time_components): Last arg is now double *,
3821 not int *, and means to store all the result as a double, without
3822 worrying about whether the seconds part fits in time_t.
3823 All callers changed.
3824 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3825 All callers changed.
3826 (Ffloat_time): Do not fail merely because the specified time falls
3827 outside of time_t range.
3828
3829 2012-07-07 Glenn Morris <rgm@gnu.org>
3830
3831 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3832 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3833 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3834
3835 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
3836
3837 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3838 Update dependencies.
3839
3840 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3841
3842 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3843
3844 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3845 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3846 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3847 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3848 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3849 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3850
3851 * xfont.c (compare_font_names): Redo to omit the need for casts.
3852
3853 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3854
3855 * xfns.c (Fx_change_window_property): Doc fix.
3856 * w32fns.c (Fx_change_window_property): Doc fix.
3857
3858 * w32fns.c (Fx_window_property): Accept the same arguments as the
3859 X Windows version. Doc fix.
3860 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3861
3862 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
3863 Eli Zaretskii <eliz@gnu.org>
3864
3865 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3866 Windows-specific code from nt/config.nt moved here.
3867 Obsolete settings removed.
3868
3869 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3870
3871 * process.c: Avoid unnecessary calls to gettime.
3872 (wait_reading_process_output): Don't get the time of day
3873 when gobbling data immediately and not waiting, as there's no need
3874 for it in that case. This removes a FIXME.
3875
3876 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3877
3878 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3879 is defined (Bug#11768).
3880
3881 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3882
3883 Fix marker debugging code.
3884 * marker.c (byte_char_debug_check): Do not perform the check
3885 if buffer is not multibyte.
3886 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3887 Call byte_char_debug_check with correct arguments.
3888
3889 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3890
3891 Compile marker debugging code only if ENABLE_CHECKING is defined.
3892 * marker.c (byte_char_debug_check, count_markers):
3893 Use only if ENABLE_CHECKING is defined.
3894 (byte_debug_flag): Remove.
3895 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3896 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3897
3898 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3899
3900 Avoid code repetition in marker-related functions.
3901 * marker.c (attach_marker): New function.
3902 (Fset_marker, set_marker_restricted, set_marker_both)
3903 (set_marker_restricted_both): Use it.
3904 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3905 Consistently rename charno to charpos.
3906 (marker_position): Add eassert.
3907 (marker_byte_position): Convert to eassert.
3908
3909 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3910
3911 Simplify list operations in unchain_overlay and unchain_marker.
3912 * buffer.c (unchain_overlay): Simplify. Add comment.
3913 * marker.c (unchain_marker): Simplify. Fix comments.
3914
3915 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3916
3917 Introduce fast path for the widely used marker operation.
3918 * alloc.c (build_marker): New function.
3919 * lisp.h (build_marker): New prototype.
3920 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3921 * composite.c (autocmp_chars): Likewise.
3922 * editfns.c (buildmark): Remove.
3923 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3924 (save_restriction_save): Use build_marker.
3925 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3926 * window.c (save_window_save): Likewise.
3927
3928 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3929
3930 Do not use Fdelete_overlay in delete_all_overlays
3931 to avoid redundant calls to unchain_overlay.
3932 * buffer.c (drop_overlay): New function.
3933 (delete_all_overlays, Fdelete_overlay): Use it.
3934 * minibuf.c (get_minibuffer): Fix comment.
3935
3936 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3937
3938 Port to OpenBSD 5.1 amd64.
3939 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3940 This is needed for OpenBSD, and should be harmless on all BSD systems.
3941 Also, include <sys/sysctl.h>, as it should be available on all
3942 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3943 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3944 use p_pid member, not kp_proc.pid.
3945
3946 2012-07-06 Glenn Morris <rgm@gnu.org>
3947
3948 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3949
3950 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3951
3952 More xmalloc and related cleanup.
3953 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3954 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3955 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3956 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3957 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3958 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3959 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3960 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3961 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3962 * xterm.c:
3963 Omit needless casts involving void * pointers and allocation.
3964 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3965 as the former is more robust if P's type is changed.
3966 Prefer xzalloc to xmalloc + memset 0.
3967 Simplify malloc-or-realloc to realloc.
3968 Don't worry about xmalloc returning a null pointer.
3969 Prefer xstrdup to xmalloc + strcpy.
3970 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3971 growing it.
3972 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3973 alloca of a constant.
3974
3975 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3976
3977 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3978 hscroll is larger than the line width. Fixes long and futile
3979 looping inside extend_face_to_end_of_line (on a TTY) producing
3980 glyphs that are not needed and thrown away.
3981
3982 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3983
3984 * marker.c (set_marker_restricted_both): Simplify by using
3985 clip_to_bounds.
3986
3987 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3988
3989 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3990
3991 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3992
3993 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3994 not defined (Bug#11768).
3995 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3996 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3997 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3998 followed by gtk_box_set_homogeneous (Bug#11768).
3999 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4000 (update_theme_scrollbar_width, xg_create_scroll_bar):
4001 Use gtk_scrollbar_new (Bug#11768).
4002 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4003 (is_box_type): New function (Bug#11768).
4004 (xg_tool_item_stale_p): Call is_box_type.
4005 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4006 with default display (Bug#11768).
4007
4008 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4009
4010 * xdisp.c (window_hscroll_limited): New function.
4011 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4012 coordinates when window's hscroll is set to insanely large
4013 values. (Bug#11857)
4014
4015 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4016
4017 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4018 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4019
4020 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4021
4022 Cleanup xmalloc.
4023 * lisp.h (xzalloc): New prototype. Omit needless casts.
4024 * alloc.c (xzalloc): New function. Omit needless casts.
4025 * charset.c: Omit needless casts. Convert all calls to
4026 xmalloc with following memset to xzalloc.
4027 * dispnew.c: Likewise.
4028 * fringe.c: Likewise.
4029 * image.c: Likewise.
4030 * sound.c: Likewise.
4031 * term.c: Likewise.
4032 * w32fns.c: Likewise.
4033 * w32font.c: Likewise.
4034 * w32term.c: Likewise.
4035 * xfaces.c: Likewise.
4036 * xfns.c: Likewise.
4037 * xterm.c: Likewise.
4038 * atimer.c: Omit needless casts.
4039 * buffer.c: Likewise.
4040 * callproc.c: Likewise.
4041 * ccl.c: Likewise.
4042 * coding.c: Likewise.
4043 * composite.c: Likewise.
4044 * doc.c: Likewise.
4045 * doprnt.c: Likewise.
4046 * editfns.c: Likewise.
4047 * emacs.c: Likewise.
4048 * eval.c: Likewise.
4049 * filelock.c: Likewise.
4050 * fns.c: Likewise.
4051 * gtkutil.c: Likewise.
4052 * keyboard.c: Likewise.
4053 * lisp.h: Likewise.
4054 * lread.c: Likewise.
4055 * minibuf.c: Likewise.
4056 * msdos.c: Likewise.
4057 * print.c: Likewise.
4058 * process.c: Likewise.
4059 * region-cache.c: Likewise.
4060 * search.c: Likewise.
4061 * sysdep.c: Likewise.
4062 * termcap.c: Likewise.
4063 * terminal.c: Likewise.
4064 * tparam.c: Likewise.
4065 * w16select.c: Likewise.
4066 * w32.c: Likewise.
4067 * w32reg.c: Likewise.
4068 * w32select.c: Likewise.
4069 * w32uniscribe.c: Likewise.
4070 * widget.c: Likewise.
4071 * xdisp.c: Likewise.
4072 * xmenu.c: Likewise.
4073 * xrdb.c: Likewise.
4074 * xselect.c: Likewise.
4075
4076 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4077
4078 * fileio.c (time_error_value): Check the right error number.
4079 Problem reported by Troels Nielsen in
4080 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4081
4082 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4083
4084 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4085 This should be fixed in a better way; see Eli Zaretskii in
4086 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4087 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4088
4089 * fileio.c (time_error_value): Rename from special_mtime.
4090 The old name's problems were noted by Eli Zaretskii in
4091 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4092
4093 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4094 This variable's comment says Emacs needs at least one GDB-visible
4095 symbol of type enum pvec_type, to work around GDB problems.
4096 The symbol's value doesn't matter.
4097
4098 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4099 that causes compilation to fail on pre-C99 compilers.
4100
4101 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4102
4103 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4104 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4105
4106 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4107
4108 * buffer.c (init_buffer_once): Fix initialization of
4109 headers for buffer_defaults and buffer_local_symbols.
4110 Reported by Juanma Barranquero <lekktu@gmail.com>.
4111
4112 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4113
4114 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4115 * lisp.h (enum pvec_type): Use fewer bits.
4116 (PSEUDOVECTOR_SIZE_BITS): New constant.
4117 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4118 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4119 change in pvec_type.
4120 (PSEUDOVECTOR_TYPEP): New macro.
4121 (TYPED_PSEUDOVECTORP): Use it.
4122 * fns.c (internal_equal): Adapt code to extract pvectype.
4123 * emacs.c (gdb_pvec_type): Update type.
4124 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4125 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4126 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4127 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4128 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4129 abusing vector->header.next.nbytes.
4130 (live_vector_p): Use PVEC_TYPE.
4131 (mark_object): Adapt code to extract pvectype. Use switch.
4132
4133 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4134
4135 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4136 Tighten new eassert a bit.
4137
4138 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4139
4140 Fix compilation with --enable-gcc-warnings and -O1
4141 optimization level.
4142 * doprnt.c (doprnt): Change type of tem to int, initialize
4143 to avoid compiler warning. Add eassert.
4144 * search.c (simple_search): Initialize match_byte to avoid
4145 compiler warning. Add eassert.
4146
4147 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4148
4149 Avoid weird behavior with large horizontal scrolls.
4150 Without this change, for example, large hscroll values would
4151 mess up Emacs's display on Fedora 15 x86, presumably due to
4152 overflows in int calculations in the display code.
4153 Also, if buffers had long lines, Emacs would freeze.
4154 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4155 (set_window_hscroll): New function, containing the old guts of
4156 Fset_window_hscroll. Return the clipped value.
4157 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4158 This avoids the need to check against PTRDIFF_MAX.
4159
4160 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4161
4162 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4163
4164 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4165
4166 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4167
4168 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4169 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4170 since GCC 4.4.6 issues a bogus warning for them.
4171
4172 Fix bugs in file timestamp newness comparisons.
4173 * fileio.c (Ffile_newer_than_file_p):
4174 * lread.c (Fload): Use full timestamp resolution of files,
4175 not just the 1-second resolution, so that files that are only
4176 slightly newer still count as newer.
4177 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4178 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4179
4180 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4181
4182 * fileio.c: Improve handling of file time marker. (Bug#11852)
4183 (special_mtime): New function.
4184 (Finsert_file_contents, Fverify_visited_file_modtime):
4185 Use it to set special mtime values consistently.
4186
4187 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4188
4189 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4190 marker for non-existing file. (Bug#11852)
4191
4192 2012-07-03 Glenn Morris <rgm@gnu.org>
4193
4194 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4195 and did not make it into globals.h).
4196
4197 2012-07-03 Tom Tromey <tromey@redhat.com>
4198
4199 * window.c (Fset_window_margins, Fset_window_fringes)
4200 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4201 * textprop.c (Fprevious_property_change): No longer static.
4202 * syntax.c (Fsyntax_table_p): No longer static.
4203 * process.c (Fget_process, Fprocess_datagram_address): No longer
4204 static.
4205 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4206 * keyboard.c (Fcommand_execute): No longer static.
4207 Remove EXFUN.
4208 * insdel.c (Fcombine_after_change_execute): No longer static.
4209 * image.c (Finit_image_library): No longer static.
4210 * fileio.c (Fmake_symbolic_link): No longer static.
4211 * eval.c (Ffetch_bytecode): No longer static.
4212 * editfns.c (Fuser_full_name): No longer static.
4213 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4214 No longer static.
4215 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4216 static.
4217 * dired.c (Ffile_attributes): No longer static.
4218 * composite.c (Fcomposition_get_gstring): No longer static.
4219 * callproc.c (Fgetenv_internal): No longer static.
4220
4221 * ccl.h: Remove EXFUNs.
4222 * buffer.h: Remove EXFUNs.
4223 * dispextern.h: Remove EXFUNs.
4224 * intervals.h: Remove EXFUNs.
4225 * fontset.h: Remove EXFUN.
4226 * font.h: Remove EXFUNs.
4227 * dosfns.c (system_process_attributes): Remove EXFUN.
4228 * keymap.h: Remove EXFUNs.
4229 * lisp.h: Remove EXFUNs.
4230 * w32term.h: Remove EXFUNs.
4231 * window.h: Remove EXFUNs.
4232 * xsettings.h: Remove EXFUN.
4233 * xterm.h: Remove EXFUN.
4234
4235 2012-07-03 Glenn Morris <rgm@gnu.org>
4236
4237 * lisp.h (Frandom): Make it visible to C.
4238 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4239 buffer for invisible buffers. (Bug#1229)
4240
4241 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4242
4243 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4244 values which aren't power of 2.
4245 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4246 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4247 accordingly.
4248
4249 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4250
4251 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4252
4253 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4254
4255 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4256
4257 * alloc.c (allocate_vector_block): Remove redundant
4258 calls to mallopt if DOUG_LEA_MALLOC is defined.
4259 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4260 avoid calls to mallopt if zero_vector is returned.
4261
4262 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4263
4264 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4265 is enabled, avoid dereferencing NULL current_sblock if
4266 running undumped.
4267
4268 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4269
4270 Cleanup basic buffer management.
4271 * buffer.h (struct buffer): Change layout to use generic vector
4272 marking code. Fix some comments. Change type of 'clip_changed'
4273 to bitfield. Remove unused #ifndef old.
4274 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4275 (GET_OVERLAYS_AT): Fix indentation.
4276 (for_each_per_buffer_object_at): New macro.
4277 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4278 (Fbuffer_local_variables): Use it.
4279 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4280 * alloc.c (allocate_buffer): Adjust to match new layout of
4281 struct buffer. Fix comment.
4282 (mark_overlay): New function.
4283 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4284 Lisp area of struct buffer.
4285 (mark_object): Use it. Adjust marking of misc objects
4286 and related comments.
4287
4288 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4289
4290 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4291 wrapper that is not needed because the wrapped code is a no-op (zero
4292 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4293 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4294
4295 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4296
4297 * alloc.c (mark_buffer): Simplify. Remove prototype.
4298 (mark_object): Add comment. Reorganize marking of vector-like
4299 objects. Use CHECK_LIVE for all vector-like objects except buffers
4300 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4301 Avoid redundant calls to mark_vectorlike for bool vectors.
4302
4303 2012-06-30 Glenn Morris <rgm@gnu.org>
4304
4305 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4306
4307 * epaths.in (PATH_SITELOADSEARCH): New.
4308 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4309 This is rather than relying on --enable-locallisppath elements
4310 having "site-lisp" in their names. (Bug#10208#25, 11658)
4311
4312 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4313
4314 * w32proc.c (sys_select): Accept and ignore one more argument.
4315
4316 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4317
4318 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4319 (pselect) [!MS_DOS]: Redirect to sys_select.
4320
4321 * sysdep.c: Don't include dos.h and dosfns.h.
4322
4323 * process.c (sys_select):
4324 * msdos.c (sys_select): Accept one more argument and ignore it.
4325
4326 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4327 adapt data types and code to that.
4328
4329 * dosfns.c:
4330 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4331 which clashes with the gnulib function of the same name.
4332
4333 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4334
4335 * font.c (font_style_to_value, font_style_symbolic)
4336 (font_prop_validate_style): Add type checks for values in
4337 font_style_table.
4338
4339 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4340 argument.
4341 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4342 uses.
4343
4344 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4345
4346 * xdisp.c (try_window_id): Undo last change.
4347
4348 * w32.c (getwd): Adjust commentary about startup_dir.
4349 (init_environment): Always call sys_access, even in non-MSVC
4350 builds. Don't chdir to the directory of the Emacs executable.
4351 This undoes code from 1997 which was justified by the need to
4352 "avoid conflicts when removing and renaming directories". But its
4353 downside was that every relative file name was being interpreted
4354 relative to the directory of the Emacs executable, which can never
4355 be TRT. In particular, it broke sys_access when called with
4356 relative file names.
4357 (sys_access): Map GetLastError to errno.
4358
4359 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4360
4361 * window.h (struct window): Change type of 'fringes_outside_margins'
4362 to bitfield. Fix comment. Adjust users accordingly.
4363 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4364 Adjust comment.
4365 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4366 to ptrdiff_t.
4367
4368 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4369
4370 * gnutls.c (emacs_gnutls_handshake):
4371 Add QUIT to make the loop interruptible.
4372
4373 2012-06-29 Glenn Morris <rgm@gnu.org>
4374
4375 * charset.c (init_charset): Make lack of etc/charsets fatal.
4376
4377 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4378
4379 * editfns.c (region_limit): Fix type mismatch.
4380
4381 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4382
4383 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4384 undefined. Convert from xassert to eassert.
4385 * nsmenu.m: Convert from xassert to eassert.
4386 * nsterm.m: Likewise.
4387
4388 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4389
4390 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4391
4392 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4393
4394 Avoid integer overflow on scroll-left and scroll-right.
4395 * window.c (HSCROLL_MAX): New macro.
4396 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4397 overflow when requested scroll falls outside ptrdiff_t range.
4398
4399 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4400
4401 * window.h (struct window): Change type of 'hscroll',
4402 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4403 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4404 Adjust users accordingly.
4405 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4406 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4407 from EMACS_INT to ptrdiff_t.
4408 (make_window): Omit redundant initialization.
4409
4410 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4411
4412 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4413
4414 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4415
4416 * window.h (struct window): Change type of 'use_time' and
4417 'sequence_number' from Lisp_Object to int.
4418 * frame.c (make_frame): Adjust users accordingly.
4419 * print.c (print_object): Likewise.
4420 * window.c (select_window, Fwindow_use_time, make_parent_window)
4421 (make_window): Likewise.
4422
4423 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4424
4425 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4426 enabled with --enable-checking=[all,glyphs] configure option.
4427 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4428 adjust comments accordingly.
4429 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4430 undefined, adjust comments accordingly.
4431 * image.c: Likewise.
4432 * scroll.c: Likewise.
4433 * w32fns.c: Likewise.
4434 * w32term.c: Likewise.
4435 * xdisp.c: Likewise.
4436 * xfaces.c: Likewise.
4437 * xfns.c: Likewise.
4438 * xterm.c: Likewise.
4439
4440 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4441
4442 Generalize run-time debugging checks.
4443 * dispextern.h (XASSERTS): Remove.
4444 * fontset.c (xassert): Remove.
4445 Convert from xassert to eassert.
4446 * alloc.c: Convert from xassert to eassert.
4447 * bidi.c: Likewise.
4448 * dispnew.c: Likewise.
4449 * fns.c: Likewise.
4450 * fringe.c: Likewise.
4451 * ftfont.c: Likewise.
4452 * gtkutil.c: Likewise.
4453 * image.c: Likewise.
4454 * keyboard.c: Likewise.
4455 * menu.c: Likewise.
4456 * process.c: Likewise.
4457 * scroll.c: Likewise.
4458 * sound.c: Likewise.
4459 * term.c: Likewise.
4460 * w32console.c: Likewise.
4461 * w32fns.c: Likewise.
4462 * w32term.c: Likewise.
4463 * window.c: Likewise.
4464 * xdisp.c: Likewise.
4465 * xfaces.c: Likewise.
4466 * xfns.c: Likewise.
4467 * xselect.c: Likewise.
4468 * xterm.c: Likewise.
4469
4470 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4471
4472 * fns.c (maybe_resize_hash_table): Output message when growing the
4473 purify-hashtable.
4474
4475 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4476
4477 * alloc.c (allocate_string_data): Remove dead code.
4478 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4479 avoid GCC warning about unused macro.
4480
4481 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4482
4483 * alloc.c (allocate_string): Omit intervals initialization.
4484 * alloc.c (make_uninit_multibyte_string): Initialize intervals
4485 as in make_pure_string and make_pure_c_string.
4486
4487 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4488
4489 * alloc.c (allocate_string): Fix last change.
4490
4491 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4492
4493 * alloc.c (allocate_string): Remove two redundant calls
4494 to memset, add explicit initialization where appropriate.
4495
4496 2012-06-27 Glenn Morris <rgm@gnu.org>
4497
4498 * lisp.mk (lisp): Remove paths.elc.
4499
4500 2012-06-27 Chong Yidong <cyd@gnu.org>
4501
4502 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4503
4504 2012-06-26 John Wiegley <johnw@newartisans.com>
4505
4506 * unexmacosx.c (copy_data_segment): Add two section names used
4507 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4508
4509 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4510 when building with Clang.
4511
4512 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4513
4514 * eval.c (Fapply): Allow calling it with a single argument.
4515
4516 2012-06-26 Eli Zaretskii <eliz@gnu.org>
4517
4518 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4519 _stricmp and _strnicmp.
4520 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4521
4522 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4523
4524 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4525 allocated window.
4526 (allocate_process): Likewise for new process.
4527 (allocate_terminal): Change to use offsetof.
4528 (allocate_frame): Likewise.
4529 * frame.c (make_frame): Omit redundant initialization.
4530 * window.c (make_parent_window): Use memset.
4531 (make_window): Omit redundant initialization.
4532 * process.c (make_process): Omit redundant initialization.
4533 * terminal.c (create_terminal): Likewise.
4534
4535 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4536
4537 * term.c (delete_tty): Remove redundant call to memset.
4538
4539 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4540
4541 * alloc.c: Remove build_string.
4542 * lisp.h: Define build_string as static inline. This provides
4543 a better opportunity to optimize away calls to strlen when the
4544 function is called with compile-time constant argument.
4545 * image.c (imagemagick_error): Convert to build_string.
4546 * w32proc.c (sys_spawnve): Likewise.
4547 * xterm.c (x_term_init): Likewise.
4548
4549 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4550
4551 Use sprintf return value instead of invoking strlen on result.
4552 In the old days this wasn't portable, since some sprintf
4553 implementations returned char *. But they died out years ago and
4554 Emacs already assumes sprintf returns int.
4555 Similarly for float_to_string.
4556 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4557 * ccl.c (ccl_driver):
4558 * character.c (string_escape_byte8):
4559 * data.c (Fnumber_to_string):
4560 * doprnt.c (doprnt):
4561 * print.c (print_object):
4562 * xdisp.c (message_dolog):
4563 * xfns.c (syms_of_xfns):
4564 Use sprintf or float_to_string result to avoid need to call strlen.
4565 * data.c (Fnumber_to_string):
4566 Use make_unibyte_string, since the string must be ASCII.
4567 * lisp.h, print.c (float_to_string): Now returns int length.
4568 * term.c (produce_glyphless_glyph):
4569 Use sprintf result rather than recomputing it.
4570
4571 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4572 * Makefile.in (ALL_CFLAGS):
4573 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4574 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4575
4576 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4577
4578 * dispextern.h (xstrcasecmp): Define to library function
4579 strcasecmp if available.
4580 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4581
4582 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4583
4584 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4585 Avoid comma operator.
4586 * menu.c (push_submenu_start, push_submenu_end)
4587 (push_left_right_boundary, push_menu_pane): Likewise.
4588 * msdos.c (dos_rawgetc): Likewise.
4589
4590 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4591
4592 * xfns.c (xic_create_fontsetname): Remove redundant calls
4593 to memset.
4594
4595 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4596
4597 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4598 sprintf already null-terminates its output.
4599
4600 * xfns.c (x_window): Remove redundant cast.
4601
4602 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4603
4604 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4605 `const char *' to `char *' to avoid compiler warning.
4606
4607 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4608
4609 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4610 instead of truncating it to 63 (admittedly a generous limit).
4611
4612 * process.c: Fix spelling and caps in comments.
4613
4614 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4615
4616 * emacs.c (setpgrp): Remove definition, unused.
4617 * sysdep.c (setpgrp): Remove definition, not used in this file.
4618
4619 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
4620
4621 * makefile.w32-in: Update dependencies.
4622
4623 2012-06-24 Eli Zaretskii <eliz@gnu.org>
4624
4625 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4626 (SYSTIME_H): Add nt/inc/sys/time.h.
4627
4628 * systime.h [WINDOWSNT]: Include sys/time.h.
4629
4630 * s/ms-w32.h (struct timespec): Definition moved from
4631 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4632
4633 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4634
4635 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4636 * buffer.h (buffer_slot_type_mismatch):
4637 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4638 * eval.c (unwind_to_catch):
4639 * image.c (my_png_error, my_error_exit):
4640 * keyboard.c (quit_throw_to_read_char, user_error)
4641 (Fexit_recursive_edit, Fabort_recursive_edit):
4642 * lisp.h (die, args_out_of_range, args_out_of_range_3)
4643 (wrong_type_argument, buffer_overflow, __executable_start)
4644 (memory_full, buffer_memory_full, string_overflow, Fthrow)
4645 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4646 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4647 (fatal):
4648 (child_setup) [!DOS_NT]:
4649 * lread.c (end_of_file_error, invalid_syntax):
4650 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4651 * puresize.h (pure_write_error):
4652 * search.c (matcher_overflow):
4653 * sound.c (sound_perror, alsa_sound_perror):
4654 * sysdep.c, syssignal.h (croak):
4655 * term.c (maybe_fatal, vfatal):
4656 * textprop.c (text_read_only):
4657 * undo.c (user_error):
4658 * unexmacosx.c (unexec_error):
4659 * xterm.c (x_ins_del_lines, x_delete_glyphs):
4660 Use _Noreturn rather than NO_RETURN.
4661 No need for separate decl merely because of _Noreturn.
4662 * sound.c (sound_warning, parse_sound):
4663 Remove unnecessary forward decls.
4664
4665 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4666
4667 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4668 * lisp.h (WAIT_READING_MAX): New macro.
4669 * dispnew.c (Fsleep_for, sit_for):
4670 * keyboard.c (kbd_buffer_get_event):
4671 * process.c (Faccept_process_output):
4672 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4673 This improves on the previous patch, which introduced a bug
4674 when time_t is unsigned and as wide as intmax_t.
4675 See <http://bugs.gnu.org/9000#51>.
4676
4677 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4678
4679 * dispnew.c (sit_for, Fsleep_for):
4680 * keyboard.c (kbd_buffer_get_event):
4681 * process.c (Faccept_process_output): Avoid compiler warnings when
4682 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4683
4684 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
4685
4686 * makefile.w32-in: Update dependencies.
4687
4688 * w32.c (ltime): Add return type and declare static.
4689 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4690
4691 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4692
4693 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4694 Privately reported by Herbert J. Skuhra.
4695 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4696 All uses changed.
4697 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4698 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4699
4700 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4701
4702 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4703 last argument of make_unibyte_string.
4704
4705 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4706 language ID in the event parameters.
4707
4708 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4709 event.code, not the obscure "character set ID".
4710
4711 2012-06-23 Chong Yidong <cyd@gnu.org>
4712
4713 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4714
4715 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4716
4717 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4718 * w32.c (fdutimens): New function.
4719
4720 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4721
4722 * s/ms-w32.h (pselect): Redirect to sys_select.
4723
4724 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4725
4726 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4727 in the logic of incrementing and decrementing the value of
4728 use_relocatable_buffers.
4729
4730 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4731
4732 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4733 Privately reported by Herbert J. Skuhra.
4734 [__FreeBSD__]: Remove "*/" typo after "#include".
4735 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4736 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4737 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4738 Don't assume EMACS_TIME and struct timeval are the same type.
4739
4740 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4741
4742 Support higher-resolution time stamps (Bug#9000).
4743 The time stamps are only nanosecond-resolution at the C level,
4744 since that's the best that any real-world system supports now.
4745 But they are picosecond-resolution at the Lisp level, as that's
4746 easy, and leaves room for future OS improvements.
4747
4748 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4749 (LIBES): Use it.
4750
4751 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4752 Don't get current time unless it's needed.
4753
4754 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4755 now provides it if it's absent.
4756 (start_atimer): Port to higher-res time stamps.
4757 Check for time stamp overflow. Don't get current time more
4758 often than is needed.
4759
4760 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4761 Include systime.h, not time.h.
4762 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4763
4764 * dired.c: Include stat-time.h.
4765 (Ffile-attributes): File times now have higher resolution.
4766
4767 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4768 (struct image): Timestamp now has higher resolution.
4769
4770 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4771 has at least microseconds now. All uses removed.
4772 (update_frame, update_single_window, update_window, update_frame_1)
4773 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
4774 (duration_to_sec_usec): Remove; no longer needed.
4775
4776 * editfns.c (time_overflow): Now extern.
4777 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4778 (float-time, Fformat_time_string, Fcurrent_time_string)
4779 (Fcurrent_time_zone): Accept and generate higher-resolution
4780 time stamps.
4781 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4782 (decode_time_components, lisp_seconds_argument): New functions.
4783 (make_time): Now static.
4784 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4785 Report an error if the time is invalid, rather than having the caller
4786 do that.
4787
4788 * fileio.c: Include <stat-time.h>
4789 (Fcopy_file): Copy higher-resolution time stamps.
4790 Prefer to set the time stamp via a file descriptor if that works.
4791 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4792 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4793 (Fvisited_file_modtime, Fset_visited_file_modtime):
4794 Support higher-resolution time stamps.
4795
4796 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4797
4798 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4799
4800 * image.c (prepare_image_for_display, clear_image_cache)
4801 (lookup_image): Port to higer-resolution time stamps.
4802
4803 * keyboard.c (start_polling, bind_polling_period):
4804 Check for time stamp overflow.
4805 (read_char, kbd_buffer_get_event, timer_start_idle)
4806 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4807 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4808 Port to higher-resolution time stamps. Do not assume time_t is signed.
4809 (decode_timer): New function. Timers are now vectors of length 9,
4810 not 8, to accommodate the picosecond component.
4811 (timer_check_2): Use it.
4812
4813 * nsterm.m (select_timeout, timeval_subtract): Remove.
4814 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4815 as they're a bit more accurate and handle overflow better.
4816 (ns_select): Change prototype to be compatible with pselect.
4817 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4818 * nsterm.h (ns_select): Adjust prototype.
4819
4820 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4821 us-resolution time stamps.
4822 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4823
4824 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4825
4826 * lisp.h (time_overflow): New decl.
4827 (wait_reading_process_output): First arg is now intmax_t, not int,
4828 to accommodate larger waits.
4829
4830 * process.h (struct Lisp_Process.read_output_delay):
4831 Now counts nanoseconds, not microseconds.
4832 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4833 EMACS_HAS_USECS.
4834 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4835 (wait_reading_process_output):
4836 Port to ns-resolution time stamps.
4837 (Faccept_process_output, wait_reading_process_output):
4838 Check for time stamp overflow. Do not assume time_t is signed.
4839 (select_wrapper): Remove; we now use pselect.
4840 (Fprocess_attributes): Now generates ns-resolution time stamps.
4841
4842 * sysdep.c: Include utimens.h. Don't include utime.h
4843 or worry about struct utimbuf; gnulib does that for us now.
4844 (gettimeofday): Remove; gnulib provides a substitute.
4845 (make_timeval): New function.
4846 (set_file_times): Now sets ns-resolution time stamps.
4847 New arg FD; all uses changed.
4848 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4849 (system_process_attributes):
4850 Now returns ns-resolution time stamp. All uses changed.
4851 Check for time stamp overflow.
4852
4853 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4854 provides a substitute now.
4855
4856 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4857 since it guarantees struct timespec.
4858 (EMACS_TIME): Now struct timespec, so that we can support
4859 ns-resolution time stamps.
4860 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4861 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4862 (EMACS_USECS): Remove.
4863 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4864 so multiply the arg by 1000 before storing it.
4865 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4866 New macros.
4867 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4868 Port to ns-resolution time stamps.
4869 (EMACS_TIME_NEG_P): Remove; replaced by....
4870 (EMACS_TIME_SIGN): New macro.
4871 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4872 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4873 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4874 (make_timeval, make_lisp_time, decode_time_components): New decls.
4875 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4876 that it mishandled time_t overflow. You can't compare by subtracting!
4877 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4878 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4879
4880 * term.c: Include <sys/time.h>.
4881 (timeval_to_Time): New function, for proper overflow wraparound.
4882 (term_mouse_position, term_mouse_click): Use it.
4883
4884 * undo.c (record_first_change): Support higher-resolution time stamps
4885 in the undo buffer.
4886 (Fprimitive_undo): Use them when restoring time stamps.
4887
4888 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4889 (w32_get_internal_run_time):
4890 Port to higher-resolution Emacs time stamps.
4891 (ltime): Now accepts single 64-bit integer, as that's more convenient
4892 for callers.
4893
4894 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4895
4896 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4897 for compatibility with pselect. Support ns-resolution time stamps.
4898
4899 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4900
4901 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4902 Check for time stamp overflow, and support ns-resolution time stamps.
4903
4904 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4905 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4906 (timeval_subtract): Remove; no longer needed.
4907 (XTflash, XTring_bell, x_wait_for_event):
4908 Port to ns-resolution time stamps. Don't assume time_t is signed.
4909
4910 2012-06-22 Chong Yidong <cyd@gnu.org>
4911
4912 * xdisp.c (x_consider_frame_title): Revert last change.
4913
4914 2012-06-22 Eli Zaretskii <eliz@gnu.org>
4915
4916 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4917 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4918 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4919 staticidx goes up to 1597 out of 1600 = 0x640.)
4920
4921 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4922
4923 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4924 Otherwise, the umask might be mistakenly 0 while handling input signals.
4925
4926 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4927
4928 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4929
4930 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4931
4932 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4933 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4934 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4935 access to `contents' member of Lisp_Vector objects with AREF and ASET
4936 where appropriate.
4937
4938 2012-06-19 Chong Yidong <cyd@gnu.org>
4939
4940 * frame.c (delete_frame): When selecting a frame on a different
4941 text terminal, do not alter the terminal's top-frame.
4942
4943 * xdisp.c (format_mode_line_unwind_data): Record the target
4944 frame's selected window and its terminal's top-frame.
4945 (unwind_format_mode_line): Restore them.
4946 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4947 Callers changed.
4948 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4949 since tty frames can be explicitly named.
4950 (prepare_menu_bars): Likewise.
4951
4952 * term.c (Ftty_top_frame): New function.
4953
4954 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4955
4956 Port byte-code-meter to modern targets.
4957 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4958 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
4959 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
4960 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4961 (METER_1, METER_2): Simplify.
4962
4963 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4964
4965 * data.c (Fdefalias): Return `symbol' (bug#11686).
4966
4967 2012-06-18 Martin Rudalics <rudalics@gmx.at>
4968
4969 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
4970 gets killed during executing of this function (Bug#11665).
4971 Try to always return Qt when the buffer has been actually killed.
4972 (Vkill_buffer_query_functions): In doc-string say that functions
4973 run by this hook should not change the current buffer.
4974
4975 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4976
4977 Fix recently-introduced process.c problems found by static checking.
4978 * process.c (write_queue_push, write_queue_pop, send_process):
4979 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4980 (write_queue_pop): Fix pointer signedness problem.
4981 (send_process): Remove unused local.
4982
4983 2012-06-17 Chong Yidong <cyd@gnu.org>
4984
4985 * xdisp.c (redisplay_internal): No need to redisplay terminal
4986 frames that are not on top.
4987
4988 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
4989
4990 * process.c (make_process): Initialize write_queue.
4991 (write_queue_push, write_queue_pop): New functions.
4992 (send_process): Use them to maintain correct ordering of process
4993 writes (Bug#10815).
4994
4995 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4996
4997 * lisp.h (eassert): Assume C89 or later.
4998 This removes the need for CHECK.
4999 (CHECK): Remove. Its comments about always evaluating its
5000 argument were confusing, as 'eassert' typically does not evaluate
5001 its argument.
5002
5003 * coding.c (produce_chars): Use ptrdiff_t, not int.
5004
5005 * xterm.c (x_draw_underwave): Check for integer overflow.
5006 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5007
5008 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5009
5010 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5011 referenced (Bug#11583).
5012
5013 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5014
5015 Implement wave-style variant of underlining.
5016 * dispextern.h (face_underline_type): New enum.
5017 (face): Add field for underline type.
5018 * nsterm.m (ns_draw_underwave): New function.
5019 (ns_draw_text_decoration): Use it.
5020 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5021 New functions.
5022 (x_draw_glyph_string): Use them.
5023 * xfaces.c (Qline, Qwave): New Lisp objects.
5024 (check_lface_attrs, merge_face_ref)
5025 (Finternal_set_lisp_face_attribute, realize_x_face):
5026 Handle wave-style underline face attributes.
5027 * xterm.c (x_draw_underwave): New function.
5028 (x_draw_glyph_string): Use it.
5029
5030 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5031
5032 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5033 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5034 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5035 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5036 ($(BLD)/w32select.$(O)): Update dependencies.
5037
5038 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5039
5040 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5041 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5042 * character.c (_fetch_multibyte_char_p): Remove.
5043 * alloc.c: Include "character.h" before "buffer.h".
5044 * bidi.c: Likewise.
5045 * buffer.c: Likewise.
5046 * bytecode.c: Likewise.
5047 * callint.c: Likewise.
5048 * callproc.c: Likewise.
5049 * casefiddle.c: Likewise.
5050 * casetab.c: Likewise.
5051 * category.c: Likewise.
5052 * cmds.c: Likewise.
5053 * coding.c: Likewise.
5054 * composite.c: Likewise.
5055 * dired.c: Likewise.
5056 * dispnew.c: Likewise.
5057 * doc.c: Likewise.
5058 * dosfns.c: Likewise.
5059 * editfns.c: Likewise.
5060 * emacs.c: Likewise.
5061 * fileio.c: Likewise.
5062 * filelock.c: Likewise.
5063 * font.c: Likewise.
5064 * fontset.c: Likewise.
5065 * fringe.c: Likewise.
5066 * indent.c: Likewise.
5067 * insdel.c: Likewise.
5068 * intervals.c: Likewise.
5069 * keyboard.c: Likewise.
5070 * keymap.c: Likewise.
5071 * lread.c: Likewise.
5072 * macros.c: Likewise.
5073 * marker.c: Likewise.
5074 * minibuf.c: Likewise.
5075 * nsfns.m: Likewise.
5076 * nsmenu.m: Likewise.
5077 * print.c: Likewise.
5078 * process.c: Likewise.
5079 * regex.c: Likewise.
5080 * region-cache.c: Likewise.
5081 * search.c: Likewise.
5082 * syntax.c: Likewise.
5083 * term.c: Likewise.
5084 * textprop.c: Likewise.
5085 * undo.c: Likewise.
5086 * unexsol.c: Likewise.
5087 * w16select.c: Likewise.
5088 * w32fns.c: Likewise.
5089 * w32menu.c: Likewise.
5090 * window.c: Likewise.
5091 * xdisp.c: Likewise.
5092 * xfns.c: Likewise.
5093 * xmenu.c: Likewise.
5094 * xml.c: Likewise.
5095 * xselect.c: Likewise.
5096
5097 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5098
5099 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5100 If all the glyphs of the glyph row came from strings, and we have no
5101 cursor positioning clues, put the cursor on the first glyph of the
5102 row.
5103 (handle_face_prop): Use chunk-relative overlay string index when
5104 indexing into it->string_overlays array. (Bug#11653)
5105 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5106 the rightmost. (Bug#11720)
5107
5108 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5109
5110 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5111 (CATEGORY_MEMBER): Enforce 1/0 value.
5112 * category.c (_temp_category_set): Remove.
5113
5114 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5115
5116 * window.c (Fdelete_other_windows_internal)
5117 (Fdelete_window_internal): Don't access frame's mouse highlight
5118 info of the initial frame. (Bug#11677)
5119
5120 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5121
5122 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5123 Assume USE_2_TAGS_FOR_INTS.
5124 (xreload): Adjust $tagmask width to match recent lisp.h change.
5125
5126 Simplify lisp.h in minor ways that should not affect code.
5127 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5128 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5129 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5130 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5131 (INTTYPEBITS): New macro, for clarity.
5132 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5133 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5134 Simplify now that USE_LSB_TAG is always defined.
5135 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5136 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5137
5138 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5139
5140 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5141
5142 2012-06-13 Glenn Morris <rgm@gnu.org>
5143
5144 * s/bsd-common.h (BSD4_3):
5145 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5146
5147 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5148
5149 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5150 instead of union.
5151 (XLI, XIL): Define.
5152 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5153 Use them.
5154 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5155 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5156 * alloc.c (widen_to_Lisp_Object): Remove.
5157 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5158 * frame.c (delete_frame): Remove outdated comment.
5159 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5160 USE_LISP_UNION_TYPE.
5161 (Fw32_unregister_hot_key): Likewise.
5162 (Fw32_toggle_lock_key): Likewise.
5163 * w32menu.c (add_menu_item): Likewise.
5164 (w32_menu_display_help): Use XIL instead of checking
5165 USE_LISP_UNION_TYPE.
5166 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5167 (init_heap): Likewise.
5168 * w32term.c (w32_read_socket): Update comment.
5169
5170 2012-06-13 Glenn Morris <rgm@gnu.org>
5171
5172 * s/usg5-4-common.h, src/s/unixware.h:
5173 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5174
5175 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5176
5177 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5178
5179 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5180 * alloc.c (make_number) [!defined make_number]:
5181 Remove, as lisp.h always defines this now.
5182 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5183 (roundup_size): Verify that it is a power of 2.
5184 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5185 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5186 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5187 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5188 USE_LSB_TAG now is always defined to be either 0 or 1.
5189 All uses changed.
5190 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5191 code works fine either way, and efficiency is not a concern here,
5192 as the union type is for debugging, not for production.
5193 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5194 Use an inline function on all platforms when using the union type,
5195 since this is simpler and 'static inline' can be used portably
5196 within Emacs now.
5197 (LISP_INITIALLY_ZERO): New macro.
5198 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5199 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5200
5201 2012-06-12 Glenn Morris <rgm@gnu.org>
5202
5203 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5204
5205 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5206
5207 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5208 Move BROKEN_SIGIO to configure.
5209
5210 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5211 Move NO_TERMIO to configure.
5212
5213 2012-06-12 Chong Yidong <cyd@gnu.org>
5214
5215 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5216 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5217 MagickExportImagePixels is undefined.
5218
5219 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5220
5221 * image.c (imagemagick_load_image): Remove unused label.
5222
5223 2012-06-11 Glenn Morris <rgm@gnu.org>
5224
5225 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5226 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5227 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5228 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5229
5230 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5231
5232 * alloc.c (make_byte_code): New function.
5233 (Fmake_byte_code): Use it. Don't purify here.
5234 * lread.c (read1): Use it as well to avoid extra allocation.
5235
5236 2012-06-11 Chong Yidong <cyd@gnu.org>
5237
5238 * image.c (imagemagick_load_image): Implement transparency.
5239
5240 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5241
5242 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5243 account for preceding backslashes. (Bug#11663)
5244
5245 2012-06-09 Chong Yidong <cyd@gnu.org>
5246
5247 * term.c: Support italics in capable terminals (Bug#9652).
5248 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5249 (turn_on_face): Output using TS_enter_italic_mode if available.
5250 Don't handle unused blinking and alt-charset cases.
5251 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5252 and tty_alt_charset_p cases.
5253 (tty_capable_p, init_tty): Support italics.
5254
5255 * termchar.h (struct tty_display_info): Add field for italics.
5256 Remove unused blink field.
5257
5258 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5259 Handle slant.
5260
5261 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5262 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5263 tty_alt_charset_p. Add tty_italic_p.
5264
5265 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5266
5267 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5268 dbus_type_is_basic if available.
5269 (xd_extract_signed, xd_extract_unsigned): Rename from
5270 extract_signed and extract_unsigned, respectively. Adapt callers.
5271
5272 2012-06-09 Chong Yidong <cyd@gnu.org>
5273
5274 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5275
5276 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5277 case (Bug#9752).
5278
5279 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5280
5281 * xdisp.c (vmessage): Treat frame message as multibyte.
5282 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5283 would generate the diagnostic "Making \302\247 buffer-local while
5284 let-bound!".
5285
5286 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5287
5288 * dispnew.c (showing_window_margins_p): Undo last change, which
5289 was done due to an inadvertent commit.
5290 (adjust_frame_glyphs_for_frame_redisplay): Do call
5291 showing_window_margins_p.
5292
5293 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5294
5295 * eval.c (Fmake_var_non_special): New primitive.
5296 (syms_of_eval): Defsubr it.
5297 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5298
5299 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5300
5301 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5302 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5303
5304 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5305
5306 * alloc.c (allocate_vectorlike): Fix last change.
5307
5308 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5309
5310 Block-based vector allocation of small vectors.
5311 * lisp.h (struct vectorlike_header): New field `nbytes',
5312 adjust comment accordingly.
5313 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5314 to denote vector blocks. Adjust users (live_vector_p,
5315 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5316 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5317 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5318 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5319 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5320 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5321 (roundup_size): New constant.
5322 (struct vector_block): New data type.
5323 (vector_blocks, vector_free_lists, zero_vector): New variables.
5324 (all_vectors): Rename to `large_vectors'.
5325 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5326 (sweep_vectors): New functions.
5327 (allocate_vectorlike): Return `zero_vector' as the only vector of
5328 0 items. Allocate new vector from block if vector size is less than
5329 or equal to VBLOCK_BYTES_MAX.
5330 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5331 (init_alloc_once): Add call to init_vectors.
5332
5333 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5334
5335 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5336
5337 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5338
5339 * doprnt.c (doprnt): Truncate multibyte char correctly.
5340 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5341 would mishandle a string argument "Xc" if X was a multibyte
5342 character of length 2: it would truncate after X's first byte
5343 rather than including all of X.
5344
5345 2012-06-06 Chong Yidong <cyd@gnu.org>
5346
5347 * buffer.c (word_wrap): Doc fix.
5348
5349 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5350
5351 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5352
5353 2012-06-03 Glenn Morris <rgm@gnu.org>
5354
5355 * xdisp.c (tool-bar-style): Doc fix.
5356
5357 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5358
5359 * Makefile.in (PAXCTL): Define.
5360 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5361 binary via PaX flags if the paxctl utility is available.
5362 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5363 Restore PaX flags to their default. (Bug#11398)
5364
5365 2012-06-03 Chong Yidong <cyd@gnu.org>
5366
5367 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5368 buffer (Bug#11226).
5369
5370 2012-06-03 Chong Yidong <cyd@gnu.org>
5371
5372 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5373 (note_mode_line_or_margin_highlight): If there is no help echo,
5374 use mode-line-default-help-echo. Handle the case where the mouse
5375 position is past the end of the mode line string.
5376
5377 * buffer.c (buffer_local_value_1): New function, split from
5378 Fbuffer_local_value; can return Qunbound.
5379 (Fbuffer_local_value): Use it.
5380 (Vmode_line_format): Docstring tweaks.
5381
5382 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5383
5384 * sysdep.c (system_process_attributes): Improve comment.
5385
5386 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5387
5388 * keyboard.c: Export real-this-command to Elisp.
5389 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5390 and DEFVAR it. Update all users.
5391
5392 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5393
5394 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5395
5396 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5397 Convert pctcpu and pctmem to Lisp float properly.
5398 Let the compiler fold better, as 100.0/0x8000 is exact.
5399
5400 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5401
5402 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5403 cons_block.
5404
5405 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5406
5407 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5408
5409 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5410
5411 For a 'struct window', replace some Lisp_Object fields to
5412 bitfields where appropriate, remove unused fields.
5413 * window.h (struct window): Remove unused 'last_mark_x' and
5414 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5415 change it's type from Lisp_Object to bitfield.
5416 Change type of 'force_start', 'optional_new_start',
5417 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5418 fields from Lisp_Object to bitfield. Adjust users accordingly.
5419
5420 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5421
5422 Pacify gcc -Wdouble-precision when using Xaw.
5423 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5424 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5425 Use 'float' consistently, rather than 'float' in most places
5426 and 'double' in a couple of places.
5427
5428 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5429
5430 * xdisp.c (handle_stop): Detect whether we have overlay strings
5431 loaded by testing it->current.overlay_string_index to be
5432 non-negative, instead of checking whether n_overlay_strings is
5433 positive. (Bug#11587)
5434
5435 2012-05-31 Chong Yidong <cyd@gnu.org>
5436
5437 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5438
5439 * doc.c (Fsubstitute_command_keys): Doc fix.
5440
5441 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5442
5443 * search.c (search_buffer): Remove calls to
5444 r_alloc_inhibit_buffer_relocation, as it is now called by
5445 maybe_unify_char, which was the cause of relocation of buffer text
5446 in bug#11519.
5447
5448 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5449
5450 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5451 for the duration of call to load_charset, to avoid problems with
5452 callers of maybe_unify_char that access buffer text through C
5453 pointers.
5454
5455 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5456 decrement the inhibition flag, instead of just setting or
5457 resetting it.
5458
5459 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5460
5461 Remove obsolete '#define static' cruft.
5462 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5463 This #undef was "temporary" in 2000; it is no longer needed
5464 now that '#define static' has gone away.
5465 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5466 (gray_bitmap_bits): Remove; no longer needed.
5467 All uses replaced with definiens.
5468 * xterm.c: Include "bitmaps/gray.xbm".
5469
5470 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5471
5472 Clean up __executable_start, monstartup when --enable-profiling.
5473 The following changes affect the code only when profiling.
5474 * dispnew.c (__executable_start): Rename from safe_bcopy.
5475 Define only on platforms that need it.
5476 * emacs.c: Include <sys/gmon.h> when profiling.
5477 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5478 (__executable_start): Remove decl, since lisp.h does it now.
5479 (safe_bcopy): Remove decl; no longer has that name.
5480 (main): Coalesce #if into single bit of code, for simplicity.
5481 Cast pointers to uintptr_t, since standard libraries want integers
5482 and not pointers.
5483 * lisp.h (__executable_start): New decl.
5484
5485 2012-05-31 Glenn Morris <rgm@gnu.org>
5486
5487 * image.c (Fimagemagick_types): Doc fix.
5488
5489 2012-05-30 Jim Meyering <meyering@redhat.com>
5490
5491 * callproc.c (Fcall_process_region): Include directory component
5492 in mkstemp error message (Bug#11586).
5493
5494 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5495
5496 * alloc.c, lisp.h (make_pure_vector): Now static.
5497
5498 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5499
5500 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5501 Move to byte-run.el.
5502 (Fautoload): Do the hash-doc more carefully.
5503 * data.c (Fdefalias): Purify definition, except for keymaps.
5504 (Qdefun): Move from eval.c.
5505 * lisp.h (Qdefun): Remove.
5506 * lread.c (read1): Tiny simplification.
5507
5508 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
5509
5510 Do not create empty overlays with the evaporate property (Bug#9642).
5511 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5512 Bug#9642, but explicitly check that the buffer the overlay would
5513 be moved to is live and rearrange lines to make sure that errors
5514 will not put the overlay in an inconsistent state.
5515 (Fdelete_overlay): Cosmetics.
5516
5517 2012-05-28 Eli Zaretskii <eliz@gnu.org>
5518
5519 * w32term.c (my_bring_window_to_top): New function.
5520 (x_raise_frame): Use handle returned by DeferWindowPos, which
5521 could be different from the original one.
5522 Call my_bring_window_to_top instead of my_set_foreground_window.
5523 (Bug#11513)
5524
5525 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5526 by calling BringWindowToTop.
5527
5528 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5529 (WM_EMACS_END): Increase by one.
5530
5531 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5532
5533 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5534 This avoids undefined behavior that might cause the eassert
5535 to not catch an out-of-range value.
5536
5537 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
5538
5539 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5540 Update dependencies.
5541
5542 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5543
5544 * bidi.c (bidi_mirror_char): Fix last change.
5545
5546 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5547
5548 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5549 when referring to sectname field in printf format.
5550
5551 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5552
5553 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5554 Only r_alloc_inhibit_buffer_relocation needed to be added;
5555 the others were already declared.
5556
5557 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5558 before checking whether it's out of range. Put the check inside
5559 eassert. See
5560 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5561
5562 2012-05-27 Ken Brown <kbrown@cornell.edu>
5563
5564 * callproc.c (Fcall_process): Restore a line that was accidentally
5565 commented out in the 2011-02-13 change (bug#11547).
5566
5567 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5568
5569 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5570 defined on ralloc.c.
5571
5572 * buffer.c [REL_ALLOC]: Remove prototypes of
5573 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5574 they are now on lisp.h.
5575
5576 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5577
5578 * search.c (search_buffer): Use it to inhibit relocation of buffer
5579 text while re_search_2 is doing its job, because re_search_2 is
5580 passed C pointers to buffer text. (Bug#11519)
5581
5582 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5583 Update value to 24.
5584
5585 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5586 state after an additional call to move_it_in_display_line_to, keep
5587 the values of it->max_ascent and it->max_descent found for the
5588 entire line.
5589 (pos_visible_p): Revert the comparison against bottom_y to what it
5590 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5591 (Bug#11464)
5592
5593 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5594
5595 Fix coding-related core dumps with gcc -ftrapv.
5596 The code was computing A - B, where A and B are pointers, and B is
5597 random garbage. This can lead to core dumps on platforms that
5598 have special pointer registers, and it also leads to core dumps on
5599 x86-64 when compiled with gcc -ftrapv. The fix is to compute
5600 A - B only when B is initialized properly.
5601 * coding.c (coding_set_source, coding_set_destination): Return void.
5602 (coding_change_source, coding_change_destinations): New functions,
5603 with the old behaviors of coding_set_source and coding_set_destination.
5604 All callers that need an offset changed to use these new functions.
5605
5606 2012-05-26 Glenn Morris <rgm@gnu.org>
5607
5608 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5609
5610 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5611
5612 Extend mouse support on W32 text-mode console.
5613 * xdisp.c (draw_row_with_mouse_face):
5614 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
5615
5616 * w32console.c: Include window.h.
5617 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5618 New functions.
5619 (initialize_w32_display): Initialize mouse-highlight data.
5620
5621 * w32inevt.c: Include termchar.h and window.h.
5622 (do_mouse_event): Support mouse-autoselect-window. When the mouse
5623 moves, call note_mouse_highlight. If help_echo changed, call
5624 gen_help_event to produce help-echo message in the echo area.
5625 Call clear_mouse_face if mouse_face_hidden is set in the mouse
5626 highlight info.
5627
5628 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5629
5630 * lread.c (read1): Simplify slightly to avoid an overflow warning
5631 with GCC 4.7.0 on x86-64.
5632
5633 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5634
5635 * bidi.c (bidi_mirror_char): Revert last change: an int is
5636 definitely wide enough here.
5637
5638 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
5639
5640 Fix integer width and related bugs (Bug#9874).
5641 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
5642 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5643 (string_bytes, check_sblock, allocate_string_data):
5644 (compact_small_strings, Fmake_bool_vector, make_string)
5645 (make_unibyte_string, make_multibyte_string)
5646 (make_string_from_bytes, make_specified_string)
5647 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5648 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5649 (mark_vectorlike):
5650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5651 (allocate_pseudovector):
5652 Use int, not EMACS_INT, where int is wide enough.
5653 (inhibit_garbage_collection, Fgarbage_collect):
5654 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5655 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5656 int might not be wide enough.
5657 (bidi_cache_search, bidi_cache_find, bidi_init_it)
5658 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5659 (bidi_at_paragraph_end, bidi_find_paragraph_start)
5660 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5661 (bidi_level_of_next_char, bidi_move_to_visually_next):
5662 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5663 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5664 (Fkill_buffer, Fset_buffer_major_mode)
5665 (advance_to_char_boundary, Fbuffer_swap_text)
5666 (Fset_buffer_multibyte, overlays_at, overlays_in)
5667 (overlay_touches_p, struct sortvec, record_overlay_string)
5668 (overlay_strings, recenter_overlay_lists)
5669 (adjust_overlays_for_insert, adjust_overlays_for_delete)
5670 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5671 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5672 (Foverlay_recenter, last_overlay_modification_hooks_used)
5673 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5675 (validate_region): Omit unnecessary test for b <= e,
5676 since that's guaranteed by the previous test.
5677 (adjust_overlays_for_delete): Avoid pos + length overflow.
5678 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5679 (report_overlay_modification):
5680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5681 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5682 Omit pointer cast, which isn't needed anyway, and doesn't work
5683 after the EMACS_INT -> ptrdiff_t change.
5684 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
5685 * buffer.h: Adjust decls to match defn changes elsewhere.
5686 (struct buffer_text, struct buffer):
5687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5688 Use EMACS_INT, not int, where int might not be wide enough.
5689 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5690 not int, to avoid needless 32-bit limit on 64-bit hosts.
5691 (exec_byte_code): Use tighter memory-full test, one that checks
5692 for alloca overflow. Don't compute the address of the object just
5693 before an array, as that's not portable. Use EMACS_INT, not
5694 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
5695 * callint.c (Fcall_interactively):
5696 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5697 * callproc.c (call_process_kill, Fcall_process):
5698 Don't assume pid_t fits into an Emacs fixnum.
5699 (call_process_cleanup, Fcall_process, child_setup):
5700 Don't assume pid_t fits into int.
5701 (call_process_cleanup, Fcall_process, delete_temp_file)
5702 (Fcall_process_region):
5703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5704 (Fcall_process): Simplify handling of volatile integers.
5705 Use int, not EMACS_INT, where int will do.
5706 * casefiddle.c (casify_object, casify_region, operate_on_word)
5707 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5708 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5709 (casify_object): Avoid integer overflow when overallocating buffer.
5710 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
5711 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
5712 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5713 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5714 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5715 integers are now checked earlier. All uses replaced with XINT.
5716 (ccl_driver):
5717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5718 For CCL_MapSingle, check that content and value are in int range.
5719 (ccl_driver, Fregister_code_conversion_map):
5720 Check that Vcode_version_map_vector is a vector.
5721 (resolve_symbol_ccl_program): Check that vector header is in range.
5722 Always copy the vector, so that we can check its contents reliably
5723 now rather than having to recheck each instruction as it's being
5724 executed. Check that vector words fit in 'int'.
5725 (ccl_get_compiled_code, Fregister_ccl_program)
5726 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5727 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5728 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5729 contents are in range.
5730 (Fccl_execute_on_string): Check that status is in range.
5731 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5732 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5733 Accept and return EMACS_INT, not int, because callers can pass values
5734 out of 'int' range.
5735 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5736 (multibyte_chars_in_text, parse_str_as_multibyte)
5737 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5738 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5739 (string_escape_byte8, Fget_byte):
5740 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5741 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
5742 avoid mishandling large integers.
5743 * character.h: Adjust decls to match defn changes elsewhere.
5744 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5745 (Ffind_charset_region):
5746 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5747 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5748 (load_charset_map_from_vector, Fdefine_charset_internal):
5749 Don't assume fixnum fits in int.
5750 (load_charset_map_from_vector, Fmap_charset_chars):
5751 Remove now-unnecessary CHECK_NATNUMs.
5752 (Fdefine_charset_internal): Check ranges here, more carefully.
5753 Don't rely on undefined behavior with signed left shift overflow.
5754 Don't assume unsigned int fits into fixnum, or that fixnum fits
5755 into unsigned int. Don't require max_code to be a valid fixnum;
5756 that's not true for gb10830 4-byte on a 32-bit host. Allow
5757 invalid_code to be a cons, for the same reason. Require code_offset
5758 to be a character. Avoid int overflow if max_char is close
5759 to INT_MAX.
5760 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5761 this is intended anyway and avoids some undefined behavior.
5762 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5763 INDEX_TO_CODE_POINT, as that's what it expects.
5764 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
5765 * charset.h (DECODE_CHAR): Return int, not unsigned;
5766 this is what was intended anyway, and it avoids undefined behavior.
5767 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5768 integer-overflow issues.
5769 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5770 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5771 where the argument is EMACS_INT, and this behavior is not intended.
5772 * chartab.c (Fmake_char_table, Fset_char_table_range)
5773 (uniprop_get_decoder, uniprop_get_encoder):
5774 Don't assume fixnum fits in int.
5775 * cmds.c (move_point): New function, that does the gist of
5776 Fforward_char and Fbackward_char, but does so while checking
5777 for integer overflow more accurately.
5778 (Fforward_char, Fbackward_char): Use it.
5779 (Fforward_line, Fend_of_line, internal_self_insert)
5780 (internal_self_insert):
5781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5782 Fix a FIXME, by checking for integer overflow when calculating
5783 target_clm and actual_clm.
5784 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
5785 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
5786 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5787 (coding_alloc_by_making_gap, alloc_destination)
5788 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5789 (encode_coding_utf_16, detect_coding_emacs_mule)
5790 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5791 (detect_coding_iso_2022, decode_coding_iso_2022)
5792 (encode_invocation_designation, encode_designation_at_bol)
5793 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5794 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5795 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5796 (encode_coding_ccl, encode_coding_raw_text)
5797 (detect_coding_charset, decode_coding_charset)
5798 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5799 (produce_composition, produce_charset, produce_annotation)
5800 (decode_coding, handle_composition_annotation)
5801 (handle_charset_annotation, consume_chars, decode_coding_gap)
5802 (decode_coding_object, encode_coding_object, detect_coding_system)
5803 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5804 (code_convert_region, code_convert_string)
5805 (Fdefine_coding_system_internal)
5806 (coding_set_source, coding_set_destination):
5807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5808 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5809 (Fdefine_coding_system_internal):
5810 Don't assume fixnums fit in int.
5811 (decode_coding_gap, decode_coding_object, encode_coding_object)
5812 (Fread_coding_system, Fdetect_coding_region)
5813 (Funencodable_char_position, Fcheck_coding_systems_region)
5814 (get_translation, handle_composition_annotation, consume_chars):
5815 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5816 (consume_chars): Rewrite to not calculate an address outside buffer.
5817 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
5818 Don't access memory outside of the args array.
5819 (Fdefine_coding_system_internal): Check for charset-id overflow.
5820 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5821 result of ENCODE_CHAR.
5822 * coding.h: Adjust decls to match defn changes elsewhere.
5823 (struct coding_system):
5824 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5825 * composite.c (get_composition_id, find_composition)
5826 (run_composition_function, update_compositions)
5827 (compose_text, composition_gstring_put_cache)
5828 (composition_gstring_p, composition_gstring_width)
5829 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5830 (composition_compute_stop_pos, composition_reseat_it)
5831 (composition_update_it, struct position_record)
5832 (find_automatic_composition, composition_adjust_point)
5833 (Fcomposition_get_gstring, Ffind_composition_internal):
5834 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5835 (update_compositions):
5836 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5837 * composite.h: Adjust decls to match defn changes elsewhere.
5838 (struct composition):
5839 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5840 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5841 Do not attempt to compute the address of the object just before a
5842 buffer; this is not portable.
5843 (Faref, Faset):
5844 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5845 (Faset): Use int, not EMACS_INT, where int is wide enough.
5846 (Fstring_to_number): Don't assume fixnums fit in int.
5847 (Frem): Don't assume arg is nonnegative.
5848 * dbusbind.c (xd_append_arg): Check for integers out of range.
5849 (Fdbus_call_method): Don't overflow the timeout int.
5850 (extract_signed, extract_unsigned): New functions.
5851 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5852 (xd_get_connection_references): Return ptrdiff_t, not int.
5853 All uses changed.
5854 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5855 (xd_read_message_1):
5856 Use int, not unsigned, where the dbus API uses int.
5857 (Fdbus_message_internal): Don't overflow mtype.
5858 (syms_of_dbusbind): Allocate right-sized buffer for integers.
5859 * dired.c (directory_files_internal, file_name_completion, scmp)
5860 (file_name_completion_stat):
5861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5862 (file_name_completion): Don't overflow matchcount.
5863 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5864 * dispextern.h: Adjust decls to match defn changes elsewhere.
5865 (struct text_pos, struct glyph, struct bidi_saved_info)
5866 (struct bidi_string_data, struct bidi_it, struct composition_it)
5867 (struct it):
5868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5869 (struct display_pos, struct composition_it, struct it):
5870 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5871 * dispnew.c (increment_matrix_positions)
5872 (increment_row_positions, mode_line_string)
5873 (marginal_area_string):
5874 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5875 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
5876 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5877 (duration_to_sec_usec): New function, to check for overflow better.
5878 (Fsleep_for, sit_for): Use it.
5879 * doc.c (get_doc_string, store_function_docstring):
5880 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5881 (get_doc_string, Fsnarf_documentation):
5882 Use int, not EMACS_INT, where int is wide enough.
5883 (get_doc_string):
5884 Use SAFE_ALLOCA, not alloca.
5885 Check for overflow when converting EMACS_INT to off_t.
5886 * doprnt.c (doprnt):
5887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5888 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5889 Don't assume uid_t fits into fixnum.
5890 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5891 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5892 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5893 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5894 (general_insert_function)
5895 (Finsert_char, make_buffer_string, make_buffer_string_both)
5896 (update_buffer_properties, Fbuffer_substring)
5897 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5898 (Fsubst_char_in_region, check_translation)
5899 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5900 (transpose_markers, Ftranspose_regions):
5901 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5902 (clip_to_bounds): Move to lisp.h as an inline function).
5903 (Fconstrain_to_field): Don't assume integers are nonnegative.
5904 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5905 (Fsubst_char_in_region, Fsave_restriction):
5906 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5907 (Femacs_pid): Don't assume pid_t fits into fixnum.
5908 (lo_time): Use int, not EMACS_INT, when int suffices.
5909 (lisp_time_argument): Check for usec out of range.
5910 (Fencode_time): Don't assume fixnum fits in int.
5911 (Fuser_login_name, Fuser_full_name): Signal an error
5912 if a uid argument is out of range, rather than relying on
5913 undefined behavior.
5914 (Fformat_time_string): Remove now-unnecessary check.
5915 lisp_time_argument checks for out-of-range usec now.
5916 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
5917 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5918 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5919 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5920 (init_cmdargs, Fdump_emacs):
5921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5922 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5923 the bottom (typically) 32 bits of the fixnum.
5924 * eval.c (specpdl_size, call_debugger):
5925 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5926 (when_entered_debugger, Fbacktrace_debug):
5927 Don't assume fixnum can fit in int.
5928 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5929 the object just before a buffer; this is not portable.
5930 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5931 (grow_specpdl, unbind_to):
5932 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5933 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5934 (grow_specpdl): Simplify allocation by using xpalloc.
5935 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
5936 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5937 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5938 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5939 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5940 (a_write, e_write):
5941 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5942 (Fcopy_file, non_regular_nbytes, read_non_regular)
5943 (Finsert_file_contents):
5944 Use int, not EMACS_INT, where int is wide enough.
5945 (READ_BUF_SIZE): Verify that it fits in int.
5946 (Finsert_file_contents): Check that counts are in proper range,
5947 rather than assuming fixnums fit into ptrdiff_t etc.
5948 Don't assume fixnums fit into int.
5949 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5950 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5951 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
5952 (string_char_to_byte, string_byte_to_char)
5953 (string_make_multibyte, string_to_multibyte)
5954 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5955 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5956 (substring_both, Fdelete, internal_equal, Ffillarray)
5957 (Fclear_string, mapcar1)
5958 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5959 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5960 (larger_vector, make_hash_table, maybe_resize_hash_table)
5961 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5962 (Fmaphash, secure_hash):
5963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5964 (concat): Check for string index and length overflow.
5965 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5966 (Frequire):
5967 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5968 (larger_vector): New API (vec, incr_min, size_max) replaces old
5969 one (vec, new_size, init). This catches size overflow.
5970 INIT was removed because it was always Qnil.
5971 All callers changed.
5972 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5973 the upper bound on a hash table index size.
5974 (make_hash_table, maybe_resize_hash_table): Use it.
5975 (secure_hash): Computer start_byte and end_byte only after
5976 they're known to be in ptrdiff_t range.
5977 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5978 (Ffont_get_glyphs, Ffont_at):
5979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5980 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5981 (Flist_fonts, Fopen_font):
5982 Don't assume fixnum can fit in int.
5983 (check_gstring): Don't assume index can fit in int.
5984 (font_match_p): Check that fixnum is a character, not a nonnegative
5985 fixnum, since the later code needs to stuff it into an int.
5986 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5987 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5988 conversion overflow issues.
5989 (Fopen_font): Check for integer out of range.
5990 (Ffont_get_glyphs): Don't assume index can fit in int.
5991 * font.h: Adjust decls to match defn changes elsewhere.
5992 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5993 integer overflow.
5994 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5995 printmax_t, where ptrdiff_t is wide enough.
5996 (Finternal_char_font):
5997 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5998 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5999 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6000 (Fset_frame_position, x_set_frame_parameters)
6001 (x_set_line_spacing, x_set_border_width)
6002 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6003 Check that fixnums are in proper range for system types.
6004 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6006 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6007 Use SAFE_ALLOCA_LISP, not alloca.
6008 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6009 intptr_t is wide enough.
6010 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6011 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6012 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6013 Check for fixnum out of range.
6014 * ftfont.c (ftfont_list): Don't assume index fits in int.
6015 Check that fixnums are in proper range for system types.
6016 (ftfont_shape_by_flt):
6017 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6018 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6019 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6020 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6021 Check that fixnums are in proper range for system types.
6022 * gnutls.h: Adjust decls to match defn changes elsewhere.
6023 * gtkutil.c (xg_dialog_run):
6024 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6025 (update_frame_tool_bar):
6026 Check that fixnums are in proper range for system types.
6027 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6028 (lookup_image): Check that fixnums are in range for system types.
6029 * indent.c (last_known_column, last_known_column_point):
6030 (current_column_bol_cache):
6031 (skip_invisible, current_column, check_display_width):
6032 (check_display_width, scan_for_column, current_column_1)
6033 (Findent_to, Fcurrent_indentation, position_indentation)
6034 (indented_beyond_p, Fmove_to_column, compute_motion):
6035 (Fcompute_motion, Fvertical_motion):
6036 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6037 (last_known_column_modified): Use EMACS_INT, not int.
6038 (check_display_width):
6039 (Fcompute_motion):
6040 Check that fixnums and floats are in proper range for system types.
6041 (compute_motion): Don't assume index or fixnum fits in int.
6042 (compute_motion, Fcompute_motion):
6043 Use int, not EMACS_INT, when it is wide enough.
6044 (vmotion): Omit local var start_hpos that is always 0; that way
6045 we don't need to worry about overflow in expressions involving it.
6046 * indent.h: Adjust decls to match defn changes elsewhere.
6047 (struct position):
6048 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6049 Use int, not EMACS_INT, where int is wide enough.
6050 Remove unused members ovstring_chars_done and tab_offset;
6051 all uses removed.
6052 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6053 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6054 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6055 (make_gap, copy_text, insert, insert_and_inherit)
6056 (insert_before_markers, insert_before_markers_and_inherit)
6057 (insert_1, count_combining_before, count_combining_after)
6058 (insert_1_both, insert_from_string)
6059 (insert_from_string_before_markers, insert_from_string_1)
6060 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6061 (adjust_after_replace, adjust_after_insert, replace_range)
6062 (replace_range_2, del_range, del_range_1, del_range_byte)
6063 (del_range_both, del_range_2, modify_region)
6064 (prepare_to_modify_buffer, signal_before_change)
6065 (signal_after_change, Fcombine_after_change_execute):
6066 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6067 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6068 (balance_an_interval, split_interval_right, split_interval_left)
6069 (find_interval, next_interval, update_interval)
6070 (adjust_intervals_for_insertion, delete_node, delete_interval)
6071 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6072 (static_offset_intervals, offset_intervals)
6073 (merge_interval_right, merge_interval_left, make_new_interval)
6074 (graft_intervals_into_buffer, temp_set_point_both)
6075 (temp_set_point, set_point, adjust_for_invis_intang)
6076 (set_point_both, move_if_not_intangible, get_property_and_range)
6077 (get_local_map, copy_intervals, copy_intervals_to_string)
6078 (compare_string_intervals, set_intervals_multibyte_1):
6079 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6080 * intervals.h: Adjust decls to match defn changes elsewhere.
6081 (struct interval):
6082 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6083 * keyboard.c (this_command_key_count, this_single_command_key_start)
6084 (before_command_key_count, before_command_echo_length, echo_now)
6085 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6086 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6087 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6088 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6089 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6090 (last_non_minibuf_size, last_point_position, echo_truncate)
6091 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6092 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6093 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6094 (stuff_buffered_input):
6095 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6096 (last_auto_save, command_loop_1, read_char):
6097 Use EMACS_INT, not int, to avoid integer overflow.
6098 (record_char): Avoid overflow in total_keys computation.
6099 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6100 * keyboard.h: Adjust decls to match defn changes elsewhere.
6101 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6102 (Fkey_description, Fdescribe_vector, Flookup_key):
6103 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6104 (click_position): New function, to check that positions are in range.
6105 (Fcurrent_active_maps):
6106 (describe_command):
6107 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6108 (Faccessible_keymaps, Fkey_description):
6109 (preferred_sequence_p):
6110 Don't assume fixnum can fit into int.
6111 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6112 Check for integer overflow in size calculations.
6113 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6114 avoid mishandling large integers.
6115 * lisp.h: Adjust decls to match defn changes elsewhere.
6116 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6117 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6118 (struct Lisp_Marker):
6119 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6120 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6121 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6122 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6123 All callers changed.
6124 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6125 Assume the arg has valid form, since it always does.
6126 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6127 unsigned integer system type.
6128 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6129 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6130 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6131 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6132 (duration_to_sec_usec): New decl.
6133 * lread.c (read_from_string_index, read_from_string_index_byte)
6134 (read_from_string_limit, readchar, unreadchar, openp)
6135 (read_internal_start, read1, oblookup):
6136 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6137 (Fload, readevalloop, Feval_buffer, Feval_region):
6138 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6139 (openp): Check for out-of-range argument to 'access'.
6140 (read1): Use int, not EMACS_INT, where int is wide enough.
6141 Don't assume fixnum fits into int.
6142 Fix off-by-one error that can read outside a buffer.
6143 (read_filtered_event): Use duration_to_sec_usec
6144 to do proper overflow checking on durations.
6145 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6146 in size calculation.
6147 (Fexecute_kbd_macro):
6148 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6149 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6150 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6151 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6152 (set_marker_both, set_marker_restricted_both, marker_position)
6153 (marker_byte_position, Fbuffer_has_markers_at):
6154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6155 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6156 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6157 It now merely ensures that the menu is large enough, without
6158 necessarily growing it, as this avoids some integer overflow issues.
6159 All callers changed.
6160 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6161 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6162 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6163 Use SAFE_ALLOCA_LISP, not alloca.
6164 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6165 to EMACS_INT. Check that fixnums are in proper range for system types.
6166 * minibuf.c (minibuf_prompt_width, string_to_object)
6167 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6168 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6169 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6170 (get_minibuffer, read_minibuf_unwind):
6171 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6172 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6173 this simplifies overflow checking. All callers changed.
6174 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6175 (Ftest_completion):
6176 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6177 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6178 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6179 Check that fixnums are in proper range for system types.
6180 (Fx_create_frame, Fx_show_tip):
6181 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6182 * nsfont.m (ns_findfonts, nsfont_list_family):
6183 Don't assume fixnum fits in long.
6184 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6185 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6186 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6187 wide enough.
6188 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6189 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6190 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6191 (PRINTDECLARE, PRINTPREPARE):
6192 (strout, print_string):
6193 (print, print_preprocess, print_check_string_charset_prop)
6194 (print_object):
6195 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6196 (PRINTDECLARE):
6197 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6198 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6199 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6200 (printchar, strout): Use xpalloc to catch size calculation overflow.
6201 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6202 (print_error_message): Use SAFE_ALLOCA, not alloca.
6203 (print_object): Use int, not EMACS_INT, where int is wide enough.
6204 (print_depth, new_backquote_output, print_number_index):
6205 Use ptrdiff_t, not int, where int might not be wide enough.
6206 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6207 (Fset_process_window_size, Fformat_network_address)
6208 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6209 (sigchld_handler):
6210 Check that fixnums are in proper range for system types.
6211 (Fsignal_process): Simplify by avoiding a goto.
6212 Check for process-ids out of pid_t range rather than relying on
6213 undefined behavior.
6214 (process_tick, update_tick): Use EMACS_INT, not int.
6215 (Fformat_network_address, read_process_output, send_process)
6216 (Fprocess_send_region, status_notify):
6217 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6218 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6219 (wait_reading_process_output, read_process_output, exec_sentinel):
6220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6221 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6222 (Faccept_process_output): Use duration_to_sec_usec to do proper
6223 overflow checking on durations.
6224 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6225 Don't assume pid_t fits in int.
6226 * process.h (struct Lisp_Process): Members tick and update_tick
6227 are now of type EMACS_INT, not int.
6228 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6229 configured --with-wide-int.
6230 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6231 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6232 * search.c (looking_at_1, string_match_1):
6233 (fast_string_match, fast_c_string_match_ignore_case)
6234 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6235 (scan_newline, find_before_next_newline, search_command)
6236 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6237 (set_search_regs, wordify):
6238 (Freplace_match):
6239 (Fmatch_data):
6240 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6241 (string_match_1, search_buffer, set_search_regs):
6242 (Fmatch_data):
6243 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6244 (wordify): Check for overflow in size calculation.
6245 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6246 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6247 Check that fixnums are in proper range for system types.
6248 * sound.c (struct sound_device)
6249 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6251 (Fplay_sound_internal):
6252 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6253 * syntax.c (struct lisp_parse_state, find_start_modiff)
6254 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6255 (Fparse_partial_sexp):
6256 Don't assume fixnums can fit in int.
6257 (struct lisp_parse_state, find_start_pos, find_start_value)
6258 (find_start_value_byte, find_start_begv)
6259 (update_syntax_table, char_quoted, dec_bytepos)
6260 (find_defun_start, prev_char_comend_first, back_comment):
6261 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6262 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6264 (Finternal_describe_syntax_value): Check that match_lisp is a
6265 character, not an integer, since the code stuffs it into int.
6266 (scan_words, scan_sexps_forward):
6267 Check that fixnums are in proper range for system types.
6268 (Fforward_word):
6269 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6270 (scan_sexps_forward):
6271 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6272 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6273 * syntax.h: Adjust decls to match defn changes elsewhere.
6274 (struct gl_state_s):
6275 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6276 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6277 MOST_POSITIVE_FIXNUM.
6278 * sysdep.c (wait_for_termination_1, wait_for_termination)
6279 (interruptible_wait_for_termination, mkdir):
6280 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6281 (emacs_read, emacs_write):
6282 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6283 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6284 and double all fit in int.
6285 * term.c (set_tty_color_mode):
6286 Check that fixnums are in proper range for system types.
6287 * termhooks.h (struct input_event):
6288 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6289 * textprop.c (validate_interval_range, interval_of)
6290 (Fadd_text_properties, set_text_properties_1)
6291 (Fremove_text_properties, Fremove_list_of_text_properties)
6292 (Ftext_property_any, Ftext_property_not_all)
6293 (copy_text_properties, text_property_list, extend_property_ranges)
6294 (verify_interval_modification):
6295 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6296 (Fnext_single_char_property_change)
6297 (Fprevious_single_char_property_change):
6298 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6299 (copy_text_properties):
6300 Check for integer overflow in index calculation.
6301 * undo.c (last_boundary_position, record_point, record_insert)
6302 (record_delete, record_marker_adjustment, record_change)
6303 (record_property_change):
6304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6305 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6306 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6307 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6308 (Fx_hide_tip, Fx_file_dialog):
6309 * w32menu.c (set_frame_menubar):
6310 Use ptrdiff_t, not int, for consistency with rest of code.
6311 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6312 (select_window, Fdelete_other_windows_internal)
6313 (window_scroll_pixel_based, window_scroll_line_based)
6314 (Frecenter, Fset_window_configuration):
6315 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6316 (Fset_window_hscroll, run_window_configuration_change_hook)
6317 (set_window_buffer, temp_output_buffer_show, scroll_command)
6318 (Fscroll_other_window, Frecenter):
6319 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6320 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6321 Don't assume fixnum fits in int.
6322 (Fset_window_scroll_bars):
6323 Check that fixnums are in proper range for system types.
6324 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6325 (string_pos, c_string_pos, number_of_chars, init_iterator)
6326 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6327 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6328 (compute_display_string_end, handle_face_prop)
6329 (face_before_or_after_it_pos, handle_invisible_prop)
6330 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6331 (display_prop_intangible_p, string_buffer_position_lim)
6332 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6333 (get_overlay_strings_1, get_overlay_strings)
6334 (iterate_out_of_display_property, forward_to_next_line_start)
6335 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6336 (get_next_display_element, set_iterator_to_next)
6337 (get_visually_first_element, compute_stop_pos_backwards)
6338 (handle_stop_backwards, next_element_from_buffer)
6339 (move_it_in_display_line_to, move_it_in_display_line)
6340 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6341 (add_to_log, message_dolog, message_log_check_duplicate)
6342 (message2, message2_nolog, message3, message3_nolog
6343 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6344 (current_message_1, truncate_echo_area, truncate_message_1)
6345 (set_message, set_message_1, store_mode_line_noprop)
6346 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6347 (text_outside_line_unchanged_p, check_point_in_composition)
6348 (reconsider_clip_changes)
6349 (redisplay_internal, set_cursor_from_row, try_scrolling)
6350 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6351 (redisplay_window, find_last_unchanged_at_beg_row)
6352 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6353 (trailing_whitespace_p, find_row_edges, display_line)
6354 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6355 (display_mode_element, store_mode_line_string)
6356 (pint2str, pint2hrstr, decode_mode_spec)
6357 (display_count_lines, display_string, draw_glyphs)
6358 (x_produce_glyphs, x_insert_glyphs)
6359 (rows_from_pos_range, mouse_face_from_buffer_pos)
6360 (fast_find_string_pos, mouse_face_from_string_pos)
6361 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6362 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6363 (safe_call, init_from_display_pos, handle_fontified_prop)
6364 (handle_single_display_spec, load_overlay_strings)
6365 (with_echo_area_buffer, setup_echo_area_for_printing)
6366 (display_echo_area, echo_area_display)
6367 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6368 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6369 (redisplay_window, dump_glyph_row, display_mode_line)
6370 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6371 (handle_display_spec, display_prop_string_p):
6372 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6373 (handle_single_display_spec, build_desired_tool_bar_string)
6374 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6375 (get_specified_cursor_type):
6376 Check that fixnums are in proper range for system types.
6377 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6378 (Flookup_image_map):
6379 Don't assume fixnums fit in int.
6380 (compare_overlay_entries):
6381 Avoid mishandling comparisons due to subtraction overflow.
6382 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6383 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6384 (handle_tool_bar_click):
6385 Use int, not unsigned, since we prefer signed and the signedness
6386 doesn't matter here.
6387 (get_next_display_element, next_element_from_display_vector):
6388 Use int, not EMACS_INT, when int is wide enough.
6389 (start_hourglass): Use duration_to_sec_usec to do proper
6390 overflow checking on durations.
6391 * xfaces.c (Fbitmap_spec_p):
6392 Check that fixnums are in proper range for system types.
6393 (compare_fonts_by_sort_order):
6394 Avoid mishandling comparisons due to subtraction overflow.
6395 (Fx_family_fonts, realize_basic_faces):
6396 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6397 (Fx_family_fonts):
6398 Don't assume fixnum fits in int.
6399 Use SAFE_ALLOCA_LISP, not alloca.
6400 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6401 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6402 (face_at_buffer_position, face_for_overlay_string)
6403 (face_at_string_position):
6404 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6405 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6406 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6407 (Fx_show_tip):
6408 Check that fixnums are in proper range for system types.
6409 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6410 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6411 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6412 (Fx_change_window_property): Don't assume fixnums fit in int.
6413 * xfont.c (xfont_chars_supported):
6414 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6415 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6416 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6417 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6418 * xml.c (parse_region):
6419 * xrdb.c (magic_file_p):
6420 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6421 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6422 (x_get_local_selection, x_reply_selection_request)
6423 (x_handle_selection_request, wait_for_property_change):
6424 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6425 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6426 short is wide enough.
6427 (x_send_client_event): Don't assume fixnum fits in int.
6428 * xterm.c (x_x_to_emacs_modifiers):
6429 Don't assume EMACS_INT overflows nicely into int.
6430 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6431 may come from Lisp.
6432 (handle_one_xevent): NATNUMP can eval its arg twice.
6433 (x_connection_closed):
6434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6435 * xterm.h: Adjust decls to match defn changes elsewhere.
6436 (struct scroll_bar): Use struct vectorlike_header
6437 rather than rolling our own approximation.
6438 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6439
6440 2012-05-25 Glenn Morris <rgm@gnu.org>
6441
6442 * lisp.mk (lisp): Update for more files being compiled now.
6443
6444 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6445
6446 * lread.c: Remove `read_pure' which makes no difference.
6447 (read_pure): Remove var.
6448 (unreadpure): Remove function.
6449 (readevalloop): Don't call read_list with -1 flag.
6450 (read1, read_vector): Don't test read_pure any more.
6451 (read_list): Simplify.
6452
6453 * fileio.c, character.h: Minor style tweaks.
6454
6455 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6456
6457 * window.h (clip_changed): Remove useless declaration.
6458
6459 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
6460
6461 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6462 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6463
6464 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6465
6466 Remove src/m/*.
6467 This directory predates autoconf and is no longer needed nowadays.
6468 Move its few remaining bits of functionality to where they're needed.
6469 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6470 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6471 * m/template.h: Remove.
6472 * Makefile.in (M_FILE): Remove. All uses removed.
6473 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6474 * lisp.h (USE_LSB_TAG):
6475 * mem-limits.h (EXCEEDS_LISP_PTR):
6476 Use VAL_MAX, not VALBITS, in #if.
6477 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6478 (EMACS_UINT): Define unconditionally now.
6479 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6480 (BITS_PER_EMACS_INT): New constants, replacing
6481 what used to be in config.h, but not useful in #if.
6482 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6483 define them any more.
6484 (VAL_MAX): New macro.
6485 (VALMASK): Use it.
6486 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6487 BITS_PER_EMACS_INT, in #if.
6488 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6489 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6490 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6491 * s/ms-w32.h (DATA_START):
6492 Move here from removed file m/intel386.h.
6493 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6494 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6495
6496 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6497
6498 Assume C89 or later.
6499 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6500 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6501 (xrealloc):
6502 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6503 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6504 * textprop.c, tparam.c (NULL): Remove.
6505 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6506 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6507 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
6508 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6509 * xterm.c (input_signal_count): Assume volatile works.
6510
6511 2012-05-21 Ken Brown <kbrown@cornell.edu>
6512
6513 * xgselect.c (xg_select): Fix first argument in call to 'select'
6514 (bug#11508).
6515
6516 2012-05-20 Ken Brown <kbrown@cornell.edu>
6517
6518 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
6519 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
6520
6521 2012-05-19 Ken Brown <kbrown@cornell.edu>
6522
6523 * xfns.c (x_in_use): Remove `static' qualifier.
6524 * xterm.h (x_in_use): Declare.
6525 * xgselect.c: Include xterm.h.
6526 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6527 and `display_arg' (bug#9754).
6528
6529 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6530
6531 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6532
6533 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6534 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6535
6536 2012-05-18 Eli Zaretskii <eliz@gnu.org>
6537
6538 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6539
6540 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
6541 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
6542
6543 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6544 reference to image_cache->refcount.
6545 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6546
6547 2012-05-17 Juri Linkov <juri@jurta.org>
6548
6549 * search.c (Fword_search_regexp, Fword_search_backward)
6550 (Fword_search_forward, Fword_search_backward_lax)
6551 (Fword_search_forward_lax): Move functions to isearch.el
6552 (bug#10145, bug#11381).
6553
6554 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6555
6556 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6557
6558 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6559
6560 * lread.c (init_obarray): Declare Qt and Qnil as special.
6561
6562 2012-05-14 Glenn Morris <rgm@gnu.org>
6563
6564 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
6565 Put "libexec" before "bin", for the sake of init_callproc_1.
6566
6567 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6568
6569 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6570
6571 * unexaix.c: Port to more-recent AIX compilers.
6572 (report_error, report_error_1, make_hdr, copy_sym)
6573 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6574 Make arguments const char *, not char *, to avoid violations of C
6575 standard and to fix some AIX warnings reported by Gilles Pion.
6576
6577 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6578
6579 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6580 already have overlays loaded.
6581 (handle_single_display_spec): Before returning without displaying
6582 fringe bitmap, synchronize the bidi iterator with the main display
6583 iterator, by calling iterate_out_of_display_property.
6584 (iterate_out_of_display_property): Detect buffer iteration by
6585 testing that it->string is a Lisp string.
6586 (get_next_display_element): When the current object is exhausted,
6587 and there's something on it->stack, call set_iterator_to_next to
6588 proceed with what's on the stack, instead of returning zero.
6589 (set_iterator_to_next): If called at the end of a Lisp string,
6590 proceed to consider_string_end without incrementing string
6591 position. Don't increment display vector index past the end of
6592 the display vector. (Bug#11417)
6593 (pos_visible_p): Don't report a position visible when move_it_to
6594 stopped at the last line of window, which happens to be scanned
6595 backwards by the bidi iteration. (Bug#11464)
6596
6597 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6598
6599 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6600 and right-margin display specs even if the spec is invalid or we
6601 are on a TTY, and thus unable to display on the fringes.
6602 That's because the text with the property will not be displayed anyway,
6603 so we need to signal to the caller that this is a "replacing"
6604 display spec. This fixes display when the spec is invalid or we
6605 are on a TTY.
6606
6607 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6608
6609 * unexaix.c (make_hdr): Fix typo in prototype.
6610 This bug broke the build on AIX. Problem reported by Gilles Pion.
6611
6612 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
6613
6614 * keyboard.c (kbd_buffer_get_event): Read special events also in
6615 batch mode. (Bug#11415)
6616
6617 2012-05-12 Glenn Morris <rgm@gnu.org>
6618
6619 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6620
6621 2012-05-12 Eli Zaretskii <eliz@gnu.org>
6622
6623 * lisp.mk (lisp): Add newcomment.elc.
6624
6625 2012-05-12 Glenn Morris <rgm@gnu.org>
6626
6627 * Makefile.in (MKDIR_P): New, set by configure.
6628 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6629
6630 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6631
6632 Remove unused function hourglass_started.
6633 * dispextern.h (hourglass_started):
6634 * w32fns.c (hourglass_started):
6635 * xdisp.c (hourglass_started): Remove.
6636
6637 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
6638
6639 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6640 Update dependencies.
6641
6642 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6643
6644 * xgselect.c (xg_select): Put maxfds+1 into a var.
6645 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6646
6647 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6648
6649 2012-05-10 Dave Abrahams <dave@boostpro.com>
6650
6651 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6652 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6653
6654 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
6655
6656 * dbusbind.c (xd_registered_buses): New internal Lisp object.
6657 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6658 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6659 Initialize xd_registered_buses.
6660
6661 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6662
6663 Untag more efficiently if USE_LSB_TAG.
6664 This is based on a proposal by YAMAMOTO Mitsuharu in
6665 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6666 For an admittedly artificial (nth 8000 longlist) benchmark on
6667 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
6668 Emacs's overall text size by 1%.
6669 * lisp.h (XUNTAG): New macro.
6670 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6671 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6672 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6673 * eval.c (Fautoload):
6674 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6675 * frame.h (XFRAME): Use XUNTAG.
6676
6677 Port recent dbusbind.c changes to 32-bit --with-wide-int.
6678 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6679 Remove unportable assumptions about print widths of types like
6680 dbus_uint32_t.
6681 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6682 intptr_t when converting between pointer and integer, to avoid GCC
6683 warnings about wrong width.
6684
6685 2012-05-09 Eli Zaretskii <eliz@gnu.org>
6686
6687 * w32proc.c (new_child): Force Windows to reserve only 64KB of
6688 stack for each reader_thread, instead of defaulting to 8MB
6689 determined by the linker. This avoids failures in creating
6690 subprocesses on Windows 7, see the discussion in this thread:
6691 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6692
6693 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6694
6695 Fix up display of the *Minibuf-0* buffer in the mini window.
6696 * keyboard.c (read_char): Don't clear the echo area if there's no
6697 message to clear.
6698 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
6699 contents of *Minibuf-0*) if there's no message displayed in its stead.
6700
6701 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
6702
6703 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6704 batch mode.
6705
6706 2012-05-06 Chong Yidong <cyd@gnu.org>
6707
6708 * lisp.mk (lisp): Update.
6709
6710 2012-05-05 Jim Meyering <meyering@redhat.com>
6711
6712 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6713
6714 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6715
6716 * data.c (PUT_ERROR): New macro.
6717 (syms_of_data): Use it. Add new error type `user-error'.
6718 * undo.c (user_error): New function.
6719 (Fprimitive_undo): Use it.
6720 * print.c (print_error_message): Adjust print style for `user-error'.
6721 * keyboard.c (user_error): New function.
6722 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6723
6724 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6725
6726 Do not limit current-time-string to years 1000..9999.
6727 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6728 (Fcurrent_time_string): Support any year that is supported by the
6729 underlying localtime representation. Don't use asctime, as it
6730 has undefined behavior for years outside the range -999..9999.
6731
6732 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6733
6734 Fix race conditions involving setenv, gmtime, localtime, asctime.
6735 Without this fix, interrupts could mess up code that uses these
6736 nonreentrant functions, since setting TZ invalidates existing
6737 tm_zone or tzname values, and since most of these functions return
6738 pointers to static storage.
6739 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6740 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6741 Grow the critical sections to include not just invoking
6742 localtime/gmtime, but also accessing these functions' results
6743 including their tm_zone values if any, and any related TZ setting.
6744 (format_time_string): Last arg is now struct tm *, not struct tm **,
6745 so that the struct tm is saved in the critical section.
6746 All callers changed. Simplify allocation of initial buffer, partly
6747 motivated by the fact that memory allocation needs to be outside
6748 the critical section.
6749
6750 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6751
6752 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6753 with RESET_INTERVAL.
6754
6755 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6756 Remove duplicated buffer name initialization.
6757
6758 2012-05-02 Jim Meyering <jim@meyering.net>
6759
6760 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6761
6762 * xfns.c (x_window): Use xstrdup (Bug#11375).
6763
6764 2012-05-02 Eli Zaretskii <eliz@gnu.org>
6765
6766 * xdisp.c (pos_visible_p): If already at a newline from the
6767 display string before the 'while' loop, don't walk back the glyphs
6768 from it3.glyph_row. Solves assertion violation when the display
6769 string begins with a newline (egg.el). (Bug#11367)
6770
6771 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6772
6773 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6774 Move to simple.el.
6775
6776 2012-05-01 Glenn Morris <rgm@gnu.org>
6777
6778 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6779 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6780 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6781 All were removed before 23.1.
6782
6783 * dispnew.c: Remove HAVE_LIBNCURSES test;
6784 it is always true on relevant platforms.
6785
6786 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6787 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6788
6789 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6790
6791 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6792
6793 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6794 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6795 Remove.
6796
6797 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6798
6799 Do not avoid creating empty evaporating overlays (Bug#9642).
6800 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6801 That is, do not delete an evaporating overlay if it becomes
6802 empty after its bounds are adjusted to fit within its buffer.
6803 This fix caused other problems, and I'm reverting it until we get
6804 to the bottom of them.
6805
6806 2012-04-27 Chong Yidong <cyd@gnu.org>
6807
6808 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6809
6810 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6811
6812 * xdisp.c (pos_visible_p): If the window start position is beyond
6813 ZV, start the display from buffer beginning. Prevents assertion
6814 violation in init_iterator when the minibuffer window is scrolled
6815 via the scroll bar.
6816
6817 * window.c (window_scroll_pixel_based): Likewise.
6818
6819 2012-04-27 Chong Yidong <cyd@gnu.org>
6820
6821 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6822
6823 2012-04-27 Glenn Morris <rgm@gnu.org>
6824
6825 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6826 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6827
6828 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6829
6830 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6831 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
6832
6833 2012-04-26 Eli Zaretskii <eliz@gnu.org>
6834
6835 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6836 display element, check also the underlying string or buffer
6837 character. (Bug#11341)
6838
6839 * w32menu.c: Include w32heap.h.
6840 (add_menu_item): If the call to AppendMenuW (via
6841 unicode_append_menu) fails, disable Unicode menus only if we are
6842 running on Windows 9X/Me.
6843
6844 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6845
6846 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6847 (xgetint): Add missing shift for LSB tags.
6848
6849 2012-04-24 Martin Rudalics <rudalics@gmx.at>
6850
6851 * keyboard.c (read_char): Don't wipe echo area for select window
6852 events: These might get delayed via `mouse-autoselect-window'
6853 (Bug#11304).
6854
6855 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
6856
6857 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6858 manipulation of :loaded-from data.
6859
6860 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
6861
6862 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6863 now a cons (bug#11311).
6864
6865 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6866
6867 Do not create empty overlays with the evaporate property (Bug#9642).
6868 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6869 if it becomes empty after its bounds are adjusted to fit within
6870 its buffer. Without this fix, in a nonempty buffer (let ((o
6871 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6872 yields an empty overlay that has the evaporate property, which is
6873 not supposed to happen.
6874
6875 Fix minor GTK3 problems found by static checking.
6876 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6877 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6878 (struct _EmacsFixedClass, emacs_fixed_get_type):
6879 Move decls here from emacsgtkfixed.h, since they needn't be public.
6880 (emacs_fixed_get_type): Now static.
6881 (emacs_fixed_class_init): Omit unused local.
6882 (emacs_fixed_child_type): Remove; unused.
6883 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6884 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6885 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6886 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6887 (EMACS_FIXED_GET_CLASS): Remove; unused.
6888 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6889
6890 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6891 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6892
6893 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6894
6895 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
6896 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
6897 (__malloc_size_t, __malloc_ptrdiff_t):
6898 Remove. All uses removed, replaced by the definiens if needed,
6899 since we can assume C89 or better now.
6900 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6901 (protect_malloc_state, align, get_contiguous_space)
6902 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6903 (malloc_atfork_handler_child, malloc_enable_thread)
6904 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6905 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6906 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6907 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6908 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6909 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6910 Define using prototypes, not old style.
6911 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6912 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6913 (align): Don't assume that signed integer overflow wraps around.
6914 Omit unused local var.
6915 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6916 (_free_internal_nolock, memalign, mallochook, reallochook):
6917 Omit no-longer-needed casts.
6918 (valloc): Use getpagesize, not __getpagesize.
6919 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6920 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6921
6922 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6923
6924 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
6925
6926 Move functions from C to Lisp. Make non-blocking method calls
6927 the default. Implement further D-Bus standard interfaces.
6928
6929 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6930 (QCdbus_request_name_allow_replacement)
6931 (QCdbus_request_name_replace_existing)
6932 (QCdbus_request_name_do_not_queue)
6933 (QCdbus_request_name_reply_primary_owner)
6934 (QCdbus_request_name_reply_in_queue)
6935 (QCdbus_request_name_reply_exists)
6936 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6937 (QCdbus_registered_serial, QCdbus_registered_method)
6938 (QCdbus_registered_signal): New Lisp objects.
6939 (XD_DEBUG_MESSAGE): Use sizeof.
6940 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6941 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6942 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6943 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6944 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6945 (xd_signature, xd_append_arg): Allow float for integer types.
6946 (xd_get_connection_references): New function.
6947 (xd_get_connection_address): Rename from xd_initialize.
6948 Return cached address.
6949 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6950 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6951 level.
6952 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
6953 Return number of refcounts.
6954 (Fdbus_get_unique_name): Make stronger parameter check.
6955 (Fdbus_message_internal): New defun.
6956 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6957 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6958 (Fdbus_send_signal, Fdbus_register_service)
6959 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6960 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6961 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6962 (Vdbus_compiled_version, Vdbus_runtime_version)
6963 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6964 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6965 (Vdbus_message_type_signal): New defvars.
6966 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6967 Adapt docstring.
6968
6969 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6970
6971 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6972 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6973 Do not assume ptrdiff_t is the same width as 'int'.
6974
6975 * alloc.c: Handle unusual debugging option combinations.
6976 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6977 since the two debugging options are incompatible.
6978 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6979 is defined.
6980 (mem_init, mem_insert, mem_insert_fixup):
6981 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6982 (NEED_MEM_INSERT): Remove; no longer needed.
6983
6984 2012-04-22 Leo Liu <sdl.web@gmail.com>
6985
6986 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6987
6988 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6989
6990 * sysdep.c [__FreeBSD__]: Minor cleanups.
6991 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6992 Use Emacs indenting style more consistently. Avoid some casts.
6993 Use 'double' consistently rather than mixing 'float' and 'double'.
6994
6995 2012-04-21 Eduard Wiebe <usenet@pusto.de>
6996
6997 * sysdep.c (list_system_processes, system_process_attributes):
6998 Add implementation for FreeBSD (Bug#5243).
6999
7000 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7001
7002 * lisp.mk (lisp): Update.
7003
7004 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7005
7006 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7007 It is never used otherwise.
7008
7009 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7010
7011 * print.c (print_preprocess): Only check print_depth if print-circle
7012 is nil.
7013 (print_object): Check for cycles even when print-circle is nil and
7014 print-gensym is t, but only check print_depth if print-circle is nil.
7015
7016 2012-04-20 Chong Yidong <cyd@gnu.org>
7017
7018 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7019 set the status to "failed" and ensure that sentinel is run.
7020
7021 2012-04-20 Glenn Morris <rgm@gnu.org>
7022
7023 * process.c (Fset_process_inherit_coding_system_flag)
7024 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7025 (Fmake_network_process, Fmake_serial_process): Doc fix.
7026
7027 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7028
7029 * xdisp.c (string_buffer_position_lim): Limit starting position to
7030 BEGV.
7031 (set_cursor_from_row): If called for a mode-line or header-line
7032 row, return zero immediately.
7033 (try_cursor_movement): If inside continuation line, don't back up
7034 farther than the first row after the header line, if any.
7035 Don't consider the header-line row as "partially visible", even if
7036 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7037
7038 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7039
7040 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7041 (bug#11238).
7042
7043 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7044 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7045
7046 configure: new option --enable-gcc-warnings (Bug#11207)
7047 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7048 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7049 (ALL_CFLAGS): Use new macros rather than old.
7050 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7051 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7052 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7053 -Wunused-result, -Wunused-variable. This should go away once
7054 the Emacs and Gnulib regex code is merged.
7055 (xmalloc, xrealloc): Now static.
7056
7057 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7058
7059 * dired.c (Fsystem_groups): Remove unused local.
7060
7061 2012-04-17 Glenn Morris <rgm@gnu.org>
7062
7063 * dired.c (Fsystem_users): Doc fix.
7064
7065 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7066
7067 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7068 (syms_of_dired): Add them.
7069
7070 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7071
7072 Fix minor alloc.c problems found by static checking.
7073 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7074 New extern decls, to avoid calling undeclared functions.
7075 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7076 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7077 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7078 (NEED_MEM_INSERT): New macro.
7079 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7080 Remove one incorrect comment and fix another.
7081
7082 Fix minor ralloc.c problems found by static checking.
7083 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7084 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7085 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7086 (r_alloc_sbrk): Now static.
7087
7088 Improve ralloc.c interface checking.
7089 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7090 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7091 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7092 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7093 [REL_ALLOC]: ... to here, to check interface.
7094 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7095 Remove decls. This fixes an "It stinks!".
7096
7097 * alloc.c (which_symbols): Fix alignment issue / type clash.
7098
7099 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7100
7101 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7102 (struct Lisp_Misc_Any): Likewise.
7103 (struct Lisp_Free): Likewise.
7104 * alloc.c (union aligned_Lisp_Symbol): Define.
7105 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7106 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7107 (union aligned_Lisp_Misc): Define.
7108 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7109 aligned_Lisp_Misc instead of union Lisp_Misc.
7110 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7111
7112 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7113
7114 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7115 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7116 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7117 * s/netbsd.h, s/sol2-6.h:
7118 Remove definition of GC_MARK_STACK, since the default now works.
7119 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7120 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7121 no longer the default.
7122 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7123
7124 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7125
7126 * lread.c (lisp_file_lexically_bound_p):
7127 Fix hang at ";-*-\n" (bug#11238).
7128
7129 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7130
7131 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7132 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7133
7134 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7135
7136 * nsterm.m (constrainFrameRect): Always constrain when there is only
7137 one screen (Bug#10962).
7138
7139 2012-04-13 Ken Brown <kbrown@cornell.edu>
7140
7141 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7142
7143 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7144
7145 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7146
7147 2012-04-11 Daniel Colascione <dancol@dancol.org>
7148
7149 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7150 against is gone. It's better to use vfork now so that when Cygwin
7151 gains a new, working vfork, we use it automatically (bug#10398).
7152
7153 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7154
7155 * window.c (save_window_save): Obey window-point-insertion-type.
7156
7157 2012-04-11 Glenn Morris <rgm@gnu.org>
7158
7159 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7160
7161 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7162
7163 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7164
7165 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7166
7167 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7168 (force_quit_count): New var.
7169 (handle_interrupt): Use it.
7170
7171 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7172
7173 * w32.c (w32_delayed_load): Record the full path of the library
7174 being loaded (bug#10424).
7175
7176 2012-04-09 Glenn Morris <rgm@gnu.org>
7177
7178 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7179 not just in the obarray, before snarfing them. (Bug#11036)
7180
7181 * Makefile.in ($(leimdir)/leim-list.el):
7182 Pass EMACS rather than BUILT_EMACS.
7183
7184 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7185
7186 * process.c (make_process):
7187 * process.h: Add integer `gnutls_handshakes_tried' member to
7188 process struct.
7189
7190 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7191 Add convenience `GNUTLS_LOG2i' macro.
7192
7193 * gnutls.c (gnutls_log_function2i): Convenience log function.
7194 (emacs_gnutls_read): Use new log functions,
7195 `gnutls_handshakes_tried' process member, and
7196 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7197 attempts per process (connection).
7198
7199 2012-04-09 Chong Yidong <cyd@gnu.org>
7200
7201 * eval.c (Fuser_variable_p, user_variable_p_eh)
7202 (lisp_indirect_variable): Functions deleted.
7203 (Fdefvar): Caller changed.
7204
7205 * callint.c (Finteractive, Fcall_interactively):
7206 * minibuf.c (Fread_variable): Callers changed.
7207
7208 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7209
7210 * xdisp.c (set_cursor_from_row): If the display string appears in
7211 the buffer at position that is closer to point than the position
7212 after the display string, display the cursor on the first glyph of
7213 the display string. Fixes cursor display when a 'display' text
7214 property immediately follows invisible text. (Bug#11094)
7215
7216 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7217
7218 composite.c: use 'double' consistently
7219 * composite.c (get_composition_id): Use 'double' consistently
7220 instead of converting 'float' to 'double' and vice versa; this is
7221 easier to understand and avoids a GCC warning.
7222
7223 2012-04-09 Glenn Morris <rgm@gnu.org>
7224
7225 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7226 preparation for dumping it with emacs. (Bug#4789)
7227 (leimdir): New variable.
7228 ($(leimdir)/leim-list.el): New rule.
7229 (emacs$(EXEEXT)): Depend on leim-list.el.
7230
7231 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7232 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7233 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7234
7235 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7236
7237 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7238 proper alignment.
7239
7240 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7241
7242 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7243 Remove unused local variable.
7244
7245 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7246
7247 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7248 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7249 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7250 objects, as mark_maybe_pointer will catch them otherwise.
7251 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7252 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7253
7254 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7255
7256 Fix typo that broke non-Windows builds.
7257 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7258
7259 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7260
7261 Support building on MS-Windows with libxml2.
7262
7263 * makefile.w32-in (OBJ2): Add xml.$(O).
7264 (GLOBAL_SOURCES): Add xml.c.
7265 ($(BLD)/xml.$(O)): New dependency list.
7266
7267 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7268 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7269 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7270 [!WINDOWSNT]: New macros.
7271 (init_libxml2_functions, libxml2_loaded_p): New functions.
7272 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7273 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7274 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7275 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7276 linked in).
7277 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7278 Call init_libxml2_functions before calling libxml2 functions.
7279 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7280
7281 * emacs.c: Don't include libxml/parser.h.
7282 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7283 xmlCleanupParser directly.
7284
7285 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7286
7287 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7288
7289 * indent.c (Fvertical_motion): If there is a display string at
7290 point, use it.vpos to compute how many lines to backtrack after
7291 move_it_to point. (Bug#11133)
7292
7293 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7294
7295 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7296 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7297 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7298 macros related to unification of CJK characters. For the details,
7299 see the discussion following the message here:
7300 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7301
7302 2012-04-04 Chong Yidong <cyd@gnu.org>
7303
7304 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7305
7306 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7307
7308 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7309 instead of alloca. (Bug#11138)
7310
7311 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7312
7313 * w32menu.c (is_simple_dialog): Properly check lisp types.
7314 (Bug#11141)
7315
7316 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7317
7318 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7319 position we get to after a call to move_it_to fails the
7320 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7321 only if we wind up in a string from display property. (Bug#11063)
7322
7323 * window.c (Fdelete_other_windows_internal): Invalidate the row
7324 and column information about mouse highlight, so that redisplay
7325 restores it after reallocating the glyph matrices. (Bug#7464)
7326
7327 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7328 string comes from a `display' text property, use the buffer
7329 position of that property as if we actually saw that position in
7330 the row's glyphs.
7331 (move_it_by_lines): Remove the assertion that
7332 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7333 violated when there's a before-string at the beginning of a line.
7334 (Bug#11063)
7335
7336 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7337
7338 * xdisp.c (append_space_for_newline): If the default face was
7339 remapped, use the remapped face for the appended newline.
7340 (extend_face_to_end_of_line): Use the remapped default face for
7341 extending the face to the end of the line.
7342 (display_line): Call extend_face_to_end_of_line when the default
7343 face was remapped. (Bug#11068)
7344
7345 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7346
7347 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7348
7349 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7350
7351 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7352
7353 2012-03-27 Glenn Morris <rgm@gnu.org>
7354
7355 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7356 Doc fixes.
7357
7358 2012-03-26 Kenichi Handa <handa@m17n.org>
7359
7360 * dispextern.h (struct glyph): Fix previous change. Change the
7361 bit length of glyphless.ch to 25 (Bug#11082).
7362
7363 2012-03-26 Chong Yidong <cyd@gnu.org>
7364
7365 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7366 (command_loop_1): Use it; inhibit selection update for
7367 handle-select-window too (Bug#8996).
7368
7369 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7370
7371 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7372
7373 2012-03-25 Kenichi Handa <handa@m17n.org>
7374
7375 * dispextern.h (struct glyph): Change the bit length of
7376 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7377
7378 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7379
7380 * s/ms-w32.h (tzname): Include time.h before redirecting to
7381 _tzname. Fixes the MSVC build. (Bug#9960)
7382
7383 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7384
7385 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7386 characters.
7387
7388 * xterm.c (XTread_socket): Only modify handling_signal if
7389 !SYNC_INPUT. (Bug#11080)
7390
7391 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7392
7393 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7394 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7395 when fetching a multibyte character consumes more bytes than
7396 CHAR_BYTES returns, due to unification of CJK characters in
7397 string_char. (Bug#11073)
7398
7399 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7400
7401 * process.c (wait_reading_process_output): Handle pty disconnect
7402 by refraining from sending oneself a SIGCHLD (bug#10933).
7403
7404 2012-03-22 Chong Yidong <cyd@gnu.org>
7405
7406 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7407
7408 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7409 Mark string as coming from a prefix property.
7410 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7411 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7412
7413 2012-03-21 Chong Yidong <cyd@gnu.org>
7414
7415 * xfaces.c (Vface_remapping_alist): Doc fix.
7416
7417 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7418
7419 * w32proc.c (Fw32_set_console_codepage)
7420 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7421 Doc fixes.
7422
7423 2012-03-20 Chong Yidong <cyd@gnu.org>
7424
7425 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7426 to reflect default non-nil value of redisplay-dont-pause.
7427
7428 2012-03-19 Kenichi Handa <handa@m17n.org>
7429
7430 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7431 it fit in a valid range (Bug#11003).
7432
7433 2012-03-18 Eli Zaretskii <eliz@gnu.org>
7434
7435 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7436 that is not from display property, accept the row as a "cursor
7437 row" if one of the string's character has a non-nil `cursor'
7438 property. Fixes cursor positioning when there are newlines in
7439 overlay strings, e.g. in icomplete.el. (Bug#11035)
7440
7441 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7442
7443 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7444
7445 2012-03-12 Chong Yidong <cyd@gnu.org>
7446
7447 * eval.c (inhibit_lisp_code): Rename from
7448 inhibit_window_configuration_change_hook; move from window.c.
7449
7450 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7451 * window.c (run_window_configuration_change_hook)
7452 (syms_of_window): Callers changed.
7453
7454 2012-03-11 Chong Yidong <cyd@gnu.org>
7455
7456 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7457
7458 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7459
7460 2012-03-10 Chong Yidong <cyd@gnu.org>
7461
7462 * frame.c (other_visible_frames): Don't assume the selected frame
7463 is visible (Bug#10955).
7464
7465 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7466
7467 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7468
7469 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7470
7471 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7472 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7473 zero (Bug#10954).
7474
7475 2012-03-03 Glenn Morris <rgm@gnu.org>
7476
7477 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
7478
7479 2012-03-02 Eli Zaretskii <eliz@gnu.org>
7480
7481 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7482 position past the first glyph_row that ends at ZV. (Bug#10902)
7483 (redisplay_window, next_element_from_string): Fix typos in
7484 comments.
7485 (redisplay_window): Pass to move_it_vertically the margin in
7486 pixels, not in screen lines.
7487
7488 2012-03-02 Glenn Morris <rgm@gnu.org>
7489
7490 * buffer.c (buffer-list-update-hook): Doc fix.
7491
7492 2012-02-29 Eli Zaretskii <eliz@gnu.org>
7493
7494 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7495 push_it before setting up the iterator for the first overlay
7496 string, even if we have an empty string loaded.
7497 (next_overlay_string): If there's an empty string on the iterator
7498 stack, pop the stack. (Bug#10903)
7499
7500 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7501
7502 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7503 Suggested by Stefan Monnier in
7504 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7505 * alloc.c (widen_to_Lisp_Object): New static function.
7506 (mark_memory): Also mark Lisp_Objects by fetching pointer words
7507 and widening them to Lisp_Objects. This would work even if
7508 USE_LSB_TAG is defined and wide integers are used, which might
7509 happen in a future version of Emacs.
7510
7511 2012-02-25 Chong Yidong <cyd@gnu.org>
7512
7513 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7514 Doc fix.
7515
7516 * xselect.c (Fx_selection_exists_p): Doc fix.
7517 (x_clipboard_manager_save_all): Print an informative message
7518 before saving to clipboard manager.
7519
7520 2012-02-24 Chong Yidong <cyd@gnu.org>
7521
7522 * keyboard.c (process_special_events): Handle all X selection
7523 requests in kbd_buffer, not just the next one (Bug#8869).
7524
7525 2012-02-23 Chong Yidong <cyd@gnu.org>
7526
7527 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7528 call when setting menu-bar-lines and tool-bar-lines parameters.
7529 (unwind_create_frame_1): New helper function.
7530
7531 * window.c (inhibit_window_configuration_change_hook): New var.
7532 (run_window_configuration_change_hook): Obey it.
7533 (syms_of_window): Initialize it.
7534
7535 2012-02-22 Chong Yidong <cyd@gnu.org>
7536
7537 * xterm.c (x_draw_image_relief): Add missing type check for
7538 Vtool_bar_button_margin (Bug#10743).
7539
7540 2012-02-21 Chong Yidong <cyd@gnu.org>
7541
7542 * fileio.c (Vfile_name_handler_alist): Doc fix.
7543
7544 * buffer.c (Fget_file_buffer): Protect against invalid file
7545 handler return value.
7546
7547 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7548
7549 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7550 when computing $valmask.
7551
7552 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7553 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7554 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7555 It's useless in that case, and it can cause problems on hosts
7556 that allocate halves of EMACS_INT values separately.
7557 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7558 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7559 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7560 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7561 it avoids undefined behavior on hosts where shifting right by more
7562 than the word width has undefined behavior.
7563
7564 2012-02-19 Chong Yidong <cyd@gnu.org>
7565
7566 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7567 (Funhandled_file_name_directory, Ffile_name_as_directory)
7568 (Fdirectory_file_name, Fexpand_file_name)
7569 (Fsubstitute_in_file_name): Protect against invalid file handler
7570 return values (Bug#10845).
7571
7572 2012-02-18 Eli Zaretskii <eliz@gnu.org>
7573
7574 * .gdbinit (pitx): Fix incorrect references to fields of the
7575 iterator stack.
7576
7577 2012-02-17 Chong Yidong <cyd@gnu.org>
7578
7579 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7580
7581 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7582
7583 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7584 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7585
7586 2012-02-15 Chong Yidong <cyd@gnu.org>
7587
7588 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7589 marked as special. Also, starting docstrings with * is obsolete.
7590
7591 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7592
7593 * gnutls.c (emacs_gnutls_write): Fix last change.
7594
7595 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7596
7597 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7598 send_process.
7599
7600 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7601
7602 * keymap.c (Fsingle_key_description): Handle char ranges.
7603
7604 2012-02-12 Chong Yidong <cyd@gnu.org>
7605
7606 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7607 as that creates a dangerous corner case.
7608
7609 * window.c (Fdelete_window_internal): Invalidate the mouse
7610 highlight (Bug#9904).
7611
7612 2012-02-12 Glenn Morris <rgm@gnu.org>
7613
7614 * xselect.c (Fx_own_selection_internal)
7615 (Fx_get_selection_internal, Fx_disown_selection_internal)
7616 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7617 * nsselect.m (Fx_own_selection_internal)
7618 (Fx_disown_selection_internal, Fx_selection_exists_p)
7619 (Fx_selection_owner_p, Fx_get_selection_internal):
7620 Sync docs and argument specs with the xselect.c versions.
7621
7622 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
7623
7624 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7625
7626 2012-02-11 Eli Zaretskii <eliz@gnu.org>
7627
7628 * w32select.c (Fx_selection_exists_p): Sync doc string and
7629 argument list with xselect.c. (Bug#10783)
7630
7631 * w16select.c (Fx_selection_exists_p): Sync doc string and
7632 argument list with xselect.c. (Bug#10783)
7633
7634 2012-02-10 Glenn Morris <rgm@gnu.org>
7635
7636 * fns.c (Fsecure_hash): Doc fix.
7637
7638 2012-02-09 Kenichi Handa <handa@m17n.org>
7639
7640 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7641
7642 2012-02-07 Chong Yidong <cyd@gnu.org>
7643
7644 * buffer.c (Fbuffer_local_variables)
7645 (buffer_lisp_local_variables): Handle unbound vars correctly;
7646 don't let Qunbound leak into Lisp.
7647
7648 2012-02-07 Glenn Morris <rgm@gnu.org>
7649
7650 * image.c (Fimagemagick_types): Doc fix.
7651
7652 * image.c (imagemagick-render-type): Change it from a lisp object
7653 to an integer. Move the doc here from the lisp manual.
7654 Treat all values not equal to 0 the same.
7655
7656 2012-02-06 Chong Yidong <cyd@gnu.org>
7657
7658 * doc.c (store_function_docstring): Avoid applying docstring of
7659 alias to base function (Bug#2603).
7660
7661 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7662
7663 * .gdbinit (pp1, pv1): Remove redundant defines.
7664 (pr): Use pp.
7665
7666 2012-02-04 Chong Yidong <cyd@gnu.org>
7667
7668 * nsterm.m: Declare a global (Bug#10694).
7669
7670 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7671
7672 * w32.c (get_emacs_configuration_options):
7673 Include --enable-checking, if specified, in the return value.
7674
7675 2012-02-04 Martin Rudalics <rudalics@gmx.at>
7676
7677 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7678 after rounding frame sizes. (Bug#9723)
7679
7680 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7681
7682 * keyboard.c (adjust_point_for_property): Don't position point
7683 before BEGV. (Bug#10696)
7684
7685 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7686
7687 Handle overflow when computing char display width (Bug#9496).
7688 * character.c (char_width): Return EMACS_INT, not int.
7689 (char_width, c_string_width): Check for overflow when
7690 computing the width; this is possible now that individual
7691 characters can have unbounded width. Problem introduced
7692 by merge from Emacs 23 on 2012-01-19.
7693
7694 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
7695
7696 * dbusbind.c (Fdbus_register_method): Mention the return value
7697 :ignore in the docstring.
7698
7699 2012-02-02 Glenn Morris <rgm@gnu.org>
7700
7701 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7702
7703 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7704 Unconditionally set to t. (Bug#10673)
7705 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7706 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7707 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7708
7709 2012-02-02 Kenichi Handa <handa@m17n.org>
7710
7711 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7712 0, do not call append_composite_glyph.
7713
7714 2012-02-02 Kenichi Handa <handa@m17n.org>
7715
7716 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7717 NULL (Bug#6988).
7718 (x_produce_glyphs): If the component of a composition is a null
7719 string, set it->pixel_width to 1 to avoid zero-width glyph.
7720
7721 2012-02-01 Eli Zaretskii <eliz@gnu.org>
7722
7723 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7724 first 2 arguments are identical. This makes inserting large
7725 output from a subprocess an order of magnitude faster on
7726 MS-Windows, where all sbrk'ed memory is always contiguous.
7727
7728 2012-01-31 Glenn Morris <rgm@gnu.org>
7729
7730 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7731 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7732 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7733
7734 2012-01-29 Glenn Morris <rgm@gnu.org>
7735
7736 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7737
7738 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7739
7740 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7741
7742 2012-01-28 Chong Yidong <cyd@gnu.org>
7743
7744 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7745
7746 2012-01-26 Chong Yidong <cyd@gnu.org>
7747
7748 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7749
7750 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7751 repeat counts (Bug#10507).
7752
7753 2012-01-26 Glenn Morris <rgm@gnu.org>
7754
7755 * lread.c (syms_of_lread): Doc fix.
7756
7757 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7758
7759 * coding.c (encode_designation_at_bol): Change return value to
7760 EMACS_INT.
7761
7762 2012-01-25 Chong Yidong <cyd@gnu.org>
7763
7764 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7765
7766 2012-01-21 Chong Yidong <cyd@gnu.org>
7767
7768 * floatfns.c (Fcopysign): Make the second argument non-optional,
7769 since nil is not allowed anyway.
7770
7771 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7772
7773 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7774 (send_process): Likewise.
7775
7776 2012-01-19 Martin Rudalics <rudalics@gmx.at>
7777
7778 * window.c (save_window_save, Fcurrent_window_configuration)
7779 (Vwindow_persistent_parameters): Do not use Qstate.
7780 Rewrite doc-strings.
7781
7782 2012-01-19 Kenichi Handa <handa@m17n.org>
7783
7784 * character.c (char_width): New function.
7785 (Fchar_width, c_string_width, lisp_string_width):
7786 Use char_width (Bug#9496).
7787
7788 2012-01-16 Martin Rudalics <rudalics@gmx.at>
7789
7790 * window.c (Vwindow_persistent_parameters): New variable.
7791 (Fset_window_configuration, save_window_save): Handle persistent
7792 window parameters.
7793
7794 2012-01-14 Eli Zaretskii <eliz@gnu.org>
7795
7796 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7797 thrashing the stack of the thread. (Bug#9087)
7798
7799 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7800
7801 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7802
7803 2012-01-11 Eli Zaretskii <eliz@gnu.org>
7804
7805 * xdisp.c (rows_from_pos_range): Handle the case where the
7806 highlight ends on a newline. (Bug#10464)
7807 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7808 he end column for display of highlight that ends on a newline
7809 before a R2L line.
7810
7811 2012-01-11 Glenn Morris <rgm@gnu.org>
7812
7813 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7814 from load-path also when installation-directory is nil. (Bug#10208)
7815
7816 2012-01-10 Glenn Morris <rgm@gnu.org>
7817
7818 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7819
7820 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7821 Update template values to be closer to their typical values these days.
7822
7823 2012-01-09 Eli Zaretskii <eliz@gnu.org>
7824
7825 * xdisp.c (rows_from_pos_range): Accept additional argument
7826 DISP_STRING, and accept any glyph in a row whose object is that
7827 string as eligible for mouse highlight. Fixes mouse highlight of
7828 display strings from overlays. (Bug#10464)
7829
7830 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
7831
7832 emacs: fix an auto-save permissions race condition (Bug#10400)
7833 * fileio.c (auto_saving_dir_umask): New static var.
7834 (Fmake_directory_internal): Use it.
7835 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7836 creating the directory. The old code temporarily assigns
7837 too-generous permissions to the directory.
7838 (do_auto_save_eh): Clear it.
7839 (Fdo_auto_save): Catch all errors, not just file errors, so
7840 that the var is always cleared.
7841
7842 2012-01-07 Eli Zaretskii <eliz@gnu.org>
7843
7844 * search.c (scan_buffer): Pass character positions to
7845 know_region_cache, not byte positions. (Bug#6540)
7846
7847 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
7848
7849 * w32.c (sys_rename): Report EXDEV when rename of a directory
7850 fails because the target is on another logical disk. (Bug#10284)
7851
7852 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7853
7854 * xterm.c (x_embed_request_focus): New function.
7855
7856 * xterm.h: Add prototype.
7857
7858 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7859
7860 2012-01-05 Glenn Morris <rgm@gnu.org>
7861
7862 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7863
7864 2012-01-01 Eli Zaretskii <eliz@gnu.org>
7865
7866 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7867 Load gnutls_transport_set_lowat only if GnuTLS version is below
7868 2.11.1.
7869 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7870 GnuTLS versions below 2.11.1.
7871
7872 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7873
7874 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7875 to the doc string advising against its use for altering the way
7876 windows are scrolled.
7877
7878 2011-12-28 Kenichi Handa <handa@m17n.org>
7879
7880 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7881 coding-system ASCII compatible only when it does not produce BOM
7882 on encoding (Bug#10383).
7883
7884 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7885
7886 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7887 can scroll.
7888 (create_and_show_popup_menu): Always use menu_position_func for
7889 Gtk3 (Bug#10361).
7890
7891 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7892
7893 * callint.c (Fcall_interactively): Don't truncate prompt string.
7894
7895 2011-12-23 Eli Zaretskii <eliz@gnu.org>
7896
7897 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7898 property that ends at ZV, so that the bidi iteration could be
7899 resumed from there (after widening). (Bug#10360)
7900
7901 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7902
7903 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7904
7905 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7906
7907 * nsterm.m (x_free_frame_resources):
7908 Release f->output_data.ns->miniimage.
7909 (ns_index_color): Fix indentation. Do not retain
7910 color_table->colors[i].
7911
7912 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7913 before returning.
7914
7915 * nsfns.m (x_set_background_color): Assign return value from
7916 ns_index_color to face-background instead of NSColor*.
7917 (ns_implicitly_set_icon_type): Fix indentation.
7918 Change assignment in for loop to comparison.
7919
7920 * emacs.c (ns_pool): New variable.
7921 (main): Assign ns_pool.
7922 (Fkill_emacs): Call ns_release_autorelease_pool.
7923
7924 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7925 autorelease fdesc, release fdAttrs and tdict.
7926 (ns_get_covering_families): Release charset.
7927 (ns_findfonts): Release NSFontDescriptor created with new.
7928 (ns_uni_to_glyphs): Fix indentation.
7929 (setString): Release attrStr before assigning new value.
7930
7931 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7932
7933 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7934 and NS_IMPL_COCOA.
7935 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7936 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7937
7938 2011-12-18 David Reitter <reitter@cmu.edu>
7939
7940 * nsterm.m (ns_term_init): Subscribe for notifications
7941 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7942 to method trackingNotification in EmacsMenu.
7943
7944 * nsmenu.m (trackingMenu): New variable.
7945 (trackingNotification): New method (from Aquamacs).
7946 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
7947 from Aquamacs (Bug#7030).
7948
7949 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7950
7951 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7952 (symbol_to_nsstring): Fix indentation.
7953 (ns_symbol_to_pb): New function.
7954 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7955 (Fns_rotate_cut_buffers_internal): Remove.
7956 (Fns_store_selection_internal): Rename from
7957 Fns_store_cut_buffer_internal.
7958 (ns_get_foreign_selection, Fx_own_selection_internal)
7959 (Fx_disown_selection_internal, Fx_selection_exists_p)
7960 (Fns_get_selection_internal, Fns_store_selection_internal):
7961 Use ns_symbol_to_pb and check if return value is nil.
7962 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7963 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
7964 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7965 renamed to Sns_store_selection_internal.
7966 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7967 and remove this function.
7968 (ns_handle_selection_clear): Remove, never used.
7969 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7970 here.
7971
7972 2011-12-17 Ken Brown <kbrown@cornell.edu>
7973
7974 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7975 GID is unknown (Bug#10257).
7976
7977 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7980 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7981 which caused a build failure on GNU/Linux IA-64. This problem was
7982 introduced by my 2011-10-07 patch.
7983
7984 2011-12-15 Juri Linkov <juri@jurta.org>
7985
7986 * image.c (imagemagick_error): New function. (Bug#10112)
7987 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7988 Use `imagemagick_error' where ImageMagick functions return
7989 `MagickFalse'.
7990 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7991 proper order.
7992
7993 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7994
7995 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7996 fill background (Bug#8992).
7997
7998 2011-12-13 Martin Rudalics <rudalics@gmx.at>
7999
8000 * window.c (Vwindow_combination_resize)
8001 (Vwindow_combination_limit): Use t instead of non-nil in
8002 doc-strings.
8003 (Vrecenter_redisplay): Add first sentence of doc-string on
8004 separate line.
8005 (Frecenter): Fix doc-string typo.
8006
8007 2011-12-11 Kenichi Handa <handa@m17n.org>
8008
8009 * coding.c (Funencodable_char_position): Pay attention to the
8010 buffer text relocation (Bug#9389).
8011
8012 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8013
8014 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8015 gtk_init (Bug#10100).
8016
8017 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8018
8019 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8020 IT->string is nil. (Bug#10263)
8021
8022 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8023
8024 * nsterm.h (x_free_frame_resources): Declare.
8025
8026 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8027 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8028
8029 * nsterm.h (ns_get_defaults_value): Declare.
8030
8031 * nsterm.m (ns_default): Call ns_get_defaults_value.
8032
8033 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8034
8035 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8036 (Bug#10170)
8037
8038 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8039
8040 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8041 that where the value of an _OBJC_* symbol points to is in the .bss
8042 section (Bug#10240).
8043
8044 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8045
8046 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8047 after the loop to call ccl_driver at least once (Bug#8619).
8048
8049 2011-12-08 Kenichi Handa <handa@m17n.org>
8050
8051 * ftfont.c (get_adstyle_property): Fix previous change
8052 (Bug#10233).
8053
8054 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8055
8056 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8057 dirs from the default value of EMACSLOADPATH (bug#10208).
8058
8059 2011-12-07 Glenn Morris <rgm@gnu.org>
8060
8061 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8062 installation and source directories as well. (Bug#10208)
8063
8064 2011-12-06 Chong Yidong <cyd@gnu.org>
8065
8066 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8067
8068 2011-12-06 Glenn Morris <rgm@gnu.org>
8069
8070 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8071 as an error, not just -1. (Bug#10217)
8072
8073 2011-12-05 Chong Yidong <cyd@gnu.org>
8074
8075 * keyboard.c (process_special_events): New function.
8076 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8077
8078 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8079
8080 * coding.c (encode_designation_at_bol): Don't use uninitialized
8081 local variable (Bug#9318).
8082
8083 2011-12-05 Kenichi Handa <handa@m17n.org>
8084
8085 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8086 return Qnil (Bug#8046, Bug#10193).
8087
8088 2011-12-05 Kenichi Handa <handa@m17n.org>
8089
8090 * coding.c (encode_designation_at_bol): New args charbuf_end and
8091 dst. Return the number of produced bytes. Callers changed.
8092 (coding_set_source): Return how many bytes coding->source was
8093 relocated.
8094 (coding_set_destination): Return how many bytes
8095 coding->destination was relocated.
8096 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8097 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8098
8099 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8100
8101 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8102 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8103 macro (Bug#9318).
8104
8105 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8106
8107 The following changes are to fix Bug#9318.
8108
8109 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8110 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8111 (encode_coding_iso_2022, encode_coding_sjis)
8112 (encode_coding_big5, encode_coding_charset): Use the above macros.
8113
8114 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8115
8116 * lisp.h (process_quit_flag): Fix external declaration.
8117
8118 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8119
8120 Don't macro-inline non-performance-critical code.
8121 * eval.c (process_quit_flag): New function.
8122 * lisp.h (QUIT): Use it.
8123
8124 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8125
8126 * nsfns.m (get_geometry_from_preferences): New function.
8127 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8128
8129 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8130
8131 * emacs.c (Qkill_emacs): Define.
8132 (syms_of_emacs): Initialize it.
8133 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8134 Qquit_flag to `kill-emacs' instead.
8135 (quit_throw_to_read_char): Add parameter `from_signal'.
8136 All callers changed. Call Fkill_emacs if requested and safe.
8137 * lisp.h (QUIT): Call Fkill_emacs if requested.
8138
8139 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8140
8141 * widget.c (update_wm_hints): Return if wmshell is null.
8142 (widget_update_wm_size_hints): New function.
8143
8144 * widget.h (widget_update_wm_size_hints): Declare.
8145
8146 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8147 widget_update_wm_size_hints (Bug#10104).
8148
8149 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8150
8151 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8152 before a newline, prepare the bidi iterator for consuming the
8153 newline, and keep the current paragraph direction. (Bug#10183)
8154 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8155
8156 2011-12-02 Juri Linkov <juri@jurta.org>
8157
8158 * search.c (Fword_search_regexp): New Lisp function created from
8159 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8160 (Fword_search_backward, Fword_search_forward)
8161 (Fword_search_backward_lax, Fword_search_forward_lax):
8162 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8163 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8164
8165 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8166
8167 * fileio.c (Finsert_file_contents): Move after-change-function call
8168 to before the "handled:" label, since all "goto handled" appear in
8169 cases where the *-change-functions have already been properly called
8170 (bug#10117).
8171
8172 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8173
8174 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8175 waiting for input. (Bug#10169)
8176
8177 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8178
8179 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8180 verifies glyph row's hash code--we have just reallocated the
8181 glyphs, so their contents can be complete garbage. (Bug#10164)
8182
8183 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8184
8185 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8186
8187 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8188
8189 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8190 attributes are tested _before_ calling verify_row_hash, to protect
8191 against GCC re-ordering of the tests. (Bug#10164)
8192
8193 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8194
8195 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8196
8197 * xterm.c (handle_one_xevent): Only set async_visible and friends
8198 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8199 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8200 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8201
8202 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8203
8204 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8205 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8206 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8207 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8208 All uses changed to use GCPRO1 etc.
8209 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8210 Revert to old implementation (i.e., before 2011-03-11).
8211
8212 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8213
8214 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8215 of scroll runs so as to avoid assigning disabled bogus rows and
8216 unnecessary graphics copy operations.
8217
8218 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8219
8220 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8221 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8222 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8223 (malloc, free, realloc, calloc): Redirect to e_* only when
8224 compiling Emacs.
8225
8226 * lisp.h (GCTYPEBITS): Move before first use.
8227 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8228 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8229 this macro definition.
8230
8231 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8232 _MSC_VER.
8233
8234 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8235
8236 * gtkutil.c (xg_create_frame_widgets):
8237 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8238 present with Gtk+ 2.0.
8239
8240 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8241
8242 * fileio.c (Finsert_file_contents): Undo previous change; see
8243 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8244
8245 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8246
8247 Rename locals to avoid shadowing.
8248 * fileio.c (Finsert_file_contents):
8249 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8250 * process.c (wait_reading_process_output):
8251 Rename inner 'proc' to 'p' to avoid shadowing.
8252 Indent for consistency with usual Emacs style.
8253
8254 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8255
8256 * xdisp.c (redisplay_window): If cursor row is not fully visible
8257 after recentering, and scroll-conservatively is set to a large
8258 number, scroll window by a few more lines to make the cursor fully
8259 visible and out of scroll-margin. (Bug#10105)
8260 (start_display): Don't move to the next line if the display should
8261 start at a newline that is part of a display vector or an overlay
8262 string. (Bug#10119)
8263
8264 2011-11-24 Juri Linkov <juri@jurta.org>
8265
8266 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8267 after the `MagickPingImage' call. (Bug#10112)
8268
8269 2011-11-23 Chong Yidong <cyd@gnu.org>
8270
8271 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8272
8273 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8274
8275 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8276 making another buffer current. (Bug#10114)
8277
8278 2011-11-23 Glenn Morris <rgm@gnu.org>
8279
8280 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8281
8282 2011-11-23 Chong Yidong <cyd@gnu.org>
8283
8284 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8285 using it (Bug#5984).
8286
8287 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8288
8289 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8290 and header-lines, as they don't have one computed for them.
8291 (Bug#10098)
8292
8293 * .gdbinit (prow): Make displayed values more self-explaining.
8294 Add row's hash code.
8295
8296 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8297
8298 * process.c (wait_reading_process_output): Fix asynchrounous
8299 GnuTLS socket handling on some versions of the GnuTLS library.
8300 (wait_reading_process_output): Add comment and URL.
8301
8302 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8303
8304 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8305
8306 2011-11-21 Chong Yidong <cyd@gnu.org>
8307
8308 * window.c (Fnext_window, Fprevious_window): Doc fix.
8309
8310 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8311
8312 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8313
8314 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8315
8316 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8317
8318 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8319
8320 * window.c (Fset_window_combination_limit): Rename argument
8321 STATUS to LIMIT.
8322 (Vwindow_combination_limit): Remove "status" from doc-string.
8323
8324 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8325
8326 * m/ibms390.h: Remove.
8327 * m/ibms390x.h: Don't include "ibms390.h".
8328
8329 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8330
8331 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8332 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8333
8334 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8335
8336 * casetab.c (Fset_case_table):
8337 * charset.c (Fcharset_after): Fix typos.
8338
8339 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8340
8341 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8342 Otherwise, valgrind does not work on some platforms.
8343 Problem reported by Andreas Schwab in
8344 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8345 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8346 is set, removing the need for VIRT_ADDRESS_VARIES.
8347 (PURE_P): Use a more-efficient implementation that needs just one
8348 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8349 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8350 to 4 (xorl, subq, cmpq, setbe).
8351 * alloc.c (pure): Always extern now, since that's the
8352 VIRT_ADDR_VARIES behavior.
8353 (PURE_POINTER_P): Use a single comparison, not two, for
8354 consistency with the new puresize.h.
8355 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8356 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8357 Remove VIRT_ADDR_VARIES no longer needed.
8358
8359 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8360
8361 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8362 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8363 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8364 behave as if the cursor position were at the window margin.
8365
8366 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8367 and the cursor position is out of bounds, behave as if the cursor
8368 position were at the window margin. (Bug#10075)
8369
8370 2011-11-18 Chong Yidong <cyd@gnu.org>
8371
8372 * window.c (Fwindow_combination_limit): Make first argument
8373 non-optional, since it is meaningless for live windows like the
8374 selected window.
8375
8376 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8377
8378 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8379
8380 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8381
8382 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8383 (graft_intervals_into_buffer): Simplify.
8384
8385 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8386
8387 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8388 hash values of the two rows.
8389 (copy_row_except_pointers): Preserve the used[] arrays and the
8390 hash values of the two rows. (Bug#10035)
8391 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8392
8393 * xdisp.c (row_hash): New function, body extracted from
8394 compute_line_metrics.
8395 (compute_line_metrics): Call row_hash, instead of computing the
8396 hash code inline.
8397
8398 * dispnew.c (verify_row_hash): Call row_hash for computing the
8399 hash code of a row, instead of duplicating code from xdisp.c.
8400
8401 * dispextern.h (row_hash): Add prototype.
8402
8403 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8404
8405 * frame.c (delete_frame): Don't delete the terminal when the last
8406 X frame is closed if emacs is built with GTK toolkit.
8407
8408 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8409
8410 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8411
8412 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8413
8414 * window.c (Vwindow_splits): Rename to
8415 Vwindow_combination_resize. Suggested by Juri Linkov.
8416 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8417 of Vwindow_splits.
8418
8419 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8420
8421 * nsfns.m (Fns_font_name):
8422 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8423
8424 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8425
8426 * window.h (window): Rename slot "nest" to "combination_limit".
8427 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8428 (Fset_window_nest): Rename to Fset_window_combination_limit.
8429 (Vwindow_nest): Rename to Vwindow_combination_limit.
8430 (recombine_windows, make_parent_window, make_window)
8431 (Fsplit_window_internal, saved_window)
8432 (Fset_window_configuration, save_window_save): Rename all
8433 occurrences of window_nest to window_combination_limit.
8434
8435 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
8436
8437 * image.c (imagemagick_load_image): Fix typo.
8438
8439 2011-11-14 Eli Zaretskii <eliz@gnu.org>
8440
8441 * xdisp.c (display_line): Move the call to
8442 highlight_trailing_whitespace before the call to
8443 compute_line_metrics, since the latter needs to see the final
8444 faces of all the glyphs to compute ROW's hash value.
8445 Fixes assertion violations in row_equal_p. (Bug#10035)
8446
8447 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
8448
8449 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8450 just return (bug#10044).
8451
8452 2011-11-12 Eli Zaretskii <eliz@gnu.org>
8453
8454 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8455 with user-defined heap size. Bump the default size of the temacs
8456 heap to 27MB, to avoid memory warning when running temacs.
8457 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8458
8459 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8460 current_matrix and desired_matrix. (Bug#9990)
8461 (verify_row_hash) [XASSERTS]: New function.
8462 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8463 that the hash value of glyph rows is correct.
8464
8465 2011-11-12 Martin Rudalics <rudalics@gmx.at>
8466
8467 * window.h (window): Remove splits slot.
8468 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8469 (Fdelete_other_windows_internal, make_parent_window)
8470 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8471 (Fset_window_configuration, save_window_save): Don't deal with
8472 split status of windows.
8473 (saved_window): Remove splits slot.
8474 (Vwindow_splits): Rewrite doc-string.
8475
8476 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8477
8478 * xfns.c (unwind_create_frame):
8479 * nsfns.m (unwind_create_frame):
8480 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8481 Vframe_list (Bug#9999).
8482
8483 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8484
8485 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
8486
8487 2011-11-11 Kenichi Handa <handa@m17n.org>
8488
8489 * callproc.c (Fcall_process): Set the member dst_multibyte of
8490 process_coding.
8491
8492 2011-11-11 Johan Bockgård <bojohan@gnu.org>
8493
8494 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8495 avoid a crash (bug#9496).
8496
8497 2011-11-09 Chong Yidong <cyd@gnu.org>
8498
8499 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8500 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8501
8502 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8503
8504 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8505
8506 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8507
8508 Avoid some portability problems by eschewing 'extern inline' functions.
8509 The trivial performance wins aren't worth the portability hassles; see
8510 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8511 et seq.
8512 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8513 (window_box_width, window_box_left, window_box_left_offset)
8514 (window_box_right, window_box_right_offset): Undo previous change,
8515 by removing the "extern"s.
8516 * intervals.c (adjust_intervals_for_insertion)
8517 (adjust_intervals_for_deletion): Undo previous change,
8518 making these static again.
8519 (offset_intervals, temp_set_point_both, temp_set_point)
8520 (copy_intervals_to_string): No longer inline.
8521 * xdisp.c (window_text_bottom_y, window_box_width)
8522 (window_box_height, window_box_left_offset)
8523 (window_box_right_offset, window_box_left, window_box_right)
8524 (window_box): No longer inline.
8525
8526 2011-11-08 Chong Yidong <cyd@gnu.org>
8527
8528 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
8529 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8530 Signal an error if not a live window.
8531 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8532 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8533
8534 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
8535
8536 * lisp.h (syms_of_abbrev): Remove declaration.
8537 Reported by CHENG Gao <chenggao@royau.me>.
8538
8539 2011-11-07 Eli Zaretskii <eliz@gnu.org>
8540
8541 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8542 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
8543 of temacs in GUI mode.
8544
8545 2011-11-07 Martin Rudalics <rudalics@gmx.at>
8546
8547 * window.h: Declare delete_all_child_windows instead of
8548 delete_all_subwindows.
8549 * window.c (Fwindow_nest, Fset_window_nest)
8550 (Fset_window_new_total, Fset_window_new_normal)
8551 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8552 (delete_all_subwindows): Rename to delete_all_child_windows.
8553 (Fdelete_other_windows_internal, Fset_window_configuration):
8554 Call delete_all_child_windows instead of delete_all_subwindows.
8555 * frame.c (delete_frame): Call delete_all_child_windows instead
8556 of delete_all_subwindows.
8557
8558 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8559
8560 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8561 This is also needed for porting to any host where GC_MARK_STACK is
8562 not GC_MAKE_GCPROS_NOOPS.
8563 (which_symbols): Use it.
8564
8565 2011-11-07 Kenichi Handa <handa@m17n.org>
8566
8567 * coding.c (coding_set_destination): Check coding->src_pos only
8568 when coding->src_object is a buffer (bug#9910).
8569
8570 * process.c (send_process): Set the member src_multibyte of coding
8571 to 0 (bug#9911) when sending a unibyte text.
8572
8573 * callproc.c (Fcall_process): Set the member src_multibyte of
8574 process_coding to 0 (bug#9912).
8575
8576 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8577
8578 * xmenu.c (cleanup_widget_value_tree): New function.
8579 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8580 calling free_menubar_widget_value_tree directly (Bug#9830).
8581
8582 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8583
8584 Fix some portability problems with 'inline'.
8585 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8586 (window_box_width, window_box_left, window_box_left_offset)
8587 (window_box_right, window_box_right_offset): Declare extern.
8588 Otherwise, these inline functions do not conform to C99 and
8589 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8590 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8591 * intervals.c (adjust_intervals_for_insertion)
8592 (adjust_intervals_for_deletion): Now extern, because otherwise the
8593 extern inline functions 'offset_intervals' couldn't refer to it.
8594 (static_offset_intervals): Remove.
8595 (offset_intervals): Rewrite using the old contents of
8596 static_offset_intervals. The old version didn't conform to C99
8597 because an extern inline function contained a reference to an
8598 identifier with static linkage.
8599
8600 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8601
8602 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8603 GC.
8604
8605 2011-11-06 Eli Zaretskii <eliz@gnu.org>
8606
8607 * xdisp.c (init_iterator, reseat_to_string): Don't set the
8608 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
8609 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8610 return Qleft_to_right.
8611
8612 2011-11-06 Chong Yidong <cyd@gnu.org>
8613
8614 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8615 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8616 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8617 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8618 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8619 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8620 (Fwindow_vscroll): Doc fix.
8621 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
8622 argument, since it makes no sense to pass a live window and for
8623 consistency with window-child.
8624
8625 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
8626
8627 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8628 support MSVC.
8629
8630 2011-11-05 Jason Rumney <jasonr@gnu.org>
8631
8632 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8633 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8634 fonts (Bug#6029).
8635 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8636 bitwise arithmetic preventing use of unicode-sip and non-truetype
8637 opentype fonts.
8638
8639 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8640
8641 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8642 "emacs"-only part.
8643
8644 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8645 initialization code to keep similarity to xfns.c after changes
8646 from 2011-11-05.
8647
8648 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8649
8650 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8651 (unwind_create_frame): New function (Bug#9943).
8652 (Fx_create_frame): Restructure code to be more similar to the one in
8653 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
8654 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8655 Move terminal->reference_count++ just before making the frame official
8656 (Bug#9943).
8657
8658 * nsterm.m (x_free_frame_resources): New function.
8659 (x_destroy_window): Move code to x_free_frame_resources.
8660
8661 * xfns.c (unwind_create_frame): Fix comment.
8662 (Fx_create_frame, x_create_tip_frame):
8663 Move terminal->reference_count++ just before making the frame
8664 official. Move initialization of image_cache_refcount and
8665 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8666
8667 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8668
8669 Support MSVC build with newer versions of Visual Studio.
8670 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8671 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
8672 nt/gmake.defs.
8673
8674 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8675 which are not supported by MSVC.
8676 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8677 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8678 bitfields.
8679 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8680 types in bitfields.
8681 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8682
8683 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8684
8685 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
8686
8687 Support MSVC build with newer versions of Visual Studio.
8688 * w32.c: Don't include w32api.h for MSVC.
8689 (init_environment) [_MSC_VER]: Call sys_access, not _access.
8690
8691 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8692 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8693 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8694 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8695 e_* cousins.
8696 (alloca) [_MSC_VER]: Define to _alloca.
8697
8698 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8699
8700 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8701
8702 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8703
8704 * xdisp.c (note_mouse_highlight): If either of
8705 previous/next-single-property-change returns nil, treat that as
8706 the beginning or the end of the buffer. (Bug#9955)
8707
8708 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8709
8710 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
8711 label is not null (Bug#9951).
8712 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8713 may be NULL.
8714
8715 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8716
8717 * window.c (Fwindow_body_size): Mention in the doc string that the
8718 return value is in frame's canonical units. (Bug#9949)
8719
8720 2011-11-03 Eli Zaretskii <eliz@gnu.org>
8721
8722 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8723
8724 * w32fns.c (unwind_create_frame): If needed, free the glyph
8725 matrices of the partially constructed frame. (Bug#9943)
8726 * xfns.c (unwind_create_frame): Likewise.
8727
8728 2011-11-01 Eli Zaretskii <eliz@gnu.org>
8729
8730 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8731 Don't stop backward scan on the continuation glyph, even though
8732 its CHARPOS is positive.
8733 (mouse_face_from_buffer_pos, note_mouse_highlight):
8734 Rename cover_string to disp_string.
8735
8736 2011-11-01 Martin Rudalics <rudalics@gmx.at>
8737
8738 * window.c (temp_output_buffer_show): Don't use
8739 Vtemp_buffer_show_specifiers.
8740 (Vtemp_buffer_show_specifiers): Remove unused variable.
8741
8742 2011-10-30 Eli Zaretskii <eliz@gnu.org>
8743
8744 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8745 past the beginning of the current glyph matrix.
8746
8747 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
8748
8749 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8750 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8751 HAVE_GTK3 (Bug#9869).
8752
8753 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8754 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8755
8756 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8757
8758 * xterm.c: Declare x_handle_net_wm_state to return int.
8759 (handle_one_xevent): Check if we are iconified but don't have
8760 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8761 (get_current_wm_state): Return non-zero if not hidden,
8762 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8763 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8764 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8765 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8766
8767 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8768
8769 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8770 so that this new function doesn't get optimized away by a
8771 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8772
8773 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8774
8775 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8776
8777 2011-10-29 Eli Zaretskii <eliz@gnu.org>
8778
8779 Fix the `xbytecode' command.
8780 * .gdbinit (xprintbytestr): New command.
8781 (xwhichsymbols): Rename from `which'; all callers changed.
8782 (xbytecode): Print the byte-code string as well.
8783
8784 2011-10-29 Kim Storm <storm@cua.dk>
8785
8786 * alloc.c (which_symbols): New function.
8787
8788 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8789
8790 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8791 line. (Bug#9903)
8792
8793 2011-10-29 Glenn Morris <rgm@gnu.org>
8794
8795 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8796 Not clear what it was for, and it causes various bugs. (Bug#9839)
8797
8798 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8799
8800 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8801 possible random value that matches one of those tested as
8802 condition to clear the mouse face.
8803
8804 2011-10-28 Chong Yidong <cyd@gnu.org>
8805
8806 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8807
8808 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8809
8810 * window.c (make_window): Initialize phys_cursor_on_p.
8811
8812 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8813
8814 * lisp.h (struct Lisp_Symbol): Update comments.
8815
8816 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
8817
8818 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8819
8820 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8821
8822 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8823 <oslsachem@gmail.com> for helping to debug this.
8824
8825 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8826 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8827 (g_b_init_get_glyph_outline_w): New static variables.
8828 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8829 (GetGlyphOutlineW_Proc): New typedefs.
8830 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
8831 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8832 New functions.
8833 (w32font_open_internal, compute_metrics):
8834 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
8835 instead of calling the "wide" APIs directly.
8836
8837 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8838
8839 * w32.h (syms_of_w32font): Add prototype.
8840
8841 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8842
8843 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8844 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8845 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8846 (Fmove_to_window_line): Doc fix.
8847
8848 2011-10-27 Chong Yidong <cyd@gnu.org>
8849
8850 * process.c (make_process): Set gnutls_state to NULL.
8851
8852 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8853 non-NULL, regardless of GNUTLS_INITSTAGE.
8854 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8855 an error. Set process slots as soon as we allocate them.
8856
8857 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8858
8859 2011-10-27 Chong Yidong <cyd@gnu.org>
8860
8861 * gnutls.c (emacs_gnutls_deinit): New function.
8862 Deallocate credentials structures as well as calling gnutls_deinit.
8863 (Fgnutls_deinit, Fgnutls_boot): Use it.
8864
8865 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8866 (deactivate_process): Call emacs_gnutls_deinit.
8867
8868 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8869
8870 * image.c (x_create_x_image_and_pixmap):
8871 * w32.c (sys_rename, w32_delayed_load):
8872 * w32font.c (fill_in_logfont):
8873 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8874
8875 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
8876
8877 * w32fns.c (w32_default_color_map): New function,
8878 extracted from Fw32_default_color_map.
8879 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
8880
8881 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8882
8883 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8884
8885 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8886
8887 * keyboard.c (test_undefined): New function (bug#9751).
8888 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8889
8890 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8891
8892 * sysdep.c (init_sys_modes): Fix the check for the controlling
8893 terminal (Bug#6649).
8894
8895 2011-10-20 Eli Zaretskii <eliz@gnu.org>
8896
8897 * dispextern.h (struct bidi_it): New member next_en_type.
8898
8899 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8900 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8901 current character, check also for next_en_type being WEAK_EN.
8902 (bidi_resolve_weak): Don't enter the expensive loop if the current
8903 position is before next_en_pos. Record the bidi type of the first
8904 non-ET, non-BN character we find, in addition to its position.
8905 (bidi_level_of_next_char): Invalidate next_en_type when
8906 next_en_pos is over-stepped.
8907
8908 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8909
8910 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8911 * editfns.c: Rewrite current-time-zone so that it invokes
8912 the equivalent of (format-time-string "%Z") to get the time zone name.
8913 This fixes a bug when the time zone name contains characters that
8914 need converting from the system time locale to Emacs internal format.
8915 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8916 that patch fixed format-time-string to do the conversion, but
8917 I forgot to fix current-time-zone.
8918 (format_time_string): New function, containing most of
8919 what Fformat_time_string used to contain.
8920 (Fformat_time_string): Rewrite in terms of format_time_string.
8921 This doesn't change this function's behavior.
8922 (current-time-zone): Rewrite to use format_time_string.
8923 This fixes the bug reported by Michael Schierl in
8924 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8925 Jason Rumney's 2007-06-07 change worked around this bug, but
8926 didn't fix it.
8927 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8928
8929 2011-10-19 Eli Zaretskii <eliz@gnu.org>
8930
8931 * xdisp.c (start_display): If the character at POS is displayed
8932 via a display vector, reset IT->current.dpvec_index to zero.
8933 (try_window_reusing_current_matrix): If a line ends in a display
8934 vector or the next line starts in a display vector, continue
8935 redrawing the window even though the character position of
8936 start_row was reached.
8937 (Bug#9771, part 2)
8938
8939 2011-10-18 Chong Yidong <cyd@gnu.org>
8940
8941 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8942 with nobreak-char-display too.
8943
8944 2011-10-18 Eli Zaretskii <eliz@gnu.org>
8945
8946 Fix part 3 of bug#9771.
8947 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8948 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8949 non-neutral characters if the current character is a paragraph
8950 separator (a.k.a. Newline). This avoids running the same
8951 expensive loop twice, once when we consume the preceding newline
8952 and the other time when the line actually needs to be displayed.
8953 Avoid the loop when we see neutrals on the base embedding level
8954 following a character whose directionality is the same as the
8955 paragraph's. This avoids running the expensive loop when a line
8956 ends in a long sequence of neutrals, like control characters.
8957 Add assertion against STRONG_AL type. Slightly rearrange code
8958 that determines the type of a neutral given the first non-neutral
8959 that follows it.
8960 (bidi_level_of_next_char): Set next_en_pos to zero when
8961 invalidating its info.
8962
8963 2011-10-17 Eli Zaretskii <eliz@gnu.org>
8964
8965 * xdisp.c (push_display_prop): Determine whether to record string
8966 or buffer position by IT->string, not by IT->method. Allow
8967 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
8968 (move_it_vertically_backward): Don't look for character position
8969 immediately after the newline when in a continuation line.
8970 (Bug#9771, part 1)
8971
8972 2011-10-15 Martin Rudalics <rudalics@gmx.at>
8973
8974 * window.c (coordinates_in_window): Rewrite and delabelize
8975 vertical border check. (Bug#5357) (Bug#9618)
8976
8977 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8978
8979 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8980 errors in XSetWindowBorder (bug#9310).
8981
8982 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8983
8984 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8985 avoid crash when xmalloc overrun checking is enabled.
8986
8987 2011-10-13 Eli Zaretskii <eliz@gnu.org>
8988
8989 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8990 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8991 cursor motion with <left> and <right> arrow keys.
8992
8993 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8994 some callers set that themselves.
8995
8996 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8997
8998 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8999 display string and the previous row comes from the same string and
9000 is empty. (Bug#9739) (Bug#9738)
9001
9002 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9003
9004 * doc.c (get_doc_string): Encode file name (bug#9735).
9005
9006 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9007
9008 * bidi.c (bidi_level_of_next_char):
9009 * xdisp.c (get_visually_first_element): Remove old incorrect
9010 comments regarding the Unicode Line Separator character.
9011
9012 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9013
9014 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9015
9016 * alloc.c (Fgc_status): Do not access beyond zombies array
9017 boundary if nzombies > MAX_ZOMBIES.
9018 * alloc.c (dump_zombies): Add missing format specifier.
9019
9020 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9021
9022 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9023 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9024
9025 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9026 Some packages use them to denote characters with modifiers.
9027
9028 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9029
9030 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9031 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9032 matching a pp-number. Rename parameter var to var1.
9033
9034 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9035
9036 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9037
9038 2011-10-08 Glenn Morris <rgm@gnu.org>
9039
9040 * callint.c (Fcall_interactively): Give a more explicit error for the
9041 'c' case with a non-character input. (Bug#8479)
9042
9043 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9044
9045 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9046 lines.
9047 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9048 lines that are hscrolled on the left.
9049
9050 * dispnew.c (buffer_posn_from_coords): Account for a possible
9051 presence of header-line. (Bug#4426)
9052
9053 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9054
9055 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9056 Don't advertise functionality which we discourage or doesn't work.
9057
9058 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9059
9060 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9061 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9062 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9063 this makes Emacs dump core during garbage collection on rare
9064 occasions. sizeof is obviously inferior to offsetof here, so
9065 stick with offsetof.
9066 (GC_POINTER_ALIGNMENT): New macro.
9067 (mark_memory): Omit 3rd (offset) arg; caller changed.
9068 Don't assume EMACS_INT alignment is the same as pointer alignment.
9069
9070 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9071
9072 * keyboard.c (read_key_sequence_remapped): New var.
9073 (read_key_sequence): Compute remapping in the right buffer.
9074 (command_loop_1): Use read_key_sequence's remapping directly.
9075
9076 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9077
9078 * dired.c (file_name_completion): Don't expand file name.
9079 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9080 before checking file name handler.
9081
9082 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9083 they've been requested explicitly (bug#9591).
9084
9085 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9086
9087 * keymap.c (Fsingle_key_description): Use make_specified_string
9088 instead of build_string to build string from push_key_description.
9089 (Bug#5193)
9090
9091 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9092
9093 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9094 This fixes a Y2038 bug on 64-bit hosts.
9095 * buffer.c (reset_buffer):
9096 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9097 (Fclear_buffer_auto_save_failure):
9098 Use 0, not -1, to represent an unset failure time, since time_t
9099 might not be signed.
9100
9101 Remove dependency on glibc malloc internals.
9102 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9103 Move back here from lisp.h, but with their new implementations.
9104 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9105 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9106 * charset.c (charset_table_init): New static var.
9107 (syms_of_charset): Use it instead of xmalloc. This removes a
9108 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9109 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9110 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9111 Move back to alloc.c.
9112 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9113 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9114
9115 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9116
9117 * nsterm.m (windowDidResize): Call x_set_window_size only when
9118 ns_in_resize is true. Otherwise set pixelwidth/height and
9119 call change_frame_size (Bug#9628).
9120
9121 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9122
9123 Port --enable-checking=all to Fedora 14 x86-64.
9124 * charset.c (syms_of_charset): Also account for glibc malloc's
9125 internal overhead when calculating the initial malloc maximum.
9126
9127 Port --enable-checking=all to Fedora 14 x86.
9128 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9129 Move to lisp.h.
9130 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9131 (overrun_check_realloc, overrun_check_free):
9132 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9133 That way, xmalloc returns a properly-aligned pointer even if
9134 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9135 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9136 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9137 into account when calculating the initial malloc maximum.
9138 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9139 Move here from alloc.c, so that charset.c can use it too.
9140 Properly align; the old code wasn't right for common 32-bit hosts
9141 when configured with --enable-checking=all.
9142 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9143 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9144
9145 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9146
9147 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9148 use EDOM.
9149
9150 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9151
9152 * xdisp.c (compute_display_string_end): If there's no display
9153 string at CHARPOS, return -1.
9154
9155 * bidi.c (bidi_fetch_char): When compute_display_string_end
9156 returns a negative value, treat the character as a normal
9157 character not covered by a display string. (Bug#9624)
9158
9159 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9160
9161 * lread.c (Fread_from_string): Fix typo in docstring.
9162
9163 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9164
9165 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9166 newline, reseat the iterator instead of bidi-iterating there one
9167 character at a time. (Bug#9610)
9168 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9169 TO_CHARPOS if the bidi iterator is at base embedding level.
9170
9171 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9172
9173 * lread.c (readevalloop): Use correct code for NBSP.
9174 (read1): Likewise. (Bug#9608)
9175
9176 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9177
9178 * dbusbind.c (Fdbus_register_signal): When service is not
9179 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9180
9181 2011-09-25 Glenn Morris <rgm@gnu.org>
9182
9183 * buffer.c (truncate-lines): Doc fix.
9184
9185 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9186
9187 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9188 (Fset_window_next_buffers): Doc fix.
9189
9190 2011-09-24 Glenn Morris <rgm@gnu.org>
9191
9192 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9193
9194 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9195
9196 Fix minor problems found by static checking.
9197 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9198 * indent.c (Fvertical_motion): Fix == vs = typo.
9199
9200 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9201
9202 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9203 Default value is now t. Doc fix.
9204
9205 * indent.c (Fvertical_motion): Compute and apply the overshoot
9206 logic when moving up, not only when moving down. Fix the
9207 confusing name and values of the it_overshoot_expected variable;
9208 logic changes accordingly. (Bug#9254) (Bug#9549)
9209
9210 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9211 CHARPOS is covered by a display string which includes newlines.
9212 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9213 is covered by a display string with embedded newlines.
9214
9215 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9216
9217 * dbusbind.c (Fdbus_register_signal): Add match rule to
9218 Vdbus_registered_objects_table. (Bug#9581)
9219 (Fdbus_register_method, Vdbus_registered_objects_table):
9220 Fix docstring.
9221
9222 2011-09-24 Jim Meyering <meyering@redhat.com>
9223
9224 do not ignore write error for any output size
9225 The previous change was incomplete.
9226 While it makes emacs --batch detect the vast majority of stdout
9227 write failures, errors were still ignored whenever the output size is
9228 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9229 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9230 && echo FAIL: ignored write error
9231 FAIL: ignored write error
9232 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9233 && echo FAIL: ignored write error
9234 FAIL: ignored write error
9235 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9236
9237 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9238
9239 * emacs.c (Fkill_emacs): In noninteractive mode exit
9240 non-successfully if a write error occurred on stdout. (Bug#9574)
9241
9242 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9243
9244 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9245 the xassert test.
9246
9247 * dispextern.h (struct it): Update the comment documenting what
9248 can it->OBJECT be.
9249
9250 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9251
9252 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9253 a display string, extend search for cursor position to end of row.
9254 (find_row_edges): If the row ends in a newline from a display
9255 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9256 Handle the case of a display string with multiple newlines.
9257 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9258 non-empty line. Fixes confusing cursor motion with arrow keys at
9259 the beginning of a line that starts with whitespace.
9260
9261 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9262
9263 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9264 (bug#9493).
9265
9266 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9267
9268 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9269 boolean (Bug#9154).
9270
9271 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9272
9273 * xdisp.c (display_line): Record maximum and minimum buffer
9274 positions even if no glyphs were produced (e.g., by a zero-width
9275 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9276 buffer positions that will be removed from the glyph row because
9277 they don't fit.
9278 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9279 column is beyond frame width: don't subtract 1 "pixel" when
9280 computing width of the stretch.
9281 (reseat_at_next_visible_line_start): Undo the change made on
9282 2011-09-17 that saved paragraph information and restored it after
9283 the call to `reseat'. (Bug#9545)
9284
9285 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9286
9287 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9288 and turn window cursor on if cleared (Bug#9415).
9289
9290 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9291
9292 * search.c (boyer_moore): Take unibyte characters from pattern
9293 literally. (Bug#9458)
9294
9295 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9296
9297 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9298
9299 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9300
9301 Fix minor problem found by static checking.
9302 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9303 initialized, to pacify gcc -Wuninitialized.
9304
9305 * fileio.c: Report proper errno when syscall falls.
9306 (Finsert_file_contents): Save and restore errno,
9307 so that report_file_error outputs the correct diagnostic.
9308 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9309
9310 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9311
9312 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9313
9314 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9315
9316 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9317 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9318
9319 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9320
9321 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9322 about the current paragraph and restore it after the call to reseat.
9323
9324 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9325 (bidi_find_paragraph_start): Search back for paragraph beginning
9326 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9327 (bidi_move_to_visually_next): Only trigger paragraph-related
9328 computations when the last character is a newline or at EOB, not
9329 just any NEUTRAL_B. (Bug#9470)
9330
9331 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9332 truncated lines if point is covered by a display string. (Bug#9524)
9333
9334 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9335
9336 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9337 (cons_to_x_long): New function.
9338 (lisp_data_to_selection_data): Use it. Correct the test for
9339 short-versus-long data; it was negated. Break out of vector
9340 loop, for efficiency, when a long datum is discovered.
9341
9342 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9343
9344 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9345
9346 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9347
9348 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9349 GCC PR/17406) by declaring this function with external scope.
9350
9351 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9352
9353 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9354 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9355
9356 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9357
9358 * editfns.c (Fformat): Correctly handle text properties on "%%".
9359
9360 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9361
9362 * xterm.c (x_draw_composite_glyph_string_foreground):
9363 * w32term.c (x_draw_composite_glyph_string_foreground):
9364 * term.c (encode_terminal_code):
9365 * composite.c (composition_update_it, get_composition_id):
9366 * xdisp.c (get_next_display_element)
9367 (fill_composite_glyph_string): Add comments about special meaning
9368 of TAB characters in a composition.
9369
9370 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9371
9372 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9373 This occurs when processing a multibyte format.
9374 Problem reported by Wolfgang Jenker.
9375
9376 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9377
9378 * xdisp.c (try_cursor_movement): Only check for exact match if
9379 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9380
9381 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9382
9383 Remove unused external symbols.
9384 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9385 * xdisp.c (calc_pixel_width_or_height): Now static.
9386 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9387 * indent.c (check_display_width):
9388 * w32term.c: Fix comment to match code.
9389 * xterm.c, xterm.h (x_catching_errors): Remove.
9390
9391 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9392
9393 * xselect.c: Use signed conversions more consistently (Bug#9498).
9394 (selection_data_to_lisp_data): Assume incoming selection data are
9395 signed integers, not unsigned. This is to be consistent with
9396 outgoing selection data, which was modified to use signed integers
9397 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9398 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9399 expects long, not unsigned long.
9400
9401 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9402
9403 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9404 computation of loop end. Reported by Johan Bockgård
9405 <bojohan@gnu.org>.
9406
9407 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9408
9409 * frame.c (Fother_visible_frames_p): Function deleted.
9410
9411 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9412
9413 * indent.c (compute_motion): Process display vector front to back
9414 rather than the other way around. (Bug#2496)
9415
9416 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9417
9418 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9419
9420 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9421
9422 * minibuf.c (Fread_from_minibuffer): Doc fix.
9423
9424 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9425
9426 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9427 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9428
9429 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9430
9431 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9432 value for non-existent files.
9433
9434 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9435
9436 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9437 set its "size" to -1. This will set the modtime_size field of
9438 the corresponding buffer to -1, which is what
9439 verify-visited-file-modtime expects for files that do not exist.
9440 (Bug#9139)
9441
9442 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9443
9444 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9445 here ...
9446 * lisp.h: ... from here. push_key_description is no longer
9447 defined in keyboard.c, so its declaration should not be in
9448 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9449 logically belongs with push_key_description.
9450
9451 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9452
9453 * buffer.h: Include <sys/types.h> instead of <time.h>.
9454 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9455 Problem reported by Herbert J. Skuhra.
9456
9457 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9458
9459 * xml.c (parse_region): Make the parsing work for
9460 non-comment-starting XML files again (bug#9144).
9461
9462 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9463
9464 * image.c (gif_load): Fix calculation of bottom and right corner.
9465 (Bug#9468)
9466
9467 2011-09-10 Eli Zaretskii <eliz@gnu.org>
9468
9469 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9470 redisplay in small windows.
9471
9472 2011-09-09 Eli Zaretskii <eliz@gnu.org>
9473
9474 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9475
9476 2011-09-08 Martin Rudalics <rudalics@gmx.at>
9477
9478 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9479 Operate on live windows only.
9480
9481 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
9482
9483 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9484
9485 2011-09-07 Eli Zaretskii <eliz@gnu.org>
9486
9487 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9488 only under bidi iteration.
9489
9490 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9491
9492 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9493
9494 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9495
9496 isnan: Fix porting problem to Solaris 10 with bundled gcc.
9497 Without this fix, the command to link temacs failed due to an
9498 undefined symbol __builtin_isnan. This is because
9499 /usr/include/iso/math_c99.h #defines isnan(x) to
9500 __builtin_isnan(x), but the bundled gcc, which identifies itself
9501 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9502 a __builtin_isnan.
9503 * floatfns.c (isnan): #undef, and then #define to a clone of
9504 what's in data.c.
9505 (Fisnan): Always define, since it's always available now.
9506 (syms_of_floatfns): Always define isnan at the Lisp level.
9507
9508 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9509
9510 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9511
9512 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9513
9514 * fileio.c: Fix bugs with large file offsets (Bug#9428).
9515 The previous code assumed that file offsets (off_t values) fit in
9516 EMACS_INT variables, which is not true on typical 32-bit hosts.
9517 The code messed up by falsely reporting buffer overflow in cases
9518 such as (insert-file-contents "big" nil 1 2) into an empty buffer
9519 when "big" contains more than 2**29 bytes, even though this
9520 inserts just one byte and does not overflow the buffer.
9521 (Finsert_file_contents): Store file offsets as off_t
9522 values, not as EMACS_INT values. Check for overflow when
9523 converting between EMACS_INT and off_t. When checking for
9524 buffer overflow or for overlap, take the offsets into account.
9525 Don't use EMACS_INT for small values where int suffices.
9526 When checking for overlap, fix a typo: ZV was used where
9527 ZV_BYTE was intended.
9528 (Fwrite_region): Don't assume off_t fits into 'long'.
9529 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9530
9531 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
9532
9533 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9534
9535 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9536
9537 sprintf-related integer and memory overflow issues (Bug#9412).
9538
9539 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
9540 (esprintf, exprintf, evxprintf): New functions.
9541 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
9542 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
9543 (modify_event_symbol): Do not assume that the length of
9544 name_alist_or_stem is safe to alloca and fits in int.
9545 (Fexecute_extended_command): Likewise for function name and binding.
9546 (Frecursion_depth): Wrap around reliably on integer overflow.
9547 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9548 since some callers pass EMACS_INT values.
9549 (Fsingle_key_description): Don't crash if symbol name contains more
9550 than MAX_ALLOCA bytes.
9551 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9552 (get_minibuffer): Arg is now EMACS_INT, not int.
9553 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
9554 (esprintf, exprintf, evxprintf): New decls.
9555 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9556
9557 * dbusbind.c (signature_cat): New function.
9558 (xd_signature, Fdbus_register_signal):
9559 Do not overrun buffer; instead, report string overflow.
9560
9561 * dispnew.c (add_window_display_history): Don't overrun buffer.
9562 Truncate instead; this is OK since it's just a log.
9563
9564 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9565 even if the time zone offset is outlandishly large.
9566 Don't mishandle offset == INT_MIN.
9567
9568 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9569 when creating daemon; the previous buffer-overflow check was incorrect.
9570
9571 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9572 which has the guts of the old verror function.
9573
9574 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9575 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9576
9577 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9578 (font_unparse_xlfd): Don't blindly alloca long strings.
9579 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
9580 fits in int, when using sprintf. Use single snprintf to count
9581 length of string rather than counting it via multiple sprintfs;
9582 that's simpler and more reliable.
9583 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9584 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9585 sprintf, in case result does not fit in int.
9586
9587 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9588 (fontset_from_font): Print it.
9589
9590 * frame.c (tty_frame_count): Now printmax_t, not int.
9591 (make_terminal_frame, set_term_frame_name): Print it.
9592 (x_report_frame_params): In X, window IDs are unsigned long,
9593 not signed long, so print them as unsigned.
9594 (validate_x_resource_name): Check for implausibly long names,
9595 and don't assume name length fits in 'int'.
9596 (x_get_resource_string): Don't blindly alloca invocation name;
9597 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9598 not fit in int.
9599
9600 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9601 (xg_check_special_colors, xg_set_geometry):
9602 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9603
9604 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9605 Use esprintf, not sprintf, in case result does not fit in int.
9606
9607 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9608 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9609 it as a large positive number.
9610 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9611 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9612
9613 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9614 in case result does not fit in int.
9615
9616 * print.c (float_to_string): Detect width overflow more reliably.
9617 (print_object): Make sprintf buffer a bit bigger, to avoid potential
9618 buffer overrun. Don't assume list length fits in 'int'. Treat
9619 print length of 0 as 0, not as infinity; to be consistent with other
9620 uses of print length in this function. Don't overflow print length
9621 index. Don't assume hash table size fits in 'long', or that
9622 vectorlike size fits in 'unsigned long'.
9623
9624 * process.c (make_process): Use printmax_t, not int, to format
9625 process-name gensyms.
9626
9627 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9628
9629 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9630 to avoid potential buffer overrun.
9631
9632 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9633 if X resource line is longer than 512 bytes.
9634
9635 * xfns.c (x_window): Make sprintf buffer a bit bigger
9636 to avoid potential buffer overrun.
9637
9638 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9639
9640 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9641
9642 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9643
9644 Integer overflow fixes for scrolling, etc.
9645 Without these, Emacs silently mishandles large integers sometimes.
9646 For example, "C-u 4294967297 M-x recenter" was treated as if
9647 it were "C-u 1 M-x recenter" on a typical 64-bit host.
9648
9649 * xdisp.c (try_window_id): Check Emacs fixnum range before
9650 converting to 'int'.
9651
9652 * window.c (window_scroll_line_based, Frecenter):
9653 Check that an Emacs fixnum is in range before assigning it to 'int'.
9654 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9655 values converted from Emacs fixnums.
9656 (Frecenter): Don't wrap around a line count if it is out of 'int'
9657 range; instead, treat it as an extreme value.
9658 (Fset_window_configuration, compare_window_configurations):
9659 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9660
9661 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9662 that can exceed INT_MAX. Check that EMACS_INT value is in range
9663 before assigning it to the (possibly-narrower) index.
9664 (match_limit): Don't assume that a fixnum can fit in 'int'.
9665
9666 * print.c (print_object): Use ptrdiff_t, not int, for index that can
9667 exceed INT_MAX.
9668
9669 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
9670 (Fvertical_motion): Don't wrap around LINES values that don't fit
9671 in 'int'. Instead, treat them as extreme values. This is good
9672 enough for windows, which can't have more than INT_MAX lines anyway.
9673
9674 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9675
9676 * Require libxml/parser.h to avoid compilation warning.
9677
9678 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9679
9680 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9681 since this reportedly can destroy thread storage.
9682
9683 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
9684
9685 * syntax.c (find_defun_start): Update all cache variables if
9686 exiting early (Bug#9401).
9687
9688 2011-08-30 Eli Zaretskii <eliz@gnu.org>
9689
9690 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9691
9692 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9693 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9694 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9695
9696 * term.c (tty_append_glyph): New function.
9697 (produce_stretch_glyph): Static function and its prototype deleted.
9698
9699 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9700 Add prototypes.
9701
9702 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9703
9704 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9705 when checking :margin (Bug#9390).
9706 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
9707 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
9708 so that the name doesn't mislead. All uses changed.
9709
9710 2011-08-28 Johan Bockgård <bojohan@gnu.org>
9711
9712 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9713 set_tty_hooks.
9714
9715 2011-08-27 Eli Zaretskii <eliz@gnu.org>
9716
9717 * xdisp.c (move_it_to): Don't bail out early when reaching
9718 position beyond to_charpos, if we are scanning backwards.
9719 (move_it_vertically_backward): When DY == 0, make sure we get to
9720 the first character in the line after the newline.
9721
9722 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9723
9724 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9725 (ccl_driver): Do not generate an out-of-range pointer.
9726 (Fccl_execute_on_string): Remove unnecessary check for
9727 integer overflow, noted by Stefan Monnier in
9728 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9729 Remove a FIXME that didn't need fixing.
9730 Simplify the newly-introduced buffer reallocation code.
9731
9732 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
9733
9734 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9735
9736 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
9737
9738 Integer and memory overflow issues (Bug#9196).
9739
9740 * doc.c (get_doc_string): Rework so that
9741 get_doc_string_buffer_size is the actual buffer size, rather than
9742 being 1 less than the actual buffer size; this makes xpalloc more
9743 convenient.
9744
9745 * image.c (x_allocate_bitmap_record, cache_image):
9746 * xselect.c (Fx_register_dnd_atom):
9747 Simplify previous changes by using xpalloc.
9748
9749 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9750 since either will do and ptrdiff_t is convenient with xpalloc.
9751
9752 * charset.c (charset_table_size)
9753 (struct charset_sort_data.priority): Now ptrdiff_t.
9754 (charset_compare): Don't overflow if priorities differ greatly.
9755 (Fsort_charsets): Don't assume list length fits in int.
9756 Check for size-calculation overflow when allocating sort data.
9757 (syms_of_charset): Allocate an initial charset table that is
9758 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9759
9760 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9761
9762 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9763 The actual value is always <= INT_MAX, and leaving it unsigned made
9764 overflow checking harder.
9765
9766 * dispextern.h (struct glyph_matrix.rows_allocated)
9767 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9768 with xpalloc. The values are still always <= INT_MAX.
9769
9770 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9771
9772 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9773 (SAFE_NALLOCA): New macro.
9774
9775 * region-cache.c (struct boundary.pos, find_cache_boundary)
9776 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9777 (set_cache_region, invalidate_region_cache)
9778 (revalidate_region_cache, know_region_cache, region_cache_forward)
9779 (region_cache_backward, pp_cache):
9780 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9781 so that ptrdiff_t * can be passed to xpalloc.
9782 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9783 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9784 (pp_cache): Don't assume cache_len fits in int.
9785 * region-cache.h: Adjust extern decls to match.
9786
9787 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9788 EMACS_INT, since either will do, for xpalloc.
9789
9790 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9791 (xnmalloc, xnrealloc, xpalloc): New functions.
9792
9793 * bidi.c (bidi_shelve_header_size): New constant.
9794 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9795 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9796
9797 * bidi.c (bidi_cache_shrink):
9798 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9799 (overlay_strings):
9800 Don't update size of array until after memory allocation succeeds,
9801 because xmalloc/xrealloc may not return.
9802 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9803 now that we have proper integer overflow checking.
9804 (record_overlay_string, overlay_strings): Catch overflows when
9805 calculating size of overlay_str_buf.
9806
9807 * callproc.c (Fcall_process): Check for size overflow when
9808 calculating size of args2.
9809 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9810 Normally we prefer signed values, but sticking with ptrdiff_t would
9811 require adding more-complicated checks.
9812
9813 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9814 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9815 Redo buffer-overflow calculations to avoid integer overflow.
9816 Add a FIXME comment where memory seems to be over-allocated.
9817
9818 * character.c (Fstring): Check for size-calculation overflow.
9819
9820 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9821 unnecessary integer overflow. Check for size overflow.
9822 (encode_coding_object): Don't update size until xmalloc succeeds.
9823
9824 * composite.c (get_composition_id): Check for overflow in glyph
9825 length calculations.
9826
9827 Integer and memory overflow fixes for display code.
9828 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9829 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9830 (scrolling_window): Check for overflow in size calculations.
9831 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9832 Don't assume glyph table len fits in int.
9833 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9834 (row_table_size): Now ptrdiff_t, not int.
9835 (scrolling_window): Avoid overflow in size calculations.
9836 Don't update size until allocation succeeds.
9837 * fns.c (concat): Check for overflow in size calculations.
9838 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9839 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9840 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9841
9842 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9843 (get_doc_string): Check for size calculation overflow.
9844 Don't update size until allocation succeeds.
9845 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9846 EMACS_INT, where ptrdiff_t will do.
9847 (Fsubstitute_command_keys): Check for string overflow.
9848
9849 * editfns.c (set_time_zone_rule): Don't assume environment length
9850 fits in int.
9851 (message_length): Now ptrdiff_t, not int.
9852 (Fmessage_box): Don't update size until allocation succeeds.
9853 Don't assume message length fits in int.
9854 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9855
9856 * emacs.c (main): Do not reallocate argv, since there is a null at
9857 the end that can be overwritten, and this way there's no need to
9858 worry about size-calculation overflow.
9859 (sort_args): Check for size-calculation overflow.
9860
9861 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9862 alloc succeeds.
9863 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9864
9865 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9866 (x_set_scroll_bar_width, x_figure_window_size):
9867 Check for integer overflow.
9868 (x_set_alpha): Do not assume XINT fits in int.
9869
9870 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9871 This is for the members text_lines, text_cols, total_lines, total_cols,
9872 where the system imposes an 'int' limit.
9873
9874 * fringe.c (Fdefine_fringe_bitmap):
9875 Don't update size until alloc works.
9876
9877 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9878 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9879
9880 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9881 Check for size-calculation overflow.
9882 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9883 do, as we prefer signed integers.
9884 (id_to_widget.max_size, id_to_widget.used)
9885 (xg_store_widget_in_map, xg_remove_widget_from_map)
9886 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9887 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9888 Use and return ptrdiff_t, not int.
9889 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9890 * gtkutil.h: Change prototypes to match the above.
9891
9892 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9893 are duplicate now that they've been promoted to lisp.h.
9894 (x_allocate_bitmap_record, x_alloc_image_color)
9895 (make_image_cache, cache_image, xpm_load):
9896 Don't update size until alloc is done.
9897 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9898 (x_detect_edges):
9899 Check for size calculation overflow.
9900 (ct_colors_allocated_max): New constant.
9901 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9902 overflow.
9903
9904 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9905 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9906 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9907 Use ptrdiff_t, not int, to count maps.
9908 (read_char_minibuf_menu_prompt): Check for overflow in size
9909 calculations. Don't update size until allocation succeeds.
9910 Redo calculations to avoid overflow.
9911 * keyboard.h: Change prototypes to match the above.
9912
9913 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9914 to count maps.
9915 (current_minor_maps): Check for size calculation overflow.
9916 * keymap.h: Change prototypes to match the above.
9917
9918 * lread.c (read1, init_obarray): Don't update size until alloc done.
9919
9920 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9921 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9922
9923 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9924 Now ptrdiff_t, not int.
9925 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9926 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9927
9928 * process.c (Fnetwork_interface_list): Check for overflow
9929 in size calculation.
9930
9931 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9932
9933 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9934 overflow. Don't bother calling xmalloc when xrealloc will do.
9935
9936 * search.c (Freplace_match): Check for size calculation overflow.
9937 (Fset_match_data): Don't assume list lengths fit in 'int'.
9938
9939 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9940 for command line length. Do not attempt to address one before the
9941 beginning of an array, as that's not portable.
9942
9943 * term.c (max_frame_lines): Remove; unused.
9944 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9945 not int.
9946 (encode_terminal_code, calculate_costs): Check for size
9947 calculation overflow.
9948 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9949 table lengths and related sizes. Don't update size until alloc
9950 done. Redo calculations to avoid overflow.
9951 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9952
9953 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9954 subtracting pointers.
9955 (gobble_line): Check for overflow more carefully. Don't update size
9956 until alloc done.
9957
9958 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9959 Don't update size until alloc done.
9960 Redo size calculations to avoid overflow.
9961 Check for size calculation overflow.
9962 (main) [DEBUG]: Fix typo in invoking tparam1.
9963
9964 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9965 Use ptrdiff_t, not int, for sizes.
9966 (store_mode_line_noprop_char): Don't update size until alloc done.
9967
9968 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9969 Use ptrdiff_t, not int, for sizes.
9970 (Finternal_make_lisp_face, cache_face):
9971 Check for size calculation overflow.
9972 (cache_face): Treat size calculation overflows as if they were
9973 memory exhaustion (the usual treatment), rather than aborting.
9974
9975 * xfns.c (x_encode_text, x_set_name_internal)
9976 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9977 sizes, since they can exceed INT_MAX in size. Check for size
9978 calculation overflow.
9979
9980 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9981 (xg_select): Check for size calculation overflow.
9982 Don't update size until alloc done.
9983
9984 * xrdb.c (get_environ_db): Don't assume path length fits in int,
9985 as sprintf is limited to int lengths.
9986
9987 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9988 (X_LONG_MIN): New macros.
9989 Use them to make the following changes clearer.
9990 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9991 This change doesn't affect the value now, but it may help remind
9992 future maintainers not to raise the value too much later.
9993 (SELECTION_QUANTUM): Remove, replacing with ...
9994 (selection_quantum): ... new function, which avoids overflow.
9995 All uses changed.
9996 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9997 assumption that selection length fits in 'int'.
9998 (x_reply_selection_request, x_handle_selection_request)
9999 (x_get_window_property, receive_incremental_selection)
10000 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10001 (lisp_data_to_selection_data, clean_local_selection_data):
10002 Use ptrdiff_t, not int, to record length of selection.
10003 (x_reply_selection_request, x_get_window_property)
10004 (receive_incremental_selection, x_property_data_to_lisp):
10005 Redo calculations to avoid overflow.
10006 (x_reply_selection_request): When sending hint, ceiling it at
10007 X_LONG_MAX rather than relying on wraparound overflow to send
10008 something.
10009 (x_get_window_property, receive_incremental_selection)
10010 (lisp_data_to_selection_data, x_property_data_to_lisp):
10011 Check for size-calculation overflow.
10012 (x_get_window_property, receive_incremental_selection)
10013 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10014 Don't store size until memory allocation succeeds.
10015 (x_get_window_property): Plug memory leak on memory exhaustion.
10016 Don't double-block input; malloc is safe here. Don't assume 2**34
10017 - 4 fits in unsigned long. Add an xassert to check
10018 XGetWindowProperty overflow. Be more careful about overflow
10019 calculations, and distinguish size from memory overflow better.
10020 (receive_incremental_selection): When tracing, don't assume
10021 unsigned int is less than INT_MAX.
10022 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10023 harmful) conversions of unsigned short to int.
10024 (lisp_data_to_selection_data): Don't assume that integers
10025 in the range -65535 through -1 fit in an X unsigned short.
10026 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10027 result parameters unless successful. Rely on cons_to_unsigned
10028 to report problems with elements; the old code wasn't right anyway.
10029 (x_check_property_data): Check for int overflow; we cannot use
10030 a wider type due to X limits.
10031 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10032
10033 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10034
10035 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10036 (x_term_init): Check for size calculation overflow.
10037 (x_color_cells): Don't store size until memory allocation succeeds.
10038 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10039 Don't assume alloca size is less than MAX_ALLOCA.
10040 (x_term_init): Don't assume length fits in int (sprintf is limited
10041 to int size).
10042
10043 Use ptrdiff_t for composition IDs.
10044 * character.c (lisp_string_width):
10045 * composite.c (composition_table_size, n_compositions)
10046 (get_composition_id, composition_gstring_from_id):
10047 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10048 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10049 * window.c (Frecenter):
10050 Use ptrdiff_t, not int, for composition IDs.
10051 * composite.c (get_composition_id): Check for integer overflow.
10052 * composite.h: Adjust prototypes to match the above changes.
10053
10054 Use ptrdiff_t for hash table indexes.
10055 * category.c (hash_get_category_set):
10056 * ccl.c (ccl_driver):
10057 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10058 * coding.c (coding_system_charset_list, detect_coding_system):
10059 * coding.h (struct coding_system.id):
10060 * composite.c (get_composition_id, gstring_lookup_cache):
10061 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10062 * image.c (xpm_get_color_table_h):
10063 * lisp.h (hash_lookup, hash_put):
10064 * minibuf.c (Ftest_completion):
10065 Use ptrdiff_t for hash table indexes, not int (which is too
10066 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10067 32-bit --with-wide-int hosts).
10068
10069 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10070 Add a FIXME comment about memory leaks.
10071 (syms_of_charset): Don't assume xmalloc returns.
10072
10073 Don't assume that stated character widths fit in int.
10074 * character.c (Fchar_width, c_string_width, lisp_string_width):
10075 * character.h (CHAR_WIDTH):
10076 * indent.c (MULTIBYTE_BYTES_WIDTH):
10077 Use sanitize_char_width to avoid undefined and/or bad behavior
10078 with outlandish widths.
10079 * character.h (sanitize_tab_width): Rename from sanitize_width,
10080 now that we have two such functions. All uses changed.
10081 (sanitize_char_width): New inline function.
10082
10083 Don't assume that tab-width fits in int.
10084 * character.h (sanitize_width): New inline function.
10085 (SANE_TAB_WIDTH): New macro.
10086 (ASCII_CHAR_WIDTH): Use it.
10087 * indent.c (sane_tab_width): Remove. All uses replaced by
10088 SANE_TAB_WIDTH (current_buffer).
10089 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10090
10091 * fileio.c: Integer overflow issues with file modes.
10092 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10093
10094 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10095 Remove unreachable code.
10096 (read_hex, load_charset_map_from_file): Check for integer overflow.
10097
10098 * xterm.c: Don't go over XClientMessageEvent limit.
10099 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10100 (x_send_scroll_bar_event): Likewise. Check that the size does not
10101 exceed limits imposed by XClientMessageEvent, as well as the usual
10102 ptrdiff_t and size_t limits.
10103
10104 * keyboard.c: Overflow, signedness and related fixes.
10105 (make_lispy_movement): Use same integer type in forward decl
10106 that is used in the definition.
10107 (read_key_sequence, keyremap_step):
10108 Change bufsize argument back to int, undoing my 2011-03-30 change.
10109 We prefer signed types, and int is wide enough here.
10110 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10111 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10112 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10113 length, not size_t. Use ptrdiff_t for index, not int.
10114 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10115 possibility of integer overflow.
10116
10117 Overflow, signedness and related fixes for images.
10118
10119 * dispextern.h (struct it.stack[0].u.image.image_id)
10120 (struct_it.image_id, struct image.id, struct image_cache.size)
10121 (struct image_cache.used, struct image_cache.ref_count):
10122 * gtkutil.c (update_frame_tool_bar):
10123 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10124 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10125 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10126 * nsmenu.m (update_frame_tool_bar):
10127 * xdisp.c (calc_pixel_width_or_height):
10128 * xfns.c (image_cache_refcount):
10129 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10130 on typical 64-bit hosts.
10131
10132 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10133 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10134 Omit unnecessary casts to int.
10135 (parse_image_spec): Check that integers fall into 'int' range
10136 when the callers expect that.
10137 (image_ascent): Redo ascent calculation to avoid int overflow.
10138 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10139 (lookup_image): Remove unnecessary tests.
10140 (xbm_image_p): Locals are now of int, not EMACS_INT,
10141 since parse_image_check makes sure they fit into int.
10142 (png_load, gif_load, svg_load_image):
10143 Prefer int to unsigned where either will do.
10144 (tiff_handler): New function, combining the cores of the
10145 old tiff_error_handler and tiff_warning_handler.
10146 This function is rewritten to use vsnprintf and thereby avoid
10147 stack buffer overflows. It uses only the features of vsnprintf
10148 that are common to both POSIX and native Microsoft.
10149 (tiff_error_handler, tiff_warning_handler): Use it.
10150 (tiff_load, gif_load, imagemagick_load_image):
10151 Don't assume :index value fits in 'int'.
10152 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10153 (imagemagick_load_image): Check that crop parameters fit into
10154 the integer types that MagickCropImage accepts. Don't assume
10155 Vimagemagick_render_type has a nonnegative value. Don't assume
10156 size_t fits in 'long'.
10157 (gs_load): Use printmax_t to print the widest integers possible.
10158 Check for integer overflow when computing image height and width.
10159
10160 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10161
10162 * xdisp.c (redisplay_window): Don't force window start if point
10163 will be invisible in the resulting window. (Bug#9324)
10164
10165 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10166
10167 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10168 the display spec is of the form `(space ...)'.
10169 (handle_display_spec): Return the value returned by
10170 handle_single_display_spec, not just 1 or zero.
10171 (handle_single_display_spec): If the display spec is of the form
10172 `(space ...)', and specifies display in the text area, return 2
10173 rather than 1.
10174 (try_cursor_movement): Check for the need to scroll more
10175 accurately, and prefer exact match for point under bidi.
10176 Don't advance `row' beyond the last row of the window.
10177
10178 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10179 into disp_prop; all users changed.
10180
10181 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10182 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10183 for the text covered by the display property.
10184
10185 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10186
10187 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10188 Change return value to nil.
10189 (Frecord_buffer): Delete unused function.
10190
10191 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10192
10193 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10194 buffers, return left-to-right.
10195 (set_cursor_from_row): Consider candidate row a win if its glyph
10196 represents a newline and point is on that newline. Fixes cursor
10197 positioning on the newline at EOL of R2L text within L2R
10198 paragraph, and vice versa.
10199 (try_cursor_movement): Check continued rows, in addition to
10200 continuation rows. Fixes unwarranted scroll when point enters a
10201 continued line of R2L text within an L2R paragraph, or vice versa.
10202 (cursor_row_p): Consider the case of point being equal to
10203 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10204 from the end of a short line to the beginning of a continued line
10205 of R2L text within L2R paragraph.
10206 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10207 composed characters.
10208
10209 * bidi.c (bidi_check_type): Use xassert.
10210 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10211 members.
10212
10213 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10214
10215 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10216 a character.
10217
10218 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10219
10220 * nsfont.m (ns_otf_to_script): Fix typo.
10221
10222 2011-08-22 Kenichi Handa <handa@m17n.org>
10223
10224 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10225 extra slot even if the purpose is char-code-property-table.
10226
10227 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10228
10229 * xdisp.c (redisplay_window): When computing centering_position,
10230 account for the height of the header line. (Bug#8874)
10231
10232 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10233 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10234 candidate is selected by the mouse, and that candidate has a
10235 composed character under the mouse.
10236
10237 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10238 coordinates reported by pos-visible-in-window-p for a composed
10239 character in column zero.
10240
10241 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10242
10243 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10244
10245 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10246
10247 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10248 consider it a hit if to_charpos is anywhere in the range of the
10249 composed buffer positions.
10250
10251 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10252
10253 * image.c (gif_load): Don't assume that each subimage has the same
10254 dimensions as the base image. Handle disposal method that is
10255 "undefined" by the gif spec (Bug#9335).
10256
10257 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10258
10259 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10260 (Fcondition_case): Document `debug' symbol in error handler.
10261
10262 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10263
10264 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10265 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10266 from an Org mode buffer to a Speedbar frame.
10267
10268 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10269 a composition, take its buffer position from IT->cmp_it.charpos.
10270 Fixes cursor positioning at the beginning of a line that begins
10271 with a composed character.
10272
10273 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10274
10275 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10276 character bidirectional type, use STRONG_L instead. Fixes crashes
10277 in a buffer produced by `describe-categories'.
10278
10279 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10280 members before the level stack, so they would be saved and
10281 restored when copying iterator state. Fixes incorrect reordering
10282 around TABs covered by display properties.
10283
10284 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10285
10286 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10287
10288 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10289
10290 * eval.c (internal_condition_case, internal_condition_case_1)
10291 (internal_condition_case_2, internal_condition_case_n):
10292 Remove unnecessary aborts (Bug#9081).
10293
10294 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10295
10296 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10297 has no `load' handler, try opening the file locally. (Bug#9311)
10298
10299 2011-08-16 Ken Brown <kbrown@cornell.edu>
10300
10301 * gmalloc.c: Expand comment.
10302
10303 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10304
10305 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10306 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10307
10308 2011-08-16 Ken Brown <kbrown@cornell.edu>
10309
10310 Fix memory allocation problems in Cygwin build (Bug#9273).
10311
10312 * unexcw.c ( __malloc_initialized): Declare external variable.
10313 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10314
10315 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10316 New variables.
10317 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10318 dumped emacs.
10319 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10320 in the static heap.
10321 [CYGWIN] (special_realloc): New function.
10322 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10323 requests to realloc storage in the static heap.
10324
10325 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10326
10327 * bidi.c (bidi_initialize): Remove unused local.
10328
10329 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10330
10331 * bidimirror.h:
10332 * biditype.h: Remove file.
10333 * makefile.w32-in ($(BLD)/bidi.$(O)):
10334 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10335
10336 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10337
10338 * chartab.c: Improve commentary for the uniprop_table API.
10339
10340 * bidi.c (bidi_paragraph_init): Support zero value of
10341 bidi_ignore_explicit_marks_for_paragraph_level.
10342 (bidi_initialize): Use uniprop_table instead of including
10343 biditype.h and bidimirror.h.
10344
10345 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10346 coordinates of the iterator when restoring from ppos_it.
10347 (Bug#9296)
10348
10349 2011-08-14 Kenichi Handa <handa@m17n.org>
10350
10351 * process.c (create_process): Call setup_process_coding_systems
10352 after the pid of the process is set to -1 (Bug#8162).
10353
10354 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10355
10356 * xdisp.c (move_it_in_display_line_to): Don't invoke
10357 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10358 ppos_it. Fixes vertical cursor motion when line beginning is
10359 covered by an image. (Bug#9296)
10360
10361 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10362
10363 * nsterm.h (ns_run_ascript): Declare.
10364 (NSAPP_DATA2_RUNASSCRIPT): Define.
10365
10366 * nsfns.m (as_script, as_result, as_status): New static variables.
10367 (ns_run_ascript): New function.
10368 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10369 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10370 the event loop. Get status from as_status (Bug#7276).
10371
10372 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10373 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10374 the event loop (Bug#7276).
10375
10376 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10377
10378 * gnutls.c (QCgnutls_bootprop_priority)
10379 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10380 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10381 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10382 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10383 (QCgnutls_bootprop_verify_hostname_error)
10384 (QCgnutls_bootprop_callbacks_verify): Rename from
10385 Qgnutls_bootprop_..., all uses changed.
10386
10387 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10388 uses changed.
10389
10390 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10391
10392 * xfaces.c (Qframe_set_background_mode): Now static.
10393 * dispextern.h (Qframe_set_background_mode): Remove decl.
10394
10395 * process.c (Fnetwork_interface_info): Declare local only if needed.
10396
10397 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10398
10399 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10400 (Fnetwork_interface_list): Allocate in increments of bytes instead
10401 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10402 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10403 sockaddr.
10404 (struct ifflag_def): notrailers is smart on OSX.
10405 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10406 Get hardware address with getifaddrs if available.
10407
10408 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10409
10410 * xdisp.c (iterate_out_of_display_property): xassert that
10411 IT->position is set to within IT->object's boundaries. Break from
10412 the loop as soon as EOB is reached; avoids infloops in redisplay
10413 when IT->position is set up wrongly due to some bug.
10414 Set IT->current to match the bidi iterator unconditionally.
10415 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10416 entry. Force push_it to save on the stack the current
10417 buffer/string position, to be restored by pop_it. Fix flags in
10418 the iterator structure wrt the object coming from a display
10419 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10420 properties. (Bug#9284)
10421
10422 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10423
10424 * fontset.c (fontset_get_font_group): Add proper type checks.
10425 (Bug#9172)
10426
10427 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10428
10429 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10430 and LC_VERSION_MIN_MACOSX.
10431 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10432 (dump_it) [LC_FUNCTION_STARTS]: Use it.
10433
10434 2011-08-08 Eli Zaretskii <eliz@gnu.org>
10435
10436 * xdisp.c (forward_to_next_line_start): Allow to use the
10437 no-display-properties-and-no-overlays under bidi display.
10438 Set disp_pos in the bidi iterator to avoid searches for display
10439 properties and overlays.
10440
10441 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
10442
10443 * editfns.c (Fset_time_zone_rule): Document relationship with the
10444 setenv function.
10445
10446 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10447 the font entity extracted from the cache (Bug#8109).
10448
10449 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
10450
10451 * composite.c (autocmp_chars): Don't reset point. That is done by
10452 restore_point_unwind (Bug#5984).
10453
10454 2011-08-07 Juri Linkov <juri@jurta.org>
10455
10456 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10457 to show the arg `TIME' instead of `TIMEVAL'.
10458
10459 2011-08-06 Eli Zaretskii <eliz@gnu.org>
10460
10461 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10462 display property strides EOL and includes a newline, as in
10463 longlines-mode. (Bug#9254)
10464 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10465 word-wrap under bidirectional display. (Bug#9224)
10466
10467 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10468 is non-zero, even if the data buffer is NULL. Fixes a crash in
10469 vertical-motion with longlines-mode. (Bug#9254)
10470
10471 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10472
10473 * bidi.c <bidi_cache_total_alloc>: Now static.
10474 (bidi_initialize): Initialize bidi_cache_total_alloc.
10475
10476 * xdisp.c (display_line): Release buffer allocated for shelved bidi
10477 cache. (Bug#9221)
10478
10479 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10480 amount allocated this far in `bidi_cache_total_alloc'.
10481 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10482 non-zero, only free the data buffer without restoring the cache
10483 contents. All callers changed.
10484
10485 * dispextern.h (bidi_unshelve_cache): Update prototype.
10486
10487 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10488 (move_it_in_display_line, move_it_to)
10489 (move_it_vertically_backward, move_it_by_lines): Replace the call
10490 to xfree to an equivalent call to bidi_unshelve_cache.
10491 (move_it_in_display_line_to): Fix logic of returning
10492 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
10493
10494 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10495
10496 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10497 came from a string character with a `cursor' property. (Bug#9229)
10498
10499 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10500
10501 * Makefile.in (LIB_PTHREAD): New variable.
10502 (LIBES): Add LIB_PTHREAD (Bug#9216).
10503
10504 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10505 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10506
10507 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10508
10509 * regex.c (re_iswctype): Remove some redundant boolean conversions.
10510
10511 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10512
10513 * xterm.c (x_find_topmost_parent): New function.
10514 (x_set_frame_alpha): Find topmost parent window with
10515 x_find_topmost_parent and set the property there also (bug#9181).
10516 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10517
10518 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10519
10520 * callproc.c (Fcall_process): Avoid vfork clobbering
10521 the local vars buffer, coding_systems, current_dir.
10522
10523 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10524
10525 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10526
10527 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10528
10529 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10530 so that it is not optimized away.
10531
10532 * xdisp.c (compute_display_string_pos): Remove unused local.
10533
10534 2011-08-02 Eli Zaretskii <eliz@gnu.org>
10535
10536 Fix slow cursor motion and scrolling in large buffers with
10537 selective display, like Org Mode buffers. (Bug#9218)
10538
10539 * dispextern.h (struct bidi_it): New member disp_prop_p.
10540
10541 * xdisp.c: Remove one-slot cache of display string positions.
10542 (compute_display_string_pos): Accept an additional argument
10543 DISP_PROP_P; callers changed. Scan at most 5K characters forward
10544 for a display string or property. If found, set DISP_PROP_P
10545 non-zero.
10546
10547 * bidi.c (bidi_fetch_char): Accept an additional argument
10548 DISP_PROP_P, and pass it to compute_display_string_pos.
10549 Only handle text covered by a display string if DISP_PROP_P is returned
10550 non-zero. All callers of bidi_fetch_char changed.
10551
10552 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10553
10554 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10555
10556 2010-12-03 Don March <don@ohspite.net>
10557
10558 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10559 last character M-[char] is translated to ESC [char] (bug#7541).
10560
10561 2011-08-02 Kenichi Handa <handa@m17n.org>
10562
10563 * lisp.h (uniprop_table): Extern it.
10564
10565 * chartab.c (uniprop_table): Make it non-static.
10566
10567 2011-08-01 Eli Zaretskii <eliz@gnu.org>
10568
10569 * xdisp.c (forward_to_next_line_start): Accept additional argument
10570 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10571 on the newline.
10572 (reseat_at_next_visible_line_start): Use the bidi iterator state
10573 returned by forward_to_next_line_start to restore the state of
10574 it->bidi_it after backing up to previous newline. (Bug#9212)
10575
10576 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10577
10578 * regex.c (re_comp): Protoize.
10579 (re_exec): Fix return type.
10580 (regexec): Fix type of `ret'. (Bug#9203)
10581
10582 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10583
10584 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10585 This is needed if max-image-size is a floating-point number.
10586
10587 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10588
10589 * print.c (print_object): Print empty symbol as ##.
10590
10591 * lread.c (read1): Read ## as empty symbol.
10592
10593 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10594
10595 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10596 setting frame foreground color (Bug#9175).
10597 (x_set_background_color): Likewise.
10598
10599 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10600 contents (Bug#9176).
10601 (EmacsTooltip -init): Remove bezels and add shadows to
10602 tooltip windows.
10603
10604 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10605 or scroll bar (Bug#8470).
10606
10607 * nsfont.m (nsfont_open): Remove assignment to voffset and
10608 unnecessary vars hshink, expand, hd, full_height, min_height.
10609 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10610
10611 * nsterm.h (nsfont_info): Remove voffset field.
10612
10613 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10614
10615 Implement strike-through and overline on NextStep (Bug#8863).
10616
10617 * nsfont.m (nsfont_open): Use underline position provided by font,
10618 instead of hard-coded value of 2.
10619 (nsfont_draw): Call ns_draw_text_decoration instead.
10620
10621 * nsterm.h: Add declaration for ns_draw_text_decoration.
10622
10623 * nsterm.m (ns_draw_text_decoration): New function for drawing
10624 underline, overline, and strike-through.
10625 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
10626 ns_draw_text_decoration. Change treatment of cursor drawing to
10627 accommodate underlining, etc.
10628
10629 2011-07-28 Eli Zaretskii <eliz@gnu.org>
10630
10631 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10632 default.
10633
10634 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10635
10636 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10637 Without this fix, if a signal arrives just after memory fills up,
10638 'malloc' might be invoked reentrantly.
10639
10640 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10641 In other words, assume that every image size is allowed, on non-X
10642 hosts. This assumption is probably wrong, but it lets Emacs compile.
10643
10644 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10645
10646 * regex.c (re_iswctype): Convert return values to boolean.
10647
10648 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10649
10650 * xdisp.c (compute_display_string_pos): Don't use cached display
10651 string position if the buffer had its restriction changed.
10652 (Bug#9184)
10653
10654 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10655
10656 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10657
10658 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10659
10660 Integer signedness and overflow and related fixes. (Bug#9079)
10661
10662 * bidi.c: Integer size and overflow fixes.
10663 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10664 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10665 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10666 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10667 (bidi_find_other_level_edge):
10668 Use ptrdiff_t instead of EMACS_INT where either will do.
10669 This works better on 32-bit hosts configured --with-wide-int.
10670 (bidi_cache_ensure_space): Check for size-calculation overflow.
10671 Use % rather than repeated addition, for better worst-case speed.
10672 Don't set bidi_cache_size until after xrealloc returns, because it
10673 might not return.
10674 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
10675 (bidi_cache_ensure_space): Also check that the bidi cache size
10676 does not exceed that of the largest Lisp string or buffer. See Eli
10677 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
10678
10679 * alloc.c (__malloc_size_t): Remove.
10680 All uses replaced by size_t. See Andreas Schwab's note
10681 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10682
10683 * image.c: Improve checking for integer overflow.
10684 (check_image_size): Assume that f is nonnull, since
10685 it is always nonnull in practice. This is one less thing to
10686 worry about when checking for integer overflow later.
10687 (x_check_image_size): New function, which checks for integer
10688 overflow issues inside X.
10689 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10690 This removes the need for a memory_full check.
10691 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10692 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10693 (xbm_read_bitmap_data): Change locals back to 'int', since
10694 their values must fit in 'int'.
10695 (xpm_load_image, png_load, tiff_load):
10696 Invoke x_create_x_image_and_pixmap earlier,
10697 to avoid much needless work if the image is too large.
10698 (tiff_load): Treat overly large images as if
10699 x_create_x_image_and_pixmap failed, not as malloc failures.
10700 (gs_load): Use x_check_image_size.
10701
10702 * gtkutil.c: Omit integer casts.
10703 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10704 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10705
10706 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10707
10708 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10709 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10710 would wrongly return t on a 64-bit host.
10711
10712 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10713 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10714 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10715 and therefore cause GCC to emit a bogus diagnostic in some cases.
10716
10717 * image.c: Integer signedness and overflow and related fixes.
10718 This is not an exhaustive set of fixes, but it's time to
10719 record what I've got.
10720 (lookup_pixel_color, check_image_size): Remove redundant decls.
10721 (check_image_size): Don't assume that arbitrary EMACS_INT values
10722 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10723 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10724 (tiff_load, imagemagick_load_image):
10725 Check for overflow in size calculations.
10726 (x_create_x_image_and_pixmap): Remove unnecessary test for
10727 xmalloc returning NULL; that can't happen.
10728 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10729 (xpm_color_bucket): Use better integer hashing function.
10730 (xpm_cache_color): Don't possibly over-allocate memory.
10731 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10732 (gif_memory_source):
10733 Use ptrdiff_t, not int or size_t, to record sizes.
10734 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10735 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10736 either works, as we prefer signed integers.
10737 (tiff_read_from_memory, tiff_write_from_memory):
10738 Return tsize_t, not size_t, since that's what the TIFF API wants.
10739 (tiff_read_from_memory): Don't fail simply because the read would
10740 go past EOF; instead, return a short read.
10741 (tiff_load): Omit no-longer-needed casts.
10742 (Fimagemagick_types): Don't assume size fits into 'int'.
10743
10744 Improve hashing quality when configured --with-wide-int.
10745 * fns.c (hash_string): New function, taken from sxhash_string.
10746 Do not discard information about ASCII character case; this
10747 discarding is no longer needed.
10748 (sxhash-string): Use it. Change sig to match it. Caller changed.
10749 * lisp.h: Declare it.
10750 * lread.c (hash_string): Remove, since we now use fns.c's version.
10751 The fns.c version returns a wider integer if --with-wide-int is
10752 specified, so this should help the quality of the hashing a bit.
10753
10754 * emacs.c: Integer overflow minor fix.
10755 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10756 Define only if GNU_LINUX.
10757 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10758
10759 * dispnew.c: Integer signedness and overflow fixes.
10760 Remove unnecessary forward decls, that were a maintenance hassle.
10761 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10762 All uses changed.
10763 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10764 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10765 (prepare_desired_row, line_draw_cost):
10766 Use int, not unsigned, where either works.
10767 (save_current_matrix, restore_current_matrix):
10768 Use ptrdiff_t, not size_t, where either works.
10769 (init_display): Check for overflow more accurately, and without
10770 relying on undefined behavior.
10771
10772 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10773 Remove, replacing with the new symbols in lisp.h. All uses changed.
10774 * fileio.c (make_temp_name):
10775 * filelock.c (lock_file_1, lock_file):
10776 * xdisp.c (message_dolog):
10777 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10778 Use pMd etc. instead.
10779 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10780 replacing the pWIDE etc. symbols removed from editfns.c.
10781
10782 * keyboard.h (num_input_events): Now uintmax_t.
10783 This is (very slightly) less likely to mess up due to wraparound.
10784 All uses changed.
10785
10786 * buffer.c: Integer signedness fixes.
10787 (alloc_buffer_text, enlarge_buffer_text):
10788 Use ptrdiff_t rather than size_t when either will do, as we prefer
10789 signed integers.
10790
10791 * alloc.c: Integer signedness and overflow fixes.
10792 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10793 (__malloc_size_t): Default to size_t, not to int.
10794 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10795 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10796 Prefer ptrdiff_t to size_t when either would do, as we prefer
10797 signed integers.
10798 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10799 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10800 Now const. Initialize with values that are in range even if char
10801 is signed.
10802 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10803 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10804 These functions do the right thing with sizes > 2**32.
10805 (check_depth): Now ptrdiff_t, not int.
10806 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10807 Adjust to new way of storing sizes. Check for size overflow bugs
10808 in rest of code.
10809 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10810 slightly wrong anyway, as it missed one instance of
10811 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10812 (refill_memory_reserve): Omit needless cast to size_t.
10813 (mark_object_loop_halt): Mark as externally visible.
10814
10815 * xselect.c: Integer signedness and overflow fixes.
10816 (Fx_register_dnd_atom, x_handle_dnd_message):
10817 Use ptrdiff_t, not size_t, since we prefer signed.
10818 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10819 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10820 x_dnd_atoms_size and x_dnd_atoms_length.
10821
10822 * doprnt.c: Prefer signed to unsigned when either works.
10823 * eval.c (verror):
10824 * doprnt.c (doprnt):
10825 * lisp.h (doprnt):
10826 * xdisp.c (vmessage):
10827 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10828 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10829 prefer signed arithmetic to avoid comparison confusion.
10830 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10831 but is a bit tricky.
10832
10833 Assume freestanding C89 headers, string.h, stdlib.h.
10834 * data.c, doprnt.c, floatfns.c, print.c:
10835 Include float.h unconditionally.
10836 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10837 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10838 * regex.c: Likewise for stddef.h, string.h.
10839 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10840 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10841 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10842 (STDC_HEADERS): Remove obsolete defines.
10843 * sysdep.c: Include limits.h unconditionally.
10844
10845 Assume support for memcmp, memcpy, memmove, memset.
10846 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10847 * regex.c (memcmp, memcpy):
10848 Remove; we assume C89 now.
10849
10850 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10851 (__malloc_safe_bcopy): Remove; no longer needed.
10852
10853 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
10854 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10855 well either way, and we prefer signed to unsigned.
10856
10857 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10858
10859 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10860 closes the connection while we're reading (bug#9182).
10861
10862 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
10863
10864 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10865 are specified (Bug#9168).
10866
10867 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10868
10869 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10870 Found by GCC static checking and --with-wide-int on a 32-bit host.
10871
10872 2011-07-25 Eli Zaretskii <eliz@gnu.org>
10873
10874 * xdisp.c (compute_display_string_pos): Fix logic of caching
10875 previous display string position. Initialize cached_prev_pos to
10876 -1. Fixes slow-down at the beginning of a buffer.
10877
10878 2011-07-24 Eli Zaretskii <eliz@gnu.org>
10879
10880 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10881 for attrs[LFACE_FONTSET_INDEX].
10882
10883 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10884
10885 * xml.c (parse_region): Remove unused local
10886 that was recently introduced.
10887
10888 2011-07-23 Eli Zaretskii <eliz@gnu.org>
10889
10890 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10891 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10892
10893 * xdisp.c (move_it_in_display_line_to): Record the best matching
10894 position for TO_CHARPOS while scanning the line, and restore it on
10895 exit if none of the characters scanned was an exact match.
10896 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
10897 when exact match is impossible due to invisible text, and the
10898 lines are truncated.
10899
10900 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10901
10902 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10903 for OSX >= 10.7.
10904
10905 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10906
10907 Fix a significant slow-down of cursor motion with C-n, C-p,
10908 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10909 auto-repeat under bidi redisplay in fontified buffers.
10910 * xdisp.c (compute_stop_pos_backwards): New function.
10911 (next_element_from_buffer): Call compute_stop_pos_backwards to
10912 find a suitable prev_stop when we find ourselves before
10913 base_level_stop.
10914 (reseat): Don't look for prev_stop, as that could mean a very long
10915 run.
10916 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10917 <cached_disp_overlay_modiff>: Cache for last found display string
10918 position.
10919 (compute_display_string_pos): Return the cached position if asked
10920 about the same buffer in the same area of character positions, and
10921 the buffer wasn't changed since the time the display string
10922 position was cached.
10923
10924 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10925
10926 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10927 is an integer, which is important for empty lines. (Bug#9149)
10928
10929 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
10930
10931 * frame.c (Fmodify_frame_parameters): In tty case, update the
10932 default face if necessary (Bug#4238).
10933
10934 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
10935
10936 * editfns.c (Fstring_to_char): No need to explain what a character
10937 is in the docstring (Bug#6576).
10938
10939 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10940
10941 * xml.c (parse_region): Make sure we always return a tree.
10942
10943 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10944
10945 * xml.c (parse_region): If a document contains only comments,
10946 return that, too.
10947
10948 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10949
10950 * xml.c (make_dom): Return comments, too.
10951
10952 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10953
10954 Port to OpenBSD.
10955 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10956 and the surrounding thread.
10957 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10958 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10959 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10960 timer goes off.
10961 * s/openbsd.h (BROKEN_SIGIO): Define.
10962 * unexelf.c (unexec) [__OpenBSD__]:
10963 Don't update the .mdebug section of the Alpha COFF symbol table.
10964
10965 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10966
10967 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10968 (bug#8460).
10969
10970 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10971
10972 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10973 This fixes some race conditions on the permissions of any newly
10974 created file.
10975
10976 * alloc.c (valid_pointer_p): Use pipe, not open.
10977 This fixes some permissions issues when debugging.
10978
10979 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10980 If fchown fails to set both uid and gid, try to set just gid,
10981 as that is sometimes allowed. Adjust the file's mode to eliminate
10982 setuid or setgid bits that are inappropriate if fchown fails.
10983
10984 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10985
10986 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10987 to compare Lisp_Objects.
10988 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10989 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10990 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10991
10992 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10993
10994 * lread.c (read_integer): Unread even EOF character.
10995 (read1): Likewise. Properly record start position of symbol.
10996
10997 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10998 symbol character follows.
10999
11000 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11001
11002 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11003 This works around a problem with the previous change to Fcopy_file.
11004 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11005 and without this change, GCC might complain about discarding
11006 fchown's return value.
11007
11008 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11009
11010 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11011
11012 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11013
11014 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11015
11016 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11017
11018 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11019 it's used from the C level.
11020
11021 * process.c: Use the same condition for POLL_FOR_INPUT in both
11022 keyboard.c and process.c (bug#1858).
11023
11024 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11025
11026 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11027 (Fgnutls_boot): Use it.
11028
11029 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11030
11031 * doc.c (Fsubstitute_command_keys): Revert last change.
11032
11033 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11034
11035 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11036 quotes the next character, and doesn't affect other longer
11037 sequences (bug#8935).
11038
11039 * lread.c (syms_of_lread): Clarify that is isn't only
11040 `eval-buffer' and `eval-defun' that's affected by
11041 `lexical-binding' (bug#8460).
11042
11043 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11044
11045 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11046 bidi redisplay when a line includes both an image and is truncated.
11047
11048 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11049
11050 Fix minor problems found by static checking.
11051 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11052 (elsz): Now a signed constant, not a size_t var. We prefer signed
11053 types to unsigned, to avoid integer comparison confusion. Without
11054 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11055 "cannot optimize loop, the loop counter may overflow", a symptom
11056 of the confusion.
11057 * indent.c (Fvertical_motion): Mark locals as initialized.
11058 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11059
11060 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11061
11062 * search.c (Fre_search_backward): Mention `case-fold-search' in
11063 all the re_search_* functions (bug#8138).
11064
11065 * keyboard.c (Fopen_dribble_file): Document when the file is
11066 closed (bug#8056).
11067
11068 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11069
11070 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11071 bidi_cache_idx.
11072
11073 Support bidi reordering of display and overlay strings.
11074 * xdisp.c (compute_display_string_pos)
11075 (compute_display_string_end): Accept additional argument STRING.
11076 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11077 (reseat_to_string): Initialize bidi_it->string.s and
11078 bidi_it->string.schars.
11079 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11080 NULL (avoids a crash in bidi_paragraph_init).
11081 Initialize itb.string.lstring.
11082 (init_iterator): Call bidi_init_it only of a valid
11083 buffer position was specified. Initialize paragraph_embedding to
11084 L2R.
11085 (reseat_to_string): Initialize the bidi iterator.
11086 (display_string): If we need to ignore text properties of
11087 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11088 original value of -1 will not work with bidi.)
11089 (compute_display_string_pos): First arg is now struct
11090 `text_pos *'; all callers changed. Support display properties on
11091 Lisp strings.
11092 (compute_display_string_end): Support display properties on Lisp
11093 strings.
11094 (init_iterator, reseat_1, reseat_to_string): Initialize the
11095 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11096 when iterating on a string not from display properties).
11097 (compute_display_string_pos, compute_display_string_end):
11098 Fix calculation of the object to scan. Fixes an error when using
11099 arrow keys.
11100 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11101 base_level_stop; instead, set base_level_stop to BEGV.
11102 Fixes crashes in vertical-motion.
11103 (next_element_from_buffer): Improve commentary for when
11104 the iterator is before prev_stop.
11105 (init_iterator): Initialize bidi_p from the default value of
11106 bidi-display-reordering, not from buffer-local value. Use the
11107 buffer-local value only if initializing for buffer iteration.
11108 (handle_invisible_prop): Support invisible properties on strings
11109 that are being bidi-reordered.
11110 (set_iterator_to_next): Support bidi reordering of C strings and
11111 Lisp strings.
11112 (next_element_from_string): Support bidi reordering of Lisp
11113 strings.
11114 (handle_stop_backwards): Support Lisp strings as well.
11115 (display_string): Support display of R2L glyph rows.
11116 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11117 (init_iterator): Don't initialize it->bidi_p for strings
11118 here.
11119 (reseat_to_string): Initialize it->bidi_p for strings here.
11120 (next_element_from_string, next_element_from_c_string)
11121 (next_element_from_buffer): Add xassert's for correspondence
11122 between IT's object being iterated and it->bidi_it.string
11123 structure.
11124 (face_before_or_after_it_pos): Support bidi iteration.
11125 (next_element_from_c_string): Handle the case of the first string
11126 character that is not the first one in the visual order.
11127 (get_visually_first_element): New function, refactored from common
11128 parts of next_element_from_buffer, next_element_from_string, and
11129 next_element_from_c_string.
11130 (tool_bar_lines_needed, redisplay_tool_bar)
11131 (display_menu_bar): Force left-to-right direction. Add a FIXME
11132 comment for making that be controlled by a user option.
11133 (push_it, pop_it): Save and restore the state of the
11134 bidi iterator. Save and restore the bidi_p flag.
11135 (pop_it): Iterate out of display property for string iteration as
11136 well.
11137 (iterate_out_of_display_property): Support iteration over strings.
11138 (handle_single_display_spec): Set up it->bidi_it for iteration
11139 over a display string, and call bidi_init_it.
11140 (handle_single_display_spec, next_overlay_string)
11141 (get_overlay_strings_1, push_display_prop): Set up the bidi
11142 iterator for displaying display or overlay strings.
11143 (forward_to_next_line_start): Don't use the shortcut if
11144 bidi-iterating.
11145 (back_to_previous_visible_line_start): If handle_display_prop
11146 pushed the iterator stack, restore the internal state of the bidi
11147 iterator by calling bidi_pop_it same number of times.
11148 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11149 and we are bidi-iterating, don't decrement the iterator position;
11150 instead, set the first_elt flag in the bidi iterator, to produce
11151 the same effect.
11152 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11153 (push_display_prop): xassert that we are iterating a buffer.
11154 (push_it, pop_it): Save and restore paragraph_embedding member.
11155 (handle_single_display_spec, next_overlay_string)
11156 (get_overlay_strings_1, reseat_1, reseat_to_string)
11157 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11158 correctly. Don't assume unibyte strings are not bidi-reordered.
11159 (compute_display_string_pos)
11160 (compute_display_string_end): Fix handling the case of C string.
11161 (push_it, pop_it): Save and restore from_disp_prop_p.
11162 (handle_single_display_spec, push_display_prop): Set the
11163 from_disp_prop_p flag.
11164 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11165 (pop_it): Call iterate_out_of_display_property only if we are
11166 popping after iteration over a string that came from a display
11167 property. Fix a typo in popping stretch info. Add an assertion
11168 for verifying that the iterator position is in sync with the bidi
11169 iterator.
11170 (handle_single_display_spec, get_overlay_strings_1)
11171 (push_display_prop): Fix initialization of paragraph direction for
11172 string when that of the parent object is not yet determined.
11173 (reseat_1): Call bidi_init_it to resync the bidi
11174 iterator with IT's position. (Bug#7616)
11175 (find_row_edges): If ROW->start.pos gives position
11176 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11177 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11178 Reset the from_disp_prop_p flag.
11179 (SAVE_IT, RESTORE_IT): New macros.
11180 (pos_visible_p, face_before_or_after_it_pos)
11181 (back_to_previous_visible_line_start)
11182 (move_it_in_display_line_to, move_it_in_display_line)
11183 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11184 (try_scrolling, redisplay_window, display_line): Use them when
11185 saving a temporary copy of the iterator and restoring it back.
11186 (back_to_previous_visible_line_start, reseat_1)
11187 (init_iterator): Empty the bidi cache "stack".
11188 (move_it_in_display_line_to): If iterator ended up at
11189 EOL, but we never saw any buffer positions smaller than
11190 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11191 motion in bidi-reordered lines.
11192 (move_it_in_display_line_to): Record prev_method and prev_pos
11193 immediately before the call to set_iterator_to_next. Fixes cursor
11194 motion in bidi-reordered lines with stretch glyphs and strings
11195 displayed in margins. (Bug#8133) (Bug#8867)
11196 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11197 TO_CHARPOS.
11198 (pos_visible_p): Support positions in bidi-reordered lines.
11199 Save and restore bidi cache.
11200
11201 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11202 (bidi_paragraph_info): Delete unused struct.
11203 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11204 (bidi_cache_start): New variable.
11205 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11206 to zero.
11207 (bidi_cache_fetch_state, bidi_cache_search)
11208 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11209 (bidi_cache_find, bidi_peek_at_next_level)
11210 (bidi_level_of_next_char, bidi_find_other_level_edge)
11211 (bidi_move_to_visually_next): Compare cache index with
11212 bidi_cache_start rather than with zero.
11213 (bidi_fetch_char): Accept new argument STRING; all callers
11214 changed. Support iteration over a string. Support strings with
11215 display properties. Support unibyte strings. Fix the type of
11216 `len' according to what STRING_CHAR_AND_LENGTH expects.
11217 (bidi_paragraph_init, bidi_resolve_explicit_1)
11218 (bidi_resolve_explicit, bidi_resolve_weak)
11219 (bidi_level_of_next_char, bidi_move_to_visually_next):
11220 Support iteration over a string.
11221 (bidi_set_sor_type, bidi_resolve_explicit_1)
11222 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11223 can now be zero (for strings); special values 0 and -1 were
11224 changed to -1 and -2, respectively.
11225 (bidi_char_at_pos): New function.
11226 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11227 Call it instead of FETCH_MULTIBYTE_CHAR.
11228 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11229 initialized to valid values.
11230 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11231 values.
11232 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11233 the test for valid cached positions. Fix the logic for looking up
11234 the sentinel state in the cache. GCPRO the Lisp string we are
11235 iterating.
11236 (bidi_push_it, bidi_pop_it): New functions.
11237 (bidi_initialize): Initialize the bidi cache start stack pointer.
11238 (bidi_cache_ensure_space): New function, refactored from part of
11239 bidi_cache_iterator_state. Don't assume the required size is just
11240 one BIDI_CACHE_CHUNK away.
11241 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11242 (bidi_count_bytes, bidi_char_at_pos): New functions.
11243 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11244 always valid if bidi_cache_idx is valid.
11245 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11246 is valid if it's going to be used.
11247 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11248 (bidi_cache_fetch_state, bidi_cache_search)
11249 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11250 (bidi_cache_iterator_state, bidi_cache_find)
11251 (bidi_find_other_level_edge, bidi_cache_start_stack):
11252 All variables related to cache indices are now EMACS_INT.
11253
11254 * dispextern.h (struct bidi_string_data): New structure.
11255 (struct bidi_it): New member `string'. Make flag members be 1-bit
11256 fields, and put them last in the struct.
11257 (compute_display_string_pos, compute_display_string_end):
11258 Update prototypes.
11259 (bidi_push_it, bidi_pop_it): Add prototypes.
11260 (struct iterator_stack_entry): New members bidi_p,
11261 paragraph_embedding, and from_disp_prop_p.
11262 (struct it): Member bidi_p is now a bit field 1 bit wide.
11263 (bidi_shelve_cache, bidi_unshelve_cache):
11264 Declare prototypes.
11265
11266 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11267 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11268 and vector-like objects.
11269
11270 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11271 cache around display iteration.
11272
11273 * window.c (Fwindow_end, window_scroll_pixel_based)
11274 (displayed_window_lines, Frecenter): Save and restore the bidi
11275 cache around display iteration.
11276
11277 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11278
11279 * editfns.c (Fdelete_region): Clarify the use of the named
11280 parameters (bug#6788).
11281
11282 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11283
11284 * indent.c (Fvertical_motion): Set and restore w->pointm when
11285 saving and restoring the window's buffer (Bug#9006).
11286
11287 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11288
11289 * editfns.c (Fstring_to_char): Clarify just what is returned
11290 (bug#6576). Text by Eli Zaretskii.
11291
11292 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11293
11294 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11295
11296 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11297
11298 * buffer.c (mmap_find): Fix a typo.
11299
11300 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11301
11302 Fix execution of x selection hooks.
11303 * xselect.c (Qx_lost_selection_functions)
11304 (Qx_sent_selection_functions): New vars.
11305 (syms_of_xselect): DEFSYM them.
11306 (x_handle_selection_request): Pass Qx_sent_selection_functions
11307 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11308 (x_handle_selection_clear,x_clear_frame_selections):
11309 Pass Qx_lost_selection_functions rather than
11310 Vx_lost_selection_functions to Frun_hook_with_args.
11311
11312 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11313
11314 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11315 The old code sometimes used this field without initializing it.
11316
11317 * alloc.c (gc_sweep): Don't read past end of array.
11318 In theory, the old code could also have corrupted Emacs internals,
11319 though it'd be very unlikely.
11320
11321 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11322
11323 * character.c (Fcharacterp): Don't advertise optional ignored
11324 argument. (Bug#4026)
11325
11326 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11327
11328 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11329 key" (bug#4257).
11330
11331 * window.c (Fset_window_start): Doc fix (bug#4199).
11332 (Fset_window_hscroll): Ditto.
11333
11334 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11335
11336 Fix minor new problems caught by GCC 4.6.1.
11337 * term.c (init_tty): Remove unused local.
11338 * xsettings.c (store_monospaced_changed): Define this function only
11339 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11340 not used otherwise.
11341
11342 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11343
11344 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11345
11346 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11347
11348 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11349 are the mini-buffer and the echo area (bug#3320).
11350
11351 * term.c (init_tty): Remove support for supdup, c10 and perq
11352 terminals, which are no longer supported (bug#1482).
11353
11354 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11355
11356 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11357
11358 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11359
11360 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11361 for non-popups (Bug#3642).
11362
11363 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11364
11365 * alloc.c (reset_malloc_hooks): Protoize.
11366 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11367 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11368 * cm.c (losecursor): Likewise.
11369 * data.c (fmod): Likewise.
11370 * dispnew.c (swap_glyphs_in_rows): Likewise.
11371 * emacs.c (memory_warning_signal): Likewise.
11372 * floatfns.c (float_error): Likewise.
11373 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11374 (otf_open, font_otf_capability, generate_otf_features)
11375 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11376 Likewise.
11377 * image.c (pbm_read_file): Likewise.
11378 * indent.c (string_display_width): Likewise.
11379 * intervals.c (check_for_interval, search_for_interval)
11380 (inc_interval_count, count_intervals, root_interval)
11381 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11382 * lread.c (defalias): Likewise.
11383 * ralloc.c (r_alloc_check): Likewise.
11384 * regex.c (set_image_of_range_1, set_image_of_range)
11385 (regex_grow_registers): Likewise.
11386 * sysdep.c (strerror): Likewise.
11387 * termcap.c (valid_filename_p, tprint, main): Likewise.
11388 * tparam.c (main): Likewise.
11389 * unexhp9k800.c (run_time_remap, save_data_space)
11390 (update_file_ptrs, read_header, write_header, calculate_checksum)
11391 (copy_file, copy_rest, display_header): Likewise.
11392 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11393 Likewise.
11394 * xdisp.c (check_it): Likewise.
11395 * xfaces.c (register_color, unregister_color, unregister_colors):
11396 Likewise.
11397 * xfns.c (print_fontset_result): Likewise.
11398 * xrdb.c (member, fatal, main): Likewise.
11399
11400 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11401
11402 Fix minor problems found by static checking (Bug#9031).
11403 * chartab.c (char_table_set_range, map_sub_char_table):
11404 Remove unused locals.
11405 (uniprop_table): Now static.
11406 * composite.c (_work_char): Remove unused static var.
11407
11408 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11409
11410 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11411
11412 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11413
11414 * gtkutil.c (qttip_cb): Remove code without function.
11415
11416 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11417
11418 * w32.c (pthread_sigmask): New stub.
11419
11420 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11421
11422 Use pthread_sigmask, not sigprocmask (Bug#9010).
11423 sigprocmask is portable only for single-threaded applications, and
11424 Emacs can be multi-threaded when it uses GTK.
11425 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11426 (LIBES): Use it.
11427 * callproc.c (Fcall_process):
11428 * process.c (create_process):
11429 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11430 Use pthread_sigmask, not sigprocmask.
11431
11432 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11433
11434 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11435 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11436 wrong (Bug#8591).
11437
11438 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11439
11440 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11441 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11442 (xg_hide_tooltip): Fix comment.
11443
11444 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11445 in registerServicesMenuSendTypes.
11446 (validRequestorForSendType): Don't check ns_return_types.
11447
11448 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11449 ns_return_type.
11450
11451 2011-07-08 Jason Rumney <jasonr@gnu.org>
11452
11453 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11454 SH_SHOW for hidden windows (Bug#5482).
11455
11456 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11457 frame struct members of non-existent frames (Bug#6284).
11458
11459 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11460
11461 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11462 variable firstTime not needed on OSX >= 10.6.
11463 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11464 >= 10.5. Use setKnobProportion, setDoubleValue.
11465
11466 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11467 (MAC_OS_X_VERSION_10_5): Define if not defined.
11468 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11469 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11470 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11471
11472 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11473 cString and lossyCString on OSX >= 10.4.
11474
11475 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11476 sizeToFit on OSX >= 10.2.
11477
11478 * nsimage.m (allocInitFromFile): Don't use deprecated method
11479 bestRepresentationForDevice on OSX >= 10.6.
11480
11481 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11482 to avoid warning.
11483
11484 * emacs.c: Declare unexec_init_emacs_zone.
11485
11486 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11487
11488 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11489
11490 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11491 on svcsMenu (Bug#8842).
11492
11493 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11494 ns_return_types.
11495 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11496
11497 * nsterm.m (QUTF8_STRING): Declare.
11498 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11499 (validRequestorForSendType): Return type is (id).
11500 Change indexOfObjectIdenticalTo to indexOfObject.
11501 Check if we have local selection before returning self (Bug#8842).
11502 (writeSelectionToPasteboard): Put local selection into paste board
11503 if we have a local selection (Bug#8842).
11504 (syms_of_nsterm): DEFSYM QUTF8_STRING.
11505
11506 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11507 (ns_get_local_selection): Declare.
11508
11509 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11510
11511 * keymap.c (describe_map_tree): Don't insert a double newline at
11512 the end of the buffer (bug#1169) and return whether we inserted
11513 something.
11514
11515 * callint.c (Fcall_interactively): Change "reading args" to
11516 "providing args" to try to clarify what it does (bug#1010).
11517
11518 2011-07-07 Kenichi Handa <handa@m17n.org>
11519
11520 * composite.c (composition_compute_stop_pos): Ignore a static
11521 composition starting before CHARPOS (Bug#8915).
11522
11523 * xdisp.c (handle_composition_prop): Likewise.
11524
11525 2011-07-07 Eli Zaretskii <eliz@gnu.org>
11526
11527 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11528 (Bug#9015)
11529
11530 2011-07-07 Kenichi Handa <handa@m17n.org>
11531
11532 * character.h (unicode_category_t): New enum type.
11533
11534 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11535 (Qchar_code_property_table): New variable.
11536 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11537 (UNIPROP_COMPRESSED_FORM_P): New macros.
11538 (char_table_ascii): Uncompress the compressed values.
11539 (sub_char_table_ref): New arg is_uniprop. Callers changed.
11540 Uncompress the compressed values.
11541 (sub_char_table_ref_and_range): Likewise.
11542 (char_table_ref_and_range): Uncompress the compressed values.
11543 (sub_char_table_set): New arg is_uniprop. Callers changed.
11544 Uncompress the compressed values.
11545 (sub_char_table_set_range): Args changed. Callers changed.
11546 (char_table_set_range): Adjuted for the above change.
11547 (map_sub_char_table): Delete args default_val and parent. Add arg
11548 top. Give decoded values to a Lisp function.
11549 (map_char_table): Adjust for the above change. Give decoded
11550 values to a Lisp function. Gcpro more variables.
11551 (uniprop_table_uncompress)
11552 (uniprop_decode_value_run_length): New functions.
11553 (uniprop_decoder, uniprop_decoder_count): New variables.
11554 (uniprop_get_decoder, uniprop_encode_value_character)
11555 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11556 New functions.
11557 (uniprop_encoder, uniprop_encoder_count): New variables.
11558 (uniprop_get_encoder, uniprop_table)
11559 (Funicode_property_table_internal, Fget_unicode_property_internal)
11560 (Fput_unicode_property_internal): New functions.
11561 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11562 Sunicode_property_table_internal, Sget_unicode_property_internal,
11563 and Sput_unicode_property_internal. Defvar_lisp
11564 char-code-property-alist.
11565
11566 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
11567 Vunicode_category_table.
11568
11569 * font.c (font_range): Adjust for the change of
11570 Vunicode_category_table.
11571
11572 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11573
11574 * m/iris4d.h: Remove file, move contents ...
11575 * s/irix6-5.h: ... here.
11576
11577 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11578
11579 Remove unportable assumption about struct layout (Bug#8884).
11580 * alloc.c (mark_buffer):
11581 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11582 (clone_per_buffer_values): Don't assume that
11583 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11584 This isn't true in general, and it's particularly not true
11585 if Emacs is configured with --with-wide-int.
11586 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11587 New macros, used in the buffer.c change.
11588
11589 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11590
11591 * xsettings.c: Use both GConf and GSettings if both are available.
11592 (store_config_changed_event): Add comment.
11593 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11594 (store_tool_bar_style_changed): New functions.
11595 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
11596 (struct xsettings): Move font inside HAVE_XFT.
11597 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
11598 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
11599 Move inside HAVE_XFT.
11600 (something_changed_gsettingsCB): Rename from something_changedCB.
11601 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11602 also.
11603 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
11604 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
11605 (something_changed_gconfCB): Rename from something_changedCB.
11606 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11607 (parse_settings): Move check for font inside HAVE_XFT.
11608 (read_settings, apply_xft_settings): Add comment.
11609 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
11610 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
11611 call store_font_name_changed.
11612 (xft_settings_event): Add comment.
11613 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
11614 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
11615 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
11616 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
11617 (xsettings_initialize): Call init_gsettings last.
11618 (xsettings_get_system_font, xsettings_get_system_normal_font):
11619 Add comment.
11620
11621 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
11622
11623 Random fixes. E.g., (random) never returned negative values.
11624 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
11625 subseconds part to the entropy, as that's a bit more random.
11626 Prefer signed to unsigned, since the signedness doesn't matter and
11627 in general we prefer signed. When given a limit, use a
11628 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11629 latter isn't right if USE_2_TAGS_FOR_INTS.
11630 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11631 not 0..VALMASK. Don't discard "excess" bits that random () returns.
11632
11633 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11634
11635 * textprop.c (text_property_stickiness):
11636 Obey Vtext_property_default_nonsticky.
11637 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11638 * w32fns.c (syms_of_w32fns):
11639 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11640
11641 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11642
11643 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11644 This is more efficient than Ffile_directory_p and avoids a minor race.
11645
11646 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11647
11648 * buffer.c (Foverlay_put): Say what the return value is
11649 (bug#7835).
11650
11651 * fileio.c (barf_or_query_if_file_exists): Check first if the file
11652 is a directory before asking whether to use the file name
11653 (bug#7564).
11654 (barf_or_query_if_file_exists): Make the "File is a directory"
11655 error be more correct.
11656
11657 * fns.c (Frequire): Remove the mention of the .gz files, since
11658 that's installation-specific, but keep the mention of
11659 `get-load-suffixes'.
11660
11661 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11662
11663 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11664 Report string overflow if the output is too long.
11665
11666 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
11667
11668 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11669 (syms_of_gnutls): Remove duplicate DEFSYM for
11670 Qgnutls_bootprop_verify_hostname_error, an error for
11671 Qgnutls_bootprop_verify_error (which is no longer used).
11672
11673 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11674 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
11675 Also (re)move comments that are misplaced or no longer relevant.
11676
11677 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11678
11679 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11680
11681 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
11682
11683 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11684 and background color parameters if they have been changed.
11685
11686 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11687
11688 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11689
11690 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11691
11692 * xsettings.c (SYSTEM_FONT): Define only when used.
11693 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11694
11695 * keymap.c (access_keymap_1): Now static.
11696
11697 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
11698
11699 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11700 leave any prefix arg for the up event (Bug#1586).
11701
11702 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11703
11704 * lread.c (syms_of_lread): Mention single symbols defined by
11705 `defvar' or `defconst' (bug#7154).
11706
11707 * fns.c (Frequire): Mention .el.gz files (bug#7314).
11708 (Frequire): Mention get-load-suffixes.
11709
11710 2011-07-02 Martin Rudalics <rudalics@gmx.at>
11711
11712 * window.h (window): Remove clone_number slot.
11713 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11714 Remove.
11715 (make_parent_window, make_window, saved_window)
11716 (Fset_window_configuration, save_window_save): Don't deal with
11717 clone numbers.
11718 * buffer.c (Qclone_number): Remove declaration.
11719 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11720
11721 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11722
11723 Add multiple inheritance to keymaps.
11724 * keymap.c (Fmake_composed_keymap): New function.
11725 (Fset_keymap_parent): Simplify.
11726 (fix_submap_inheritance): Remove.
11727 (access_keymap_1): New function extracted from access_keymap to handle
11728 embedded parents and handle lists of maps.
11729 (access_keymap): Use it.
11730 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11731 (Fcopy_keymap): Handle embedded parents.
11732 (Fcommand_remapping, define_as_prefix): Simplify.
11733 (Fkey_binding): Simplify.
11734 (syms_of_keymap): Move minibuffer-local-completion-map,
11735 minibuffer-local-filename-completion-map,
11736 minibuffer-local-must-match-map, and
11737 minibuffer-local-filename-must-match-map to Elisp.
11738 (syms_of_keymap): Defsubr make-composed-keymap.
11739 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11740 (parse_menu_item): Trivial simplification.
11741
11742 2011-07-01 Glenn Morris <rgm@gnu.org>
11743
11744 * Makefile.in (SETTINGS_LIBS): Fix typo.
11745
11746 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11747
11748 * coding.c (Fencode_coding_string): Record the last coding system
11749 used, as the function doc string says (bug#8738).
11750
11751 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11752
11753 * xsettings.c (store_monospaced_changed): Take new font as arg and
11754 check for change against current_mono_font.
11755 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11756 (emacs_settings_constructor, emacs_settings_get_property)
11757 (emacs_settings_set_property, emacs_settings_class_init)
11758 (emacs_settings_init, gsettings_obj): Remove.
11759 (something_changedCB): New function for HAVE_GSETTINGS.
11760 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11761 with value as argument.
11762 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11763 g_settings_new (Bug#8967). Do not create gsettings_obj.
11764 Remove calls to g_settings_bind. Connect something_changedCB to
11765 "changed".
11766
11767 * xgselect.c: Add defined (HAVE_GSETTINGS).
11768 (xgselect_initialize): Ditto.
11769
11770 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11771 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11772 xg_select.
11773
11774 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11775
11776 * eval.c (struct backtrace): Simplify and port the data structure.
11777 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11778 signed bit field, as this assumption is not portable and it makes
11779 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11780 "char debug_on_exit : 1" as this is not portable either; instead,
11781 use the portable "unsigned int debug_on_exit : 1". Remove unused
11782 member evalargs. Remove obsolete comments about cc bombing out.
11783
11784 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11785
11786 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
11787 Let HAVE_GSETTINGS override HAVE_GCONF.
11788 (store_monospaced_changed): New function.
11789 (EMACS_SETTINGS): A new type derived from GObject to handle
11790 GSettings notifications.
11791 (emacs_settings_constructor, emacs_settings_get_property)
11792 (emacs_settings_set_property, emacs_settings_class_init):
11793 New functions.
11794 (gsettings_client, gsettings_obj): New variables.
11795 (GSETTINGS_SCHEMA): New define.
11796 (something_changedCB): Call store_monospaced_changed.
11797 (init_gsettings): New function.
11798 (xsettings_initialize): Call init_gsettings.
11799 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11800 to NULL.
11801
11802 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
11803 GCONF_CFLAGS/LIBS.
11804
11805 2011-06-29 Martin Rudalics <rudalics@gmx.at>
11806
11807 * window.c (resize_root_window, grow_mini_window)
11808 (shrink_mini_window): Rename Qresize_root_window to
11809 Qwindow_resize_root_window and Qresize_root_window_vertically to
11810 Qwindow_resize_root_window_vertically.
11811
11812 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11813
11814 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11815
11816 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
11817
11818 * makefile.w32-in: Redesign dependencies so they reflect more
11819 clearly which files are directly included by each source file,
11820 and not through other includes.
11821
11822 2011-06-27 Martin Rudalics <rudalics@gmx.at>
11823
11824 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11825 (sort_overlays, overlay_strings): When an overlay's clone number
11826 matches the window's clone number process the overlay even if
11827 the overlay's window property doesn't match the current window.
11828
11829 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11830 (Fwindow_hchild): Rename to Fwindow_left_child.
11831 (Fwindow_next): Rename to Fwindow_next_sibling.
11832 (Fwindow_prev): Rename to Fwindow_prev_sibling.
11833 (resize_window_check): Rename to window_resize_check.
11834 (resize_window_apply): Rename to window_resize_apply.
11835 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11836 (Fdelete_other_windows_internal, resize_frame_windows)
11837 (Fsplit_window_internal, Fdelete_window_internal)
11838 (grow_mini_window, shrink_mini_window)
11839 (Fresize_mini_window_internal): Fix callers accordingly.
11840
11841 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11842
11843 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11844 (emacs_fixed_set_min_size): Remove.
11845 (emacs_fixed_new): Take frame as argument.
11846
11847 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11848 (_EmacsFixedPrivate): Remove minwidth/height.
11849 Add struct frame *f.
11850 (emacs_fixed_init): Initialize priv->f.
11851 (get_parent_class, emacs_fixed_set_min_size): Remove.
11852 (emacs_fixed_new): Set priv->f to argument.
11853 (emacs_fixed_get_preferred_width)
11854 (emacs_fixed_get_preferred_height): Use min_width/height from
11855 frames size_hint to set minimum and natural (Bug#8919).
11856 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11857 and use min_width/height from frames size_hint to set
11858 min_width/height (Bug#8919).
11859
11860 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
11861 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11862 Fix indentation.
11863
11864 2011-06-26 Eli Zaretskii <eliz@gnu.org>
11865
11866 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11867 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11868 called at ZV.
11869
11870 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
11871
11872 * process.c (wait_reading_process_output): Bypass select if
11873 waiting for a cell while ignoring keyboard input, and input is
11874 pending. Suggested by Jan Djärv (Bug#8869).
11875
11876 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11877
11878 Use gnulib's dup2 module instead of rolling our own.
11879 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11880
11881 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11882
11883 * dispnew.c (scrolling_window): Before scrolling, turn off a
11884 mouse-highlight in the window being scrolled.
11885
11886 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
11887
11888 Move DEFSYM to lisp.h and use everywhere.
11889
11890 * character.h (DEFSYM): Move declaration...
11891 * lisp.h (DEFSYM): ...here.
11892
11893 * gnutls.c:
11894 * minibuf.c:
11895 * w32menu.c:
11896 * w32proc.c:
11897 * w32select.c: Don't include character.h.
11898
11899 * alloc.c (syms_of_alloc):
11900 * buffer.c (syms_of_buffer):
11901 * bytecode.c (syms_of_bytecode):
11902 * callint.c (syms_of_callint):
11903 * casefiddle.c (syms_of_casefiddle):
11904 * casetab.c (init_casetab_once):
11905 * category.c (init_category_once, syms_of_category):
11906 * ccl.c (syms_of_ccl):
11907 * cmds.c (syms_of_cmds):
11908 * composite.c (syms_of_composite):
11909 * dbusbind.c (syms_of_dbusbind):
11910 * dired.c (syms_of_dired):
11911 * dispnew.c (syms_of_display):
11912 * doc.c (syms_of_doc):
11913 * editfns.c (syms_of_editfns):
11914 * emacs.c (syms_of_emacs):
11915 * eval.c (syms_of_eval):
11916 * fileio.c (syms_of_fileio):
11917 * fns.c (syms_of_fns):
11918 * frame.c (syms_of_frame):
11919 * fringe.c (syms_of_fringe):
11920 * insdel.c (syms_of_insdel):
11921 * keymap.c (syms_of_keymap):
11922 * lread.c (init_obarray, syms_of_lread):
11923 * macros.c (syms_of_macros):
11924 * msdos.c (syms_of_msdos):
11925 * print.c (syms_of_print):
11926 * process.c (syms_of_process):
11927 * search.c (syms_of_search):
11928 * sound.c (syms_of_sound):
11929 * syntax.c (init_syntax_once, syms_of_syntax):
11930 * terminal.c (syms_of_terminal):
11931 * textprop.c (syms_of_textprop):
11932 * undo.c (syms_of_undo):
11933 * w32.c (globals_of_w32):
11934 * window.c (syms_of_window):
11935 * xdisp.c (syms_of_xdisp):
11936 * xfaces.c (syms_of_xfaces):
11937 * xfns.c (syms_of_xfns):
11938 * xmenu.c (syms_of_xmenu):
11939 * xsettings.c (syms_of_xsettings):
11940 * xterm.c (syms_of_xterm): Use DEFSYM.
11941
11942 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11943
11944 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
11945
11946 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11947
11948 Integer and buffer overflow fixes (Bug#8873).
11949
11950 * print.c (printchar, strout): Check for string overflow.
11951 (PRINTPREPARE, printchar, strout):
11952 Don't set size unless allocation succeeds.
11953
11954 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11955 for sizes. Check for string overflow more accurately.
11956 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11957
11958 * macros.c: Integer and buffer overflow fixes.
11959 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11960 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11961 Use ptrdiff_t, not int, for sizes.
11962 Don't increment bufsize until after realloc succeeds.
11963 Check for size-calculation overflow.
11964 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11965
11966 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11967
11968 * lread.c: Integer overflow fixes.
11969 (read_integer): Radix is now EMACS_INT, not int,
11970 to improve quality of diagnostics for out-of-range radices.
11971 Calculate buffer size correctly for out-of-range radices.
11972 (read1): Check for integer overflow in radices, and in
11973 read-circle numbers.
11974 (read_escape): Avoid int overflow.
11975 (Fload, openp, read_buffer_size, read1)
11976 (substitute_object_recurse, read_vector, read_list, map_obarray):
11977 Use ptrdiff_t, not int, for sizes.
11978 (read1): Use EMACS_INT, not int, for sizes.
11979 Check for size overflow.
11980
11981 * image.c (cache_image): Check for size arithmetic overflow.
11982
11983 * lread.c: Integer overflow issues.
11984 (saved_doc_string_size, saved_doc_string_length)
11985 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11986 Now ptrdiff_t, not int.
11987 (read1): Don't assume doc string length fits in int. Check for
11988 out-of-range doc string lengths.
11989 (read_list): Don't assume file position fits in int.
11990 (read_escape): Check for hex character overflow.
11991
11992 2011-06-22 Leo Liu <sdl.web@gmail.com>
11993
11994 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11995 Move to minibuffer.el.
11996
11997 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11998
11999 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12000 The following patches are for when GLYPH_DEBUG && !XASSERT.
12001 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12002 * dispnew.c (flush_stdout):
12003 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12004 Mark as externally visible.
12005 * dispnew.c (check_window_matrix_pointers): Now static.
12006 * dispnew.c (window_to_frame_vpos):
12007 * xfns.c (unwind_create_frame):
12008 * xterm.c (x_check_font): Remove unused local.
12009 * scroll.c (CHECK_BOUNDS):
12010 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12011 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12012 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12013 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12014 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12015 Now static.
12016 (debug_method_add): Use va_list and vsprintf rather than relying
12017 on undefined behavior with wrong number of arguments.
12018 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12019 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12020 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12021 since we're not interested in debugging glyphs with old libraries.
12022 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12023 GCC 4.6.0's static checking.
12024
12025 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12026
12027 Integer overflow and signedness fixes (Bug#8873).
12028 A few related buffer overrun fixes, too.
12029
12030 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12031
12032 * dispextern.h (struct face.stipple):
12033 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12034 (x_bitmap_mask, x_allocate_bitmap_record)
12035 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12036 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12037 (x_create_bitmap_from_xpm_data):
12038 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12039 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12040 (.bitmaps_last):
12041 * xfaces.c (load_pixmap):
12042 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12043 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12044 (.bitmaps_last, struct x_output.icon_bitmap):
12045 Use ptrdiff_t, not int, for bitmap indexes.
12046 (x_allocate_bitmap_record): Check for size overflow.
12047 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12048
12049 Use ptrdiff_t, not int, for overlay counts.
12050 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12051 * editfns.c (overlays_around, get_pos_property):
12052 * textprop.c (get_char_property_and_overlay):
12053 * xdisp.c (next_overlay_change, note_mouse_highlight):
12054 * xfaces.c (face_at_buffer_position):
12055 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12056 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12057 (Fnext_overlay_change, Fprevious_overlay_change)
12058 (mouse_face_overlay_overlaps, Foverlays_in):
12059 Use ptrdiff_t, not int, for sizes.
12060 (overlays_at, overlays_in): Check for size-calculation overflow.
12061
12062 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12063
12064 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12065 (x_session_initialize): Do not assume string length fits in int.
12066
12067 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12068 This is unlikely, but can occur if DPI is outlandish.
12069
12070 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12071 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12072
12073 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12074 * xrdb.c (magic_file_p, search_magic_path):
12075 Omit last arg SUFFIX; it was always 0. All callers changed.
12076 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12077
12078 * xfont.c (xfont_match): Avoid need for strlen.
12079
12080 * xfns.c: Don't assume strlen fits in int.
12081 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12082
12083 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12084 not unsigned long, as we prefer signed integers. All callers changed.
12085 Detect integer overflow in repeat count.
12086 (message_dolog): Don't assume print length fits in 39 bytes.
12087 (display_mode_element): Don't assume strlen fits in int.
12088
12089 * termcap.c: Don't assume sizes fit in int and never overflow.
12090 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12091 (gobble_line): Check for size-calculation overflow.
12092
12093 * minibuf.c (Fread_buffer):
12094 * lread.c (intern, intern_c_string):
12095 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12096 Don't assume string length fits in int.
12097
12098 * keyboard.c (parse_tool_bar_item):
12099 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12100
12101 * font.c: Don't assume string length fits in int.
12102 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12103 Use ptrdiff_t, not int.
12104 (font_intern_prop): Don't assume string length fits in int.
12105 Don't assume integer property fits in fixnum.
12106 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12107
12108 * filelock.c: Fix some buffer overrun and integer overflow issues.
12109 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12110 Reformulate so as not to need the command string.
12111 Invoke gzip -cd rather than gunzip, as it's more portable.
12112 (lock_info_type, lock_file_1, lock_file):
12113 Don't assume pid_t and time_t fit in unsigned long.
12114 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12115 (current_lock_owner): Prefer signed type for sizes.
12116 Use memcpy, not strncpy, where memcpy is what is really wanted.
12117 Don't assume (via atoi) that time_t and pid_t fit in int.
12118 Check for time_t and/or pid_t out of range, e.g., via a network share.
12119 Don't alloca where an auto var works fine.
12120
12121 * fileio.c: Fix some integer overflow issues.
12122 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12123 Don't assume string length fits in int.
12124 (directory_file_name): Don't assume string length fits in long.
12125 (make_temp_name): Don't assume pid fits in int, or that its print
12126 length is less than 20.
12127
12128 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12129
12130 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12131
12132 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12133
12134 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12135 We prefer signed integers, even for size calculations.
12136
12137 * emacs.c: Don't assume string length fits in 'int'.
12138 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12139 (main): Don't invoke strlen when not needed.
12140
12141 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12142 (XD_DEBUG_MESSAGE): Don't waste a byte.
12143
12144 * callproc.c (getenv_internal_1, getenv_internal)
12145 (Fgetenv_internal):
12146 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12147
12148 * lread.c (invalid_syntax): Omit length argument.
12149 All uses changed. This doesn't fix a bug, but it simplifies the
12150 code away from its former Hollerith-constant appearance, and it's
12151 one less 'int' to worry about when looking at integer-overflow issues.
12152 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12153
12154 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12155 This didn't break anything, but it didn't help either.
12156 It's confusing to put a bogus integer in a place where the actual
12157 value does not matter.
12158 (LIST_END_P): Remove unused macro and its bogus comment.
12159 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12160
12161 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12162 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12163 implementation.
12164 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12165 We prefer signed types, and the value cannot exceed the EMACS_INT
12166 range anyway (because otherwise the length would not be representable).
12167 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12168 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12169 This avoids a GCC warning when WIDE_EMACS_INT.
12170
12171 * indent.c (sane_tab_width): New function.
12172 (current_column, scan_for_column, Findent_to, position_indentation)
12173 (compute_motion): Use it. This is just for clarity.
12174 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12175
12176 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12177
12178 * lisp.h (lint_assume): New macro.
12179 * composite.c (composition_gstring_put_cache):
12180 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12181
12182 * editfns.c, insdel.c:
12183 Omit unnecessary forward decls, to simplify future changes.
12184
12185 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12186
12187 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12188
12189 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12190 Use much-faster test for byte-length change.
12191 Don't assume string byte-length fits in 'int'.
12192 Check that character arg fits in 'int'.
12193 (mapcar1): Declare byte as byte, for clarity.
12194
12195 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12196
12197 * fns.c (concat): Catch string overflow earlier.
12198 Do not rely on integer wraparound.
12199
12200 * dispextern.h (struct it.overlay_strings_charpos)
12201 (struct it.selective): Now EMACS_INT, not int.
12202 * xdisp.c (forward_to_next_line_start)
12203 (back_to_previous_visible_line_start)
12204 (reseat_at_next_visible_line_start, next_element_from_buffer):
12205 Don't arbitrarily truncate the value of 'selective' to int.
12206
12207 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12208
12209 * composite.c: Don't truncate sizes to 'int'.
12210 (composition_gstring_p, composition_reseat_it)
12211 (composition_adjust_point): Use EMACS_INT, not int.
12212 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12213 not EMACS_UINT, for indexes.
12214
12215 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12216
12217 * buffer.c: Include <verify.h>.
12218 (struct sortvec.priority, struct sortstr.priority):
12219 Now EMACS_INT, not int.
12220 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12221 (struct sortstr.size, record_overlay_string)
12222 (struct sortstrlist.size, struct sortlist.used):
12223 Don't truncate size to int.
12224 (record_overlay_string): Check for size-calculation overflow.
12225 (init_buffer_once): Check at compile-time, not run-time.
12226
12227 2011-06-22 Jim Meyering <meyering@redhat.com>
12228
12229 Don't leak an XBM-image-sized buffer
12230 * image.c (xbm_load): Free the image buffer after using it.
12231
12232 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12233
12234 Port to Sun C.
12235 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12236 that Sun C diagnosed.
12237 * fns.c (secure_hash): Fix pointer signedness issue.
12238 * intervals.c (static_offset_intervals): New function.
12239 (offset_intervals): Use it.
12240
12241 2011-06-21 Leo Liu <sdl.web@gmail.com>
12242
12243 * deps.mk (fns.o):
12244 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12245 sha512.h.
12246
12247 * fns.c (secure_hash): Rename from crypto_hash_function and change
12248 the first arg to accept symbols.
12249 (Fsecure_hash): New primitive.
12250 (syms_of_fns): New symbols.
12251
12252 2011-06-20 Deniz Dogan <deniz@dogan.se>
12253
12254 * process.c (Fset_process_buffer): Clarify return value in
12255 docstring.
12256
12257 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12258
12259 * dispnew.c (add_window_display_history): Use BVAR.
12260
12261 * xdisp.c (debug_method_add): Use BVAR.
12262 (check_window_end, dump_glyph_matrix, dump_glyph)
12263 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12264
12265 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12266 Likewise.
12267
12268 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12269 check till after the cache is created in init_frame_faces.
12270
12271 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12272
12273 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12274
12275 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12276
12277 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12278 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12279 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12280
12281 Improve buffer-overflow checking (Bug#8873).
12282 * fileio.c (Finsert_file_contents):
12283 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12284 Remove the old (too-loose) buffer overflow checks.
12285 They weren't needed, since make_gap checks for buffer overflow.
12286 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12287 The old code merely checked for Emacs fixnum overflow, and relied
12288 on undefined (wraparound) behavior. The new code avoids undefined
12289 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12290
12291 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12292 Tune. Don't use wider integers than needed. Don't use alloca.
12293 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12294
12295 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12296
12297 * insdel.c, lisp.h (buffer_overflow): New function.
12298 (insert_from_buffer_1, replace_range, replace_range_2):
12299 * insdel.c (make_gap_larger):
12300 * editfns.c (Finsert_char):
12301 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12302
12303 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12304
12305 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12306
12307 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12308
12309 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12310 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12311
12312 * fileio.c: Don't assume EMACS_INT fits in off_t.
12313 (emacs_lseek): New static function.
12314 (Finsert_file_contents, Fwrite_region): Use it.
12315 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12316
12317 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12318
12319 * fns.c: Don't overflow int when computing a list length.
12320 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12321 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12322 truncation on 64-bit hosts. Check for QUIT every
12323 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12324 faster and is responsive enough.
12325 (Flength): Report an error instead of overflowing an integer.
12326 (Fsafe_length): Return a float if the value is not representable
12327 as a fixnum. This shouldn't happen except in contrived situations.
12328 (Fnthcdr, Fsort): Don't assume list length fits in int.
12329 (Fcopy_sequence): Don't assume vector length fits in int.
12330
12331 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12332 (header_size, word_size): New constants.
12333 (allocate_vectorlike): Don't check size overflow here.
12334 (allocate_vector): Check it here instead, since this is the only
12335 caller of allocate_vectorlike that could cause overflow.
12336 Check that the new vector's length is representable as a fixnum.
12337
12338 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12339 The previous code was bogus. For example, next_almost_prime (32)
12340 returned 39, which is undesirable as it is a multiple of 3; and
12341 next_almost_prime (24) returned 25, which is a multiple of 5 so
12342 why was the code bothering to check for multiples of 7?
12343
12344 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12345
12346 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12347
12348 Variadic C functions now count arguments with ptrdiff_t.
12349 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12350 Back then I didn't know that the Emacs coding style prefers signed int.
12351 Also, in the meantime I found a few more instances where arguments
12352 were being counted with int, which may truncate counts on 64-bit
12353 machines, or EMACS_INT, which may be unnecessarily wide.
12354 * lisp.h (struct Lisp_Subr.function.aMANY)
12355 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12356 Arg counts are now ptrdiff_t, not size_t.
12357 All variadic functions and their callers changed accordingly.
12358 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12359 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12360 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12361 * callint.c (Fcall_interactively): Check arg count for overflow,
12362 to avoid potential buffer overrun. Use signed char, not 'int',
12363 for 'varies' array, so that we needn't bother to check its size
12364 calculation for overflow.
12365 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12366 * eval.c (apply_lambda):
12367 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12368 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12369 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12370
12371 * callint.c (Fcall_interactively): Don't use index var as event count.
12372
12373 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12374 * mem-limits.h (SIZE): Remove; no longer used.
12375
12376 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12377
12378 Remove unnecessary casts.
12379 * xterm.c (x_term_init):
12380 * xfns.c (x_set_border_pixel):
12381 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12382 These aren't needed now that we assume ANSI C.
12383
12384 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12385 It's more likely to cause problems (due to unsigned overflow)
12386 than to cure them.
12387
12388 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12389
12390 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12391
12392 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12393
12394 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12395
12396 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12397
12398 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12399
12400 GLYPH_CODE_FACE returns EMACS_INT, not int.
12401 * dispextern.h (merge_faces):
12402 * xfaces.c (merge_faces):
12403 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12404 Don't assume EMACS_INT fits in int.
12405
12406 * character.h (CHAR_VALID_P): Remove unused parameter.
12407 * fontset.c, lisp.h, xdisp.c: All uses changed.
12408
12409 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12410
12411 * fns.c (concat): Minor tuning based on overflow analysis.
12412 This doesn't fix any bugs. Use int to hold character, instead
12413 of constantly refetching from Emacs object. Use XFASTINT, not
12414 XINT, for value known to be a character. Don't bother comparing
12415 a single byte to 0400, as it's always less.
12416
12417 * floatfns.c (Fexpt):
12418 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12419
12420 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12421 for characters.
12422
12423 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12424
12425 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12426 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12427 incorrectly succeed when S was a string, because 4294967386 was
12428 truncated before it was used.
12429
12430 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12431 Otherwise, an out-of-range integer could cause undefined behavior
12432 on a 64-bit host.
12433
12434 * composite.c: Use int, not EMACS_INT, for characters.
12435 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12436 EMACS_INT, for values that are known to be in character range.
12437 This doesn't fix any bugs but is the usual style inside Emacs and
12438 may generate better code on 32-bit machines.
12439
12440 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12441 This is for reasons similar to the recent CHAR_STRING fix.
12442 * charset.c (Fencode_char): Check that character arg is actually
12443 a character. Pass an int to ENCODE_CHAR.
12444 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12445 wider than 'int', as a compile-time check to prevent future regressions
12446 in this area.
12447
12448 * character.c (char_string): Remove unnecessary casts.
12449
12450 Make sure a 64-bit char is never passed to CHAR_STRING.
12451 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12452 by silently ignoring the top 32 bits, allowing some values
12453 that were far too large to be valid characters.
12454 * character.h: Include <verify.h>.
12455 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12456 arguments are no wider than unsigned, as a compile-time check
12457 to prevent future regressions in this area.
12458 * data.c (Faset):
12459 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12460 (Fsubst_char_in_region):
12461 * fns.c (concat):
12462 * xdisp.c (decode_mode_spec_coding):
12463 Adjust to CHAR_STRING's new requirement.
12464 * editfns.c (Finsert_char, Fsubst_char_in_region):
12465 * fns.c (concat): Check that character args are actually
12466 characters. Without this test, these functions did the wrong
12467 thing with wildly out-of-range values on 64-bit hosts.
12468
12469 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12470 These casts should not be needed on 32-bit hosts, either.
12471 * keyboard.c (read_char):
12472 * lread.c (Fload): Remove casts to unsigned.
12473
12474 * lisp.h (UNSIGNED_CMP): New macro.
12475 This fixes comparison bugs on 64-bit hosts.
12476 (ASCII_CHAR_P): Use it.
12477 * casefiddle.c (casify_object):
12478 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
12479 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12480 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12481 * dispextern.h (FACE_FROM_ID):
12482 * keyboard.c (read_char): Use UNSIGNED_CMP.
12483
12484 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12485 not to EMACS_INT, to avoid GCC warning.
12486
12487 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12488
12489 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12490 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12491 isn't needed on 32-bit machines.
12492
12493 * buffer.c (Fgenerate_new_buffer_name):
12494 Use EMACS_INT for count, not int.
12495 (advance_to_char_boundary): Return EMACS_INT, not int.
12496
12497 * data.c (Qcompiled_function): Now static.
12498
12499 * window.c (window_body_lines): Now static.
12500
12501 * image.c (gif_load): Rename local to avoid shadowing.
12502
12503 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12504 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12505 * alloc.c (make_save_value): Integer argument is now of type
12506 ptrdiff_t, not int.
12507 (mark_object): Use ptrdiff_t, not int.
12508 * lisp.h (pD): New macro.
12509 * print.c (print_object): Use it.
12510
12511 * alloc.c: Use EMACS_INT, not int, to count objects.
12512 (total_conses, total_markers, total_symbols, total_vector_size)
12513 (total_free_conses, total_free_markers, total_free_symbols)
12514 (total_free_floats, total_floats, total_free_intervals)
12515 (total_intervals, total_strings, total_free_strings):
12516 Now EMACS_INT, not int. All uses changed.
12517 (Fgarbage_collect): Compute overall total using a double, so that
12518 integer overflow is less likely to be a problem. Check for overflow
12519 when converting back to an integer.
12520 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12521 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12522 These were 'int' variables that could overflow on 64-bit hosts;
12523 they were never used, so remove them instead of repairing them.
12524 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
12525 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12526 Previously, this ceilinged at INT_MAX, but that doesn't work on
12527 64-bit machines.
12528 (allocate_pseudovector): Don't use EMACS_INT when int would do.
12529
12530 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
12531 (allocate_vectorlike): Check for ptrdiff_t overflow.
12532 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12533 when a (possibly-narrower) signed value would do just as well.
12534 We prefer using signed arithmetic, to avoid comparison confusion.
12535
12536 * alloc.c: Catch some string size overflows that we were missing.
12537 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12538 for convenience in STRING_BYTES_MAX.
12539 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12540 The definition here is exact; the one in lisp.h was approximate.
12541 (allocate_string_data): Check for string overflow. This catches
12542 some instances we weren't catching before. Also, it catches
12543 size_t overflow on (unusual) hosts where SIZE_MAX <= min
12544 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12545 and ptrdiff_t and EMACS_INT are both 64 bits.
12546
12547 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12548 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
12549 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
12550
12551 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12552
12553 * alloc.c (Fmake_string): Check for out-of-range init.
12554
12555 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12556
12557 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12558
12559 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12560
12561 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12562 xg_get_default_scrollbar_width.
12563
12564 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12565 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12566 (style_changed_cb): Call update_theme_scrollbar_width and call
12567 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12568 all frames (Bug#8505).
12569 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12570 Call gtk_window_set_resizable if HAVE_GTK3.
12571 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12572 and height if HAVE_GTK3 (Bug#8505).
12573 (scroll_bar_width_for_theme): New variable.
12574 (update_theme_scrollbar_width): New function.
12575 (xg_get_default_scrollbar_width): Move code to
12576 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12577 (xg_initialize): Call update_theme_scrollbar_width.
12578
12579 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12580
12581 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12582
12583 2011-06-12 Martin Rudalics <rudalics@gmx.at>
12584
12585 * frame.c (make_frame): Call other_buffer_safely instead of
12586 other_buffer.
12587
12588 * window.c (temp_output_buffer_show): Call display_buffer with
12589 second argument Vtemp_buffer_show_specifiers and reset latter
12590 immediately after the call.
12591 (Vtemp_buffer_show_specifiers): New variable.
12592 (auto_window_vscroll_p, next_screen_context_lines)
12593 (Vscroll_preserve_screen_position): Remove leading asterisks from
12594 doc-strings.
12595
12596 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
12597
12598 Fix minor problems found by GCC 4.6.0 static checking.
12599 * buffer.c (Qclone_number): Remove for now, as it's unused.
12600 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12601 (record_buffer): Remove unused local.
12602 * frame.c (other_visible_frames, frame_buffer_list): Now static.
12603 (set_frame_buffer_list): Remove; unused.
12604 * frame.h (other_visible_frames): Remove decl.
12605 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12606 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12607 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12608 if HAVE_GPM.
12609 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12610 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12611 Define only if HAVE_GPM.
12612 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12613 (update_hints_inhibit): Remove; never set. All uses removed.
12614 * widgetprv.h (emacsFrameClassRec): Remove decl.
12615 * window.c (delete_deletable_window): Now returns void, since it
12616 wasn't returning anything.
12617 (compare_window_configurations): Remove unused locals.
12618 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12619 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
12620 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
12621 the same widths as pointers. This follows up on the 2011-05-06 patch.
12622 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
12623 * xterm.h: Likewise.
12624 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
12625
12626 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
12627
12628 * makefile.w32-in: Update dependencies.
12629 (LISP_H): Add lib/intprops.h.
12630
12631 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12632
12633 * image.c (gif_load): Add animation frame delay to the metadata.
12634 (syms_of_image): Use DEFSYM. New symbol `delay'.
12635
12636 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12637
12638 * window.c (delete_deletable_window): Re-add.
12639 (Fset_window_configuration): Rewrite to handle dead buffers and
12640 consequently deletable windows.
12641 (window_tree, Fwindow_tree): Remove. Supply functionality in
12642 window.el.
12643 (compare_window_configurations): Simplify code.
12644
12645 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12646
12647 * image.c (imagemagick_load_image): Fix type mismatch.
12648 (Fimagemagick_types): Likewise.
12649
12650 * window.h (replace_buffer_in_windows): Declare.
12651
12652 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12653
12654 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12655 Qclone_number. Remove external declaration of Qdelete_window.
12656 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
12657 code.
12658 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12659 Run Qbuffer_list_update_hook if allowed.
12660 (Fother_buffer): Rewrite doc-string. Major rewrite for new
12661 buffer list implementation.
12662 (other_buffer_safely): New function.
12663 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12664 calls to replace_buffer_in_windows and
12665 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
12666 if allowed.
12667 (record_buffer): Inhibit quitting and rewrite using quittable
12668 functions. Run Qbuffer_list_update_hook if allowed.
12669 (Frecord_buffer, Funrecord_buffer): New functions.
12670 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12671 Move switch-to-buffer to window.el.
12672 (bury-buffer): Move to window.el.
12673 (Vbuffer_list_update_hook): New variable.
12674
12675 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12676 section.
12677
12678 * window.h (resize_frame_windows): Move up in code.
12679 (Fwindow_frame): Remove EXFUN.
12680 (replace_buffer_in_all_windows): Remove prototype.
12681 (replace_buffer_in_windows_safely): Add prototype.
12682
12683 * window.c: Declare Qdelete_window static again. Move down
12684 declaration of select_count.
12685 (Fnext_window, Fprevious_window): Rewrite doc-strings.
12686 (Fother_window): Move to window.el.
12687 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12688 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12689 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12690 window.el.
12691 (replace_buffer_in_windows): Implement by calling
12692 Qreplace_buffer_in_windows.
12693 (replace_buffer_in_all_windows): Remove with some functionality
12694 moved into replace_buffer_in_windows_safely.
12695 (replace_buffer_in_windows_safely): New function.
12696 (select_window_norecord, select_frame_norecord): Move in front
12697 of run_window_configuration_change_hook. Remove now obsolete
12698 declarations.
12699 (Fset_window_buffer): Rewrite doc-string.
12700 Call Qrecord_window_buffer.
12701 (keys_of_window): Move binding for other-window to window.el.
12702
12703 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12704
12705 * dispextern.h (struct image): Replace data member, whose int_val
12706 and ptr_val fields were not used by anything, with a single
12707 lisp_val object.
12708
12709 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12710 (gif_clear_image, gif_load, imagemagick_load_image)
12711 (gs_clear_image, gs_load): Callers changed.
12712
12713 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12714
12715 * buffer.h: Include <time.h>, for time_t.
12716 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12717
12718 Fix minor problems found by static checking.
12719
12720 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12721
12722 Make identifiers static if they are not used in other modules.
12723 * data.c (Qcompiled_function, Qframe, Qvector):
12724 * image.c (QimageMagick, Qsvg):
12725 * minibuf.c (Qmetadata):
12726 * window.c (resize_window_check, resize_root_window): Now static.
12727 * window.h (resize_window_check, resize_root_window): Remove decls.
12728
12729 * window.c (window_deletion_count, delete_deletable_window):
12730 Remove; unused.
12731 (window_body_lines): Now static.
12732 (Fdelete_other_windows_internal): Mark vars as initialized.
12733 Make sure 'resize_failed' is initialized.
12734 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12735 (resize_window_apply): Remove unused local.
12736 * window.h (delete_deletable_window): Remove decl.
12737
12738 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
12739 (imagemagick_load_image): Fix pointer signedness problem by changing
12740 last arg from unsigned char * to char *. All uses changed.
12741 Also, fix a local for similar reasons.
12742 Remove unused locals. Remove locals to avoid shadowing.
12743 (fn_rsvg_handle_free): Remove; unused.
12744 (svg_load, svg_load_image): Fix pointer signedness problem.
12745 (imagemagick_load_image): Don't use garbage pointer image_wand.
12746
12747 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12748
12749 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
12750
12751 * image.c (gif_load): Fix omitted cast error introduced by
12752 2011-06-06 change.
12753
12754 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12755
12756 * window.h (resize_proportionally, orig_total_lines)
12757 (orig_top_line): Remove from window structure.
12758 (set_window_height, set_window_width, change_window_heights)
12759 (Fdelete_window): Remove prototypes.
12760 (resize_frame_windows): Remove duplicate declaration.
12761
12762 2011-06-10 Eli Zaretskii <eliz@gnu.org>
12763
12764 * window.h (resize_frame_windows, resize_window_check)
12765 (delete_deletable_window, resize_root_window)
12766 (resize_frame_windows): Declare prototypes.
12767
12768 * window.c (resize_window_apply): Make definition be "static" to
12769 match the prototype.
12770
12771 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12772
12773 * window.c: Remove declarations of Qwindow_size_fixed,
12774 window_min_size_1, window_min_size_2, window_min_size,
12775 size_window, window_fixed_size_p, enlarge_window, delete_window.
12776 Remove static from declaration of Qdelete_window, it's
12777 temporarily needed by Fbury_buffer.
12778 (replace_window): Don't assign orig_top_line and
12779 orig_total_lines.
12780 (Fdelete_window, delete_window): Remove. Window deletion is
12781 handled by window.el.
12782 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12783 Replace Fdelete_window calls with calls to Qdelete_window.
12784 (Fdelete_other_windows): Remove. Deleting other windows is
12785 handled by window.el.
12786 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12787 handled in window.el.
12788 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12789 Window minimum sizes are handled in window.el.
12790 (shrink_windows, size_window, set_window_height)
12791 (set_window_width, change_window_heights, window_height)
12792 (window_width, CURBEG, CURSIZE, enlarge_window)
12793 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12794 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12795 handled in window.el.
12796 (make_dummy_parent): Rename to make_parent_window and give it a
12797 second argument horflag.
12798 (make_window): Don't set resize_proportionally any more.
12799 (Fsplit_window): Remove. Windows are split in window.el.
12800 (save_restore_action, save_restore_orig_size)
12801 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12802 Resize mini windows in window.el.
12803 (grow_mini_window, shrink_mini_window): Implement by calling
12804 Qresize_root_window_vertically, resize_window_check and
12805 resize_window_apply.
12806 (saved_window, Fset_window_configuration, save_window_save):
12807 Do not handle orig_top_line, orig_total_lines, and
12808 resize_proportionally.
12809 (window_min_height, window_min_width): Move to window.el.
12810 (keys_of_window): Move bindings for delete-other-windows,
12811 split-window, delete-window and enlarge-window to window.el.
12812
12813 * buffer.c: Temporarily extern Qdelete_window.
12814 (Fbury_buffer): Temporarily call Qdelete_window instead of
12815 Fdelete_window (Fbury_buffer will move to window.el soon).
12816
12817 * frame.c (set_menu_bar_lines_1): Remove code handling
12818 orig_top_line and orig_total_lines.
12819
12820 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12821 set_window_height but set heights directly.
12822 (change_frame_size_1): Use resize_frame_windows.
12823
12824 * xdisp.c (init_xdisp): Don't use set_window_height but set
12825 heights directly.
12826
12827 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12828 Use resize_frame_windows instead of change_window_heights and run
12829 run_window_configuration_change_hook.
12830
12831 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12832 instead of change_window_heights and run
12833 run_window_configuration_change_hook.
12834
12835 2011-06-09 Martin Rudalics <rudalics@gmx.at>
12836
12837 * window.c (replace_window): Rename second argument REPLACEMENT to
12838 NEW. New third argument SETFLAG. Rewrite.
12839 (delete_window, make_dummy_parent): Call replace_window with
12840 third argument 1.
12841 (window_list_1): Move down in code.
12842 (run_window_configuration_change_hook): Move set_buffer part
12843 before select_frame_norecord part in order to unwind correctly.
12844 Rename count1 to count.
12845 (recombine_windows, delete_deletable_window, resize_root_window)
12846 (Fdelete_other_windows_internal)
12847 (Frun_window_configuration_change_hook, make_parent_window)
12848 (resize_window_check, resize_window_apply, Fresize_window_apply)
12849 (resize_frame_windows, Fsplit_window_internal)
12850 (Fdelete_window_internal, Fresize_mini_window_internal):
12851 New functions.
12852 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12853
12854 2011-06-08 Martin Rudalics <rudalics@gmx.at>
12855
12856 * window.h (window): Add some new members to window structure -
12857 normal_lines, normal_cols, new_total, new_normal, clone_number,
12858 splits, nest, prev_buffers, next_buffers.
12859 (WINDOW_TOTAL_SIZE): Move here from window.c.
12860 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
12861
12862 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12863 Remove.
12864 (make_dummy_parent): Set new members of windows structure.
12865 (make_window): Move down in code. Handle new members of window
12866 structure.
12867 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12868 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12869 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12870 (Fset_window_prev_buffers, Fwindow_next_buffers)
12871 (Fset_window_next_buffers, Fset_window_clone_number):
12872 New functions.
12873 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12874 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12875 Doc-string fixes.
12876 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12877 Argument WINDOW can be now internal window too.
12878 (Fwindow_use_time): Move up in code.
12879 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12880 Rewrite doc-string.
12881 (Fset_window_configuration, saved_window)
12882 (Fcurrent_window_configuration, save_window_save): Handle new
12883 members of window structure.
12884 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12885 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12886 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12887 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12888 Qget_mru_window, Qresize_root_window,
12889 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12890 Qauto_buffer_name; staticpro them.
12891
12892 2011-06-07 Martin Rudalics <rudalics@gmx.at>
12893
12894 * window.c (Fwindow_total_size, Fwindow_left_column)
12895 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12896 (Fwindow_list_1): New functions.
12897 (window_box_text_cols): Replace with window_body_cols.
12898 (Fwindow_width, Fscroll_left, Fscroll_right):
12899 Use window_body_cols instead of window_box_text_cols.
12900 (delete_window, Fset_window_configuration):
12901 Call delete_all_subwindows with window as argument.
12902 (delete_all_subwindows): Take a window as argument and not a
12903 structure. Rewrite.
12904 (window_loop): Remove handling of GET_LRU_WINDOW and
12905 GET_LARGEST_WINDOW.
12906 (Fget_lru_window, Fget_largest_window): Move to window.el.
12907
12908 * window.h: Extern window_body_cols instead of
12909 window_box_text_cols. delete_all_subwindows now takes a
12910 Lisp_Object as argument.
12911
12912 * indent.c (compute_motion, Fcompute_motion):
12913 Use window_body_cols instead of window_box_text_cols.
12914
12915 * frame.c (delete_frame): Call delete_all_subwindows with root
12916 window as argument.
12917
12918 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12919
12920 * fns.c (Fputhash): Document return value.
12921
12922 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
12923
12924 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12925
12926 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12927
12928 Cons<->int and similar integer overflow fixes (Bug#8794).
12929
12930 Check for overflow when converting integer to cons and back.
12931 * charset.c (Fdefine_charset_internal, Fdecode_char):
12932 Use cons_to_unsigned to catch overflow.
12933 (Fencode_char): Use INTEGER_TO_CONS.
12934 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12935 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12936 * data.c (long_to_cons, cons_to_long): Remove.
12937 (cons_to_unsigned, cons_to_signed): New functions.
12938 These signal an error for invalid or out-of-range values.
12939 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12940 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12941 * font.c (Ffont_variation_glyphs):
12942 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12943 * lisp.h: Include <intprops.h>.
12944 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12945 (cons_to_signed, cons_to_unsigned): New decls.
12946 (long_to_cons, cons_to_long): Remove decls.
12947 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12948 (Fprimitive_undo): Use CONS_TO_INTEGER.
12949 * xfns.c (Fx_window_property): Likewise.
12950 * xselect.c: Include <limits.h>.
12951 (x_own_selection, selection_data_to_lisp_data):
12952 Use INTEGER_TO_CONS.
12953 (x_handle_selection_request, x_handle_selection_clear)
12954 (x_get_foreign_selection, Fx_disown_selection_internal)
12955 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12956 (lisp_data_to_selection_data): Use cons_to_unsigned.
12957 (x_fill_property_data): Use cons_to_signed.
12958 Report values out of range.
12959
12960 Check for buffer and string overflow more precisely.
12961 * buffer.h (BUF_BYTES_MAX): New macro.
12962 * lisp.h (STRING_BYTES_MAX): New macro.
12963 * alloc.c (Fmake_string):
12964 * character.c (string_escape_byte8):
12965 * coding.c (coding_alloc_by_realloc):
12966 * doprnt.c (doprnt):
12967 * editfns.c (Fformat):
12968 * eval.c (verror):
12969 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12970 since they may not be the same number.
12971 * editfns.c (Finsert_char):
12972 * fileio.c (Finsert_file_contents):
12973 Likewise for BUF_BYTES_MAX.
12974
12975 * image.c: Use ptrdiff_t, not int, for sizes.
12976 (slurp_file): Switch from int to ptrdiff_t.
12977 All uses changed.
12978 (slurp_file): Check that file size fits in both size_t (for
12979 malloc) and ptrdiff_t (for sanity and safety).
12980
12981 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12982 if b->modtime has its maximal value.
12983
12984 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12985
12986 Don't assume time_t can fit into int.
12987 * buffer.h (struct buffer.modtime): Now time_t, not int.
12988 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12989 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12990
12991 Minor fixes for signed vs unsigned integers.
12992 * character.h (MAYBE_UNIFY_CHAR):
12993 * charset.c (maybe_unify_char):
12994 * keyboard.c (read_char, reorder_modifiers):
12995 XINT -> XFASTINT, since the integer must be nonnegative.
12996 * ftfont.c (ftfont_spec_pattern):
12997 * keymap.c (access_keymap, silly_event_symbol_error):
12998 XUINT -> XFASTINT, since the integer must be nonnegative.
12999 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13000 since it makes no difference and we prefer signed.
13001 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13002 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13003 nonnegative.
13004
13005 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13006
13007 * window.h (Fwindow_frame): Declare.
13008
13009 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13010
13011 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13012 (SPARE_MEMORY): Always define.
13013 (LARGE_REQUEST): Remove.
13014 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13015
13016 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13017
13018 * lisp.h: Move EXFUNS for Fframe_root_window,
13019 Fframe_first_window and Fset_frame_selected_window to window.h.
13020
13021 * window.h: Move EXFUNS for Fframe_root_window,
13022 Fframe_first_window and Fset_frame_selected_window here from
13023 lisp.h.
13024
13025 * frame.c (Fwindow_frame, Fframe_first_window)
13026 (Fframe_root_window, Fframe_selected_window)
13027 (Fset_frame_selected_window): Move to window.c.
13028 (Factive_minibuffer_window): Move to minibuf.c.
13029 (Fother_visible_frames_p): New function.
13030
13031 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13032
13033 * window.c (decode_window, decode_any_window): Move up in code.
13034 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13035 (inhibit_frame_unsplittable): Remove unused variable.
13036 (Fwindow_buffer): Move up and rewrite doc-string.
13037 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13038 (Fwindow_prev): New functions.
13039 (Fwindow_frame): Move here from frame.c. Accept any window as
13040 argument.
13041 (Fframe_root_window, Fframe_first_window)
13042 (Fframe_selected_window): Move here from frame.c. Accept frame
13043 or arbitrary window as argument. Update doc-strings.
13044 (Fminibuffer_window): Move up in code.
13045 (Fwindow_minibuffer_p): Move up in code and simplify.
13046 (Fset_frame_selected_window): Move here from frame.c.
13047 Marginal rewrite.
13048 (Fselected_window, select_window, Fselect_window): Move up in
13049 code. Minor doc-string fixes.
13050
13051 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13052
13053 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13054 Do not assume that spare memory exists; that assumption is valid
13055 only if SYSTEM_MALLOC.
13056 (LARGE_REQUEST): New macro, so that the issue of large requests
13057 is separated from the issue of spare memory.
13058
13059 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13060
13061 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13062 format. (Bug#8806)
13063
13064 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13065
13066 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13067 before statements.
13068
13069 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13070
13071 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13072
13073 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13074
13075 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13076 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13077
13078 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13079
13080 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13081
13082 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13083
13084 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13085 (x_clipboard_manager_save): Add return value.
13086 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13087 New error handlers.
13088 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13089 Obey Vx_select_enable_clipboard_manager. Catch errors in
13090 x_clipboard_manager_save (Bug#8779).
13091 (Vx_select_enable_clipboard_manager): New variable.
13092 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13093
13094 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13095
13096 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13097
13098 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13099
13100 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13101 in the current matrix if keep_current_p is non-zero.
13102
13103 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13104
13105 * bidi.c (bidi_level_of_next_char): Fix last change.
13106
13107 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13108
13109 Support bidi reordering of text covered by display properties.
13110
13111 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13112 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13113 (bidi_cache_search, bidi_cache_iterator_state)
13114 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13115 (bidi_level_of_next_char, bidi_move_to_visually_next):
13116 Support character positions inside a run of characters covered by a
13117 display string.
13118 (bidi_paragraph_init, bidi_resolve_explicit_1)
13119 (bidi_level_of_next_char): Call bidi_fetch_char and
13120 bidi_fetch_char_advance instead of FETCH_CHAR and
13121 FETCH_CHAR_ADVANCE.
13122 (bidi_init_it): Initialize new members.
13123 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13124 definitions.
13125 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13126 instead of using explicit *_CHAR codes.
13127 (bidi_resolve_explicit, bidi_resolve_weak):
13128 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13129 bidirectional text is supported only in multibyte buffers.
13130 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13131 it to initialize the frame_window_p member of struct bidi_it.
13132 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13133 (bidi_resolve_explicit, bidi_resolve_weak)
13134 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13135 bidi_it->nchars is non-positive.
13136 (bidi_level_of_next_char): Don't try to lookup the cache for the
13137 next/previous character if nothing is cached there yet, or if we
13138 were just reseat()'ed to a new position.
13139
13140 * xdisp.c (set_cursor_from_row): Set start and stop points
13141 according to the row's direction when priming the loop that looks
13142 for the glyph on which to display cursor.
13143 (single_display_spec_intangible_p): Function deleted.
13144 (display_prop_intangible_p): Reimplement to call
13145 handle_display_spec instead of single_display_spec_intangible_p.
13146 Accept 3 additional arguments needed by handle_display_spec.
13147 This fixes incorrect cursor motion across display property with complex
13148 values: lists, `(when COND...)' forms, etc.
13149 (single_display_spec_string_p): Support property values that are
13150 lists with the argument STRING its top-level element.
13151 (display_prop_string_p): Fix the condition for processing a
13152 property that is a list to be consistent with handle_display_spec.
13153 (handle_display_spec): New function, refactored from the
13154 last portion of handle_display_prop.
13155 (compute_display_string_pos): Accept additional argument
13156 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13157 value of a `display' property is a "replacing spec".
13158 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13159 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13160 the display property, but just return a value indicating whether
13161 the display property will replace the characters it covers.
13162 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13163 frame_window_p members of struct bidi_it.
13164 (compute_display_string_pos, compute_display_string_end):
13165 New functions.
13166 (push_it): Accept second argument POSITION, where pop_it should
13167 jump to continue iteration.
13168 (reseat_1): Initialize bidi_it.disp_pos.
13169
13170 * keyboard.c (adjust_point_for_property): Adjust the call to
13171 display_prop_intangible_p to its new signature.
13172
13173 * dispextern.h (struct bidi_it): New member frame_window_p.
13174 (bidi_init_it): Update prototypes.
13175 (display_prop_intangible_p): Update prototype.
13176 (compute_display_string_pos, compute_display_string_end):
13177 Declare prototypes.
13178 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13179 EMACS_INT.
13180
13181 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13182
13183 Malloc failure behavior now depends on size of allocation.
13184 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13185 * lisp.h: Change signatures accordingly.
13186 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13187 All callers changed. (Bug#8762)
13188
13189 * gnutls.c: Use Emacs's memory allocators.
13190 Without this change, the gnutls library would invoke malloc etc.
13191 directly, which causes problems on non-SYNC_INPUT hosts, and which
13192 runs afoul of improving memory_full behavior. (Bug#8761)
13193 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13194 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13195 xfree instead of the default malloc, realloc, free.
13196 (Fgnutls_boot): No need to check for memory allocation failure,
13197 since xmalloc does that for us.
13198
13199 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13200 * category.c (hash_get_category_set):
13201 * ccl.c (ccl_driver):
13202 * charset.c (Fdefine_charset_internal):
13203 * charset.h (struct charset.hash_index):
13204 * composite.c (get_composition_id, gstring_lookup_cache)
13205 (composition_gstring_put_cache):
13206 * composite.h (struct composition.hash_index):
13207 * dispextern.h (struct image.hash):
13208 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13209 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13210 (hashfn_equal, hashfn_user_defined, make_hash_table)
13211 (maybe_resize_hash_table, hash_lookup, hash_put)
13212 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13213 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13214 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13215 * image.c (make_image, search_image_cache, lookup_image)
13216 (xpm_put_color_table_h):
13217 * lisp.h (struct Lisp_Hash_Table):
13218 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13219 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13220 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13221 * alloc.c (allocate_vectorlike):
13222 Check for overflow in vector size calculations.
13223 * ccl.c (ccl_driver):
13224 Check for overflow when converting EMACS_INT to int.
13225 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13226 need to be updated by these changes.
13227 * fns.c (make_hash_table, maybe_resize_hash_table):
13228 Check for integer overflow with large hash tables.
13229 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13230 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13231 (SXHASH_REDUCE): New macro.
13232 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13233 Use it instead of discarding useful hash info with large hash values.
13234 (sxhash_float): New function.
13235 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13236 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13237 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13238 Rewrite to use FIXNUM_BITS, as this simplifies things.
13239 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13240 Adjust signatures to match updated version of code.
13241 (consing_since_gc): Now EMACS_INT, since a single hash table can
13242 use more than INT_MAX bytes.
13243
13244 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13245
13246 Make it possible to build with GCC-4.6+ -O2 -flto.
13247
13248 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13249
13250 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13251
13252 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13253 Call minibuffer-inactive-mode.
13254
13255 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13256
13257 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13258 Update dependencies.
13259
13260 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13261
13262 * data.c (init_data): Remove code for UTS, this system is not
13263 supported anymore.
13264
13265 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13266
13267 Don't force ./temacs to start in terminal mode.
13268
13269 * frame.c (make_initial_frame): Initialize faces in all cases, not
13270 only when CANNOT_DUMP is defined.
13271 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13272
13273 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13274
13275 * dispnew.c (add_window_display_history): Use const for the string
13276 pointer. Remove declaration, not needed.
13277
13278 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13279
13280 Use 'inline', not 'INLINE'.
13281 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13282 * alloc.c, fontset.c (INLINE): Remove.
13283 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13284 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13285 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13286 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13287 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13288
13289 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13290
13291 Make it possible to run ./temacs.
13292
13293 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13294 syms_of_callproc does the same thing. Remove test for
13295 "initialized", do it in the caller.
13296 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13297
13298 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13299
13300 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13301 (read_minibuf): Use get_minibuffer.
13302 (syms_of_minibuf): Use DEFSYM.
13303 (Qmetadata): New var.
13304 * data.c (Qbuffer): Don't make it static.
13305 (syms_of_data): Use DEFSYM.
13306
13307 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13308
13309 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13310 (CCL_CODE_MIN): New macro.
13311
13312 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13313
13314 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13315
13316 * eval.c (Qdebug): Now static.
13317 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13318 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13319 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13320
13321 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13322
13323 * image.c: Various fixes to ImageMagick code comments.
13324 (Fimagemagick_types): Doc fix.
13325
13326 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13327
13328 Minor fixes prompted by GCC 4.6.0 warnings.
13329
13330 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13331
13332 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13333 (x_clipboard_manager_save_all): Move extern decl to ...
13334 * xterm.h: ... here, so that it can be checked for consistency.
13335
13336 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13337
13338 * xselect.c (x_clipboard_manager_save_frame)
13339 (x_clipboard_manager_save_all): New functions.
13340 (Fx_clipboard_manager_save): Lisp function deleted.
13341
13342 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13343 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13344
13345 * xterm.h: Update prototype.
13346
13347 2011-05-28 William Xu <william.xwl@gmail.com>
13348
13349 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13350 exiting (Bug#8239).
13351
13352 2011-05-28 Jim Meyering <meyering@redhat.com>
13353
13354 Avoid a sign-extension bug in crypto_hash_function.
13355 * fns.c (to_uchar): Define.
13356 (crypto_hash_function): Use it to convert some newly-signed
13357 variables to unsigned, to avoid sign-extension bugs. For example,
13358 without this change, (md5 "truc") would evaluate to
13359 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13360 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13361 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13362
13363 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13364
13365 Integer overflow fixes.
13366
13367 * dbusbind.c: Serial number integer overflow fixes.
13368 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13369 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13370 to hold a serial number that is too large for a fixnum.
13371 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13372 Check for serial numbers out of range. Decode any serial number
13373 that was so large that it became a float. (Bug#8722)
13374
13375 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13376 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13377 Use XFASTINT rather than XUINT when numbers are nonnegative.
13378 (xd_append_arg, Fdbus_method_return_internal):
13379 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13380 arguments, check that Lisp number is nonnegative, rather than
13381 silently wrapping negative numbers around. (Bug#8722)
13382 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13383 (Bug#8722)
13384
13385 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13386
13387 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13388
13389 ccl: Add integer overflow checks.
13390 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13391 (IN_INT_RANGE): New macros.
13392 (ccl_driver): Use them to check for integer overflow when
13393 decoding a CCL program. Many of the new checks are whether XINT (x)
13394 fits in int; it doesn't always, on 64-bit hosts. The new version
13395 doesn't catch all possible integer overflows, but it's an
13396 improvement. (Bug#8719)
13397
13398 * alloc.c (make_event_array): Use XINT, not XUINT.
13399 There's no need for unsigned here.
13400
13401 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13402 This follows up to the 2011-05-06 change that substituted uintptr_t
13403 for EMACS_INT. This case wasn't caught back then.
13404
13405 Rework Fformat to avoid integer overflow issues.
13406 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13407 now (part of C89). Include <verify.h>.
13408 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13409 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13410 (Fformat): Avoid the prepass trying to compute sizes; it was only
13411 approximate and thus did not catch overflow reliably. Instead, walk
13412 through the format just once, formatting and computing sizes as we go,
13413 checking for integer overflow at every step, and allocating a larger
13414 buffer as needed. Keep track separately whether the format is
13415 multibyte. Keep only the most-recently calculated precision, rather
13416 than them all. Record whether each argument has been converted to
13417 string. Use EMACS_INT, not int, for byte and char and arg counts.
13418 Support field widths and precisions larger than INT_MAX. Avoid
13419 sprintf's undefined behavior with conversion specifications such as %#d
13420 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13421 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13422 formatting out-of-range floating point numbers with int
13423 formats. (Bug#8668)
13424
13425 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13426
13427 * data.c: Avoid integer truncation in expressions involving floats.
13428 * data.c: Include <intprops.h>.
13429 (arith_driver): When there's an integer overflow in an expression
13430 involving floating point, convert the integers to floating point
13431 so that the resulting value does not suffer from catastrophic
13432 integer truncation. For example, on a 64-bit host (* 4
13433 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13434 Do not rely on undefined behavior after integer overflow.
13435
13436 merge count_size_as_multibyte, parse_str_to_multibyte
13437 * character.c, character.h (count_size_as_multibyte):
13438 Rename from parse_str_to_multibyte; all uses changed.
13439 Check for integer overflow.
13440 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13441 since it's now a duplicate of the other. This is more of
13442 a character than a buffer op, so better that it's in character.c.
13443 * fns.c, print.c: Adjust to above changes.
13444
13445 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13446
13447 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13448
13449 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13450
13451 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13452 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13453 (x_clipboard_manager_save): Now static.
13454 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13455
13456 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13457 (crypto_hash_function): Now static.
13458 Fix pointer signedness problems. Avoid unnecessary initializations.
13459
13460 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
13461
13462 * termhooks.h (Vselection_alist): Make it terminal-local.
13463
13464 * terminal.c (create_terminal): Initialize it.
13465
13466 * xselect.c: Support for clipboard managers.
13467 (Vselection_alist): Move to termhooks.h as terminal-local var.
13468 (LOCAL_SELECTION): New macro.
13469 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13470 (symbol_to_x_atom): Remove gratuitous arg.
13471 (x_handle_selection_request, lisp_data_to_selection_data)
13472 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
13473 (x_own_selection, x_get_local_selection, x_convert_selection):
13474 New arg, specifying work frame. Use terminal-local Vselection_alist.
13475 (some_frame_on_display): Delete unused function.
13476 (Fx_own_selection_internal, Fx_get_selection_internal)
13477 (Fx_disown_selection_internal, Fx_selection_owner_p)
13478 (Fx_selection_exists_p): New optional frame arg.
13479 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13480 (x_handle_selection_clear): Don't treat other terminals with the
13481 same keyboard specially. Use the terminal-local Vselection_alist.
13482 (x_clear_frame_selections): Use Frun_hook_with_args.
13483
13484 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13485
13486 * xterm.h: Add support for those atoms.
13487
13488 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
13489
13490 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13491 (converted_selections, conversion_fail_tag): New global variables.
13492 (x_selection_request_lisp_error): Free the above.
13493 (x_get_local_selection): Remove unnecessary code.
13494 (x_reply_selection_request): Args changed; handle arbitrary array
13495 of converted selections stored in converted_selections.
13496 Separate the XChangeProperty and SelectionNotify steps.
13497 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13498 (x_convert_selection): New function.
13499 (x_handle_selection_event): Simplify.
13500 (x_get_foreign_selection): Don't ignore incoming requests while
13501 waiting for an answer; this will fail when we implement
13502 SAVE_TARGETS, and seems unnecessary anyway.
13503 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13504 (Vx_sent_selection_functions): Doc fix.
13505
13506 2011-05-26 Leo Liu <sdl.web@gmail.com>
13507
13508 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13509
13510 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13511
13512 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13513
13514 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13515 for fringe update if it has periodic bitmap.
13516 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
13517 and fringe_bitmap_periodic_p.
13518
13519 * fringe.c (get_fringe_bitmap_data): New function.
13520 (draw_fringe_bitmap_1, update_window_fringes): Use it.
13521 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13522 row. Mark glyph row for fringe update if periodicity changed.
13523
13524 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13525 for fringe update unless it has periodic bitmap.
13526
13527 2011-05-25 Kenichi Handa <handa@m17n.org>
13528
13529 * xdisp.c (get_next_display_element): Set correct it->face_id for
13530 a static composition.
13531
13532 2011-05-24 Leo Liu <sdl.web@gmail.com>
13533
13534 * deps.mk (fns.o):
13535 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13536
13537 * fns.c (crypto_hash_function, Fsha1): New function.
13538 (Fmd5): Use crypto_hash_function.
13539 (syms_of_fns): Add Ssha1.
13540
13541 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13542
13543 * gnutls.c: Remove unused macros.
13544 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13545 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13546 Remove macros that are defined and never used.
13547 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13548
13549 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13550
13551 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13552 (Fx_get_selection_internal): Minor cleanup.
13553 (Fx_own_selection_internal): Rename arguments for consistency with
13554 select.el.
13555
13556 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13557
13558 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13559
13560 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13561
13562 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13563
13564 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13565
13566 * dispnew.c (scrolling_window): Don't exclude the case that the
13567 last enabled row in the desired matrix touches the bottom boundary.
13568
13569 2011-05-21 Glenn Morris <rgm@gnu.org>
13570
13571 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
13572 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13573 and add some more files.
13574
13575 2011-05-20 Eli Zaretskii <eliz@gnu.org>
13576
13577 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13578 report_file_error introduced by the change from 2011-05-07.
13579
13580 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13581
13582 * systime.h (Time): Define only if emacs is defined.
13583 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13584 where the include path doesn't have X11/X.h by default. See
13585 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13586
13587 2011-05-20 Kenichi Handa <handa@m17n.org>
13588
13589 * composite.c (find_automatic_composition): Fix previous change.
13590
13591 2011-05-20 Glenn Morris <rgm@gnu.org>
13592
13593 * lisp.mk: New file, split from Makefile.in.
13594 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13595 (shortlisp): Remove.
13596 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13597
13598 2011-05-19 Glenn Morris <rgm@gnu.org>
13599
13600 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13601 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13602 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13603 (lisp): Set the order to that of loadup.el.
13604 (shortlisp): Make it a copy of $lisp.
13605 (SOME_MACHINE_LISP): Remove.
13606 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13607 Use just $shortlisp, not $SOME_MACHINE_LISP too.
13608
13609 2011-05-18 Kenichi Handa <handa@m17n.org>
13610
13611 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13612 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13613 (find_automatic_composition): Mostly rewrite for efficiency.
13614
13615 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
13616
13617 * makefile.w32-in: Update dependencies.
13618
13619 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13620
13621 * menu.c: Include limits.h (fixes the MS-Windows build broken by
13622 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
13623
13624 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
13625
13626 Fix some integer overflow issues, such as string length overflow.
13627
13628 * insdel.c (count_size_as_multibyte): Check for string overflow.
13629
13630 * character.c (lisp_string_width): Check for string overflow.
13631 Use EMACS_INT, not int, for string indexes and lengths; in
13632 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
13633 the resulting string length overflows an EMACS_INT; instead,
13634 report a string overflow if no precision given. When checking for
13635 precision exhaustion, use a check that cannot possibly have
13636 integer overflow. (Bug#8675)
13637 * character.h (lisp_string_width): Adjust to new signature.
13638
13639 * alloc.c (string_overflow): New function.
13640 (Fmake_string): Use it. This doesn't change behavior, but saves
13641 a few bytes and will simplify future changes.
13642 * character.c (string_escape_byte8): Likewise.
13643 * lisp.h (string_overflow): New decl.
13644
13645 Fixups, following up to the user-interface timestamp change.
13646 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13647 for UI timestamps, instead of unsigned long.
13648 * msdos.c (mouse_get_pos): Likewise.
13649 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
13650 * w32gui.h (Time): Define by including "systime.h" rather than by
13651 declaring it ourselves. (Bug#8664)
13652
13653 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13654 * image.c (clear_image_cache): Likewise.
13655
13656 * term.c (term_mouse_position): Don't assume time_t wraparound.
13657
13658 Be more systematic about user-interface timestamps.
13659 Before, the code sometimes used 'Time', sometimes 'unsigned long',
13660 and sometimes 'EMACS_UINT', to represent these timestamps.
13661 This change causes it to use 'Time' uniformly, as that's what X uses.
13662 This makes the code easier to follow, and makes it easier to catch
13663 integer overflow bugs such as Bug#8664.
13664 * frame.c (Fmouse_position, Fmouse_pixel_position):
13665 Use Time, not unsigned long, for user-interface timestamps.
13666 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13667 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13668 * keyboard.h (last_event_timestamp): Likewise.
13669 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13670 * menu.h (xmenu_show): Likewise.
13671 * term.c (term_mouse_position): Likewise.
13672 * termhooks.h (struct input_event.timestamp): Likewise.
13673 (struct terminal.mouse_position_hook): Likewise.
13674 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13675 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13676 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
13677 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13678 what it was before.
13679 * menu.h, termhooks.h: Include "systime.h", for Time.
13680
13681 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13682 Don't assume that the difference between two unsigned long values
13683 can fit into an integer. At this point, we know button_down_time
13684 <= event->timestamp, so the difference must be nonnegative, so
13685 there's no need to cast the result if double-click-time is
13686 nonnegative, as it should be; check that it's nonnegative, just in
13687 case. This bug is triggered when events are more than 2**31 ms
13688 apart (about 25 days). (Bug#8664)
13689
13690 * xselect.c (last_event_timestamp): Remove duplicate decl.
13691 (x_own_selection): Remove needless cast to unsigned long.
13692
13693 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13694 that always fit in int. Use a sentinel instead of a counter, to
13695 avoid a temp and to allay GCC's concerns about possible int overflow.
13696 * frame.h (struct frame): Use int for menu_bar_items_used
13697 instead of EMACS_INT, since it always fits in int.
13698
13699 * menu.c (grow_menu_items): Check for int overflow.
13700
13701 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13702
13703 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13704 Before, the code was not consistent. These values cannot exceed
13705 2**31 - 1 so there's no need to make them unsigned.
13706 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13707 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13708 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13709 as modifiers.
13710 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13711
13712 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13713 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13714 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13715 presumably because the widths might not match.
13716
13717 * window.c (size_window): Avoid needless test at loop start.
13718
13719 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13720
13721 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13722
13723 2011-05-12 Drew Adams <drew.adams@oracle.com>
13724
13725 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13726
13727 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13728
13729 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13730 `width' to `bar_area_x' and `bar_area_width', respectively.
13731 (x_scroll_run): Take account of fringe background extension.
13732
13733 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13734 Rename local vars `left' and `width' to `bar_area_x' and
13735 `bar_area_width', respectively.
13736 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13737 background extension.
13738
13739 2011-05-10 Jim Meyering <meyering@redhat.com>
13740
13741 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13742
13743 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
13744
13745 * image.c (Finit_image_library): Return t for built-in image types,
13746 like pbm and xbm. (Bug#8640)
13747
13748 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13749
13750 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13751
13752 2011-05-07 Eli Zaretskii <eliz@gnu.org>
13753
13754 * w32console.c (Fset_screen_color): Doc fix.
13755 (Fget_screen_color): New function.
13756 (syms_of_ntterm): Defsubr it.
13757
13758 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13759 unlink the temporary file if Fcall_process didn't create it in the
13760 first place.
13761 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13762 child process will be redirected to a file specified with `:file'.
13763 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13764 cue to call_process_cleanup not to close that handle.
13765
13766 2011-05-07 Ben Key <bkey76@gmail.com>
13767
13768 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13769 one of two shell specific rules, either bootstrap-temacs-CMD or
13770 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13771 to the previous implementation of the bootstrap-temacs rule.
13772 The bootstrap-temacs-CMD rule is similar to the previous
13773 implementation of the bootstrap-temacs rule except that it
13774 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13775 variable.
13776
13777 These changes, along with some changes to nt/configure.bat,
13778 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13779 earlier fix to add support for --cflags and --ldflags options
13780 that include quotes so that it works whether make uses cmd or
13781 sh as the shell.
13782
13783 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
13784
13785 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13786 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13787 is a constant.
13788 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13789 a string. Handle both cases.
13790 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13791 (Fdbus_register_method): Use Qinvalid_function.
13792
13793 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13794
13795 * makefile.w32-in: Update dependencies.
13796 (LISP_H): Add inttypes.h and stdin.h.
13797 (PROCESS_H): Add unistd.h.
13798
13799 2011-05-06 Eli Zaretskii <eliz@gnu.org>
13800
13801 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13802 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13803
13804 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
13805
13806 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13807
13808 * term.c (vfatal): Remove stray call to va_end.
13809 It's not needed and the C Standard doesn't allow it here anyway.
13810
13811 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13812 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13813
13814 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13815 bytes.
13816
13817 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13818
13819 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13820
13821 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13822
13823 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13824
13825 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13826
13827 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13828 * charset.c (Fdefine_charset_internal): Don't initialize
13829 charset.code_space[15]. The value was garbage, on hosts with
13830 32-bit int (Bug#8600).
13831
13832 * lread.c (read_integer): Be more consistent with string-to-number.
13833 Use string_to_number to do the actual conversion; this avoids
13834 rounding errors and fixes some other screwups. Without this fix,
13835 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13836 (digit_to_number): Move earlier, for benefit of read_integer.
13837 Return -1 if the digit is out of range for the base, -2 if it is
13838 not a digit in any supported base. (Bug#8602)
13839
13840 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13841
13842 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13843 to match comment at start of function. This also removes a
13844 GCC warning about overflow in a 32+64-bit port.
13845
13846 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13847
13848 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13849 Reported by Stefan Monnier in
13850 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
13851 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13852 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
13853
13854 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13855 (EMACS_UINTPTR): Likewise, with uintptr_t.
13856
13857 * lisp.h: Prefer 64-bit EMACS_INT if available.
13858 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13859 on 32-bit hosts that have 64-bit int, so that they can access
13860 large files.
13861 However, temporarily disable this change unless the temporary
13862 symbol WIDE_EMACS_INT is defined.
13863
13864 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13865
13866 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13867 This removes an assumption that EMACS_INT and long are the same
13868 width as pointers. The assumption is true for Emacs porting targets
13869 now, but we want to make other targets possible.
13870 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13871 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13872 In the rest of the code, change types of integers that hold casted
13873 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13874 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13875 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13876 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13877 No need to cast type when ORing.
13878 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13879 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13880 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13881 assume EMACS_INT is the same width as char *.
13882 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13883 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13884 Remove no-longer-needed casts.
13885 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13886 (xg_tool_bar_help_callback, xg_make_tool_item):
13887 Use EMACS_INTPTR to hold an integer
13888 that will be cast to void *; this can avoid a GCC warning
13889 if EMACS_INT is not the same width as void *.
13890 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13891 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13892 (current_message_1, set_message_1):
13893 Use a local to convert to proper width without a cast.
13894 * xmenu.c (dialog_selection_callback): Likewise.
13895
13896 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13897 Also, don't assume VALBITS / RAND_BITS is less than 5,
13898 and don't rely on undefined behavior when shifting a 1 left into
13899 the sign bit.
13900 * lisp.h (get_random): Change signature to match.
13901
13902 * lread.c (hash_string): Use size_t, not int, for hash computation.
13903 Normally we prefer signed values; but hashing is special, because
13904 it's better to use unsigned division on hash table sizes so that
13905 the remainder is nonnegative. Also, size_t is the natural width
13906 for hashing into memory. The previous code used 'int', which doesn't
13907 retain enough info to hash well into very large tables.
13908 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13909
13910 * dbusbind.c: Don't possibly lose pointer info when converting.
13911 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13912 Use XPNTR rather than XHASH, so that the high-order bits of
13913 the pointer aren't lost when converting through void *.
13914
13915 * eval.c (Fautoload): Don't double-shift a pointer.
13916
13917 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13918
13919 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13920
13921 * gnutls.c (DEF_GNUTLS_FN):
13922 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13923
13924 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13925
13926 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13927 marker. (Bug#8610)
13928
13929 2011-05-05 Eli Zaretskii <eliz@gnu.org>
13930
13931 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13932 New version that can reserve upto 2GB of heap space.
13933
13934 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
13935
13936 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13937
13938 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13939
13940 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13941 `gnutls_certificate_set_x509_key_file'.
13942
13943 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
13944
13945 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13946 Update dependencies.
13947
13948 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13949
13950 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13951 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13952 Remove unused parameter `fildes'.
13953 * process.c (read_process_output, send_process): Don't pass it.
13954
13955 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13956
13957 Fix previous change: the library cache is defined in w32.c.
13958 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13959 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13960
13961 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13962
13963 Implement dynamic loading of GnuTLS on Windows.
13964
13965 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13966 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13967 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13968 Declare.
13969
13970 * gnutls.c (Qgnutls_dll): Define.
13971 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13972 (gnutls_*): Declare function pointers.
13973 (init_gnutls_functions): New function to initialize function pointers.
13974 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13975 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13976 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13977 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13978 (emacs_gnutls_write, emacs_gnutls_read)
13979 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13980 (Fgnutls_available_p): New function.
13981 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13982 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13983 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13984
13985 * image.c: Include w32.h.
13986 (Vimage_type_cache): Delete.
13987 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13988 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13989 (w32_delayed_load): Move to w32.c.
13990
13991 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13992
13993 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13994 (w32_delayed_load): Move from image.c. When loading a library, record
13995 its filename in the :loaded-from property of the library id.
13996 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13997 Initialize and staticpro them.
13998 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13999
14000 * process.c: Include lisp.h before w32.h, not after.
14001 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14002 instead of gnutls_record_check_pending.
14003
14004 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14005
14006 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14007
14008 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14009 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14010 as passed in.
14011
14012 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14013
14014 * xterm.c (x_set_frame_alpha): Do not set property on anything
14015 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14016
14017 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14018
14019 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14020
14021 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14022
14023 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14024 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14025 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14026 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14027 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14028 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14029 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14030 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14031 (Qgnutls_bootprop_callbacks_verify): Make static.
14032
14033 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14034
14035 * callproc.c: Indentation fixup.
14036
14037 * sysdep.c (wait_for_termination_1): Make static.
14038 (wait_for_termination, interruptible_wait_for_termination):
14039 Move after wait_for_termination_1.
14040
14041 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14042
14043 * sysdep.c (interruptible_wait_for_termination): New function
14044 which is like wait_for_termination, but allows keyboard
14045 interruptions.
14046
14047 * callproc.c (Fcall_process): Add (:file "file") as an option for
14048 the STDOUT buffer.
14049 (Fcall_process_region): Ditto.
14050
14051 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14052
14053 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14054 rather than `XVECTOR (FOO)->size'.
14055
14056 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14057 inttypes.h, as a gnulib replacement is used if it not available in
14058 system headers.
14059
14060 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14061
14062 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14063 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14064 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14065
14066 * coding.c (coding_alloc_by_realloc): Error out if destination
14067 will grow beyond MOST_POSITIVE_FIXNUM.
14068 (decode_coding_emacs_mule): Abort if there isn't enough place in
14069 charbuf for the composition carryover bytes. Reserve an extra
14070 space for up to 2 characters produced in a loop.
14071 (decode_coding_iso_2022): Abort if there isn't enough place in
14072 charbuf for the composition carryover bytes.
14073
14074 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14075
14076 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14077 aborting when %lld or %lll format is passed.
14078 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14079 %llo or %llx format is passed. (Bug#8545)
14080
14081 * window.c (window_scroll_line_based): Use a marker instead of
14082 simple variables to record original value of point. (Bug#7952)
14083
14084 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14085 produced by %s or %c overflows available buffer space. (Bug#8545)
14086
14087 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14088
14089 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14090 (SIZE_MAX): Move defn after all includes, as they might #define it.
14091
14092 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14093
14094 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14095
14096 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14097
14098 * keyboard.c (Qdelayed_warnings_hook): Define.
14099 (command_loop_1): Run `delayed-warnings-hook'
14100 if Vdelayed_warnings_list is non-nil.
14101 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14102 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14103
14104 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14105
14106 * doprnt.c (doprnt): Don't return value smaller than the buffer
14107 size if the message was truncated. (Bug#8545).
14108
14109 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14110
14111 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14112 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14113
14114 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14115
14116 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14117
14118 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14119
14120 * makefile.w32-in: Update dependencies.
14121
14122 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14123
14124 Improve `doprnt' and its usage. (Bug#8545)
14125 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14126 `format_end'. Remove support for %l as a conversion specifier.
14127 Don't use xrealloc. Improve diagnostics when the %l size modifier
14128 is used. Update the commentary.
14129
14130 * eval.c (verror): Simplify calculation of size_t.
14131
14132 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14133 messages.
14134
14135 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14136
14137 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14138 change.
14139
14140 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14141
14142 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14143 This makes this file independent of the recent pseudovector change.
14144
14145 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14146
14147 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14148
14149 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14150 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14151 Remove unused local.
14152 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14153
14154 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14155 GCC 4.6.0 optimizes based on type-based alias analysis.
14156 For example, if b is of type struct buffer * and v of type struct
14157 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14158 != &v->size, and therefore "v->size = 1; b->size = 2; return
14159 v->size;" must therefore return 1. This assumption is incorrect
14160 for Emacs, since it type-puns struct Lisp_Vector * with many other
14161 types. To fix this problem, this patch adds a new type struct
14162 vectorlike_header that documents the constraints on layout of vectors
14163 and pseudovectors, and helps optimizing compilers not get fooled
14164 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14165 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14166 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14167 the size member.
14168 (XSETPVECTYPE): Rewrite in terms of new macro.
14169 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14170 This is a bit clearer, and further avoids the possibility of
14171 undesirable aliasing.
14172 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14173 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14174 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14175 since Lisp_Subr is a special case (no "next" field).
14176 (ASIZE): Now uses header.size rather than size.
14177 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14178 to avoid the hassle of writing XVECTOR (foo)->header.size.
14179 (struct vectorlike_header): New type.
14180 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14181 object, to help avoid aliasing.
14182 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14183 (SUBRP): Likewise, since Lisp_Subr is a special case.
14184 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14185 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14186 (struct Lisp_Hash_Table): Combine first two members into a single
14187 struct vectorlike_header member. All uses of "size" and "next" members
14188 changed to be "header.size" and "header.next".
14189 * buffer.h (struct buffer): Likewise.
14190 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14191 * frame.h (struct frame): Likewise.
14192 * process.h (struct Lisp_Process): Likewise.
14193 * termhooks.h (struct terminal): Likewise.
14194 * window.c (struct save_window_data, struct saved_window): Likewise.
14195 * window.h (struct window): Likewise.
14196 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14197 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14198 * buffer.c (init_buffer_once): Likewise.
14199 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14200 special case.
14201 * process.c (Fformat_network_address): Use local var for size,
14202 for brevity.
14203
14204 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14205
14206 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14207 * data.c (atof): Remove decl; no longer used or needed.
14208 (digit_to_number): Move to lread.c.
14209 (Fstring_to_number): Use new string_to_number function, to be
14210 consistent with how the Lisp reader treats infinities and NaNs.
14211 Do not assume that floating-point numbers represent EMACS_INT
14212 without losing information; this is not true on most 64-bit hosts.
14213 Avoid double-rounding errors, by insisting on integers when
14214 parsing non-base-10 numbers, as the documentation specifies.
14215 * lisp.h (string_to_number): New decl, replacing ...
14216 (isfloat_string): Remove.
14217 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14218 (read1): Do not accept +. and -. as integers; this
14219 appears to have been a coding error. Similarly, do not accept
14220 strings like +-1e0 as floating point numbers. Do not report
14221 overflow for integer overflows unless the base is not 10 which
14222 means we have no simple and reliable way to continue.
14223 Break out the floating-point parsing into a new
14224 function string_to_number, so that Fstring_to_number parses
14225 floating point numbers consistently with the Lisp reader.
14226 (digit_to_number): Move here from data.c. Make it static inline.
14227 (E_CHAR, EXP_INT): Remove, replacing with ...
14228 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14229 (string_to_number): New function, replacing isfloat_string.
14230 This function checks for valid syntax and produces the resulting
14231 Lisp float number too. Rework it so that string-to-number
14232 no longer mishandles examples like "1.0e+". Use strtoumax,
14233 so that overflow for non-base-10 numbers is reported only when
14234 there's no portable and simple way to convert to floating point.
14235
14236 * textprop.c (set_text_properties_1): Rewrite for clarity,
14237 and to avoid GCC warning about integer overflow.
14238
14239 * intervals.h (struct interval): Use EMACS_INT for members
14240 where EMACS_UINT might cause problems. See
14241 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14242 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14243 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14244 All uses changed.
14245 (offset_intervals): Tell GCC not to worry about length overflow
14246 when negating a negative length.
14247
14248 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14249 (overrun_check_free): Likewise.
14250
14251 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14252 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14253 word size.
14254
14255 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14256 (gnutls_make_error): Rename local to avoid shadowing.
14257 (gnutls_emacs_global_deinit): ifdef out; not used.
14258 (Fgnutls_boot): Use const for pointer to readonly storage.
14259 Comment out unused local. Fix pointer signedness problems.
14260
14261 * lread.c (openp): Don't stuff size_t into an 'int'.
14262 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14263 about possible signed overflow.
14264
14265 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14266 (GDK_KEY_g): Don't define if already defined.
14267 (xg_prepare_tooltip): Avoid pointer signedness problem.
14268 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14269
14270 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14271 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14272
14273 * xfns.c (Fx_window_property): Simplify a bit,
14274 to make a bit faster and to avoid GCC 4.6.0 warning.
14275 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14276
14277 * fns.c (internal_equal): Don't assume size_t fits in int.
14278
14279 * alloc.c (compact_small_strings): Tighten assertion a little.
14280
14281 Replace pEd with more-general pI, and fix some printf arg casts.
14282 * lisp.h (pI): New macro, generalizing old pEd macro to other
14283 conversion specifiers. For example, use "...%"pI"d..." rather
14284 than "...%"pEd"...".
14285 (pEd): Remove. All uses replaced with similar uses of pI.
14286 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14287 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14288 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14289 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14290 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14291 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14292 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14293 64-bit hosts.
14294 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14295 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14296 * print.c (safe_debug_print, print_object): Likewise.
14297 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14298 to int.
14299 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14300 avoiding the 0 flag, which is not portable.
14301 * process.c (Fmake_network_process): Use pI to avoid cast.
14302 * region-cache.c (pp_cache): Likewise.
14303 * xdisp.c (decode_mode_spec): Likewise.
14304 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14305 behavior on 64-bit hosts with printf arg.
14306 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14307 (x_stop_queuing_selection_requests): Likewise.
14308 (x_get_window_property): Don't truncate byte count to an 'int'
14309 when tracing.
14310
14311 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14312 here, since it parses constructs like leading '-' and spaces,
14313 which are not wanted; and it overflows with large numbers.
14314 Instead, simply match F[0-9]+, which is what is wanted anyway.
14315
14316 * alloc.c: Remove unportable assumptions about struct layout.
14317 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14318 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14319 (allocate_vectorlike, make_pure_vector): Use the new macros,
14320 plus offsetof, to remove unportable assumptions about struct layout.
14321 These assumptions hold on all porting targets that I know of, but
14322 they are not guaranteed, they're easy to remove, and removing them
14323 makes further changes easier.
14324
14325 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14326 This doesn't fix a bug but makes the code clearer.
14327 (string_overrun_cookie): Now const. Use initializers that
14328 don't formally overflow signed char, to avoid warnings.
14329 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14330 can cause Emacs to crash when string overrun checking is enabled.
14331 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14332 multiple of sizeof (EMACS_INT); it need not be, if
14333 alignof(EMACS_INT) < sizeof (EMACS_INT).
14334 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14335
14336 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14337
14338 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14339
14340 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14341
14342 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14343 supposed to be handshaking. (Bug#8556)
14344 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14345
14346 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14347
14348 * lisp.h (Qdebug): List symbol.
14349 * eval.c (Qdebug): Restore global linkage.
14350 * keyboard.c (debug-on-event): New variable.
14351 (handle_user_signal): Break into debugger when debug-on-event
14352 matches the current signal symbol.
14353
14354 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14355
14356 * alloc.c (check_sblock, check_string_bytes)
14357 (check_string_free_list): Convert to standard C.
14358
14359 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14360
14361 * w32.c (emacs_gnutls_push): Fix typo.
14362
14363 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14364
14365 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14366 "cast to pointer from integer of different size".
14367
14368 Improve doprnt and its use in verror. (Bug#8545)
14369 * doprnt.c (doprnt): Document the set of format control sequences
14370 supported by the function. Use SAFE_ALLOCA instead of always
14371 using `alloca'.
14372
14373 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14374 is one byte too soon. Don't use xrealloc; instead xfree and
14375 xmalloc anew.
14376
14377 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14378
14379 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14380 callbacks stage.
14381
14382 * gnutls.c: Renamed global_initialized to
14383 gnutls_global_initialized. Added internals for the
14384 :verify-hostname-error, :verify-error, and :verify-flags
14385 parameters of `gnutls-boot' and documented those parameters in the
14386 docstring. Start callback support.
14387 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14388 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14389 on error. Return error code.
14390 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14391 (emacs_gnutls_read): Likewise.
14392 (Fgnutls_boot): Return handshake error code.
14393 (emacs_gnutls_handle_error): New function.
14394 (wsaerror_to_errno): Likewise.
14395
14396 * w32.h (emacs_gnutls_pull): Add prototype.
14397 (emacs_gnutls_push): Likewise.
14398
14399 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14400 (emacs_gnutls_push): Likewise.
14401
14402 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14403
14404 * process.c (wait_reading_process_output): Check if GnuTLS
14405 buffered some data internally if no FDs are set for TLS
14406 connections.
14407
14408 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14409 (LIBS): Link to USER_LIBS.
14410 ($(BLD)/gnutls.$(0)): New target.
14411
14412 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14413
14414 * xdisp.c (handle_single_display_spec): Rename the
14415 display_replaced_before_p argument into display_replaced_p, to
14416 make it consistent with the commentary. Fix typos in the
14417 commentary.
14418
14419 * textprop.c (syms_of_textprop): Remove dead code.
14420 (copy_text_properties): Delete obsolete commentary about an
14421 interface that was deleted long ago. Fix typos in the description
14422 of arguments.
14423
14424 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14425 to changes in oldXMenu/XMenu.h from 2011-04-16.
14426 <menu_help_message, prev_menu_help_message>: Constify.
14427 (IT_menu_make_room): menu->help_text is now `const char **';
14428 adjust.
14429
14430 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14431 to changes in oldXMenu/XMenu.h from 2011-04-16.
14432 (struct XMenu): Declare `help_text' `const char **'.
14433
14434 * xfaces.c <Qunspecified>: Make extern again.
14435
14436 * syntax.c: Include sys/types.h before including regex.h, as
14437 required by POSIX.
14438
14439 * doc.c (get_doc_string): Improve the format passed to `error'.
14440
14441 * doprnt.c (doprnt): Improve commentary.
14442
14443 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14444
14445 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14446 them with etags.
14447
14448 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14449 changes in globals.h immediately force recompilation.
14450 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14451 $(CURDIR)/s/ms-w32.h.
14452 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
14453
14454 * character.c (Fchar_direction): Function deleted.
14455 (syms_of_character): Don't defsubr it.
14456 <char-direction-table>: Deleted.
14457
14458 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14459
14460 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14461 * doprnt.c: Include limits.h.
14462 (SIZE_MAX): New macro.
14463 (doprnt): Return a size_t value. 2nd arg is now size_t.
14464 Many local variables are now size_t instead of int or unsigned.
14465 Improve overflow protection. Support `l' modifier for integer
14466 conversions. Support %l conversion. Don't assume an EMACS_INT
14467 argument for integer conversions and for %c.
14468
14469 * lisp.h (doprnt): Restore prototype.
14470
14471 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14472 $(SRC)/character.h.
14473
14474 * Makefile.in (base_obj): Add back doprnt.o.
14475
14476 * deps.mk (doprnt.o): Add back prerequisites.
14477 (callint.o): Depend on character.h.
14478
14479 * eval.c (internal_lisp_condition_case): Include the handler
14480 representation in the error message.
14481 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
14482 when breaking from the loop.
14483
14484 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14485
14486 * callint.c (Fcall_interactively): When displaying error message
14487 about invalid control letter, pass the character's codepoint, not
14488 a pointer to its multibyte form. Improve display of the character
14489 in octal and display also its hex code.
14490
14491 * character.c (char_string): Use %x to display the (unsigned)
14492 codepoint of an invalid character, to avoid displaying a bogus
14493 negative value.
14494
14495 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14496 `error', not SYMBOL_NAME itself.
14497
14498 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14499 character arguments to `error'.
14500
14501 * charset.c (check_iso_charset_parameter): Fix incorrect argument
14502 to `error' in error message about FINAL_CHAR argument. Make sure
14503 FINAL_CHAR is a character, and use %c when it is passed as
14504 argument to `error'.
14505
14506 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14507
14508 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14509
14510 * w32.c: Include <time.h>.
14511 (sys_localtime): New function.
14512
14513 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
14514
14515 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14516
14517 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
14518
14519 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
14520
14521 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14522 zombies (Bug#8467).
14523
14524 2011-04-19 Eli Zaretskii <eliz@gnu.org>
14525
14526 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14527 gl_state.e_property when gl_state.object is Qt.
14528
14529 * insdel.c (make_gap_larger): Remove limitation of buffer size
14530 to <= INT_MAX.
14531
14532 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
14533
14534 * xdisp.c (lookup_glyphless_char_display)
14535 (produce_glyphless_glyph): Handle cons cell entry in
14536 glyphless-char-display.
14537 (Vglyphless_char_display): Document it.
14538
14539 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14540 glyphless-char-display.
14541
14542 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
14543
14544 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14545
14546 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14547
14548 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14549 definition for no-X builds.
14550
14551 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
14552
14553 Static checks with GCC 4.6.0 and non-default toolkits.
14554
14555 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14556
14557 * process.c (keyboard_bit_set): Define only if SIGIO.
14558 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14559 (send_process): Repair possible setjmp clobbering.
14560
14561 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14562
14563 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14564
14565 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14566
14567 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14568 Define only if needed.
14569
14570 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14571 by pacifying GCC about it. Maybe it's time to retire it?
14572 * xfaces.c (USG, __TIMEVAL__): Likewise.
14573
14574 * dispextern.h (struct redisplay_interface): Rename param
14575 to avoid shadowing.
14576 * termhooks.h (struct terminal): Likewise.
14577 * xterm.c (xembed_send_message): Likewise.
14578
14579 * insdel.c (make_gap_smaller): Define only if
14580 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14581
14582 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14583 it.
14584
14585 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14586 so that we aren't warned about unused symbols.
14587
14588 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14589
14590 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
14591
14592 * xfns.c (x_real_positions): Mark locals as initialized.
14593
14594 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14595
14596 * xterm.c: Fix problems found by static analysis with other toolkits.
14597 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
14598 (x_dispatch_event): Declare static if USE_GTK, and
14599 define if USE_GTK || USE_X_TOOLKIT.
14600 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
14601 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
14602 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14603 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
14604
14605 * xmenu.c (menu_help_callback): Pointer type fixes.
14606 Use const pointers when pointing at readonly data. Avoid pointer
14607 signedness clashes.
14608 (FALSE): Remove unused macro.
14609 (update_frame_menubar): Remove unused decl.
14610
14611 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14612
14613 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14614 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14615 (single_menu_item): Rename local to avoid shadowing.
14616
14617 * keyboard.c (make_lispy_event): Remove unused local var.
14618
14619 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14620 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14621
14622 * bitmaps: Change bitmaps from unsigned char back to the X11
14623 compatible char. Avoid the old compiler warnings about
14624 out-of-range initializers by using, for example, '\xab' rather
14625 than 0xab.
14626
14627 * xgselect.c (xgselect_initialize): Check vs interface
14628 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14629
14630 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14631
14632 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14633 to read-only memory.
14634
14635 * fns.c (vector): Remove; this old hack is no longer needed.
14636
14637 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
14638 Remove unused var.
14639 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
14640
14641 * xrdb.c (x_load_resources): Omit unused local.
14642
14643 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
14644 (x_window): Rename locals to avoid shadowing.
14645 (USG): Use the kludged USG macro, to pacify gcc.
14646
14647 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
14648 (x_term_init): Remove local to avoid shadowing.
14649
14650 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
14651
14652 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14653 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14654
14655 2011-04-16 Eli Zaretskii <eliz@gnu.org>
14656
14657 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14658
14659 Fix regex.c, syntax.c and friends for buffers > 2GB.
14660 * syntax.h (struct gl_state_s): Declare character position members
14661 EMACS_INT.
14662
14663 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14664
14665 * textprop.c (verify_interval_modification, interval_of):
14666 Declare arguments EMACS_INT.
14667
14668 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14669 EMACS_INT.
14670
14671 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14672
14673 * indent.c (Fvertical_motion): Local variable it_start is now
14674 EMACS_INT.
14675
14676 * regex.c (re_match, re_match_2, re_match_2_internal)
14677 (bcmp_translate, regcomp, regexec, print_double_string)
14678 (group_in_compile_stack, re_search, re_search_2, regex_compile)
14679 (re_compile_pattern, re_exec): Declare arguments and local
14680 variables `size_t' and `ssize_t' and return values `regoff_t', as
14681 appropriate.
14682 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14683 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14684 <compile_stack_type>: `size' and `avail' are now `size_t'.
14685
14686 * regex.h <regoff_t>: Use ssize_t, not int.
14687 (re_search, re_search_2, re_match, re_match_2): Arguments that
14688 specify buffer/string position and length are now ssize_t and
14689 size_t. Return type is regoff_t.
14690
14691 2011-04-16 Ben Key <bkey76@gmail.com>
14692
14693 * nsfont.m: Fixed bugs in ns_get_family and
14694 ns_descriptor_to_entity that were caused by using free to
14695 deallocate memory blocks that were allocated by xmalloc (via
14696 xstrdup). This caused Emacs to crash when compiled with
14697 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14698 --enable-checking=xmallocoverrun). xfree is now used to
14699 deallocate these memory blocks.
14700
14701 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
14702
14703 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14704
14705 emacs_write: Accept and return EMACS_INT for sizes.
14706 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14707 et seq.
14708 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14709 Accept and return EMACS_INT.
14710 (emacs_gnutls_write): Return the number of bytes written on
14711 partial writes.
14712 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
14713 (emacs_read, emacs_write): Remove check for negative size, as the
14714 Emacs source code has been audited now.
14715 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14716 (emacs_read, emacs_write): Use it.
14717 * process.c (send_process): Adjust to the new signatures of
14718 emacs_write and emacs_gnutls_write. Do not attempt to store
14719 a byte offset into an 'int'; it might overflow.
14720 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
14721
14722 * sound.c: Don't assume sizes fit in 'int'.
14723 (struct sound_device.period_size, alsa_period_size):
14724 Return EMACS_INT, not int.
14725 (struct sound_device.write, vox_write, alsa_write):
14726 Accept EMACS_INT, not int.
14727 (wav_play, au_play): Use EMACS_INT to store sizes and to
14728 record read return values.
14729
14730 2011-04-15 Ben Key <bkey76@gmail.com>
14731
14732 * keyboard.c (Qundefined): Don't declare static since it is used
14733 in nsfns.m.
14734 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14735 static since they are used in nsfont.m.
14736
14737 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14738
14739 * process.c (Qprocessp): Don't declare static.
14740 * lisp.h (Qprocessp): Declare again.
14741
14742 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
14743
14744 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14745
14746 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14747
14748 Improve C-level modularity by making more things 'static'.
14749
14750 Don't publish debugger-only interfaces to other modules.
14751 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14752 (verify_bytepos, count_markers): Move decls to the only modules
14753 that need them.
14754 * region-cache.h (pp_cache): Likewise.
14755 * window.h (check_all_windows): Likewise.
14756 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14757
14758 * sysdep.c (croak): Now static, if
14759 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14760 * syssignal.h (croak): Declare only if not static.
14761
14762 * alloc.c (refill_memory_reserve): Now static if
14763 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14764 * lisp.h (refill_memory_reserve): Declare only if not static.
14765
14766 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14767 Define only if USE_LUCID.
14768
14769 * xrdb.c (x_customization_string, x_rm_string): Now static.
14770
14771 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14772 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14773
14774 * xdisp.c (draw_row_with_mouse_face): Now static.
14775 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14776
14777 * window.h (check_all_windows): Mark externally visible.
14778
14779 * window.c (window_deletion_count): Now static.
14780
14781 * undo.c: Make symbols static if they're not exported.
14782 (last_undo_buffer, last_boundary_position, pending_boundary):
14783 Now static.
14784
14785 * textprop.c (interval_insert_behind_hooks): Now static.
14786 (interval_insert_in_front_hooks): Likewise.
14787
14788 * term.c: Make symbols static if they're not exported.
14789 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14790 (max_frame_lines, tty_set_terminal_modes):
14791 (tty_reset_terminal_modes, tty_turn_off_highlight):
14792 (get_tty_terminal): Now static.
14793 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14794 * termhooks.h (term_mouse_moveto): Do not declare if
14795 HAVE_WINDOW_SYSTEM.
14796 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14797 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14798
14799 * sysdep.c: Make symbols static if they're not exported.
14800 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14801 Now static.
14802 (sigprocmask_set, full_mask): Remove; unused.
14803 (wait_debugging): Mark as visible.
14804 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14805 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14806
14807 * syntax.c (syntax_temp): Define only if !__GNUC__.
14808
14809 * sound.c (current_sound_device, current_sound): Now static.
14810
14811 * search.c (searchbufs, searchbuf_head): Now static.
14812
14813 * scroll.c (scroll_cost): Remove; unused.
14814 * dispextern.h (scroll_cost): Remove decl.
14815
14816 * region-cache.h (pp_cache): Mark as externally visible.
14817
14818 * process.c: Make symbols static if they're not exported.
14819 (process_tick, update_tick, create_process, chan_process):
14820 (Vprocess_alist, proc_buffered_char, datagram_access):
14821 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14822 (deactivate_process): Mark defn as static, as well as decl.
14823 * lisp.h (create_process): Remove decl.
14824 * process.h (chan_process, Vprocess_alist): Remove decls.
14825
14826 * print.c: Make symbols static if they're not exported.
14827 (print_depth, new_backquote_output, being_printed, print_buffer):
14828 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14829 (print_interval, print_number_index, initial_stderr_stream):
14830 Now static.
14831 * lisp.h (Fprinc): Remove decl.
14832 (debug_output_compilation_hack): Mark as externally visible.
14833
14834 * sysdep.c (croak): Move decl from here to syssignal.h.
14835 * syssignal.h (croak): Put it here, so the API can be checked when
14836 'croak' is called from dissociate_if_controlling_tty.
14837
14838 * minibuf.c: Make symbols static if they're not exported.
14839 (minibuf_save_list, choose_minibuf_frame): Now static.
14840 * lisp.h (choose_minibuf_frame): Remove decl.
14841
14842 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14843
14844 * lread.c: Make symbols static if they're not exported.
14845 (read_objects, initial_obarray, oblookup_last_bucket_number):
14846 Now static.
14847 (make_symbol): Remove; unused.
14848 * lisp.h (initial_obarray, make_symbol): Remove decls.
14849
14850 * keyboard.c: Make symbols static if they're not exported.
14851 (single_kboard, recent_keys_index, total_keys, recent_keys):
14852 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14853 (this_single_command_key_start, echoing, last_auto_save):
14854 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14855 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14856 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14857 (Vlispy_mouse_stem, double_click_count):
14858 Now static.
14859 (force_auto_save_soon): Define only if SIGDANGER.
14860 (ignore_mouse_drag_p): Now static if
14861 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14862 (print_help): Remove; unused.
14863 (stop_character, last_timer_event): Mark as externally visible.
14864 * keyboard.h (ignore_mouse_drag_p): Declare only if
14865 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14866 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14867 * lisp.h (echoing): Remove decl.
14868 (force_auto_save_soon): Declare only if SIGDANGER.
14869 * xdisp.c (redisplay_window): Simplify code, to make it more
14870 obvious that ignore_mouse_drag_p is not accessed if !defined
14871 USE_GTK && !defined HAVE_NS.
14872
14873 * intervals.c: Make symbols static if they're not exported.
14874 (merge_properties_sticky, merge_interval_right, delete_interval):
14875 Now static.
14876 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14877
14878 * insdel.c: Make symbols static if they're not exported.
14879 However, leave prepare_to_modify_buffer alone. It's never
14880 called from outside this function, but that appears to be a bug.
14881 (combine_after_change_list, combine_after_change_buffer):
14882 (adjust_after_replace, signal_before_change): Now static.
14883 (adjust_after_replace_noundo): Remove; unused.
14884 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
14885 (signal_before_change): Remove decls.
14886
14887 * indent.c (val_compute_motion, val_vmotion): Now static.
14888
14889 * image.c: Make symbols static if they're not exported.
14890 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14891 if USE_GTK.
14892 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14893 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14894
14895 * fringe.c (standard_bitmaps): Now static.
14896 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14897
14898 * frame.c: Make symbols static if they're not exported.
14899 (x_report_frame_params, make_terminal_frame): Now static.
14900 (get_frame_param): Now static, unless HAVE_NS.
14901 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14902 (x_get_resource_string): Remove; not used.
14903 * frame.h (make_terminal_frame, x_report_frame_params):
14904 (x_get_resource_string); Remove decls.
14905 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14906 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14907
14908 * font.c, fontset.c: Make symbols static if they're not exported.
14909 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14910 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14911 * font.c (font_close_object): Now static.
14912 * font.h (font_close_object): Remove.
14913 * fontset.c (FONTSET_OBJLIST): Remove.
14914 (free_realized_fontset) #if-0 the body, which does nothing.
14915 (face_suitable_for_char_p): #if-0, as it's never called.
14916 * fontset.h (face_suitable_for_char_p): Remove decl.
14917 * xfaces.c (face_at_string_position):
14918 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
14919 since 0 is always ASCII.
14920
14921 * fns.c (weak_hash_tables): Now static.
14922
14923 * fileio.c: Make symbols static if they're not exported.
14924 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14925 (Vwrite_region_annotation_buffers): Now static.
14926
14927 * eval.c: Make symbols static if they're not exported.
14928 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14929 * lisp.h (backtrace_list): Remove decl.
14930
14931 * emacs.c: Make symbols static if they're not exported.
14932 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14933 (fatal_error_code, fatal_error_signal_hook, standard_args):
14934 Now static.
14935 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14936 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14937 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14938 * lisp.h (fatal_error_signal_hook): Remove decl.
14939 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14940
14941 * editfns.c: Move a (normally-unused) function to its only use.
14942 * editfns.c, lisp.h (get_operating_system_release): Remove.
14943 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14944 worth the hassle of breaking this out.
14945
14946 * xterm.c: Make symbols static if they're not exported.
14947 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14948 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14949 (x_destroy_window, x_delete_display):
14950 Now static.
14951 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14952 (x_mouse_leave): Remove; unused.
14953 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14954 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14955 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14956 Remove decls.
14957 (x_mouse_leave): Declare only if WINDOWSNT.
14958 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14959 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14960 USE_X_TOOLKIT.
14961
14962 * ftxfont.c: Make symbols static if they're not exported.
14963 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14964 HAVE_FREETYPE.
14965 * font.h (ftxfont_driver): Likewise.
14966
14967 * xfns.c: Make symbols static if they're not exported.
14968 (x_last_font_name, x_display_info_for_name):
14969 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14970 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14971 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14972 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14973 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14974 (last_show_tip_args): Now static.
14975 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14976 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14977 (x_screen_planes): Remove; unused.
14978 * dispextern.h (x_screen_planes): Remove decl.
14979
14980 * dispnew.c: Make symbols static if they're not exported.
14981 * dispextern.h (redraw_garbaged_frames, scrolling):
14982 (increment_row_positions): Remove.
14983 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14984 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14985 Now static.
14986 (redraw_garbaged_frames): Remove; unused.
14987
14988 * xfaces.c: Make symbols static if they're not exported.
14989 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14990 Remove decls.
14991 * xterm.h (defined_color): Remove decls.
14992 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14993 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14994 (menu_face_changed_default, defined_color, free_realized_face):
14995 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14996 (ascii_face_of_lisp_face): Remove; unused.
14997
14998 * xdisp.c: Make symbols static if they're not exported.
14999 * dispextern.h (scratch_glyph_row, window_box_edges):
15000 (glyph_to_pixel_coords, set_cursor_from_row):
15001 (get_next_display_element, set_iterator_to_next):
15002 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15003 (show_mouse_face): Remove decls
15004 * frame.h (message_buf_print): Likewise.
15005 * lisp.h (pop_message, set_message, check_point_in_composition):
15006 Likewise.
15007 * xterm.h (set_vertical_scroll_bar): Likewise.
15008 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15009 (message_buf_print, scratch_glyph_row, displayed_buffer):
15010 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15011 (get_next_display_element, show_mouse_face, window_box_edges):
15012 (frame_to_window_pixel_xy, check_point_in_composition):
15013 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15014 (glyph_to_pixel_coords): Remove; unused.
15015
15016 * dired.c (file_name_completion): Now static.
15017
15018 * dbusbind.c (xd_in_read_queued_messages): Now static.
15019
15020 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15021 * data.c (circular_list_error): Remove.
15022
15023 * commands.h (last_point_position, last_point_position_buffer):
15024 (last_point_position_window): Remove decls.
15025 * keyboard.c: Make these variables static.
15026
15027 * coding.h (coding, code_convert_region, encode_coding_gap):
15028 Remove decls.
15029 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15030 (iso_code_class, detect_coding, code_convert_region): Now static.
15031 (encode_coding_gap): Remove; unused.
15032
15033 * chartab.c (chartab_chars, chartab_bits): Now static.
15034
15035 * charset.h (charset_iso_8859_1): Remove decl.
15036 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15037 Now static.
15038
15039 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15040 * ccl.c (Vccl_program_table): Now static.
15041 (check_ccl_update): Remove; unused.
15042
15043 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15044 * category.h: ... from here.
15045 * category.c (check_category_table, set_category_set): Now static.
15046
15047 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15048 * lisp.h: Remove these decls.
15049
15050 * buffer.c (buffer_count): Remove unused var.
15051
15052 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15053 so that it's not optimized away.
15054 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15055 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15056 exported only to the debugger.
15057
15058 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15059 * atimer.h (run_all_atimers): Remove; not exported.
15060
15061 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15062 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15063 was inaccessible from Lisp.
15064 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15065 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15066
15067 alloc.c: Import and export fewer symbols, and remove unused items.
15068 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15069 is defined.
15070 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15071 it's not optimized away by whole-program optimization.
15072 (message_enable_multibyte, free_misc): Remove.
15073 (catchlist, handlerlist, mark_backtrace):
15074 Declare only if BYTE_MARK_STACK.
15075 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15076 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15077 (message_enable_multibyte): Remove decl.
15078 (free_misc, interval_free_list, float_block, float_block_index):
15079 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15080 (cons_free_list, last_marked_index):
15081 Now static.
15082 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15083 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15084 (mark_backtrace): Define only if BYTE_MARK_STACK.
15085 * xdisp.c (message_enable_multibyte): Now static.
15086
15087 Declare Lisp_Object Q* variables to be 'static' if not exported.
15088 This makes it easier for human readers (and static analyzers)
15089 to see whether these variables are used from other modules.
15090 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15091 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15092 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15093 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15094 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15095 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15096 * xmenu.c, xselect.c:
15097 Declare Q* vars static if they are not used in other modules.
15098 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15099 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15100 Remove decls of unexported vars.
15101 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15102
15103 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15104
15105 Make Emacs functions such as Fatom 'static' by default.
15106 This makes it easier for human readers (and static analyzers)
15107 to see whether these functions can be called from other modules.
15108 DEFUN now defines a static function. To make the function external
15109 so that it can be used in other C modules, use the new macro DEFUE.
15110 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15111 (Finit_image_library):
15112 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15113 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15114 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15115 Remove decls, since these functions are now static.
15116 (Funintern, Fget_internal_run_time): New decls, since these functions
15117 were already external.
15118
15119 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15120 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15121 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15122 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15123 * keyboard.c, keymap.c, lread.c:
15124 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15125 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15126 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15127 Mark functions with DEFUE instead of DEFUN,
15128 if they are used in other modules.
15129 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15130 decls for now-static functions.
15131 * buffer.h (Fdelete_overlay): Remove decl.
15132 * callproc.c (Fgetenv_internal): Mark as internal.
15133 * composite.c (Fremove_list_of_text_properties): Remove decl.
15134 (Fcomposition_get_gstring): New forward static decl.
15135 * composite.h (Fcomposite_get_gstring): Remove decl.
15136 * dired.c (Ffile_attributes): New forward static decl.
15137 * doc.c (Fdocumntation_property): New forward static decl.
15138 * eval.c (Ffetch_bytecode): New forward static decl.
15139 (Funintern): Remove extern decl; now in .h file where it belongs.
15140 * fileio.c (Fmake_symbolic_link): New forward static decl.
15141 * image.c (Finit_image_library): New forward static decl.
15142 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15143 * intervals.h (Fprevious_property_change):
15144 (Fremove_list_of_text_properties): Remove decls.
15145 * keyboard.c (Fthis_command_keys): Remove decl.
15146 (Fcommand_execute): New forward static decl.
15147 * keymap.c (Flookup_key): New forward static decl.
15148 (Fcopy_keymap): Now static.
15149 * keymap.h (Flookup_key): Remove decl.
15150 * process.c (Fget_process): New forward static decl.
15151 (Fprocess_datagram_address): Mark as internal.
15152 * syntax.c (Fsyntax_table_p): New forward static decl.
15153 (skip_chars): Remove duplicate decl.
15154 * textprop.c (Fprevious_property_change): New forward static decl.
15155 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15156 Now internal.
15157 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15158 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15159
15160 * editfns.c (Fformat): Remove unreachable code.
15161
15162 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15163
15164 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15165 change. (Bug#8496)
15166
15167 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15168
15169 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15170 when at ZV. (Bug#8487)
15171
15172 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15173
15174 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15175 (Bug#8437)
15176 * keyboard.c (parse_tool_bar_item): Likewise.
15177 * sound.c (sound_cleanup, alsa_close): Likewise.
15178 * termcap.c (tgetent): Likewise.
15179 * xfns.c (x_default_font_parameter): Likewise.
15180 * xsettings.c (read_and_apply_settings): Likewise.
15181
15182 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15183 (overrun_check_free): Protoize.
15184
15185 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15186
15187 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15188 since callers should never pass a negative size.
15189 Change the signature to match that of plain 'read' and 'write'; see
15190 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15191 * lisp.h: Update prototypes of emacs_write and emacs_read.
15192
15193 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15194
15195 * xdisp.c (redisplay_window): Don't try to determine the character
15196 position of the scroll margin if the window start point w->startp
15197 is outside the buffer's accessible region. (Bug#8468)
15198
15199 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15200
15201 Fix write-region and its subroutines for buffers > 2GB.
15202 * fileio.c (a_write, e_write): Modify declaration of arguments and
15203 local variables to support buffers larger than 2GB.
15204 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15205
15206 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15207 argument, local variables, and return value.
15208
15209 * lisp.h: Update prototypes of emacs_write and emacs_read.
15210
15211 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15212
15213 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15214
15215 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15216
15217 Fix more problems found by GCC 4.6.0's static checks.
15218
15219 * xdisp.c (vmessage): Use a better test for character truncation.
15220
15221 * charset.c (load_charset_map): <, not <=, for optimization,
15222 and to avoid potential problems with integer overflow.
15223 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15224 * casetab.c (set_identity, shuffle): Likewise.
15225 * editfns.c (Fformat): Likewise.
15226 * syntax.c (skip_chars): Likewise.
15227
15228 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15229 This also lets GCC 4.6.0 generate slightly better loop code.
15230
15231 * callint.c (Fcall_interactively): <, not <=, for optimization.
15232 (Fcall_interactively): Count the number of arguments produced,
15233 not the number of arguments given. This is simpler and lets GCC
15234 4.6.0 generate slightly better code.
15235
15236 * ftfont.c: Distingish more carefully between FcChar8 and char.
15237 The previous code passed unsigned char * to a functions like
15238 strlen and xstrcasecmp that expect char *, which does not
15239 conform to the C standard.
15240 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15241 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15242 char * when the C standard requires it.
15243
15244 * keyboard.c (read_char): Remove unused var.
15245
15246 * eval.c: Port to Windows vsnprintf (Bug#8435).
15247 Include <limits.h>.
15248 (SIZE_MAX): Define if the headers do not.
15249 (verror): Do not give up if vsnprintf returns a negative count.
15250 Instead, grow the buffer. This ports to Windows vsnprintf, which
15251 does not conform to C99. Problem reported by Eli Zaretskii.
15252 Also, simplify the allocation scheme, by avoiding the need for
15253 calling realloc, and removing the ALLOCATED variable.
15254
15255 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15256
15257 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15258 But keep the doprint source code for now, as we might revamp it
15259 and use it again (Bug#8435).
15260 * lisp.h (doprnt): Remove.
15261 * Makefile.in (base_obj): Remove doprnt.o.
15262 * deps.mk (doprnt.o): Remove.
15263
15264 error: Print 32- and 64-bit integers portably (Bug#8435).
15265 Without this change, on typical 64-bit hosts error ("...%d...", N)
15266 was used to print both 32- and 64-bit integers N, which relied on
15267 undefined behavior.
15268 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15269 * lisp.h (error, verror): Mark as printf-like functions.
15270 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15271 Report overflow in size calculations when allocating printf buffer.
15272 Do not truncate output string at its first null byte.
15273 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15274 Truncate the output at a character boundary, since vsnprintf does not
15275 do that.
15276 * charset.c (check_iso_charset_parameter): Convert internal
15277 character to string before calling 'error', since %c now has the
15278 printf meaning.
15279 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15280 overflow when computing char to be passed to 'error'. Do not
15281 pass Lisp_Object to 'error'; pass the integer instead.
15282 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15283 formatted with plain %d.
15284
15285 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15286
15287 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15288
15289 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15290
15291 * xterm.c (x_catch_errors): Remove duplicate declaration.
15292
15293 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15294
15295 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15296
15297 2011-04-10 Jim Meyering <meyering@redhat.com>
15298
15299 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15300 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15301 return ssize_t not "int", and use size_t as the buffer length.
15302 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15303 * gnutls.h: Update declarations.
15304 * process.c (read_process_output): Use ssize_t, to match.
15305 (send_process): Likewise.
15306
15307 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15308
15309 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15310
15311 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15312
15313 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15314 Use unsigned char, to match FcChar8 type definition.
15315
15316 * xterm.c (handle_one_xevent):
15317 * xmenu.c (create_and_show_popup_menu):
15318 * xselect.c (x_decline_selection_request)
15319 (x_reply_selection_request): Avoid type-punned deref of X events.
15320
15321 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15322
15323 Fix some uses of `int' instead of EMACS_INT.
15324 * search.c (string_match_1, fast_string_match)
15325 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15326 (scan_buffer, find_next_newline_no_quit)
15327 (find_before_next_newline, search_command, Freplace_match)
15328 (Fmatch_data): Make some `int' variables be EMACS_INT.
15329
15330 * xdisp.c (display_count_lines): 3rd argument and return value now
15331 EMACS_INT. All callers changed.
15332 (pint2hrstr): Last argument is now EMACS_INT.
15333
15334 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15335 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15336 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15337 (decode_coding_utf_16, decode_coding_emacs_mule)
15338 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15339 (decode_coding_ccl, decode_coding_charset)
15340 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15341 (decode_coding_iso_2022, decode_coding_emacs_mule)
15342 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15343 <char_offset, last_offset>: Declare EMACS_INT.
15344 (encode_coding_utf_8, encode_coding_utf_16)
15345 (encode_coding_emacs_mule, encode_invocation_designation)
15346 (encode_designation_at_bol, encode_coding_iso_2022)
15347 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15348 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15349 Declare EMACS_INT.
15350 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15351 (encode_invocation_designation): Last argument P_NCHARS is now
15352 EMACS_INT.
15353 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15354 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15355
15356 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15357 All users changed.
15358
15359 * ccl.c (Fccl_execute_on_string): Declare some variables
15360 EMACS_INT.
15361
15362 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15363
15364 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15365
15366 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15367
15368 * process.c (Fformat_network_address): Doc fix.
15369
15370 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15371
15372 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15373
15374 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15375
15376 * keyboard.c (read_char): Call Lisp function help-form-show,
15377 instead of using internal_with_output_to_temp_buffer.
15378 (Qhelp_form_show): New var.
15379 (syms_of_keyboard): Use DEFSYM macro.
15380
15381 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15382
15383 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15384
15385 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15386
15387 * process.c (Flist_processes): Remove to Lisp.
15388 (list_processes_1): Delete.
15389
15390 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15391
15392 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15393
15394 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15395
15396 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15397
15398 Fix more problems found by GCC 4.6.0's static checks.
15399
15400 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15401
15402 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15403
15404 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15405
15406 * xdisp.c (vmessage): Mark as a printf-like function.
15407
15408 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15409
15410 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15411
15412 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15413 printf-like functions.
15414 (tiff_load): Add casts to remove these marks before passing them
15415 to system-supplied API.
15416
15417 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15418
15419 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15420 This avoids several warnings with gcc -Wstrict-overflow.
15421 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15422 directly, rather than having caller test rule sign. This avoids
15423 some unnecessary tests.
15424 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15425 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15426 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
15427
15428 * xfont.c (xfont_text_extents): Remove var that was set but not used.
15429 (xfont_open): Avoid unnecessary tests.
15430
15431 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15432
15433 * composite.h, composite.c (composition_gstring_put_cache):
15434 Use EMACS_INT, not int, for length.
15435
15436 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15437 breaking out part of COMPOSITION_DECODE_RULE.
15438 (COMPOSITION_DECODE_RULE): Use it.
15439 * composite.c (get_composition_id): Remove unused local vars,
15440 by using the new macro.
15441
15442 * textprop.c (set_text_properties_1): Change while to do-while,
15443 since the condition is always true at first.
15444
15445 * intervals.c (graft_intervals_into_buffer): Mark var as used.
15446 (interval_deletion_adjustment): Return unsigned value.
15447 All uses changed.
15448
15449 * process.c (list_processes_1, create_pty, read_process_output):
15450 (exec_sentinel): Remove vars that were set but not used.
15451 (create_pty): Remove unnecessary "volatile"s.
15452 (Fnetwork_interface_info): Avoid possibility of int overflow.
15453 (read_process_output): Do adaptive read buffering even if carryover.
15454 (read_process_output): Simplify nbytes computation if buffered.
15455
15456 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15457
15458 * syntax.c (scan_words): Remove var that was set but not used.
15459 (update_syntax_table): Use unsigned instead of int.
15460
15461 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
15462 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
15463 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
15464
15465 * print.c (print_error_message): Avoid int overflow.
15466
15467 * font.c (font_list_entities): Redo for clarity,
15468 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15469
15470 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15471 (font_score): Avoid potential overflow in diff calculation.
15472
15473 * fns.c (substring_both): Remove var that is set but not used.
15474 (sxhash): Redo loop for clarity and to avoid wraparound warning.
15475
15476 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15477
15478 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15479 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15480 can always succeed if overflow has undefined behavior.
15481
15482 * search.c (boyer_moore, wordify): Remove vars set but not used.
15483 (wordify): Omit three unnecessary tests.
15484
15485 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15486 All callers changed. This avoids the need for an unused var.
15487
15488 * casefiddle.c (casify_region): Remove var that is set but not used.
15489
15490 * dired.c (file_name_completion): Remove var that is set but not used.
15491
15492 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15493
15494 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
15495 (Finsert_file_contents): Remove unnecessary code checking fd.
15496
15497 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15498 Check for integer overflow on size calculations.
15499
15500 * buffer.c (Fprevious_overlay_change): Remove var that is set
15501 but not used.
15502
15503 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15504 Remove vars that are set but not used.
15505 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
15506 (timer_check_2): Mark vars as initialized.
15507
15508 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15509
15510 * image.c (lookup_image): Remove var that is set but not used.
15511 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
15512
15513 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15514 that are set but not used.
15515
15516 * xfns.c (make_invisible_cursor): Don't return garbage
15517 if XCreateBitmapFromData fails (Bug#8410).
15518
15519 * xselect.c (x_get_local_selection, x_handle_property_notify):
15520 Remove vars that are set but not used.
15521
15522 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
15523 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
15524
15525 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15526 Remove var that is set but not used.
15527 (scroll_bar_windows_size): Now size_t, not int.
15528 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15529 Check for overflow.
15530
15531 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15532 (map_tty_color) [!defined MSDOS]: Likewise.
15533
15534 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15535
15536 * coding.c: Remove vars that are set but not used.
15537 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15538 All callers changed.
15539 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15540 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15541 (decode_coding_charset): Remove vars that are set but not used.
15542
15543 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15544 that is set but not used.
15545
15546 * print.c (print_object): Remove var that is set but not used.
15547
15548 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
15549 The gnulib version avoids calling malloc in the usual case,
15550 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15551 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15552 * filelock.c (current_lock_owner): Likewise.
15553 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15554 * sysdep.c: Include allocator.h, careadlinkat.h.
15555 (emacs_no_realloc_allocator): New static constant.
15556 (emacs_readlink): New function.
15557 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15558 ../lib/careadlinkat.h.
15559
15560 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15561
15562 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15563 first non-nil return value).
15564
15565 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15566
15567 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15568 if not defined (Bug#8403).
15569
15570 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15571
15572 * xdisp.c (display_count_lines): Remove parameter `start',
15573 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15574 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15575 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15576 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15577 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15578 and thereabouts. All callers changed.
15579 (get_per_char_metric): Remove parameter `f', unused since
15580 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15581
15582 2011-04-02 Jim Meyering <meyering@redhat.com>
15583
15584 do not dereference NULL upon failed strdup
15585 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15586 (ns_get_family): Likewise.
15587
15588 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15589
15590 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15591
15592 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15593
15594 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15595 later (Bug#8403).
15596
15597 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15598
15599 Add lexical binding.
15600
15601 * window.c (Ftemp_output_buffer_show): New fun.
15602 (Fsave_window_excursion):
15603 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15604
15605 * lread.c (lisp_file_lexically_bound_p): New function.
15606 (Fload): Bind Qlexical_binding.
15607 (readevalloop): Remove `evalfun' arg.
15608 Bind Qinternal_interpreter_environment.
15609 (Feval_buffer): Bind Qlexical_binding.
15610 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15611 Mark as dynamic.
15612 (syms_of_lread): Declare `lexical-binding'.
15613
15614 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15615
15616 * keyboard.c (eval_dyn): New fun.
15617 (menu_item_eval_property): Use it.
15618
15619 * image.c (parse_image_spec): Use Ffunctionp.
15620
15621 * fns.c (concat, mapcar1): Accept byte-code-functions.
15622
15623 * eval.c (Fsetq): Handle lexical vars.
15624 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
15625 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
15626 (FletX, Flet): Obey lexical binding.
15627 (Fcommandp): Handle closures.
15628 (Feval): New `lexical' arg.
15629 (eval_sub): New function extracted from Feval. Use it almost
15630 everywhere where Feval was used. Look up vars in lexical env.
15631 Handle closures.
15632 (Ffunctionp): Move from subr.el.
15633 (Ffuncall): Handle closures.
15634 (apply_lambda): Remove `eval_flags'.
15635 (funcall_lambda): Handle closures and new byte-code-functions.
15636 (Fspecial_variable_p): New function.
15637 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15638 but without exporting it to Lisp.
15639
15640 * doc.c (Fdocumentation, store_function_docstring):
15641 * data.c (Finteractive_form): Handle closures.
15642
15643 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15644 interactive spec.
15645
15646 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15647 New byte-codes.
15648 (exec_byte_code): New function extracted from Fbyte_code to handle new
15649 calling convention for byte-code-functions. Add new byte-codes.
15650
15651 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
15652
15653 * alloc.c (Fmake_symbol): Init new `declared_special' field.
15654
15655 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15656
15657 * xdisp.c (redisplay_internal): Fix prototype.
15658
15659 2011-03-31 Eli Zaretskii <eliz@gnu.org>
15660
15661 * xdisp.c (SCROLL_LIMIT): New macro.
15662 (try_scrolling): Use it when setting scroll_limit.
15663 Limit scrolling to 100 screen lines.
15664 (redisplay_window): Even when falling back on "recentering",
15665 position point in the window according to scroll-conservatively,
15666 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
15667
15668 (try_scrolling): When point is above the window, allow searching
15669 as far as scroll_max, or one screenful, to compute vertical
15670 distance from PT to the scroll margin position. This prevents
15671 try_scrolling from unnecessarily failing when
15672 scroll-conservatively is set to a value slightly larger than the
15673 window height. Clean up the case of PT below the margin at bottom
15674 of window: scroll_max can no longer be INT_MAX. When aggressive
15675 scrolling is in use, don't let point enter the opposite scroll
15676 margin as result of the scroll.
15677 (syms_of_xdisp) <scroll-conservatively>: Document the
15678 threshold of 100 lines for never-recentering scrolling.
15679
15680 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15681
15682 * dispextern.h (move_it_by_lines):
15683 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15684 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
15685 (message_log_check_duplicate): Remove parameters `prev_bol' and
15686 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15687 (redisplay_internal): Remove parameter `preserve_echo_area',
15688 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
15689
15690 * indent.c (Fvertical_motion):
15691 * window.c (window_scroll_pixel_based, Frecenter):
15692 Don't pass `need_y_p' to `move_it_by_lines'.
15693
15694 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15695
15696 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15697 steal a few bits to be more compact.
15698 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15699 Remove unneeded casts.
15700
15701 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15702
15703 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15704
15705 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15706 binding" message (bug#7967).
15707
15708 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15709
15710 Fix more problems found by GCC 4.6.0's static checks.
15711
15712 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15713 Remove unused local var.
15714
15715 * editfns.c (Fmessage_box): Remove unused local var.
15716
15717 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15718 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15719 Omit unused local vars.
15720 * window.c (shrink_windows): Omit unused local var.
15721 * menu.c (digest_single_submenu): Omit unused local var.
15722 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15723 Omit unused local var.
15724
15725 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15726 Don't assume string length fits in int.
15727 (keyremap_step, read_key_sequence): Use size_t for sizes.
15728 (read_key_sequence): Don't check last_real_key_start redundantly.
15729
15730 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15731 instead of alloca (Bug#8344).
15732
15733 * eval.c (Fbacktrace): Don't assume nargs fits in int.
15734 (Fbacktrace_frame): Don't assume nframes fits in int.
15735
15736 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15737
15738 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15739 concerns.
15740
15741 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15742
15743 * cm.c (calccost): Turn while-do into do-while, for clarity.
15744
15745 * keyboard.c (syms_of_keyboard): Use the same style as later
15746 in this function when indexing through an array. This also
15747 works around GCC bug 48267.
15748
15749 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15750
15751 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15752
15753 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15754 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15755
15756 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15757 This avoids undefined behavior on integer overflow, and is a bit
15758 more convenient anyway since it is compared to a size_t variable.
15759
15760 Variadic C functions now count arguments with size_t, not int.
15761 This avoids an unnecessary limitation on 64-bit machines, which
15762 caused (substring ...) to crash on large vectors (Bug#8344).
15763 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15764 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
15765 All variadic functions and their callers changed accordingly.
15766 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15767 * data.c (arith_driver, float_arith_driver): Likewise.
15768 * editfns.c (general_insert_function): Likewise.
15769 * eval.c (struct backtrace.nargs, interactive_p)
15770 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15771 (funcall_lambda, mark_backtrace): Likewise.
15772 * fns.c (concat): Likewise.
15773 * frame.c (x_set_frame_parameters): Likewise.
15774 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15775 0 if not found, not -1. All callers changed.
15776
15777 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15778 (stack_copy_size): Now size_t, not int.
15779 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15780
15781 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15782
15783 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15784 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15785 All callers changed.
15786
15787 * lisp.h (multibyte_char_to_unibyte):
15788 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15789 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15790 * character.h (CHAR_TO_BYTE8):
15791 * cmds.c (internal_self_insert):
15792 * editfns.c (general_insert_function):
15793 * keymap.c (push_key_description):
15794 * search.c (Freplace_match):
15795 * xdisp.c (message_dolog, set_message_1): All callers changed.
15796
15797 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15798
15799 * keyboard.c (safe_run_hook_funcall): New function.
15800 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15801 don't set the hook to nil, but remove the offending function instead.
15802 (Qcommand_hook_internal): Remove, unused.
15803 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15804 Vcommand_hook_internal.
15805
15806 * eval.c (enum run_hooks_condition): Remove.
15807 (funcall_nil, funcall_not): New functions.
15808 (run_hook_with_args): Call each function through a `funcall' argument.
15809 Remove `cond' argument, now redundant.
15810 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15811 (Frun_hook_with_args_until_failure): Adjust accordingly.
15812 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15813
15814 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15815
15816 * dispextern.h (string_buffer_position): Remove declaration.
15817
15818 * print.c (strout): Remove parameter `multibyte', unused since
15819 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15820
15821 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15822 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15823 All callers changed.
15824
15825 * w32.c (_wsa_errlist): Use braces for struct initializers.
15826
15827 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15828 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15829 All callers changed.
15830 (string_buffer_position): Likewise. Also, make static (it's never
15831 used outside xdisp.c).
15832 (cursor_row_p): Remove parameter `w', unused since
15833 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15834 (decode_mode_spec): Remove parameter `precision', introduced during
15835 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15836 All callers changed.
15837
15838 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15839
15840 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15841
15842 2011-03-27 Anders Lindgren <andlind@gmail.com>
15843
15844 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15845 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15846 (ns_update_auto_hide_menu_bar): New functions.
15847 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15848 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15849 ns_constrain_all_frames.
15850 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15851 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15852
15853 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15854
15855 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15856
15857 2011-03-27 Glenn Morris <rgm@gnu.org>
15858
15859 * syssignal.h: Replace RETSIGTYPE with void.
15860 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15861 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15862 Replace SIGTYPE with void everywhere.
15863 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15864 * s/template.h (SIGTYPE): Remove commented out definition.
15865
15866 2011-03-26 Eli Zaretskii <eliz@gnu.org>
15867
15868 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15869 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15870
15871 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
15872
15873 * w32.c (read_unc_volume): Use parameter `henum', instead of
15874 global variable `wget_enum_handle'.
15875
15876 * keymap.c (describe_vector): Remove parameters `indices' and
15877 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15878 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15879
15880 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15881
15882 * keyboard.c (timer_check): Remove parameter `do_it_now',
15883 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15884 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15885 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15886
15887 * keyboard.c (read_char):
15888 * w32menu.c (w32_menu_display_help):
15889 * xmenu.c (show_help_event, menu_help_callback):
15890 Adjust calls to `show_help_echo'.
15891
15892 * gtkutil.c (xg_maybe_add_timer):
15893 * keyboard.c (readable_events):
15894 * process.c (wait_reading_process_output):
15895 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15896
15897 * insdel.c (adjust_markers_gap_motion):
15898 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15899 (gap_left, gap_right): Don't call it.
15900
15901 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
15902
15903 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15904 incurred during fontification.
15905
15906 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15907
15908 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15909 (DEFVAR_PER_BUFFER): Don't pass it.
15910
15911 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15912 (scrolling_window): Don't pass it.
15913
15914 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15915
15916 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15917
15918 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15919 and `suffix'.
15920 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15921 of variables specific to SELinux and computation of `encoded_absname'.
15922
15923 * image.c (XPutPixel): Remove unused variable `height'.
15924
15925 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15926
15927 * unexw32.c (get_section_info): Remove unused variable `section'.
15928
15929 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15930 (system_process_attributes): Remove unused variable `sess'.
15931 (sys_read): Remove unused variable `err'.
15932
15933 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15934 (w32_wnd_proc): Remove unused variable `isdead'.
15935 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15936 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15937 (x_create_tip_frame): Remove unused variable `tem'.
15938
15939 * w32inevt.c (w32_console_read_socket):
15940 Remove unused variable `no_events'.
15941
15942 * w32term.c (x_draw_composite_glyph_string_foreground):
15943 Remove unused variable `width'.
15944
15945 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
15946
15947 * w32term.c (x_set_glyph_string_clipping):
15948 Don't pass uninitialized region to CombineRgn.
15949
15950 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
15951
15952 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15953 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15954 (Fx_close_connection): Remove unused variable `i'.
15955
15956 * w32font.c (w32font_draw): Return number of glyphs.
15957 (w32font_open_internal): Remove unused variable `i'.
15958 (w32font_driver): Add missing initializer.
15959
15960 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15961 (fill_in_menu): Remove unused variable `items_added'.
15962
15963 * w32term.c (last_mouse_press_frame): Remove static global variable.
15964 (w32_clip_to_row): Remove unused variable `f'.
15965 (x_delete_terminal): Remove unused variable `i'.
15966
15967 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15968 (NOTHING): Remove unused static global variable.
15969 (uniscribe_check_otf): Remove unused variable `table'.
15970 (uniscribe_font_driver): Add missing initializers.
15971
15972 2011-03-23 Julien Danjou <julien@danjou.info>
15973
15974 * term.c (Fsuspend_tty, Fresume_tty):
15975 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15976 * window.c (temp_output_buffer_show):
15977 * insdel.c (signal_before_change):
15978 * frame.c (Fhandle_switch_frame):
15979 * fileio.c (Fdo_auto_save):
15980 * emacs.c (Fkill_emacs):
15981 * editfns.c (save_excursion_restore):
15982 * cmds.c (internal_self_insert):
15983 * callint.c (Fcall_interactively):
15984 * buffer.c (Fkill_all_local_variables):
15985 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15986 Use Frun_hooks.
15987 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
15988 unconditionally since it does the check itself.
15989
15990 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
15991
15992 Fix more problems found by GCC 4.5.2's static checks.
15993
15994 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15995 the first time through the loop, since we know p0 < p1 then.
15996 This also avoids a gcc -Wstrict-overflow warning.
15997
15998 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15999 leading to a memory leak, possible in functions like
16000 load_charset_map_from_file that can allocate an unbounded number
16001 of objects (Bug#8318).
16002
16003 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16004 that could (at least in theory) be that large.
16005
16006 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16007 This is less likely to overflow, and avoids undefined behavior if
16008 overflow does occur. All callers changed. Use strtoul to scan
16009 for the unsigned long integer.
16010 (pint2hrstr): Simplify and tune code slightly.
16011 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16012
16013 * scroll.c (do_scrolling): Work around GCC bug 48228.
16014 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16015
16016 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16017 This also avoids a warning with gcc -Wstrict-overflow.
16018 (validate_x_resource_name): Simplify count usage.
16019 This also avoids a warning with gcc -Wstrict-overflow.
16020
16021 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16022 fail (Bug#8306).
16023
16024 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16025
16026 * process.c (Fmake_network_process): Use socklen_t, not int,
16027 where POSIX says socklen_t is required in portable programs.
16028 This fixes a porting bug on hosts like 64-bit HP-UX, where
16029 socklen_t is wider than int (Bug#8277).
16030 (Fmake_network_process, server_accept_connection):
16031 (wait_reading_process_output, read_process_output):
16032 Likewise.
16033
16034 * process.c: Rename or move locals to avoid shadowing.
16035 (list_processes_1, Fmake_network_process):
16036 (read_process_output_error_handler, exec_sentinel_error_handler):
16037 Rename or move locals.
16038 (Fmake_network_process): Define label "retry_connect" only if needed.
16039 (Fnetwork_interface_info): Fix pointer signedness.
16040 (process_send_signal): Add cast to avoid pointer signedness problem.
16041 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16042 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16043
16044 Make tparam.h and terminfo.c consistent.
16045 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16046 Include tparam.h instead, since it declares them.
16047 * cm.h (PC): Remove extern decl; tparam.h now does this.
16048 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16049 * terminfo.c: Include tparam.h, to check interfaces.
16050 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16051 (tparam): Adjust signature to match interface in tparam.h;
16052 this removes some undefined behavior. Check that outstring and len
16053 are zero, which they always are with Emacs.
16054 * tparam.h (PC, BC, UP): New extern decls.
16055
16056 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16057 (xftfont_open): Rename locals to avoid shadowing.
16058
16059 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16060 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16061 (OTF_TAG_SYM): Omit macro if not needed.
16062 (ftfont_list): Remove unused local.
16063 (get_adstyle_property, ftfont_pattern_entity):
16064 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16065 Rename locals to avoid shadowing.
16066
16067 * xfont.c (xfont_list_family): Mark var as initialized.
16068
16069 * xml.c (make_dom): Now static.
16070
16071 * composite.c (composition_compute_stop_pos): Rename local to
16072 avoid shadowing.
16073 (composition_reseat_it): Remove unused locals.
16074 (find_automatic_composition, composition_adjust_point): Likewise.
16075 (composition_update_it): Mark var as initialized.
16076 (find_automatic_composition): Mark vars as initialized,
16077 with a FIXME (Bug#8290).
16078
16079 character.h: Rename locals to avoid shadowing.
16080 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16081 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16082 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16083 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16084 to avoid shadowing.
16085
16086 * textprop.c (property_change_between_p): Remove; unused.
16087
16088 * intervals.c (interval_start_pos): Now static.
16089
16090 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16091
16092 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16093 Rename locals to avoid shadowing.
16094
16095 * sound.c (wav_play, au_play, Fplay_sound_internal):
16096 Fix pointer signedness.
16097 (alsa_choose_format): Remove unused local var.
16098 (wav_play): Initialize a variable to 0, to prevent undefined
16099 behavior (Bug#8278).
16100
16101 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16102
16103 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16104
16105 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16106 clobbering (Bug#8298).
16107 * sysdep.c (sys_subshell): Likewise.
16108 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16109
16110 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16111 This should get cleaned up, so that child_setup has the
16112 same signature on all platforms.
16113
16114 * callproc.c (call_process_cleanup): Now static.
16115 (relocate_fd): Rename locals to avoid shadowing.
16116
16117 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16118
16119 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16120 not to be necessary, and produces flickering.
16121
16122 2011-03-20 Glenn Morris <rgm@gnu.org>
16123
16124 * config.in: Remove file.
16125
16126 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16127
16128 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16129 are now in src/globals.h.
16130 (syms_of_minibuf): Remove spurious & from previous change.
16131
16132 2011-03-20 Leo Liu <sdl.web@gmail.com>
16133
16134 * minibuf.c (completing-read-function): New variable.
16135 (completing-read-default): Rename from completing-read.
16136 (completing-read): Call completing-read-function.
16137
16138 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16139
16140 * xfaces.c (Fx_load_color_file):
16141 Read color file from absolute filename (bug#8250).
16142
16143 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16144
16145 * makefile.w32-in: Update dependencies.
16146
16147 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16148
16149 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16150
16151 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16152
16153 Fix more problems found by GCC 4.5.2's static checks.
16154
16155 * process.c (make_serial_process_unwind, send_process_trap):
16156 (sigchld_handler): Now static.
16157
16158 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16159 That way, the code declares only the vars that it needs.
16160 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16161 * s/cygwin.h (PTY_ITERATION): Likewise.
16162 * s/darwin.h (PTY_ITERATION): Likewise.
16163 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16164
16165 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16166 * process.c (allocate_pty): Don't declare stb unless it's needed.
16167
16168 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16169 (CONSTANTLIM): Remove; unused.
16170 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16171 Define only if needed.
16172
16173 * unexelf.c (unexec): Name an expression,
16174 to avoid gcc -Wbad-function-cast warning.
16175 Use a different way to cause a compilation error if anyone uses
16176 n rather than nn, a way that does not involve shadowing.
16177 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16178
16179 * deps.mk (unexalpha.o): Remove; unused.
16180
16181 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16182 * unexec.h: New file.
16183 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16184 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16185 Depend on unexec.h.
16186 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16187 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16188 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16189 Change as necessary to match prototype in unexec.h.
16190
16191 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16192 shadowing.
16193 (back_comment, skip_chars): Mark vars as initialized.
16194
16195 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16196 Rename locals to avoid shadowing.
16197
16198 * lread.c (read1): Rewrite so as not to use empty "else".
16199 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16200
16201 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16202
16203 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16204 warning when compiling print.c.
16205
16206 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16207 instead of using an uninitialized var.
16208 (font_sort_entities): Mark var as initialized.
16209
16210 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16211
16212 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16213 pointers to constants.
16214 (font_parse_fcname): Remove unused vars.
16215 (font_delete_unmatched): Now static.
16216 (font_get_spec): Remove; unused.
16217 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16218 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16219 Rename or move locals to avoid shadowing.
16220
16221 * fns.c (require_nesting_list, require_unwind): Now static.
16222 (Ffillarray): Rename locals to avoid shadowing.
16223
16224 * floatfns.c (domain_error2): Define only if needed.
16225 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16226
16227 * alloc.c (mark_backtrace): Move decl from here ...
16228 * lisp.h: ... to here, so that it can be checked.
16229
16230 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16231 (Fdefvar): Rewrite so as not to use empty "else".
16232 (lisp_indirect_variable): Name an expression,
16233 to avoid gcc -Wbad-function-cast warning.
16234 (Fdefvar): Rename locals to avoid shadowing.
16235
16236 * callint.c (quotify_arg, quotify_args): Now static.
16237 (Fcall_interactively): Rename locals to avoid shadowing.
16238 Use const pointer when appropriate.
16239
16240 * lisp.h (get_system_name, get_operating_system_release):
16241 Move decls here, to check interfaces.
16242 * process.c (get_operating_system_release): Move decl to lisp.h.
16243 * xrdb.c (get_system_name): Likewise.
16244 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16245 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16246 some of which prompt warnings from gcc -Wbad-function-cast.
16247 (Fformat_time_string, Fencode_time, Finsert_char):
16248 (Ftranslate_region_internal, Fformat):
16249 Rename or remove local vars to avoid shadowing.
16250 (Ftranslate_region_internal): Mark var as initialized.
16251
16252 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16253 avoid shadowing.
16254
16255 * lisp.h (eassert): Check that the argument compiles, even if
16256 ENABLE_CHECKING is not defined.
16257
16258 * data.c (Findirect_variable): Name an expression, to avoid
16259 gcc -Wbad-function-cast warning.
16260 (default_value, arithcompare, arith_driver, arith_error): Now static.
16261 (store_symval_forwarding): Rename local to avoid shadowing.
16262 (Fmake_variable_buffer_local, Fmake_local_variable):
16263 Mark variables as initialized.
16264 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16265
16266 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16267 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16268 Rename locals to avoid shadowing.
16269 (mark_stack): Move local variables into the #ifdef region where
16270 they're used.
16271 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16272 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16273 needed otherwise.
16274 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16275 (GC_STRING_CHARS): Remove; not used.
16276 (Fmemory_limit): Cast sbrk's returned value to char *.
16277
16278 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16279 avoids undefined behavior in theory.
16280
16281 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16282
16283 Use functions, not macros, for up- and down-casing (Bug#8254).
16284 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16285 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16286 to use the following functions instead of these macros.
16287 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16288 EMACS_INT, since callers assume the returned value fits in int.
16289 (upcase1): Likewise, for UPCASE_TABLE.
16290 (uppercasep, lowercasep, upcase): New static inline functions.
16291 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16292 the race-condition problem in the old DOWNCASE.
16293
16294 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16295 Rename locals to avoid shadowing.
16296 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16297 (regex_compile, re_search_2, re_match_2_internal):
16298 Remove unused local vars.
16299 (FREE_VAR): Rewrite so as not to use empty "else",
16300 which gcc can warn about.
16301 (regex_compile, re_match_2_internal): Mark locals as initialized.
16302 (RETALLOC_IF): Define only if needed.
16303 (WORDCHAR_P): Likewise. This one is never needed, but is used
16304 only in a comment talking about a compiler bug, so put inside
16305 the #if 0 of that comment.
16306 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16307 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16308 Remove; unused.
16309
16310 * search.c (boyer_moore): Rename locals to avoid shadowing.
16311 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16312 (PREV_CHAR_BOUNDARY): Likewise.
16313
16314 * search.c (simple_search): Remove unused var.
16315
16316 * dired.c (compile_pattern): Move decl from here ...
16317 * lisp.h: ... to here, so that it can be checked.
16318 (struct re_registers): New forward decl.
16319
16320 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16321
16322 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16323 All uses changed.
16324 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16325 Rename locals to avoid shadowing.
16326 (Fvertical_motion): Mark locals as initialized.
16327
16328 * casefiddle.c (casify_object, casify_region): Now static.
16329 (casify_region): Mark local as initialized.
16330
16331 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16332
16333 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16334 New macros, so that the caller can use some names other than
16335 gcpro1, gcpro2, etc.
16336 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16337 of the new macros.
16338 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16339 argument, for consistency with GCPRO2_VAR, etc: it is now the
16340 prefix of the variable, not the variable itself. All uses
16341 changed.
16342 * dired.c (directory_files_internal, file_name_completion):
16343 Rename locals to avoid shadowing.
16344
16345 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16346 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16347 dired.c's scmp function, had undefined behavior.
16348 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16349 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16350 * buffer.h: ... to here, because these macros use current_buffer,
16351 and the new implementation with inline functions needs to have
16352 current_buffer in scope now, rather than later when the macros
16353 are used.
16354 (downcase, upcase1): New static inline functions.
16355 (DOWNCASE, UPCASE1): Reimplement using these functions.
16356 This avoids undefined behavior in expressions like
16357 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16358 from race conditions in accessing the global variables
16359 case_temp1 and case_temp2.
16360 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16361 * lisp.h (case_temp1, case_temp2): Remove their decls.
16362 * character.h (ASCII_CHAR_P): Move from here ...
16363 * lisp.h: ... to here, so that the inline functions mentioned
16364 above can use them.
16365
16366 * dired.c (directory_files_internal_unwind): Now static.
16367
16368 * fileio.c (file_name_as_directory, directory_file_name):
16369 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16370 Now static.
16371 (file_name_as_directory): Use const pointers when appropriate.
16372 (Fexpand_file_name): Likewise. In particular, newdir might
16373 point at constant storage, so make it a const pointer.
16374 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16375 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16376 signedness issues.
16377 (Fset_file_times, Finsert_file_contents, auto_save_error):
16378 Rename locals to avoid shadowing.
16379
16380 * minibuf.c (choose_minibuf_frame_1): Now static.
16381 (Ftry_completion, Fall_completions): Rename or remove locals
16382 to avoid shadowing.
16383
16384 * marker.c (bytepos_to_charpos): Remove; unused.
16385
16386 * lisp.h (verify_bytepos, count_markers): New decls,
16387 so that gcc does not warn that these functions aren't declared.
16388
16389 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16390 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16391 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16392 (copy_text): Remove unused local var.
16393
16394 * filelock.c (within_one_second): Now static.
16395 (lock_file_1): Rename local to avoid shadowing.
16396
16397 * buffer.c (fix_overlays_before): Mark locals as initialized.
16398 (fix_start_end_in_overlays): Likewise. This function should be
16399 simplified by using pointers-to-pointers, but that's a different
16400 matter.
16401 (switch_to_buffer_1): Now static.
16402 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16403 (report_overlay_modification): Rename locals to avoid shadowing.
16404
16405 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16406 Fix pointer signedness issue.
16407 (sys_subshell): Mark local as volatile if checking for lint,
16408 to suppress a gcc -Wclobbered warning that does not seem to be right.
16409 (MAXPATHLEN): Define only if needed.
16410
16411 * process.c (serial_open, serial_configure): Move decls from here ...
16412 * systty.h: ... to here, so that they can be checked.
16413
16414 * fns.c (get_random, seed_random): Move extern decls from here ...
16415 * lisp.h: ... to here, so that they can be checked.
16416
16417 * sysdep.c (reset_io): Now static.
16418 (wait_for_termination_signal): Remove; unused.
16419
16420 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16421 (copy_keymap_item, append_key, push_text_char_description):
16422 Now static.
16423 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
16424 (DENSE_TABLE_SIZE): Remove; unused.
16425 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16426 (describe_map_tree):
16427 Rename locals to avoid shadowing.
16428
16429 * keyboard.c: Declare functions static if they are not used elsewhere.
16430 (echo_char, echo_dash, cmd_error, top_level_2):
16431 (poll_for_input, handle_async_input): Now static.
16432 (read_char, kbd_buffer_get_event, make_lispy_position):
16433 (make_lispy_event, make_lispy_movement, apply_modifiers):
16434 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16435 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16436 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
16437 (read_key_sequence, read_char): Mark locals as initialized.
16438 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
16439
16440 * keyboard.h (make_ctrl_char): New decl.
16441 (mark_kboards): Move decl here ...
16442 * alloc.c (mark_kboards): ... from here.
16443
16444 * lisp.h (force_auto_save_soon): New decl.
16445
16446 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
16447 (DEFINE_DUMMY_FUNCTION): New macro.
16448 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16449 Use it.
16450 (main): Add casts to avoid warnings
16451 if GCC considers string literals to be constants.
16452
16453 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16454
16455 * dbusbind.c: Pointer signedness fixes.
16456 (xd_signature, xd_append_arg, xd_initialize):
16457 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16458 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16459 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16460 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16461
16462 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16463 if GCC considers string literals to be constants.
16464 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
16465
16466 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16467
16468 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16469 (print_preprocess, print_object): New macro to fix last change.
16470
16471 * print.c (print_preprocess): Don't forget font objects.
16472
16473 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
16474
16475 * emacs.c (USAGE3): Doc fixes.
16476
16477 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16478
16479 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16480 structure.
16481
16482 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
16483
16484 * lisp.h (VWindow_system, Qfile_name_history):
16485 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16486 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16487 (w32_system_caret_x, w32_system_caret_y): Declare extern.
16488
16489 * w32select.c: Don't #include "keyboard.h".
16490 (run_protected): Add extern declaration for waiting_for_input.
16491
16492 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16493 * w32console.c (detect_input_pending, read_input_pending)
16494 (encode_terminal_code):
16495 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16496 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16497 (w32_system_caret_y, Qfile_name_history):
16498 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16499 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16500 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16501 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16502 * w32proc.c (Qlocal, report_file_error):
16503 * w32term.c (Vwindow_system, updating_frame):
16504 * w32uniscribe.c (initialized, uniscribe_font_driver):
16505 Remove unneeded extern declarations.
16506
16507 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
16508
16509 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
16510
16511 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
16512
16513 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16514 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16515 These macros can no longer be used for assignment.
16516
16517 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16518 Assign struct members directly, instead of using BUF_BEGV etc.
16519 (record_buffer_markers, fetch_buffer_markers): New functions for
16520 recording and fetching special buffer markers.
16521 (set_buffer_internal_1, set_buffer_temp): Use them.
16522
16523 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16524
16525 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16526
16527 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16528 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16529
16530 * xdisp.c (hscroll_window_tree):
16531 (reconsider_clip_changes): Use PT instead of BUF_PT.
16532
16533 2011-03-13 Eli Zaretskii <eliz@gnu.org>
16534
16535 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16536 $(EMACS_ROOT)/lib/intprops.h.
16537
16538 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16539
16540 Fix more problems found by GCC 4.5.2's static checks.
16541
16542 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16543 to unsigned char * to avoid compiler diagnostic.
16544 (xg_free_frame_widgets): Make it clear that a local variable is
16545 needed only if USE_GTK_TOOLTIP.
16546 (gdk_window_get_screen): Make it clear that this macro is needed
16547 only if USE_GTK_TOOLTIP.
16548 (int_gtk_range_get_value): New function, which avoids a diagnostic
16549 from gcc -Wbad-function-cast.
16550 (xg_set_toolkit_scroll_bar_thumb): Use it.
16551 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16552 diagnostic from gcc -Wbad-function-cast.
16553 (get_utf8_string, xg_get_file_with_chooser):
16554 Rename locals to avoid shadowing.
16555 (create_dialog): Move locals to avoid shadowing.
16556
16557 * xgselect.c (xg_select): Remove unused var.
16558
16559 * image.c (four_corners_best): Mark locals as initialized.
16560 (gif_load): Initialize transparent_p to zero (Bug#8238).
16561 Mark another local as initialized.
16562 (my_png_error, my_error_exit): Mark with NO_RETURN.
16563
16564 * image.c (clear_image_cache): Now static.
16565 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
16566 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
16567 (x_edge_detection): Remove unnecessary cast that
16568 gcc -Wbad-function-cast diagnoses.
16569 (gif_load): Fix pointer signedness.
16570 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16571 (jpeg_load, gif_load): Rename locals to avoid shadowing.
16572
16573 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
16574
16575 Improve quality of tests for time stamp overflow.
16576 For example, without this patch (encode-time 0 0 0 1 1
16577 1152921504606846976) returns the obviously-bogus value (-948597
16578 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16579 reports time overflow. See
16580 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
16581 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16582 * editfns.c: Include limits.h and intprops.h.
16583 (TIME_T_MIN, TIME_T_MAX): New macros.
16584 (time_overflow): Move earlier, to before first use.
16585 (hi_time, lo_time): New functions, for an accurate test for
16586 out-of-range times.
16587 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16588 (Fget_internal_run_time): Don't assume time_t fits in int.
16589 (make_time): Use list2 instead of Fcons twice.
16590 (Fdecode_time): More accurate test for out-of-range times.
16591 (check_tm_member): New function.
16592 (Fencode_time): Use it, to test for out-of-range times.
16593 (lisp_time_argument): Don't rely on undefined left-shift and
16594 right-shift behavior when checking for time stamp overflow.
16595
16596 * editfns.c (time_overflow): New function, refactoring common code.
16597 (Fformat_time_string, Fdecode_time, Fencode_time):
16598 (Fcurrent_time_string): Use it.
16599
16600 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16601 * dired.c (make_time): Move to ...
16602 * editfns.c (make_time): ... here.
16603 * systime.h: Note the move.
16604
16605 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16606
16607 * fringe.c (update_window_fringes): Remove unused variables.
16608
16609 * unexmacosx.c (copy_data_segment): Also copy __got section.
16610 (Bug#8223)
16611
16612 2011-03-12 Eli Zaretskii <eliz@gnu.org>
16613
16614 * termcap.c [MSDOS]: Include "msdos.h".
16615 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16616 Constify `char *' arguments and their references according to
16617 prototypes in tparam.h.
16618
16619 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
16620
16621 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16622 Adapt all references accordingly.
16623
16624 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16625
16626 2011-03-11 Tom Tromey <tromey@redhat.com>
16627
16628 * buffer.c (syms_of_buffer): Remove obsolete comment.
16629
16630 2011-03-11 Eli Zaretskii <eliz@gnu.org>
16631
16632 * termhooks.h (encode_terminal_code): Declare prototype.
16633
16634 * msdos.c (encode_terminal_code): Don't declare prototype.
16635
16636 * term.c (encode_terminal_code): Now external again, used by
16637 w32console.c and msdos.c.
16638
16639 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16640 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
16641
16642 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
16643
16644 Fix some minor problems found by GCC 4.5.2's static checks.
16645
16646 * fringe.c (update_window_fringes): Mark locals as initialized
16647 (Bug#8227).
16648 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
16649
16650 * alloc.c (mark_fringe_data): Move decl from here ...
16651 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16652 to check its interface.
16653 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16654
16655 * fontset.c (free_realized_fontset): Now static.
16656 (Fset_fontset_font): Rename local to avoid shadowing.
16657 (fontset_font): Mark local as initialized.
16658 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
16659
16660 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16661
16662 * xselect.c (x_disown_buffer_selections): Remove; not used.
16663 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
16664 (x_own_selection, Fx_disown_selection_internal): Rename locals
16665 to avoid shadowing.
16666 (x_handle_dnd_message): Remove local to avoid shadowing.
16667
16668 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16669 so that the caller can use some name other than gcpro1.
16670 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
16671 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16672 (Fx_backspace_delete_keys_p):
16673 Use them to avoid shadowing, and rename vars to avoid shadowing.
16674 (x_decode_color, x_set_name, x_window): Now static.
16675 (Fx_create_frame): Add braces to silence GCC warning.
16676 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
16677 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16678 Remove unused locals.
16679 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16680 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16681 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16682 macros.
16683
16684 * xterm.h (x_mouse_leave): New decl.
16685
16686 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16687 Remove unused functions.
16688 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16689 (x_calc_absolute_position): Now static.
16690 (XTread_socket): Don't define label "out" unless it's used.
16691 Don't declare local "event" unless it's used.
16692 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16693 unless they are used.
16694 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16695 (x_fatal_error_signal): Remove; not used.
16696 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16697 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16698 (x_error_catcher, x_connection_closed, x_error_handler):
16699 (x_error_quitter, xembed_send_message, x_iconify_frame):
16700 (my_log_handler): Rename locals to avoid shadowing.
16701 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
16702 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
16703
16704 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16705 Rename or move locals to avoid shadowing.
16706 (tty_defined_color, merge_face_heights): Now static.
16707 (free_realized_faces_for_fontset): Remove; not used.
16708 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16709 does not deduce is never used uninitialized.
16710 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16711 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
16712
16713 * terminal.c (store_terminal_param): Now static.
16714
16715 * xmenu.c (menu_highlight_callback): Now static.
16716 (set_frame_menubar): Remove unused local.
16717 (xmenu_show): Rename parameter to avoid shadowing.
16718 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16719 since they might point to immutable storage.
16720 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16721 since it's unused otherwise.
16722
16723 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
16724 Add a FIXME, since the code still doesn't look right. (Bug#8215)
16725 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16726 avoids a gcc -Wuninitialized diagnostic.
16727 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
16728 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16729 does not deduce are never used uninitialized.
16730
16731 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16732
16733 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
16734 * window.c (window_loop, size_window):
16735 (run_window_configuration_change_hook, enlarge_window): Likewise.
16736
16737 * window.c (display_buffer): Now static.
16738 (size_window): Mark variables that gcc -Wuninitialized
16739 does not deduce are never used uninitialized.
16740 * window.h (check_all_windows): New decl, to forestall
16741 gcc -Wmissing-prototypes diagnostic.
16742 * dispextern.h (bidi_dump_cached_states): Likewise.
16743
16744 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16745 shadowing.
16746 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
16747 Include <limits.h>.
16748 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16749 and to avoid gcc -Wuninitialized warning.
16750 (load_charset_map): Mark variables that gcc -Wuninitialized
16751 does not deduce are never used uninitialized.
16752 (load_charset): Abort instead of using uninitialized var (Bug#8229).
16753
16754 * coding.c (coding_set_source, coding_set_destination):
16755 Use "else { /* comment */ }" rather than "else /* comment */;"
16756 for clarity, and to avoid gcc -Wempty-body warning.
16757 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16758 a block, when the outer 'i' will do.
16759 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16760 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16761 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16762 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16763 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16764 Rename locals to avoid shadowing.
16765 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
16766 * coding.c (emacs_mule_char, encode_invocation_designation):
16767 Now static, since they're not used elsewhere.
16768 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
16769 (decode_coding_object, encode_coding_object, detect_coding_system):
16770 (decode_coding_emacs_mule): Mark variables that gcc
16771 -Wuninitialized does not deduce are never used uninitialized.
16772 (detect_coding_iso_2022): Initialize a local variable that might
16773 be used uninitialized. Leave a FIXME because it's not clear that
16774 this initialization is needed. (Bug#8211)
16775 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16776 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16777 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16778 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16779 Remove unused macros.
16780
16781 * category.c (hash_get_category_set): Remove unused local var.
16782 (copy_category_table): Now static, since it's not used elsewhere.
16783 * character.c (string_count_byte8): Likewise.
16784
16785 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16786 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16787
16788 * chartab.c (copy_sub_char_table): Now static, since it's not used
16789 elsewhere.
16790 (sub_char_table_ref_and_range, char_table_ref_and_range):
16791 Rename locals to avoid shadowing.
16792 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
16793
16794 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
16795 (BIDI_BOB): Remove unused macro.
16796
16797 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16798 deduce are never used uninitialized.
16799 * term.c (encode_terminal_code): Likewise.
16800
16801 * term.c (encode_terminal_code): Now static. Remove unused local.
16802
16803 * tparam.h: New file.
16804 * term.c, tparam.h: Include it.
16805 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16806 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16807 Move these decls to tparam.h, and make them agree with what
16808 is actually in tparam.c. The previous trick of using incompatible
16809 decls in different modules does not conform to the C standard.
16810 All callers of tparam changed to use tparam's actual API.
16811 * tparam.c (tparam1, tparam, tgoto):
16812 Use const pointers where appropriate.
16813
16814 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16815 * cm.h (struct cm): Likewise.
16816 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16817 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16818 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16819 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16820 (turn_on_face, init_tty): Likewise.
16821 * termchar.h (struct tty_display_info): Likewise.
16822
16823 * term.c (term_mouse_position): Rename local to avoid shadowing.
16824
16825 * alloc.c (mark_ttys): Move decl from here ...
16826 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16827
16828 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16829
16830 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16831
16832 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
16833
16834 * search.c (compile_pattern_1): Remove argument regp, unused since
16835 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16836 (compile_pattern): Don't pass it.
16837
16838 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16839
16840 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16841 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16842 for ! HAVE_GTK3.
16843 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16844
16845 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16846
16847 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16848 gdk_window_get_screen, gdk_window_get_geometry,
16849 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16850 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16851 (xg_get_pixbuf_from_pixmap): New function.
16852 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16853 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16854 Call xg_get_pixbuf_from_pixmap instead of
16855 gdk_pixbuf_get_from_drawable.
16856 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16857 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16858 (xg_check_special_colors): Use GtkStyleContext and its functions
16859 for HAVE_GTK3.
16860 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16861 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16862 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
16863 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16864 Call gtk_widget_get_preferred_size.
16865 (xg_frame_resized): gdk_window_get_geometry only takes 5
16866 parameters.
16867 (xg_win_to_widget, xg_event_is_for_menubar):
16868 Call gdk_x11_window_lookup_for_display.
16869 (xg_set_widget_bg): New function.
16870 (delete_cb): New function.
16871 (xg_create_frame_widgets): Connect delete-event to delete_cb.
16872 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
16873 (xg_set_background_color): Call xg_set_widget_bg.
16874 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16875 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16876 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16877 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16878 if ! HAVE_GTK3.
16879 (update_frame_tool_bar): Call gtk_widget_hide.
16880 (xg_initialize): Use GDK_KEY_g.
16881
16882 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16883 if ! HAVE_GTK3
16884 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16885
16886 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16887 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16888 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16889
16890 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
16891
16892 * w32xfns.c (select_palette): Check success of RealizePalette against
16893 GDI_ERROR, not zero.
16894
16895 See ChangeLog.11 for earlier changes.
16896
16897 ;; Local Variables:
16898 ;; coding: utf-8
16899 ;; End:
16900
16901 Copyright (C) 2011-2012 Free Software Foundation, Inc.
16902
16903 This file is part of GNU Emacs.
16904
16905 GNU Emacs is free software: you can redistribute it and/or modify
16906 it under the terms of the GNU General Public License as published by
16907 the Free Software Foundation, either version 3 of the License, or
16908 (at your option) any later version.
16909
16910 GNU Emacs is distributed in the hope that it will be useful,
16911 but WITHOUT ANY WARRANTY; without even the implied warranty of
16912 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16913 GNU General Public License for more details.
16914
16915 You should have received a copy of the GNU General Public License
16916 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.