* lisp/play/fortune.el (fortune-compile): Simplify and fix previous change.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
51b3a99c
JD
12013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (tb_size_cb): New function.
4 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
5
e31560a7
SM
62013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
7
8 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
9 an event.
10
fe336261
SM
112013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
12
13 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
14
5a655b9f
DA
152013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
16
17 * font.c (font_range): Add pos_byte argument. Adjust comment
18 and break long line.
19 * font.h (font_range): Adjust prototype.
20 * composite.c (autocmp_chars): Pass byte position to font_range.
21 Break long line. Remove useless prototype and format comment.
22
1a359750
GM
232013-02-13 Glenn Morris <rgm@gnu.org>
24
25 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
26
01fcc3a5 272013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 28
f53f992a
PE
29 Improve AIX port some more (Bug#13650).
30 With this, it should be as good as it was in 23.3, though it's
31 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
32 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
33 * unexaix.c (start_of_text): Remove.
34 (_data, _text): Declare as char[], not int, as AIX manual suggests.
35 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
36 (orig_load_scnptr, orig_data_scnptr):
37 Now off_t, not long, since they are file offsets.
38 (make_hdr): Use _data, not start_of_data ().
39 This is the key part of the fix.
40 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
41 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
42
4458c255
PE
43 * pre-crt0.c (data_start): Initialize to 1.
44 This ports to compilers that optimize the external declaration
45 'int x = 0;' as if it were 'int x;' to shrink the executable.
46
227be86d
PE
47 Improve AIX port (Bug#13650).
48 This doesn't fix the bug, but it makes progress: Emacs builds now.
49 * unexaix.c: Include inttypes.h, stdarg.h.
50 (report_error, report_error_1): Mark as _Noreturn.
51 (report_error): Don't report the wrong errno.
52 (report_error_1): Now varargs. All callers changed.
53 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
54 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
55 (write_ptr): Use %p to print address rather than %lx and a cast
56 to unsigned long. Grow buffer a bit, to be safer.
57
01fcc3a5 582013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
59
60 * bidi.c (bidi_resolve_neutral): After finding the next
61 non-neutral character, accept NEUTRAL_ON type as well, because
62 directional control characters, such as LRE and RLE, have their
63 type converted to that by bidi_resolve_weak. This avoids aborts
64 when LRE/RLE follows a run of neutrals.
65 (bidi_move_to_visually_next): Assert that return value of
66 bidi_peek_at_next_level is non-negative. Negative values will
67 cause an infloop.
68
83be8524
PE
692013-02-13 Paul Eggert <eggert@cs.ucla.edu>
70
71 Minor getenv-related fixes.
72 * callproc.c (Fcall_process_region) [!DOS_NT]:
73 Avoid unnecessary duplicate call to getenv.
74 * callproc.c (init_callproc):
75 * dispnew.c (init_display):
76 * sysdep.c (sys_subshell):
77 Omit unnecessary cast of getenv or egetenv.
78
45b2b768
JB
792013-02-13 Juanma Barranquero <lekktu@gmail.com>
80
81 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
82 Update dependencies.
83
33b49d71
EZ
842013-02-12 Eli Zaretskii <eliz@gnu.org>
85
86 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
87 marker's position.
88 (display_line): Set w->region_showing to the value of
89 it->region_beg_charpos, not to -1. This fixes redisplay
90 optimization when cursor is moved up after M->. (Bug#13623)
91 (Bug#13626)
c4131562
EZ
92 (try_scrolling): Scroll text up more if point is too close to ZV
93 and inside the scroll margin. This makes sure point is moved
94 outside the scroll margin in these cases.
33b49d71
EZ
95
96 * window.h (struct window): region_showing can no longer be
97 negative.
98
b09a4810
PE
992013-02-11 Paul Eggert <eggert@cs.ucla.edu>
100
a84b7c53
PE
101 Tune by using memchr and memrchr.
102 * doc.c (Fsnarf_documentation):
103 * fileio.c (Fsubstitute_in_file_name):
104 * search.c (find_newline, scan_newline):
105 * xdisp.c (pos_visible_p, display_count_lines):
106 Use memchr and memrchr rather than scanning byte-by-byte.
107 * search.c (find_newline): Rename from scan_buffer.
108 Omit first arg TARGET, as it's always '\n'. All callers changed.
109
b09a4810
PE
110 Clean up read_key_sequence a tiny bit more.
111 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
112 (read_key_sequence): Remove unused locals.
113
99d0d6dc
SM
1142013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
115
116 Clean up read_key_sequence a bit; reread active keymaps after first event.
117 * keyboard.c (read_char, read_char_x_menu_prompt)
118 (read_char_minibuf_menu_prompt):
119 Replace nmaps+maps with a single `map' arg.
120 (follow_key): Operate on a single map.
121 (active_maps): New function.
122 (test_undefined): Also return true for nil bindings.
123 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
124 a single (composed) keymap. Remember `first_event' to choose the right
125 set of active keymaps. Recompute the set of keymaps after receiving
126 the first event. Remove GOBBLE_FIRST_EVENT.
127 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
128 * keyboard.h (read_char): Update declaration.
129 * lread.c (read_filtered_event): Adjust call to read_char.
130
f5e1b680
EZ
1312013-02-11 Eli Zaretskii <eliz@gnu.org>
132
99d0d6dc
SM
133 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
134 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
135 in the window. (Bug#13675)
136
f74de345
DA
1372013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
138
139 * marker.c (set_marker_internal): If desired position is passed
140 as a marker, avoid call to buf_charpos_to_bytepos.
141 * window.c (Fset_window_point): Omit redundant type checking.
142 (Fset_window_start): Likewise. Format comment.
143 (window_scroll_pixel_based): Use set_marker_restricted_both
144 with character and byte positions obtained from an iterator.
145 (Fset_window_configuration): Use set_marker_restricted_both.
146 * xdisp.c (message_dolog): Likewise.
147
a4ba3963
EZ
1482013-02-10 Eli Zaretskii <eliz@gnu.org>
149
99d0d6dc
SM
150 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
151 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
152 too far. This speeds up some redisplay operations. (Bug#13675)
153
68643cde
DA
1542013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
155
156 * syntax.c (scan_sexps_forward): Fix byte position calculation
157 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
158
7ba11bee
PE
1592013-02-10 Paul Eggert <eggert@cs.ucla.edu>
160
161 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
162 that was not needed.
163
eff1c190
PE
1642013-02-09 Paul Eggert <eggert@cs.ucla.edu>
165
166 Minor hashing refactoring.
167 * fns.c (SXHASH_REDUCE): Move to lisp.h.
168 (sxhash_float): Return EMACS_UINT, for consistency with the other
169 hash functions.
170 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
171 non-static inline function and therefore can't use static vars.
172 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
173 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
174 with the other hash functions.
175
6b48c831
EZ
1762013-02-09 Eli Zaretskii <eliz@gnu.org>
177
4dde2087
EZ
178 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
179 XXXXXX part of the temporary file pattern is not downcased even
180 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 181
8549f9e8
EZ
182 * xdisp.c (decode_mode_spec): Remove handling of %t.
183
6b48c831
EZ
184 * msdos.c (careadlinkatcwd): Remove.
185
75a65c7e
SM
1862013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
187
188 * lread.c (skip_dyn_bytes): New function (bug#12598).
189 (read1): Use it. Use getc instead of READCHAR to read bytes.
190 (load_each_byte): Remove. Update users.
191
8ca30920
DA
1922013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
193
194 * search.c (scan_buffer): Calculate end byte position just once.
195 (scan_newline): Do not recalculate start_byte.
196 (search_command): Use eassert.
197 * syntax.c (struct lisp_parse_state): New member location_byte.
198 (scan_sexps_forward): Record from_byte and avoid redundant
199 character to byte position calculation ...
200 (Fparse_partial_sexp): ... here. Break too long line.
201
25721f5b
DA
2022013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
203
204 * lisp.h (make_uninit_vector): New function.
205 * alloc.c (Fvector, Fmake_byte_code):
206 * ccl.c (Fregister_ccl_program):
207 * charset.c (Fdefine_charset_internal, define_charset_internal):
208 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
209 * composite.c (syms_of_composite):
210 * font.c (Fquery_font, Ffont_info, syms_of_font):
211 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
212 * ftfont.c (ftfont_shape_by_flt):
213 * indent.c (recompute_width_table):
214 * nsselect.m (clean_local_selection_data):
215 * syntax.c (init_syntax_once):
216 * w32unsubscribe.c (uniscribe_shape):
217 * window.c (Fcurrent_window_configuration):
218 * xfaces.c (Fx_family_fonts):
219 * xselect.c (selection_data_to_lisp_data): Use it.
220
9a9d91d9
DA
2212013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
222
223 * coding.c (Fdefine_coding_system_internal): Use AREF where
224 argument is known to be a vector.
225 * fns.c (Flocale_info): Likewise for ASET.
226 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
227 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
228
6871e574
JD
2292013-02-05 Jan Djärv <jan.h.d@swipnet.se>
230
231 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
232 height.
233
234 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
235 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
236 updateCollectionBehaviour.
237
238 * nsterm.m (NEW_STYLE_FS): Remove.
239 (ns_last_use_native_fullscreen): New variable.
240 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
241 (x_set_window_size): Do not take title bar and tool bar into account
242 if isFullscreen returns YES.
243 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
244 (check_native_fs): New function.
245 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
246 (ns_term_init): Remove NEW_STYLE_FS.
247 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
248 and tool bar if isFullscreen returns NO.
249 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
250 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
251 with HAVE_NATIVE_FS.
252 (window:willUseFullScreenPresentationOptions:): New method.
253 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
254 Hide toolbar if not enabled (Bug#13444).
255 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
256 Restore tool bar if enabled, hide it otherwise (Bug#13444).
257 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
258 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
259 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
260 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
261 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
262 (syms_of_nsterm): Add ns-use-native-fullscreen.
263
3f011c7f
PE
2642013-02-04 Paul Eggert <eggert@cs.ucla.edu>
265
266 * fileio.c (Qchoose_write_coding_system): Now static.
267
86f7c0fe
EZ
2682013-02-04 Eli Zaretskii <eliz@gnu.org>
269
270 * xdisp.c (window_buffer_changed): region_showing can be negative,
271 which still means region is being displayed.
272 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
273 whole window when showing region and the mark has changed.
274 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
275 (display_line): If it->region_beg_charpos is non-zero, set the
276 window's region_showing member to -1. (Bug#13623) (Bug#13626)
277
278 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
279 not bitfield of 1 bit.
280
5257b701
DC
2812013-02-03 Daniel Colascione <dancol@dancol.org>
282
283 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
284 daemon mode works on cygw32 when Emacs is installed and not just
285 during development.
286
8ea41ea9
PE
2872013-02-02 Paul Eggert <eggert@cs.ucla.edu>
288
289 Avoid file time stamp bug on MS-Windows (Bug#13149).
290 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
291 as FAT32 doesn't update time stamps when truncating them.
292 Also, check that a file time stamp is not a multiple of 100 ns;
293 this should catch all instances of the problem on MS-Windows,
294 as its native file system resolution is 100 ns or worse, and
295 checking for a non-multiple of 100 ns should impose only a small
296 overhead on systems with ns resolution.
297
94fbc901 2982013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 299
e7ac588e
EZ
300 Avoid encoding file names on MS-Windows when they need to be run
301 through dostounix_filename.
302 * w32.c (normalize_filename): Accept an additional argument
303 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
304 downcase it even if w32-downcase-file-names is non-nil.
305 (dostounix_filename): Accept an additional argument MULTIBYTE and
306 pass it to normalize_filename.
307 (emacs_root_dir): Adjust.
308
309 * msdos.h (dostounix_filename): Adjust prototype.
310
311 * w32.h (dostounix_filename): Adjust prototype.
312
313 * msdos.c (dostounix_filename): Accept an additional argument and
314 ignore it.
315 (init_environment): Adjust callers of dostounix_filename.
316
317 * fileio.c (Ffile_name_directory, file_name_as_directory)
318 (directory_file_name, Fexpand_file_name)
319 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
320 dostounix_filename.
321 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
322 non-nil.
323 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
324 variables, as egetenv is case-insensitive for DOS_NT.
325
326 * dired.c (file_name_completion): Don't call Fdirectory_file_name
327 with an encoded file name.
328
99d0d6dc
SM
329 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
330 Adjust calls to dostounix_filename.
e7ac588e
EZ
331
332 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
333
334 * unexw32.c (unexec): Adjust call to dostounix_filename.
335
336 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
337
338 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
339 dostounix_filename.
340
341 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
342 dostounix_filename.
343
e7c3fb06
EZ
344 * callproc.c (Fcall_process): Make sure program name in PATH and
345 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
346 is passed to exec/spawnve, which fails unless the file-name
347 encoding is UTF-8.
348
18a80473
EZ
349 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
350 even if w32-quote-process-args is nil.
351
35e85499
PE
3522013-02-01 Paul Eggert <eggert@cs.ucla.edu>
353
354 Fix timestamp bug when write-region appends nothing (Bug#13149).
355 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
356 the file's time stamp doesn't change if Emacs happens to write nothing
357 to the file, and on a buggy file system this could cause Emacs to
358 incorrectly infer that the file system doesn't have the bug.
359 Avoid this problem by inhibiting the inference in this case.
360
422ff52b
DA
3612013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
362
363 * window.h (struct window): Convert base_line_number, base_line_pos
364 and column_number_displayed members from Lisp_Object to ptrdiff_t.
365 Convert region_showing member from Lisp_Object to bitfield.
366 Remove sequence_number member. Adjust comments.
367 * window.c (sequence_number): Remove.
368 (make_window): Initialize column_number_displayed.
369 * print.c (print_object): Follow the printed representation of
370 frames and print window pointer to distinguish between windows.
371 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
372 * xdisp.c (wset_base_line_number, wset_base_line_pos)
373 (wset_column_number_displayed, wset_region_showing): Remove.
374 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
375 (try_scrolling, try_cursor_movement, redisplay_window)
376 (try_window_reusing_current_matrix, try_window_id, display_line)
377 (display_mode_lines, decode_mode_spec): Adjust users.
378 * .gdbinit (pwinx): Do not print sequence_number.
379
8654f9d7
PE
3802013-02-01 Paul Eggert <eggert@cs.ucla.edu>
381
382 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
383 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
384 * dired.c: Include <fcntl.h>.
385 (open_directory): New function, which uses open and fdopendir
386 rather than opendir. DOS_NT platforms still use opendir, though.
387 (directory_files_internal, file_name_completion): Use it.
388 (file_attributes): New function, with most of the old Ffile_attributes.
389 (directory_files_internal, Ffile_attributes): Use it.
390 (file_attributes, file_name_completion_stat): First arg is now fd,
391 not dir name. All uses changed. Use fstatat rather than lstat +
392 stat.
393 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
394 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
395 (emacs_readlinkat): New function, with much of the old
396 Ffile_symlink_p, but with an fd argument for speed.
397 It uses readlinkat rather than careadlinkatcwd, so that it
398 need not assume the working directory.
399 (Ffile_symlink_p): Use it.
400 * filelock.c (current_lock_owner): Use emacs_readlinkat
401 rather than emacs_readlink.
402 * lisp.h (emacs_readlinkat): New decl.
403 (READLINK_BUFSIZE, emacs_readlink): Remove.
404 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
405 (emacs_norealloc_allocator, emacs_readlink): Remove.
406 This stuff is moved to fileio.c.
407 * w32.c (fstatat, readlinkat): New functions.
408 (careadlinkat): Don't check that fd == AT_FDCWD.
409 (careadlinkatcwd): Remove; no longer needed.
410
9dbda100
GM
4112013-01-31 Glenn Morris <rgm@gnu.org>
412
413 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
414 (Fwrite_region): Update for new choose_write_coding_system args.
415 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
416 (syms_of_fileio): Add choose-write-coding-system.
417
3f82a88a 4182013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
419
420 * w32.c (sys_open): Zero out the flags for the new file descriptor.
421 (sys_close): Zero out the flags for the file descriptor before
422 closing it. (Bug#13546)
423
806fed21 424 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
425 (logon_network_drive, stat_worker, symlink, chase_symlinks):
426 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
427 DBCS. (Bug#13553)
428
6ee4509a
EZ
429 * w32.c (w32_get_long_filename, init_environment, readlink):
430 Support file names encoded in DBCS codepages.
26854e9c
EZ
431 (readlink): Use the current file-name-coding-system, not the ANSI
432 codepage, to decode and handle targets of symlinks.
6ee4509a 433
cf01a359
EZ
4342013-01-28 Eli Zaretskii <eliz@gnu.org>
435
436 * w32.c (opendir): Now accepts a 'const char *'.
437
6fd326b7
DA
4382013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
439
440 Remove obsolete redisplay code. See the discussion at
441 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
442 * dispnew.c (preemption_period, preemption_next_check): Remove.
443 (Vredisplay_preemption_period): Likewise.
444 (update_frame, update_single_window, update_window, update_frame_1):
445 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
446 used, following the 2012-06-22 change.
447
d8cd7742
EZ
4482013-01-25 Eli Zaretskii <eliz@gnu.org>
449
450 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
451
266fee4f
DA
4522013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
453
454 * font.c (num_fonts): Remove the leftover from old
455 debugging code. Adjust comment style here and there.
59e624b3
DA
456 * insdel.c (insert_1): Remove.
457 * lisp.h (insert_1): Remove prototype.
458 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 459
830e46e6 4602013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
461
462 * w32.c (max_filename_mbslen): New function.
463 (normalize_filename, readdir): Use it to detect locales where ANSI
464 encoding of file names uses a double-byte character set (DBCS).
465 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
466 CharNextExA, instead of incrementing a 'char *' pointer.
467 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 468
81abbb95
EZ
469 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
470 request of memory reservation to 1.7GB. (Bug#13065)
471
830e46e6 4722013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
473
474 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
475 at check_extra_latin label. (Bug#13505)
476
fd3ceb09
DA
4772013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
478
479 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
480 Avoid redundant calls to strlen.
481
edfa7fa0
DA
4822013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
483
484 Drop async_visible and async_iconified fields of struct frame.
485 This is possible because async input is gone; for details, see
486 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
487 * frame.h (struct frame): Remove async_visible and async_iconified
488 members, convert garbaged to unsigned bitfield. Adjust comments.
489 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
490 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
491 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
492 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
493 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
494 * w32term.c: Ditto.
495 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
496 properly. Likewise for obscured.
497 * xterm.c: Ditto.
266fee4f 498 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
499 properly.
500 * nsterm.m: Ditto.
501 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
502
5ad86e34
DA
5032013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
504
505 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
506 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
507
b09cca6a
SM
5082013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
509
510 * xdisp.c (message2, message2_nolog): Remove functions.
511 (message3, message3_nolog): Extract nbytes and multibyteness directly
512 from the string. Change all callers.
513 (message3_nolog): Don't set message_enable_multibyte since set_message
514 will reset it anyway.
515 (message1, message1_nolog): Use message3.
516 (vmessage): Use a stack allocated buffer rather than f->message_buf.
517 (with_echo_area_buffer): Remove last two arguments. Update all callers.
518 (set_message): Drop all but the second arg, which has to be a string.
519 (set_message_1): Simplify now that we know that a1 is NULL and the
520 second arg is a string.
521 * frame.h (struct frame): Remove `message_buf' field.
522 Use glyphs_initialized_p instead.
523 (FRAME_MESSAGE_BUF): Remove macro.
524 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
525 * lisp.h (message2, message2_nolog): Remove declarations.
526 (message3, message3_nolog): Update declarations.
527 * keyboard.c (read_char_minibuf_menu_text)
528 (read_char_minibuf_menu_width): Remove vars.
529 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
530 to correctly handle multibyte strings.
531 * frame.c (delete_frame): Don't free message_buf any more.
532 * editfns.c (message_text, message_length): Remove vars.
533 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
534 * fileio.c (auto_save_error): Use message3 instead of message2.
535 * dispnew.c (adjust_frame_message_buffer): Remove function.
536
54ab1c5a
EZ
5372013-01-23 Eli Zaretskii <eliz@gnu.org>
538
539 * w32term.c (w32fullscreen_hook): Account correctly for the screen
540 real estate used for the tool bar and the menu bar.
541
6c27465b
DA
5422013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
543
544 * insdel.c (prepare_to_modify_buffer): Force redisplay if
545 hidden buffer is prepared to modification (Bug#13164).
546
9d93ce29
DA
5472013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
548
549 * window.h (struct window): Change window_end_valid member from
550 Lisp_Object to a bitfield. Adjust comments.
551 (wset_window_end_valid): Remove.
552 * window.c (adjust_window_count): Clear window_end_valid.
553 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
554 (Fwindow_line_height, set_window_buffer, Frecenter)
555 (Fsplit_window_internal, Fdelete_other_windows_internal)
556 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
557 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
558 * xdisp.c (check_window_end, reconsider_clip_changes)
559 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
560 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
561 (find_first_unchanged_at_end_row, try_window_id): Likewise.
562
1dcb8ea2
DA
5632013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
564
565 * xdisp.c (mark_window_display_accurate): Simplify the loop
566 assuming that the only one of vchild, hchild or buffer window
567 slots is non-nil. Call mark_window_display_accurate_1 for
568 the leaf windows only.
569 (mark_window_display_accurate_1): Always assume leaf window.
570 Adjust comment.
571
b41b8a7e
PE
5722013-01-22 Paul Eggert <eggert@cs.ucla.edu>
573
593a5f2e
PE
574 * emacs.c (Qkill_emacs_hook): Now static.
575
b41b8a7e
PE
576 * fileio.c (Finsert_file_contents): Simplify.
577 Remove unnecessary assignments and tests.
578
84e5ed96
EZ
5792013-01-21 Eli Zaretskii <eliz@gnu.org>
580
581 * w32.c (acl_set_file): Don't test for errors unless
582 set_file_security returns FALSE. Avoids spurious errors when
583 saving files.
584
2ef88fd4
DA
5852013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
586
587 * fileio.c (Finsert_file_contents): Revert code introduced at
588 2013-01-18 in favor of the simpler and generally better fix.
589 Save stack space by removing 'buffer' and reusing 'read_buf'
590 where appropriate.
591
d7a0a7c9
PE
5922013-01-19 Paul Eggert <eggert@cs.ucla.edu>
593
594 * lisp.h (eabs): Define unconditionally (Bug#13419).
595 The old "#if !defined (eabs)" was an unnecessary revenant of back
596 when this macro was called "abs". Document 'eabs' better.
597
795e7a5b 5982013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
599
600 * fns.c (Frandom): Doc fix.
601
59ac2d13
EZ
6022013-01-19 Eli Zaretskii <eliz@gnu.org>
603
604 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
605 segfault when there are lots of overlays.
606
607 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
608 when there are lots of overlays.
609 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
610 for the details and a way to reproduce.
611
b3fbb395
PE
6122013-01-19 Paul Eggert <eggert@cs.ucla.edu>
613
3a955a1f
PE
614 * fileio.c: Use O_APPEND to append.
615 This corresponds better to the natural interpretation of "append",
616 and avoids the need to open the output file twice, or to invoke
617 lseek when APPEND is neither nil nor a number.
618 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
619 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
620 file possibly twice, and lseeking to its end; this avoids the
621 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
622 at the same time: the combination is never needed and apparently
623 it doesn't work with DOS_NT.
624
21cd50b8
PE
625 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
626 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
627
b3fbb395
PE
628 Allow floating-point file offsets.
629 Problem reported by Vitalie Spinu in
630 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
631 * fileio.c (emacs_lseek): Remove.
632 (file_offset): New function.
633 (Finsert_file_contents, Fwrite_region): Use it.
634
73c14218
CY
6352013-01-19 Chong Yidong <cyd@gnu.org>
636
637 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
638 aborting on Fsignal (Bug#13289).
639
6a9465f3
EZ
6402013-01-19 Eli Zaretskii <eliz@gnu.org>
641
642 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
643 set_file_security as failure due to insufficient privileges.
644 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 645 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 646
fa705c99
PE
6472013-01-19 Paul Eggert <eggert@cs.ucla.edu>
648
9fe43ff6
PE
649 Work around bug in CIFS and vboxsf file systems (Bug#13149).
650 The bug was observed on Ubuntu operating inside a virtual machine,
651 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
652 The workaround introduces a race condition on non-buggy hosts,
653 but it's an unlikely race and anyway there's a nearly identical
654 nearby race that can't be fixed.
655 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
656 New static vars.
657 (Fwrite_region): Test for file system time stamp bug.
658 (init_fileio): New function.
659 * lisp.h (init_fileio): Declare it.
660 * emacs.c (main): Call it.
661
fa705c99
PE
662 * fileio.c (Finsert_file_contents): Simplify new diagnostic
663 and make it more consistent with other stat-failure diagnostics.
664
e07469fa
DA
6652013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
666
99d0d6dc
SM
667 Fix crash when inserting data from non-regular files.
668 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
669 for the error description produced by valgrind.
670 * fileio.c (read_non_regular): Rename to read_contents.
671 Free Lisp_Save_Value object used to pass parameters.
672 (read_non_regular_quit): Rename to read_contents_quit.
673 (Finsert_file_contents): Redesign internal file reading loop to adjust
674 gap and end positions after each read and so help make_gap to work
675 properly. Do not signal an I/O error too early and so do not leave
676 not yet decoded characters in a buffer, which was the reason of
677 redisplay crash. Use list2 to build return value. Adjust comments.
678
67722112
PE
6792013-01-17 Paul Eggert <eggert@cs.ucla.edu>
680
681 Close a race when statting and reading files (Bug#13149).
682 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
683 This avoids a race if the file is renamed between stat and open.
684 This race is not the problem originally noted in Bug#13149;
685 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
686
468afbac
DA
6872013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
688
689 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
690 objects, related functions and macros.
691 (make_save_value): Adjust prototype.
692 (make_save_pointer): New prototype.
693 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
694 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
695 * alloc.c (format_save_value): Rename to make_save_value.
696 (make_save_pointer): New function.
697 (record_xmalloc): Use make_save_pointer.
698 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
699 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
700 Change users of make_save_value to make_save_pointer.
701 Likewise for format_save_value and make_save_value.
702
0e70695a
DA
7032013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
704
705 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
706 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
707 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
708 debugging stubs.
709
963ea40f
PE
7102013-01-15 Paul Eggert <eggert@cs.ucla.edu>
711
712 * alloc.c (free_save_value): Now static.
713
3346c1d0
DA
7142013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
715
716 * keymap.c (map_keymap_internal): Use format_save_value.
717 (map_keymap_char_table_item): Adjust accordingly.
718 * fileio.c (non_regular_fd, non_regular_inserted)
719 (non_regular_nbytes): Remove.
99d0d6dc
SM
720 (Finsert_file_contents): Convert trytry to ptrdiff_t.
721 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
722 (read_non_regular): Use XSAVE_ macros to extract parameters.
723 Adjust comment.
724 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
725 format_save_value.
726 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
727
2b30549c
DA
7282013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
729
730 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
731 extraction from any Lisp_Save_Value slot. Add type checking.
732 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
733 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
734 * xselect.c: All users changed.
735
1b971ac1
DA
7362013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
737
738 Some convenient bits to deal with Lisp_Save_Values.
739 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
740 (allocate_misc): Remove prototype.
741 (format_save_value): New prototype.
742 * alloc.c (allocate_misc): Revert back to static.
743 (format_save_value): New function to build Lisp_Save_Value
744 object with the specified internal structure.
745 (make_save_value): Reimplement using format_save_value.
746 * editfns.c (save_excursion_save): Use format_save_value.
747 (save_excursion_restore): Use XSAVE_OBJECT.
748
c50cf2ea
PE
7492013-01-14 Paul Eggert <eggert@cs.ucla.edu>
750
751 Avoid needless casts with XSAVE_POINTER.
752 * alloc.c (mark_object) [GC_MARK_STACK]:
753 * dired.c (directory_files_internal_unwind):
754 * fileio.c (do_auto_save_unwind):
755 * gtkutil.c (pop_down_dialog):
756 * keymap.c (map_keymap_char_table_item):
757 * lread.c (load_unwind):
758 * nsmenu.m (pop_down_menu):
759 * print.c (print_object) [GC_MARK_STACK]:
760 * xfns.c (clean_up_file_dialog):
761 * xmenu.c (cleanup_widget_value_tree):
762 Omit casts between XSAVE_POINTER and a pointer type.
763
9d5a1260
DA
7642013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
765
766 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
767 * eval.c (eval_sub): Protect `form' from being GCed before its
768 car and cdr becomes protected with the backtrace entry.
769
73ebd38f
DA
7702013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
771
772 Make Lisp_Save_Value more versatile storage for up to four objects.
773 * lisp.h (toplevel): Enumeration to describe types of saved objects.
774 (struct Lisp_Save_Value): New layout. Adjust comments.
775 (XSAVE_POINTER): New macro.
776 (XSAVE_INTEGER): Likewise.
777 (allocate_misc): Add prototype.
778 (free_misc): Likewise.
779 * alloc.c (allocate_misc): Now global.
780 (free_misc): Likewise. Adjust comment.
781 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
782 (free_save_value): Likewise.
783 (mark_object): Likewise.
784 * editfns.c (save_excursion_save): Pack everything within
785 Lisp_Save_Value and so avoid xmalloc.
786 (save_excursion_restore): Adjust to match new layout. Use free_misc
787 because we do not allocate extra memory any more. Add eassert.
788 * print.c (print_object): New code to print Lisp_Save_Value. Do not
789 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
790 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
791 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
792 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
793
b826986f
JD
7942013-01-13 Jan Djärv <jan.h.d@swipnet.se>
795
796 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
797 (nsfont_draw): Remove disabling of LCD smoothing.
798 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 799 Bug#11484 with LCD smoothing on.
b826986f 800
c0511b57 8012013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 802
b6f960a0
PE
803 Fix SIGDANGER handlers, for AIX (Bug#13408).
804 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
805 Move handlers here from emacs.c; they were out of place.
806
616763d5
JD
8072013-01-11 Jan Djärv <jan.h.d@swipnet.se>
808
809 * xterm.c (syms_of_xterm): Adjust documentation for
810 scroll-bar-adjust-thumb-portion.
811
0b59090b 8122012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
813
814 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
815 determine whether scroll bar thumb size should be adjusted or
816 not. Use variable for MOTIF.
817
818 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
819 GTK.
820
7bc916b4
JD
8212013-01-13 Jan Djärv <jan.h.d@swipnet.se>
822
eac4d08f
JD
823 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
824 event is generated.
825 (doCommandBySelector:): Set processingCompose to NO.
826
7bc916b4
JD
827 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
828 Remove check for fkeys count > zero, block/unblock fixes the real bug.
829 (nsfont_list_family): Add block/unblock_input calls.
830 (nsfont_open): Move block_input earlier. Add unblock_input before early
831 return.
832 (nsfont_draw): Add block/unblock_input calls.
833
bdc9b756
PE
8342013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
835
836 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
837 for old_charpos and old_bytepos.
838
ee56a6dc
PE
8392013-01-12 Paul Eggert <eggert@cs.ucla.edu>
840
841 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
842 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
843 Clear tzvalbuf_in_environ if this workaround is in effect.
844 Problem and fix reported by Kazuhiro Ito.
845
9fc9a531
AH
8462013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
847
99d0d6dc
SM
848 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
849 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
850
851 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
852 doc string cross-reference(s).
853
854 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
855 string cross-reference(s).
856
6020559a
DA
8572013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
858
859 Avoid unnecessary byte position calculation for the gap movement.
860 Since all users of move_gap do CHAR_TO_BYTE for other purposes
861 anyway, all of them should use move_gap_both instead.
862 * lisp.h (move_gap): Remove prototype.
863 * insdel.c (move_gap): Remove.
864 (move_gap_both): Add eassert.
865 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
866 * xml.c (parse_region): Likewise.
867
b8956427
PE
8682013-01-11 Paul Eggert <eggert@cs.ucla.edu>
869
870 emacsclient -t should not suspend Emacs server (Bug#13387)
871 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
872 New functions.
873 * term.c (init_tty): Use them instead of rolling our own code.
874 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
875 switches from 'signal' to 'pthread_sigmask', which is safer in
876 multithreaded applications.
877 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
878 which has already arranged for that.
879 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
880 This is the main part of the bug fix.
881
0b59090b 8822013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
883
884 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
885 x_last_font_name (Bug#13403).
886
58cc0a01
DA
8872013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
888
889 Omit buffer_slot_type_mismatch and use generic predicates to enforce
890 the type of per-buffer values where appropriate.
891 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
892 predicate, which is how it's really used now. Adjust comment.
893 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
894 * buffer.c (buffer_slot_type_mismatch): Remove.
895 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
896 predicate. Adjust comment.
897 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
898 fill-column, left-margin, tab-width, buffer-saved-size,
899 left-margin-width, right-margin-width, left-fringe-width,
900 right-fringe-width, scroll-bar-width and buffer-display-count.
901 Use Qstringp for default-directory, buffer-file-name,
902 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
903 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
904 line-spacing.
905 * data.c (store_symval_forwarding): Adjust to call the predicate.
906
5104861e
JB
9072013-01-09 Juanma Barranquero <lekktu@gmail.com>
908
909 * w32.c (get_name_and_id, acl_set_file):
910 * w32term.c (w32fullscreen_hook): Remove unused local variables.
911
eefd7278
DA
9122013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
913
914 * lisp.h (make_gap_1): New prototype.
915 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
916 gap size values.
917 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
918 naming convention.
919 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 920 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
921 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
922 (make_gap_1): New function to adjust the gap of any buffer.
923 * coding.c (coding_alloc_by_making_gap): Use it.
924 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
925 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
926
073ca75b
JL
9272013-01-08 Juri Linkov <juri@jurta.org>
928
929 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
930 of (supports :underline (:style wave)). (Bug#13000)
931
3bace969
AH
9322013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
933
934 * undo.c (Fprimitive_undo): Move to simple.el.
935 (syms_of_undo): Remove declarations for Sprimitive_undo.
936
63a63bd4
SM
9372013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
938
939 * keyboard.c (echo_add_key): Rename from echo_add_char.
940
56ed110a
CY
9412013-01-06 Chong Yidong <cyd@gnu.org>
942
943 * keyboard.c (echo_add_char): New function, factored out from
944 echo_char. Don't add a space if the previous echo string was
945 empty (Bug#13255).
946 (echo_char): Use it.
947 (read_key_sequence): When echoing mock input, ensure that the
948 trailing dash is properly added.
949
b630991b
EZ
9502013-01-05 Eli Zaretskii <eliz@gnu.org>
951
952 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
953 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
954 digits for buffer positions, before misalignment starts.
955 Display "0" for integer "object" field.
b630991b
EZ
956 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
957 Display the newline glyph more unambiguously.
958
f032a318
YM
9592013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
960
961 * nsterm.m (ns_draw_underwave):
962 * w32term.c (w32_draw_underwave):
963 * xterm.c (x_draw_underwave): Make underwave look more triangular
964 and also degrade gracefully for small fonts. (Bug#13000)
965
4240dd3c
YM
966 * nsterm.m (ns_draw_text_decoration):
967 * w32term.c (x_draw_glyph_string):
968 * xterm.c (x_draw_glyph_string): Don't use previous underline
969 thickness and position if previous underline type is underwave.
970
553081a5
SM
9712013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
972
973 * fileio.c (Ffile_acl): Undocument return format.
974
9539d465 9752013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
976
977 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
978
71376d4b
PE
9792013-01-02 Paul Eggert <eggert@cs.ucla.edu>
980
981 Simplify via eabs.
982 * dired.c (file_name_completion):
983 * doc.c (get_doc_string):
984 * floatfns.c (round2):
985 * font.c (font_score, font_delete_unmatched):
986 * fringe.c (compute_fringe_widths):
987 * lread.c (read_list):
988 * minibuf.c (Ftry_completion):
989 * term.c (tty_ins_del_lines):
990 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
991 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
992
a7f11948
EZ
9932012-12-31 Eli Zaretskii <eliz@gnu.org>
994
995 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
996 correctly.
997 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
998 for the bug this caused.
999
84cc1ab6
PE
10002012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1001
1002 * coding.c (Qmac): Now static.
1003
5a1d858b
JD
10042012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1005
1006 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1007 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1008 handlebox_widget. Set toolbar_in_hbox to false/true, set
1009 toolbar_is_packed to true.
1010 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1011 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1012 Show all on TOOLBAR_TOP_WIDGET.
1013 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1014 by TOOLBAR_TOP_WIDGET.
1015 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1016 Check toolbar_is_packed.
8b745d92
JD
1017 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1018 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1019 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1020 false.
1021 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1022 (xg_update_menubar): Update title only if
1023 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1024 (xg_update_submenu): Skip tearoff only if
1025 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1026 (xg_initialize): Initialize xg_detached_menus only if
1027 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
1028
1029 * xterm.h (struct x_output): Surround handlebox_widget with
1030 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1031 toolbar_in_hbox is bool.
1032
d5e5e7b4 10332012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
1034
1035 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1036 (LIBS_GNUSTEP): Define.
1037 (LIBES): Add $(LIBS_GNUSTEP).
1038 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1039
d5e5e7b4 10402012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
1041
1042 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1043 continuation glyph on a TTY with an indication of an empty line.
1044 (Bug#13277)
1045
e7ae8039
EZ
10462012-12-29 Eli Zaretskii <eliz@gnu.org>
1047
ccad023b
EZ
1048 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1049 file's SELinux context or ACLs successfully set, nil otherwise.
1050 (Bug#13298)
8d23a331 1051 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 1052
e7ae8039
EZ
1053 * w32proc.c (reader_thread): Avoid passing NULL handles to
1054 SetEvent and WaitForSingleObject.
1055
7456e13f
PE
10562012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1057
1058 Port EXTERNALLY_VISIBLE to Clang 3.2.
1059 * conf_post.h (__has_attribute): New macro.
1060 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1061
1ab0c851
GM
10622012-12-27 Glenn Morris <rgm@gnu.org>
1063
1064 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1065 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1066
82e2a1f0 10672012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 1068
63a63bd4
SM
1069 * fileio.c (file_name_as_directory, directory_file_name):
1070 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
1071 came from a multibyte or a unibyte Lisp string; all callers
1072 adjusted. Don't assume the input string is always multibyte.
1073 (Bug#13262)
1074 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1075 don't ENCODE_FILE them, and return a unibyte string if the input
1076 was unibyte.
1077 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1078 don't assume the input strings will always be multibyte. If the
1079 input strings are multibyte, decode strings obtained from C
1080 library functions.
1081
8847a0de
DA
10822012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1083
1084 * lisp.h (toplevel): Add two notices to the comment about
1085 defining a new Lisp data type.
6cda572a
DA
1086 * print.c (print_object): If Lisp_Save_Value object's pointer
1087 is the address of a memory area containing Lisp_Objects, try
1088 to print them.
1089 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 1090
4b298d5a
DA
10912012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1092
1093 * keyboard.c (record_asynch_buffer_change): Initialize an event
1094 only if it's really needed.
1095 * frame.h (enum output_method): Remove output_mac member since
1096 it's a leftover from the deleted code.
1097 * frame.c (Fframep): Adjust user here ...
1098 * terminal.c (Fterminal_live_p): ... and here.
1099 * coding.c (Qmac): Now here because it's only used to denote
1100 end-of-line encoding type.
1101 (syms_of_coding): DEFSYM it.
1102 * frame.h (Qmac): Remove duplicated declaration.
1103
12384b01
PE
11042012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1105
1106 * window.c (select_window_1): Now static, since it's used only here.
1107
f1665bdc
EZ
11082012-12-25 Eli Zaretskii <eliz@gnu.org>
1109
1110 * window.c (window_body_cols): Subtract display margins from the
1111 window body width on TTYs as well. See
1112 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1113 for the original report.
1114
9a0d4f34
DA
11152012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1116
1117 * xdisp.c (redisplay_window): Remove inner local variable
1118 because the outer shadowed one has the same meaning.
cd78d9b1
DA
1119 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1120 set but never used.
1121 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1122 (xg_create_tool_bar): Adjust users.
9a0d4f34 1123
f9e7c67e
DA
11242012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1125
1126 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1127 * buffer.c (Fget_buffer_create): Use it to set compact field of
1128 struct buffer_text to avoid accessing an uninitialized value
1129 when compact_buffer is called for the first time.
1130 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
1131 (Fset_buffer_modified_p): Use buffer_window_count to check
1132 whether the buffer is displayed in some window.
1133 * xdisp.c (message_dolog): Likewise.
f9e7c67e 1134
299614f3
EZ
11352012-12-23 Eli Zaretskii <eliz@gnu.org>
1136
40ff07a5
EZ
1137 * w32.c (acl_set_file): If setting the file security descriptor
1138 fails, and the new DACL is identical to the existing one, silently
1139 return success. This fixes problems for users backing up their
1140 own files without having the necessary privileges for setting
1141 security descriptors.
1142
299614f3
EZ
1143 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1144 values.
1145 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1146 after WaitForSingleObject returns normally. This expedites reader
1147 thread shutdown when delete_child triggers it.
1148 (reap_subprocess): More accurate commentary for why we call
1149 delete_child only when cp->fd is negative.
1150
1151 * w32.c (sys_close): Do not call delete_child on a subprocess
1152 whose handle is not yet closed. Instead, set its file descriptor
1153 to a negative value, so that reap_subprocess will call
63a63bd4
SM
1154 delete_child on that subprocess when its SIGCHLD arrives.
1155 This avoids closing handles used for communications between sys_select
299614f3
EZ
1156 and reader_thread, which doesn't give sys_select a chance to
1157 notice that the process exited and invoke the SIGCHLD handler for
1158 it.
1159
cf162aee
JD
11602012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1161
1162 * nsfns.m (Fns_do_applescript): Run event loop until script has
1163 been executed (Bug#12969).
1164 (ns_run_ascript): Chech as_script for nil, set to nil after
1165 executing script.
1166
94900bfe
MR
11672012-12-22 Martin Rudalics <rudalics@gmx.at>
1168
1169 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1170
b2faf49c
EZ
11712012-12-22 Eli Zaretskii <eliz@gnu.org>
1172
1173 * w32term.c (w32fullscreen_hook): New function.
1174 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1175
7efa3fb3
EZ
11762012-12-21 Eli Zaretskii <eliz@gnu.org>
1177
bb085aed
EZ
1178 * fileio.c (Finsert_file_contents): Doc fix.
1179
7efa3fb3
EZ
1180 * w32proc.c (new_child, delete_child, find_child_pid): For a
1181 subprocess, consider its slot being in use as long as its process
1182 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1183 slot when a new process is started immediately after killing
1184 another one, without waiting enough time for the first process to
1185 be reaped and resources allocated for it be orderly freed.
1186 (Bug#13086)
1187 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1188
c1f02afa
CY
11892012-12-21 Chong Yidong <cyd@gnu.org>
1190
1191 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1192
5bec25eb
CY
1193 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1194
a4b0cca1 11952012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
1196
1197 * w32.c (get_name_and_id): Always pass NULL as the first argument
1198 of lookup_account_sid. Avoids crashes with UNC file names that
1199 refer to DFS domains, not to specific machine names. (Bug#12621)
1200 Remove now unused argument FNAME; all callers changed.
1201 (get_file_owner_and_group): Remove now unused argument FNAME; all
1202 callers changed.
1203
34b4b7eb
CY
12042012-12-21 Chong Yidong <cyd@gnu.org>
1205
1206 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1207 error for invalid chars, don't check for a nil return value.
1208
13002885
DA
12092012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1210
1211 Avoid calls to CHAR_TO_BYTE if byte position is known.
1212 * editfns.c (make_buffer_string_both): Use move_gap_both.
1213 (Fbuffer_string): Use make_buffer_string_both.
1214 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1215 Adjust comment.
1216 (buf_bytepos_to_charpos): Likewise.
1217 (charpos_to_bytepos): Remove.
1218 * fileio.c (Finsert_file_contents): Use move_gap_both.
1219 * search.c (Freplace_match): Likewise.
9a0d4f34 1220 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
1221 names for byte positions.
1222 * lisp.h (charpos_to_bytepos): Remove prototype.
1223 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1224 * insdel.c (move_gap): Likewise.
1225
99e9311c
PE
12262012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1227
1228 * xdisp.c (redisplay_internal): Remove now-unused local.
1229
e02230bf
SM
12302012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1231
1232 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1233 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 1234 proper value of frame-local variables (bug#13225).
e02230bf 1235
1687fb14
DA
12362012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1237
1238 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1239 Rename 4th argument since it may be buffer or string. Adjust comment.
1240 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1241
a2f07cd2
DA
12422012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1243
1244 * coding.c (Fdetect_coding_region): Do not check start and end with
1245 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1246 (code_convert_region): Likewise.
1247
474d441e
EZ
12482012-12-18 Eli Zaretskii <eliz@gnu.org>
1249
1250 * w32.c (acl_get_file, acl_set_file): Run the file name through
1251 map_w32_filename, and resolve any symlinks in the file name, like
1252 Posix platforms do.
1253 (acl_set_file): Call revert_to_self, if any privileges were
1254 enabled.
1255
8725c076
JB
12562012-12-17 Juanma Barranquero <lekktu@gmail.com>
1257
1258 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1259 ($(BLD)/w32.$(O)): Update dependencies.
1260
1e101a4b
SM
12612012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1262
1263 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1264 propagate redisplay's scrolling (if any) to the right window.
1265 (redisplay_internal): Use ensure_selected_frame.
1266 (display_mode_lines): Complete last fix.
1267 * window.c (select_window_1): New func, extracted from select_window.
1268 (select_window): Use it.
1269 * window.h (select_window_1): Declare.
1270
66447e07
EZ
12712012-12-17 Eli Zaretskii <eliz@gnu.org>
1272
1273 Emulate Posix ACL APIs on MS-Windows.
1274 * w32.c: Include sddl.h and sys/acl.h.
1275 (SDDL_REVISION_1): Define if not already defined.
1276 (g_b_init_get_security_descriptor_dacl)
1277 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1278 (g_b_init_is_valid_security_descriptor)
1279 (g_b_init_set_file_security): New static flags.
1280 (globals_of_w32): Initialize them to zero.
1281 (SetFileSecurity_Name): New string constant.
1282 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1283 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1284 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1285 (IsValidSecurityDescriptor_Proc): New typedefs.
1286 (get_file_security, get_security_descriptor_owner)
1287 (get_security_descriptor_group): Set errno to ENOTSUP.
1288 (set_file_security, get_security_descriptor_dacl)
1289 (is_valid_security_descriptor, convert_sd_to_sddl)
1290 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
1291 (acl_free, acl_get_file, acl_set_file): New functions.
1292
1293 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
1294
207a7ef0
PE
12952012-12-17 Paul Eggert <eggert@cs.ucla.edu>
1296
1297 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
1298 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
1299 for some of that bug's symptoms can now cause Emacs to abort.
1300 Remove the workaround.
1301 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
1302 The bug that caused SIGCHLD to get lost has been fixed, and the
1303 workaround for it can now cause Emacs to abort.
1304
17fdfc15
PE
13052012-12-16 Paul Eggert <eggert@cs.ucla.edu>
1306
1307 * sysdep.c (emacs_abort): Bump backtrace size to 40.
1308 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
1309 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1310
7c3d167f
RF
13112012-12-16 Romain Francoise <romain@orebokech.com>
1312
1313 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
1314 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 1315 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
1316 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
1317
1318 * Makefile.in (LIBACL_LIBS): New macro.
1319 (LIBES): Use it.
1320
7d80ea23
PE
13212012-12-15 Paul Eggert <eggert@cs.ucla.edu>
1322
1323 * fileio.c (internal_delete_file): Use bool for boolean.
1324
b0728617
EZ
13252012-12-15 Eli Zaretskii <eliz@gnu.org>
1326
1327 Fix bug #13079 on MS-Windows with temp files not being deleted.
1328 * w32.h (_child_process): New members input_file and
1329 pending_deletion.
1330 (register_child): First argument is now pid_t.
1331 (record_infile, record_pending_deletion): New prototypes.
1332
1333 * w32proc.c (new_child): Initialize input_file and
1334 pending_deletion members of the child.
1335 (delete_child): Delete the child's temporary input file, if any,
1336 that is pending deletion.
1337 (register_child): First argument is now pid_t.
1338 (record_infile, record_pending_deletion): New functions.
1339 (reap_subprocess): Fix a typo in DebPrint string.
1340 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
1341
1342 * fileio.c (internal_delete_file): Return an int again: non-zero
1343 if delete-file succeeds, zero otherwise.
1344
1345 * lisp.h (internal_delete_file): Adjust prototype.
1346
1347 * callproc.c (Fcall_process): Don't overwrite infile with result
1348 of DECODE_FILE.
1349 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
1350 asynchronous subprocess, record the name of the input file name,
1351 if any.
1352 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
1353 delete the file, record it as pending deletion when the subprocess
1354 exits.
1355
7e90af26
EZ
13562012-12-14 Eli Zaretskii <eliz@gnu.org>
1357
1358 * editfns.c [HAVE_PWD_H]: Include grp.h.
1359
1360 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
1361
97976f9f
PE
13622012-12-14 Paul Eggert <eggert@cs.ucla.edu>
1363
1364 Fix permissions bugs with setgid directories etc. (Bug#13125)
1365 * dired.c (Ffile_attributes): Return t as the 9th attribute,
1366 to mark it as a placeholder. The old value was often wrong.
1367 The only user of this attribute has been changed to use
1368 file-ownership-preserved-p instead, with its new group arg.
1369 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
1370
26ec1f49
SM
13712012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
1372
ad966fe7
SM
1373 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
1374 Keep selected_window and selected_frame in sync.
26ec1f49 1375
5c207910
EZ
13762012-12-14 Eli Zaretskii <eliz@gnu.org>
1377
1378 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
1379 try to get accurate owner and group information from NT file
1380 security APIs. This is to make most callers of 'stat' and
1381 'lstat', which don't need that information, much faster.
1382
26ec1f49
SM
1383 * dired.c (Ffile_attributes) [WINDOWSNT]:
1384 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
1385 owner and group information from 'lstat'.
1386
893f52d8
PE
13872012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1388
4c95c9a5
PE
1389 * fileio.c (Finsert_file_contents): Don't put tail into head area,
1390 as that confuses set-auto-coding, so insist on the head-read
1391 returning the full 1024 bytes. Let lseek compute the tail offset;
1392 less work for us. Do not ignore I/O errors when reading the tail.
1393
893f52d8
PE
1394 * xdisp.c: Minor style fixes.
1395 (init_iterator): Hoist assignment out of if-expression.
1396 (markpos_of_region): Callers now test for sign, not for -1.
1397
40d1e434
DA
13982012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
1399
1400 Minor redisplay optimization when the region length is zero.
1401 * xdisp.c (markpos_of_region): New function.
1402 (init_iterator): Do not highlight the region of zero length.
1403 (redisplay_window): Check whether the region is of non-zero length.
1404 (try_cursor_movement): Allow if the region length is zero.
1405 (try_window_reusing_current_matrix, try_window_id): Likewise.
1406
727f9739 14072012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
1408
1409 * search.c (search_buffer): Check the inverse translations of each
1410 character in pattern when the buffer being searched is unibyte.
1411 (Bug#13084)
1412
727f9739 14132012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
1414
1415 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
1416 files, fixing a regression from 24.2.
645c6a30 1417 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 1418
d20704ef
PE
14192012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1420
1421 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
1422 fstat shouldn't fail, and if it does fail copy-file should not proceed.
1423 Remove unnecessary S_ISLNK test, as (contra the comments) this
1424 function can't copy symlinks. Improve quality of error message
1425 when attempting to copy files that are neither regular files nor
1426 directories.
1427
2dd61a9b
DA
14282012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
1429
1430 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
1431 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
1432 * window.c (Frecenter):
1433 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
1434 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
1435
cc98b684
DC
14362012-12-12 Daniel Colascione <dancol@dancol.org>
1437
1e101a4b 1438 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
1439 the dumped Emacs is not a sparse file, greatly improving Cygwin
1440 "make bootstrap" performance.
1441
38e791fd
MA
14422012-12-11 Michael Albinus <michael.albinus@gmx.de>
1443
1444 * inotify.c (inotify_callback): Generate an Emacs event for every
1445 incoming inotify event.
1446
f9d1448f
EZ
14472012-12-11 Eli Zaretskii <eliz@gnu.org>
1448
1449 * xdisp.c (handle_face_prop): Fix logic of computing
1450 it->start_of_box_run_p.
1451 (append_space_for_newline): If the glyph row is R2L, reset the
1452 iterator's end_of_box_run_p flag before prepending the space glyph.
1453 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
1454 iterator's start_of_box_run_p flag before prepending the stretch.
1455 (append_glyph, produce_image_glyph, append_composite_glyph)
1456 (append_stretch_glyph, append_glyphless_glyph): Reverse the
1457 left_box_line_p and right_box_line_p flags of the glyph for R2L
1458 glyph rows. (Bug#13011)
1459
c6afe371
DA
14602012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1461
1462 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
1463 if changed buffer is not shown in a window.
1464 * insdel.c (prepare_to_modify_buffer): Likewise.
1465 * window.c (replace_buffer_in_windows_safely): Do nothing
1466 if buffer is not shown in a window.
1467 (Fforce_window_update): Likewise if string or buffer argument
1468 is passed.
1469
1b47babd
EZ
14702012-12-11 Eli Zaretskii <eliz@gnu.org>
1471
1472 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
1473 encoded_file_name, which is what it is.
1474
4c1acb95
DA
14752012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1476
1477 Consistently use marker_position and marker_byte_position.
1478 * fringe.c (Ffringe_bitmaps_at_pos):
1479 * indent.c (Fvertical_motion):
1480 * insdel.c (prepare_to_modify_buffer):
1481 * keyboard.c (make_lispy_position):
1482 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
1483 (window_scroll_pixel_based, displayed_window_lines)
1484 (Fset_window_configuration):
1485 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
1486 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
1487 Replace direct access to marker fields with calls
1488 to marker_position and/or marker_byte_position.
1489
0eeb69fe
JB
14902012-12-11 Juanma Barranquero <lekktu@gmail.com>
1491
1492 * makefile.w32-in (SIG2STR_H): New macro.
1493 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
1494 ($(BLD)/w32notify.$(O)): Update dependencies.
1495
1cf1bbd5
DC
14962012-12-10 Daniel Colascione <dancol@dancol.org>
1497
8db4b52f
DC
1498 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
1499 Windows file notification functionality unless WINDOWSNT.
1500
1cf1bbd5
DC
1501 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
1502 declarations.
1503
1504 * w32fns.c (cache_system_info): Initialize the global hinst
1505 variable here so various initialization calls DTRT.
1506
1e101a4b 1507 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
1508 (hinst): Remove unneeded extern declaration.
1509 (_start): Remove initialization of above variables; remove
1510 initialization of hinst, as cache_system_info now does that.
1511
1512 * emacs.c (main): Call cache_system_info early in startup; we
1513 previously weren't calling it in Cygwin builds.
1514
26ec1f49
SM
1515 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
1516 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
1517 and link it to Emacs.
1518
98a07056
DA
15192012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
1520
1521 Per-buffer window counters.
1522 * buffer.h (struct buffer): New member window_count.
1523 (buffer_window_count): New function.
1524 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1525 Initialize window_count.
1526 (Fkill_buffer): Verify window_count for the buffer being killed.
1527 (modify_overlay): Do not force redisplay if buffer is not shown
1528 in any window.
1529 (init_buffer_once): Initialize window_count for buffer_defaults
1530 and buffer_local_symbols.
1531 * window.h (buffer_shared): Remove declaration.
1532 (wset_buffer): Convert from inline ...
1533 * window.c (wset_buffer): ... to an ordinary function.
1534 (adjust_window_count): New function.
1535 (make_parent_window): Use it.
1536 * xdisp.c (buffer_shared): Remove.
1537 (redisplay_internal, redisplay_window): Adjust users.
1538 (buffer_shared_and_changed): Use per-buffer window counter.
1539
2b8c9064
EZ
15402012-12-10 Eli Zaretskii <eliz@gnu.org>
1541
1542 Support for filesystem notifications on MS-Windows.
1543 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
1544 and this is a TTY frame, signal the caller that keyboard input is
1545 available.
1546
1547 * w32xfns.c (drain_message_queue): Now returns an int: an
1548 indication whether any WM_EMACS_FILENOTIFY messages were found in
1549 the queue.
1550
1551 * w32inevt.c (handle_file_notifications): New function.
1552 (w32_console_read_socket): Call it to process file notifications.
1553
1554 * w32console.c (initialize_w32_display): Record the main thread ID
1555 in dwMainThreadId.
1556
1557 * deps.mk (inotify.o): New dependency list.
1558
1559 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
1560
1561 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
1562 (WM_EMACS_END): Bump value by 1.
1563 (notification_buffer_in_use, file_notifications)
1564 (notifications_size, notifications_desc): Declare.
1565 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
1566 Add prototypes.
1567
1568 * w32term.c (lispy_file_action, queue_notifications): New functions.
1569 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
1570 <Qrenamed_to>: New symbols.
1571 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
1572
1573 * w32notify.c: New file, implements file event notifications for
1574 MS-Windows.
1575
1576 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
1577 by posting it to the w32_read_socket queue.
1578
1e101a4b 1579 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
1580
1581 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
1582 (GLOBAL_SOURCES): Add w32notify.c
1583 ($(BLD)/w32notify.$(O)): New set of dependencies.
1584
1585 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
1586
1e101a4b
SM
1587 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
1588 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
1589 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
1590 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
1591 w32notify-handle-event by default.
1592
1593 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
1594 syms_of_w32notify.
1595
81606b10
RS
15962012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
1597
2b8c9064 1598 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 1599 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
1600
1601 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
1602
1603 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
1604 (syms_of_keyboard): DEFSYM it.
1605 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
1606 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
1607 Qfile_inotify events.
1608 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
1609 special-event-map to inotify-handle-event.
1610
1611 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
1612
1613 * Makefile.in (base_obj): Add inotify.o.
1614
1615 * inotify.c: New file.
1616
265c2fbf 16172012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
1618
1619 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
1620
265c2fbf 16212012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
1622
1623 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
1624 DWORD_PTR, for compatibility with 64-bit builds.
1625
a06ae17d 1626 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
1627 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
1628 (system_process_attributes): Use SIZE_T rather than DWORD, for
1629 compatibility with 64-bit builds.
1630
265c2fbf 16312012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
1632
1633 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
1634
265c2fbf 16352012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
1636
1637 * indent.c (Fvertical_motion): If a display string will be
1638 displayed on the left or the right margin, don't consider it as a
1639 factor in cursor positioning. (Bug#13108)
1640
265c2fbf 16412012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
1642
1643 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
1644
5f460827
PE
16452012-12-10 Paul Eggert <eggert@cs.ucla.edu>
1646
1647 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
1648 for string length.
1649
a16e75cd
EZ
16502012-12-08 Eli Zaretskii <eliz@gnu.org>
1651
1652 * w32.c (unsetenv): Return 0 if the input string is too long.
1653
5745a7df
PE
16542012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1655
1656 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
1657 * alloc.c (xputenv): New function.
1658 * dbusbind.c (Fdbus_init_bus):
1659 * emacs.c (main):
1660 * xterm.c (x_term_init):
1661 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
1662 * editfns.c (initial_tz): Move static var decl up.
1663 (tzvalbuf_in_environ): New static var.
1664 (init_editfns): Initialize these two static vars.
1665 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
1666 Save old TZ value on stack, if it's small.
1667 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
1668 instead, use xputenv+unsetenv to set and restore TZ.
1669 (environbuf): Remove static var. All uses removed.
1670 (Fset_time_zone_rule): Do not save TZ and environ;
1671 no longer needed here.
1672 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
1673 Move to inside set_time_zone_rule; they don't need file scope any more.
1674 (set_time_zone_rule): Maintain the TZ=value string separately.
1675 (syms_of_editfns): Don't initialize initial_tz;
1676 init_editfns now does it.
1677 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
1678 * lisp.h (xputenv): New decl.
1679
c56efa40
FP
16802012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
1681
1682 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
1683
75ceee05
EZ
16842012-12-08 Eli Zaretskii <eliz@gnu.org>
1685
1686 * w32.c (unsetenv, sys_putenv): New functions.
1687
1b6dbfeb
CY
16882012-12-08 Chong Yidong <cyd@gnu.org>
1689
1690 * editfns.c (Finsert_char): Make the error message more
1691 informative (Bug#12992).
1692
d983a10b
PE
16932012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1694
7be78020
PE
1695 Simplify get_lim_data.
1696 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
1697 Remove USG and vlimit methods; no longer used these days.
1698 Add #error catchall just in case.
1699
d983a10b
PE
1700 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
1701 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
1702 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
1703 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
1704 (deleted_pid_list, Fdelete_process, create_process)
1705 (record_child_status_change, handle_child_signal, deliver_child_signal)
1706 (init_process_emacs, syms_of_process):
1707 Assume SIGCHLD is defined.
1708 (parse_signal): Remove. All uses removed.
1709 (abbr_to_signal): New static function.
1710 (Fsignal_process): Use it to convert signal names to ints.
1711 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
1712 kill (getpgrp (), ...).
1713 (emacs_sigaction_init): Assume SIGCHLD is defined.
1714 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
1715 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
1716 * syssignal.h (EMACS_KILLPG): Remove.
1717 All uses replaced by 'kill' with a negative pid.
1718 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
1719 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
1720
9cdde1e2
PE
17212012-12-07 Paul Eggert <eggert@cs.ucla.edu>
1722
1723 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
1724 This will cause a production Emacs to dump core instead of
1725 infinite-looping.
1726
822995f8
DA
17272012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1728
1729 * frame.c (make_frame): Do not set window's buffer to t.
1730 * window.c (Fsplit_window_internal): Likewise. Previously it was
1731 used to indicate that the window is being set up. Now we use
1732 set_window_buffer for all new windows, so the condition in ...
1733 (Fset_window_buffer): ... is always true and can be removed.
1734
ed08365b
DA
17352012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1736
1737 Convenient macro to check whether the buffer is hidden.
1738 * buffer.h (BUFFER_HIDDEN_P): New macro.
1739 * frame.c (make_frame): Use it. Adjust comment.
1740 * buffer.c (candidate_buffer): New function.
1741 (Fother_buffer, other_buffer_safely): Use it.
1742
e86f5134
EZ
17432012-12-06 Eli Zaretskii <eliz@gnu.org>
1744
1745 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
1746 if the child process is still running. Instead, exit the wait
1747 loop and return zero. (Bug#13086)
1748
1700db3c
DA
17492012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1750
1751 * frame.h (x_char_width, x_char_height): Remove prototypes.
1752 * w32term.h (x_char_width, x_char_height): Likewise.
1753 * xfns.c (x_char_width, x_char_height): Remove.
1754 * w32fns.c (x_char_width, x_char_height): Likewise.
1755 * nsfns.c (x_char_width, x_char_height): Likewise.
1756 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
1757 all window frames.
1758 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
1759 * keyboard.c (command_loop_1): Remove prototype.
1760 (command_loop_2, top_level_1): Add static to match prototype.
1761
35fb8050
PE
17622012-12-06 Paul Eggert <eggert@cs.ucla.edu>
1763
1764 Fix a recently-introduced delete-process race condition.
1765 * callproc.c, process.h (record_kill_process):
1766 New function, containing part of the old call_process_kill.
1767 (call_process_kill): Use it.
1768 This does not change call_process_kill's behavior.
1769 * process.c (Fdelete_process): Use record_kill_process to fix a
1770 race condition that could cause Emacs to lose track of a child.
1771
565212e5
DA
17722012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1773
1774 Avoid code duplication between prev_frame and next_frame.
1775 * frame.c (candidate_frame): New function. Add comment.
1776 (prev_frame, next_frame): Use it. Adjust comment.
1777
d8ad4d3f 17782012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
1779
1780 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
1781 fails, signal an error instead of continuing with an empty
1782 string. (Bug#13079)
7c2fcf9b
EZ
1783 Encode expanded temp file pattern before passing it to mkstemp or
1784 mktemp.
d3cefd13 1785
2e7cddd3
EZ
1786 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
1787 Encode the file name before passing it to dostounix_filename, in
1788 case it will downcase it (under w32-downcase-file-names).
1789 (Bug#12933)
1790
644d3f0d
PE
17912012-12-05 Paul Eggert <eggert@cs.ucla.edu>
1792
1793 Minor call-process cleanups.
1794 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
1795 at the same time as other platforms, to simplify analysis.
1796 No need for fd0_volatile since we have synch_process_fd.
1797 Avoid needless emacs_close; arg is always negative.
1798
396376f1
AS
17992012-12-04 Andreas Schwab <schwab@linux-m68k.org>
1800
1801 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
1802 processes.
1803
350f51ad
DA
18042012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
1805
1806 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
1807 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
1808 and mouse_face_hidden members to a bitfields.
1809 * frame.h (struct frame): Remove set-but-not-used space_width member.
1810 (FRAME_SPACE_WIDTH): Remove.
1811 * nsterm.m, w32term.c, xterm.c: Adjust users.
1812 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
1813 member. Adjust users. Convert term_initted, delete_in_insert_mode,
1814 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
1815 members to a bitfields.
1816
bc9dbce6
PE
18172012-12-03 Paul Eggert <eggert@cs.ucla.edu>
1818
bb5f74ee
PE
1819 Don't let call-process be a zombie factory (Bug#12980).
1820 Fixing this bug required some cleanup of the signal-handling code.
1821 As a side effect, this change also fixes a longstanding rare race
1822 condition whereby Emacs could mistakenly kill unrelated processes,
1823 and it fixes a bug where a second C-g does not kill a recalcitrant
1824 synchronous process in GNU/Linux and similar platforms.
1825 The patch should also fix the last vestiges of Bug#9488,
1826 a bug which has mostly been fixed on the trunk by other changes.
1827 * callproc.c, process.h (synch_process_alive, synch_process_death)
1828 (synch_process_termsig, sync_process_retcode):
1829 Remove. All uses removed, to simplify analysis and so that
1830 less consing is done inside critical sections.
1831 * callproc.c (call_process_exited): Remove. All uses replaced
1832 with !synch_process_pid.
1833 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
1834 These take the role of what used to be in unwind-protect arg.
1835 All uses changed.
1836 (block_child_signal, unblock_child_signal):
1837 New functions, to avoid races that could kill innocent-victim processes.
1838 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
1839 (call_process_kill): Record killed processes as deleted, so that
1840 zombies do not clutter up the system. Do this inside a critical
1841 section, to avoid a race that would allow the clutter.
1842 (call_process_cleanup): Fix code so that the second C-g works again
1843 on common platforms such as GNU/Linux.
1844 (Fcall_process): Create the child process in a critical section,
1845 to fix a race condition. If creating an asynchronous process,
1846 record it as deleted so that zombies do not clutter up the system.
1847 Do unwind-protect for WINDOWSNT too, as that's simpler in the
1848 light of these changes. Omit unnecessary call to emacs_close
1849 before failure, as the unwind-protect code does that.
1850 * callproc.c (call_process_cleanup):
1851 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
1852 * process.c (record_deleted_pid): New function, containing
1853 code refactored out of Fdelete_process.
1854 (Fdelete_process): Use it.
1855 (process_status_retrieved): Remove. All callers changed to use
1856 child_status_change.
1857 (record_child_status_change): Remove, folding its contents into ...
1858 (handle_child_signal): ... this signal handler. Now, this
1859 function is purely a handler for SIGCHLD, and is not called after
1860 a synchronous waitpid returns; the synchronous code is moved to
1861 wait_for_termination. There is no need to worry about reaping
1862 more than one child now.
1863 * sysdep.c (get_child_status, child_status_changed): New functions.
1864 (wait_for_termination): Now takes int * status and bool
1865 interruptible arguments, too. Do not record child status change;
1866 that's now the caller's responsibility. All callers changed.
1867 Reimplement in terms of get_child_status.
1868 (wait_for_termination_1, interruptible_wait_for_termination):
1869 Remove. All callers changed to use wait_for_termination.
1870 * syswait.h: Include <stdbool.h>, for bool.
1871 (record_child_status_change, interruptible_wait_for_termination):
1872 Remove decls.
1873 (record_deleted_pid, child_status_changed): New decls.
1874 (wait_for_termination): Adjust to API changes noted above.
1875
bc9dbce6
PE
1876 * bytecode.c, lisp.h (Qbytecode): Remove.
1877 No longer needed after 2012-11-20 interactive-p changes.
1878
3cf3c607
EZ
18792012-12-03 Eli Zaretskii <eliz@gnu.org>
1880
1881 * xdisp.c (redisplay_window): If the cursor is visible, but inside
1882 the scroll margin, move point outside the margin. (Bug#13055)
1883
005c8d13
JD
18842012-12-03 Jan Djärv <jan.h.d@swipnet.se>
1885
1886 * gtkutil.c (my_log_handler): New function.
1887 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
1888
20edc1c9
DA
18892012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1890
1891 * lisp.h (modify_region): Rename to...
1892 (modify_region_1): ...new prototype.
1893 * textprop.c (modify_region): Now static. Adjust users.
1894 * insdel.c (modify_region): Rename to...
1895 (modify_region_1): ...new function to work with current buffer.
1896 Adjust comment and users. Use true and false for booleans.
1897
62c2e5ed
DA
18982012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1899
1900 * alloc.c (free_save_value): New function.
1901 (safe_alloca_unwind): Use it.
1902 * lisp.h (free_save_value): New prototype.
1903 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
1904 Add comment.
1905 (save_excursion_restore): Adjust to match saved data structure.
1906 Use free_save_value to offload some work from GC. Drop obsolete
1907 #if 0 code.
1908
c5bc2d1d 19092012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
1910
1911 * fileio.c (Vauto_save_list_file_name): Doc fix.
1912
c5bc2d1d 19132012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
1914
1915 * w32fns.c: Remove prototype of atof.
1e101a4b 1916 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 1917 builds.
1e101a4b 1918 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
1919
1920 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
1921 with 64-bit builds.
1922
1923 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1924 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
1925 defined.
1926
c5bc2d1d 19272012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 1928
a9de9f0c 1929 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 1930
21e54a94
PE
19312012-12-02 Paul Eggert <eggert@cs.ucla.edu>
1932
2dd2e622
PE
1933 Fix xpalloc confusion after memory is exhausted.
1934 * alloc.c (xpalloc): Comment fix.
1935 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
1936 and signals an error, do not clear charset_table_size, as
1937 charset_table is still valid.
1938 * doprnt.c (evxprintf): Clear *BUF after freeing it.
1939
21e54a94
PE
1940 Use execve to avoid need to munge environ (Bug#13054).
1941 * callproc.c (Fcall_process):
1942 * process.c (create_process):
1943 Don't save and restore environ; no longer needed.
1944 * callproc.c (child_setup):
1945 Use execve, not execvp, to preserve environ.
1946
3e5490f7
PE
19472012-12-01 Paul Eggert <eggert@cs.ucla.edu>
1948
1949 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
1950
75b4f59c
YM
19512012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1952
1953 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
1954 display for sliced images (Bug#10500).
1955
1956 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
1957
f8aff4c6
JB
19582012-11-30 Juanma Barranquero <lekktu@gmail.com>
1959
1960 * doc.c (Fdocumentation): Re-add handling of function-documentation,
1961 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
1962
3940b924
DA
19632012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
1964
1965 * xdisp.c (window_outdated): Remove eassert since it hits
1966 some suspicious corner cases (see Bug#13007 and Bug#13012).
1967 (mode_line_update_needed): New function.
1968 (redisplay_internal, redisplay_window): Use it.
1969 (ensure_selected_frame): New function.
1970 (redisplay_internal, unwind_redisplay): Use it.
1971 (redisplay_internal): Move comment about buffer_shared...
1972 (buffer_shared_and_changed): ...near to its real use.
1973
4a9204fe
PE
19742012-11-29 Paul Eggert <eggert@cs.ucla.edu>
1975
1976 * callproc.c (Fcall_process): Don't misreport vfork failure.
1977
60aeceb8
PE
19782012-11-28 Paul Eggert <eggert@cs.ucla.edu>
1979
1980 * callproc.c (Fcall_process): Fix vfork portability problems.
1981 Do not assume that fd[0], count, filefd, and save_environ survive
1982 vfork. Fix bug whereby wrong errno value could be reported for
1983 pipe failure. Some minor cleanups, too, as follows. Move buf and
1984 bufsize to the context where they're needed. Change new_argv to
1985 be of type char **, as this is more convenient and avoids casts.
1986 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
1987 Now local constants, not macros.
1988
00dc3ead
KH
19892012-11-18 Kenichi Handa <handa@gnu.org>
1990
1991 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
1992 for the variable "f".
1993
e1bf05c1
KH
19942012-11-13 Kenichi Handa <handa@gnu.org>
1995
1996 * font.c (font_unparse_xlfd): Exclude special characters from the
1997 generating XLFD name.
1998
22626a85
PE
19992012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2000
350e0088
PE
2001 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2002 * dired.c (stat_uname, stat_gname):
2003 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2004
22626a85
PE
2005 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2006 * dired.c (directory_files_internal, file_name_completion):
2007 Assume EAGAIN and EINTR are defined.
350e0088 2008
22626a85
PE
2009 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2010 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2011 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2012 * lread.c (readbyte_from_file): Assume EINTR is defined.
2013 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2014 Assume EIO and EAGAIN are defined.
2015 * unexcoff.c (write_segment): Assume EFAULT is defined.
2016
5c9cf0a3 20172012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
2018
2019 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2020 (Bug#11964)
2021
22294a56
EZ
2022 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2023 highlighting on the frame was cleared. Prevents assertion
2024 violations when repeatedly clicking on the "Top" link of the
2025 "bread-crumbs" in Info buffers.
2026
5fbab051
PE
20272012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2028
2029 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2030
bcd77a2b
KB
20312012-11-24 Ken Brown <kbrown@cornell.edu>
2032
2033 * keyboard.c (HAVE_MOUSE):
2034 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2035 were always defined.
2036
d125ca15 20372012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 2038
24becea4
EZ
2039 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2040 between bpos_covered and bpos_max. This fixes cursor display when
2041 several display strings follow each other.
2042
8654a41b
EZ
2043 * .gdbinit (pgx): If the glyph's object is a string, display the
2044 pointer to string data, rather than the value of the string object
2045 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2046
cb5867b1
EZ
2047 * indent.c (Fvertical_motion): If the starting position is covered
2048 by a display string, return to one position before that, to avoid
2049 overshooting it inside move_it_to. (Bug#12930)
2050
f418b22e
DA
20512012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2052
2053 * frame.h (struct frame): Remove display_preempted member
2054 since all users are dead long ago.
2055 * nsterm.h (struct x_output): Use the only dummy member.
2056 * w32menu.c (pending_menu_activation): Remove since not
2057 really used.
2058 (set_frame_menubar): Adjust user.
2059 * w32term.h (struct x_output): Drop outdated #if 0 code.
2060 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
2061 asked_for_visible and menubar_active members.
2062 Drop unused pending_menu_activation member.
f418b22e
DA
2063 * xterm.h (struct x_output): Drop outdated #if 0 code.
2064 Use bitfields for explicit_parent, asked_for_visible,
2065 has_been_visible and net_wm_state_hidden_seen members.
2066
a879f0ea
EZ
20672012-11-23 Eli Zaretskii <eliz@gnu.org>
2068
2069 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2070 of a literal "/". (Bug#12955)
2071 (gl-stamp): Invoke fc.exe directly, not through cmd.
2072
95ef7787
PE
20732012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2074
2075 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2076 * dired.c: Assume HAVE_DIRENT_H.
2077 (NAMLEN): Remove, replacing with ...
2078 (dirent_namelen): New function. All uses changed. Use the GNU macro
2079 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2080 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2081 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2082 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2083 $(NT_INC)/dirent.h.
2084 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2085 * ndir.h: Rename to ../nt/inc/dirent.h.
2086 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2087 Do not include <dirent.h>; no longer needed.
2088 * w32.c: Include <dirent.h> rather than "ndir.h".
2089
12645ae6
CY
20902012-11-23 Chong Yidong <cyd@gnu.org>
2091
2092 * xftfont.c (xftfont_open): Remove duplicate assignment.
2093
5c747675
DA
20942012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2095
2096 * alloc.c (Fgarbage_collect): Unblock input after clearing
2097 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2098 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2099 * msdos.c (IT_frame_up_to_date): Use it here...
2100 * w32term.c (w32_frame_up_to_date): ...here...
2101 * xterm.c (XTframe_up_to_date): ...and here...
2102 * nsterm.m (ns_frame_up_to_date): ...but not here.
2103 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2104 Adjust users.
2105 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2106 Do not check whether GC is in progress.
2107
6ceeb5f1
DA
21082012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2109
2110 * xdisp.c (window_buffer_changed): New function.
2111 (update_menu_bar, update_tool_bar): Use it to
2112 simplify large 'if' statements.
2113 (redisplay_internal): Generalize commonly used
2114 'tail' and 'frame' local variables.
2115
ec84768f
EZ
21162012-11-22 Eli Zaretskii <eliz@gnu.org>
2117
2118 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2119 with Windows system header.
2120
9239d970
PE
21212012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2122
2123 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2124 * alloc.c: Assume unistd.h exists.
2125 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2126 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2127 (getwd) [USG]: Remove; no longer needed.
2128 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2129 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2130 * w32.h (getcwd): Remove decl.
2131
954bba56
SM
21322012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2133
2134 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2135 Make it set selected_window as well.
2136 (update_tool_bar): Use it.
2137
6ef2e5ef 21382012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
2139
2140 * emacs.c (main): Set the G_SLICE environment variable for all
2141 Cygwin builds, not just GTK builds. See
2142 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2143
6ef2e5ef 21442012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
2145
2146 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2147 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2148 Define for the MSVC compiler.
2149
6ef2e5ef 2150 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
2151
2152 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2153 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2154 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
2155 dostounix_filename assumes it gets a unibyte string.
2156 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
2157 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2158
eadf1faa
SM
21592012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2160
2161 Conflate Qnil and Qunbound for `symbol-function'.
2162 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2163 * lread.c (init_obarray): Set `function' fields to Qnil.
2164 * eval.c (Fcommandp): Ignore Qunbound.
2165 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2166 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2167 Test NILP rather than Qunbound.
2168 (Ffmakunbound): Set to Qnil.
2169 (Fsymbol_function): Never signal an error.
2170 (Finteractive_form): Ignore Qunbound.
2171
b83fdfa9
PE
21722012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2173
2174 * eval.c (interactive_p): Remove no-longer-used decl.
2175
952580c5
DA
21762012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2177
2178 * xdisp.c (buffer_shared): Adjust comment.
2179 (buffer_shared_and_changed): New function.
2180 (prepare_menu_bars, redisplay_internal): Use it to
2181 decide whether all windows or frames should be updated.
ea6de9b1
DA
2182 (window_outdated): New function.
2183 (text_outside_line_unchanged_p, redisplay_window): Use it.
2184 (redisplay_internal): Likewise. Fix indentation.
952580c5 2185
23ba2705
SM
21862012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2187
2188 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2189 (syms_of_eval): Remove corresponding defsubr.
2190 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2191
6e9f7997
DC
21922012-11-19 Daniel Colascione <dancol@dancol.org>
2193
2194 * w32fns.c (Fx_file_dialog):
2195 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2196 cygwin_convert_file_name*.
2197
2198 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2199 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2200
552a1590
PE
22012012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2202
2203 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2204
2ac9538d 22052012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
2206
2207 * w32select.c: Include w32common.h before w32term.h, so that
2208 windows.h gets included before w32term.h uses some of its
2209 features, see below.
2210
23ba2705
SM
2211 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2212 New typedefs.
2213 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2214 New prototypes.
d8715cdf
EZ
2215 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2216
2ac9538d 22172012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
2218
2219 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2220 (ns_select): Return at once if events are held (Bug#12834).
2221
2ac9538d 22222012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 2223
2224 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2225 Needed following 2012-10-20 change. (Bug#12902)
2226
c1f7ba3a
JB
22272012-11-18 Juanma Barranquero <lekktu@gmail.com>
2228
2229 * w32proc.c (waitpid): Remove unused label get_result.
2230
a75ce9d3
JB
22312012-11-17 Juanma Barranquero <lekktu@gmail.com>
2232
2233 * makefile.w32-in (SYSWAIT_H): New macro.
2234 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2235 ($(BLD)/sysdep.$(O)): Update dependencies.
2236
49cdacda
PE
22372012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2238
2239 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2240 * callproc.c (relocate_fd): Assume F_DUPFD.
2241 * emacs.c, term.c (O_RDWR): Remove.
2242 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2243 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2244 * nsterm.m: Assume <fcntl.h> exists.
2245 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2246 (create_pty, Fmake_network_process, server_accept_connection)
2247 (wait_reading_process_output, init_process_emacs):
2248 Assume O_NONBLOCK.
2249 (wait_reading_process_output): Put in a special case for WINDOWSNT
2250 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2251 It's not clear this is needed, but it's a more-conservative change.
2252 (create_process): Assume FD_CLOEXEC.
2253 (create_process, create_pty): Assume O_NOCTTY.
2254 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2255 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2256 Omit if not DOS_NT, since F_GETFL is not defined there.
2257 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2258 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2259 (O_NOCTTY): Remove.
2260 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2261 lack it, since gnulib guarantees this.
2262 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2263
22bae83f
EZ
22642012-11-17 Eli Zaretskii <eliz@gnu.org>
2265
6ad30855
EZ
2266 * w32.c (faccessat): Pretend that directories have the execute bit
2267 set. Emacs expects that, e.g., in files.el:cd-absolute.
2268
22bae83f
EZ
2269 * w32proc.c (create_child): Don't clip the PID of the child
2270 process to fit into an Emacs integer, as this is no longer a
2271 restriction.
2272 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2273 reaping only the process specified by PID argument, if that is
2274 positive. Use PID instead of dead_child to know which process to
2275 reap. Wait for the child to die only if WNOHANG is not in
2276 OPTIONS.
2277 (sys_select): Don't set dead_child.
2278
2279 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2280 as it is no longer needed.
2281
2282 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2283 no longer needed.
2284 (record_child_status_change): Remove the setting of
2285 record_at_most_one_child for the !WNOHANG case.
2286
a631d0e0
PE
22872012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2288
2289 Fix problems in ns port found by static checking.
2290 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
2291 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
2292 not to process group.
2293 (ns_select): Use emacs_write, not write, as that's more robust
2294 in the presence of signals.
2295 (fd_handler:): Check for read errors.
2296
d56f2e49
GM
22972012-11-16 Glenn Morris <rgm@gnu.org>
2298
2299 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
2300
96e05507 23012012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
2302
2303 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
2304
96e05507 23052012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
2306
2307 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
2308 use the same value of thread handle.
2309 (start_timer_thread): If the timer thread exited (due to error),
2310 clean up by closing the two handles it used. Duplicate the caller
2311 thread's handle here, so it gets duplicated only once, when
2312 launching the timer thread. Set priority of the timer thread, not
2313 the caller thread.
2314 (getitimer): Don't duplicate the caller thread's handle here.
2315 (Bug#12832)
2316
96e05507 23172012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
2318
2319 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
2320 called (Bug#12834).
2321
3d082a26
PE
23222012-11-16 Paul Eggert <eggert@cs.ucla.edu>
2323
2324 Remove no-longer-used pty_max_bytes variable.
2325 * process.c (pty_max_bytes): Remove; unused.
2326 (send_process): Do not set it.
2327
b72c161c
JB
23282012-11-15 Juanma Barranquero <lekktu@gmail.com>
2329
2330 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
2331 Update dependencies.
2332
bf20ea80
PE
23332012-11-15 Paul Eggert <eggert@cs.ucla.edu>
2334
2335 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
2336 This follows up on the 2012-09-29 patch that removed indirection
2337 for the 'function' field. Reported by Sergey Vinokurov in
2338 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
2339
14f20728
EZ
23402012-11-14 Eli Zaretskii <eliz@gnu.org>
2341
2342 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
2343 different name, as the MS runtime does not have such a function,
2344 and probably never will.) All callers changed. Ignore DIRFD
2345 value if PATH is an absolute file name, to match Posix spec
2346 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
2347 symlinks.
2348
77731919
DA
23492012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
2350
2351 * xdisp.c (echo_area_display, redisplay_internal):
2352 Omit redundant check whether frame_garbaged is set.
2353
73dcdb9f
PE
23542012-11-14 Paul Eggert <eggert@cs.ucla.edu>
2355
2356 Use faccessat, not access, when checking file permissions (Bug#12632).
2357 This fixes a bug that has been present in Emacs since its creation.
2358 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
2359 which must set some sort of record. (Torek's bug report was against
2360 a predecessor of GNU Emacs, but GNU Emacs happened to have the
2361 same common flaw.) See Torek's Usenet posting
2362 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
2363 Posted: Fri Apr 8 14:18:56 1983.
2364 * Makefile.in (LIB_EACCESS): New macro.
2365 (LIBES): Use it.
2366 * callproc.c (init_callproc):
2367 * charset.c (init_charset):
2368 * fileio.c (check_existing, check_executable, check_writable)
2369 (Ffile_readable_p):
2370 * lread.c (openp, load_path_check):
2371 * process.c (allocate_pty):
2372 * xrdb.c (file_p):
2373 Use effective UID when checking permissions, not real UID.
2374 * callproc.c (init_callproc):
2375 * charset.c (init_charset):
2376 * lread.c (load_path_check, init_lread):
2377 Test whether directories are accessible, not merely whether they exist.
2378 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
2379 * fileio.c (check_existing, check_executable, check_writable)
2380 (Ffile_readable_p):
2381 Use symbolic names instead of integers for the flags, as they're
2382 portable now.
2383 (check_writable): New arg AMODE. All uses changed.
2384 Set errno on failure.
2385 (Ffile_readable_p): Use faccessat, not stat + open + close.
2386 (Ffile_writable_p): No need to call check_existing + check_writable.
2387 Just call check_writable and then look at errno. This saves a syscall.
2388 dir should never be nil; replace an unnecessary runtime check
2389 with an eassert. When checking the parent directory of a nonexistent
2390 file, check that the directory is searchable as well as writable, as
2391 we can't create files in unsearchable directories.
2392 (file_directory_p): New function, which uses 'stat' on most platforms
2393 but faccessat with D_OK (for efficiency) if WINDOWSNT.
2394 (Ffile_directory_p, Fset_file_times): Use it.
2395 (file_accessible_directory_p): New function, which uses a single
2396 syscall for efficiency.
2397 (Ffile_accessible_directory_p): Use it.
2398 * xrdb.c (file_p): Use file_directory_p.
2399 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
2400 * lread.c (openp): When opening a file, use fstat rather than
2401 stat, as that avoids a permissions race. When not opening a file,
2402 use file_directory_p rather than stat.
2403 (dir_warning): First arg is now a usage string, not a format.
2404 Use errno. All uses changed.
2405 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
2406 that merely introduced a race.
2407 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
2408 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
2409 and similarly for the other O_* flags.
2410 * w32.c (sys_faccessat): Rename from sys_access and switch to
2411 faccessat's API. All uses changed.
2412 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
2413 (magic_db): Rename from magic_file_p.
2414 (magic_db, search_magic_path): Return an XrmDatabase rather than a
2415 char *, so that we don't have to test for file existence
2416 separately from opening the file for reading. This removes a race
2417 fixes a permission-checking problem, and simplifies the code.
2418 All uses changed.
2419 (file_p): Remove; no longer needed.
2420
2a14f83b
DA
24212012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
2422
2423 Omit glyphs initialization at startup.
2424 * dispnew.c (glyphs_initialized_initially_p): Remove.
2425 (adjust_frame_glyphs_initially): Likewise. Adjust users.
2426 (Fredraw_frame): Move actual code from here...
c7085245 2427 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
2428 (Fredraw_display): Use redraw_frame.
2429 * xdisp.c (clear_garbaged_frames): Likewise.
2430
f78ee6af 24312012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
2432
2433 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
2434 passed to pint2str and pint2hrstr to be at most the size of the
2435 frame's decode_mode_spec_buffer. This avoids crashes with very
2436 large values of FIELD_WIDTH argument to decode_mode_spec.
2437 (Bug#12867)
2438
b95a9c0c
PE
24392012-11-13 Paul Eggert <eggert@cs.ucla.edu>
2440
2441 Fix a race with verify-visited-file-modtime (Bug#12863).
2442 Since at least 1991 Emacs has ignored an mtime difference of no
2443 more than one second, but my guess is that this was to work around
2444 file system bugs that were fixed long ago. Since the race is
2445 causing problems now, let's remove that code.
2446 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
2447 whose time stamp is off by no more than a second. Insist that the
2448 file time stamps match exactly.
2449
be49ba74
DA
24502012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2451
2452 * frame.h (struct frame): Convert external_tool_bar member to
2453 1-bit unsigned bitfield.
2454 * termhooks.h (struct terminal): Remove mouse_moved member since
2455 all users are long dead. Adjust comment on mouse_position_hook.
2456
5b04e9f9
DA
24572012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2458
2459 Simplify by using FOR_EACH_FRAME here and there.
2460 * frame.c (next_frame, prev_frame, other_visible_frames)
2461 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
2462 * w32term.c (x_window_to_scroll_bar): Likewise.
2463 * window.c (window_list): Likewise.
2464 * xdisp.c (x_consider_frame_title): Likewise.
2465 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
2466 * xfns.c (x_window_to_frame, x_any_window_to_frame)
2467 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
2468 * xmenu.c (menubar_id_to_frame): Likewise.
2469 * xselect.c (frame_for_x_selection): Likewise.
2470 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
2471 (x_window_to_menu_bar): Likewise.
2472 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
2473
76ae24d7
PE
24742012-11-12 Paul Eggert <eggert@cs.ucla.edu>
2475
12cc4337
PE
2476 * data.c (Qdefalias_fset_function): Now static.
2477
76ae24d7
PE
2478 Another tweak to vectorlike_header change.
2479 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
2480 Remove, and replace all uses with ...
2481 (next_in_free_list, set_next_in_free_list):
2482 New functions, which respect C's aliasing rules better.
2483
1479c557
PE
24842012-11-11 Paul Eggert <eggert@cs.ucla.edu>
2485
2486 * window.c (list4i): Rename from 'quad'. All uses changed.
2487 Needed because <sys/types.h> defines 'quad' on Solaris 10.
2488
11235c03
JB
24892012-11-11 Juanma Barranquero <lekktu@gmail.com>
2490
2491 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
2492 warning about mixing declarations and code in ISO C90.
2493
6baf66d5 24942012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
2495
2496 * window.c (Fsplit_window_internal): Set combination limit of
2497 new parent window to t iff Vwindow_combination_limit is t;
2498 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 2499 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 2500
6baf66d5 25012012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
2502
2503 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
2504 amount when the scroll margins are too large. When scrolling
2505 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
2506 scroll margin within a reasonable number of screen lines.
2507 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
2508 point is positioned many lines beyond the window top/bottom.
2509 (Bug#12811)
2510
508f51f5
EZ
2511 * ralloc.c (relinquish): If real_morecore fails to return memory
2512 to the system, don't crash; instead, leave the last heap
2513 unchanged and return. (Bug#12774)
2514
32e5c58c
SM
25152012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2516
2517 * lisp.h (AUTOLOADP): New macro.
2518 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
2519 * data.c (Ffset): Remove special ad-advice-info handling.
2520 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
2521 (Fsubr_arity): CSE.
2522 (Finteractive_form): Simplify.
2523 (Fquo): Don't insist on having at least 2 arguments.
2524 (Qdefalias_fset_function): New var.
2525
719b0aa5
JD
25262012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2527
4ab15c3e
JD
2528 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
2529
719b0aa5
JD
2530 * nsfont.m (Qcondensed, Qexpanded): New variables.
2531 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
2532 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
2533
535cc8e9
DA
25342012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2535
2536 Fix recently introduced crash on MS-Windows (Bug#12839).
2537 * w32term.h (struct scroll_bar): Use convenient header.
2538 (SCROLL_BAR_VEC_SIZE): Remove.
2539 * w32term.c (x_scroll_bar_create): Use VECSIZE.
2540
7d377c48
DA
25412012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2542
2543 Tweak last vectorlike_header change.
2544 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
2545 vectorlike object on the free list. This is introduced to avoid
2546 some (but not all) pointer casting and aliasing problems, see
2547 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
2548 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
2549 objects.
2550 (xvectype, xvecsize): Use them to examine Lisp_Object values.
2551
7ad27466
JD
25522012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2553
32e5c58c 2554 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
2555 been removed, so remove them here also.
2556
57618ecf
SM
25572012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2558
2559 * doc.c (Fdocumentation): Handle new property
2560 dynamic-docstring-function to replace the old ad-advice-info.
2561
53371430
PE
25622012-11-09 Paul Eggert <eggert@cs.ucla.edu>
2563
2564 * fns.c (Qeql, hashtest_eq): Now static.
2565
61ddb1b9
SM
25662012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2567
2568 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
2569 * fns.c (hashfn_eq, hashfn_eql, sxhash):
2570 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
2571 * buffer.c (compare_overlays): Use XLI rather than XHASH.
2572
04a2d0d3
PE
25732012-11-08 Paul Eggert <eggert@cs.ucla.edu>
2574
2575 Use same hash function for hashfn_profiler as for hash_string etc.
2576 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
2577 * lisp.h (sxhash_combine): New inline function, with the contents
2578 of the old SXHASH_COMBINE.
2579 * profiler.c (hashfn_profiler): Use it, instead of having a
2580 special hash function containing a comparison that always yields 1.
2581
de5ef41a
SM
25822012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2583
2584 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
2585 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
2586 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
2587 Remove unused vars.
2588
a23c4171
JD
25892012-11-08 Jan Djärv <jan.h.d@swipnet.se>
2590
2591 * image.c (xpm_make_color_table_h): Fix compiler error because
2592 make_hash_table changed.
2593
0b59090b 25942012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
2595
2596 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
2597
b7432bb2
SM
25982012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2599
2600 Use ad-hoc comparison function for the profiler's hash-tables.
2601 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
2602 (make_log): Use them.
2603 (handle_profiler_signal): Don't inhibit quit any longer since we don't
2604 call Fequal any more.
2605 (Ffunction_equal): New function.
2606 (cmpfn_profiler, hashfn_profiler): New functions.
2607 (syms_of_profiler): Initialize them.
2608 * lisp.h (struct hash_table_test): New struct.
2609 (struct Lisp_Hash_Table): Use it.
2610 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
2611 * fns.c (make_hash_table): Take a struct to describe the test.
2612 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
2613 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
2614 (hash_lookup, hash_remove_from_table): Move assertion checking of
2615 hashfn result here. Check hash-equality before calling cmpfn.
2616 (Fmake_hash_table): Adjust call to make_hash_table.
2617 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
2618 (syms_of_fns): Initialize them.
2619 * emacs.c (main): Move syms_of_fns earlier.
2620 * xterm.c (syms_of_xterm):
2621 * category.c (hash_get_category_set): Adjust call to make_hash_table.
2622 * print.c (print_object): Adjust to new hash-table struct.
2623 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
2624
88002743
EZ
26252012-11-08 Eli Zaretskii <eliz@gnu.org>
2626
2627 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
2628 value of w32-scroll-lock-modifier is neither nil nor one of the
2629 known key modifiers. (Bug#12806)
2630
914adc42
DA
26312012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2632
2633 Shrink struct vectorlike_header to the only size field.
2634 * lisp.h (enum pvec_type): Avoid explicit enum member values.
2635 Adjust comment.
2636 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
2637 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
2638 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
2639 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
2640 information from the vector header. Adjust comment.
2641 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
2642 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
2643 layout.
2644 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
2645 (struct vectorlike_header): Remove next member. Adjust comment.
2646 (struct Lisp_Subr): Add convenient header. Adjust comment.
2647 (allocate_pseudovector): Adjust prototype.
2648 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
2649 (sweep_string, lisp_malloc): Remove useless prototypes.
2650 (enum mem_type): Adjust comment.
2651 (NEXT_IN_FREE_LIST): New macro.
2652 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
2653 (Fmake_bool_vector): Likewise.
2654 (struct large_vector): New type to represent allocation unit for
2655 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
2656 (large_vectors): Change type to struct large_vector.
2657 (allocate_vector_from_block): Simplify.
2658 (PSEUDOVECTOR_NBYTES): Replace with...
2659 (vector_nbytes): ...new function. Adjust users.
2660 (sweep_vectors): Adjust processing of large vectors.
2661 (allocate_vectorlike): Likewise.
2662 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
2663 Add easserts. Adjust XSETPVECTYPESIZE usage.
2664 (allocate_buffer): Use BUFFER_PVEC_INIT.
2665 (live_vector_p): Adjust to match large vector.
2666 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
2667 * buffer.h (struct buffer): Add next member.
2668 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
2669 New macros.
2670 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
2671 * fns.c (internal_equal): Adjust to match enum pvec_type change.
2672 (copy_hash_table): Adjust to match vector header change.
2673 * lread.c (defsubr): Use XSETPVECTYPE.
2674 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
2675 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
2676 (xvecsize): New command.
2677
c66f21ea
DA
26782012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2679
2680 * keyboard.c (event_to_kboard): Do not dereference
2681 frame_or_window field of SELECTION_REQUEST_EVENT
2682 and SELECTION_CLEAR_EVENT events (Bug#12814).
2683 * xterm.h (struct selection_input_event): Adjust comment.
2684
eb147960
EZ
26852012-11-07 Eli Zaretskii <eliz@gnu.org>
2686
dab72075
EZ
2687 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
2688 such as Scroll Lock, if the respective keys are treated as
2689 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 2690 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 2691
5890e400
DA
26922012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
2693
2694 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
2695
b6b3b294
PE
26962012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2697
2698 Restore some duplicate definitions (Bug#12814).
2699 This undoes part of the 2012-11-03 changes. Some people build
2700 with plain -g rather than with -g3, and they need the duplicate
2701 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
2702 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
2703 Define as macros, as well as as enums or as constants.
2704
e770aad5
JD
27052012-11-06 Jan Djärv <jan.h.d@swipnet.se>
2706
2707 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
2708 to keypad keys (Bug#12816).
2709
68f8f1c0
PE
27102012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2711
2712 Minor adjustments of recently-changed frame functions.
2713 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
2714 known to be a frame (we're in the FRAMEP branch).
2715 * lisp.h (Qframep): Remove decl. frame.h declares this.
2716 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
2717 since they're meant for Lisp fixnum values.
2718
72f94d4b
DA
27192012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2720
2721 * window.c (Fwindow_combination_limit): Revert to the only
2722 required argument and adjust docstring as suggested in
2723 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
2724 by Martin Rudalics <rudalics@gmx.at>.
2725
d9f07150
DA
27262012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2727
2728 Widely used frame validity and checking functions.
2729 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
2730 * frame.c (decode_live_frame, decode_any_frame): New functions.
2731 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
2732 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
2733 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
2734 (Fframe_pointer_visible_p): Use decode_any_frame.
2735 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
2736 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
2737 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
2738 (Fframe_focus): Likewise. Allow zero number of arguments.
2739 Adjust docstring.
2740 (frame_buffer_list, frame_buffer_predicate): Remove.
2741 * lisp.h (frame_buffer_predicate): Remove prototype.
2742 * buffer.c (Fother_buffer): Use decode_any_frame.
2743 * xdisp.c (Ftool_bar_lines_needed): Likewise.
2744 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
2745 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
2746 (Fclose_font, Ffont_info): Use decode_live_frame.
2747 * fontset.c (check_fontset_name): Likewise.
2748 * terminal.c (Fframe_terminal): Likewise.
2749 * w32fns.c (check_x_frame): Likewise.
2750 * window.c (Fminibuffer_window, Fwindow_at)
2751 (Fcurrent_window_configuration): Likewise.
2752 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
2753 Likewise. Allow zero number of arguments. Adjust docstring.
2754 * dispnew.c (Fredraw_frame): Likewise.
2755 * xfaces.c (frame_or_selected_frame): Remove.
2756 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
2757 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
2758 (Fframe_face_alist): Use decode_live_frame.
2759 * xfns.c (check_x_frame): Likewise.
2760
89bc0592
DA
27612012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2762
2763 * window.c (quad): New function.
2764 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
2765 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
2766 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
2767 (Fwindow_line_height): Use it.
2768 (Fwindow_fringes): Use list3.
2769 (Fwindow_scroll_bars): Use list4.
2770 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
2771 (Fwindow_combination_limit): Allow zero number of arguments.
2772
c8e3a9c3
EZ
27732012-11-05 Eli Zaretskii <eliz@gnu.org>
2774
2775 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
2776
8e2417bf 2777 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 2778 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 2779 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 2780
209c6a58
CY
27812012-11-05 Chong Yidong <cyd@gnu.org>
2782
2783 * process.c (wait_reading_process_output): Revert previous change.
2784
8148369c
PE
27852012-11-05 Paul Eggert <eggert@cs.ucla.edu>
2786
dd0333b6
PE
2787 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
2788 This removes code that has been obsolete since around 1990.
2789 * callproc.c (Fcall_process):
2790 * emacs.c (main):
2791 * process.c (create_process):
2792 * term.c (dissociate_if_controlling_tty):
2793 Assume setsid exists.
2794 * callproc.c (child_setup): Assume setpgid exists and behaves as
2795 per POSIX.1-1988 or later.
2796 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
2797 * emacs.c (shut_down_emacs):
2798 * sysdep.c (sys_suspend, init_foreground_group):
2799 Assume getpgrp behaves as per POSIX.1-1998 or later.
2800 * msdos.c (setpgrp): Remove.
2801 (tcgetpgrp, setpgid, setsid): New functions.
2802 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
2803 * term.c (no_controlling_tty): Remove; unused.
2804 * w32proc.c (setpgrp): Remove.
2805 (setsid, tcgetpgrp): New functions.
2806
8148369c
PE
2807 Simplify by assuming __fpending.
2808 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
2809 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
2810 Do not assume that __fpending's result fits in int.
2811
76abf5e5
PE
28122012-11-04 Paul Eggert <eggert@cs.ucla.edu>
2813
06b63c9b
PE
2814 Remove EMACS_OUTQSIZE+sleep hack.
2815 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
2816 than 2400 bps, which throttled Emacs by having it sleep.
2817 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
2818 was added, and anyway those old terminals are long dead.
2819 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
2820 without the dispnew.c change, as dispnew.c doesn't include systty.h.
2821
76abf5e5
PE
2822 Fix data-loss with --version (Bug#9574).
2823 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
2824 as we can't assume that emacs_strerror is initialized, and strerror
2825 is good enough here.
2826 (main): Invoke atexit earlier, to catch earlier instances of
2827 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
2828
8f31e74b
MM
28292012-11-04 Michael Marchionna <tralfaz@pacbell.net>
2830
2831 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
2832 (keyDown): Remap keypad keys to X11 virtual key codes.
2833
0d879dca
PE
28342012-11-03 Paul Eggert <eggert@cs.ucla.edu>
2835
7ccfb720
PE
2836 Fix data-loss with --batch (Bug#9574).
2837 * emacs.c: Include <close-stream.h>.
2838 (close_output_streams): New function.
2839 (main): Pass it to atexit, so that Emacs closes stdout and stderr
2840 and handles errors appropriately.
2841 (Fkill_emacs): Don't worry about flushing, as close_output_stream
2842 does that now.
2843
0b3d4a47
PE
2844 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
2845 The symptom is a diagnostic "GLib-WARNING **: In call to
2846 g_spawn_sync(), exit status of a child process was requested but
2847 SIGCHLD action was set to SIG_IGN and ECHILD was received by
2848 waitpid(), so exit status can't be returned." The diagnostic
2849 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
2850 The real bug is a race condition between Emacs and glib: Emacs
2851 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
2852 so that glib can't find it. Work around the bug by invoking
2853 waitpid only on subprocesses that Emacs itself creates.
2854 * process.c (create_process, record_child_status_change):
2855 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
2856 know the pid rather than having the callee infer it.
2857 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
2858 (create_process): Set new 'alive' member if child is created.
2859 (process_status_retrieved): New function.
2860 (record_child_status_change): Use it.
2861 Accept negative 1st argument, which means to wait for the
2862 processes that Emacs already knows about. Move special-case code
2863 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
2864 processes that have already been waited for, by testing and
2865 clearing new 'alive' member.
2866 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
2867 now does this internally.
2868 (handle_child_signal): Let record_child_status_change do all
2869 the work, since we do not want to reap all exited child processes,
2870 only the child processes that Emacs itself created.
2871 * process.h (Lisp_Process): New boolean member 'alive'.
2872
0d879dca
PE
2873 Omit duplicate definitions no longer needed with gcc -g3.
2874 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
2875 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
2876 Define only as macros. There's no longer any need to also define
2877 these symbols as enums or as constants, since we now assume
2878 gcc -g3 when debugging.
2879
3478f4b5
EZ
28802012-11-03 Eli Zaretskii <eliz@gnu.org>
2881
2882 * lisp.mk: Adjust comments to the fact that term/internal is now
2883 loaded from loadup.el.
2884
2885 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
2886 (msdos_fatal_signal): New function.
2887 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
2888 its argument list.
2889
2890 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
2891 for GCC versions before 4.
2892 (emacs_raise): Define to call msdos_fatal_signal.
2893
2894 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
2895 iterator when starting in the middle of a display or overlay
2896 string. (Bug#12745)
2897
85fabcb7
CY
28982012-11-03 Chong Yidong <cyd@gnu.org>
2899
2900 * process.c (wait_reading_process_output): Clean up the last
2901 change.
2902
893cc455
CY
29032012-11-03 Jim Paris <jim@jtan.com> (tiny change)
2904
2905 * process.c (wait_reading_process_output): Avoid a race condition
2906 with SIGIO delivery (Bug#11536).
2907
0f7b074f
CY
29082012-11-03 Chong Yidong <cyd@gnu.org>
2909
2910 * buffer.c (cursor_type): Untabify docstring.
2911
3737fee7
DA
29122012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2913
2914 * frame.h (struct frame): Drop can_have_scroll_bars member
2915 which is meaningless for a long time. Adjust comments.
2916 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
2917 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
2918
b6a9e8b1
DA
29192012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2920
2921 * window.c (decode_next_window_args): Update window arg after
2922 calling decode_live_window and so fix crash reported at
2923 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
2924 by Juanma Barranquero <lekktu@gmail.com>.
2925 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
2926 * font.c (Ffont_at): Likewise.
2927
600d4768
JD
29282012-11-01 Jan Djärv <jan.h.d@swipnet.se>
2929
2930 * widget.c (resize_cb): New function.
2931 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
2932 (EmacsFrameResize): Check if all is up to date before changing frame
2933 size.
2934
1005b4b9
EZ
29352012-11-02 Eli Zaretskii <eliz@gnu.org>
2936
2937 Implement backtrace output for fatal errors on MS-Windows.
2938 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
2939 (BACKTRACE_LIMIT_MAX): New macro.
2940 (w32_backtrace): New function.
2941 (emacs_abort): Use w32_backtrace when the user chooses not to
2942 attach a debugger. Update the text of the abort dialog.
2943
b9e9df47
DA
29442012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2945
2946 Window-related stuff cleanup here and there.
2947 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
2948 Use decode_any_window.
2949 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
2950 * xdisp.c (Fformat_mode_line): Likewise.
2951 * font.c (Ffont_at): Use decode_live_window.
2952 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
2953 * window.c (decode_next_window_args): Likewise.
2954 (decode_any_window): Remove static.
2955 * window.h (decode_any_window): Add prototype.
2956 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
2957 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
2958 respectively.
2959
2b371ff7
DA
29602012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2961
2962 Remove pad from struct input_event.
2963 * termhooks.h (struct input_event): Remove padding field.
2964 Adjust comment.
2965 * keyboard.c (event_to_kboard): Simplify because frame_or_window
2966 member is never cons for a long time. Adjust comment.
2967 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
2968 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
2969 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
2970 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
2971
7e8b50d9
EZ
29722012-11-01 Eli Zaretskii <eliz@gnu.org>
2973
2974 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
2975
322aea6d
PE
29762012-10-31 Paul Eggert <eggert@cs.ucla.edu>
2977
2978 Fix crash when using Emacs as commit editor for git (Bug#12697).
2979 * callproc.c (setpgrp): Remove macro, as we now use setpgid
2980 and it is configured in conf_post.h.
2981 (Fcall_process): Don't invoke both setsid and setpgid; the former
2982 is enough, if it exists.
2983 * callproc.c (Fcall_process, child_setup):
2984 * process.c (create_process): Use setpgid.
2985 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
2986 for the real thing.
2987 * dispnew.c (init_display): Initialize the foreground group
2988 if we are running a tty display.
2989 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
2990 * lisp.h (init_foreground_group): New decl.
2991 * sysdep.c (inherited_pgroup): New static var.
2992 (init_foreground_group, tcsetpgrp_without_stopping)
2993 (narrow_foreground_group, widen_foreground_group): New functions.
2994 (init_sys_modes): Narrow foreground group.
2995 (reset_sys_modes): Widen foreground group.
2996
220cb2bd
MA
29972012-10-31 Michael Albinus <michael.albinus@gmx.de>
2998
2999 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3000
218e997a
MR
30012012-10-31 Martin Rudalics <rudalics@gmx.at>
3002
3003 * minibuf.c (read_minibuf): Restore current buffer since
3004 choose_minibuf_frame calling Fset_frame_selected_window may
3005 change it (Bug#12766).
3006
02615da0
JD
30072012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3008
3009 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3010
aee5b18e
KH
30112012-10-30 Kenichi Handa <handa@gnu.org>
3012
3013 * font.c (Ffont_at): If WINDOW is specified and it is not
3014 displaying the current buffer, signal an error.
3015
ba116008
DC
30162012-10-29 Daniel Colascione <dancol@dancol.org>
3017
de5ef41a
SM
3018 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3019 In preparation for fixing bug#12739, move these functions from
ba116008
DC
3020 here...
3021
3022 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
3023 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3024 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 3025
640bf8ad
EZ
30262012-10-28 Eli Zaretskii <eliz@gnu.org>
3027
3028 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3029 (timer_loop, getitimer, setitimer): Use it instead of
3030 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3031 'clock'.
3032 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3033 literal 10000.
3034
64ccff5f
JD
30352012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3036
3037 * nsterm.m (NO_APPDEFINED_DATA): New define.
3038 (last_appdefined_event_data): New variable
3039 (last_appdefined_event): Remove.
3040 (ns_select): Initialize t from last_appdefined_event_data instead
3041 of [last_appdefined_event data1].
3042 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3043 remove last_appdefined_event (Bug#12698).
3044
e483264c
SM
30452012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3046
3047 * frame.c (x_set_font): Catch internal error.
3048
6c16c13e
EZ
30492012-10-27 Eli Zaretskii <eliz@gnu.org>
3050
e483264c
SM
3051 Avoid overflow in w32 implementation of interval timers.
3052 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
3053 actually executes.
3054 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
3055 'volatile ULONGLONG' types. All the other data which was
3056 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
3057 (GetThreadTimes_Proc): New typedef.
3058 (w32_get_timer_time): New function, returns a suitable time value
3059 for the timer.
3060 (timer_loop): Enter critical section when accessing ULONGLONG
3061 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
3062 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3063 Remove unused variable.
6c16c13e
EZ
3064 (init_timers): Initialize s_pfn_Get_Thread_Times.
3065 (start_timer_thread): Don't assign itimer->caller_thread here.
3066 (getitimer): Assign itimer->caller_thread here.
3067 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 3068 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 3069
ccc83f50
EZ
30702012-10-26 Eli Zaretskii <eliz@gnu.org>
3071
3072 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3073 mouse movement events if the menu bar is active. This avoids
3074 producing a busy "hour-glass" cursor by Windows if the mouse
3075 pointer is positioned over a tooltip shown for some menu item.
3076
69deda53
PE
30772012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3078
3079 Don't assume process IDs fit in int.
3080 * emacs.c (shut_down_emacs) [!DOS_NT]:
3081 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3082 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3083 Use pid_t, not int, to store process IDs, as 'int'
3084 is not wide enough on a few platforms (e.g., AIX and IRIX).
3085
7e70a152
KH
30862012-10-23 Kenichi Handa <handa@gnu.org>
3087
3088 The following change is to make face-font-rescale-alist work
3089 correctly for non-ASCII fonts.
3090
3091 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3092 (font_open_for_lface): Handle Vface_font_rescale_alist.
3093
49238e7f
CY
30942012-10-23 Chong Yidong <cyd@gnu.org>
3095
3096 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3097
5ec86886
JD
30982012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3099
ef446959
JD
3100 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3101 for screen font.
3102 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3103
5ec86886
JD
3104 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3105 event (Bug#12681).
3106
ee7a418d
GM
31072012-10-21 Glenn Morris <rgm@gnu.org>
3108
3109 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3110
4973679b
PE
31112012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3112
3113 Port to OpenBSD 5.1.
3114 * frame.c (Fmouse_position, Fmouse_pixel_position):
3115 * xdisp.c (produce_stretch_glyph):
3116 Declare local vars only when they're needed.
3117 This is clearer and avoids a warning on OpenBSD about unused vars.
3118 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3119 This is safer, and avoids OpenBSD warnings about unused vars.
3120 * keyboard.c (record_menu_key): Remove unnecessary decl.
3121 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3122 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3123 as our definition clashes with OpenBSD's.
3124 * xfaces.c (load_face_colors, check_lface_attrs)
3125 (get_lface_attributes_no_remap, get_lface_attributes)
3126 (lface_fully_specified_p, x_supports_face_attributes_p)
3127 (tty_supports_face_attributes_p, face_fontset, realize_face)
3128 (realize_x_face, realize_tty_face):
3129 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3130 merely Lisp_Object *. This is more informative and avoids
3131 a warning on OpenBSD about accessing beyond an object's size.
3132
c664f463
CY
31332012-10-20 Chong Yidong <cyd@gnu.org>
3134
3135 * lread.c (Fload): Doc fix (Bug#12592).
3136
6ec83f92 31372012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
3138
3139 * font.c (Ffont_at): Fix previous change.
3140
d2824928
EZ
31412012-10-19 Eli Zaretskii <eliz@gnu.org>
3142
e483264c
SM
3143 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3144 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
3145 for the reasons.
3146
d2824928
EZ
3147 * alloc.c (NSTATICS): Decrease to 0x800.
3148
f60d391f
SM
31492012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3150
4a0e1924 3151 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
3152 error (bug#12677).
3153
1a9327d5
JD
31542012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3155
3156 * nsterm.m (ns_select): Check writefds before call to
3157 FD_ISSET (Bug#12668).
3158
14145a1e
DC
31592012-10-18 Daniel Colascione <dancol@dancol.org>
3160
3161 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3162 (staticpro): If we run out of staticpro slots, die with an
3163 informative error instead of just calling emacs_abort.
3164
1f76f6f5
MR
31652012-10-18 Martin Rudalics <rudalics@gmx.at>
3166
3167 Fix two flaws reported by Dmitry Antipov.
3168 * window.c (Ftemp_output_buffer_show): Remove.
3169 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3170 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3171
fcf14875
EZ
31722012-10-17 Eli Zaretskii <eliz@gnu.org>
3173
1f76f6f5
MR
3174 * makefile.w32-in ($(BLD)/w32.$(O)):
3175 ($(BLD)/vm-limit.$(O)):
3176 ($(BLD)/term.$(O)):
3177 ($(BLD)/unexw32.$(O)):
3178 ($(BLD)/fileio.$(O)):
a68089e4
EZ
3179 ($(BLD)/dispnew.$(O)): Update dependencies.
3180
3181 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3182 Add prototypes.
3183
3184 * w32proc.c: Include ctype.h.
3185
3186 * w32.h (init_environment, check_windows_init_file)
3187 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3188 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3189 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3190 (sys_link): Add prototypes.
3191
3192 * w32.c: Include w32select.h.
3193 (sys_access, e_malloc, sys_select): Add prototypes.
3194 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3195
3196 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3197
3198 * unexw32.c: Include lisp.h and w32.h.
3199
3200 * term.c [WINDOWSNT]: Include w32term.h.
3201
3202 * process.c [WINDOWSNT]: Add prototype of sys_select.
3203
3204 * fileio.c [WINDOWSNT]: Include w32.h.
3205
3206 * dispnew.c [WINDOWSNT]: Include w32.h.
3207
fcf14875
EZ
3208 * cygw32.c (Fcygwin_convert_path_to_windows)
3209 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3210 Lisp_Object values. (Bug#12661)
3211
3212 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3213 to Lisp_Object. (Bug#12661)
3214
fe0b1ec4
KH
32152012-10-17 Kenichi Handa <handa@gnu.org>
3216
3217 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3218 invalidate.
3219
d556ebf9
DA
32202012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3221
3222 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 3223 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 3224
f0863a54
DA
32252012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3226
3227 Do not verify indirection counters of killed buffers (Bug#12579).
3228 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3229 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3230
12fbe755
DA
32312012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3232
3233 * alloc.c (Fmake_byte_code): Fix typo in comment.
3234 * print.c (print_interval): Define as static to match prototype.
3235 * indent.c (disptab_matches_widthtab, recompute_width_table):
3236 Convert to eassert.
3237
61655b89
DA
32382012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3239
3240 * editfns.c (get_system_name): Remove.
3241 * lisp.h (get_system_name): Remove prototype.
3242 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3243 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3244
9520f2f2
DC
32452012-10-15 Daniel Colascione <dancol@dancol.org>
3246
3247 * dbusbind.c: Add comment explaining reason for previous change.
3248
dca778d5
MR
32492012-10-15 Martin Rudalics <rudalics@gmx.at>
3250
3251 * window.c (Fwindow_end): Rewrite check whether cached position
3252 can be used (Bug#12600).
3253 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3254 Set windows_or_buffers_changed.
3255
3e0341b0
DC
32562012-10-15 Daniel Colascione <dancol@dancol.org>
3257
3258 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3259 enabled by undefining the symbol "interface", which the platform
3260 headers define to something incompatible.
3261
33d4113c
DC
32622012-10-14 Daniel Colascione <dancol@dancol.org>
3263
3264 * image.c (init_tiff_functions, init_imagemagick_functions)
3265 (init_svg_functions): Fix cygw32 build break by using these
3266 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3267
a36fb15e
JD
32682012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3269
3270 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3271
537f336d
JD
32722012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3273
3274 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3275
0ba06a77
KH
32762012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3277
3278 * coding.c (detect_coding): Set coding->id before calling
3279 this->detector.
3280
ce2fe65a
AS
32812012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3282
3283 * fileio.c: Formatting fixes.
3284
d6453ce4
PE
32852012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3286
3287 Fix some stat-related races.
3288 * fileio.c (Fwrite_region): Avoid race condition if a file is
3289 removed or renamed by some other process immediately after Emacs
3290 writes it but before Emacs stats it. Do not assume that stat (or
3291 fstat) succeeds.
3292 * image.c (slurp_file): Resolve the file name with fopen + fstat
3293 rather than stat + fopen.
3294 (pbm_read_file) [0]: Remove unused code with stat race.
3295 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
3296 Remove ineffective code with stat race.
3297
06485aa8
SM
32982012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3299
3300 * doc.c (get_doc_string): Don't signal an error if the file is missing.
3301
167e3640
JD
33022012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3303
3304 * nsterm.m (hold_event_q): New static variable.
3305 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
3306 ! q_event_ptr.
3307 (hold_event): New function.
3308 (ns_read_socket): If hold_event_q have events, store them and
3309 return (Bug#12384).
3310 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
3311 is zero (Bug#12384).
3312
c40239df
JB
33132012-10-12 Juanma Barranquero <lekktu@gmail.com>
3314
3315 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
3316
bb385a92
EZ
33172012-10-12 Eli Zaretskii <eliz@gnu.org>
3318
2a9f1099
EZ
3319 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
3320
bb385a92
EZ
3321 * fileio.c (check_existing): New function.
3322 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
3323 instead of calling 'stat', when what's needed is to check whether
3324 a file exists. This avoids expensive system calls on MS-Windows.
3325 (Bug#12587)
3326
8599b23a 3327 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
3328
3329 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
3330 determine whether a file exists and is not a directory.
3331
3332 * lisp.h (check_existing): Add prototype.
3333
2b9c2e68
JD
33342012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3335
3336 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
3337
81749a23
GM
33382012-10-12 Glenn Morris <rgm@gnu.org>
3339
3340 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
3341
5253a5fd
SM
33422012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3343
389a94a5
SM
3344 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
3345
5253a5fd
SM
3346 * eval.c (Fautoload): Remember previous autoload status in load-history.
3347
7cded46f
PE
33482012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3349
3350 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
3351 * lread.c (load_each_byte, new_backquote_flag, readchar)
3352 (read_filtered_event, lisp_file_lexically_bound_p)
3353 (safe_to_load_version, Fload, complete_filename_p, openp)
3354 (build_load_history, readevalloop, read_escape, read1)
3355 (string_to_number, read_vector, read_list):
3356 * macros.c (Fstart_kbd_macro):
3357 * marker.c (CONSIDER):
3358 * menu.c (parse_single_submenu, digest_single_submenu)
3359 (find_and_return_menu_selection, Fx_popup_menu):
3360 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
3361 (Ftry_completion):
3362 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
3363 (ns_menu_show):
3364 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
3365 (xmenu_show, xdialog_show):
3366 Use bool for booleans.
3367 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
3368 as it's not a predicate. All uses changed. Omit unnecessary
3369 buffer termination.
3370
549c3414
DA
33712012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
3372
3373 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
3374 (save_excursion_restore): Do not restore mark if it was not saved.
3375
e85aafe7
PE
33762012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3377
fd2f90cf
PE
3378 * marker.c (cached_modiff): EMACS_INT, not int.
3379
c1af190b
PE
3380 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
3381 instead of having a wrong decl.
e85aafe7
PE
3382 * nsmenu.m (waiting_for_input): Remove wrong decl.
3383
e738ca56
PE
33842012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3385
9fa1de30
PE
3386 keyboard.c, keymap.c: Use bool for booleans.
3387 * dispnew.c (sit_for): Distinguish between 3-way display_option
3388 and boolean do_display.
3389 * keyboard.c (single_kboard, this_command_key_count_reset)
3390 (waiting_for_input, echoing, immediate_quit, input_pending)
3391 (interrupt_input, interrupts_deferred, pop_kboard)
3392 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
3393 (command_loop_1, adjust_point_for_property)
3394 (safe_run_hooks_error, input_polling_used, read_char):
3395 (help_char_p, readable_events, kbd_buffer_events_waiting)
3396 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
3397 (lucid_event_type_list_p, get_input_pending):
3398 (gobble_input, menu_separator_name_p, menu_bar_item)
3399 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
3400 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
3401 (keyremap_step, test_undefined, read_key_sequence)
3402 (detect_input_pending, detect_input_pending_ignore_squeezables)
3403 (detect_input_pending_run_timers, requeued_events_pending_p)
3404 (quit_throw_to_read_char, Fset_input_interrupt_mode):
3405 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
3406 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
3407 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
3408 (accessible_keymaps_1, Fkey_description, push_key_description):
3409 (shadow_lookup, struct where_is_internal_data)
3410 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
3411 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
3412 (describe_map, describe_vector):
3413 * menu.c (single_menu_item):
3414 * nsmenu.m (ns_update_menubar):
3415 * process.c (wait_reading_process_output):
3416 * search.c (scan_buffer, scan_newline):
3417 Use bool for boolean.
3418 * keyboard.c (timers_run, swallow_events)
3419 (detect_input_pending_run_timers):
3420 * process.c (wait_reading_process_output):
3421 Use unsigned for counter where wraparound-on-overflow is desired,
3422 since unsigned is guaranteed to have that behavior and signed is not.
3423 (read_char): Use ptrdiff_t for string length.
3424 (get_input_pending): Remove first argument, since it was always
3425 the same pointer-to-int (now pointer-to-boolean) &input_pending,
3426 and behave as if it had that value. Return new value of
3427 input_pending. All callers changed.
3428 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
3429 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
3430 a string length.
3431 * keymap.c (push_key_description): Omit last arg, which was always 1.
3432 All callers changed.
3433
e738ca56
PE
3434 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
3435
29f21cdf
JB
34362012-10-10 Juanma Barranquero <lekktu@gmail.com>
3437
3438 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
3439 ($(BLD)/term.$(O)): Update dependencies.
3440
6aea7528
DA
34412012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3442
3443 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
3444 * lisp.h (enum pvec_type): Adjust comments and omit explicit
3445 initializer for PVEC_NORMAL_VECTOR.
3446
5f3f57be
PE
34472012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3448
3449 Clean out old termopts cruft.
3450 * termopts.h (flow_control, meta_key): Remove unused decls.
3451 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
3452 Don't include termopts.h.
3453
3e98c68e
DA
34542012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3455
3456 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
3457
77e344e5
PE
34582012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3459
3460 * commands.h (immediate_quit): Remove duplicate decl.
3461
5683d7cd
JD
34622012-10-09 Jan Djärv <jan.h.d@swipnet.se>
3463
3464 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
3465 caching.
3466 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 3467 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 3468
cf5fc6db
EZ
34692012-10-09 Eli Zaretskii <eliz@gnu.org>
3470
b15736e6
EZ
3471 * w32fns.c (w32_last_error): Change the return value to DWORD, to
3472 match what GetLastError returns. Explain why the function is
3473 needed.
3474
cf5fc6db
EZ
3475 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
3476 'is_tooltip_frame', to avoid confusion with its global namesake.
3477
f99714ce
DC
34782012-10-08 Daniel Colascione <dancol@dancol.org>
3479
3480 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
3481 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
3482 build that caused Emacs to display the hourglass cursor forever.
f99714ce 3483
fd59cb29
GM
3484 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
3485 which is broken under remote desktop, calculate the number of
3486 colors available for a display based on the display's number of
3487 planes and number of bits per pixel per plane. (bug#10397).
3488
62c480c9 34892012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 3490
62c480c9
JD
3491 * nsfont.m (Vfonts_in_cache): New variable.
3492 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
3493 are used. Add cached fonts to Vfonts_in_cache.
3494 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
3495
607446ba
JB
34962012-10-08 Juanma Barranquero <lekktu@gmail.com>
3497
fd5125ad
JB
3498 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
3499 in nt/config.nt.
46979e0b
JB
3500 (FONT_H): Define after FRAME_H.
3501 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
3502 Update dependencies.
fd5125ad 3503
607446ba
JB
3504 * w32term.c: Remove leftover declaration of keyboard_codepage.
3505
b6f4e300
EZ
35062012-10-08 Eli Zaretskii <eliz@gnu.org>
3507
c54ebba4
EZ
3508 * makefile.w32-in (FONT_H): Add $(FRAME_H).
3509 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
3510 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
3511 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
3512 ($(BLD)/unexw32.$(O)):
3513 ($(BLD)/w32.$(O)):
3514 ($(BLD)/w32console.$(O)):
3515 ($(BLD)/w32fns.$(O)):
3516 ($(BLD)/w32heap.$(O)):
3517 ($(BLD)/w32menu.$(O)):
15c720a3 3518 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 3519
b6f4e300
EZ
3520 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
3521 'const char *'.
3522 (x_to_w32_color): Don't modify the argument, modify a copy instead.
3523
501199a3
DC
35242012-10-08 Daniel Colascione <dancol@dancol.org>
3525
3526 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
3527 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
3528 accidental message numbering hole. Change other messages to
3529 match.
3530
3531 * w32select.h (HAVE_W32SELECT): Remove.
3532
3533 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 3534 w32common.h instead of w32heap.h.
501199a3
DC
3535
3536 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
3537 (get_allocation_unit, get_processor_type, get_w32_major_version)
3538 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3539 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3540 (OS_NT, os_subtype, cache_system_info): Move declarations to
3541 w32common.
3542
3543 * w32heap.c: Include w32common.h.
3544 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
3545 (w32_minor_version, w32_build_number, w32_subtype):
3546 Remove duplicate definitions.
501199a3
DC
3547
3548 * w32fns.c: Include w32common.h; include w32heap.h only in
3549 WINDOWSNT.
3550
3551 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
3552 Use `report_file_error' instead of `error' in order to better
3553 inform users of what went wrong. Increase NTGUI_UNICODE file
3554 dialog box file name length to 32k, the maximum allowed by the NT
3555 kernel.
3556
3557 * w32common.h: New file.
3558 (ROUND_UP, ROUND_DOWN, get_page_size)
3559 (get_allocation_unit, get_processor_type, get_w32_major_version)
3560 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3561 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3562 (OS_NT, os_subtype, cache_system_info): Move here.
3563
3564 * unexw32.c, unexcw.c: Include w32common.h.
3565
3566 * emacs.c (main): Use (defined (WINDOWSNT) || defined
3567 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
3568 to call syms_of_w32select.
3569
3570 * cygw32.h: Remove obsolete EXFUN declarations.
3571
3572 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
3573
3574 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
3575 of w32inevt.o from SOME_MACHINE_OBJECTS.
3576
93aa5c81
DC
35772012-10-08 Daniel Colascione <dancol@dancol.org>
3578
3579 * image.c: Permanent fix for JPEG compilation issue --- limit
3580 jpeglib `boolean' redefinition to Cygwin builds.
3581
d424f3d8
EZ
35822012-10-08 Eli Zaretskii <eliz@gnu.org>
3583
8ee4c6ce
EZ
3584 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
3585
d424f3d8
EZ
3586 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
3587 Cygwin.
3588
e08348a0
DC
35892012-10-08 Daniel Colascione <dancol@dancol.org>
3590
3591 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
3592 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
3593 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
3594 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
3595 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
3596 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
3597 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
3598 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
3599 now a supported configuration.
3600
3601 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 3602 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
3603
3604 * conf_post.h:
3605 (_DebPrint) declare tracing facility for W32 debugging. We need
3606 to unify tracing later.
3607
3608 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
3609 unconditional use of W32 Unicode functions. Cygwin runs only on
3610 100% Unicode operating systems.
3611
3612 * cygw32.c: New file. Define Cygwin-specific facilities.
3613 (Fcygwin_convert_path_to_windows)
3614 (Fcygwin_convert_path_from_windows): New user functions for
3615 accessing Cygwin path-munging routines.
3616
3617 * cygw32.h: New file.
3618 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
3619 UTF-16LE strings temporarily inside non-Lisp-visible string
3620 objects.
3621
3622 (w32_strerror): Just what it says on the tin.
3623
3624 * emacs.c: Make the NS fork-then-exec code for daemon-launching
3625 also run for Cygwin; both systems have the same problem with using
3626 GUI facilities in a forked child. Also call syms_of_cygw32,
3627 syms_of_w32select in correct places.
3628
3629 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
3630 needs fork-then-exec for daemon launching.
3631
3632 * font.h: Include frame.h.
3633
3634 * image.c: Use the image library cache machinery only when we're
3635 compiling for native WINDOWSNT; Cygwin can use shared libraries
3636 like any other Unixlike system.
3637
3638 * keyboard.c: Clarify a comment regarding the input loop.
3639
3640 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
3641 functions directly instead of trying to detect at runtime that our
3642 host operating system supports them. We make this change for two
3643 reasons: Cygwin lacks support for the multibyte character
3644 conversion functions used by the legacy menu code, and Cygwin
3645 never needs to rely on non-Unicode APIs.
3646
3647 * unexw32.c (hinst): Declare extern.
3648
3649 * w32.c: Change header order;
3650 (w32_strerror): Move to w32fns.c because we need it for
3651 non-WINDOWSNT builds.
3652
3653 * w32.h: Add #error macro to make sure we don't include w32.h for
3654 Cygwin builds. Remove w32select declarations.
3655
3656 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 3657 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
3658
3659 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
3660 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
3661 POSIXy alternative.
3662 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
3663 (w32_major_version, w32_minor_version, w32_build_number)
3664 (os_subtype, sound_type): Define here
3665 (w32_defined_color): Make color parameter const for consistency
3666 with other _defined_color functions.
3667 (w32_createwindow): Unconditionally call w32_init_class instead of
3668 doing so only when hprevinst is non-NULL. Plumbing hprevinst
3669 through the code is complex and unnecessary because class
3670 registration is practically free.
3671 (w32_name_of_message): New EMACSDEBUG-only function.
3672 (Fset_message_beep): Move here
3673 (Fx_open_connection): Require that the display name for Windows be
3674 "w32" for consistency, emacsclient disambiguation, and maybe, one
3675 day, multi-window-system support.
3676 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
3677 Cygwin files for W32 GUI facilities, since these clearly don't
3678 expect Cygwin names.
3679 (_DebPrint): Define.
3680 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
3681 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
3682 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
3683 (w32_last_error): Remove.
3684
3685 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
3686
3687 * w32heap.c (syspage_mask): Declare here.
3688 (cache_system_info): Remove.
3689
3690 * w32inevt.c (faked_key): Define globally, not statically.
3691 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
3692 (w32_console_toggle_lock_key): Move to w32fns.c.
3693
3694 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
3695
3696 * w32proc.c (_DebPrint): Move to w32fns.c.
3697 * w32select.c: Include string.h, stdio.h for Cygwin.
3698 * w32select.h: New File.
3699
3700 * w32term.c: Include io.h for non-CYGWIN builds; needed for
3701 get_osfhandle.
3702 (w32_message_fd): New variable. Under Cygwin, holds the file
3703 descriptor the system used to tell us about pending thread
3704 messages.
3705
3706 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
3707 that prevented compilation under non-WINDOWSNT systems.
3708
3709 (w32_initialize): Open /dev/windows and assign it to
3710 w32_message_fd. Provide w32 feature.
3711
3712 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
3713 (WM_EMACS_INPUT_READY): add.
3714 (prepend_msg, w32_message_fd): Declare globally.
3715
3716 * w32xfns.c:
3717 (keyboard_handle): Use only when WINDOWSNT.
3718 (notify_msg_ready): New function. Posts a message to the main
3719 thread's message queue under CYGWIN, which wakes up the main
3720 thread from select(2) by making the /dev/windows file descriptor
3721 ready. Under WINDOWSNT, it sets an event the same way the old
3722 code did.
3723
3724 (post, prepend_msg): Actually call notify_msg_ready instead of
3725 setting the input event directly.
3726
98daa893
EZ
37272012-10-07 Eli Zaretskii <eliz@gnu.org>
3728
3729 * ralloc.c (relinquish): If a heap is ready to be relinquished,
3730 but it still has blocs in it, don't return it to the system,
3731 instead of aborting. (Bug#12402)
3732
3bc0a2f7
JD
37332012-10-07 Jan Djärv <jan.h.d@swipnet.se>
3734
8ad5b73b 3735 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 3736
335f5ae4
JD
3737 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
3738 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
3739 (syms_of_nsterm): Remove comment about Panther and above for
3740 ns-antialias-text.
335f5ae4
JD
3741 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
3742 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
3743 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
3744
3745 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
3746 MAC_OS_X_VERSION_10_4.
3747
8ad5b73b
JD
3748 * nsmenu.m (fillWithWidgetValue:): Remove code for <
3749 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
3750
3751 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
3752
3753 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
3754 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
3755
3bc0a2f7
JD
3756 * nsterm.m (ns_in_resize): Remove (Bug#12479).
3757 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
3758 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
3759 Remove ns_in_resize check.
3bc0a2f7
JD
3760 (ns_clear_frame_area): Remove resize handle code.
3761
3762 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
3763 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
3764 Remove ns_in_resize check.
3bc0a2f7 3765
c622b48f
PE
37662012-10-07 Paul Eggert <eggert@cs.ucla.edu>
3767
3768 Improve sys_siglist detection.
3769 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
3770 defined as a macro, as is done in Solaris.
3771 (sys_siglist_entries): New macro.
3772 (save_strsignal): Use it.
3773 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
3774 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
3775
04fafa46
JD
37762012-10-06 Jan Djärv <jan.h.d@swipnet.se>
3777
3778 * nsfns.m (Fx_create_frame): Call x_default_parameter with
3779 fullscreen/Fullscreen.
3780
3781 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
3782 tobar_height is new.
3783
3784 * nsterm.m (x_make_frame_visible): Check for fullscreen.
3785 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
3786 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
3787 (windowDidResize:): Check for correct window if old style fullscreen.
3788 Capitalize word in comment. Remove incorrect comment.
3789 (initFrameFromEmacs:): tbar_height renamed tibar_height.
3790 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
3791 error in drawing background.
1f9f395d 3792 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
3793 Set toolbar values to zero, save old height in tobar_height.
3794 Restore tool bar height when leaving fullscreen.
3795 (canBecomeMainWindow): New function.
3796
c6e21c03
PE
37972012-10-06 Paul Eggert <eggert@cs.ucla.edu>
3798
3799 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
3800
0d9f584b
EZ
38012012-10-05 Eli Zaretskii <eliz@gnu.org>
3802
a65fbb5f
EZ
3803 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
3804
0d9f584b 3805 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
3806 that time stamps of directories could also be changed.
3807 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
3808 FILE_WRITE_ATTRIBUTES access rights.
3809
3810 * fileio.c (Fset_file_times): Special-case ignoring errors for
3811 directories only on MSDOS, not on MS-Windows.
3812
e8757f09 38132012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
3814
3815 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
3816
7604f298
EZ
38172012-10-04 Eli Zaretskii <eliz@gnu.org>
3818
3819 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
3820 see whether CreateFile failed.
3821
88d69b7d
PE
38222012-10-04 Paul Eggert <eggert@cs.ucla.edu>
3823
3824 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
3825 to avoid similar races.
3826 * keyboard.c (pending_signals): Now bool, not int.
3827
7509f454
PE
3828 Port timers to OpenBSD, plus check for timer failures.
3829 OpenBSD problem reported by Han Boetes.
3830 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
3831 and/or setitimer.
3832 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
3833 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
3834 like OpenBSD, which has timer_settime but does not declare it.
3835 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
3836 whether to use itimerspec-related primitives. All uses of
3837 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
3838
a3c5c0c5
PE
38392012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3840
3841 * profiler.c (handle_profiler_signal): Fix a malloc race
3842 that caused Emacs to hang on Fedora 17 when profiling Lisp.
3843
914e743b
JD
38442012-10-02 Jan Djärv <jan.h.d@swipnet.se>
3845
3846 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
3847
d8ab37a8
EZ
38482012-10-02 Eli Zaretskii <eliz@gnu.org>
3849
3850 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
3851 consistent with the change in return value of 'safe_strsignal'.
3852
b3ecad33
PE
38532012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3854
0a99eee1
PE
3855 Prefer plain 'static' to 'static inline' (Bug#12541).
3856 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
3857 (bidi_set_sor_type, bidi_push_embedding_level)
3858 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
3859 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
3860 (bidi_cache_search, bidi_cache_ensure_space)
3861 (bidi_cache_iterator_state, bidi_cache_find)
3862 (bidi_peek_at_next_level, bidi_set_paragraph_end)
3863 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3864 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
3865 Now 'static', not 'static inline'.
3866
b3ecad33
PE
3867 Count overruns when profiling; change units to ns.
3868 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
3869 Give extra weight to samples after overruns, to attempt to count
3870 the time more accurately.
3871 (setup_cpu_timer): Change sampling interval units from ms to ns, since
3872 the underlying primitives nominally do ns.
3873 (Fprofiler_cpu_start): Document the change. Mention that
3874 the sampling intervals are only approximate.
3875
090cf9db
SM
38762012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
3877
3878 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
3879
3880 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
3881 case for the special 0 coding-system.
3882
3883 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
3884 (Fmake_overlay): Remove redundant tests.
64edc777 3885 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 3886
81550bf4
JB
38872012-10-02 Juanma Barranquero <lekktu@gmail.com>
3888
3889 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
3890 Update dependencies.
3891
aa1ba90e
PE
38922012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3893
3894 Fix a malloc race condition involving strsignal.
3895 A signal can arrive in the middle of a malloc, and Emacs's signal
3896 handler can invoke strsignal, which can invoke malloc, which is
3897 not portable. This race condition bug makes Emacs hang on GNU/Linux.
3898 Fix it by altering the signal handler so that it does not invoke
3899 strsignal.
3900 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
3901 * process.c (status_message): Use const pointer, in case strsignal
3902 is #defined to safe_strsignal.
3903 * sysdep.c (sys_siglist, init_signals): Always define and
3904 initialize a substitute sys_siglist if the system does not define
3905 one, even if HAVE_STRSIGNAL.
3906 (safe_strsignal): Rename from strsignal. Always define,
3907 using sys_siglist. Return a const pointer.
3908 * syssignal.h (safe_strsignal): New decl.
3909 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
3910
ace917bd
EZ
39112012-10-01 Eli Zaretskii <eliz@gnu.org>
3912
3913 * w32proc.c (timer_loop): Fix code that waits for timer
3914 expiration, to avoid high CPU usage.
3915
9eb71b9c
SM
39162012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
3917
3918 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
3919 (sweep_weak_table): Remove redundant prototypes.
3920
b3317662
FP
39212012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
3922
3923 * emacs.c: Move the inclusion of TERM_HEADER after including
3924 windows.h on WINDOWSNT. This avoids compilation problems with
3925 MSVC.
3926
f0e5f225
EZ
39272012-10-01 Eli Zaretskii <eliz@gnu.org>
3928
2d7d1608
EZ
3929 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
3930 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
3931 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
3932 as the previous version used 'void *'.
3933
3934 * ralloc.c (ROUNDUP): Fix last change.
3935 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
3936 'size_t'.
3937
f0e5f225
EZ
3938 * w32proc.c <disable_itimers>: New static flag.
3939 (init_timers): Initialize it to zero, after creating the critical
3940 sections used by the timer threads.
3941 (term_timers): Set to 1 before deleting the critical sections.
3942 (getitimer, setitimer): If disable_itimers is non-zero, return an
3943 error indication without doing anything. Reported by Fabrice
3944 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
3945 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
3946 return results.
3947 [!HAVE_SETITIMER]: Behave as the previous version that didn't
3948 support timers.
f0e5f225
EZ
3949
3950 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
3951 term_ntproc after all the other bookkeeping, to get timers working
3952 as long as possible.
3953
82ef37c1
PE
39542012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3955
b3a4c387
PE
3956 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
3957 Suggested by Juri Linkov in
3958 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
3959
b0ab8123
PE
3960 Prefer plain 'static' to 'static inline' (Bug#12541).
3961 With static functions, modern compilers inline pretty well by
3962 themselves; advice from programmers often hurts as much as it helps.
3963 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
3964 this change shrinks the text size of the Emacs executable by 1.1%
3965 without affecting CPU significantly in my benchmark.
3966 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
3967 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
3968 (mark_maybe_object, mark_maybe_pointer, bounded_number):
3969 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3970 (bset_auto_fill_function, bset_auto_save_file_format)
3971 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3972 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3973 (bset_cache_long_line_scans, bset_case_fold_search)
3974 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3975 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3976 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3977 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3978 (bset_header_line_format, bset_indicate_buffer_boundaries)
3979 (bset_indicate_empty_lines, bset_invisibility_spec)
3980 (bset_left_fringe_width, bset_major_mode, bset_mark)
3981 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3982 (bset_name, bset_overwrite_mode, bset_pt_marker)
3983 (bset_right_fringe_width, bset_save_length)
3984 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3985 (bset_scroll_up_aggressively, bset_selective_display)
3986 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3987 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
3988 (set_buffer_overlays_after):
3989 * category.c (bset_category_table):
3990 * charset.c (read_hex):
3991 * coding.c (produce_composition, produce_charset)
3992 (handle_composition_annotation, handle_charset_annotation)
3993 (char_encodable_p):
3994 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
3995 (assign_row, set_frame_matrix_frame, make_current)
3996 (add_row_entry):
3997 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
3998 * fns.c (maybe_resize_hash_table):
3999 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4000 * gmalloc.c (register_heapinfo):
4001 * image.c (lookup_image_type):
4002 * intervals.c (set_interval_object, set_interval_left)
4003 (set_interval_right, copy_interval_parent, rotate_right)
4004 (rotate_left, balance_possible_root_interval):
4005 * keyboard.c (kset_echo_string, kset_kbd_queue)
4006 (kset_keyboard_translate_table, kset_last_prefix_arg)
4007 (kset_last_repeatable_command, kset_local_function_key_map)
4008 (kset_overriding_terminal_local_map, kset_real_last_command)
4009 (kset_system_key_syms, clear_event, set_prop):
4010 * lread.c (digit_to_number):
4011 * marker.c (attach_marker, live_buffer, set_marker_internal):
4012 * nsterm.m (ns_compute_glyph_string_overhangs):
4013 * process.c (pset_buffer, pset_command)
4014 (pset_decode_coding_system, pset_decoding_buf)
4015 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4016 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4017 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4018 * syntax.c (bset_syntax_table, dec_bytepos):
4019 * terminal.c (tset_param_alist):
4020 * textprop.c (interval_has_some_properties)
4021 (interval_has_some_properties_list):
4022 * window.c (wset_combination_limit, wset_dedicated)
4023 (wset_display_table, wset_hchild, wset_left_fringe_width)
4024 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4025 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4026 (wset_right_fringe_width, wset_right_margin_cols)
4027 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4028 (wset_vertical_scroll_bar_type, wset_window_parameters):
4029 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4030 (wset_column_number_displayed, wset_region_showing)
4031 (window_box_edges, run_window_scroll_functions)
4032 (append_glyph_string_lists, prepend_glyph_string_lists)
4033 (append_glyph_string, set_glyph_string_background_width)
4034 (append_glyph, append_composite_glyph)
4035 (take_vertical_position_into_account):
4036 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4037 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4038 (lface_hash, lface_same_font_attributes_p, lookup_face):
4039 * xml.c (libxml2_loaded_p):
4040 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4041 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4042 Now 'static', not 'static inline'.
4043
05584c31
PE
4044 * bidi.c: Tune.
4045 (bidi_copy_it): Do the whole copy with a single memcpy.
4046 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4047
86ec63ba
PE
4048 Revert the FOLLOW-SYMLINKS change for file-attributes.
4049 Doing it right would require several changes to Tramp, and there's
4050 not enough time to get that tested before the freeze today.
4051 * dired.c (directory_files_internal, Ffile_attributes):
4052 Undo last change.
4053
82ef37c1
PE
4054 * frame.c (x_report_frame_params): Port better to wider ints.
4055 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4056 or that pointers can be printed in 15 decimal digits.
4057 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4058
62aba0d4
FP
40592012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4060
4061 Support x64 build on MS-Windows.
4062 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4063 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4064 compatibility with x64.
5e4daaf3 4065 (x_get_focus_frame): Add prototype.
62aba0d4
FP
4066
4067 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4068 defining an XRectangle structure.
4069
4070 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4071 arithmetics for compatibility with x64.
4072
4073 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4074 compatibility with x64.
4075
4076 * w32heap.h: Adjust prototypes and declarations.
4077
4078 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4079 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4080 DWORD, long, and unsigned long, for compatibility with x64.
4081 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4082 (sbrk): Argument is now of type ptrdiff_t.
4083
4084 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4085 less than 0x0500.
4086 (w32_msg_pump): Use WPARAM type for 'result'.
4087
4088 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4089 architecture.
4090 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4091 compatibility with x64.
4092
4093 * vm-limit.c (lim_data): Now size_t.
4094 (check_memory_limits): Adjust prototypes of real_morecore and
4095 __morecore to receive argument of type ptrdiff_t. Use size_t for
4096 five_percent and data_size.
4097
4098 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4099 variables, for compatibility with x64.
4100 (rva_to_section, offset_to_section, relocate_offset)
4101 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4102 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4103 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4104 for compatibility with x64.
4105
4106 * sysdep.c (STDERR_FILENO): Define if not already defined.
4107
4108 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4109 (__morecore): Argument type is now ptrdiff_t.
4110 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4111 (relinquish): Use ptrdiff_t type for 'excess'.
4112 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4113
4114 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4115 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4116 instead of a literal number.
4117
4118 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4119 (min): Define only if not already defined.
4120
4121 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4122 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4123 hosts.
4124
4125 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4126 'bitmaps' is a pointer.
4127
4128 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4129
4130 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4131
e7a2937b
PE
41322012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4133
4134 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4135 * dired.c (directory_files_internal, Ffile_attributes):
4136 New arg follow_symlinks. All uses changed.
4137
b43d62ae
SM
41382012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4139
4140 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4141
c06c382a
EZ
41422012-09-30 Eli Zaretskii <eliz@gnu.org>
4143
4144 Support atimers and CPU profiler via profile.c on MS-Windows.
4145 * w32proc.c (sig_mask, crit_sig): New static variables.
4146 (sys_signal): Support SIGALRM and SIGPROF.
4147 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 4148 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
4149 sigfillset, and sigprocmask are no longer no-ops.
4150 (sigismember): New function.
4151 (struct itimer_data): New definition.
4152 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4153 (crit_prof): New static variables.
4154 (MAX_SINGLE_SLEEP): New definition.
4155 (timer_loop, stop_timer_thread, term_timers, init_timers)
4156 (start_timer_thread, getitimer, setitimer): New functions.
4157 (alarm): No longer a no-op, calls setitimer.
4158
4159 * w32.c (term_ntproc): Call term_timers.
4160 (init_ntproc): Make sure all signals are unblocked at startup, to
4161 erase any traces of dumping. Call init_timers.
4162
4163 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4164 Windows-specific code to display the hourglass mouse pointer is no
4165 longer used.
4166 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4167 to hourglass timer expiration.
4168 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4169 Remove, no longer used.
b43d62ae
SM
4170 (w32_note_current_window, show_hourglass, hide_hourglass):
4171 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
4172 window systems.
4173 (syms_of_w32fns): Don't initialize hourglass_timer.
4174
4175 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4176 WINDOWSNT as well.
4177 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4178
4179 * w32.h (init_timers, term_timers): Add prototypes.
4180
95402d5f
KH
41812012-09-30 Kenichi Handa <handa@gnu.org>
4182
4183 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4184 to the buffer relocation which may be caused by ccl_driver.
4185
dd946752
JD
41862012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4187
d7e642cc
JD
4188 * xfns.c (Fx_file_dialog): Update comment.
4189
4190 * w32fns.c (Fx_file_dialog): Update comment.
4191
4192 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4193 Initialize panel name field if OSX >= 10.6.
4194
4195 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4196
dd946752
JD
4197 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4198
4199 * nsterm.m (NEW_STYLE_FS): New define.
4200 (ns_fullscreen_hook, windowWillEnterFullScreen)
4201 (windowDidEnterFullScreen, windowWillExitFullScreen)
4202 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4203 (setFSValue): New functions.
4204 (EmacsFSWindow): New implementation.
4205 (canBecomeKeyWindow): New function for EmacsFSWindow.
4206 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4207 (dealloc): Release nonfs_window if in fullscreen.
4208 (updateFrameSize:): Call windowDidMove to update top/left.
4209 (windowWillResize:toSize:): Check if frame is still maximized.
4210 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4211 next_maximized, maximized_width, maximized_height and nonfs_window.
4212 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4213 tbar_height.
4214 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 4215 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
4216
4217 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4218 (EmacsView): Add variables for fullscreen.
4219 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4220 (EmacsFSWindow): New interface for fullscreen.
4221
427730eb
JB
42222012-09-30 Juanma Barranquero <lekktu@gmail.com>
4223
4224 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4225
48de8b12
CY
42262012-09-30 Chong Yidong <cyd@gnu.org>
4227
4228 * fns.c (Frandom): Doc fix.
4229
5938d519
MR
42302012-09-30 Martin Rudalics <rudalics@gmx.at>
4231
4232 * window.c (Vwindow_combination_limit): New default value.
4233 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4234
cb5b0266
PE
42352012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4236
4237 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4238 Suggested by Eli Zaretskii in
4239 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4240
84f72efd
EZ
42412012-09-30 Eli Zaretskii <eliz@gnu.org>
4242
4243 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4244 HAVE_TIMER_SETTIME is defined.
4245
9d4dcdc9
PE
42462012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4247
d89460ed
PE
4248 Profiler improvements: more-accurate timers, overflow checks.
4249 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4250 signal.h, setjmp.h. Include systime.h instead.
4251 (saturated_add): New function.
4252 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4253 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4254 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4255 New static vars.
84f72efd 4256 (enum profiler_cpu_running): New enum.
d89460ed
PE
4257 (profiler_cpu_running): Now of that enum type, not bool.
4258 All uses changed to store the new value.
4259 (handle_profiler_signal): Rename from sigprof_handler_1,
4260 for consistency with other handlers. Do not check whether
4261 cpu_log is a hash-table if garbage collecting, since it
4262 doesn't matter in that case.
4263 (deliver_profiler_signal): Rename from sigprof_handler,
4264 for consistency with other handlers.
4265 (setup_cpu_timer): New function, with much of what used to be in
4266 Fprofiler_cpu_start. Check for out-of-range argument.
4267 Prefer timer_settime if available, and prefer
4268 thread cputime clocks, then process cputime clocks, then
4269 monotonic clocks, to the old realtime clock. Use make_timeval
4270 to round more-correctly when falling back to setitimer.
4271 (Fprofiler_cpu_start): Use it.
4272 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4273 Don't assume that passing NULL as the 2nd argument of setitimer
4274 is the same as passing a pointer to all-zero storage.
4275 Ignore SIGPROF afterwards.
4276 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4277 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4278 non-fatal signal handlers. Ignore SIGPROF on startup.
4279 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4280 in profiler.c, since sysdep.c now uses it.
4281
9d4dcdc9
PE
4282 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4283 Suggested by Eli Zaretskii in
4284 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4285
8e5691a0
JB
42862012-09-29 Juanma Barranquero <lekktu@gmail.com>
4287
4288 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4289
e7c1b6ef
SM
42902012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
4291
4292 * lisp.h (struct backtrace): Remove indirection for `function' field.
4293 * xdisp.c (redisplay_internal):
4294 * profiler.c (record_backtrace, sigprof_handler_1):
4295 * alloc.c (Fgarbage_collect):
4296 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
4297 (Fbacktrace_frame): Adjust accordingly.
4298
e61d39cd 42992012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
4300
4301 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
4302 (Frun_hook_with_args_until_failure): Doc fixes.
4303
404043ea
EZ
43042012-09-28 Eli Zaretskii <eliz@gnu.org>
4305
4306 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
4307 Qautomatic_redisplay and change the symbol name. All users changed.
4308
704d3f45
TM
43092012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
4310
4311 * profiler.c (sigprof_handler): Fix race condition.
4312
757140ff
GM
43132012-09-28 Glenn Morris <rgm@gnu.org>
4314
4315 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4316
a615a3ae
PE
43172012-09-27 Paul Eggert <eggert@cs.ucla.edu>
4318
4319 Check more robustly for timer_settime.
89d17fd0
PE
4320 * Makefile.in (LIB_TIMER_TIME): New macro.
4321 (LIBES): Add it.
a615a3ae
PE
4322 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
4323 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
4324 call timer_settime.
4325
3670daf7
TM
43262012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4327
4328 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
4329
6a586b7f
JB
43302012-09-26 Juanma Barranquero <lekktu@gmail.com>
4331
4332 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4333
41c8bfcf
PE
43342012-09-26 Paul Eggert <eggert@cs.ucla.edu>
4335
4336 * character.h (MAYBE_UNIFY_CHAR): Remove.
4337 * charset.c, charset.h (maybe_unify_char): Now static.
4338 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
4339 Since this stuff is now private to charset.c, there's no need for
4340 a public macro and no need to inline by hand.
4341
3a880af4
SM
43422012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4343 Stefan Monnier <monnier@iro.umontreal.ca>
4344 Juanma Barranquero <lekktu@gmail.com>
611b7507 4345
3a880af4
SM
4346 * profiler.c: New file.
4347 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
4348 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
4349 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
4350 * emacs.c (main): Call syms_of_profiler.
4351 * alloc.c (Qautomatic_gc): New constant.
4352 (MALLOC_PROBE): New macro.
4353 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
4354 (total_bytes_of_live_objects): New function.
4355 (Fgarbage_collect): Use it. Record itself in backtrace_list.
4356 Call malloc_probe for the memory profiler.
4357 (syms_of_alloc): Define Qautomatic_gc.
4358 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
4359 race condition.
4360 (struct backtrace): Move definition...
4361 * lisp.h (struct backtrace): ..here.
4362 (Qautomatic_gc, profiler_memory_running): Declare vars.
4363 (malloc_probe, syms_of_profiler): Declare functions.
4364 * xdisp.c (Qautomatic_redisplay): New constant.
4365 (redisplay_internal): Record itself in backtrace_list.
4366 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 4367
5938d519 43682012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
43692012-09-25 Juanma Barranquero <lekktu@gmail.com>
4370
4371 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
4372
e26fd2e4
PE
43732012-09-25 Paul Eggert <eggert@cs.ucla.edu>
4374
4375 Prefer POSIX timers if available.
4376 They avoid a race if the timer is too close to the current time.
4377 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
4378 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 4379 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 4380
eedec3ee
EZ
43812012-09-25 Eli Zaretskii <eliz@gnu.org>
4382
4383 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
4384 CHAR_STRING_ADVANCE.
4385 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
4386 STRING_CHAR_ADVANCE.
4387
aa15c6bb
JB
43882012-09-25 Juanma Barranquero <lekktu@gmail.com>
4389
4390 Move Vlibrary_cache to emacs.c and reset before dumping.
4391
4392 * lisp.h (reset_image_types): Declare.
4393 [WINDOWSNT] (Vlibrary_cache): Declare.
4394
4395 * image.c (reset_image_types): New function.
4396
4397 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
4398 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
4399 (Fdump_emacs): Reset Vlibrary_cache and image_types.
4400
4401 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
4402 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
4403
4404 * w32.h (Vlibrary_cache): Do not declare.
4405
54d629be
EZ
44062012-09-25 Eli Zaretskii <eliz@gnu.org>
4407
16b22fef
EZ
4408 * w32proc.c (sys_signal): Handle all signals defined by the
4409 MS-Windows runtime, not just SIGCHLD. Actually install the signal
4410 handlers for signals supported by Windows. Don't override
4411 term_ntproc as the handler for SIGABRT.
4412 (sigaction): Rewrite to call sys_signal instead of duplicating its
4413 code.
4414 (sys_kill): Improve commentary.
4415
4416 * w32.c (term_ntproc): Accept (and ignore) one argument, for
4417 consistency with a signature of a signal handler. All callers
4418 changed.
4419 (init_ntproc): Accept an argument DUMPING. If dumping, don't
4420 install term_ntproc as a signal handler for SIGABRT, as that
4421 should be done by the dumped Emacs.
4422
4423 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
4424
4425 * w32select.c (term_w32select): Protect against repeated
4426 invocation by setting clipboard_owner to NULL after calling
4427 DestroyWindow.
4428
4429 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
4430 and term_ntproc to their modified signatures.
4431
54d629be
EZ
4432 * character.c (char_string, string_char): Remove calls to
4433 MAYBE_UNIFY_CHAR. See the discussion starting at
4434 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
4435 for the details.
4436
59f7af81
CY
44372012-09-25 Chong Yidong <cyd@gnu.org>
4438
4439 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
4440
22e8cf4a
SM
44412012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
4442
4443 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
4444 when encountering an unknown bytecode.
4445
578098f3
PE
44462012-09-24 Paul Eggert <eggert@cs.ucla.edu>
4447
4448 image.c, indent.c: Use bool for booleans.
4449 * dispextern.h (struct image_type): Members valid_p, load, init
4450 now return bool, not int. All uses changed.
4451 * image.c: Omit unnecessary static decls.
4452 (x_create_bitmap_mask, x_build_heuristic_mask):
4453 Return void, not int, since callers don't care about the return value.
4454 (x_create_bitmap_mask, define_image_type, valid_image_p)
4455 (struct image_keyword, parse_image_spec, image_spec_value)
4456 (check_image_size, image_background)
4457 (image_background_transparent, x_clear_image_1)
4458 (postprocess_image, lookup_image, x_check_image_size)
4459 (x_create_x_image_and_pixmap, xbm_image_p)
4460 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
4461 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
4462 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
4463 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
4464 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
4465 (png_image_p, init_png_functions, png_load_body, png_load)
4466 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
4467 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
4468 (init_gif_functions, gif_load, imagemagick_image_p)
4469 (imagemagick_load_image, imagemagick_load, svg_image_p)
4470 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
4471 (gs_load):
4472 * nsimage.m (ns_load_image):
4473 * nsterm.m (ns_defined_color):
4474 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
4475 * xfns.c (x_defined_color):
4476 * xterm.c (x_alloc_lighter_color_for_widget)
4477 (x_alloc_nearest_color_1, x_alloc_nearest_color)
4478 (x_alloc_lighter_color):
4479 * indent.c (disptab_matches_widthtab, current_column)
4480 (scan_for_column, string_display_width, indented_beyond_p)
4481 (compute_motion, vmotion, Fvertical_motion):
4482 Use bool for booleans.
4483
a5f2b6ec
CY
44842012-09-24 Chong Yidong <cyd@gnu.org>
4485
4486 * chartab.c (Fset_char_table_default): Obsolete function removed.
4487
18e27ea8
PE
44882012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4489
afea8a8a
PE
4490 Move pid_t related decls out of lisp.h.
4491 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
4492 (interruptible_wait_for_termination):
4493 Move these decls from lisp.h to syswait.h, since they use pid_t.
4494 Needed on FreeBSD; see Herbert J. Skuhra in
4495 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
4496 * callproc.c: Include syswait.h.
4497
18e27ea8
PE
4498 gnutls.c, gtkutil.c: Use bool for boolean.
4499 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
4500 (emacs_gnutls_handle_error):
4501 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
4502 (xg_hide_tooltip, xg_create_frame_widgets)
4503 (create_dialog, xg_uses_old_file_dialog)
4504 (xg_get_file_with_chooser, xg_get_file_with_selection)
4505 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
4506 (xg_item_label_same_p, xg_update_menubar)
4507 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
4508 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
4509 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
4510 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
4511 (update_frame_tool_bar, free_frame_tool_bar):
4512 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
4513 * nsmenu.m (ns_update_menubar):
4514 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
4515 * xfns.c (Fx_show_tip) [USE_GTK]:
4516 Use bool for boolean.
4517 * gtkutil.c (xg_update_frame_menubar):
4518 * xmenu.c (update_frame_menubar):
4519 Return void, not int, since caller ignores return value.
4520 * gtkutil.c (xg_change_toolbar_position):
4521 Return void, not 1.
4522
af0e9f75
JB
45232012-09-23 Juanma Barranquero <lekktu@gmail.com>
4524
4525 * makefile.w32-in (BLOCKINPUT_H): Remove.
4526 (SYSSIGNAL_H): New macro.
4527 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
4528 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
4529 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
4530 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
4531 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
4532 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
4533 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
4534 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
4535 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
4536 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
4537 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
4538 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
4539 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
4540 ($(BLD)/w32xfns.$(O)): Update dependencies.
4541
5101529e
EZ
45422012-09-23 Eli Zaretskii <eliz@gnu.org>
4543
4544 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
4545 fatal_error_backtrace.
4546
4547 * w32proc.c (sys_kill): Undo last change: don't do anything when
4548 invoked to deliver SIGABRT to our own process. This is now
4549 handled by emacs_raise.
4550
2c3ee0ad
JB
45512012-09-23 Juanma Barranquero <lekktu@gmail.com>
4552
4553 * w32term.c (w32_read_socket): Remove leftover reference to
4554 interrupt_input_pending.
4555
62a1d661
PE
45562012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4557
4558 Do not use SA_NODEFER.
4559 Problem reported by Dani Moncayo in
4560 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
4561 * alloc.c (die):
4562 * sysdep.c (emacs_abort): Do not reset signal handler.
4563 * emacs.c (terminate_due_to_signal): Reset signal handler here.
4564 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
4565 wanted even on POSIXish hosts, and it doesn't work on Windows.
4566
a0942b9a
JD
45672012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4568
4569 * xterm.c (x_term_init): Call fixup_locale before and after calling
4570 gtk_init (Bug#12392).
4571
d07ff9db
CY
45722012-09-23 Chong Yidong <cyd@gnu.org>
4573
4574 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
4575 Vdynamic_library_alist.
4576
4577 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
4578 (Fgnutls_available_p): Caller changed.
4579
4580 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
4581 (Flibxml_parse_xml_region): Likewise.
4582
4583 * dispextern.h (struct image_type): Remove arg from init function.
4584
4585 * image.c (Finit_image_library, lookup_image_type)
4586 (define_image_type): Remove now-unneeded second arg.
4587 (init_xpm_functions, init_png_functions, init_jpeg_functions)
4588 (init_tiff_functions, init_gif_functions, init_svg_functions):
4589 Arglist and w32_delayed_load calling convention changed.
4590 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 4591 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 4592
4d7e6e51
PE
45932012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4594
4595 Simplify and avoid signal-handling races (Bug#12471).
4596 * alloc.c (die):
4597 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
4598 Avoid recursive loop if there's a fatal error in the function itself.
4599 * atimer.c (pending_atimers):
4600 * blockinput.h: Don't include "atimer.h"; no longer needed.
4601 (interrupt_input_pending): Remove. All uses removed.
4602 pending_signals now counts both atimers and ordinary interrupts.
4603 This is less racy than having three separate pending-signal flags.
4604 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
4605 (input_blocked_p):
4606 Rename from their upper-case counterparts BLOCK_INPUT,
4607 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
4608 INPUT_BLOCKED_P, and turn into functions. All uses changed.
4609 This makes it easier to access volatile variables more accurately.
4610 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
4611 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
4612 that's more reliable if the code is buggy and sets
4613 interrupt_input_blocked to a negative value. All uses changed.
4614 * atimer.c (deliver_alarm_signal):
4615 Remove. No need to deliver this to the parent; any thread can
4616 handle this signal now. All uses replaced by underlying handler.
4617 * atimer.c (turn_on_atimers):
4618 * dispnew.c (handle_window_change_signal):
4619 * emacs.c (handle_danger_signal):
4620 * keyboard.c (kbd_buffer_get_event):
4621 Don't reestablish signal handler; not needed with sigaction.
4622 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
4623 (UNBLOCK_INPUT_TO):
4624 Rework to avoid unnecessary accesses to volatile variables.
4625 (UNBLOCK_INPUT_TO): Now a function.
4626 (totally_unblock_input, unblock_input): New decls.
4627 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
4628 (init_data): Remove. Necessary stuff now done in init_signal.
4629 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
4630 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
4631 (fatal_error_code): Remove; no longer needed.
4632 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
4633 it doesn't always backtrace. All uses changed. No need to reset
4634 signal to default, since sigaction and/or die does that for us now.
4635 Use emacs_raise (FOO), not kill (getpid (), FOO).
4636 (main): Check more-accurately whether we're dumping.
4637 Move fatal-error setup to sysdep.c
4638 * floatfns.c: Do not include "syssignal.h"; no longer needed.
4639 * gtkutil.c (xg_get_file_name, xg_get_font):
4640 Remove no-longer-needed signal-mask manipulation.
4641 * keyboard.c, process.c (POLL_FOR_INPUT):
4642 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
4643 * keyboard.c (read_avail_input): Remove.
4644 All uses replaced by gobble_input.
4645 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
4646 (kbd_buffer_store_event_hold, gobble_input):
4647 (record_asynch_buffer_change) [USABLE_SIGIO]:
4648 (store_user_signal_events):
4649 No need to mess with signal mask.
4650 (gobble_input): If blocking input and there are terminals, simply
4651 set pending_signals to 1 and return. All hooks changed to not
4652 worry about whether input is blocked.
4653 (process_pending_signals): Clear pending_signals before processing
4654 them, in case a signal comes in while we're processing.
4655 By convention callers now test pending_signals before calling us.
4656 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
4657 New functions, to support changes to blockinput.h.
4658 (handle_input_available_signal): Now extern.
4659 (reinvoke_input_signal): Remove. All uses replaced by
4660 handle_async_input.
4661 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
4662 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
4663 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
4664 Clear sigmask reliably, even if Fsignal returns, which it can.
4665 Omit unnecessary accesses to volatile var.
4666 (quit_throw_to_read_char): No need to restore sigmask.
4667 * keyboard.c (gobble_input, handle_user_signal):
4668 * process.c (wait_reading_process_output):
4669 Call signal-handling code rather than killing ourselves.
4670 * lisp.h: Include <float.h>, for...
4671 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
4672 (pending_signals): Now volatile.
4673 (syms_of_data): Now const if IEEE floating point.
4674 (handle_input_available_signal) [USABLE_SIGIO]:
4675 (terminate_due_to_signal, record_child_status_change): New decls.
4676 * process.c (create_process): Avoid disaster if memory is exhausted
4677 while we're processing a vfork, by tightening the critical section
4678 around the vfork.
4679 (send_process_frame, process_sent_to, handle_pipe_signal)
4680 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
4681 ignores SIGPIPE.
4682 (send_process): No need for setjmp/longjmp any more, since the
4683 SIGPIPE stuff is now gone. Instead, report an error if errno
4684 is EPIPE.
4685 (record_child_status_change): Now extern. PID and W are now args.
4686 Return void, not bool. All callers changed.
4687 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
4688 Remove. All uses removed. This bug should be fixed now in a
4689 different way.
4690 (wait_for_termination_1): Use waitpid rather than sigsuspend,
4691 and record the child status change directly. This avoids the
4692 need to futz with the signal mask.
4693 (process_fatal_action): Move here from emacs.c.
4694 (emacs_sigaction_flags): New function, containing
4695 much of what used to be in emacs_sigaction_init.
4696 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
4697 caught by emacs, to make races less likely.
4698 (deliver_process_signal): Rename from handle_on_main_thread.
4699 All uses changed.
4700 (BACKTRACE_LIMIT_MAX): Now at top level.
4701 (thread_backtrace_buffer, threadback_backtrace_pointers):
4702 New static vars.
4703 (deliver_thread_signal, deliver_fatal_thread_signal):
4704 New functions, for more-accurate delivery of thread-specific signals.
4705 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
4706 (deliver_arith_signal): Handle in this thread, not
4707 in the main thread, since it's triggered by this thread.
4708 (maybe_fatal_sig): New function.
4709 (init_signals): New arg DUMPING so that we can be more accurate
4710 about whether we're dumping. Caller changed.
4711 Treat thread-specific signals differently from process-general signals.
4712 Block all signals while handling fatal error; that's safer.
4713 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
4714 on IEEE hosts.
4715 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
4716 Ignore SIGPIPE unless batch.
4717 (emacs_backtrace): Output backtrace for the appropriate thread,
4718 which is not necessarily the main thread.
4719 * syssignal.h: Include <stdbool.h>.
4720 (emacs_raise): New macro.
4721 * xterm.c (x_connection_signal): Remove; no longer needed
4722 now that we use sigaction.
4723 (x_connection_closed): No need to mess with sigmask now.
4724 (x_initialize): No need to reset SIGPIPE handler here, since
4725 init_signals does this for us now.
4726
8f4635e9
JD
47272012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4728
4729 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 4730 background rect may be larger (Bug#12245).
8f4635e9 4731
3296976d
CY
47322012-09-23 Chong Yidong <cyd@gnu.org>
4733
4734 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
4735
d41e491e
PE
47362012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4737
4738 * .gdbinit: Just stop at fatal_error_backtrace.
4739 See Stefan Monnier's request in
4740 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
4741 Remove no-longer-used query of system type.
4742
c88b867f
CY
47432012-09-22 Chong Yidong <cyd@gnu.org>
4744
4745 * search.c (Freplace_match): Doc fix (Bug#12325).
4746
4747 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
4748
4749 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
4750 (Fline_end_position): Doc fix.
4751
4752 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
4753
bb4d86b4
CY
47542012-09-22 Chong Yidong <cyd@gnu.org>
4755
4756 * dispextern.h (struct image_type): Add new slot, storing a type
4757 initialization function.
4758
4759 * image.c (define_image_type): Call the image initializer function
4760 if it is defined. Arguments and return value changed.
4761 (valid_image_p, make_image): Callers changed.
4762 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
4763 (gif_type, imagemagick_type, svg_type, gs_type):
4764 Add initialization functions.
bb4d86b4
CY
4765 (Finit_image_library): Call lookup_image_type.
4766 (CHECK_LIB_AVAILABLE): Macro deleted.
4767 (lookup_image_type): Call define_image_type here, rather than via
4768 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
4769 (syms_of_image): Move define_image_type calls for xbm_type and
4770 pbm_type to lookup_image_type.
4771
df9685f3
EZ
47722012-09-22 Eli Zaretskii <eliz@gnu.org>
4773
4774 * keyboard.c (timer_check_2): Move calculation of 'timers' and
4775 'idle_timers' from here ...
4776 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
4777 lists, to avoid infloops when the timer does something stupid,
4778 like reinvoke itself with the same or smaller time-out.
4779 (Bug#12447)
4780
8e17c9ba
MR
47812012-09-22 Martin Rudalics <rudalics@gmx.at>
4782
4783 * window.c (Fsplit_window_internal): Handle only Qt value of
4784 Vwindow_combination_limit separately.
4785 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
4786 (Vwindow_combination_limit): New default value.
4787 Rewrite doc-string.
8e17c9ba 4788
589bd69b
EZ
47892012-09-22 Eli Zaretskii <eliz@gnu.org>
4790
4791 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
4792 the new overlay string. (Bug#10159)
4793
01108e3f
PE
47942012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4795
4796 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
4797 or that fprintf is async-signal-safe. POSIX doesn't require
4798 either assumption.
4799
82f8cd94
CY
48002012-09-22 Chong Yidong <cyd@gnu.org>
4801
4802 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
4803 (Bug#8207).
4804
3cccbd87
KH
48052012-09-22 Kenichi Handa <handa@gnu.org>
4806
4807 * composite.c (composition_reseat_it): Handle the case that a
4808 grapheme cluster is not covered by a single font (Bug#12352).
4809
09c01941
CY
48102012-09-21 Chong Yidong <cyd@gnu.org>
4811
4812 * image.c (define_image_type): Avoid adding duplicate types to
4813 image_types (Bug#12463). Suggested by Jörg Walter.
4814
acfa068f 48152012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
4816
4817 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
4818 (print_load_command_name): Add case LC_DATA_IN_CODE.
4819 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
4820
acfa068f 48212012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
4822
4823 * eval.c (Frun_hook_with_args_until_success)
4824 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
4825
acfa068f 48262012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
4827
4828 * fileio.c (Ffile_selinux_context): Only call freecon when
4829 lgetfilecon succeeded.
4830 (Fset_file_selinux_context): Likewise. (Bug#12444)
4831
acfa068f 48322012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
4833
4834 * xdisp.c (try_window_reusing_current_matrix): Under bidi
4835 reordering, locate the cursor by calling set_cursor_from_row; if
4836 that fails, clear the desired glyph matrix before returning a
4837 failure indication to the caller. Fixes leaving garbled display
4838 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
4839 (compute_stop_pos_backwards): Fix a typo that caused crashes while
4840 scrolling through multibyte text.
aa36e4d2 4841
e99f70c8
SM
48422012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
4843
4844 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
4845 calling mark_vectorlike since that's the one that marks the window.
4846 (mark_discard_killed_buffers): Mark the final cdr.
4847 * window.h (struct window): Move prev/next_buffers to the
4848 non-standard fields.
4849 * window.c (make_window): Initialize prev/next_buffers manually.
4850
f75beb47
PE
48512012-09-20 Paul Eggert <eggert@cs.ucla.edu>
4852
4853 Omit unused arg EXPECTED from socket hooks.
4854 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
4855 * nsterm.m (ns_term_init):
4856 * termhooks.h (struct terminal.read_socket_hook):
4857 * w32inevt.c (w32_console_read_socket):
4858 * w32term.c (w32_read_socket):
4859 * xterm.c (XTread_socket):
4860 Omit unused arg EXPECTED. All callers changed.
4861 (store_user_signal_events): Return void, not int, since callers no
4862 longer care about the return value. All uses changed.
4863
b019b76a
JB
48642012-09-20 Juanma Barranquero <lekktu@gmail.com>
4865
4866 * w32gui.h (XParseGeometry): Do not declare.
4867
05642592
PE
48682012-09-19 Paul Eggert <eggert@cs.ucla.edu>
4869
e4bce92a 4870 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 4871 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
4872 <http://bugs.gnu.org/12471#8> (last line).
4873
05642592
PE
4874 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
4875 (XParseGeometry): Now static. Substitute extremal values for
4876 values that are out of range.
4877
e543ae91
JD
48782012-09-19 Jan Djärv <jan.h.d@swipnet.se>
4879
4880 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
4881
4882 * nsfns.m (XParseGeometry): Remove.
4883 (Fx_create_frame): Call x_set_offset to correctly interpret
4884 top_pos in geometry.
4885
3a880af4 4886 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
4887 (Fx_parse_geometry): If there is a space in string, call
4888 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
4889
45ba16c7
EZ
48902012-09-17 Eli Zaretskii <eliz@gnu.org>
4891
c8b9f1bc
EZ
4892 * search.c (scan_buffer): Use character positions in calls to
4893 region_cache_forward and region_cache_backward, not byte
4894 positions. (Bug#12196)
4895
b4c932a2
EZ
4896 * w32term.c (w32_read_socket): Set pending_signals to 1, like
4897 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
4898
45ba16c7
EZ
4899 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
4900 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
4901 emacs_blocked_malloc, now deleted.
4902
eeceac93
PE
49032012-09-17 Paul Eggert <eggert@cs.ucla.edu>
4904
4905 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
4906 The workaround was for improving performance on Solaris 2.4, but
4907 is getting in the way now. Emacs will still work if someone is
4908 still running Solaris 2.4 in a museum somewhere; Sun dropped
4909 support for Solaris 2.4 in 2003.
4910 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
4911 * process.c (create_process) [HAVE_WORKING_VFORK]:
4912 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
4913 since Emacs no longer uses vfork on that platform.
4914
78f83752
GM
49152012-09-17 Glenn Morris <rgm@gnu.org>
4916
4917 * emacs.c: Use COPYRIGHT.
4918
634b8cac
PE
49192012-09-16 Paul Eggert <eggert@cs.ucla.edu>
4920
0caaedb1
PE
4921 Remove configure's --without-sync-input option (Bug#12450).
4922 When auditing signal-handling in preparation for cleaning it up,
4923 I found that SYNC_INPUT has race conditions and would be a real
4924 pain to fix. Since it's an undocumented and deprecated
4925 configure-time option, now seems like a good time to remove it.
4926 Also see <http://bugs.gnu.org/11080#16>.
4927 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
4928 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
4929 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4930 (malloc_hysteresis):
4931 (check_depth) [XMALLOC_OVERRUN_CHECK]:
4932 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
4933 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
4934 (dont_register_blocks, bytes_used_when_reconsidered)
4935 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
4936 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
4937 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 4938 Remove. All uses removed.
0caaedb1
PE
4939 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
4940 implementation, one that depends on whether the new macro
4941 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
4942 is defined.
4943 * atimer.c (run_timers, handle_alarm_signal):
4944 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
4945 (handle_async_input, process_pending_signals)
4946 (handle_input_available_signal, init_keyboard):
4947 * nsterm.m (ns_read_socket):
4948 * process.c (wait_reading_process_output):
4949 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
4950 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
4951 (emacs_write):
4952 * xterm.c (XTread_socket):
4953 Assume SYNC_INPUT.
4954 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
4955 * eval.c (handling_signal): Remove. All uses removed.
4956 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
4957 All uses replaced with the SYNC_INPUT version.
4958 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
4959 Remove decls.
4960 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4961 Now static.
4962
634b8cac
PE
4963 * font.c (Ffont_shape_gstring): Remove unused local.
4964
83da1b55
GM
49652012-09-16 Glenn Morris <rgm@gnu.org>
4966
518650a5
GM
4967 * Makefile.in (clean): No longer run nextstep's clean.
4968
83da1b55
GM
4969 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
4970 (ns_frag): Remove.
4971 (ns-app): Move here from ns.mk, and simplify.
4972 (clean): Simplify nextstep entry.
4973 * ns.mk: Remove file.
4974
85a43e2e
KH
49752012-09-17 Kenichi Handa <handa@gnu.org>
4976
4977 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
4978 not covert the last few charactes.
4979
ba13e616 49802012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
4981
4982 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
4983 here, but just check the validity of glyphs in the glyph-string.
4984
a8c729af
MR
49852012-09-16 Martin Rudalics <rudalics@gmx.at>
4986
3a880af4
SM
4987 * window.c (Fwindow_parameter, Fset_window_parameter):
4988 Accept any window as argument (Bug#12452).
a8c729af 4989
c077c059
JD
49902012-09-16 Jan Djärv <jan.h.d@swipnet.se>
4991
4992 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
4993 to ns_term_init to avoid memory leak.
4994
4995 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
4996 explicit retain/release.
4997 (ns_term_init): Only allow one display. Initialize outerpool and
4998 ns_*_types.
4999
39a57ad0
PE
50002012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5001
5002 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5003 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5004 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5005 the Microsoft problem in a different way, by altering ../nt/config.nt.
5006
7105c8cb
EZ
50072012-09-15 Eli Zaretskii <eliz@gnu.org>
5008
5009 * w32xfns.c:
5010 * w32uniscribe.c:
5011 * w32term.c:
5012 * w32select.c:
5013 * w32reg.c:
5014 * w32proc.c:
5015 * w32menu.c:
5016 * w32inevt.c:
5017 * w32heap.c:
5018 * w32font.c:
5019 * w32fns.c:
5020 * w32console.c:
5021 * w32.c:
5022 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5023 by lisp.h. This completes removal of setjmp.h inclusion
5024 erroneously announced in the previous commit. (Bug#12446)
5025
5026 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5027 more accurate.
5028
5029 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5030 not defined as a macro. The latter happens on MS-Windows.
5031 (Bug#12446)
5032
0328b6de
PE
50332012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5034
5035 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5036 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 5037 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
5038 only reason for the instance was because "lisp.h" was included.
5039 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5040 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5041 and _longjmp with the new symbols. Emacs already uses _setjmp if
5042 available, so this change affects only POSIXish hosts that have
5043 sigsetjmp but not _setjmp, such as some versions of Solaris and
5044 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5045 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5046 (png_load_body) [HAVE_PNG]:
5047 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5048 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5049 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5050 since PNG requires jmp_buf. This is the only exception to the
5051 general rule that we now use sys_setjmp and sys_longjmp.
5052 This exception is OK since this code does not change the signal
5053 mask or longjmp out of a signal handler.
5054
2af03429
PE
50552012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5056
5057 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5058 Include "syssignal.h", for 'main_thread'.
5059
2f294edf
DA
50602012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5061
5062 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
5063 * insdel.c (replace_range, replace_range_2):
5064 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
5065 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5066 Remove redundant check before calling offset_intervals.
5067
6b533e9c
MR
50682012-09-14 Martin Rudalics <rudalics@gmx.at>
5069
5070 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5071 current buffer (Bug#12387).
5072
2a7931e3
JB
50732012-09-14 Juanma Barranquero <lekktu@gmail.com>
5074
5075 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5076
c18e885b
PE
50772012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5078
5079 Use a more backwards-compatible timer format (Bug#12430).
5080 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5081 vector element, not from the 4th, since PSECS is now at the end.
5082 (Fcurrent_idle_time): Doc fix.
5083
d59a1afb
DA
50842012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5085
5086 Function to mark objects and remove killed buffers at once.
5087 * alloc.c (discard_killed_buffers): Rename to ...
5088 (mark_discard_killed buffers) ... new name. Add marking
5089 of remaining objects. Fix comment. Adjust users.
5090 (mark_object): Do not touch frame buffer lists here.
5091 * frame.c (delete_frame): Reset frame buffer lists here.
5092
5f0cb45a
PE
50932012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5094
8ea47e3a
PE
5095 Better workaround for GNOME bug when --enable-gcc-warnings.
5096 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5097 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5098 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5099
4a4bbad2
PE
5100 Simplify SIGIO usage (Bug#12408).
5101 The code that dealt with SIGIO was crufty and confusing, e.g., it
5102 played tricks like "#undef SIGIO" but these tricks were not used
5103 consistently. Simplify mostly by not #undeffing standard symbols,
5104 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5105 or not as we please) rather than "defined SIGIO" (standard symbol
5106 that we probably shouldn't #undef).
5107 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5108 Modules that need it can include it.
5109 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5110 * dispextern.h (ignore_sigio): New decl.
5111 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5112 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5113 * emacs.c (shut_down_emacs):
5114 * keyboard.c (kbd_buffer_store_event_hold):
5115 Use ignore_sigio rather than invoking 'signal' directly.
5116 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5117 for FIONREAD.
5118 (FIONREAD, SIGIO): Do not #undef.
5119 (tty_read_avail_input): Use #error rather than a syntax error.
5120 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5121 for I_PIPE, used by SETUP_SLAVE_PTY.
5122 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5123 * sysdep.c (croak): Remove; no longer needed. This bit of
5124 temporary code, with Fred N. Fish's comment that it's temporary,
5125 has been in Emacs since at least 1992!
5126 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5127 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5128 * syssignal.h (croak): Remove decl.
5129 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5130 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5131 now that we're termios-only.
5132 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5133 * term.c (dissociate_if_controlling_tty): Use #error rather than
5134 a run-time error.
5135
5f0cb45a
PE
5136 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5137 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5138 to work around GNOME bug 683906.
5139 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5140 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5141 This works around GCC bug 54561.
5142
40bce90b
PE
51432012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5144
5145 More fixes for 'volatile' and setjmp/longjmp.
5146 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5147 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5148 (png_load_body) [HAVE_PNG]:
5149 (jpeg_load_body) [HAVE_JPEG]:
5150 New function, with most of the old parent function's body.
5151 (png_load) [HAVE_PNG]:
5152 (jpeg_load) [HAVE_JPEG]:
5153 Invoke the new function, to avoid longjmp munging our locals.
5154 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5155 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5156 longjmp is passed 2, as the C standard doesn't guarantee this.
5157 Instead, store the failure code into mgr->failure_code.
5158
bfeae2cf
SM
51592012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5160
5161 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5162 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5163 (syms_of_keyboard): Remove support for unread-command-char.
5164
8099e36b
EZ
51652012-09-12 Eli Zaretskii <eliz@gnu.org>
5166
5167 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5168 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5169 violation. (Bug#12426)
5170
92547ff9
PE
51712012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5172
5173 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5174
45b82ad0
SM
51752012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5176
5177 * eval.c: Add `inhibit-debugger'.
5178 (Qinhibit_debugger): New symbol.
5179 (call_debugger): Bind it instead of Qdebug_on_error.
5180 (maybe_call_debugger): Test Vinhibit_debugger.
5181 (syms_of_eval): Define inhibit-debugger.
5182 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5183 (syms_of_xdisp): Remove inhibit-debug-on-message.
5184
5779a1dc
PE
51852012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5186
50f2e553
PE
5187 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5188 If a nonvolatile local variable is written before a _longjmp to
5189 the frame containing the variable, and is read after the _longjmp,
5190 the value read is indeterminate. Some local variables of type
5191 'struct handler' and 'struct catchtag' are used in this way, so
5192 mark each of their slots as volatile if the slot can be set before
5193 _longjmp and read afterwards.
5194 * lisp.h (struct handler): var and chosen_clause are now volatile.
5195 (struct catchtag): val, next, and pdlcount are now volatile.
5196
ae1d87e2
PE
5197 * bidi.c (bidi_push_it, bidi_pop_it):
5198 * fns.c (copy_hash_table):
5199 * image.c (define_image_type):
5200 * keyboard.c (kbd_buffer_store_event_hold):
5201 * process.c (Fprocess_send_eof):
5202 * xfaces.c (x_create_gc) [HAVE_NS]:
5203 * xgselect.c (xg_select):
5204 Prefer assignment to memcpy when either will do.
5205
5779a1dc
PE
5206 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5207 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5208 time an item is removed. No need to mark this function 'inline';
5209 the compiler knows better than we do.
5210
c4c9756b
JD
52112012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5212
5213 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5214 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5215 to change_frame_size (Bug#12388).
5216 (windowDidResize:): Pass YES to updateFrameSize.
5217
5218 * nsterm.h: Add delay parameter to updateFrameSize.
5219
d73e321c
DA
52202012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5221
5222 Discard killed buffers from deleted window and frame objects.
5223 This reduces an amount of references to killed buffers and
5224 helps GC to reclaim them faster.
5225 * alloc.c (discard_killed_buffers): New function.
5226 (mark_object): Use it for deleted windows and frames.
5227 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 5228 or deleted frame, restore its global binding.
d73e321c
DA
5229 * data.c (swap_in_global_binding): Add GC notice.
5230 (swap_in_symval_forwarding): Use convenient set_blv_where.
5231 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5232 * window.h: ... to here.
5233
e578f381
DA
52342012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5235
5236 Convenient macro to check whether the buffer is live.
5237 * buffer.h (BUFFER_LIVE_P): New macro.
5238 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5239 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5240
3057e615
YM
52412012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5242
5243 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5244 composition cases (Bug#12364).
5245
5246 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5247 overhang of succeeding glyphs overlapping box cursor.
5248
5249 * w32term.c (x_draw_glyph_string): Likewise.
5250
6fda35f2
PE
52512012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5252
c990426a
PE
5253 Simplify, document, and port floating-point (Bug#12381).
5254 The porting part of this patch fixes bugs on non-IEEE platforms
5255 with frexp, ldexp, logb.
5256 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5257 Now static.
5258 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5259 support, by removing commented-out code and briefly listing the
5260 C89 functions excluded. The commented-out stuff was confusing
5261 maintenance, e.g., we thought we needed cbrt but it was commented out.
5262 (logb): Remove decl; no longer needed.
5263 (isfinite): New macro, if not already supplied.
5264 (isnan): Don't replace any existing macro.
5265 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5266 are present on all C89 platforms.
5267 (Ffrexp): Do not special-case zero, as frexp does the right thing
5268 for that case.
5269 (Flogb): Do not use logb, as it doesn't have the desired meaning
5270 on hosts that use non-base-2 floating point. Instead, stick with
5271 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5272 frexp, to avoid getting an unspecified result.
5273
6fda35f2
PE
5274 * xdisp.c (Qinhibit_debug_on_message): Now static.
5275
16130a58
JD
52762012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5277
5278 * nsterm.m (ns_update_begin): Set clip path to whole view by using
5279 NSBezierPath (Bug#12131).
5280
d105a573
CY
52812012-09-10 Chong Yidong <cyd@gnu.org>
5282
5283 * fns.c (Fdelq, Fdelete): Doc fix.
5284
ff55dfe8
PE
52852012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5286
5287 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5288 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5289
e7032e7c
SM
52902012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
5291
5292 * lisp.h (make_lisp_ptr): New macro to replace XSET.
5293 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
5294 Use it.
5295
e9957956
EZ
52962012-09-09 Eli Zaretskii <eliz@gnu.org>
5297
aba05ce9
EZ
5298 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
5299 left fringe if the window has a left margin. This avoids leaving
5300 traces of the cursor because its leftmost pixel is not drawn over.
5301
e9957956
EZ
5302 * dispnew.c (update_window_line): When the left margin area of a
5303 screen line is updated, set the redraw_fringe_bitmaps_p flag of
5304 that screen line. (Bug#12277)
5305
f6196b87
PE
53062012-09-09 Paul Eggert <eggert@cs.ucla.edu>
5307
5308 Assume C89 or later for math functions (Bug#12381).
5309 This simplifies the code, and makes it a bit smaller and faster,
5310 and (most important) makes it easier to clean up signal handling
5311 since we can stop worring about floating-point exceptions in
5312 library code. That was a problem before C89, but the problem
5313 went away many years ago on all practical Emacs targets.
5314 * data.c, image.c, lread.c, print.c:
5315 Don't include <math.h>; no longer needed.
5316 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
5317 might be autoconfigured, as that never happens.
5318 * data.c (fmod):
5319 * doprnt.c (DBL_MAX_10_EXP):
5320 * print.c (DBL_DIG):
5321 Remove. C89 or later always defines these.
5322 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
5323 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
5324 (arith_error, domain_error, domain_error2):
5325 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
5326 no longer needed -- we simply return what C returns. All uses removed.
5327 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
5328 the wrapped code.
5329 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
5330 Remove. All uses expanded, as these macros are no longer used
5331 more than once and are now more trouble than they're worth.
5332 (Ftan): Use tan, not sin / cos.
5333 (Flogb): Assume C89 frexp.
5334 (fmod_float): Assume C89 fmod.
5335 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
5336 (init_floatfns): Remove. All uses removed.
5337
9d7f1863
JD
53382012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5339
5340 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
5341 compositeToPoint for OSX < 10.6 (Bug#12390).
5342
eabf0404
PE
53432012-09-08 Paul Eggert <eggert@cs.ucla.edu>
5344
5345 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
5346 This produces more-accurate results.
5347
0b3b1d23
JD
53482012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5349
5350 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
5351 changes (Bug#12088).
5352
6dcef6ec
CY
53532012-09-08 Chong Yidong <cyd@gnu.org>
5354
5355 * syntax.c (Fstring_to_syntax): Doc fix.
5356
aa7d57c5
JD
53572012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5358
5359 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
5360 in the internal border.
5361 (x_set_window_size): Remove static variables and their usage.
5362 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
5363 (ns_after_update_window_line, ns_draw_fringe_bitmap):
5364 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
5365 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
5366 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
5367 (ns_fix_rect_ibw): Remove.
5368 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
5369 (ns_dumpglyphs_box_or_relief): Ditto.
5370 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
5371 adjustment.
5372 (ns_dumpglyphs_image): Ditto.
fc0c31f8 5373 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
5374 border adjustment.
5375 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
5376 their usage. Add fringe_extended_p and its use as in other terms.
5377 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
5378 scroll bar was removed.
5379 (updateFrameSize): New function.
5380 (windowDidResize): Move code to updateFrameSize and call it.
5381
5382 * nsterm.h (EmacsView): Add updateFrameSize.
5383
1a5432bc
CY
53842012-09-07 Chong Yidong <cyd@gnu.org>
5385
b4f5313e
CY
5386 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
5387
1a5432bc
CY
5388 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
5389
1a4f1e9b
PE
53902012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5391
5392 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
5393 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
5394 Problem introduced when merging patches. Noted by Eli Zaretskii in
5395 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
5396 * floatfns.c: Comment fix.
5397 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
5398 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
5399 and anyway the declaration is harmless even if SIGDANGER is not defined.
5400 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
5401 defined BROKEN_FIONREAD). systty.h formerly did this, but other
5402 source files not surprisingly expected syssignal.h to define, or
5403 not define, SIGIO, and it's cleaner to do it that way, for consistency.
5404 Include <sys/ioctl.h>, for FIONREAD.
5405 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
5406 This eliminates a problem whereby other files mysteriously had
5407 to include "syssignal.h" before including "systty.h" if they
5408 wanted to use "#ifdef SIGIO".
5409
bc8000ff
EZ
54102012-09-07 Eli Zaretskii <eliz@gnu.org>
5411
3e6d6928
EZ
5412 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
5413
5414 * w32.c (sigemptyset): Empty the set.
5415 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
5416
bc8000ff
EZ
5417 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
5418
b4fa72f2
DA
54192012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
5420
5421 * alloc.c (mark_buffer): Revert unsafe marking optimization.
5422 (mark_object): Likewise for frame objects.
5423
30730c93
PE
54242012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5425
5426 * syssignal.h (handle_on_main_thread): Always declare,
5427 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
5428 This ports to platforms without HAVE_PTHREAD.
5429
2fe28299
PE
54302012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5431
5432 Signal-handler cleanup (Bug#12327).
5433 Emacs's signal handlers were written in the old 4.2BSD style with
5434 sigblock and sigmask and so forth, and this led to some
5435 inefficiencies and confusion. Rewrite these to use
5436 pthread_sigmask etc. without copying signal sets around. Also,
5437 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
5438 'signal', and instead use functions that do not attempt to take
5439 over the system name space. This patch causes Emacs's text
5440 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
5441 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
5442 Do not include <signal.h> or "syssignal.h", as these
5443 modules do not use signals.
5444 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
5445 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
5446 Do not include <signal.h>, as "syssignal.h" does that for us now.
5447 * atimer.c (sigmask_atimers): New function.
5448 (block_atimers, unblock_atimers): New functions,
5449 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
5450 All uses replaced.
5451 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
5452 no longer needed here.
5453 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 5454 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
5455 * sysdep.c (struct save_signal): New member 'action', replacing
5456 old member 'handler'.
5457 (save_signal_handlers, restore_signal_handlers):
5458 Use sigaction instead of 'signal' to save and restore.
5459 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
5460 New function. All users of 'signal' modified to use set_sighandler
5461 if they're writeonly, and to use sys_signal if they're read+write.
5462 (emacs_sigaction_init, forwarded_signal): New functions.
5463 (sys_signal): Remove. All uses replaced by calls to sigaction
5464 and emacs_sigaction_init, or by direct calls to 'signal'.
5465 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
5466 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
5467 all uses replaced by pthread_sigmask etc. calls.
5468 * syssignal.h: Include <signal.h>.
5469 (emacs_sigaction_init, forwarded_signal): New decls.
5470 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
5471 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
5472 (sigmask, sys_sigmask): Remove; no longer needed.
5473 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
5474 (sigblock, sigunblock, sigfree):
5475 (sigsetmask) [!defined sigsetmask]:
5476 Remove. All uses replaced by pthread_sigmask.
5477 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
5478 no longer need to be replaced, and its typical old uses
5479 are now done via emacs_sigaction_init and sigaction.
5480 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
5481 (sys_sigdel): Remove; unused.
5482 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
5483
0216c128
EZ
54842012-09-06 Eli Zaretskii <eliz@gnu.org>
5485
5486 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
5487 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
5488
c752cfa9
DA
54892012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5490
5491 Explicitly mark buffer_defaults and buffer_local_symbols.
5492 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
5493 mark_local_symbols here.
5494 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
5495 since special buffers aren't marked here any more.
5496 (allocate_buffer): Chain new buffer with all_buffers here...
5497 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
5498 not here.
5499 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
5500 (syms_of_buffer): Remove staticpro of the above.
5501 (init_buffer_once): Set names for buffer_defaults and
5502 buffer_local_symbols.
5503
a864ef14
PE
55042012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5505
5506 Use bool for booleans in font-related modules.
5507 * font.c (font_intern_prop, font_style_to_value)
5508 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
5509 (generate_otf_features, font_check_otf_features, font_check_otf)
5510 (font_match_p, font_list_entities, font_at):
5511 * fontset.c (fontset_id_valid_p, reorder_font_vector
5512 (fontset_find_font, Fset_fontset_font)
5513 (face_suitable_for_char_p) [0]:
5514 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
5515 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
5516 (m17n_flt_initialized, ftfont_shape_by_flt):
5517 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
5518 * nsfont.m (nsfont_draw):
5519 * w32font.c (w32font_draw):
5520 * w32term.c (x_draw_glyphless_glyph_string_foreground):
5521 Use bool for booleans.
5522 * font.h: Adjust to above API changes.
5523 (struct font, struct font_driver, struct font_driver_list):
5524 Use bool for booleans.
5525 (struct font): Remove useless member encoding_type.
5526 All users removed.
5527 * fontset.c, xftfont.c: Omit unnecessary static decls.
5528
0699fc18
DA
55292012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5530
5531 * alloc.c (mark_object): Revert window marking code
5532 since it's unsafe for the Fset_window_configuration.
5533
20ef56db
PE
55342012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5535
2fe28299 5536 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
5537 Be more systematic about preserving errno whenever a signal
5538 handler returns, even if it's not in the main thread. Do this by
5539 renaming signal handlers to distinguish between signal delivery
5540 and signal handling. All uses changed.
5541 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
5542 * data.c (deliver_arith_signal): Rename from arith_error.
5543 * dispnew.c (deliver_window_change_signal): Rename from
5544 window_change_signal.
5545 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
5546 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
5547 * keyboard.c (deliver_input_available_signal): Rename from
5548 input_available_signal.
5549 (deliver_user_signal): Rename from handle_user_signal.
5550 (deliver_interrupt_signal): Rename from interrupt_signal.
5551 * process.c (deliver_pipe_signal): Rename from send_process_trap.
5552 (deliver_child_signal): Rename from sigchld_handler.
5553 * atimer.c (handle_alarm_signal):
5554 * data.c (handle_arith_signal):
5555 * dispnew.c (handle_window_change_signal):
5556 * emacs.c (handle_fatal_signal, handle_danger_signal):
5557 * keyboard.c (handle_input_available_signal):
5558 * keyboard.c (handle_user_signal, handle_interrupt_signal):
5559 * process.c (handle_pipe_signal, handle_child_signal):
5560 New functions, with the actual signal-handling code taken from the
5561 original respective signal handlers, sans the sporadic attempts to
5562 preserve errno, since that's now done by handle_on_main_thread.
5563 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
5564 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
5565 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5566 Move to sysdep.c.
5567 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5568 Move initialization of main_thread to sysdep.c's init_signals.
5569 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
5570 our usage, and simplifies the mainline code.
5571 (record_child_status_change): New static function, as a helper
5572 for handle_child_signal, and with most of the old child handler's
5573 contents.
5574 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
5575 (handle_child_signal): Use the above.
5576 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5577 Moved here from emacs.c.
5578 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
5579 code moved here from emacs.c's main function.
5580 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
5581 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
5582 This lets callers save and restore errno properly.
20ef56db 5583
e3ccf108
DA
55842012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5585
5586 Remove redundant or unused things here and there.
5587 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
5588 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
5589 * editfns.c (Fcompare_buffer_substrings): Likewise.
5590 * frame.h (struct terminal, struct font_driver_list):
5591 Remove redundant declarations.
5592 * window.h (Qleft, Qright): Likewise.
5593
697e1e39
DA
55942012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5595
5596 Do not mark objects from deleted buffers, windows and frames.
5597 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
5598 (mark_object): Likewise for windows and frames.
5599
c1ca42ca
DA
56002012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5601
5602 * alloc.c (valid_lisp_object_p): Treat killed buffers,
5603 buffer_defaults and buffer_local_symbols as valid objects.
5604 Return special value to denote them.
5605
014d93be
PE
56062012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5607
f75d7a91
PE
5608 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
5609 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
5610 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
5611 (file_name_absolute_p, Fsubstitute_in_file_name):
5612 (check_executable, check_writable, Ffile_accessible_directory_p)
5613 (Fset_file_selinux_context, Fdefault_file_modes)
5614 (Finsert_file_contents, choose_write_coding_system)
5615 (Fwrite_region, build_annotations, a_write, e_write)
5616 (Fdo_auto_save):
5617 * filelock.c (boot_time_initialized, get_boot_time)
5618 (get_boot_time_1, lock_file_1, within_one_second):
5619 * floatfns.c (in_float):
5620 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
5621 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
5622 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
5623 * lisp.h (struct Lisp_Hash_Table.cmpfn):
5624 * window.c (compare_window_configurations):
5625 Use bool for booleans.
5626 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
5627 (Fdefault_file_modes): Now mode_t, not int, for modes.
5628 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
5629 (internal_delete_file): Now returns void, not a (boolean) int,
5630 since nobody was looking at the return value.
5631 * lisp.h, window.h: Adjust to above API changes.
5632
014d93be
PE
5633 * xdisp.c (set_message): Simplify and reindent last change.
5634
776f29e1
JB
56352012-09-05 Juanma Barranquero <lekktu@gmail.com>
5636
5637 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
5638
7f7e0167
LI
56392012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
5640
5641 * eval.c (call_debugger): Make the function non-static so that we
5642 can call it from set_message.
5643
5644 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
5645 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
5646
cf29dd84
PE
56472012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5648
5649 Give more-useful info on a fatal error (Bug#12328).
5650 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
5651 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
5652 of doing the work ourselves.
5653 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
5654 do most of the work.
5655 (fatal_error_backtrace): New function, taken from the guts
5656 of the old fatal_error_signal, but with a new option to output
5657 a backtrace.
5658 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
5659 info about the signal than just its number.
5660 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
5661 * sysdep.c: Include <execinfo.h>
5662 (emacs_backtrace): New function, taken partly from the previous
5663 code of the 'die' function.
5664 (emacs_abort): Call fatal_error_backtrace rather than abort.
5665
972debf2
SM
56662012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
5667
5668 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
5669 eager (load-time) macro-expansion.
5670 * lisp.mk (lisp): Add macroexp.
5671
1088b922
PE
56722012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5673
5674 Simplify redefinition of 'abort' (Bug#12316).
5675 Do not try to redefine the 'abort' function. Instead, redo
5676 the code so that it calls 'emacs_abort' rather than 'abort'.
5677 This removes the need for the NO_ABORT configure-time macro
5678 and makes it easier to change the abort code to do a backtrace.
5679 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
5680 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
5681 Remove; sysdep.c's emacs_abort now takes its place.
5682 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
5683 'abort' changed to use 'emacs_abort'.
5684 * msdos.c (dos_abort) [defined abort]: Remove; not used.
5685 (abort) [!defined abort]: Rename to ...
5686 (emacs_abort): ... new name.
5687 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
5688 the place of the old 'abort' in emacs.c.
5689 * w32.c, w32fns.c (abort): Do not #undef.
5690 * w32.c (emacs_abort): Rename from w32_abort.
5691
30934d33
EZ
56922012-09-04 Eli Zaretskii <eliz@gnu.org>
5693
5694 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
5695 offsets[j].dv, since the y axis of the screen coordinates points
5696 down, while the y axis of the font definition coordinates points
5697 up. This fixes display of Arabic diacritics such as KASRA and
5698 KASRATAN. (Bug#11860)
5699
af26b72c
PE
57002012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5701
5702 Be more systematic about _setjmp vs setjmp.
5703 * alloc.c (test_setjmp, mark_stack):
5704 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
5705 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
5706 (png_load, my_error_exit, jpeg_load):
5707 * process.c (send_process_trap, send_process):
5708 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
5709 The underscored versions are up to 30x faster on some hosts.
5710 Formerly, the code used setjmp+longjmp sometimes and
5711 _setjmp+_longjmp at other times, with no particular reason to
5712 prefer setjmp+longjmp.
5713
26d4541d
PE
57142012-09-03 Paul Eggert <eggert@cs.ucla.edu>
5715
d42f4f0f 5716 Fix minor problem found by static checking.
26d4541d 5717 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 5718
c5e28e39
MR
57192012-09-03 Martin Rudalics <rudalics@gmx.at>
5720
5721 * buffer.c (Fdelete_all_overlays): New function.
5722
3eab3ca9
CY
57232012-09-03 Chong Yidong <cyd@gnu.org>
5724
5725 * gtkutil.c: Add extern decl for Qxft.
5726
c04889f8
PE
57272012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5728
1882aa38
PE
5729 * emacs.c, eval.c: Use bool for boolean.
5730 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
5731 (malloc_using_checking) [DOUG_LEA_MALLOC]:
5732 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
5733 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
5734 (main, decode_env_path, Fdaemon_initialized):
5735 * eval.c (call_debugger, Finteractive_p, interactive_p):
5736 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
5737 (maybe_call_debugger, Fbacktrace):
5738 * process.c (read_process_output, exec_sentinel):
5739 Use bool for booleans.
5740 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
5741 All callers changed.
5742 * eval.c (interactive_p): Omit always-true boolean argument
5743 EXCLUDE_SUBRS_P. All callers changed.
5744 * dispextern.h, lisp.h: Reflect above API changes.
5745 * firstfile.c (dummy): Use the address of 'main', whose signature
5746 won't change, instead of the address of 'initialize', whose
5747 signature just changed from int to bool.
5748 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
5749 * msdos.c (fatal_error_in_progress): ... from here.
5750 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
5751 of incrementing it.
5752 (redisplay_internal, unwind_redisplay): Simply clear
5753 REDISPLAYING_P when unwinding, instead of saving its previous,
5754 always-false value and then restoring it.
5755
a411ac43
PE
5756 Clean up some extern decls.
5757 Mostly, this hoists extern decls out of .c files and into .h files.
5758 That way, we're more likely to catch errors if the interfaces change.
5759 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
5760 declare xg_mark_data.
5761 * dispextern.h (x_frame_parm_handlers):
5762 * font.h (Qxft):
5763 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
5764 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
5765 (Qultra_bold, Qoblique, Qitalic):
5766 Move extern decl here from .c file.
5767 * alloc.c (xg_mark_data) [USE_GTK]:
5768 * doc.c (Qclosure):
5769 * eval.c (Qlexical_binding):
5770 * fns.c (time) [!HAVE_UNISTD_H]:
5771 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
5772 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
5773 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
5774 * lread.c (Qinternal_interpreter_environment):
5775 * minibuf.c (Qbuffer):
5776 * process.c (QCfamily, QCfilter):
5777 * widget.c (free_frame_faces):
5778 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
5779 * xfont.c (x_clear_errors):
5780 * xterm.c (x_frame_parm_handlers):
5781 Remove now-redundant extern decls.
5782 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
5783 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
5784 Now static.
5785 * xfaces.c: Remove unnecessary static decls.
5786 * xterm.c (updating_frame): Remove decl of nonexistent object.
5787
c04889f8
PE
5788 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
5789 when building globals.h, as the objects that are not built on
5790 this host are not needed to compile C files on this host.
5791
8b339673
JD
57922012-09-02 Jan Djärv <jan.h.d@swipnet.se>
5793
5794 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
5795
5796 * frame.h: Add missing prototype for x_wm_set_size_hint.
5797
a08d4ba7
PE
57982012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5799
5800 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
5801 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
5802 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
5803 (Fsubstitute_command_keys):
5804 * editfns.c (region_limit, find_field, Fconstrain_to_field)
5805 (save_excursion_save, save_excursion_restore)
5806 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
5807 (format_time_string, general_insert_function)
5808 (make_buffer_string, make_buffer_string_both)
5809 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
5810 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
5811 (copy_text, insert_1, insert_1_both, insert_from_string)
5812 (insert_from_string_before_markers, insert_from_string_1)
5813 (insert_from_buffer, insert_from_buffer_1, replace_range)
5814 (replace_range_2, del_range_1, del_range_byte, del_range_both)
5815 (del_range_2, modify_region):
5816 * intervals.c (intervals_equal, balance_possible_root_interval)
5817 (adjust_intervals_for_insertion, merge_properties_sticky)
5818 (graft_intervals_into_buffer, lookup_char_property)
5819 (adjust_for_invis_intang, set_point_both)
5820 (get_property_and_range, compare_string_intervals)
5821 (set_intervals_multibyte_1, set_intervals_multibyte):
5822 * keyboard.c (decode_timer):
5823 Use bool for boolean.
5824 * intervals.h, lisp.h, systime.h: Reflect above API changes.
5825 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
5826
48c948de
CY
58272012-09-02 Chong Yidong <cyd@gnu.org>
5828
5829 * keymap.c (push_key_description): Print M-TAB as C-M-i
5830 (Bug#11758).
5831
6c49a40b
JB
58322012-09-02 Juanma Barranquero <lekktu@gmail.com>
5833
5834 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
5835 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
5836 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
5837 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
5838 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
5839 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
5840 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5841
4dfbd238
EZ
58422012-09-01 Eli Zaretskii <eliz@gnu.org>
5843
7e510e28
EZ
5844 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
5845 more than one grapheme cluster passed to the shaper: compute the
5846 offset adjustment values separately for each cluster. (Bug#11860)
5847
4dfbd238
EZ
5848 * image.c: Restore mistakenly removed inclusion of w32.h. Without
5849 it, GCC doesn't see prototypes of w32_delayed_load, and complains
5850 about implicit conversions from integer to pointer.
5851
86571ae0
DC
58522012-09-01 Daniel Colascione <dancol@dancol.org>
5853
5854 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
5855 system used too early.
5856
0e23ef9d
PE
58572012-09-01 Paul Eggert <eggert@cs.ucla.edu>
5858
5859 Better seed support for (random).
5860 * emacs.c (main): Call init_random.
5861 * fns.c (Frandom): Set the seed from a string argument, if given.
5862 Remove long-obsolete Gentzel cruft.
5863 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
5864 (init_random): New function.
5865
17a2cbbd
DC
58662012-09-01 Daniel Colascione <dancol@dancol.org>
5867
5868 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
5869 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
5870 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
5871 x_wm_set_size_hint, x_query_colors, x_real_positions,
5872 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
5873 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
5874 all of which have been moved to common code.
5875
5876 * xfaces.c: Include TERM_HEADER instead of listing all possible
5877 window-system headers.
5878
5879 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
5880 to match header.
5881
5882 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
5883 directly accessing frame internals.
5884
f18cbb28 5885 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
5886 globals_of_w32font.
5887
5888 * process.c: Include TERM_HEADER instead of listing all possible
5889 window-system headers.
5890
3a880af4
SM
5891 * nsterm.h: Remove declarations now in frame.h.
5892 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
5893
5894 * menu.c: Include TERM_HEADER instead of listing all possible
5895 window-system headers.
5896
5897 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
5898 window system.
5899
5900 * keyboard.c: Include TERM_HEADER instead of listing all possible
5901 window-system headers.
5902
5903 * image.c: Include TERM_HEADER instead of listing all possible
5904 window-system headers. Declare Vlibrary_cache when compiling for
5905 Windows.
5906
5907 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
5908 window system declarations.
5909
5910 * frame.h: Move common functions here: set_frame_menubar,
5911 x_set_window_size, x_sync, x_get_focus_frame,
5912 x_set_mouse_position, x_set_mouse_pixel_position,
5913 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
5914 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
5915 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
5916 x_activate_menubar, x_real_positions, x_bitmap_icon,
5917 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
5918 and x_query_colors.
5919
5920 * frame.c: Include TERM_HEADER instead of listing all possible
5921 window-system headers.
5922
5923 * font.c: Include TERM_HEADER instead of listing all possible
5924 window-system headers.
5925
5926 * emacs.c: Include TERM_HEADER.
5927
f18cbb28
EZ
5928 * dispnew.c: Include TERM_HEADER instead of listing all possible
5929 window-system headers.
17a2cbbd 5930
f18cbb28 5931 * ccl.h: Include character.h.
17a2cbbd
DC
5932
5933 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
5934 the current window system; include in list of objects to link into
5935 Emacs.
5936
c650a5de
DA
59372012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5938
5939 Remove mark_ttys function and fix tty_display_info initialization.
5940 * lisp.h (mark_ttys): Remove prototype.
5941 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
5942 to mark_ttys because all possible values of 'top_frame' slot are
5943 the frames which are reachable from Vframe_list.
5944 * term.c (mark_ttys): Remove.
5945 (init_tty): Safely initialize 'top_frame' slot with Qnil.
5946
4e0f6479
DA
59472012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5948
5949 Change struct frame bitfields from unsigned char to unsigned.
5950 * frame.h (struct frame): Change type of 'display_preempted',
5951 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
5952 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
5953 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
5954 bitfields from unsigned char to unsigned.
5955
8b96a52c
DA
59562012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5957
5958 Remove unused member of struct x_output and struct w32_output.
5959 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
5960 * w32term.h (struct w32_output): Likewise.
5961
b4444c8a
JD
59622012-08-30 Jan Djärv <jan.h.d@swipnet.se>
5963
5964 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
5965 does not become zero (Bug#12234).
5966
b98521db
PE
59672012-08-30 Paul Eggert <eggert@cs.ucla.edu>
5968
5969 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
5970 for GCC 4.7.1 x86-64.
5971
31d02438
GM
59722012-08-30 Glenn Morris <rgm@gnu.org>
5973
5974 * lread.c (init_lread): For out-of-tree builds, only add the
5975 source directory's site-lisp dir to the load-path if it exists,
5976 consistent with in-tree builds. (Bug#12302)
5977
7f8941d8
JD
59782012-08-28 Jan Djärv <jan.h.d@swipnet.se>
5979
5980 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 5981 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
5982 (windowShouldClose:): Set window_closed.
5983 (dealloc): New member, free button_values.
fc0c31f8
JB
5984 (process_dialog:): Make member function. Remove window argument,
5985 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
5986 in button_values.
5987 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 5988 with tag. Remove return self, declare return value as void.
7f8941d8
JD
5989 (addString:row:): Remove return self, declare return value as void.
5990 (addSplit): Remove return self, declare return value as void.
5991 (clicked:): Remove return self, declare return value as void.
fc0c31f8 5992 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
5993 (initFromContents:isQuestion:): Adjust call to process_dialog.
5994 Code formatting change.
5995 (timeout_handler:): Set timer_fired to YES.
5996 (runDialogAt:): Set timer_fired to NO.
5997 Handle click on close button as quit.
5998
5999 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6000 Add window_closed and button_values. Add void as return value for
6001 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6002 Add process_dialog as new member.
6003
eada0861 60042012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 6005
eada0861
GM
6006 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6007 is not one of the heaps we manage. (Bug#12242)
6008
60092012-08-28 Glenn Morris <rgm@gnu.org>
6010
6011 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6012
457294dd
MR
60132012-08-28 Martin Rudalics <rudalics@gmx.at>
6014
6015 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
6016 auto-buffer-name window parameter. Install revision of reverted
6017 fix.
457294dd 6018
4f2daf31
DA
60192012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6020
6021 Do not allow to set major mode for a dead buffer.
6022 * buffer.c (Fset_buffer_major_mode): Signal an error
6023 if the buffer is dead.
6024 (Fother_buffer, other_buffer_safely): Remove redundant
6025 nested declaration.
6026
66322887
DA
60272012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6028
6029 Always use set_buffer_if_live to restore original buffer at unwind.
6030 * buffer.h (record_unwind_current_buffer): New function.
6031 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6032 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6033 * undo.c, window.c: Adjust users.
6034 * buffer.c (set_buffer_if_live): Fix comment.
6035
a3d794a1
DA
60362012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6037
6038 Fix usage of set_buffer_internal.
6039 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6040 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6041 * coding.c (decode_coding): Omit redundant test.
6042 * fileio.c (decide_coding_unwind): Likewise.
6043 * fns.c (secure_hash): Likewise.
6044 * insdel.c (modify_region): Likewise.
6045 * keyboard.c (command_loop_1): Likewise.
6046 * print.c (PRINTFINISH): Likewise.
6047 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6048
59ea14cd
PE
60492012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6050
6051 * dispnew.c: Use bool for boolean.
6052 (frame_garbaged, display_completed, delayed_size_change)
6053 (fonts_changed_p, add_window_display_history)
6054 (add_frame_display_history, verify_row_hash)
6055 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6056 (row_equal_p, realloc_glyph_pool)
6057 (allocate_matrices_for_frame_redisplay)
6058 (showing_window_margins_p)
6059 (adjust_frame_glyphs_for_frame_redisplay)
6060 (build_frame_matrix_from_leaf_window, make_current)
6061 (mirrored_line_dance, mirror_line_dance, update_frame)
6062 (update_window_tree, update_single_window)
6063 (check_current_matrix_flags, update_window, update_text_area)
6064 (update_window_line, set_window_update_flags, scrolling_window)
6065 (update_frame_1, scrolling, buffer_posn_from_coords)
6066 (do_pending_window_change, change_frame_size)
6067 (change_frame_size_1, sit_for):
6068 Use bool for boolean.
6069 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6070 and remove last int (actually boolean) argument, which was always 0.
6071 All callers changed.
6072 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6073 * dispextern.h (struct composition_it): Use bool for boolean.
6074 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6075 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6076 * dired.c (file_name_completion):
6077 Use bool for boolean. (This was missed in an earlier change.)
6078
95072a94
MR
60792012-08-27 Martin Rudalics <rudalics@gmx.at>
6080
6081 * window.c (Fset_window_configuration): Revert first part of
6082 last change.
6083
0f19feff
JD
60842012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6085
6086 * nsterm.h (NSPanel): New class variable dialog_return.
6087
3a880af4
SM
6088 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6089 Initialize dialog_return.
0f19feff
JD
6090 (windowShouldClose:): Use stop instead of stopModalWithCode.
6091 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6092 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6093 event.
6094 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6095 modal loop returns.
6096
f10fe38f
PE
60972012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6098
de1339b0
PE
6099 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6100 * composite.c (find_composition, composition_gstring_p)
6101 (composition_reseat_it, find_automatic_composition):
6102 * data.c (let_shadows_buffer_binding_p)
6103 (let_shadows_global_binding_p, set_internal, make_blv)
6104 (Fmake_variable_buffer_local, Fmake_local_variable)
6105 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6106 (cons_to_signed, arith_driver):
6107 * dbusbind.c (xd_in_read_queued_messages):
6108 * dired.c (directory_files_internal, file_name_completion):
6109 Use bool for booleans.
6110 * dired.c (file_name_completion):
6111 * process.h (fd_callback):
6112 Omit int (actually boolean) argument. It wasn't being used.
6113 All uses changed.
6114 * composite.h, lisp.h: Reflect above API changes.
6115
f10fe38f
PE
6116 * cmds.c, coding.c: Use bool for booleans.
6117 * cmds.c (move_point, Fself_insert_command):
6118 * coding.h (struct composition status, struct coding_system):
6119 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6120 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6121 (emacs_mule_char, decode_coding_emacs_mule)
6122 (encode_coding_emacs_mule, detect_coding_iso_2022)
6123 (decode_coding_iso_2022, encode_invocation_designation)
6124 (encode_designation_at_bol, encode_coding_iso_2022)
6125 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6126 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6127 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6128 (encode_coding_raw_text, detect_coding_charset)
6129 (decode_coding_charset, encode_coding_charset, detect_eol)
6130 (detect_coding, get_translation_table, produce_chars)
6131 (consume_chars, reused_workbuf_in_use)
6132 (make_conversion_work_buffer, code_conversion_save)
6133 (decode_coding_object, encode_coding_object)
6134 (detect_coding_system, char_encodable_p)
6135 (Funencodable_char_position, code_convert_region)
6136 (code_convert_string, code_convert_string_norecord)
6137 (Fset_coding_system_priority):
6138 * fileio.c (Finsert_file_contents):
6139 Use bool for booleans.
6140 * coding.h, lisp.h: Reflect above API changes.
6141 * coding.c: Remove unnecessary static function decls.
6142 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6143 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6144 not a boolean 'int', since callers never look at the return value.
6145 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6146 * coding.h (decoding_buffer_size, encoding_buffer_size)
6147 (emacs_mule_string_char): Remove unused extern decls.
6148 (struct iso_2022_spec, struct coding_system):
6149 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6150 (struct emacs_mule_spec): Remove unused field 'full_support'.
6151 All initializations removed.
6152 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6153
5474c384
DA
61542012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6155
f10fe38f 6156 Fix spare memory change (Bug#12286).
5474c384
DA
6157 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6158 (valid_lisp_object_p): Likewise.
6159
c4b6914d
MR
61602012-08-27 Martin Rudalics <rudalics@gmx.at>
6161
6162 * window.c (Fset_window_configuration): Record any window's old
6163 buffer if it's replaced (see Bug#8789). If the new current
6164 buffer doesn't appear in the selected window, go to its old
6165 point (Bug#12208).
6166
35aaa1ea
DA
61672012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6168
6169 Special MEM_TYPE_SPARE to denote reserved memory.
6170 * alloc.c (enum mem_type): New memory type.
6171 (refill_memory_reserve): Use new type for spare memory.
6172 This prevents live_cons_p and live_string_p from incorrect
6173 detection of uninitialized objects from spare memory as live.
6174
6af64513
PE
61752012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6176
8b2e00a3
PE
6177 Spelling fixes.
6178 * Makefile.in (.PHONY): versioclean -> versionclean.
6179
b52d6985
PE
6180 Remove unused external symbols.
6181 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6182 * window.c (Qwindow_valid_p, decode_valid_window):
6183 Now static, not extern.
6184 * data.c (Qinterval): Remove; unused.
6185 (syms_of_data): Do not define 'interval'.
6186 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6187 * window.h (decode_valid_window):
6188 Remove decls.
6189
d5172d4f
PE
6190 * character.c, charset.c, chartab.c: Use bool for booleans.
6191 * character.c (lisp_string_width, string_count_byte8)
6192 (string_escape_byte8):
6193 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6194 (load_charset_map_from_file, map_charset_chars)
6195 (Fdefine_charset_internal, define_charset_internal)
6196 (Fdeclare_equiv_charset, find_charsets_in_text)
6197 (Ffind_charset_region, char_charset, Fiso_charset):
6198 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6199 (sub_char_table_set, sub_char_table_set_range)
6200 (char_table_set_range, optimize_sub_char_table)
6201 (map_sub_char_table):
6202 Use bool for boolean.
6203 * character.c (str_to_unibyte): Omit last boolean argument; it was
6204 always 0. All callers changed.
6205 * character.h, charset.h: Adjust to match previous changes.
6206 * character.h (char_printable_p): Remove decl of nonexistent function.
6207 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6208 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6209 are all boolean, so make them single-bit bitfields.
6210
6af64513
PE
6211 * lisp.h (ASET): Remove attempt to detect side effects.
6212 It was meant to be temporary and it often doesn't work,
6213 because when IDX has side effects the behavior of IDX==IDX
6214 is undefined. See Stefan Monnier in
6215 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6216
e1f29348
BR
62172012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6218
6219 * lisp.h (functionp): New function (extracted from Ffunctionp).
6220 (FUNCTIONP): Use it.
6221 * eval.c (Ffunctionp): Use it.
6222
17c05d74
PE
62232012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6224
0f46bc75
PE
6225 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6226 as that's faster and simpler than static storage. Don't bother
6227 with the g_main_context_query overhead if g_main_context_pending
6228 says no events are pending.
6229 (gfds, gfds_size): Remove these static vars.
6230 (xgselect_initialize): Remove; no longer needed.
6231 All uses and decls removed.
6232
ee4c0f69
PE
6233 * emacs.c (fatal_error_signal_hook): Remove.
6234 All uses removed. This leftover from old code was always 0.
6235
17c05d74
PE
6236 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6237 * casefiddle.c (casify_object, casify_region):
6238 * casetab.c (set_case_table):
6239 * category.c, category.h (word_boundary_p):
6240 * category.h (CHAR_HAS_CATEGORY):
6241 Use bool for booleans, instead of int.
6242
391ceac5
EZ
62432012-08-25 Eli Zaretskii <eliz@gnu.org>
6244
6245 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6246
2f221583
PE
62472012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6248
f4a681b0
PE
6249 On assertion failure, print backtrace if available.
6250 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6251 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6252 * Makefile.in (LIB_EXECINFO): New macro.
6253 (LIBES): Use it.
6254
2f221583
PE
6255 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6256 * bytecode.c (exec_byte_code):
6257 * callint.c (check_mark, Fcall_interactively):
6258 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6259 (getenv_internal, sync_process_alive, call_process_exited):
6260 * lisp.h (USE_SAFE_ALLOCA):
6261 Use bool for booleans, instead of int.
6262 * lisp.h, process.h: Adjust prototypes to match above changes.
6263 * callint.c (Fcall_interactively): Don't assume the mark's
6264 offset fits in 'int'.
6265
37ef52bb
PE
62662012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6267
6268 * buffer.c, buffer.h: Use bool for boolean.
6269 * buffer.c (reset_buffer_local_variables)
6270 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6271 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6272 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6273 (overlay_touches_p, overlay_strings, Foverlay_put)
6274 (report_overlay_modification, call_overlay_mod_hooks):
6275 (mmap_enlarge, mmap_set_vars):
6276 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6277 Use bool for booleans, instead of int.
6278 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
6279 since the 1-or-0 return value is always ignored anyway.
6280 (mmap_initialized_p):
6281 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6282 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6283
2cc21167
PE
62842012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6285
6286 * bidi.c: Use bool for boolean.
6287 This is a bit more readable, and makes the text segment of bidi.o
6288 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6289 Presumably it's faster too.
6290 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
6291 Now bool.
6292 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6293 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
6294 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
6295 (bidi_explicit_dir_char, bidi_level_of_next_char)
6296 (bidi_find_other_level_edge, bidi_move_to_visually_next):
6297 Use bool for booleans, instead of int.
6298 * dispextern.h (bidi_init_it, bidi_paragraph_init)
6299 (bidi_unshelve_cache): Adjust decls to match code.
6300
7db4ddf4
MR
63012012-08-23 Martin Rudalics <rudalics@gmx.at>
6302
6303 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
6304 argument.
6305
b1bb8011
PE
63062012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6307
6308 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
6309 * atimer.h: Include <stdbool.h>.
6310
ff687885
DN
63112012-08-22 Dan Nicolaescu <dann@gnu.org>
6312
6313 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
6314 compile time tests instead of run time tests on systems that do
6315 not use them.
6316 (FRAME_MAC_P): Remove leftover from deleted code.
6317 * frame.c (syms_of_frame): Remove leftover from deleted code.
6318
4ce7a138
JD
63192012-08-22 Jan Djärv <jan.h.d@swipnet.se>
6320
6321 * nsterm.m (insertText:): Don't clear modifiers if code is space.
6322
d733ec6d
PE
63232012-08-22 Paul Eggert <eggert@cs.ucla.edu>
6324
6325 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
6326 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 6327 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
6328 (fontset_add): Return void, for FONTSET_ADD.
6329
d0d2d26f
PE
63302012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6331
fce31d69
PE
6332 * alloc.c: Use bool for booleans.
6333 (gc_in_progress, abort_on_gc)
6334 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6335 (dont_register_blocks) [GC_MALLOC_CHECK]:
6336 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
6337 (check_string_bytes, make_specified_string, memory_full)
6338 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
6339 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
6340 (mark_stack, valid_pointer_p, make_pure_string)
6341 (Fgarbage_collect, survives_gc_p, gc_sweep):
6342 Use bool for booleans, instead of int.
6343 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6344 Remove unused local.
6345 * alloc.c (PURE_POINTER_P):
6346 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
6347 * editfns.c (Fformat):
6348 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
6349 (Fdo_auto_save):
6350 * fns.c (sweep_weak_table):
6351 * lisp.h (suppress_checking, push_message, survives_gc_p)
6352 (make_pure_string, gc_in_progress, abort_on_gc):
6353 * lread.c (readchar, read1):
6354 * print.c (Fprin1_to_string):
6355 * xdisp.c (push_message):
6356 Use bool for booleans affected directly or indirectly by
6357 alloc.c's changes.
6358
d0d2d26f
PE
6359 Make recently-introduced setters macros.
6360 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
6361 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
6362 (set_fontset_default, set_fontset_fallback): Rename from their
6363 upper-case counterparts, and make them functions rather than macros.
6364 This is more consistent with the other recently-introduced setters.
6365 These don't need to be inline, since they're local.
6366
d18e2bb6
JD
63672012-08-21 Jan Djärv <jan.h.d@swipnet.se>
6368
6369 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
6370 the loop (Bug#12247).
6371
1b9d9d16
PE
63722012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6373
6374 * lisp.h (vcopy): Use memcpy rather than our own loop.
6375 This fixes a performance regression introduced by the recent
6376 addition of vcopy. This means 'vcopy' will need to be modified
6377 for a copying collector, but that's OK. Also, tighten the
6378 checking in the assertion.
6379
b2f09701
EZ
63802012-08-21 Eli Zaretskii <eliz@gnu.org>
6381
6382 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
6383 components for RTL text (Bug#11860). Adjust X-OFFSET of each
6384 non-base glyph for the width of the base character, according to
e1f29348
BR
6385 what x_draw_composite_glyph_string_foreground expects.
6386 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
6387 expectations, to produce correct width of the composed character.
6388 Reverse the sign of the DU offset produced by ScriptPlace.
6389
9b994fed
PE
63902012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6391
6392 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
6393
086ca913
DA
63942012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6395
6396 Avoid direct writes to contents member of struct Lisp_Vector.
6397 * lisp.h (vcopy): New function to copy data into vector.
6398 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
6399 * fns.c (Ffillarray): Use ASET.
6400 * keyboard.c (timer_check_2): Use AREF and ASET.
6401 (append_tool_bar_item, Frecent_keys): Use vcopy.
6402 * lread.c (read_vector): Use ASET.
6403 * msdos.c (Frecent_doskeys): Use vcopy.
6404 * xface.c (Finternal_copy_lisp_face): Use vcopy.
6405 (Finternal_merge_in_global_face): Use ASET and vcopy.
6406 * xfont.c (xfont_list_pattern): Likewise.
6407
5481664a
MR
64082012-08-21 Martin Rudalics <rudalics@gmx.at>
6409
6410 * window.c (Fwindow_point): For the selected window always return
6411 the position of its buffer's point.
6412 (Fset_window_point): For the selected window always go in its
6413 buffer to the specified position.
6414
6d470bdd
DA
64152012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6416
6417 Setter macros for fontsets.
6418 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
6419 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
6420 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
6421 Adjust users.
6422
24564fe1
GM
64232012-08-20 Glenn Morris <rgm@gnu.org>
6424
6425 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6426 Don't assume that `ln -f' works.
6427
0a05a035
EZ
64282012-08-20 Eli Zaretskii <eliz@gnu.org>
6429
6430 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
6431 and later about non-assignments with no effect. See discussion at
6432 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
6433 details.
6434
e46f2325
DA
64352012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6436
6437 Inline setter functions for Lisp_Objects slots of struct specbinding.
6438 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
6439 Adjust users.
6440
734fbd86
MR
64412012-08-20 Martin Rudalics <rudalics@gmx.at>
6442
6443 * window.c (select_window): Always make selected window's buffer
6444 current.
6445
f1a95992
DA
64462012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6447
6448 Use AREF and ASET for docstrings of category tables.
6449 * category.h (CATEGORY_DOCSTRING): Use AREF.
6450 (SET_CATEGORY_DOCSTRING): Use ASET.
6451 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
6452
e83064be
DA
64532012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6454
6455 Inline setter functions for hash table members.
6456 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
6457 (set_hash_hash, set_hash_index): Rename with _slot suffix.
6458 (set_hash_key_and_value, set_hash_index, set_hash_next)
6459 (set_hash_hash): New functions.
6460 * charset.c, fns.c: Adjust users.
6461
4ce60d2e
DA
64622012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6463
6464 Inline getter and setter functions for per-buffer values.
6465 * buffer.h (per_buffer_default, set_per_buffer_default)
6466 (per_buffer_value, set_per_buffer_value): New functions.
6467 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
6468 * buffer.c, data.c: Adjust users.
6469
c06c9690
JB
64702012-08-20 Juanma Barranquero <lekktu@gmail.com>
6471
6472 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
6473
32bd4250
PE
64742012-08-19 Paul Eggert <eggert@cs.ucla.edu>
6475
bad03192 6476 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
6477 as gnulib does this if the system doesn't.
6478 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
6479 Remove declaration. MS-Windows declares it on stdlib.h which is
6480 included by conf_post.h.
b69a6d22
PE
6481 * emacs.c (environ) [DOUG_LEA_MALLOC]:
6482 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
6483 * vm-limit.c: Include <unistd.h>, for 'environ'.
6484
22d7feb2
PE
6485 * unexaix.c, unexcoff.c: Include "mem-limits.h".
6486 (start_of_data): Remove decl; mem-limits.h provides it.
6487
32bd4250
PE
6488 * xdisp.c (handle_invisible_prop): Make it a bit faster
6489 and avoid a gcc -Wmaybe-uninitialized diagnostic.
6490
450809af
CY
64912012-08-19 Chong Yidong <cyd@gnu.org>
6492
6493 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
6494 ends (Bug#3874).
6495
9e677988
AS
64962012-08-19 Andreas Schwab <schwab@linux-m68k.org>
6497
6b1319ce
AS
6498 * .gdbinit: Use call instead of set when calling a function in the
6499 inferior.
6500
9e677988
AS
6501 * data.c (set_internal): Don't use set_blv_found.
6502 (Fkill_local_variable): Likewise.
6503
d7191076
AA
65042012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
6505
6506 * nsfont.m (ns_ascii_average_width): Ensure the string
6507 ascii_printable is initialized with a null-terminated character
6508 array. Otherwise, it can contain undesired extra characters.
6509
e757f1c6
PE
65102012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6511
6512 port new setting code to Sun C 5.8 2005/10/13
6513 * chartab.c, lisp.h (char_table_set, char_table_set_range):
6514 Return void, not Lisp_Object. Otherwise, the compiler
6515 complains about (A?B:C) where B is void and C is Lisp_Object
6516 when compiling CHAR_TABLE_SET, due to the recent change to
6517 the API of sub_char_table_set_contents.
6518
a999ce26
CY
65192012-08-18 Chong Yidong <cyd@gnu.org>
6520
6521 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
6522 for the string case (Bug#3874).
6523
3f22b86f
PE
65242012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6525
39eb03f1
PE
6526 * buffer.h (BSET): Remove (Bug#12215).
6527 Replace all uses with calls to new setter functions.
6528 (bset_bidi_paragraph_direction, bset_case_canon_table)
6529 (bset_case_eqv_table, bset_directory, bset_display_count)
6530 (bset_display_time, bset_downcase_table)
6531 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
6532 (bset_last_selected_window, bset_local_var_alist)
6533 (bset_mark_active, bset_point_before_scroll, bset_read_only)
6534 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
6535 (bset_width_table):
6536 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6537 (bset_auto_fill_function, bset_auto_save_file_format)
6538 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6539 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6540 (bset_cache_long_line_scans, bset_case_fold_search)
6541 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6542 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6543 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6544 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6545 (bset_header_line_format, bset_indicate_buffer_boundaries)
6546 (bset_indicate_empty_lines, bset_invisibility_spec)
6547 (bset_left_fringe_width, bset_major_mode, bset_mark)
6548 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6549 (bset_name, bset_overwrite_mode, bset_pt_marker)
6550 (bset_right_fringe_width, bset_save_length)
6551 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6552 (bset_scroll_up_aggressively, bset_selective_display)
6553 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6554 (bset_word_wrap, bset_zv_marker):
6555 * category.c (bset_category_table):
6556 * syntax.c (bset_syntax_table):
6557 New setter functions.
6558
6a09a33b
PE
6559 * process.h (PSET): Remove (Bug#12215).
6560 Replace all uses with calls to new setter functions.
6561 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6562 (PROCESS_INLINE): New macro.
6563 (pset_childp): New setter function.
6564 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
6565 * process.c (PROCESS_INLINE):
6566 Define to EXTERN_INLINE, so that the corresponding functions
6567 are compiled into code.
6568 (pset_buffer, pset_command, pset_decode_coding_system)
6569 (pset_decoding_buf, pset_encode_coding_system)
6570 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
6571 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
6572 (pset_type, pset_write_queue): New setter functions.
6573
e8c17b81
PE
6574 * window.h (WSET): Remove (Bug#12215).
6575 Replace all uses with calls to new setter functions.
6576 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6577 (WINDOW_INLINE): New macro.
6578 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
6579 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
6580 (wset_total_lines, wset_vertical_scroll_bar)
6581 (wset_window_end_pos, wset_window_end_valid)
6582 (wset_window_end_vpos): New setter functions.
6583 * window.c (WINDOW_INLINE):
6584 Define to EXTERN_INLINE, so that the corresponding functions
6585 are compiled into code.
6586 (wset_combination_limit, wset_dedicated, wset_display_table)
6587 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
6588 (wset_new_normal, wset_new_total, wset_next_buffers)
6589 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6590 (wset_prev_buffers, wset_right_fringe_width)
6591 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
6592 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
6593 (wset_window_parameters):
6594 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6595 (wset_column_number_displayed, wset_region_showing):
6596 New setter functions.
6597
3f22b86f
PE
6598 * termhooks.h (TSET): Remove (Bug#12215).
6599 Replace all uses with calls to new setter functions.
6600 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6601 (TERMHOOKS_INLINE): New macro.
6602 (tset_charset_list, tset_selection_alist): New setter functions.
6603 * terminal.c (TERMHOOKS_INLINE):
6604 Define to EXTERN_INLINE, so that the corresponding functions
6605 are compiled into code.
6606 (tset_param_alist): New setter function.
6607
742af32f
PE
66082012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6609
15dbb4d6
PE
6610 * keyboard.h (KSET): Remove (Bug#12215).
6611 Replace all uses with calls to new setter functions.
6612 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6613 (KEYBOARD_INLINE): New macro.
6614 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
6615 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
6616 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
6617 New setter functions.
6618 * keyboard.c (KEYBOARD_INLINE):
6619 Define to EXTERN_INLINE, so that the corresponding functions
6620 are compiled into code.
6621 (kset_echo_string, kset_kbd_queue)
6622 (kset_keyboard_translate_table, kset_last_prefix_arg)
6623 (kset_last_repeatable_command, kset_local_function_key_map)
6624 (kset_overriding_terminal_local_map, kset_real_last_command)
6625 (kset_system_key_syms): New setter functions.
6626
f00af5b1
PE
6627 * frame.h (FSET): Remove (Bug#12215).
6628 Replace all uses with calls to new setter functions.
6629 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6630 (FRAME_INLINE): New macro.
6631 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
6632 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
6633 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
6634 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
6635 (fset_param_alist, fset_root_window, fset_scroll_bars)
6636 (fset_selected_window, fset_title, fset_tool_bar_items)
6637 (fset_tool_bar_position, fset_tool_bar_window): New functions.
6638 * frame.c (FRAME_INLINE):
6639 Define to EXTERN_INLINE, so that the corresponding functions
6640 are compiled into code.
6641 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
6642
0c94c8d6
PE
6643 A few more naming-convention fixes for getters and setters.
6644 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
6645 and rename from buffer_overlays_set_before.
6646 (set_buffer_overlays_after): Move here from buffer.h, and rename
6647 from buffer_overlays_set_after.
6648 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
6649 All uses changed.
6650 (set_buffer_intervals): Rename from buffer_set_intervals.
6651 * intervals.c (set_interval_object): Move here from intervals.h,
6652 and rename from interval_set_object.
6653 (set_interval_left): Move here from intervals.h, and rename from
6654 interval_set_left.
6655 (set_interval_right): Move here from intervals.h, and rename from
6656 interval_set_right.
6657 (copy_interval_parent): Move here from intervals.h, and rename from
6658 interval_copy_parent.
6659 * intervals.h (set_interval_parent): Rename from interval_set_parent.
6660 (set_interval_plist): Rename from interval_set_plist.
6661 Return void, not Lisp_Object, since no caller uses the result.
6662 * lisp.h (string_intervals): Rename from string_get_intervals.
6663 (set_string_intervals): Rename from string_set_intervals.
6664
34dabdb7
PE
6665 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
6666 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 6667 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
6668 All uses changed. See the end of
6669 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
6670
742af32f
PE
6671 * lisp.h (CSET): Remove (Bug#12215).
6672 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
6673 (set_char_table_purpose): New functions,
6674 replacing CSET. All uses changed. For example, replace
6675 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 6676 "set_char_table_parent (char_table, parent);".
742af32f
PE
6677 The old version was confusing because it used the same name
6678 'parent' for two different things.
6679
a04e2c62
DA
66802012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6681
6682 Functions to get and set Lisp_Object fields of buffer-local variables.
6683 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
6684 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
6685 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
6686 * data.c, eval.c, frame.c: Adjust users.
6687
383dcbf9
CY
66882012-08-17 Chong Yidong <cyd@gnu.org>
6689
6690 * xfaces.c (merge_face_vectors): If the target font specfies a
6691 font spec, make the font's attributes take precedence over
6692 directly-specified attributes.
6693 (merge_face_ref): Recognize :font.
6694
44386687
DA
66952012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6696
6697 Do not use memcpy for copying intervals.
6698 * intervals.c (reproduce_interval): New function.
6699 (reproduce_tree, reproduce_tree_obj): Use it.
6700 (reproduce_tree_obj): Remove prototype.
6701
927c7216
PE
67022012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6703
6704 * lisp.h (duration_to_sec_usec): Remove unused decl.
6705
93044f7b
AA
67062012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
6707
6708 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
6709 to an allocated instance of NSString, not to the class itself.
6710
9851e4a5
JB
67112012-08-17 Juanma Barranquero <lekktu@gmail.com>
6712
6713 * makefile.w32-in (C_CTYPE_H): New macro.
6714 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
6715 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
6716 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6717
620f13b0
PE
67182012-08-16 Paul Eggert <eggert@cs.ucla.edu>
6719
6720 Use ASCII tests for character types.
6721 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
6722 * xfns.c, xterm.c:
6723 Don't include <ctype.h>; was not needed.
6724 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
6725 * sysdep.c, xfaces.c:
6726 Include <c-ctype.h> instead of <ctype.h>.
6727 * nsterm.m: Include <c-ctype.h>.
6728 * charset.c (read_hex):
6729 * doc.c (Fsnarf_documentation):
6730 * fileio.c (IS_DRIVE) [WINDOWSNT]:
6731 (DRIVE_LETTER) [DOS_NT]:
6732 (Ffile_name_directory, Fexpand_file_name)
6733 (Fsubstitute_in_file_name):
6734 * font.c (font_parse_xlfd, font_parse_fcname):
6735 * frame.c (x_set_font_backend):
6736 * gtkutil.c (xg_get_font):
6737 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
6738 * nsimage.m (hexchar):
6739 * nsterm.m (ns_xlfd_to_fontname):
6740 * sysdep.c (system_process_attributes):
6741 * xfaces.c (hash_string_case_insensitive):
6742 Use C-locale tests instead of locale-specific tests for character
6743 types, since we want the ASCII interpretation here, not the
6744 interpretation suitable for whatever happens to be the current locale.
6745
52162052
MR
67462012-08-16 Martin Rudalics <rudalics@gmx.at>
6747
6748 Consistently check windows for validity/liveness
6749 (Bug#11984, Bug#12025, Bug#12026).
6750 * lisp.h (CHECK_VALID_WINDOW): New macro.
6751 * window.c (decode_window): Rename to decode_live_window.
6752 (decode_valid_window, Fwindow_valid_p): New functions.
6753 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
6754 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
6755 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
6756 (Fwindow_prev_sibling, Fwindow_combination_limit)
6757 (Fset_window_combination_limit, Fwindow_use_time)
6758 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
6759 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
6760 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
6761 (Fwindow_hscroll, Fset_window_hscroll)
6762 (Fwindow_redisplay_end_trigger)
6763 (Fset_window_redisplay_end_trigger, Fwindow_edges)
6764 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
6765 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6766 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
6767 (Fwindow_end, Fset_window_point, Fset_window_start)
6768 (Fpos_visible_in_window_p, Fwindow_line_height)
6769 (Fwindow_dedicated_p, Fset_window_dedicated_p)
6770 (Fwindow_prev_buffers, Fset_window_prev_buffers)
6771 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
6772 (Fset_window_parameter, Fwindow_display_table)
6773 (Fset_window_display_table, Fdelete_other_windows_internal)
6774 (Fset_window_buffer, Fset_window_new_total)
6775 (Fset_window_new_normal, Fdelete_window_internal)
6776 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
6777 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
6778 (Fwindow_scroll_bars): Check whether argument window is a valid or
6779 live window. Update doc-strings.
6780 (syms_of_window): New symbol Qwindow_valid_p.
6781 * keyboard.c (Fposn_at_x_y): Check whether argument
6782 frame_or_window denotes a valid window.
6783
2751c80f
DA
67842012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6785
6786 Fix previous char table change.
6787 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
6788 * chartab.c (optimize_sub_char_table): Likewise.
6789
032a42c8
CY
67902012-08-16 Chong Yidong <cyd@gnu.org>
6791
a2d19368
CY
6792 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
6793
032a42c8
CY
6794 * xfont.c (xfont_open):
6795 * xftfont.c (xftfont_open): Set the font's max_width field.
6796
6797 * nsfont.m (nsfont_open): Similar to the Xft backend, set
6798 min_width to space_width and average_width to the average over
6799 printable ASCII characters.
6800 (ns_char_width): Code cleanup.
6801 (ns_ascii_average_width): New utility function.
6802
6803 * font.h (struct font): Update comments.
6804
a098c930
DA
68052012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6806
032a42c8 6807 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
6808 * lisp.h (CSET): New macro.
6809 (char_table_set_extras, char_table_set_contents)
6810 (sub_char_table_set_contents): New function.
6811 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
6812 * syntax.c: Adjust users.
6813
8be3a09c
SM
68142012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
6815
6816 * eval.c (eval_sub): Bind lexical-binding.
6817 * lread.c (Qlexical_binding): Make non-static.
6818
ac4845a6
JD
68192012-08-15 Jan Djärv <jan.h.d@swipnet.se>
6820
ddee6515
JD
6821 * nsmenu.m (popupSession): Remove.
6822 (pop_down_menu): Remove endModalSession.
6823 (timeout_handler:): New method.
6824 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
6825 Call runModalForWindow. Check timer_fired when it returns.
6826 If not set, cancel timer and break out of loop.
6827 Otherwise loop again, with a new timeout.
6828
6829 * nsterm.m: Include fcntl.h if present.
6830 (fd_entry, t_readfds, inNsSelect): Remove.
6831 (select_writefds, select_valid, select_timeout, selfds)
6832 (select_mutex, apploopnr): Add.
6833 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
6834 Otherwise call kbd_buffer_store_event.
6835 (ns_send_appdefined): Remove release of fd_entry.
6836 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
6837 Increment and decrement apploopnr.
6838 (ns_select): If no file descriptors, just do a NSTimer.
6839 Otherwise copy read/write masks and start select thread (fd_handler).
6840 Start main loop and wait for application defined event.
6841 Inform select thread to stop selecting after main loop is exited.
6842 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 6843 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
6844 (fd_handler:): Loop forever, wait for info from the main thread
6845 to either start or stop selecting. When select returns, send
6846 and appdefined event.
6847 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
6848 If not call kbd_buffer_store_event.
6849
6850 * nsterm.h (EmacsApp): fd_handler takes id argument.
6851 (EmacsDialogPanel): Add timer_fired and timeout_handler.
6852
ac4845a6
JD
6853 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
6854
eb424fe3
EZ
68552012-08-15 Eli Zaretskii <eliz@gnu.org>
6856
6857 * region-cache.c (move_cache_gap): Update gap_len using the actual
6858 growth of the boundaries array. Do not change cache_len.
6859 (Bug#12196)
6860
4e6a86c6
DA
68612012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6862
6863 Generalize and cleanup font subsystem checks.
6864 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
6865 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
6866 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 6867
5bf192ca
DA
68682012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6869
6870 * gtkutil.c (xg_get_font): Use pango_units_to_double.
6871
f2045622
CY
68722012-08-15 Chong Yidong <cyd@gnu.org>
6873
8be3a09c
SM
6874 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
6875 When using the new font chooser, use gtk_font_chooser_get_font_desc to
6876 extract the font descriptor instead of just the font name.
6877 In that case, return a font spec instead of a string.
f2045622
CY
6878 (x_last_font_name): Move to this file from xfns.c.
6879
6880 * xfns.c (Fx_select_font): The return value can also be a font
6881 spec. Move x_last_font_name management to gtkutil.c.
6882
6883 * xfaces.c: Make font weight and style symbols non-static.
6884
7f6feb56
SM
68852012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
6886
6887 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
6888 (bug#12117).
6889
fecbd8ff
SM
68902012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
6891
6892 * alloc.c (Fgarbage_collect): Use plural form consistently.
6893
9b8d5165
EZ
68942012-08-14 Eli Zaretskii <eliz@gnu.org>
6895
6896 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
6897 iteration through the command loop. Fixes a problem whereby mouse
6898 movements are ignored until the first mouse click.
6899
f5d9e83a
PE
69002012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6901
6902 Use bool, not int, for Lisp booleans.
6903 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
6904 makes Emacs a bit smaller and presumably a bit faster.
6905 * lisp.h: Include <stdbool.h>.
6906 (struct Lisp_Boolfwd, defvar_bool):
6907 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
6908 * regex.c [!emacs]: Include <stdbool.h>.
6909 (false, true): Remove; <stdbool.h> does this for us now.
6910
55802e4a
CY
69112012-08-14 Chong Yidong <cyd@gnu.org>
6912
4abcdac8
CY
6913 * character.c (Fcharacterp): Doc fix (Bug#12076).
6914
6915 * data.c (Findirect_variable): Doc fix (Bug#11040).
6916
55802e4a
CY
6917 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
6918
6919 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 6920 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 6921
8e99d072
BR
69222012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6923
6924 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
6925 (bug#12022).
6926
08908aca
MR
69272012-08-14 Martin Rudalics <rudalics@gmx.at>
6928
6929 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
6930 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
6931 * minibuf.c (choose_minibuf_frame, read_minibuf):
6932 * w32fns.c (x_create_tip_frame):
6933 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
6934 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
6935
56120d6f
PE
69362012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6937
6938 * intervals.c (offset_intervals): Remove obsolete comment.
6939
67b77c0b
AS
69402012-08-14 Andreas Schwab <schwab@linux-m68k.org>
6941
6942 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
6943
f48b82fd
GR
69442012-08-14 Gergely Risko <gergely@risko.hu>
6945
6946 * coding.c (decode_coding): Record buffer modification before
6947 disabling undo_list (Bug#11773).
6948
fd318b54
DA
69492012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6950
6951 Revert and cleanup some recent overlay changes.
6952 * buffer.h (enum overlay_type): Remove.
6953 (buffer_get_overlays, buffer_set_overlays): Likewise.
6954 (buffer_set_overlays_before, buffer_set_overlays_after):
6955 New function. Adjust users.
6956 (unchain_both): Add eassert.
6957
41a62dd9
DA
69582012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6959
6960 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
6961
5884c324
PE
69622012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6963
6964 * gtkutil.c (xg_mark_data): Don't assume C99.
6965
ca06f160
JD
69662012-08-13 Jan Djärv <jan.h.d@swipnet.se>
6967
6968 * gtkutil.c (xg_frame_tb_info): New struct.
6969 (TB_INFO_KEY): New define.
6970 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
6971 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
6972 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
6973 if not present.
6974 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 6975 is up to date. Otherwise store new data.
ca06f160
JD
6976 (free_frame_tool_bar): Free xg_frame_tb_info if present.
6977
7864a3f7
DA
69782012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6979
6980 Use KSET for write access to Lisp_Object members of struct kboard.
6981 * keyboard.h (KSET): New macro.
6982 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
6983 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
6984 * xterm.c: Adjust users.
6985
4c31be61
DA
69862012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6987
6988 Use BSET for write access to Lisp_Object members of struct buffer.
6989 * buffer.h (BSET): New macro.
6990 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
6991 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
6992 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
6993 * window.c, xdisp.c, xfns.c: Adjust users.
6994
14ae4239
BT
69952012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
6996
6997 * lread.c (syms_of_lread): Initialize Vlexical_binding.
6998
32bcadb4
JD
69992012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7000
3d29b2ce 7001 * nsterm.m (not_in_argv): New function.
fc0c31f8 7002 (application:openFile, application:openTempFile:):
3d29b2ce
JD
7003 (application:openFileWithoutUI:, application:openFiles:): Open file
7004 if not_in_argv returns non-zero (bug#12171).
7005
32bcadb4 7006 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
7007 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7008 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
7009 (xg_get_font_name): Use those functions/macros here.
7010 Reported by Frans Oilinki <moilinki@gmail.com>.
7011
9ff9402d 70122012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
7013
7014 * unexmacosx.c (copy_data_segment): Copy initialized data in
7015 statically linked libraries from input file rather than memory.
7016
db74a5fc
YM
7017 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7018 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7019 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7020
25e65510
GM
70212012-08-10 Glenn Morris <rgm@gnu.org>
7022
7023 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7024 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7025
7961135c
DA
70262012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7027
7028 Fix last change to allow compilation with low optimization levels.
7029 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7030 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7031
42b3a444
DA
70322012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7033
7034 Use common inline syntax in intervals.h.
7035 * intervals.h (INTERVALS_INLINE): New macro.
7036 Change all users from LISP_INLINE.
7037
9fb0c957
DA
70382012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7039
7040 Define Qnone once for all platforms.
7041 * frame.c (Qnone): Define here.
7042 (syms_of_frame): DEFSYM it.
7043 * lisp.h (Qnone): New declaration.
7044 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7045 * xfns.c: Remove duplication. Adjust users.
7046
65e8ee52
DA
70472012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7048
7049 Remove unused macros from intervals.h.
7050 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7051 * intervals.c: Adjust comment.
7052
9b855fd6
EZ
70532012-08-10 Eli Zaretskii <eliz@gnu.org>
7054
7055 * w32fns.c <w32_unicode_gui>: New static variable.
7056 (globals_of_w32fns): Initialize it according to os_subtype.
7057 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7058 testing os_subtype.
7059
39cb9e56 70602012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
7061 Eli Zaretskii <eliz@gnu.org>
7062
7063 Fix bug #10299 with Unicode characters sent by customized
7064 keyboards created by MSKLC.
7065 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7066 (w32_init_class): Use it to initialize the Emacs class with either
7067 ANSI or Unicode API calls.
7068 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7069 later.
7070 (w32_wnd_proc): If the character code sent by WM_CHAR or
7071 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7072 original message. Call DefWindowProcW on NT and later.
7073
9374581a
GM
70742012-08-10 Glenn Morris <rgm@gnu.org>
7075
4b94e8cf
GM
7076 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7077
9374581a
GM
7078 * lisp.h (DIRECTORY_SEP): Let configure set it.
7079
a2752828
DA
70802012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7081
7082 Use TSET for write access to Lisp_Object slots of struct terminal.
7083 * termhooks.h (TSET): New macro.
7084 * coding.c, terminal.c, xselect.c: Adjust users.
7085
cc92c454
SM
70862012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7087
7088 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7089 the failing expression, include them in the error message.
7090 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7091 * lisp.h (internal_condition_case_n): Update declaration.
7092
4cb3e6b3
DA
70932012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7094
7095 Inline functions to examine and change buffer overlays.
7096 * buffer.c (unchain_both): New function.
7097 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7098 (buffer_has_overlays): New function.
7099 (enum overlay_type): New enum.
7100 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7101 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7102
8707c1e5
DA
71032012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7104
7105 Inline functions to examine and change buffer intervals.
7106 * alloc.c (mark_interval_tree): Remove.
7107 (MARK_INTERVAL_TREE): Simplify.
7108 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7109 * intervals.c (buffer_balance_intervals): New function.
7110 (graft_intervals_into_buffer): Adjust indentation.
7111 (set_intervals_multibyte): Simplify.
7112 * buffer.h (BUF_INTERVALS): Remove.
7113 (buffer_get_intervals, buffer_set_intervals): New function.
7114 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7115 * intervals.c, textprop.c: Adjust users.
7116
ad8c997f
DA
71172012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7118
7119 Inline functions to examine and change string intervals.
7120 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7121 (string_get_intervals, string_set_intervals): New function.
7122 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7123 * lread.c, print.c, textprop.c: Adjust users.
7124
32ac3a6b
GM
71252012-08-08 Glenn Morris <rgm@gnu.org>
7126
7127 * lisp.mk (lisp): Remove language/persian.elc.
7128
77c7bcb1
DA
71292012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7130
7131 Cleanup intervals.
7132 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7133 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
7134 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7135 Adjust comment. Move under #if 0.
77c7bcb1
DA
7136 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7137 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7138
9c08a8d4
DA
71392012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7140
7141 Check total length of intervals with eassert.
7142 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7143 * intervals.c: Change all users to eassert.
7144
26d16b35
EZ
71452012-08-07 Eli Zaretskii <eliz@gnu.org>
7146
14ae4239
BT
7147 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7148 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
7149 INTERNAL_FIELD in Lisp_Cons.
7150
c644523b
DA
71512012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7152
7153 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7154 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7155 name since all xname users are fixed long time ago. Do not
7156 use INTERNAL_FIELD.
7157 (set_symbol_name, set_symbol_function, set_symbol_plist):
7158 (set_symbol_next, set_overlay_plist): New function.
7159 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7160 (struct Lisp_Overlay): Likewise.
7161 (CVAR, MVAR, SVAR): Remove.
7162 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7163 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7164 * xterm.c: Adjust users.
7165 * .gdbinit: Change to use name field of struct Lisp_Symbol
7166 where appropriate.
7167
6a3d20cc
DA
71682012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7169
7170 Basic functions to set Lisp_Object and pointer slots of intervals.
7171 * intervals.h (interval_set_parent, interval_set_object):
7172 (interval_set_left, interval_set_right, interval_set_plist):
7173 (interval_copy_parent): New function.
7174 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
7175 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7176 Adjust indentation.
6a3d20cc
DA
7177 (INTERVAL_SIZE): Remove. Adjust users.
7178 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7179
4d2b044c
DA
71802012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7181
7182 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7183 * process.h (PGET): Remove.
7184 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7185 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7186
d3d50620
DA
71872012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7188
7189 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7190 * window.h (WGET): Remove.
7191 (struct window): Do not use INTERNAL_FIELD.
7192 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7193 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7194 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7195 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7196 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7197 Adjust users.
7198
d10a51dc
CY
71992012-08-07 Chong Yidong <cyd@gnu.org>
7200
7201 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7202 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7203 (Fdelete_window_internal): Signal an error if the window is not on
7204 a live frame (Bug#12025).
7205
e69b0960
DA
72062012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7207
7208 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7209 * frame.h (FGET): Remove.
7210 (struct frame): Do not use INTERNAL_FIELD.
7211 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7212 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7213 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7214 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7215
25a20a3a
JB
72162012-08-06 Juanma Barranquero <lekktu@gmail.com>
7217
7218 * w32.c: Silence compiler warnings.
7219 (map_w32_filename): Remove unused variable `is_fat'.
7220 (chase_symlinks): Add parentheses around expression.
7221
1c6f11f4
GM
72222012-08-06 Glenn Morris <rgm@gnu.org>
7223
1db4583a
GM
7224 * sysdep.c: Respect BROKEN_GETWD.
7225
1c6f11f4
GM
7226 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7227 Let configure handle it.
7228 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7229
2b90362b
DA
72302012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7231
7232 Use GCALIGNMENT where appropriate.
7233 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7234 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7235 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7236
5f50daf2
EZ
72372012-08-06 Eli Zaretskii <eliz@gnu.org>
7238
14ae4239
BT
7239 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7240 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 7241
cbcc7007
SM
72422012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7243
7244 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7245 that should be sufficient for everyone.
7246
4d365fa4
JD
72472012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7248
7249 * keyboard.c (timer_check_2): Add break so timer_check returns next
7250 timeout.
7251
dd86bd82
DA
72522012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7253
7254 Fix Windows build errors introduced after converting to WGET and WSET.
7255 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7256 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7257
054e1668
JD
72582012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7259
7260 * nsterm.m (ns_frame_rehighlight): Use FSET.
7261
7262 * nsmenu.m (ns_update_menubar): Use FSET.
7263
21238f11
DA
72642012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7265
7266 Separate read and write access to Lisp_Object slots of Lisp_Process.
7267 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7268 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7269
077288cf
DA
72702012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7271
7272 Separate read and write access to Lisp_Object slots of struct window.
7273 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7274 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7275 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7276 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7277 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7278 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7279 Adjust users.
7280
71688bd7
DA
72812012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7282
7283 Fix Windows build errors introduced after converting to FGET and FSET.
7284 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7285 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7286 (w32_judge_scroll_bars): Change to use FSET.
7287 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7288
f99bac93
DA
72892012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7290
7291 Fix replacement typo.
7292 * window.c (replace_window): Set root_window instead of
7293 selected_window. This fixes a total window subsystem
7294 malfunction reported by Bastien Guerry <bzg@gnu.org>.
7295
8c2a0f2d
GM
72962012-08-06 Glenn Morris <rgm@gnu.org>
7297
7298 * lisp.mk (lisp): Add language/persian.elc.
7299
edd74c35
DA
73002012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7301
7302 Separate read and write access to Lisp_Object slots of struct frame.
7303 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
7304 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7305 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7306 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7307 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7308
8671676c
AS
73092012-08-05 Andreas Schwab <schwab@linux-m68k.org>
7310
7311 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
7312
663e2b3f
DA
73132012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
7314
7315 Generalize common compile-time constants.
7316 * lisp.h (header_size, bool_header_size, word_size): Now here.
7317 (struct Lisp_Vector): Add comment.
7318 (struct Lisp_Bool_Vector): Move up to define handy constants.
7319 (VECSIZE, PSEUDOVECSIZE): Simplify.
7320 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
7321 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
7322 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
7323 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
7324 * xfont.c, xmenu.c: Use word_size where appropriate.
7325
d32e47af
LM
73262012-08-05 Lawrence Mitchell <wence@gmx.li>
7327
7328 * search.c (Freplace_match): Treat \? in the replacement text
7329 literally (Bug#8161).
7330
e5d9c0d1
CY
73312012-08-05 Chong Yidong <cyd@gnu.org>
7332
7333 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
7334 * frame.c (Vdelete_frame_functions):
7335 * emacs.c (Vkill_emacs_hook): Doc fix.
7336
8da0576b
EZ
73372012-08-04 Eli Zaretskii <eliz@gnu.org>
7338
7339 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
7340 --with-x-toolkit=no builds.
7341 Reported by Carsten Mattner <carstenmattner@gmail.com>.
7342
02676e5d
CY
73432012-08-04 Chong Yidong <cyd@gnu.org>
7344
7345 * syntax.c (Fmodify_syntax_entry): Doc fix.
7346
97147da9
EZ
73472012-08-04 Eli Zaretskii <eliz@gnu.org>
7348
76151e2c
EZ
7349 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
7350 * w32.c (init_environment): Change the default values of many
7351 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
7352 them into environment when they were not already defined.
7353 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 7354 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
7355 (check_windows_init_file): Now external, not static.
7356 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
7357 called when Vload_path is already set up.
7358
7359 * w32.h (check_windows_init_file): Add prototype.
7360
7361 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
7362 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
7363 compatibility with Posix platforms.
7364 (main): Move the call to check_windows_init_file to here from
7365 w32.c.
7366 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
7367 any, in the DEFALT argument into the root of the Emacs build or
7368 installation tree, as appropriate.
7369
7370 * callproc.c (init_callproc_1): Call decode_env_path instead of
7371 doing its equivalent by hand.
7372 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
7373 the code that sets Vexec_path run on MS-Windows.
7374
7375 * lread.c (init_lread): Add comments to #ifdef's.
7376
97147da9
EZ
7377 * msdos.c (dos_set_window_size, IT_update_begin)
7378 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
7379 instead of direct references.
7380
185ee146
PE
73812012-08-04 Paul Eggert <eggert@cs.ucla.edu>
7382
7383 Export DEFAULT_REHASH_* to GDB.
7384 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
7385 Now constants, not macros.
7386
8834c57a
PE
73872012-08-03 Paul Eggert <eggert@cs.ucla.edu>
7388
98c6f1e3
PE
7389 Remove unnecessary casts involving pointers.
7390 These casts are no longer needed now that we assume C89 or later,
7391 since they involve casting to or from void *.
7392 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
7393 (make_pure_float, make_pure_vector):
7394 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
7395 * macros.c (Fstart_kbd_macro):
7396 * menu.c (find_and_return_menu_selection):
7397 * minibuf.c (read_minibuf_noninteractive):
7398 * sysdep.c (closedir):
7399 * xdisp.c (x_produce_glyphs):
7400 * xfaces.c (compare_fonts_by_sort_order):
7401 * xfns.c (x_real_positions, select_visual):
7402 * xselect.c (x_stop_queuing_selection_requests)
7403 (x_get_window_property, x_get_window_property_as_lisp_data):
7404 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
7405 Remove unnecessary pointer casts.
7406 * alloc.c (record_xmalloc): New function.
7407 * lisp.h (record_xmalloc): New decl.
7408 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
7409 more like a function. This is because the pointer cast is not
7410 needed. All uses changed.
7411 * print.c (print_string, print_error_message): Avoid length recalc.
7412
8834c57a
PE
7413 Improve fix for macroexp crash with debugging (Bug#12118).
7414 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
7415 ARRAY_MARK_FLAG when checking subscripts, because ASET is
7416 not supposed to be invoked from the garbage collector.
7417 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
7418 (gc_aset): New function, which is like ASET but can be
7419 used in the garbage collector.
7420 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7421 (set_hash_index): Use it instead of ASET.
7422
6dad7178
EZ
74232012-08-03 Eli Zaretskii <eliz@gnu.org>
7424
7425 Support symlinks on latest versions of MS-Windows.
7426 * w32.c: Include winioctl.h and aclapi.h.
7427 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
7428 (revert_to_self): Forward declarations of static functions.
7429 <static BOOL g_b_init_get_security_info>:
7430 <g_b_init_create_symbolic_link>: New static flags.
7431 (globals_of_w32): Initialize them to zero.
7432 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
7433 (map_w32_filename): Improve commentary. Simplify switch.
7434 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
7435 headers (most versions of MinGW w32api don't).
7436 (get_security_info, create_symbolic_link)
7437 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
7438 New functions.
7439 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
7440 in the argument file name.
7441 (sys_access): Call unc_volume_file_attributes only if
7442 GetFileAttributes fails with network-related error codes.
7443 (sys_rename): Diagnose renaming of a symlink when the user doesn't
7444 have the required privileges.
14ae4239 7445 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
7446 get_file_security_desc.
7447 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
7448 with addition of handling of symlinks and support for 'lstat'.
7449 If possible, get file's attributes and security information by
6dad7178
EZ
7450 handle, not by name. Produce S_IFLNK bit for symlinks, when
7451 called from 'lstat'.
7452 (stat, lstat): New functions, call 'stat_worker'.
7453 (symlink, readlink, careadlinkat): Rewritten to create and resolve
7454 symlinks when the underlying filesystem supports them.
7455
f162bcc3
PE
74562012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7457
79ea6c20
PE
7458 Fix macroexp crash on Windows with debugging (Bug#12118).
7459 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
7460 checking subscripts; problem introduced with the recent
7461 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
7462 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
7463 since it's used in non-static inline functions now.
7464
c0ce93fd
PE
7465 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
7466 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 7467
f162bcc3
PE
7468 Use C99-style 'extern inline' if available.
7469 * buffer.h (BUFFER_INLINE):
7470 * category.h (CATEGORY_INLINE):
7471 * character.h (CHARACTER_INLINE):
7472 * charset.h (CHARSET_INLINE):
7473 * composite.h (COMPOSITE_INLINE):
7474 * dispextern.h (DISPEXTERN_INLINE):
7475 * lisp.h (LISP_INLINE):
7476 * systime.h (SYSTIME_INLINE):
7477 New macro, replacing 'static inline' in this header.
7478 * buffer.h, category.h, character.h, charset.h, composite.h:
7479 * dispextern.h, lisp.h, systime.h:
7480 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7481 * alloc.c (LISP_INLINE):
7482 * buffer.c (BUFFER_INLINE):
7483 * category.c (CATEGORY_INLINE):
7484 * character.c (CHARACTER_INLINE):
7485 * charset.c (CHARSET_INLINE):
7486 * composite.c (COMPOSITE_INLINE):
7487 * dispnew.c (DISPEXTERN_INLINE):
7488 * sysdep.c (SYSTIME_INLINE):
7489 Define to EXTERN_INLINE, so that the corresponding functions
7490 are compiled into code.
7491 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
7492 (INLINE_HEADER_END): New macros.
7493 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
7494 since it's used in non-static inline functions now.
a8333d03 7495 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 7496
837b365b
GM
74972012-08-02 Glenn Morris <rgm@gnu.org>
7498
d66b744d
GM
7499 * s/: Remove empty directory.
7500
837b365b
GM
7501 * s/ms-w32.h: Move to ../nt/inc.
7502 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
7503 Update for new ms-w32.h location.
7504
13294f95
PE
75052012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7506
7507 Port to Solaris 8.
7508 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
7509
90df0db3
GM
75102012-08-02 Glenn Morris <rgm@gnu.org>
7511
7512 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
7513 hard-coding the path separator.
7514
4939150c
PE
75152012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7516
7517 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
7518 This how ASET and AREF are supposed to work, and makes
7519 it easier to think about future improvements. See
7520 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
7521 * charset.h (set_charset_attr): New function.
7522 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
7523 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
7524 (aref_addr): New function. All uses of &AREF(...) changed.
7525 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7526 (set_hash_index): New functions. All lvalue-style uses of
7527 HASH_KEY etc. changed.
7528 * keyboard.c (set_prop): New function. All lvalue-style uses
7529 of PROP changed.
7530
947b2afd
AA
75312012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
7532
7533 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
7534 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 7535 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
7536 * nsfns.m (ns_set_name_as_filename): Likewise.
7537 * nsmenu.m (ns_update_menubar): Likewise.
7538 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
7539
4f5d0325
EZ
75402012-08-01 Eli Zaretskii <eliz@gnu.org>
7541
2008beae
EZ
7542 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
7543 Adapt to latest changes in field names of the corresponding Lisp
288479f6 7544 objects.
2008beae 7545
4f5d0325
EZ
7546 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
7547
fe3cc771
GM
75482012-08-01 Glenn Morris <rgm@gnu.org>
7549
7550 * s/msdos.h: Remove file.
7551 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
7552 * Makefile.in (S_FILE): Remove.
7553 (config_h): Remove S_FILE.
7554
c90acc54
JB
75552012-08-01 Juanma Barranquero <lekktu@gmail.com>
7556
7557 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
7558 Remove; moved to nt/config.nt.
7559
d8a05828
DA
75602012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7561
7562 Use INTERNAL_FIELD for conses and overlays.
7563 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
7564 Remove obsolete comment.
7565 (MVAR): New macro.
7566 (struct Lisp_Overlay): Use INTERNAL_FIELD.
7567 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
7568
8271d590
DA
75692012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7570
7571 Use INTERNAL_FIELD for symbols.
7572 * lisp.h (SVAR): New macro. Adjust users.
7573 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
7574 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
7575
3193acd2
DA
75762012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7577
7578 Use INTERNAL_FIELD for processes.
7579 * process.h (PVAR): New macro. Adjust style.
7580 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
7581 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
7582
3a45383a
DA
75832012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7584
7585 Use INTERNAL_FIELD for windows.
7586 * window.h (WVAR): New macro.
7587 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
7588 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7589 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7590 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
7591 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
7592 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7593
c1dbc63c
PE
75942012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7595
7596 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
7597
5c0c0e8a
GM
75982012-08-01 Glenn Morris <rgm@gnu.org>
7599
7600 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
7601 Move to configure.ac.
7602
552a99b4
JB
76032012-08-01 Juanma Barranquero <lekktu@gmail.com>
7604
7605 * makefile.w32-in (CONFIG_H): Update dependencies.
7606 (CONF_POST_H): New macro.
7607
7608 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
7609
8d8e2dfe
GM
76102012-07-31 Glenn Morris <rgm@gnu.org>
7611
bc96620a
GM
7612 * Makefile.in (S_FILE): No longer set by configure.
7613
476b1b2d
GM
7614 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
7615 is available.
7616 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
7617
b2c7a106
GM
7618 * process.h (NULL_DEVICE):
7619 * emacs.c (SEPCHAR):
7620 * editfns.c (USER_FULL_NAME): Let configure set them.
7621
d53d062a
GM
7622 * s/README, s/template.h: Remove files.
7623
4515017f
GM
7624 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
7625
8d8e2dfe
GM
7626 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
7627 Move to configure.ac.
7628
5b20b3cc
EZ
76292012-07-31 Eli Zaretskii <eliz@gnu.org>
7630
1e0afd9a
EZ
7631 * .gdbinit (xframe): Adapt to introduction of FVAR and the
7632 resulting renaming of 'struct frame' members.
7633
5b20b3cc
EZ
7634 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
7635
7636 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
7637 after introduction of FVAR.
7638
f1310128
JD
76392012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7640
79e721e0
JD
7641 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
7642
7643 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
7644 instead of compositeToPoint.
7645 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
7646
8d7c7eed 7647 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 7648
e34f7f79
DA
76492012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7650
7651 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
7652 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 7653 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
7654 (BVAR): Change to use INTERNAL_FIELD.
7655 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
7656 (KVAR): Change to use INTERNAL_FIELD.
7657 * frame.h (FVAR): New macro.
7658 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
7659 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
7660 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
7661 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
7662 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7663
c09bfb2f
DA
76642012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7665
7666 Miscellaneous fixes for non-default X toolkits.
7667 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
7668 * xterm.c (x_frame_of_widget): Remove redundant prototype.
7669 Move under #ifdef USE_LUCID.
7670 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
7671 definition and usage to avoid warnings.
7672
14c114ae
JD
76732012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7674
7675 * nsterm.m (openFiles): Fix previous checkin.
7676
3bd21e82
PE
76772012-07-31 Paul Eggert <eggert@cs.ucla.edu>
7678
7679 * indent.c (compute_motion): Remove unused local.
7680
c1529ded
GM
76812012-07-31 Glenn Morris <rgm@gnu.org>
7682
400d5621
GM
7683 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
7684
268e2432
GM
7685 * conf_post.h [USG5_4]:
7686 Move remaining contents of s/usg5-4-common.h here.
7687 * s/usg5-4-common.h: Remove file.
7688
7552f3ee
GM
7689 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
7690 * s/irix6-5.h: Remove file.
7691
6a381852
GM
7692 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
7693 * s/darwin.h: Remove file.
7694
c1529ded
GM
7695 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
7696 * s/hpux10-20.h: Remove file, which is now empty.
7697
b429a4ee
GM
76982012-07-30 Glenn Morris <rgm@gnu.org>
7699
7700 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
7701 * Makefile.in (config_h): Add conf_post.h.
7702 * makefile.w32-in (CONFIG_H): Add conf_post.h.
7703
adff3182
JD
77042012-07-30 Jan Djärv <jan.h.d@swipnet.se>
7705
7706 * nsterm.m (ns_do_open_file): New variable.
b9031d69 7707 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
7708 (openFile, openTempFile, openFileWithoutUI, openFiles):
7709 Open files only if ns_do_open_file.
adff3182 7710
c32af1e4
PE
77112012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7712
7393bcbb
PE
7713 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
7714 This no-op macro hasn't been needed for many years.
7715 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
7716
c32af1e4
PE
7717 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
7718 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
7719 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
7720 gdb_make_enums_visible.
7721 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
7722 (DIRECTORY_SEP): Now a constant, not a macro.
7723
302fc036
EZ
77242012-07-30 Eli Zaretskii <eliz@gnu.org>
7725
7726 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
7727 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
7728
7729 * w32term.c <w32_keyboard_codepage>: Renamed from
7730 keyboard_codepage and now external. All users changed.
7731
7732 * w32term.h: Add declaration of w32_keyboard_codepage.
7733
7734 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
7735 the codepage to translate keys to Unicode. If this argument is
7736 -1, use the value returned by GetConsoleCP. All callers changed.
7737
88fb40b4
PE
77382012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7739
0aee6912
PE
7740 Update .PHONY listings in makefiles.
7741 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
7742 bootstrap-clean, distclean, maintainer-clean, versioclean,
7743 extraclean, frc.
7744
88fb40b4
PE
7745 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
7746 This is a bit clearer. Fix some commentary typos.
7747
0a763bd1
GM
77482012-07-30 Glenn Morris <rgm@gnu.org>
7749
32bac6d6
GM
7750 * s/netbsd.h: Let configure include signal.h if needed.
7751 Remove file, which is now empty.
7752
b65e7c46
GM
7753 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
7754 Let configure set them.
7755 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
7756 No more need to undefine.
0a763bd1 7757
169304bd
AS
77582012-07-30 Andreas Schwab <schwab@linux-m68k.org>
7759
7760 * keymap.c (Fkey_description): Don't remove 0x80 bit from
7761 non-single-byte char when adding meta modifier. (Bug#12090)
7762
6cd7a139
DA
77632012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7764
7765 Convert safe_call to use variable number of arguments.
7766 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
7767 (safe_call2): Fix comment.
7768 * lisp.h (safe_call): Adjust prototype.
7769 * coding.c (encode_coding_object): Change to use safe_call2.
7770 * xfaces.c (merge_face_heights): Change to use safe_call1.
7771
d34d6ffc
GM
77722012-07-30 Glenn Morris <rgm@gnu.org>
7773
7b8a48e4 7774 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 7775 does that unconditionally. Remove file, which is now empty.
7b8a48e4 7776
d34d6ffc
GM
7777 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
7778 Remove empty files.
7779
03a660a6
PE
77802012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7781
7782 Export to GDB most of lisp.h's remaining object-like macros.
7783 * lisp.h (min, max): Move earlier, because they're used earlier now.
7784 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
7785 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
7786 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
7787 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
7788 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
7789 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
7790 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
7791 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
7792 Now constants, for GDB. They need not be macros.
7793 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
7794 Now constants, for GDB, as well as macros, for static initializers.
7795 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
7796 Move to after the definition of struct Lisp_Char_Table,
7797 since the former now needs that type defined.
7798 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
7799 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
7800 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
7801 New enums, for gdb_make_enums_visible.
7802 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 7803 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
7804 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
7805 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
7806 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
7807 enum maxargs, enum MAX_ALLOCA.
7808 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
7809 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
7810 no longer needed, now that they are done in lisp.h.
7811
e499d0ee
DA
78122012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7813
7814 Cleanup string bytes checking.
7815 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
7816 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
7817 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
7818 (check_sblock, compact_small_strings): Simplify.
7819
d5040d2d
PE
78202012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7821
7822 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
7823 These macros are confusing and no longer need to be defined, as
7824 the enum values now suffice. All uses replaced with definiens.
7825 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
7826
7f259ae6
JB
78272012-07-29 Juanma Barranquero <lekktu@gmail.com>
7828
7829 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
7830 ($(BLD)/w32console.$(O)): Update dependencies.
7831
7e63e0c3
DA
78322012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7833
7834 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
7835 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
7836 time. Adjust users.
7837 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
7838
ffd817eb
JD
78392012-07-29 Jan Djärv <jan.h.d@swipnet.se>
7840
7841 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
7842 setting sitelisp (Bug#12010).
7843
417a7a0e
EZ
78442012-07-29 Eli Zaretskii <eliz@gnu.org>
7845
14ae4239 7846 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
7847
7848 * w32heap.c (cache_system_info):
7849 * w32.c (sys_rename):
7850 * w32proc.c (find_child_console, sys_kill): All users changed.
7851
387d4d92
PE
78522012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7853
7854 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
7855
55a6cca6
EZ
78562012-07-29 Eli Zaretskii <eliz@gnu.org>
7857
7858 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
7859
dbcf001c
DA
78602012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7861
7862 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
7863 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
7864 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 7865
e2688e4a
DA
78662012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7867
7868 Generalize marker debugging code under MARKER_DEBUG and use eassert.
7869 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
7870 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
7871 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
7872 (replace_range, replace_range_2, del_range_2): Change to eassert.
7873 * marker.c (byte_char_debug_check): Adjust style.
7874
b46a6a83
PE
78752012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7876
7877 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
7878 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
7879 long-ago-commented-out code that talks about "WIN32".
7880 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
7881 All uses changed.
7882
e32a5799
PE
78832012-07-28 Paul Eggert <eggert@cs.ucla.edu>
7884
7885 Use Gnulib stdalign module (Bug#9772, Bug#9960).
7886 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
7887 Simplify by using alignof.
7888 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
7889 * lisp.h: Include <stdalign.h>.
7890 (GCALIGNMENT): New macro and constant.
7891 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
7892 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
7893 (stdalign): New macro, if not already defined.
7894
df81cd29
EZ
78952012-07-28 Eli Zaretskii <eliz@gnu.org>
7896
01bd1b0d
EZ
7897 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
7898 * w32inevt.c: Include w32inevt.h.
7899 (w32_read_console_input): New inline function, calls either
7900 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
7901 w32_console_unicode_input.
7902 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
7903 (w32_kbd_patch_key, key_event): Use the codepage returned by
7904 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
7905 (key_event): use uChar.UnicodeChar only if
7906 w32_console_unicode_input is non-zero.
7907
7908 * w32console.c: Include w32heap.h.
7909 <w32_console_unicode_input>: New global variable.
7910 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
7911 family of Windows, zero otherwise.
7912
7913 * w32inevt.h: Declare w32_console_unicode_input.
7914
df81cd29
EZ
7915 * xdisp.c (init_iterator): Don't reference tip_frame in a build
7916 --without-x. (Bug#11742)
7917
c20fdd9e
PE
79182012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7919
7920 Adjust GDB to reflect pvec_type changes (Bug#12036).
7921 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
7922 2012-07-04 changes to pseudovector representation.
7923 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 7924
32770973 79252012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
7926
7927 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
7928 bus address.
7929 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
7930
3438fe21
EZ
79312012-07-27 Eli Zaretskii <eliz@gnu.org>
7932
bcfbc9de
EZ
7933 * alloc.c (listn): Fix the order the arguments are consed onto the
7934 list.
7935
3438fe21
EZ
7936 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
7937 enumeration constants, as PURE and HEAP are too general, and clash
7938 with other headers and sources, such as gmalloc.c and the
7939 MS-Windows system headers. All users changed.
7940
eeaea515
DA
79412012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7942
7943 Revert last save_excursion_save and save_excursion_restore changes.
7944 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
7945 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
7946
073c88c2
DA
79472012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7948
7949 Fix recently-introduced typos in Windows port.
7950 Reported by Martin Rudalics <rudalics@gmx.at>.
7951 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 7952 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 7953
4706125e
PE
79542012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7955
7956 Improve GDB symbol export (Bug#12036).
7957 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
7958 arms of an 'if', not using conditional expressions; otherwise GDB
7959 complains about the types in the unevaluated arm when the argument
7960 is an integer literal.
7961 (xgetint): Simplify expression.
7962 * alloc.c (gdb_make_enums_visible): New constant. This ports to
7963 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
7964 Zaretskii in <http://bugs.gnu.org/12036#13>.
7965 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
7966 needed now that we have gdb_make_enums_visible.
7967 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
7968 (enum enum_USE_LSB_TAG):
7969 New enum types, packaging up enums that need to be exported to GDB.
7970
694b6c97
DA
79712012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7972
7973 Utility function to make a list from specified amount of objects.
7974 * lisp.h (enum constype): New datatype.
7975 (listn): New prototype.
7976 * alloc.c (listn): New function.
7977 (Fmemory_use_count, syms_of_alloc): Use it.
7978 * buffer.c (syms_of_buffer): Likewise.
7979 * callint.c (syms_of_callint): Likewise.
7980 * charset.c (define_charset_internal): Likewise.
7981 * coding.c (syms_of_coding): Likewise.
7982 * keymap.c (syms_of_keymap): Likewise.
7983 * search.c (syms_of_search): Likewise.
7984 * syntax.c (syms_of_syntax): Likewise.
7985 * w32.c (init_environment): Likewise.
7986 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
7987 * xdisp.c (syms_of_xdisp): Likewise.
7988 * xfns.c (syms_of_xfns): Likewise.
7989
6195f384
DA
79902012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7991
7992 Fast save_excursion_save and save_excursion_restore.
7993 * lisp.h (struct Lisp_Excursion): New data type.
7994 (PVEC_EXCURSION): New pseudovector type.
7995 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
7996 to deal with it. Adjust comments.
7997 (init_marker, attach_marker): New prototype.
7998 (unchain_marker): Adjust prototype.
7999 * marker.c (attach_marker): Change to global.
8000 (init_marker): New function.
8001 * alloc.c (Fmake_marker, build_marker): Use it.
8002 (build_marker): More easserts.
8003 (mark_object): Handle struct Lisp_Excursion.
8004 * editfns.c (save_excursion_save, save_excursion_restore):
8005 Reimplement to use struct Lisp_Excursion. Add comments.
8006
5eceb8fb
PE
80072012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8008
8009 Fix export of symbols to GDB (Bug#12036).
8010 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8011 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8012 emacs.c, as this is a more-suitable home. Had this been done earlier
8013 the fix for 12036 would have avoided some of the problems noted in
8014 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8015 would have been more obvious.
562157c8
PE
8016 * emacs.c: Do not include <verify.h>; no longer needed.
8017 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
8018 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8019 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8020 Remove; now done in lisp.h.
8021 * lisp.h (PUBLISH_TO_GDB): New macro.
8022 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8023 (DATA_SEG_BITS): Use it.
8024 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8025 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8026 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8027 not be usable in #if. This simplifies things.
8028
d6749401
JB
80292012-07-26 Juanma Barranquero <lekktu@gmail.com>
8030
8031 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8032
1781b9e9
PE
80332012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8034
d89518db 8035 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
8036 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8037 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8038 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8039 Adjust to changes in lisp.h and emacs.c, by using
8040 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8041 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8042 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8043 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8044 instead of gdb_valbits.
8045 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8046 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8047 instead of gdb_array_mark_flag.
8048 (xboolvector): Get size from $->size, not $->header.size.
8049 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8050 (xreload, hook-run, hookpost-run): Remove.
8051 * emacs.c: Include <verify.h>.
8052 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8053 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8054 Remove.
8055 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8056 (gdb_USE_LSB_TAG): New enum constants.
8057 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8058 Also define these as enum constants, so they're visible to GDB.
8059 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8060 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8061 as constants, so they're visible to GDB.
8062 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8063 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8064 Now enum constants, not macros, so they're visible to GDB.
8065 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8066 more convenient now. All uses changed.
8067 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8068 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8069
3628596a
DA
80702012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8071
8072 Explicitly free restriction data that are not needed anymore.
8073 * editfns.c (save_restriction_restore): Free restriction data.
8074
7abaf5cc
SM
80752012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8076
8077 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8078 add argument, tune behavior, and adjust all callers.
8079
71f88e00
PE
80802012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8081
8082 Use typedef for EMACS_INT, EMACS_UINT.
8083 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8084 than macros. This simplifies debugging in the usual case, since
8085 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8086 and it allows expressions involving EMACS_INT casts.
8087 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8088
57ec3034
JD
80892012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8090
8091 * nsterm.m (ns_read_socket): Return early if there is a modal
8092 window (Bug#12043).
8093
8137e7b3
MR
80942012-07-25 Martin Rudalics <rudalics@gmx.at>
8095
8096 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8097 that FOCUS-FRAME can be omitted.
8098
04e9897c
DA
80992012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8100
8101 Adjust buffer text indirection counters at the end of Fkill_buffer.
8102 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8103 buffer is definitely dead. This should really fix an issue reported
8104 by Christoph Scholtes again. (Bug#12007).
8105 (init_buffer_once): Initialize indirection counters of
8106 buffer_defaults and buffer_local_symbols (for sanity and safety).
8107
8a0484e1
EZ
81082012-07-24 Eli Zaretskii <eliz@gnu.org>
8109
8110 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8111 and continuation glyphs on tooltip frames, leave them at zero.
8112 Avoids continued lines in tooltips. (Bug#11832)
8113
fa691a83
DA
81142012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8115
8116 Simplify copy_overlay.
04e9897c 8117 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
8118 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8119
436bc8e0
EZ
81202012-07-23 Eli Zaretskii <eliz@gnu.org>
8121
8122 * print.c (print_object): Don't crash when a frame's name is nil
8123 or invalid. (Bug#12025)
8124
8125 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8126 it signals an error when a tooltip frame is being created.
8127
d7a7fda3
DA
81282012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8129
8130 Cleanup miscellaneous objects allocation and initialization.
8131 * alloc.c (allocate_misc): Change to static. Add argument to
8132 specify the subtype. Adjust comment and users.
8133 (build_overlay): New function.
8134 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8135 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8136 (allocate_misc): Remove prototype.
8137 (build_overlay): Add prototype.
8138
81392012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
8140
8141 Swap buffer text indirection counters in Fbuffer_swap_text.
8142 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8143 This avoids crash reported by Christoph Scholtes at
8144 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8145
9d7fa573
JD
81462012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8147
8148 * nsmenu.m (Popdown_data): New struct.
8149 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8150 free Popdown_data.
8151 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8152 (initWithContentRect): Make imgView and contentView non-static
8153 and autorelease them. Also autorelease img and matrix (Bug#12005).
8154 (dealloc): Remove (Bug#12005).
8155
0dd6d66d
DA
81562012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8157
8158 Adjust consing_since_gc when objects are explicitly freed.
8159 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8160 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8161 (free_cons, free_misc): Subtract object size from consing_since_gc.
8162
d36d71df
DA
81632012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8164
8165 Simplify and cleanup markers positioning code.
8166 * marker.c (attach_marker): More useful eassert.
8167 (live_buffer, set_marker_internal): New function.
8168 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8169 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8170
fb9ea40f
PE
81712012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8172
8173 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8174 as it's limited by the amount of memory, not by INT_MAX.
8175
2d5c5f7d
EZ
81762012-07-21 Eli Zaretskii <eliz@gnu.org>
8177
07fb592e
EZ
8178 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8179 in special-event-map. See the discussion at
8180 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8181 for the reasons.
8182
37a9eac8 8183 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
8184 info.dwItemData. Fixes crashes on 64-bit Windows.
8185 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 8186
c4328746
JD
81872012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8188
fc0c31f8 8189 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 8190 (conversationIdentifier): Return value is NSInteger.
784051c4 8191 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 8192
6e5d1c12
CY
81932012-07-21 Chong Yidong <cyd@gnu.org>
8194
8195 * window.c (decode_any_window): Signal an error if the window is
8196 on a dead frame (Bug#11984).
8197
9928463d
DA
81982012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8199
8200 Add indirection counting to speed up Fkill_buffer.
8201 * buffer.h (struct buffer): New member.
8202 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8203 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8204 base buffer indirection counter.
8205 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8206 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8207 through buffer list if indirection counter is 0.
8208
f8643a6b
DA
82092012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8210
8211 Extend the value returned by Fgarbage_collect with heap statistics.
8212 * alloc.c (Qheap): New symbol.
8213 (syms_of_alloc): DEFSYM it.
8214 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8215 (Fmemory_free): Remove.
8216 (syms_of_alloc): Don't defsubr it.
8217 * buffer.c (Fcompact_buffer): Remove.
8218 (syms_of_buffer): Don't defsubr it.
8219
dac616ff
DA
82202012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8221
8222 Make maybe_gc inline.
8223 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8224 * lisp.h (consing_since_gc, gc_relative_threshold)
8225 (memory_full_cons_threshold): Revert declaration.
8226 (maybe_gc): Remove prototype, define as inline.
8227 * alloc.c: Remove old commented-out code.
8228 (consing_since_gc, gc_relative_threshold)
8229 (memory_full_cons_threshold): Revert to global.
8230 (maybe_gc): Remove.
8231
d7ea76b4
DA
82322012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8233
8234 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8235 * lisp.h (build_unibyte_string): New function.
8236 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8237 * sysdep.c, w32fns.c, xfns.c: Use it.
8238 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8239 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8240 Adjust users accordingly.
8241 * font.h (font_open_by_name): Adjust prototype.
8242
765e61e3
DA
82432012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8244
8245 Cleanup calls to Fgarbage_collect.
8246 * lisp.h (maybe_gc): New prototype.
8247 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8248 Remove declarations.
8249 * alloc.c (maybe_gc): New function.
8250 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8251 Make them static.
8252 * bytecode.c (MAYBE_GC): Use maybe_gc.
8253 * eval.c (eval_sub, Ffuncall): Likewise.
8254 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8255 to avoid dependency from auto-save feature.
8256
52b852c7
PE
82572012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8258
8259 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8260 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8261 'for_each_per_buffer_object_at'.
8262 All uses changed. It's better to use upper-case for macros that
8263 cannot be implemented as functions, to give the reader a clue
8264 that they're special.
8265
5db81e33
SM
82662012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8267
8268 * alloc.c (Fgarbage_collect): Tweak docstring.
8269
5b835e1d
DA
82702012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8271
8272 Tweak the value returned from Fgarbage_collect again.
8273 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8274 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8275 Adjust documentation.
8276 (total_vector_bytes): Rename to total_vector_slots, adjust
8277 accounting.
8278 (total_free_vector_bytes): Rename to total_free_vector_slots,
8279 adjust accounting.
8280 (Qstring_bytes, Qvector_slots): New symbols.
8281 (syms_of_alloc): DEFSYM them.
8282
9cd47b72
DA
82832012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8284
8285 Buffer compaction primitive which may be used from Lisp.
8286 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8287 (syms_of_buffer): Register Fcompact_buffer.
8288 * alloc.c (Fgarbage_collect): Use compact_buffer.
8289 * buffer.h (compact_buffer): New prototype.
8290 (struct buffer_text): New member.
8291
d17337e5
DA
82922012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8293
8294 New macro to iterate over all buffers, miscellaneous cleanups.
8295 * lisp.h (all_buffers): Remove declaration.
8296 * buffer.h (all_buffers): Add declaration, with comment.
8297 (for_each_buffer): New macro.
8298 * alloc.c (Fgarbage_collect, mark_object): Use it.
8299 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
8300 (init_buffer): Likewise.
8301 * data.c (Fset_default): Likewise.
8302 * coding.c (code_conversion_restore): Remove redundant check
8303 for dead buffer.
8304 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
8305
60cfd278
AS
83062012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8307
8308 Fix bug that created negative-length intervals.
8309 * intervals.c (merge_interval_right, merge_interval_left):
8310 Do not zero out this interval if it is absorbed by its children,
8311 as this interval's total length doesn't change in that case. See
8312 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
8313
d06714cb
PE
83142012-07-18 Paul Eggert <eggert@cs.ucla.edu>
8315
83713154
PE
8316 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
8317 when invoking (make-bool-vector N t) and N is a positive
8318 multiple of 8 -- the last 8 bits were mistakenly cleared.
8319
d06714cb
PE
8320 Remove some struct layout assumptions in bool vectors.
8321 * alloc.c (bool_header_size): New constant.
8322 (header_size, word_size): Move earlier, as they're now used earlier.
8323 Use 'word_size' in a few more places, where it's appropriate.
8324 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
8325 padding before the data member of a bool vector.
8326 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
8327 than doing the check by hand with an abort ().
8328
464d5a5e
SM
83292012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8330
5fbc0409
SM
8331 * eval.c (Fdefvar): Don't check constants since we only set the var if
8332 it's not yet defined anyway (bug#11904).
8333
464d5a5e
SM
8334 * lisp.h (last_undo_boundary): Declare new var.
8335 * keyboard.c (command_loop_1): Set it.
8336 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
8337 were auto-added by the command loop (bug#11774).
8338
8dc2e44a
AS
83392012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8340
8341 * w32font.c (Qsymbol): Remove local definition.
8342 (syms_of_w32font): Don't DEFSYM it.
8343
169925ec
DA
83442012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8345
8346 Fix sweep_vectors to handle large bool vectors correctly.
8347 * alloc.c (sweep_vectors): Account total_vector_bytes for
8348 bool vectors larger than VBLOCK_BYTES_MAX.
8349
5fbfb018
CY
83502012-07-18 Chong Yidong <cyd@gnu.org>
8351
8352 * frame.c (x_set_frame_parameters): Revert bogus change introduced
8353 in 2012-05-25 commit by Paul Eggert (Bug#11738).
8354
3ab6e069
DA
83552012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8356
8357 Return more descriptive data from Fgarbage_collect.
8358 Suggested by Stefan Monnier in
8359 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
8360 * alloc.c (bounded_number): New function.
8361 (total_buffers, total_vectors): New variable.
8362 (total_string_size): Rename to total_string_bytes, adjust users.
8363 (total_vector_size): Rename to total_vector_bytes, adjust users.
8364 (sweep_vectors): Account total_vectors and total_vector_bytes.
8365 (Fgarbage_collect): New return value. Adjust documentation.
8366 (gc_sweep): Account total_buffers.
8367 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
8368 (VECTOR_SIZE): Remove.
8369 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
8370 (Qinterval, Qmisc): New symbols.
8371 (syms_of_data): Initialize them.
8372 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
8373 (Qcons, Qbuffer): New declarations.
8374
6d02fe5b
PE
83752012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8376
8377 * alloc.c (Fmemory_free): Account for memory-free's own storage.
8378 Round up, not down. Improve doc.
8379
b7ffe040
DA
83802012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8381
8382 Restore old code in allocate_string_data to avoid Faset breakage.
8383 Reported by Julien Danjou <julien@danjou.info> in
8384 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
8385 * alloc.c (allocate_string_data): Restore old code with minor
8386 adjustments, fix comment to explain this subtle issue.
8387
4dc7c8d5
SM
83882012-07-17 Eli Zaretskii <eliz@gnu.org>
8389
8390 Remove FILE_SYSTEM_CASE.
8391 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
8392
8393 * fileio.c (FILE_SYSTEM_CASE): Don't define.
8394 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
8395 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
8396 call-process-region passes it through expand-file-name.
8397
8398 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
8399
84002012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8401
8402 Fix crash when creating indirect buffer (Bug#11917)
8403 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
8404 Don't handle unbound variables specially if non-zero.
8405 (Fbuffer_local_variables): Pass zero.
8406 (clone_per_buffer_values): Pass non-zero.
8407
84082012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8409
8410 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
8411 to make the loop interruptible.
8412
84132012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8414
8415 * gnutls.c (emacs_gnutls_handshake): Only retry if
8416 GNUTLS_E_INTERRUPTED.
8417
cce7fefc
DA
84182012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8419
8420 Cleanup and convert miscellaneous checks to eassert.
8421 * alloc.c (mark_interval): Fix comment, partially rephrase
8422 old comment from intervals.h (see below).
8423 * intervals.c (find_interval, adjust_intervals_for_insertion)
8424 (delete_interval, adjust_intervals_for_deletion)
8425 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
8426 Convert to eassert.
8427 (adjust_intervals_for_insertion, make_new_interval):
8428 Remove obsolete and unused code.
8429 * intervals.h (struct interval): Remove obsolete comment.
8430 * textprotp.c (erase_properties): Remove unused code.
8431 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
8432 (Fremove_list_of_text_properties): Convert to eassert.
8433
9ea10cc3
CY
84342012-07-17 Chong Yidong <cyd@gnu.org>
8435
8436 * editfns.c (Finsert_char): Doc fix.
8437
3900d5de
DA
84382012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8439
8440 Fix previous change to make Fmemory_free always accurate.
8441 * alloc.c (make_interval): Update total_free_intervals.
8442 (make_float): Likewise for total_free_floats.
8443 (free_cons, Fcons): Likewise for total_free_conses.
8444 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
8445 Likewise for total_free_vector_bytes.
8446 (Fmake_symbol): Likewise for total_free_symbols.
8447 (bytes_free): Remove.
8448
7098646f
DA
84492012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8450
8451 Simple free memory accounting feature.
8452 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
8453 (sweep_vectors): Accumulate size of free vectors.
8454 (Fgarbage_collect): Setup bytes_free.
8455 (Fmemory_free): New function.
8456 (syms_of_alloc): Register it.
8457
22657b40
DA
84582012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8459
8460 Cleanup overlays checking.
8461 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
8462 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
8463 eassert and OVERLAYP.
8464 (sort_overlays): Change to use OVERLAYP.
8465
ddfc8813
RK
84662012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
8467
8468 * editfns.c (Finsert_char): Make it interactive, and make the
8469 second arg optional. Copy interactive spec and docstring from
8470 ucs-insert.
8471
7c26cf3c
PE
84722012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8473
8474 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
8475 Unlike the other wrapped functions, fabs has an unspecified
8476 effect on errno.
8477
5d127af9
JD
84782012-07-16 Jan Djärv <jan.h.d@swipnet.se>
8479
8480 * nsterm.m (keyDown): Interpret flags without left/right bits
8481 as the left key (Bug#11670).
8482
6a0dd1d7
DA
84832012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8484
8485 Remove empty and useless init functions.
8486 * lisp.h (init_character_once, init_fns, init_image)
8487 (init_filelock, init_sound): Remove prototype.
8488 * character.c (init_character_once): Remove.
8489 * filelock.c (init_filelock): Likewise.
8490 * fns.c (init_fns): Likewise.
8491 * image.c (init_image): Likewise.
8492 * sound.c (init_sound): Likewise.
8493 * emacs.c (main): Adjust accordingly.
8494
7a6136fd
DA
84952012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8496
8497 * gtkutil.h: Tiny cleanups.
8498 (use_old_gtk_file_dialog): Remove useless declaration.
8499 (xg_uses_old_file_dialog): Add suggested const attribute.
8500
ce811ad9
EZ
85012012-07-15 Eli Zaretskii <eliz@gnu.org>
8502
8503 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
8504 (bidi_paragraph_init): Use it to limit search forward for a strong
8505 directional character in abnormally large paragraphs full of
8506 neutral or weak characters. (Bug#11943)
8507
c9adfeaa
SF
85082012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
8509
8510 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
8511 the toolbar (Bug#9451).
8512 (xg_make_tool_item): Give the widget event box a transparent
8513 background.
8514
fff62aa9
DA
85152012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8516
8517 Cleanup basic allocation variables and functions.
8518 * alloc.c (ignore_warnings, init_intervals, init_float)
8519 (init_cons, init_symbol, init_marker): Remove.
8520 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
8521 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
8522 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
8523 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
8524 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
8525 (staticidx, init_alloc_once, init_strings, free_ablock):
8526 Remove redundant initialization.
8527 * fns.c (init_weak_hash_tables): Remove.
8528 * lisp.h (init_weak_hash_tables): Remove prototype.
8529
9730daca
DA
85302012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8531
8532 Use zero_vector where appropriate.
8533 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
8534 accordingly.
8535 * lisp.h (zero_vector): New declaration.
8536 * font.c (null_vector): Remove.
8537 (syms_of_font): Remove initialization and staticpro.
8538 (font_list_entities, font_find_for_lface): Change to use zero_vector.
8539 * keymap.c (Faccessible_keymaps): Likewise.
8540
2e2d2a13
LL
85412012-07-15 Leo Liu <sdl.web@gmail.com>
8542
8543 * fringe.c: Fix typo in comments.
8544
cd276f6e
LL
85452012-07-14 Leo Liu <sdl.web@gmail.com>
8546
8547 * fringe.c: Add a new bitmap exclamation-mark.
8548
5a1131d9
EZ
85492012-07-14 Eli Zaretskii <eliz@gnu.org>
8550
8551 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
8552
8553 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
8554 (HAVE_MENUS): Don't define, defined by editing config.in with
8555 msdos/sed2v2.inp.
8556 (GMALLOC_INHIBIT_VALLOC): Don't define.
8557 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
8558
22e983b7
JB
85592012-07-14 Juanma Barranquero <lekktu@gmail.com>
8560
8561 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
8562
5b3f250f
GM
85632012-07-14 Glenn Morris <rgm@gnu.org>
8564
8565 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
8566 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
8567 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
8568
33d63ff4
GM
85692012-07-13 Glenn Morris <rgm@gnu.org>
8570
5b633342
GM
8571 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
8572
33d63ff4
GM
8573 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
8574 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
8575
b55b9f85
JD
85762012-07-13 Jan Djärv <jan.h.d@swipnet.se>
8577
0dc8cf50
JD
8578 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
8579 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
8580 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
8581 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
8582 where appropriate.
8583 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
8584 as boolean expression.
8585 (x_set_window_size): Remove unused variable toolbar.
8586 (ns_get_color_default, ns_mod_to_lisp): Remove.
8587 (ns_mouse_position): Remove unused variables xchar and ychar.
8588 (ns_compute_glyph_string_overhangs): Remove unused variable face.
8589 (ns_set_vertical_scroll_bar): Remove unused variable count.
8590 (ns_delete_terminal): Remove unused variable i.
8591 (ns_term_init): Remove unused variables r, g and b.
8592 (mouseDown): Remove unused variable window.
8593 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
8594 (initFrameFromEmacs): Remove unused variable vbextra.
8595 (mouseEntered): Remove unused variables p and dpyinfo.
8596 (mouseExited): Remove unused variables p and r.
8597 (ns_define_frame_cursor, ns_clear_frame_area)
8598 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
8599 (menuDown): Assign [sender tag] to variable and cast the variable.
8600
8601 * nsterm.h (menuDown): Add id as type to argument sender.
8602 (ns_display_info_for_name): Add Lisp_Object argument.
8603 (ns_term_init): Add Lisp_Object argument.
8604 (ns_map_event_to_object): Add void argument.
8605 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
8606 prototype with arguments and only declare if __OBJC__.
8607 (nxatoms_of_nsselect): Add void argument.
8608 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
8609 (ns_alloc_autorelease_pool): Add void argument.
8610 (ns_release_autorelease_pool): Add void* argument.
8611 (ns_get_defaults_value): Add const char* argument.
8612
8613 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
8614 (initFromContents): Use SSDATA where appropriate.
8615 (ns_update_menubar): Add braces to ambigous if-else.
8616 (initWithTitle): Put () around assignment in if statement.
8617 (ns_menu_show): Remove unused variables window and keymap.
8618 (update_frame_tool_bar): Remove unused variable selected_p.
8619 (initWithContentRect): Remove unused variable this_cmd_name.
8620
8621 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
8622 appropriate.
8623 (setXBMColor): Remove unused variable len.
8624 (setPixmapData): Put () around assignment in loop statement.
8625
8626 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
8627 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
8628 where appropriate.
8629 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
8630 around assignment in loop statement.
8631 (nsfont_open): Remove unused variable i.
8632 (nsfont_open): Remove unused variable len.
8633 (nsfont_draw): Remove unused variable cs.
8634
8635 * nsfns.m (x_set_icon_name, ns_set_name_internal)
8636 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
8637 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
8638 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
8639 (Fns_font_name, Fns_perform_service)
8640 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
8641 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
8642 (ns_set_name): Remove unused variable view.
8643 (x_set_menu_bar_lines): Remove unused variable olines.
8644 (x_set_tool_bar_lines): Remove unused variable root_window.
8645 (Fns_list_colors): Put () around assignment in while statement.
8646 (Fns_perform_service): Remove unused variable len.
8647 (Fns_display_usable_bounds): Remove unused variable top.
8648 (syms_of_nsfns): Remove unused variable i.
8649
b55b9f85
JD
8650 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
8651 memcpy (Bug#11907).
8652
ed9265fc 86532012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
8654
8655 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
8656 and free it with DestroyExceptionInfo (Bug#11558).
8657
ef099b57
JB
86582012-07-13 Juanma Barranquero <lekktu@gmail.com>
8659
8660 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
8661 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
8662 Set here, not in nt/config.nt.
8663
ea814a5d
EZ
86642012-07-13 Eli Zaretskii <eliz@gnu.org>
8665
8666 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
8667 cursor overflow into the last glyph on display line when the right
8668 fringe is off. (Bug#11832)
8669
1a952767
PE
86702012-07-13 Paul Eggert <eggert@cs.ucla.edu>
8671
8672 * xdisp.c (produce_special_glyphs): Now static.
8673 * dispextern.h (produce_special_glyphs): Remove decl.
8674
983188fd
GM
86752012-07-13 Glenn Morris <rgm@gnu.org>
8676
8d7c7eed 8677 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
8678 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
8679
983188fd
GM
8680 * s/usg5-4-common.h (USG, USG5):
8681 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
8682 * s/sol2-6.h (SOLARIS2):
8683 * s/irix6-5.h (IRIX6_5):
8684 * s/hpux10-20.h (USG, USG5, HPUX):
8685 * s/gnu-linux.h (USG, GNU_LINUX):
8686 * s/freebsd.h (BSD_SYSTEM):
8687 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
8688 * s/cygwin.h (CYGWIN):
8689 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
8690 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
8691
d1e68667 86922012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
8693
8694 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 8695
6de0e799
GM
86962012-07-13 Glenn Morris <rgm@gnu.org>
8697
739ae010
GM
8698 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
8699
dbee5793
GM
8700 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
8701
6de0e799
GM
8702 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
8703 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
8704
b82da769
GM
87052012-07-12 Glenn Morris <rgm@gnu.org>
8706
4fae5a7a 8707 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
8708
8709 * process.c (init_process_emacs): Rename from init_process.
8710 The old name is also the name of a Mach system call.
8711 * lisp.h, emacs.c: Update for this name change.
8712 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
8713 longer needed.
8714
5a979817
EZ
87152012-07-12 Eli Zaretskii <eliz@gnu.org>
8716
8717 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
8718 memmove call that removes glyphs covered by the left truncation
8719 glyph. Improve commentary.
8720 (display_line): Fix display of continuation glyphs on GUI frames
8721 when the right fringe is turned off and variable-size fonts are
8722 used in the window. Move the code that appends a stretch glyph to
8723 produce_special_glyphs, so that it could be used for truncation
8724 and continuation glyphs alike.
8725 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
8726 glyph of a suitably computed width, to align the special glyphs at
8727 the window margin. Code moved from display_line. (Bug#11832)
8728
3e91a053
GM
87292012-07-12 Glenn Morris <rgm@gnu.org>
8730
ba9e4b84
GM
8731 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
8732
8733 * s/gnu-linux.h, s/hpux10-20.h:
8734 Do not unconditionally define HAVE_XRMSETDATABASE.
8735
3e91a053
GM
8736 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
8737
b300b1f4
PE
87382012-07-12 Paul Eggert <eggert@cs.ucla.edu>
8739
8740 Fix typos that broke OS X build.
8741 Reported by Randal L. Schwartz in
8742 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
8743 * nsterm.m (ns_timeout): Add missing local decl.
8744 (ns_get_color): snprintf -> sprintf, to fix typo.
8745
6e777848
GM
87462012-07-12 Glenn Morris <rgm@gnu.org>
8747
3f922c37
GM
8748 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
8749 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
8750 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
8751 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
8752
0ab7b23a
GM
8753 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
8754 Move PTY_OPEN to configure.
8755
6e777848
GM
8756 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8757 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
8758 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
8759
4a7edc24
DA
87602012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
8761
8762 Use empty_unibyte_string where applicable.
8763 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
8764 * lread.c (read1): Likewise.
8765 * xsettings.c (syms_of_xsettings): Likewise.
8766
308aab79
GM
87672012-07-12 Glenn Morris <rgm@gnu.org>
8768
42bd1719
GM
8769 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
8770 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
8771 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
8772 * s/hpux10-20.h (RUN_TIME_REMAP):
8773 * s/bsd-common.h (TABDLY): Move to configure.
8774
8775 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
8776
8777 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
8778
ea0bbd17 8779 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 8780 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
8781
8782 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 8783
308aab79
GM
8784 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
8785 * s/template.h: Move NARROWPROTO to configure.
8786
ee1cf5cf
GM
87872012-07-11 Glenn Morris <rgm@gnu.org>
8788
30fe9bf4
GM
8789 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
8790 unused since 2011-01-17 change to systty.h.
8791
ee1cf5cf
GM
8792 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
8793 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8794 Move HAVE_PTYS and HAVE_SOCKETS to configure.
8795
63e47e07
PE
87962012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8797
8798 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
8799
c43fb4c3
GM
88002012-07-11 Glenn Morris <rgm@gnu.org>
8801
8802 * s/darwin.h, s/gnu-linux.h, s/template.h:
8803 Move INTERRUPT_INPUT to configure.
8804
e8df9267
DA
88052012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8806
8807 Minor adjustments to interning code.
8808 * lisp.h (intern, intern_c_string): Redefine as static inline
8809 wrappers for intern_1 and intern_c_string_1, respectively.
8810 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
8811 * lread.c (intern_1, intern_c_string_1, oblookup):
8812 Simplify Vobarray checking.
e8df9267
DA
8813 * font.c (font_intern_prop): Likewise. Adjust comment.
8814 * w32font.c (intern_font_name): Likewise.
8815
34348bd4
AS
88162012-07-11 Andreas Schwab <schwab@linux-m68k.org>
8817
d96a1e0c
AS
8818 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
8819
34348bd4
AS
8820 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
8821 of Fcar/Fcdr if possible.
8822 * font.c (check_otf_features): Likewise.
8823 * fontset.c (Fnew_fontset): Likewise.
8824 * gnutls.c (Fgnutls_boot): Likewise.
8825 * minibuf.c (read_minibuf): Likewise.
8826 * msdos.c (IT_set_frame_parameters): Likewise.
8827 * xmenu.c (Fx_popup_dialog): Likewise.
8828 * w32menu.c (Fx_popup_dialog): Likewise.
8829
c8add24e
GM
88302012-07-11 Glenn Morris <rgm@gnu.org>
8831
4b575b3c
GM
8832 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
8833 since nothing has defined it on these platforms.
8834
09f4e3b0
GM
8835 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
8836 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
8837
172bedef
GM
8838 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8839 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8840 Move CLASH_DETECTION to configure.
8841
249685df
GM
8842 * s/gnu.h: Remove file, which is now empty.
8843
c8add24e
GM
8844 * s/gnu.h, s/gnu-linux.h:
8845 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
8846
b41253a3
JW
88472012-07-11 John Wiegley <johnw@newartisans.com>
8848
8849 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
8850 function attribute, so we only use it if it exists in the
8851 compiler.
8852
d923b542
DA
88532012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8854
8855 Avoid call to strlen in fast_c_string_match_ignore_case.
8856 * search.c (fast_c_string_match_ignore_case): Change to use
8857 length argument. Adjust users accordingly.
8858 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
8859
5ebbef1d
PE
88602012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8861
bb352260
PE
8862 Assume mkdir, rmdir.
8863 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
8864 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
8865
57054ddd
PE
8866 Assume rename.
8867 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
8868
b747d3f7
PE
8869 Assume perror.
8870 * s/hpux10-20.h (HAVE_PERROR): Remove.
8871 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
8872 Remove dummy definition, as this problem was obsolete long ago.
8873
5ebbef1d
PE
8874 Assume strerror.
8875 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
8876
984e7f30
DA
88772012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8878
8879 Avoid calls to strlen in font processing functions.
8880 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
8881 (font_open_by_name): Change to use length argument.
8882 Adjust users accordingly.
d923b542
DA
8883 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
8884 Adjust prototypes.
8885 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
8886 Change to return ptrdiff_t.
984e7f30
DA
8887 (xfont_list_pattern, xfont_match): Use length returned by
8888 xfont_decode_coding_xlfd.
8889 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
8890
20e94fdd
GM
88912012-07-11 Glenn Morris <rgm@gnu.org>
8892
9d596af3
GM
8893 * s/darwin.h, s/freebsd.h, s/netbsd.h:
8894 Move DONT_REOPEN_PTY to configure.
8895
20e94fdd
GM
8896 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
8897 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
8898
e99a530f
PE
88992012-07-10 Paul Eggert <eggert@cs.ucla.edu>
8900
22ffb973
PE
8901 Remove "#define unix" that is no longer needed (Bug#11905).
8902 * s/aix4-2.h (unix): Remove; no longer needed.
8903
e9a9ae03
PE
8904 EMACS_TIME simplification (Bug#11875).
8905 This replaces macros (which typically do not work in GDB)
8906 with functions, typedefs and enums, making the code easier to debug.
8907 The functional style also makes code easier to read and maintain.
8908 * systime.h: Include <sys/time.h> on all hosts, not just if
8909 WINDOWSNT, since 'struct timeval' is needed in general.
8910 (EMACS_TIME): Now a typedef, not a macro.
8911 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
8912 not macros.
8913 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
8914 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
8915 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
8916 (EMACS_TIME_LE): Now functions, not macros.
8917 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
8918 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
8919 which are not functions. All uses rewritten to use:
8920 (make_emacs_time): New function.
8921 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
8922 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
8923 not functions. All uses rewritten to use the following, respectively:
8924 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
8925 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 8926 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
8927 * fileio.c (Fcopy_file):
8928 * xterm.c (XTflash): Get the current time closer to when it's used.
8929 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
8930
ffacb126
PE
8931 * bytecode.c (targets): Suppress -Woverride-init warnings.
8932
e99a530f
PE
8933 Simplify by avoiding confusing use of strncpy etc.
8934 * doc.c (Fsnarf_documentation):
8935 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
8936 * frame.c (Fmake_terminal_frame):
8937 * gtkutil.c (get_utf8_string):
8938 * lread.c (openp):
8939 * nsmenu.m (ns_update_menubar):
8940 * regex.c (regerror):
8941 Prefer memcpy to strncpy and strncat when either will do.
8942 * fileio.c (Fsubstitute_in_file_name):
8943 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
8944 (menu_separator_name_p):
8945 * nsmenu.m (ns_update_menubar):
8946 Prefer memcmp to strncmp when either will do.
8947 * nsterm.m: Include <ftoastr.h>.
8948 (ns_get_color):
8949 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
8950 Prefer snprintf to strncpy.
8951 * nsterm.m (ns_term_init):
8952 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
8953 * nsterm.m (ns_term_init):
8954 Avoid the need for strncpy, by using build_string or
8955 make_unibyte_string directly. Use dtoastr, not snprintf.
8956 * process.c (Fmake_network_process): Diagnose service names that
8957 are too long, rather than silently truncating them or creating
8958 non-null-terminated names.
8959 (Fnetwork_interface_info): Likewise, for interface names.
8960 * sysdep.c (system_process_attributes) [GNU_LINUX]:
8961 Prefer sprintf to strncat.
8962 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
8963 Prefer vsnprintf to vsprintf + strncpy.
8964
c59592b3
GM
89652012-07-10 Glenn Morris <rgm@gnu.org>
8966
8967 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
8968 Clarify fallback case.
8969
7d7bbefd
DA
89702012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8971
8972 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
8973 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
8974 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 8975 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
8976 where argument type is known to be a Lisp_Cons.
8977
3a4c8000
TT
89782012-07-10 Tom Tromey <tromey@redhat.com>
8979
8980 * bytecode.c (BYTE_CODE_THREADED): New macro.
8981 (BYTE_CODES): New macro. Replaces all old byte-code defines.
8982 (enum byte_code_op): New type.
8983 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
8984 (exec_byte_code): Use them. Use token threading when applicable.
8985
2a0213a6
DA
89862012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8987
8988 Optimize pure C strings initialization.
8989 * lisp.h (make_pure_string): Fix prototype.
8990 (build_pure_c_string): New function, defined as static inline. This
8991 provides a better opportunity to optimize away calls to strlen when
8992 the function is called with compile-time constant argument.
8993 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
8994 argument, adjust users accordingly. Use build_pure_c_string where
8995 appropriate.
8996 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
8997 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
8998 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
8999
cb1caeaf
DA
90002012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9001
9002 Avoid calls to strlen in miscellaneous functions.
9003 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9004 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9005 * lread.c (openp): Likewise.
9006
c293e30c
DA
90072012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9008
9009 Avoid calls to strlen in path processing functions.
9010 * fileio.c (file_name_as_directory): Add comment. Change to add
9011 srclen argument and return the length of result. Adjust users
9012 accordingly.
9013 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
9014 swap 1st and 2nd arguments to obey the common convention.
9015 Adjust users accordingly.
c293e30c
DA
9016 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9017
9e059e3f
GM
90182012-07-10 Glenn Morris <rgm@gnu.org>
9019
d02eb359
GM
9020 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9021 Move PENDING_OUTPUT_COUNT definition to configure.
9022
882cf227
GM
9023 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9024 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9025 * s/gnu.h (DATA_START): Move definitions to configure.
9026
af6e839f
GM
9027 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9028 We include usg5-4-common.h, which defines them both.
9029
40289a12
GM
9030 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9031 O_RDONLY already includes it).
9032
9e059e3f
GM
9033 Stop ns builds setting the EMACSLOADPATH environment variable.
9034 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9035 Now it does not set EMACSLOADPATH, just returns the load-path string.
9036 * nsterm.h: Update accordingly.
9037 * lread.c [HAVE_NS]: Include nsterm.h.
9038 (init_lread) [HAVE_NS]: Use ns_load_path.
9039 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9040
7c4e8ec0
GM
90412012-07-09 Glenn Morris <rgm@gnu.org>
9042
d4f600ff
GM
9043 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9044 since the included bsd-common.h does so.
9045
cbb31951
GM
9046 Stop ns builds setting the EMACSPATH environment variable.
9047 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9048 (ns_init_paths): Do not set EMACSPATH.
9049 * nsterm.h (ns_exec_path): Add it.
9050 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9051 Use ns_exec_path.
9052
7c4e8ec0
GM
9053 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9054
26bccfae
PE
90552012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9056
a0bee46f
PE
9057 * process.c (wait_reading_process_output): 'waitchannels' was unset
9058 when read_kbd || !NILP (wait_for_cell); fix this.
9059
5994c183
PE
9060 Add GCC-style 'const' attribute to functions that can use it.
9061 * character.h (char_resolve_modifier_mask):
9062 * keyboard.h (make_ctrl_char):
9063 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9064 (init_character_once, next_almost_prime, init_fns, init_image)
9065 (flush_pending_output, init_sound):
9066 * mem-limits.h (start_of_data):
9067 * menu.h (finish_menu_items):
9068 Add ATTRIBUTE_CONST.
9069 * emacs.c (DEFINE_DUMMY_FUNCTION):
9070 Declare the dummy function with ATTRIBUTE_CONST.
9071 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9072 Add decls with ATTRIBUTE_CONST.
9073
26bccfae
PE
9074 Minor improvements to make_formatted_string.
9075 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9076 where int is good enough, as vsprintf returns an int.
9077 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9078
a8290ec3
DA
90792012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9080
9081 Use make_formatted_string to avoid double length calculation.
9082 * lisp.h (make_formatted_string): New prototype.
9083 * alloc.c (make_formatted_string): New function.
9084 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 9085 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
9086 * editfns.c (Fcurrent_time_zone): Likewise.
9087 * filelock.c (get_boot_time): Likewise.
9088 * frame.c (make_terminal_frame, set_term_frame_name)
9089 (x_report_frame_params): Likewise.
9090 * image.c (gs_load): Likewise.
9091 * minibuf.c (get_minibuffer): Likewise.
9092 * msdos.c (dos_set_window_size): Likewise.
9093 * process.c (make_process): Likewise.
9094 * xdisp.c (ensure_echo_area_buffers): Likewise.
9095 * xsettings.c (apply_xft_settings): Likewise.
9096
d01ba2f1
GM
90972012-07-09 Glenn Morris <rgm@gnu.org>
9098
9099 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9100 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9101 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9102 * nsterm.h (ns_etc_directory): Add it.
9103 * callproc.c [HAVE_NS]: Include nsterm.h.
9104 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9105
f1f924b6
DA
91062012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9107
9108 Move marker debugging code under MARKER_DEBUG.
9109 * marker.c (MARKER_DEBUG): Move marker debugging code under
9110 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9111 for bootstrap with --enable-checking (~3x slowdown reported
9112 by Juanma Barranquero <lekktu@gmail.com>).
9113 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9114
ab531b66
PE
91152012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9116
9117 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9118 See <http://bugs.gnu.org/11825#29>.
9119
c4b3bc8a
EZ
91202012-07-08 Eli Zaretskii <eliz@gnu.org>
9121
9122 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9123 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
9124 (display_line): Add commentary about displaying truncation glyphs
9125 on GUI frames.
9126 (produce_special_glyphs): Move here from term.c.
9127
9128 * term.c (produce_special_glyphs): Move to xdisp.c.
9129
9130 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9131 section.
c4b3bc8a 9132
b676b881
AS
91332012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9134
f17c5273
AS
9135 * xdisp.c (display_line): Avoid warning about implicit declaration
9136 of FRAME_FONT.
9137
298819b9
AS
9138 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9139
b676b881
AS
9140 * lisp.h: Remove empty conditional.
9141
6045c4fd
PE
91422012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9143
b3350bf9
PE
9144 * lread.c (load_path_check): Now static.
9145
6045c4fd
PE
9146 Fix some minor --with-ns problems found by static checking.
9147 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9148 (x_set_font) [!HAVE_X_WINDOWS]:
9149 * image.c (xpm_load_image) [HAVE_NS]:
9150 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9151 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9152 Remove unused local.
9153 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9154 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9155 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9156 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9157 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9158 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9159 Fix pointer signedness problem.
9160 * xfaces.c (FRAME_X_FONT_TABLE):
9161 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9162
929e7845
GM
91632012-07-07 Glenn Morris <rgm@gnu.org>
9164
9165 * lread.c (load_path_check): New function, split from init_lread.
9166 (init_lread): Reorganize. Motivation:
9167 If EMACSLOADPATH is set, check/warn about that rather than the
9168 defaults, which we are not going to use. Hence we can remove
9169 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9170 Don't warn if site-lisp directories are missing.
9171 If not installed, start from a blank load-path, since
9172 PATH_LOADSEARCH refers to the eventual installation directories.
9173
58dd0aa4
EZ
91742012-07-07 Eli Zaretskii <eliz@gnu.org>
9175
9176 Support truncation and continuation glyphs on GUI frames, when
9177 fringes are disabled. (Bug#11832)
9178 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
9179 continuation glyphs even if on GUI frames.
9180 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
9181 or both, are absent.
9182 (start_display, move_it_in_display_line_to): Handle the case of a
9183 GUI frame without a fringe to display continuation or truncation
9184 glyphs.
9185 (insert_left_trunc_glyphs): Support GUI frames: make sure
9186 truncation glyphs overwrite enough glyphs from the current line to
9187 have sufficient space in pixels.
9188 (display_line): Support truncation and continuation glyphs on GUI
9189 frames. If some spare pixels are left on the line after inserting
9190 the truncation glyphs, fill that space with a stretch glyph of a
9191 suitably computed width.
9192
9193 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9194 produce_glyphs, to support GUI sessions.
9195
31571fd7
PE
91962012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9197
5a16b9bc
PE
9198 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9199
f3047c75
PE
9200 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9201
31571fd7
PE
9202 Do not require float-time's arg to fit in time_t (Bug#11825).
9203 This works better on hosts where time_t is unsigned, and where
9204 float-time is applied to the (negative) difference between two times.
9205 * editfns.c (decode_time_components): Last arg is now double *,
9206 not int *, and means to store all the result as a double, without
9207 worrying about whether the seconds part fits in time_t.
9208 All callers changed.
9209 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9210 All callers changed.
9211 (Ffloat_time): Do not fail merely because the specified time falls
9212 outside of time_t range.
9213
4516fbef
GM
92142012-07-07 Glenn Morris <rgm@gnu.org>
9215
9216 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9217 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9218 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9219
07adc2c6
JB
92202012-07-07 Juanma Barranquero <lekktu@gmail.com>
9221
9222 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9223 Update dependencies.
9224
9225 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9226
fd573f31
PE
92272012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9228
fee5959d
PE
9229 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9230 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9231 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9232 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9233 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9234 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9235
fd573f31
PE
9236 * xfont.c (compare_font_names): Redo to omit the need for casts.
9237
ddadbc0e
AS
92382012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9239
fca8d6b6
AS
9240 * xfns.c (Fx_change_window_property): Doc fix.
9241 * w32fns.c (Fx_change_window_property): Doc fix.
9242
ddadbc0e
AS
9243 * w32fns.c (Fx_window_property): Accept the same arguments as the
9244 X Windows version. Doc fix.
9245 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9246
ed9265fc 92472012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
9248 Eli Zaretskii <eliz@gnu.org>
9249
9250 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9251 Windows-specific code from nt/config.nt moved here.
9252 Obsolete settings removed.
9253
216ee680
PE
92542012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9255
9256 * process.c: Avoid unnecessary calls to gettime.
9257 (wait_reading_process_output): Don't get the time of day
9258 when gobbling data immediately and not waiting, as there's no need
9259 for it in that case. This removes a FIXME.
9260
bdd091e4
JD
92612012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9262
9263 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9264 is defined (Bug#11768).
9265
9d44f8ce
DA
92662012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9267
9268 Fix marker debugging code.
9269 * marker.c (byte_char_debug_check): Do not perform the check
9270 if buffer is not multibyte.
090bd7cb
JB
9271 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9272 Call byte_char_debug_check with correct arguments.
9d44f8ce 9273
90fc4786
DA
92742012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9275
9276 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
9277 * marker.c (byte_char_debug_check, count_markers):
9278 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
9279 (byte_debug_flag): Remove.
9280 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9281 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9282
7b7ae965
DA
92832012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9284
4e57b342
DA
9285 Avoid code repetition in marker-related functions.
9286 * marker.c (attach_marker): New function.
9287 (Fset_marker, set_marker_restricted, set_marker_both)
9288 (set_marker_restricted_both): Use it.
9289 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9290 Consistently rename charno to charpos.
9291 (marker_position): Add eassert.
9292 (marker_byte_position): Convert to eassert.
9293
92942012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9295
9296 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 9297 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 9298 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 9299
657924ff
DA
93002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9301
9302 Introduce fast path for the widely used marker operation.
9303 * alloc.c (build_marker): New function.
9304 * lisp.h (build_marker): New prototype.
9305 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
9306 * composite.c (autocmp_chars): Likewise.
9307 * editfns.c (buildmark): Remove.
9308 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
9309 (save_restriction_save): Use build_marker.
9310 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
9311 * window.c (save_window_save): Likewise.
9312
041a49a6
DA
93132012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9314
9315 Do not use Fdelete_overlay in delete_all_overlays
9316 to avoid redundant calls to unchain_overlay.
9317 * buffer.c (drop_overlay): New function.
9318 (delete_all_overlays, Fdelete_overlay): Use it.
9319 * minibuf.c (get_minibuffer): Fix comment.
9320
7dca65a4
PE
93212012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9322
9323 Port to OpenBSD 5.1 amd64.
9324 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
9325 This is needed for OpenBSD, and should be harmless on all BSD systems.
9326 Also, include <sys/sysctl.h>, as it should be available on all
9327 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
9328 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9329 use p_pid member, not kp_proc.pid.
9330
8eb876e2
GM
93312012-07-06 Glenn Morris <rgm@gnu.org>
9332
9333 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
9334
38182d90
PE
93352012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9336
9337 More xmalloc and related cleanup.
9338 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
9339 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
9340 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
9341 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
9342 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
9343 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
9344 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
9345 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
9346 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
9347 * xterm.c:
9348 Omit needless casts involving void * pointers and allocation.
9349 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
9350 as the former is more robust if P's type is changed.
9351 Prefer xzalloc to xmalloc + memset 0.
9352 Simplify malloc-or-realloc to realloc.
9353 Don't worry about xmalloc returning a null pointer.
9354 Prefer xstrdup to xmalloc + strcpy.
9355 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
9356 growing it.
9357 * keyboard.c (apply_modifiers_uncached): Prefer local array to
9358 alloca of a constant.
9359
6dd5a677
EZ
93602012-07-05 Eli Zaretskii <eliz@gnu.org>
9361
9362 * xdisp.c (display_line): Fix horizontal pixel coordinates when
9363 hscroll is larger than the line width. Fixes long and futile
9364 looping inside extend_face_to_end_of_line (on a TTY) producing
9365 glyphs that are not needed and thrown away.
9366
6b312f0f
DA
93672012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9368
9369 * marker.c (set_marker_restricted_both): Simplify by using
9370 clip_to_bounds.
9371
f520ef9b
PE
93722012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9373
9374 * editfns.c (region_limit): Simplify by using clip_to_bounds.
9375
383b7c95
JD
93762012-07-05 Jan Djärv <jan.h.d@swipnet.se>
9377
9378 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
9379 not defined (Bug#11768).
9380 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
9381 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
9382 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
9383 followed by gtk_box_set_homogeneous (Bug#11768).
9384 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
9385 (update_theme_scrollbar_width, xg_create_scroll_bar):
9386 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
9387 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
9388 (is_box_type): New function (Bug#11768).
9389 (xg_tool_item_stale_p): Call is_box_type.
5293d758 9390 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
9391 with default display (Bug#11768).
9392
d6e7bf45
EZ
93932012-07-05 Eli Zaretskii <eliz@gnu.org>
9394
9395 * xdisp.c (window_hscroll_limited): New function.
9396 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
9397 coordinates when window's hscroll is set to insanely large
9398 values. (Bug#11857)
9399
431391ec
JB
94002012-07-05 Juanma Barranquero <lekktu@gmail.com>
9401
9402 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
9403 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
9404
23f86fce
DA
94052012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9406
9407 Cleanup xmalloc.
9408 * lisp.h (xzalloc): New prototype. Omit needless casts.
9409 * alloc.c (xzalloc): New function. Omit needless casts.
9410 * charset.c: Omit needless casts. Convert all calls to
9411 xmalloc with following memset to xzalloc.
9412 * dispnew.c: Likewise.
9413 * fringe.c: Likewise.
9414 * image.c: Likewise.
9415 * sound.c: Likewise.
9416 * term.c: Likewise.
9417 * w32fns.c: Likewise.
9418 * w32font.c: Likewise.
9419 * w32term.c: Likewise.
9420 * xfaces.c: Likewise.
9421 * xfns.c: Likewise.
9422 * xterm.c: Likewise.
9423 * atimer.c: Omit needless casts.
9424 * buffer.c: Likewise.
9425 * callproc.c: Likewise.
9426 * ccl.c: Likewise.
9427 * coding.c: Likewise.
9428 * composite.c: Likewise.
9429 * doc.c: Likewise.
9430 * doprnt.c: Likewise.
9431 * editfns.c: Likewise.
9432 * emacs.c: Likewise.
9433 * eval.c: Likewise.
9434 * filelock.c: Likewise.
9435 * fns.c: Likewise.
9436 * gtkutil.c: Likewise.
9437 * keyboard.c: Likewise.
9438 * lisp.h: Likewise.
9439 * lread.c: Likewise.
9440 * minibuf.c: Likewise.
9441 * msdos.c: Likewise.
9442 * print.c: Likewise.
9443 * process.c: Likewise.
9444 * region-cache.c: Likewise.
9445 * search.c: Likewise.
9446 * sysdep.c: Likewise.
9447 * termcap.c: Likewise.
9448 * terminal.c: Likewise.
9449 * tparam.c: Likewise.
9450 * w16select.c: Likewise.
9451 * w32.c: Likewise.
9452 * w32reg.c: Likewise.
9453 * w32select.c: Likewise.
9454 * w32uniscribe.c: Likewise.
9455 * widget.c: Likewise.
9456 * xdisp.c: Likewise.
9457 * xmenu.c: Likewise.
9458 * xrdb.c: Likewise.
9459 * xselect.c: Likewise.
9460
0497dc44
PE
94612012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9462
9463 * fileio.c (time_error_value): Check the right error number.
9464 Problem reported by Troels Nielsen in
9465 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
9466
356e7178
PE
94672012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9468
4e71fd89
PE
9469 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
9470 This should be fixed in a better way; see Eli Zaretskii in
9471 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
9472 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
9473
f0941253
PE
9474 * fileio.c (time_error_value): Rename from special_mtime.
9475 The old name's problems were noted by Eli Zaretskii in
9476 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
9477
065c9eb4
PE
9478 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
9479 This variable's comment says Emacs needs at least one GDB-visible
9480 symbol of type enum pvec_type, to work around GDB problems.
9481 The symbol's value doesn't matter.
9482
356e7178
PE
9483 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
9484 that causes compilation to fail on pre-C99 compilers.
9485
ed9265fc 94862012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
9487
9488 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
9489 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
9490
3884d954
DA
94912012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9492
d209e2fb 9493 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
9494 headers for buffer_defaults and buffer_local_symbols.
9495 Reported by Juanma Barranquero <lekktu@gmail.com>.
9496
ee28be33
SM
94972012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9498
9499 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
9500 * lisp.h (enum pvec_type): Use fewer bits.
9501 (PSEUDOVECTOR_SIZE_BITS): New constant.
9502 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
9503 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
9504 change in pvec_type.
9505 (PSEUDOVECTOR_TYPEP): New macro.
9506 (TYPED_PSEUDOVECTORP): Use it.
9507 * fns.c (internal_equal): Adapt code to extract pvectype.
9508 * emacs.c (gdb_pvec_type): Update type.
9509 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
9510 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
9511 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
9512 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
9513 (sweep_vectors): Use it. Use local var `total_bytes' instead of
9514 abusing vector->header.next.nbytes.
9515 (live_vector_p): Use PVEC_TYPE.
9516 (mark_object): Adapt code to extract pvectype. Use switch.
9517
c7f2cd7f
PE
95182012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9519
9520 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
9521 Tighten new eassert a bit.
9522
8ce70ed2
DA
95232012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9524
9525 Fix compilation with --enable-gcc-warnings and -O1
9526 optimization level.
9527 * doprnt.c (doprnt): Change type of tem to int, initialize
9528 to avoid compiler warning. Add eassert.
9529 * search.c (simple_search): Initialize match_byte to avoid
9530 compiler warning. Add eassert.
9531
dea7f1e5
PE
95322012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9533
24a212eb
PE
9534 Avoid weird behavior with large horizontal scrolls.
9535 Without this change, for example, large hscroll values would
9536 mess up Emacs's display on Fedora 15 x86, presumably due to
9537 overflows in int calculations in the display code.
9538 Also, if buffers had long lines, Emacs would freeze.
9539 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
9540 (set_window_hscroll): New function, containing the old guts of
9541 Fset_window_hscroll. Return the clipped value.
9542 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
9543 This avoids the need to check against PTRDIFF_MAX.
9544
dea7f1e5
PE
9545 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
9546
76046526
DA
95472012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9548
9549 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
9550
39adff0d
PE
95512012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9552
63807d47
PE
9553 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
9554 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
9555 since GCC 4.4.6 issues a bogus warning for them.
9556
39adff0d
PE
9557 Fix bugs in file timestamp newness comparisons.
9558 * fileio.c (Ffile_newer_than_file_p):
9559 * lread.c (Fload): Use full timestamp resolution of files,
9560 not just the 1-second resolution, so that files that are only
9561 slightly newer still count as newer.
9562 * fileio.c (Ffile_newer_than_file_p): Don't assume file
9563 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
9564
dbeed9a6
PE
95652012-07-03 Paul Eggert <eggert@cs.ucla.edu>
9566
9567 * fileio.c: Improve handling of file time marker. (Bug#11852)
9568 (special_mtime): New function.
9569 (Finsert_file_contents, Fverify_visited_file_modtime):
9570 Use it to set special mtime values consistently.
9571
636334d6
AS
95722012-07-03 Andreas Schwab <schwab@linux-m68k.org>
9573
9574 * fileio.c (Finsert_file_contents): Properly handle st_mtime
9575 marker for non-existing file. (Bug#11852)
9576
e2017fe2
GM
95772012-07-03 Glenn Morris <rgm@gnu.org>
9578
9579 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
9580 and did not make it into globals.h).
9581
404dbd37
TT
95822012-07-03 Tom Tromey <tromey@redhat.com>
9583
9584 * window.c (Fset_window_margins, Fset_window_fringes)
9585 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
9586 * textprop.c (Fprevious_property_change): No longer static.
9587 * syntax.c (Fsyntax_table_p): No longer static.
9588 * process.c (Fget_process, Fprocess_datagram_address): No longer
9589 static.
9590 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
9591 * keyboard.c (Fcommand_execute): No longer static.
9592 Remove EXFUN.
9593 * insdel.c (Fcombine_after_change_execute): No longer static.
9594 * image.c (Finit_image_library): No longer static.
9595 * fileio.c (Fmake_symbolic_link): No longer static.
9596 * eval.c (Ffetch_bytecode): No longer static.
9597 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
9598 * doc.c (Fdocumentation_property, Fsnarf_documentation):
9599 No longer static.
404dbd37
TT
9600 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
9601 static.
9602 * dired.c (Ffile_attributes): No longer static.
9603 * composite.c (Fcomposition_get_gstring): No longer static.
9604 * callproc.c (Fgetenv_internal): No longer static.
9605
9606 * ccl.h: Remove EXFUNs.
9607 * buffer.h: Remove EXFUNs.
9608 * dispextern.h: Remove EXFUNs.
9609 * intervals.h: Remove EXFUNs.
9610 * fontset.h: Remove EXFUN.
9611 * font.h: Remove EXFUNs.
9612 * dosfns.c (system_process_attributes): Remove EXFUN.
9613 * keymap.h: Remove EXFUNs.
9614 * lisp.h: Remove EXFUNs.
9615 * w32term.h: Remove EXFUNs.
9616 * window.h: Remove EXFUNs.
9617 * xsettings.h: Remove EXFUN.
9618 * xterm.h: Remove EXFUN.
9619
8e4fd1e1
GM
96202012-07-03 Glenn Morris <rgm@gnu.org>
9621
9622 * lisp.h (Frandom): Make it visible to C.
9623 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
9624 buffer for invisible buffers. (Bug#1229)
9625
ca95b3eb
DA
96262012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9627
9628 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
9629 values which aren't power of 2.
14ae4239 9630 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 9631 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
9632 accordingly.
9633
7555c33f
SM
96342012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
9635
9636 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
9637
9638 * alloc.c (mark_object): Revert part of last patch to use `switch'.
9639
d12e8f5a
DA
96402012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9641
9642 * alloc.c (allocate_vector_block): Remove redundant
9643 calls to mallopt if DOUG_LEA_MALLOC is defined.
9644 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
9645 avoid calls to mallopt if zero_vector is returned.
9646
296094c3
DA
96472012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9648
9649 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
9650 is enabled, avoid dereferencing NULL current_sblock if
9651 running undumped.
9652
36429c89
DA
96532012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9654
9655 Cleanup basic buffer management.
9656 * buffer.h (struct buffer): Change layout to use generic vector
9657 marking code. Fix some comments. Change type of 'clip_changed'
9658 to bitfield. Remove unused #ifndef old.
9659 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
9660 (GET_OVERLAYS_AT): Fix indentation.
9661 (for_each_per_buffer_object_at): New macro.
9662 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
9663 (Fbuffer_local_variables): Use it.
9664 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
9665 * alloc.c (allocate_buffer): Adjust to match new layout of
9666 struct buffer. Fix comment.
9667 (mark_overlay): New function.
9668 (mark_buffer): Use it. Use mark_vectorlike to mark normal
9669 Lisp area of struct buffer.
9670 (mark_object): Use it. Adjust marking of misc objects
9671 and related comments.
9672
3b3e4cac
PE
96732012-07-02 Paul Eggert <eggert@cs.ucla.edu>
9674
9675 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
9676 wrapper that is not needed because the wrapped code is a no-op (zero
9677 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
9678 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
9679
cf5c0175
DA
96802012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
9681
9682 * alloc.c (mark_buffer): Simplify. Remove prototype.
9683 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 9684 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
9685 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
9686 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 9687
ca26824c
GM
96882012-06-30 Glenn Morris <rgm@gnu.org>
9689
2e4c5312
GM
9690 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
9691
ca26824c
GM
9692 * epaths.in (PATH_SITELOADSEARCH): New.
9693 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
9694 This is rather than relying on --enable-locallisppath elements
9695 having "site-lisp" in their names. (Bug#10208#25, 11658)
9696
0d23c240
EZ
96972012-06-30 Eli Zaretskii <eliz@gnu.org>
9698
c9240d7a
EZ
9699 * w32proc.c (sys_select): Accept and ignore one more argument.
9700
9701 * w32.c (emacs_gnutls_pull): Call select with one more argument.
9702
0d23c240 9703 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 9704 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
9705
9706 * sysdep.c: Don't include dos.h and dosfns.h.
9707
9708 * process.c (sys_select):
9709 * msdos.c (sys_select): Accept one more argument and ignore it.
9710
9711 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
9712 adapt data types and code to that.
9713
9714 * dosfns.c:
9715 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
9716 which clashes with the gnulib function of the same name.
9717
af5a5a98
AS
97182012-06-30 Andreas Schwab <schwab@linux-m68k.org>
9719
c5e4379c
AS
9720 * font.c (font_style_to_value, font_style_symbolic)
9721 (font_prop_validate_style): Add type checks for values in
9722 font_style_table.
9723
af5a5a98
AS
9724 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
9725 argument.
9726 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
9727 uses.
9728
8d38f461
EZ
97292012-06-29 Eli Zaretskii <eliz@gnu.org>
9730
2e5a6631
EZ
9731 * xdisp.c (try_window_id): Undo last change.
9732
8d38f461
EZ
9733 * w32.c (getwd): Adjust commentary about startup_dir.
9734 (init_environment): Always call sys_access, even in non-MSVC
9735 builds. Don't chdir to the directory of the Emacs executable.
9736 This undoes code from 1997 which was justified by the need to
9737 "avoid conflicts when removing and renaming directories". But its
9738 downside was that every relative file name was being interpreted
9739 relative to the directory of the Emacs executable, which can never
9740 be TRT. In particular, it broke sys_access when called with
9741 relative file names.
9742 (sys_access): Map GetLastError to errno.
9743
2af3565e
DA
97442012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9745
9746 * window.h (struct window): Change type of 'fringes_outside_margins'
9747 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 9748 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
9749 Adjust comment.
9750 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
9751 to ptrdiff_t.
9752
c8d3a25c 97532012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 9754
c8d3a25c
GM
9755 * gnutls.c (emacs_gnutls_handshake):
9756 Add QUIT to make the loop interruptible.
57570cd3 9757
c8d3a25c 97582012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 9759
c8d3a25c
GM
9760 * charset.c (init_charset): Make lack of etc/charsets fatal.
9761
3e984ee8
DA
97622012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9763
9764 * editfns.c (region_limit): Fix type mismatch.
9765
ef884f23
DA
97662012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9767
9768 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
9769 undefined. Convert from xassert to eassert.
9770 * nsmenu.m: Convert from xassert to eassert.
9771 * nsterm.m: Likewise.
9772
7d7e0027
SM
97732012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
9774
9775 * editfns.c (region_limit): Clip to narrowing (bug#11770).
9776
aa754e6a
PE
97772012-06-28 Paul Eggert <eggert@cs.ucla.edu>
9778
9779 Avoid integer overflow on scroll-left and scroll-right.
9780 * window.c (HSCROLL_MAX): New macro.
9781 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
9782 overflow when requested scroll falls outside ptrdiff_t range.
9783
80b00b08
DA
97842012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9785
9786 * window.h (struct window): Change type of 'hscroll',
9787 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
9788 'last_modified' and 'last_overlay_modified' to EMACS_INT.
9789 Adjust users accordingly.
9790 * xdisp.c (try_cursor_movement): Replace type check with eassert.
9791 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
9792 from EMACS_INT to ptrdiff_t.
9793 (make_window): Omit redundant initialization.
9794
62b2bcf6
JB
97952012-06-28 Juanma Barranquero <lekktu@gmail.com>
9796
9797 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
9798
45942c7d
DA
97992012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9800
9801 * window.h (struct window): Change type of 'use_time' and
9802 'sequence_number' from Lisp_Object to int.
9803 * frame.c (make_frame): Adjust users accordingly.
9804 * print.c (print_object): Likewise.
9805 * window.c (select_window, Fwindow_use_time, make_parent_window)
9806 (make_window): Likewise.
9807
e509cfa6
DA
98082012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9809
9810 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
9811 enabled with --enable-checking=[all,glyphs] configure option.
9812 Fix GLYPH_DEBUG usage assuming that it may be undefined,
9813 adjust comments accordingly.
9814 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
9815 undefined, adjust comments accordingly.
9816 * image.c: Likewise.
9817 * scroll.c: Likewise.
9818 * w32fns.c: Likewise.
9819 * w32term.c: Likewise.
9820 * xdisp.c: Likewise.
9821 * xfaces.c: Likewise.
9822 * xfns.c: Likewise.
9823 * xterm.c: Likewise.
9824
a54e2c05
DA
98252012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9826
9827 Generalize run-time debugging checks.
9828 * dispextern.h (XASSERTS): Remove.
9829 * fontset.c (xassert): Remove.
9830 Convert from xassert to eassert.
9831 * alloc.c: Convert from xassert to eassert.
9832 * bidi.c: Likewise.
9833 * dispnew.c: Likewise.
9834 * fns.c: Likewise.
9835 * fringe.c: Likewise.
9836 * ftfont.c: Likewise.
9837 * gtkutil.c: Likewise.
9838 * image.c: Likewise.
9839 * keyboard.c: Likewise.
9840 * menu.c: Likewise.
9841 * process.c: Likewise.
9842 * scroll.c: Likewise.
9843 * sound.c: Likewise.
9844 * term.c: Likewise.
9845 * w32console.c: Likewise.
9846 * w32fns.c: Likewise.
9847 * w32term.c: Likewise.
9848 * window.c: Likewise.
9849 * xdisp.c: Likewise.
9850 * xfaces.c: Likewise.
9851 * xfns.c: Likewise.
9852 * xselect.c: Likewise.
9853 * xterm.c: Likewise.
9854
1ec4b7b2
SM
98552012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
9856
9857 * fns.c (maybe_resize_hash_table): Output message when growing the
9858 purify-hashtable.
9859
2014308a
DA
98602012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9861
9862 * alloc.c (allocate_string_data): Remove dead code.
9863 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
9864 avoid GCC warning about unused macro.
9865
246155eb
DA
98662012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9867
9868 * alloc.c (allocate_string): Omit intervals initialization.
9869 * alloc.c (make_uninit_multibyte_string): Initialize intervals
9870 as in make_pure_string and make_pure_c_string.
9871
43184b7b
DA
98722012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9873
d209e2fb 9874 * alloc.c (allocate_string): Fix last change.
43184b7b 9875
3fe6dd74
DA
98762012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9877
d209e2fb 9878 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
9879 to memset, add explicit initialization where appropriate.
9880
1ba6038a
GM
98812012-06-27 Glenn Morris <rgm@gnu.org>
9882
9883 * lisp.mk (lisp): Remove paths.elc.
9884
c89926a5
CY
98852012-06-27 Chong Yidong <cyd@gnu.org>
9886
9887 * doc.c (Fsubstitute_command_keys): Fix punctuation.
9888
ed6b3510
JW
98892012-06-26 John Wiegley <johnw@newartisans.com>
9890
1ec4b7b2 9891 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
9892 on Mac OS X Lion: __mod_init_func and __mod_term_func.
9893
ed6b3510
JW
9894 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
9895 when building with Clang.
9896
8edd4a2b
SM
98972012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
9898
9899 * eval.c (Fapply): Allow calling it with a single argument.
9900
f6f62d1b
EZ
99012012-06-26 Eli Zaretskii <eliz@gnu.org>
9902
9903 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
9904 _stricmp and _strnicmp.
9905 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
9906
62efea5e
DA
99072012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9908
9909 * alloc.c (allocate_window): Zero out non-Lisp part of newly
9910 allocated window.
9911 (allocate_process): Likewise for new process.
8edd4a2b 9912 (allocate_terminal): Change to use offsetof.
62efea5e
DA
9913 (allocate_frame): Likewise.
9914 * frame.c (make_frame): Omit redundant initialization.
9915 * window.c (make_parent_window): Use memset.
9916 (make_window): Omit redundant initialization.
9917 * process.c (make_process): Omit redundant initialization.
9918 * terminal.c (create_terminal): Likewise.
9919
42997f4d
DA
99202012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9921
9922 * term.c (delete_tty): Remove redundant call to memset.
9923
1130ecfc
DA
99242012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9925
9926 * alloc.c: Remove build_string.
9927 * lisp.h: Define build_string as static inline. This provides
9928 a better opportunity to optimize away calls to strlen when the
9929 function is called with compile-time constant argument.
9930 * image.c (imagemagick_error): Convert to build_string.
9931 * w32proc.c (sys_spawnve): Likewise.
9932 * xterm.c (x_term_init): Likewise.
9933
cf38a720
PE
99342012-06-26 Paul Eggert <eggert@cs.ucla.edu>
9935
99027bdd
PE
9936 Use sprintf return value instead of invoking strlen on result.
9937 In the old days this wasn't portable, since some sprintf
9938 implementations returned char *. But they died out years ago and
9939 Emacs already assumes sprintf returns int.
9940 Similarly for float_to_string.
9941 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
9942 * ccl.c (ccl_driver):
9943 * character.c (string_escape_byte8):
9944 * data.c (Fnumber_to_string):
9945 * doprnt.c (doprnt):
9946 * print.c (print_object):
9947 * xdisp.c (message_dolog):
9948 * xfns.c (syms_of_xfns):
9949 Use sprintf or float_to_string result to avoid need to call strlen.
9950 * data.c (Fnumber_to_string):
9951 Use make_unibyte_string, since the string must be ASCII.
9952 * lisp.h, print.c (float_to_string): Now returns int length.
9953 * term.c (produce_glyphless_glyph):
9954 Use sprintf result rather than recomputing it.
9955
cf38a720
PE
9956 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
9957 * Makefile.in (ALL_CFLAGS):
9958 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
9959 * gmalloc.c, regex.c: Include <config.h> unconditionally.
9960
3511c784
DA
99612012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9962
0a08eb21 9963 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
9964 strcasecmp if available.
9965 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
9966
fb7da12e
AS
99672012-06-25 Andreas Schwab <schwab@linux-m68k.org>
9968
9969 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
9970 Avoid comma operator.
9971 * menu.c (push_submenu_start, push_submenu_end)
9972 (push_left_right_boundary, push_menu_pane): Likewise.
9973 * msdos.c (dos_rawgetc): Likewise.
9974
afa2ffd8
DA
99752012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9976
9977 * xfns.c (xic_create_fontsetname): Remove redundant calls
9978 to memset.
9979
b3b4476b
PE
99802012-06-25 Paul Eggert <eggert@cs.ucla.edu>
9981
4495ff38
PE
9982 * gtkutil.c (get_utf8_string): Remove redundant assignment.
9983 sprintf already null-terminates its output.
9984
b3b4476b
PE
9985 * xfns.c (x_window): Remove redundant cast.
9986
b00876c9
DA
99872012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9988
9989 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
9990 `const char *' to `char *' to avoid compiler warning.
9991
d188e26b
PE
99922012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9993
885d1d74
PE
9994 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
9995 instead of truncating it to 63 (admittedly a generous limit).
9996
d188e26b
PE
9997 * process.c: Fix spelling and caps in comments.
9998
e2f560b1
DN
99992012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10000
e86db54b 10001 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
10002 * sysdep.c (setpgrp): Remove definition, not used in this file.
10003
7583a3a1
JB
100042012-06-24 Juanma Barranquero <lekktu@gmail.com>
10005
10006 * makefile.w32-in: Update dependencies.
10007
696056c2
EZ
100082012-06-24 Eli Zaretskii <eliz@gnu.org>
10009
10010 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10011 (SYSTIME_H): Add nt/inc/sys/time.h.
10012
10013 * systime.h [WINDOWSNT]: Include sys/time.h.
10014
10015 * s/ms-w32.h (struct timespec): Definition moved from
10016 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10017
845ca893
PE
100182012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10019
10020 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10021 * buffer.h (buffer_slot_type_mismatch):
10022 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10023 * eval.c (unwind_to_catch):
10024 * image.c (my_png_error, my_error_exit):
10025 * keyboard.c (quit_throw_to_read_char, user_error)
10026 (Fexit_recursive_edit, Fabort_recursive_edit):
10027 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10028 (wrong_type_argument, buffer_overflow, __executable_start)
10029 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10030 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10031 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10032 (fatal):
10033 (child_setup) [!DOS_NT]:
10034 * lread.c (end_of_file_error, invalid_syntax):
10035 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10036 * puresize.h (pure_write_error):
10037 * search.c (matcher_overflow):
10038 * sound.c (sound_perror, alsa_sound_perror):
10039 * sysdep.c, syssignal.h (croak):
10040 * term.c (maybe_fatal, vfatal):
10041 * textprop.c (text_read_only):
10042 * undo.c (user_error):
10043 * unexmacosx.c (unexec_error):
10044 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10045 Use _Noreturn rather than NO_RETURN.
10046 No need for separate decl merely because of _Noreturn.
10047 * sound.c (sound_warning, parse_sound):
10048 Remove unnecessary forward decls.
10049
f1dd8073
PE
100502012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10051
10052 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10053 * lisp.h (WAIT_READING_MAX): New macro.
10054 * dispnew.c (Fsleep_for, sit_for):
10055 * keyboard.c (kbd_buffer_get_event):
10056 * process.c (Faccept_process_output):
10057 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10058 This improves on the previous patch, which introduced a bug
10059 when time_t is unsigned and as wide as intmax_t.
10060 See <http://bugs.gnu.org/9000#51>.
10061
b82c1755
EZ
100622012-06-23 Eli Zaretskii <eliz@gnu.org>
10063
10064 * dispnew.c (sit_for, Fsleep_for):
10065 * keyboard.c (kbd_buffer_get_event):
10066 * process.c (Faccept_process_output): Avoid compiler warnings when
10067 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10068
ca300656
JB
100692012-06-23 Juanma Barranquero <lekktu@gmail.com>
10070
049ec95b
JB
10071 * makefile.w32-in: Update dependencies.
10072
ca300656
JB
10073 * w32.c (ltime): Add return type and declare static.
10074 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10075
db7b8d06
PE
100762012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10077
10078 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10079 Privately reported by Herbert J. Skuhra.
10080 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10081 All uses changed.
10082 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10083 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10084
0bd8297f
EZ
100852012-06-23 Eli Zaretskii <eliz@gnu.org>
10086
96512555
EZ
10087 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10088 last argument of make_unibyte_string.
10089
0bd8297f
EZ
10090 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10091 language ID in the event parameters.
10092
10093 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10094 event.code, not the obscure "character set ID".
10095
63def6b6
CY
100962012-06-23 Chong Yidong <cyd@gnu.org>
10097
10098 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10099
e8a02204
EZ
101002012-06-23 Eli Zaretskii <eliz@gnu.org>
10101
388cdec0
EZ
10102 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10103 * w32.c (fdutimens): New function.
10104
10105 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10106
10107 * s/ms-w32.h (pselect): Redirect to sys_select.
10108
10109 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10110
e8a02204
EZ
10111 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10112 in the logic of incrementing and decrementing the value of
10113 use_relocatable_buffers.
10114
d054f3fb
PE
101152012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10116
10117 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10118 Privately reported by Herbert J. Skuhra.
10119 [__FreeBSD__]: Remove "*/" typo after "#include".
10120 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10121 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10122 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10123 Don't assume EMACS_TIME and struct timeval are the same type.
10124
d35af63c
PE
101252012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10126
10127 Support higher-resolution time stamps (Bug#9000).
10128 The time stamps are only nanosecond-resolution at the C level,
10129 since that's the best that any real-world system supports now.
10130 But they are picosecond-resolution at the Lisp level, as that's
10131 easy, and leaves room for future OS improvements.
10132
10133 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10134 (LIBES): Use it.
10135
10136 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10137 Don't get current time unless it's needed.
10138
10139 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10140 now provides it if it's absent.
10141 (start_atimer): Port to higher-res time stamps.
10142 Check for time stamp overflow. Don't get current time more
10143 often than is needed.
10144
10145 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10146 Include systime.h, not time.h.
10147 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10148
10149 * dired.c: Include stat-time.h.
10150 (Ffile-attributes): File times now have higher resolution.
10151
10152 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10153 (struct image): Timestamp now has higher resolution.
10154
10155 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10156 has at least microseconds now. All uses removed.
10157 (update_frame, update_single_window, update_window, update_frame_1)
10158 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 10159 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
10160
10161 * editfns.c (time_overflow): Now extern.
10162 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10163 (float-time, Fformat_time_string, Fcurrent_time_string)
10164 (Fcurrent_time_zone): Accept and generate higher-resolution
10165 time stamps.
10166 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10167 (decode_time_components, lisp_seconds_argument): New functions.
10168 (make_time): Now static.
10169 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10170 Report an error if the time is invalid, rather than having the caller
10171 do that.
10172
10173 * fileio.c: Include <stat-time.h>
10174 (Fcopy_file): Copy higher-resolution time stamps.
10175 Prefer to set the time stamp via a file descriptor if that works.
10176 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10177 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10178 (Fvisited_file_modtime, Fset_visited_file_modtime):
10179 Support higher-resolution time stamps.
10180
10181 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10182
10183 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10184
10185 * image.c (prepare_image_for_display, clear_image_cache)
10186 (lookup_image): Port to higer-resolution time stamps.
10187
10188 * keyboard.c (start_polling, bind_polling_period):
10189 Check for time stamp overflow.
10190 (read_char, kbd_buffer_get_event, timer_start_idle)
10191 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10192 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10193 Port to higher-resolution time stamps. Do not assume time_t is signed.
10194 (decode_timer): New function. Timers are now vectors of length 9,
10195 not 8, to accommodate the picosecond component.
10196 (timer_check_2): Use it.
10197
10198 * nsterm.m (select_timeout, timeval_subtract): Remove.
10199 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10200 as they're a bit more accurate and handle overflow better.
10201 (ns_select): Change prototype to be compatible with pselect.
10202 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10203 * nsterm.h (ns_select): Adjust prototype.
10204
10205 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10206 us-resolution time stamps.
10207 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10208
10209 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10210
10211 * lisp.h (time_overflow): New decl.
10212 (wait_reading_process_output): First arg is now intmax_t, not int,
10213 to accommodate larger waits.
10214
10215 * process.h (struct Lisp_Process.read_output_delay):
10216 Now counts nanoseconds, not microseconds.
10217 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10218 EMACS_HAS_USECS.
10219 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10220 (wait_reading_process_output):
10221 Port to ns-resolution time stamps.
10222 (Faccept_process_output, wait_reading_process_output):
10223 Check for time stamp overflow. Do not assume time_t is signed.
10224 (select_wrapper): Remove; we now use pselect.
10225 (Fprocess_attributes): Now generates ns-resolution time stamps.
10226
10227 * sysdep.c: Include utimens.h. Don't include utime.h
10228 or worry about struct utimbuf; gnulib does that for us now.
10229 (gettimeofday): Remove; gnulib provides a substitute.
10230 (make_timeval): New function.
10231 (set_file_times): Now sets ns-resolution time stamps.
10232 New arg FD; all uses changed.
10233 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10234 (system_process_attributes):
10235 Now returns ns-resolution time stamp. All uses changed.
10236 Check for time stamp overflow.
10237
10238 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10239 provides a substitute now.
10240
10241 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10242 since it guarantees struct timespec.
10243 (EMACS_TIME): Now struct timespec, so that we can support
10244 ns-resolution time stamps.
10245 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10246 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10247 (EMACS_USECS): Remove.
10248 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10249 so multiply the arg by 1000 before storing it.
10250 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10251 New macros.
10252 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10253 Port to ns-resolution time stamps.
10254 (EMACS_TIME_NEG_P): Remove; replaced by....
10255 (EMACS_TIME_SIGN): New macro.
10256 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10257 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10258 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10259 (make_timeval, make_lisp_time, decode_time_components): New decls.
10260 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10261 that it mishandled time_t overflow. You can't compare by subtracting!
10262 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10263 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10264
10265 * term.c: Include <sys/time.h>.
10266 (timeval_to_Time): New function, for proper overflow wraparound.
10267 (term_mouse_position, term_mouse_click): Use it.
10268
10269 * undo.c (record_first_change): Support higher-resolution time stamps
10270 in the undo buffer.
10271 (Fprimitive_undo): Use them when restoring time stamps.
10272
10273 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10274 (w32_get_internal_run_time):
10275 Port to higher-resolution Emacs time stamps.
10276 (ltime): Now accepts single 64-bit integer, as that's more convenient
10277 for callers.
10278
10279 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10280
10281 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10282 for compatibility with pselect. Support ns-resolution time stamps.
10283
10284 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10285
10286 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10287 Check for time stamp overflow, and support ns-resolution time stamps.
10288
10289 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10290 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
10291 (timeval_subtract): Remove; no longer needed.
10292 (XTflash, XTring_bell, x_wait_for_event):
10293 Port to ns-resolution time stamps. Don't assume time_t is signed.
10294
b6a92dfe
CY
102952012-06-22 Chong Yidong <cyd@gnu.org>
10296
10297 * xdisp.c (x_consider_frame_title): Revert last change.
10298
d251c37c
EZ
102992012-06-22 Eli Zaretskii <eliz@gnu.org>
10300
10301 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
10302 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
10303 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
10304 staticidx goes up to 1597 out of 1600 = 0x640.)
10305
f10deafb
PE
103062012-06-20 Paul Eggert <eggert@cs.ucla.edu>
10307
10308 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
10309 Otherwise, the umask might be mistakenly 0 while handling input signals.
10310
ec6de1e2
SM
103112012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
10312
10313 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
10314
28be1ada
DA
103152012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
10316
10317 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
10318 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
10319 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
10320 access to `contents' member of Lisp_Vector objects with AREF and ASET
10321 where appropriate.
10322
c6bf3022
CY
103232012-06-19 Chong Yidong <cyd@gnu.org>
10324
10325 * frame.c (delete_frame): When selecting a frame on a different
10326 text terminal, do not alter the terminal's top-frame.
10327
10328 * xdisp.c (format_mode_line_unwind_data): Record the target
10329 frame's selected window and its terminal's top-frame.
10330 (unwind_format_mode_line): Restore them.
10331 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
10332 Callers changed.
10333 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
10334 since tty frames can be explicitly named.
10335 (prepare_menu_bars): Likewise.
10336
10337 * term.c (Ftty_top_frame): New function.
10338
defd4196
PE
103392012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10340
10341 Port byte-code-meter to modern targets.
10342 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
10343 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 10344 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
10345 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
10346 (METER_1, METER_2): Simplify.
10347
1053a871
SM
103482012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
10349
10350 * data.c (Fdefalias): Return `symbol' (bug#11686).
10351
b7e8d081
MR
103522012-06-18 Martin Rudalics <rudalics@gmx.at>
10353
10354 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
10355 gets killed during executing of this function (Bug#11665).
10356 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
10357 (Vkill_buffer_query_functions): In doc-string say that functions
10358 run by this hook should not change the current buffer.
10359
7ea2b339
PE
103602012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10361
10362 Fix recently-introduced process.c problems found by static checking.
10363 * process.c (write_queue_push, write_queue_pop, send_process):
10364 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
10365 (write_queue_pop): Fix pointer signedness problem.
10366 (send_process): Remove unused local.
10367
96a313a1
CY
103682012-06-17 Chong Yidong <cyd@gnu.org>
10369
10370 * xdisp.c (redisplay_internal): No need to redisplay terminal
10371 frames that are not on top.
10372
20ca2e94
TN
103732012-06-17 Troels Nielsen <bn.troels@gmail.com>
10374
10375 * process.c (make_process): Initialize write_queue.
10376 (write_queue_push, write_queue_pop): New functions.
10377 (send_process): Use them to maintain correct ordering of process
10378 writes (Bug#10815).
10379
9a900ca9
PE
103802012-06-17 Paul Eggert <eggert@cs.ucla.edu>
10381
310fbfa8
PE
10382 * lisp.h (eassert): Assume C89 or later.
10383 This removes the need for CHECK.
10384 (CHECK): Remove. Its comments about always evaluating its
10385 argument were confusing, as 'eassert' typically does not evaluate
10386 its argument.
10387
27bb1ca4
PE
10388 * coding.c (produce_chars): Use ptrdiff_t, not int.
10389
9a900ca9
PE
10390 * xterm.c (x_draw_underwave): Check for integer overflow.
10391 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
10392
41b7f8bc 103932012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
10394
10395 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
10396 referenced (Bug#11583).
10397
9b0e3eba
AA
103982012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
10399
10400 Implement wave-style variant of underlining.
10401 * dispextern.h (face_underline_type): New enum.
10402 (face): Add field for underline type.
10403 * nsterm.m (ns_draw_underwave): New function.
10404 (ns_draw_text_decoration): Use it.
10405 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
10406 New functions.
10407 (x_draw_glyph_string): Use them.
10408 * xfaces.c (Qline, Qwave): New Lisp objects.
10409 (check_lface_attrs, merge_face_ref)
1053a871
SM
10410 (Finternal_set_lisp_face_attribute, realize_x_face):
10411 Handle wave-style underline face attributes.
9b0e3eba
AA
10412 * xterm.c (x_draw_underwave): New function.
10413 (x_draw_glyph_string): Use it.
10414
0fb52f11
JB
104152012-06-16 Juanma Barranquero <lekktu@gmail.com>
10416
10417 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
10418 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
10419 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
10420 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
10421 ($(BLD)/w32select.$(O)): Update dependencies.
10422
e5560ff7
AS
104232012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10424
10425 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
10426 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
10427 * character.c (_fetch_multibyte_char_p): Remove.
10428 * alloc.c: Include "character.h" before "buffer.h".
10429 * bidi.c: Likewise.
10430 * buffer.c: Likewise.
10431 * bytecode.c: Likewise.
10432 * callint.c: Likewise.
10433 * callproc.c: Likewise.
10434 * casefiddle.c: Likewise.
10435 * casetab.c: Likewise.
10436 * category.c: Likewise.
10437 * cmds.c: Likewise.
10438 * coding.c: Likewise.
10439 * composite.c: Likewise.
10440 * dired.c: Likewise.
10441 * dispnew.c: Likewise.
10442 * doc.c: Likewise.
10443 * dosfns.c: Likewise.
10444 * editfns.c: Likewise.
10445 * emacs.c: Likewise.
10446 * fileio.c: Likewise.
10447 * filelock.c: Likewise.
10448 * font.c: Likewise.
10449 * fontset.c: Likewise.
10450 * fringe.c: Likewise.
10451 * indent.c: Likewise.
10452 * insdel.c: Likewise.
10453 * intervals.c: Likewise.
10454 * keyboard.c: Likewise.
10455 * keymap.c: Likewise.
10456 * lread.c: Likewise.
10457 * macros.c: Likewise.
10458 * marker.c: Likewise.
10459 * minibuf.c: Likewise.
10460 * nsfns.m: Likewise.
10461 * nsmenu.m: Likewise.
10462 * print.c: Likewise.
10463 * process.c: Likewise.
10464 * regex.c: Likewise.
10465 * region-cache.c: Likewise.
10466 * search.c: Likewise.
10467 * syntax.c: Likewise.
10468 * term.c: Likewise.
10469 * textprop.c: Likewise.
10470 * undo.c: Likewise.
10471 * unexsol.c: Likewise.
10472 * w16select.c: Likewise.
10473 * w32fns.c: Likewise.
10474 * w32menu.c: Likewise.
10475 * window.c: Likewise.
10476 * xdisp.c: Likewise.
10477 * xfns.c: Likewise.
10478 * xmenu.c: Likewise.
10479 * xml.c: Likewise.
10480 * xselect.c: Likewise.
10481
2f07e6af
EZ
104822012-06-16 Eli Zaretskii <eliz@gnu.org>
10483
1053a871
SM
10484 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
10485 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 10486 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
10487 row.
10488 (handle_face_prop): Use chunk-relative overlay string index when
10489 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
10490 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
10491 the rightmost. (Bug#11720)
2f07e6af 10492
29b83cec
AS
104932012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10494
10495 * category.h (CHAR_HAS_CATEGORY): Define as inline.
10496 (CATEGORY_MEMBER): Enforce 1/0 value.
10497 * category.c (_temp_category_set): Remove.
10498
4c5501e9
EZ
104992012-06-16 Eli Zaretskii <eliz@gnu.org>
10500
10501 * window.c (Fdelete_other_windows_internal)
10502 (Fdelete_window_internal): Don't access frame's mouse highlight
10503 info of the initial frame. (Bug#11677)
10504
2b570124
PE
105052012-06-14 Paul Eggert <eggert@cs.ucla.edu>
10506
e93864f9
PE
10507 * .gdbinit (xgetint): Fix recently-introduced paren typo.
10508 Assume USE_2_TAGS_FOR_INTS.
10509 (xreload): Adjust $tagmask width to match recent lisp.h change.
10510
2b570124
PE
10511 Simplify lisp.h in minor ways that should not affect code.
10512 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
10513 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
10514 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
10515 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
10516 (INTTYPEBITS): New macro, for clarity.
10517 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
10518 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
10519 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
10520 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
10521 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
10522
81755f69
JB
105232012-06-13 Juanma Barranquero <lekktu@gmail.com>
10524
10525 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
10526
16192a57
GM
105272012-06-13 Glenn Morris <rgm@gnu.org>
10528
10529 * s/bsd-common.h (BSD4_3):
10530 * s/usg5-4-common.h (USG5_4): No longer define; unused.
10531
646b5f55
AS
105322012-06-13 Andreas Schwab <schwab@linux-m68k.org>
10533
10534 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
10535 instead of union.
10536 (XLI, XIL): Define.
1053a871
SM
10537 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
10538 Use them.
10539 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 10540 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 10541 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
10542 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
10543 * frame.c (delete_frame): Remove outdated comment.
10544 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
10545 USE_LISP_UNION_TYPE.
10546 (Fw32_unregister_hot_key): Likewise.
10547 (Fw32_toggle_lock_key): Likewise.
10548 * w32menu.c (add_menu_item): Likewise.
10549 (w32_menu_display_help): Use XIL instead of checking
10550 USE_LISP_UNION_TYPE.
10551 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
10552 (init_heap): Likewise.
10553 * w32term.c (w32_read_socket): Update comment.
10554
1d3823c9
GM
105552012-06-13 Glenn Morris <rgm@gnu.org>
10556
c62ff706
GM
10557 * s/usg5-4-common.h, src/s/unixware.h:
10558 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
10559
1d3823c9
GM
10560 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
10561
bfe3e0a2
PE
105622012-06-13 Paul Eggert <eggert@cs.ucla.edu>
10563
10564 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
10565 * alloc.c (make_number) [!defined make_number]:
10566 Remove, as lisp.h always defines this now.
10567 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
10568 (roundup_size): Verify that it is a power of 2.
10569 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
10570 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
10571 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
10572 -DUSE_LSB_TAG=0, to override the automatically-selected default.
10573 USE_LSB_TAG now is always defined to be either 0 or 1.
10574 All uses changed.
10575 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
10576 code works fine either way, and efficiency is not a concern here,
10577 as the union type is for debugging, not for production.
10578 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
10579 Use an inline function on all platforms when using the union type,
10580 since this is simpler and 'static inline' can be used portably
10581 within Emacs now.
10582 (LISP_INITIALLY_ZERO): New macro.
10583 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
10584 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
10585
45fa9c0f
GM
105862012-06-12 Glenn Morris <rgm@gnu.org>
10587
b4492cba
GM
10588 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
10589
10590 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 10591
45fa9c0f
GM
10592 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
10593 Move BROKEN_SIGIO to configure.
10594
10595 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
10596 Move NO_TERMIO to configure.
10597
0e25d334
CY
105982012-06-12 Chong Yidong <cyd@gnu.org>
10599
10600 * image.c (imagemagick_load_image): Use MagickFlattenImage if
10601 MagickMergeImageLayers is undefined. Use pixel pusher loop if
10602 MagickExportImagePixels is undefined.
10603
43682bb6
PE
106042012-06-12 Paul Eggert <eggert@cs.ucla.edu>
10605
10606 * image.c (imagemagick_load_image): Remove unused label.
10607
a9be7d2b
GM
106082012-06-11 Glenn Morris <rgm@gnu.org>
10609
10610 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10611 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
10612 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
10613 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
10614
3017f87f
SM
106152012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
10616
10617 * alloc.c (make_byte_code): New function.
10618 (Fmake_byte_code): Use it. Don't purify here.
10619 * lread.c (read1): Use it as well to avoid extra allocation.
10620
1b9b4cf4
CY
106212012-06-11 Chong Yidong <cyd@gnu.org>
10622
10623 * image.c (imagemagick_load_image): Implement transparency.
10624
95988fcf
AS
106252012-06-10 Andreas Schwab <schwab@linux-m68k.org>
10626
10627 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
10628 account for preceding backslashes. (Bug#11663)
10629
cd4eb164
CY
106302012-06-09 Chong Yidong <cyd@gnu.org>
10631
10632 * term.c: Support italics in capable terminals (Bug#9652).
10633 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
10634 (turn_on_face): Output using TS_enter_italic_mode if available.
10635 Don't handle unused blinking and alt-charset cases.
10636 (turn_off_face): Handle italic case; discard unused tty_blinking_p
10637 and tty_alt_charset_p cases.
10638 (tty_capable_p, init_tty): Support italics.
10639
10640 * termchar.h (struct tty_display_info): Add field for italics.
10641 Remove unused blink field.
10642
10643 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
10644 Handle slant.
10645
10646 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
10647 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
10648 tty_alt_charset_p. Add tty_italic_p.
10649
ff88beb8
MA
106502012-06-09 Michael Albinus <michael.albinus@gmx.de>
10651
10652 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
10653 dbus_type_is_basic if available.
10654 (xd_extract_signed, xd_extract_unsigned): Rename from
10655 extract_signed and extract_unsigned, respectively. Adapt callers.
10656
44286096
CY
106572012-06-09 Chong Yidong <cyd@gnu.org>
10658
1682701f
CY
10659 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
10660
44286096
CY
10661 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
10662 case (Bug#9752).
10663
d86feb17
PE
106642012-06-08 Paul Eggert <eggert@cs.ucla.edu>
10665
10666 * xdisp.c (vmessage): Treat frame message as multibyte.
10667 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
10668 would generate the diagnostic "Making \302\247 buffer-local while
10669 let-bound!".
10670
d5c20fe8
EZ
106712012-06-08 Eli Zaretskii <eliz@gnu.org>
10672
10673 * dispnew.c (showing_window_margins_p): Undo last change, which
10674 was done due to an inadvertent commit.
10675 (adjust_frame_glyphs_for_frame_redisplay): Do call
10676 showing_window_margins_p.
10677
513749ee
SM
106782012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10679
10680 * eval.c (Fmake_var_non_special): New primitive.
10681 (syms_of_eval): Defsubr it.
10682 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
10683
d4a8f5c1
JB
106842012-06-08 Juanma Barranquero <lekktu@gmail.com>
10685
10686 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
10687 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
10688
8bbbc977
EZ
106892012-06-08 Eli Zaretskii <eliz@gnu.org>
10690
10691 * alloc.c (allocate_vectorlike): Fix last change.
10692
f3372c87
DA
106932012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
10694
10695 Block-based vector allocation of small vectors.
10696 * lisp.h (struct vectorlike_header): New field `nbytes',
10697 adjust comment accordingly.
10698 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 10699 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
10700 mark_maybe_pointer, valid_lisp_object_p) accordingly.
10701 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
10702 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
10703 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
10704 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
10705 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
10706 (roundup_size): New constant.
10707 (struct vector_block): New data type.
10708 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 10709 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
10710 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
10711 (sweep_vectors): New functions.
10712 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 10713 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
10714 or equal to VBLOCK_BYTES_MAX.
10715 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
10716 (init_alloc_once): Add call to init_vectors.
10717
4f18a4ed
SM
107182012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10719
10720 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
10721
86f158bc
PE
107222012-06-07 Paul Eggert <eggert@cs.ucla.edu>
10723
10724 * doprnt.c (doprnt): Truncate multibyte char correctly.
10725 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
10726 would mishandle a string argument "Xc" if X was a multibyte
10727 character of length 2: it would truncate after X's first byte
10728 rather than including all of X.
10729
c5cfcbe0
CY
107302012-06-06 Chong Yidong <cyd@gnu.org>
10731
10732 * buffer.c (word_wrap): Doc fix.
10733
c05cf390
PE
107342012-06-04 Paul Eggert <eggert@cs.ucla.edu>
10735
10736 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
10737
0c3461de
GM
107382012-06-03 Glenn Morris <rgm@gnu.org>
10739
10740 * xdisp.c (tool-bar-style): Doc fix.
10741
c71232db
UM
107422012-06-03 Ulrich Müller <ulm@gentoo.org>
10743
10744 * Makefile.in (PAXCTL): Define.
10745 (temacs$(EXEEXT)): Disable memory randomization for the temacs
10746 binary via PaX flags if the paxctl utility is available.
10747 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
10748 Restore PaX flags to their default. (Bug#11398)
10749
383f7350
CY
107502012-06-03 Chong Yidong <cyd@gnu.org>
10751
10752 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
10753 buffer (Bug#11226).
10754
5f2c76c6
CY
107552012-06-03 Chong Yidong <cyd@gnu.org>
10756
10757 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
10758 (note_mode_line_or_margin_highlight): If there is no help echo,
10759 use mode-line-default-help-echo. Handle the case where the mouse
10760 position is past the end of the mode line string.
10761
10762 * buffer.c (buffer_local_value_1): New function, split from
10763 Fbuffer_local_value; can return Qunbound.
10764 (Fbuffer_local_value): Use it.
10765 (Vmode_line_format): Docstring tweaks.
10766
773d47f6
PE
107672012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10768
10769 * sysdep.c (system_process_attributes): Improve comment.
10770
f2d6a3df
SM
107712012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
10772
10773 * keyboard.c: Export real-this-command to Elisp.
10774 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
10775 and DEFVAR it. Update all users.
10776
63810350
PE
107772012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10778
7bd5c1f4
PE
10779 * minibuf.c (Fassoc_string): Remove duplicate declaration.
10780
63810350
PE
10781 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
10782 Convert pctcpu and pctmem to Lisp float properly.
10783 Let the compiler fold better, as 100.0/0x8000 is exact.
10784
a2821611
AS
107852012-06-02 Andreas Schwab <schwab@linux-m68k.org>
10786
10787 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
10788 cons_block.
10789
5fceba1d
PE
107902012-06-01 Paul Eggert <eggert@cs.ucla.edu>
10791
10792 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
10793
c98ff5dd
DA
107942012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
10795
10796 For a 'struct window', replace some Lisp_Object fields to
10797 bitfields where appropriate, remove unused fields.
10798 * window.h (struct window): Remove unused 'last_mark_x' and
10799 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 10800 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
10801 Change type of 'force_start', 'optional_new_start',
10802 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 10803 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 10804
ca34e0be
PE
108052012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10806
10807 Pacify gcc -Wdouble-precision when using Xaw.
10808 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
10809 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
10810 Use 'float' consistently, rather than 'float' in most places
10811 and 'double' in a couple of places.
10812
efc00ab1 108132012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
10814
10815 * xdisp.c (handle_stop): Detect whether we have overlay strings
10816 loaded by testing it->current.overlay_string_index to be
10817 non-negative, instead of checking whether n_overlay_strings is
10818 positive. (Bug#11587)
10819
efc00ab1 108202012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
10821
10822 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
10823
10824 * doc.c (Fsubstitute_command_keys): Doc fix.
10825
efc00ab1 108262012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
10827
10828 * search.c (search_buffer): Remove calls to
10829 r_alloc_inhibit_buffer_relocation, as it is now called by
10830 maybe_unify_char, which was the cause of relocation of buffer text
10831 in bug#11519.
10832
efc00ab1 108332012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
10834
10835 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
10836 for the duration of call to load_charset, to avoid problems with
10837 callers of maybe_unify_char that access buffer text through C
10838 pointers.
10839
10840 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
10841 decrement the inhibition flag, instead of just setting or
10842 resetting it.
10843
ba93a187
PE
108442012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10845
10846 Remove obsolete '#define static' cruft.
10847 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
10848 This #undef was "temporary" in 2000; it is no longer needed
10849 now that '#define static' has gone away.
10850 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
10851 (gray_bitmap_bits): Remove; no longer needed.
10852 All uses replaced with definiens.
10853 * xterm.c: Include "bitmaps/gray.xbm".
10854
9e4bf381
PE
108552012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10856
10857 Clean up __executable_start, monstartup when --enable-profiling.
10858 The following changes affect the code only when profiling.
10859 * dispnew.c (__executable_start): Rename from safe_bcopy.
10860 Define only on platforms that need it.
10861 * emacs.c: Include <sys/gmon.h> when profiling.
10862 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
10863 (__executable_start): Remove decl, since lisp.h does it now.
10864 (safe_bcopy): Remove decl; no longer has that name.
10865 (main): Coalesce #if into single bit of code, for simplicity.
10866 Cast pointers to uintptr_t, since standard libraries want integers
10867 and not pointers.
10868 * lisp.h (__executable_start): New decl.
10869
32d72c2f
GM
108702012-05-31 Glenn Morris <rgm@gnu.org>
10871
10872 * image.c (Fimagemagick_types): Doc fix.
10873
baac5bc7
JM
108742012-05-30 Jim Meyering <meyering@redhat.com>
10875
10876 * callproc.c (Fcall_process_region): Include directory component
10877 in mkstemp error message (Bug#11586).
10878
72cb32cf
PE
108792012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10880
10881 * alloc.c, lisp.h (make_pure_vector): Now static.
10882
61b108cc
SM
108832012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
10884
10885 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
10886 Move to byte-run.el.
10887 (Fautoload): Do the hash-doc more carefully.
10888 * data.c (Fdefalias): Purify definition, except for keymaps.
10889 (Qdefun): Move from eval.c.
10890 * lisp.h (Qdefun): Remove.
10891 * lread.c (read1): Tiny simplification.
10892
471fe23d
TN
108932012-05-29 Troels Nielsen <bn.troels@gmail.com>
10894
934f3f58 10895 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
10896 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
10897 Bug#9642, but explicitly check that the buffer the overlay would
10898 be moved to is live and rearrange lines to make sure that errors
10899 will not put the overlay in an inconsistent state.
10900 (Fdelete_overlay): Cosmetics.
10901
85d0efd1
EZ
109022012-05-28 Eli Zaretskii <eliz@gnu.org>
10903
10904 * w32term.c (my_bring_window_to_top): New function.
10905 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
10906 could be different from the original one.
10907 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
10908 (Bug#11513)
10909
10910 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
10911 by calling BringWindowToTop.
10912
10913 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
10914 (WM_EMACS_END): Increase by one.
10915
da92a98c
PE
109162012-05-28 Paul Eggert <eggert@cs.ucla.edu>
10917
10918 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
10919 This avoids undefined behavior that might cause the eassert
10920 to not catch an out-of-range value.
10921
74d1f848
JB
109222012-05-28 Juanma Barranquero <lekktu@gmail.com>
10923
10924 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
10925 Update dependencies.
10926
9e1a06fc
EZ
109272012-05-27 Eli Zaretskii <eliz@gnu.org>
10928
10929 * bidi.c (bidi_mirror_char): Fix last change.
10930
f3dd7312
AS
109312012-05-27 Andreas Schwab <schwab@linux-m68k.org>
10932
10933 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
10934 when referring to sectname field in printf format.
10935
81899c91
PE
109362012-05-27 Paul Eggert <eggert@cs.ucla.edu>
10937
57b81a9f
PE
10938 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
10939 Only r_alloc_inhibit_buffer_relocation needed to be added;
10940 the others were already declared.
10941
81899c91
PE
10942 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
10943 before checking whether it's out of range. Put the check inside
10944 eassert. See
10945 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
10946
33017faf 109472012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
10948
10949 * callproc.c (Fcall_process): Restore a line that was accidentally
10950 commented out in the 2011-02-13 change (bug#11547).
10951
33017faf 109522012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
10953
10954 * lisp.h [REL_ALLOC]: Add prototypes for external functions
10955 defined on ralloc.c.
10956
10957 * buffer.c [REL_ALLOC]: Remove prototypes of
10958 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
10959 they are now on lisp.h.
10960
10961 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
10962
10963 * search.c (search_buffer): Use it to inhibit relocation of buffer
10964 text while re_search_2 is doing its job, because re_search_2 is
10965 passed C pointers to buffer text. (Bug#11519)
10966
23415acf
EZ
10967 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
10968 Update value to 24.
10969
44e27368
EZ
10970 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
10971 state after an additional call to move_it_in_display_line_to, keep
10972 the values of it->max_ascent and it->max_descent found for the
10973 entire line.
10974 (pos_visible_p): Revert the comparison against bottom_y to what it
10975 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
10976 (Bug#11464)
10977
c1892f11
PE
109782012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10979
10980 Fix coding-related core dumps with gcc -ftrapv.
10981 The code was computing A - B, where A and B are pointers, and B is
10982 random garbage. This can lead to core dumps on platforms that
10983 have special pointer registers, and it also leads to core dumps on
10984 x86-64 when compiled with gcc -ftrapv. The fix is to compute
10985 A - B only when B is initialized properly.
10986 * coding.c (coding_set_source, coding_set_destination): Return void.
10987 (coding_change_source, coding_change_destinations): New functions,
10988 with the old behaviors of coding_set_source and coding_set_destination.
10989 All callers that need an offset changed to use these new functions.
10990
eb7afdad
GM
109912012-05-26 Glenn Morris <rgm@gnu.org>
10992
10993 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
10994
f12fdf02
EZ
109952012-05-26 Eli Zaretskii <eliz@gnu.org>
10996
53a63be6 10997 Extend mouse support on W32 text-mode console.
61b108cc
SM
10998 * xdisp.c (draw_row_with_mouse_face):
10999 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 11000
eb3f6f01 11001 * w32console.c: Include window.h.
61b108cc
SM
11002 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11003 New functions.
eb3f6f01
EZ
11004 (initialize_w32_display): Initialize mouse-highlight data.
11005
53a63be6
EZ
11006 * w32inevt.c: Include termchar.h and window.h.
11007 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11008 moves, call note_mouse_highlight. If help_echo changed, call
11009 gen_help_event to produce help-echo message in the echo area.
11010 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11011 highlight info.
11012
4cfd81f6
PE
110132012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11014
11015 * lread.c (read1): Simplify slightly to avoid an overflow warning
11016 with GCC 4.7.0 on x86-64.
11017
4446092a
EZ
110182012-05-26 Eli Zaretskii <eliz@gnu.org>
11019
11020 * bidi.c (bidi_mirror_char): Revert last change: an int is
11021 definitely wide enough here.
11022
42b2a986 110232012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 11024
42b2a986 11025 Fix integer width and related bugs (Bug#9874).
eb106a49 11026 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
11027 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11028 (string_bytes, check_sblock, allocate_string_data):
11029 (compact_small_strings, Fmake_bool_vector, make_string)
11030 (make_unibyte_string, make_multibyte_string)
11031 (make_string_from_bytes, make_specified_string)
11032 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11033 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11034 (mark_vectorlike):
11035 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11036 (allocate_pseudovector):
11037 Use int, not EMACS_INT, where int is wide enough.
11038 (inhibit_garbage_collection, Fgarbage_collect):
11039 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11040 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11041 int might not be wide enough.
11042 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11043 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11044 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11045 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11046 (bidi_level_of_next_char, bidi_move_to_visually_next):
11047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11048 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11049 (Fkill_buffer, Fset_buffer_major_mode)
11050 (advance_to_char_boundary, Fbuffer_swap_text)
11051 (Fset_buffer_multibyte, overlays_at, overlays_in)
11052 (overlay_touches_p, struct sortvec, record_overlay_string)
11053 (overlay_strings, recenter_overlay_lists)
11054 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11055 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11056 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11057 (Foverlay_recenter, last_overlay_modification_hooks_used)
11058 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11059 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
11060 (validate_region): Omit unnecessary test for b <= e,
11061 since that's guaranteed by the previous test.
d311d28c
PE
11062 (adjust_overlays_for_delete): Avoid pos + length overflow.
11063 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11064 (report_overlay_modification):
11065 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11066 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11067 Omit pointer cast, which isn't needed anyway, and doesn't work
11068 after the EMACS_INT -> ptrdiff_t change.
02481186 11069 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
11070 * buffer.h: Adjust decls to match defn changes elsewhere.
11071 (struct buffer_text, struct buffer):
11072 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11073 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
11074 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11075 not int, to avoid needless 32-bit limit on 64-bit hosts.
11076 (exec_byte_code): Use tighter memory-full test, one that checks
11077 for alloca overflow. Don't compute the address of the object just
11078 before an array, as that's not portable. Use EMACS_INT, not
11079 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
11080 * callint.c (Fcall_interactively):
11081 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11082 * callproc.c (call_process_kill, Fcall_process):
11083 Don't assume pid_t fits into an Emacs fixnum.
11084 (call_process_cleanup, Fcall_process, child_setup):
11085 Don't assume pid_t fits into int.
11086 (call_process_cleanup, Fcall_process, delete_temp_file)
11087 (Fcall_process_region):
11088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11089 (Fcall_process): Simplify handling of volatile integers.
11090 Use int, not EMACS_INT, where int will do.
11091 * casefiddle.c (casify_object, casify_region, operate_on_word)
11092 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11093 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11094 (casify_object): Avoid integer overflow when overallocating buffer.
11095 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 11096 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
11097 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11098 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11099 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11100 integers are now checked earlier. All uses replaced with XINT.
11101 (ccl_driver):
11102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11103 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
11104 (ccl_driver, Fregister_code_conversion_map):
11105 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
11106 (resolve_symbol_ccl_program): Check that vector header is in range.
11107 Always copy the vector, so that we can check its contents reliably
11108 now rather than having to recheck each instruction as it's being
11109 executed. Check that vector words fit in 'int'.
11110 (ccl_get_compiled_code, Fregister_ccl_program)
11111 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11112 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11113 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11114 contents are in range.
11115 (Fccl_execute_on_string): Check that status is in range.
11116 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11117 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11118 Accept and return EMACS_INT, not int, because callers can pass values
11119 out of 'int' range.
11120 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11121 (multibyte_chars_in_text, parse_str_as_multibyte)
11122 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11123 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11124 (string_escape_byte8, Fget_byte):
11125 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 11126 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
11127 avoid mishandling large integers.
11128 * character.h: Adjust decls to match defn changes elsewhere.
11129 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11130 (Ffind_charset_region):
11131 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11132 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11133 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 11134 Don't assume fixnum fits in int.
d311d28c
PE
11135 (load_charset_map_from_vector, Fmap_charset_chars):
11136 Remove now-unnecessary CHECK_NATNUMs.
11137 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
11138 Don't rely on undefined behavior with signed left shift overflow.
11139 Don't assume unsigned int fits into fixnum, or that fixnum fits
11140 into unsigned int. Don't require max_code to be a valid fixnum;
11141 that's not true for gb10830 4-byte on a 32-bit host. Allow
11142 invalid_code to be a cons, for the same reason. Require code_offset
11143 to be a character. Avoid int overflow if max_char is close
11144 to INT_MAX.
11145 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11146 this is intended anyway and avoids some undefined behavior.
11147 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11148 INDEX_TO_CODE_POINT, as that's what it expects.
11149 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
11150 * charset.h (DECODE_CHAR): Return int, not unsigned;
11151 this is what was intended anyway, and it avoids undefined behavior.
11152 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11153 integer-overflow issues.
11154 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11155 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11156 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
11157 * chartab.c (Fmake_char_table, Fset_char_table_range)
11158 (uniprop_get_decoder, uniprop_get_encoder):
11159 Don't assume fixnum fits in int.
11160 * cmds.c (move_point): New function, that does the gist of
11161 Fforward_char and Fbackward_char, but does so while checking
11162 for integer overflow more accurately.
c96e5d6a 11163 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
11164 (Fforward_line, Fend_of_line, internal_self_insert)
11165 (internal_self_insert):
11166 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11167 Fix a FIXME, by checking for integer overflow when calculating
11168 target_clm and actual_clm.
11169 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 11170 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
11171 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11172 (coding_alloc_by_making_gap, alloc_destination)
11173 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11174 (encode_coding_utf_16, detect_coding_emacs_mule)
11175 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11176 (detect_coding_iso_2022, decode_coding_iso_2022)
11177 (encode_invocation_designation, encode_designation_at_bol)
11178 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11179 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11180 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11181 (encode_coding_ccl, encode_coding_raw_text)
11182 (detect_coding_charset, decode_coding_charset)
11183 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11184 (produce_composition, produce_charset, produce_annotation)
11185 (decode_coding, handle_composition_annotation)
11186 (handle_charset_annotation, consume_chars, decode_coding_gap)
11187 (decode_coding_object, encode_coding_object, detect_coding_system)
11188 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11189 (code_convert_region, code_convert_string)
8f50130c
PE
11190 (Fdefine_coding_system_internal)
11191 (coding_set_source, coding_set_destination):
d311d28c
PE
11192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11193 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11194 (Fdefine_coding_system_internal):
11195 Don't assume fixnums fit in int.
11196 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 11197 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
11198 (Funencodable_char_position, Fcheck_coding_systems_region)
11199 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 11200 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 11201 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 11202 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 11203 Don't access memory outside of the args array.
d311d28c 11204 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
11205 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11206 result of ENCODE_CHAR.
d311d28c
PE
11207 * coding.h: Adjust decls to match defn changes elsewhere.
11208 (struct coding_system):
11209 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11210 * composite.c (get_composition_id, find_composition)
11211 (run_composition_function, update_compositions)
11212 (compose_text, composition_gstring_put_cache)
11213 (composition_gstring_p, composition_gstring_width)
11214 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11215 (composition_compute_stop_pos, composition_reseat_it)
11216 (composition_update_it, struct position_record)
11217 (find_automatic_composition, composition_adjust_point)
11218 (Fcomposition_get_gstring, Ffind_composition_internal):
11219 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11220 (update_compositions):
11221 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11222 * composite.h: Adjust decls to match defn changes elsewhere.
11223 (struct composition):
11224 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11225 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11226 Do not attempt to compute the address of the object just before a
11227 buffer; this is not portable.
11228 (Faref, Faset):
11229 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11230 (Faset): Use int, not EMACS_INT, where int is wide enough.
11231 (Fstring_to_number): Don't assume fixnums fit in int.
11232 (Frem): Don't assume arg is nonnegative.
11233 * dbusbind.c (xd_append_arg): Check for integers out of range.
11234 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 11235 (extract_signed, extract_unsigned): New functions.
243e0530
PE
11236 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11237 (xd_get_connection_references): Return ptrdiff_t, not int.
11238 All uses changed.
11239 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11240 (xd_read_message_1):
11241 Use int, not unsigned, where the dbus API uses int.
11242 (Fdbus_message_internal): Don't overflow mtype.
11243 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
11244 * dired.c (directory_files_internal, file_name_completion, scmp)
11245 (file_name_completion_stat):
11246 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11247 (file_name_completion): Don't overflow matchcount.
11248 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11249 * dispextern.h: Adjust decls to match defn changes elsewhere.
11250 (struct text_pos, struct glyph, struct bidi_saved_info)
11251 (struct bidi_string_data, struct bidi_it, struct composition_it)
11252 (struct it):
11253 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11254 (struct display_pos, struct composition_it, struct it):
11255 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11256 * dispnew.c (increment_matrix_positions)
11257 (increment_row_positions, mode_line_string)
11258 (marginal_area_string):
11259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 11260 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
11261 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11262 (duration_to_sec_usec): New function, to check for overflow better.
11263 (Fsleep_for, sit_for): Use it.
11264 * doc.c (get_doc_string, store_function_docstring):
11265 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11266 (get_doc_string, Fsnarf_documentation):
11267 Use int, not EMACS_INT, where int is wide enough.
11268 (get_doc_string):
11269 Use SAFE_ALLOCA, not alloca.
11270 Check for overflow when converting EMACS_INT to off_t.
11271 * doprnt.c (doprnt):
11272 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11273 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11274 Don't assume uid_t fits into fixnum.
11275 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11276 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11277 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11278 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
11279 (general_insert_function)
11280 (Finsert_char, make_buffer_string, make_buffer_string_both)
11281 (update_buffer_properties, Fbuffer_substring)
11282 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11283 (Fsubst_char_in_region, check_translation)
11284 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11285 (transpose_markers, Ftranspose_regions):
11286 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11287 (clip_to_bounds): Move to lisp.h as an inline function).
11288 (Fconstrain_to_field): Don't assume integers are nonnegative.
11289 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11290 (Fsubst_char_in_region, Fsave_restriction):
11291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11292 (Femacs_pid): Don't assume pid_t fits into fixnum.
11293 (lo_time): Use int, not EMACS_INT, when int suffices.
11294 (lisp_time_argument): Check for usec out of range.
11295 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
11296 (Fuser_login_name, Fuser_full_name): Signal an error
11297 if a uid argument is out of range, rather than relying on
11298 undefined behavior.
c8d5c857
PE
11299 (Fformat_time_string): Remove now-unnecessary check.
11300 lisp_time_argument checks for out-of-range usec now.
243e0530 11301 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
11302 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
11303 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
11304 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
11305 (init_cmdargs, Fdump_emacs):
11306 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11307 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
11308 the bottom (typically) 32 bits of the fixnum.
11309 * eval.c (specpdl_size, call_debugger):
11310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11311 (when_entered_debugger, Fbacktrace_debug):
11312 Don't assume fixnum can fit in int.
11313 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
11314 the object just before a buffer; this is not portable.
11315 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
11316 (grow_specpdl, unbind_to):
11317 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11318 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
11319 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 11320 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
11321 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
11322 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
11323 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11324 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
11325 (a_write, e_write):
11326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11327 (Fcopy_file, non_regular_nbytes, read_non_regular)
11328 (Finsert_file_contents):
11329 Use int, not EMACS_INT, where int is wide enough.
11330 (READ_BUF_SIZE): Verify that it fits in int.
11331 (Finsert_file_contents): Check that counts are in proper range,
11332 rather than assuming fixnums fit into ptrdiff_t etc.
11333 Don't assume fixnums fit into int.
125b3835 11334 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
11335 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
11336 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
11337 (string_char_to_byte, string_byte_to_char)
11338 (string_make_multibyte, string_to_multibyte)
11339 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
11340 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
11341 (substring_both, Fdelete, internal_equal, Ffillarray)
11342 (Fclear_string, mapcar1)
11343 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
11344 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
11345 (larger_vector, make_hash_table, maybe_resize_hash_table)
11346 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
11347 (Fmaphash, secure_hash):
11348 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11349 (concat): Check for string index and length overflow.
11350 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
11351 (Frequire):
11352 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11353 (larger_vector): New API (vec, incr_min, size_max) replaces old
11354 one (vec, new_size, init). This catches size overflow.
11355 INIT was removed because it was always Qnil.
11356 All callers changed.
11357 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
11358 the upper bound on a hash table index size.
11359 (make_hash_table, maybe_resize_hash_table): Use it.
11360 (secure_hash): Computer start_byte and end_byte only after
11361 they're known to be in ptrdiff_t range.
11362 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
11363 (Ffont_get_glyphs, Ffont_at):
11364 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11365 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
11366 (Flist_fonts, Fopen_font):
11367 Don't assume fixnum can fit in int.
11368 (check_gstring): Don't assume index can fit in int.
11369 (font_match_p): Check that fixnum is a character, not a nonnegative
11370 fixnum, since the later code needs to stuff it into an int.
11371 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
11372 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
11373 conversion overflow issues.
11374 (Fopen_font): Check for integer out of range.
11375 (Ffont_get_glyphs): Don't assume index can fit in int.
11376 * font.h: Adjust decls to match defn changes elsewhere.
11377 * fontset.c (reorder_font_vector): Redo score calculation to avoid
11378 integer overflow.
11379 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
11380 printmax_t, where ptrdiff_t is wide enough.
11381 (Finternal_char_font):
11382 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11383 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
11384 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
11385 (Fset_frame_position, x_set_frame_parameters)
11386 (x_set_line_spacing, x_set_border_width)
11387 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
11388 Check that fixnums are in proper range for system types.
11389 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
11390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11391 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
11392 Use SAFE_ALLOCA_LISP, not alloca.
11393 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
11394 intptr_t is wide enough.
11395 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
11396 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
11397 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
11398 Check for fixnum out of range.
11399 * ftfont.c (ftfont_list): Don't assume index fits in int.
11400 Check that fixnums are in proper range for system types.
11401 (ftfont_shape_by_flt):
11402 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
11403 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11404 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11405 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
11406 Check that fixnums are in proper range for system types.
11407 * gnutls.h: Adjust decls to match defn changes elsewhere.
11408 * gtkutil.c (xg_dialog_run):
11409 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11410 (update_frame_tool_bar):
11411 Check that fixnums are in proper range for system types.
11412 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 11413 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
11414 * indent.c (last_known_column, last_known_column_point):
11415 (current_column_bol_cache):
11416 (skip_invisible, current_column, check_display_width):
11417 (check_display_width, scan_for_column, current_column_1)
11418 (Findent_to, Fcurrent_indentation, position_indentation)
11419 (indented_beyond_p, Fmove_to_column, compute_motion):
11420 (Fcompute_motion, Fvertical_motion):
11421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11422 (last_known_column_modified): Use EMACS_INT, not int.
11423 (check_display_width):
11424 (Fcompute_motion):
11425 Check that fixnums and floats are in proper range for system types.
11426 (compute_motion): Don't assume index or fixnum fits in int.
11427 (compute_motion, Fcompute_motion):
11428 Use int, not EMACS_INT, when it is wide enough.
11429 (vmotion): Omit local var start_hpos that is always 0; that way
11430 we don't need to worry about overflow in expressions involving it.
11431 * indent.h: Adjust decls to match defn changes elsewhere.
11432 (struct position):
11433 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11434 Use int, not EMACS_INT, where int is wide enough.
11435 Remove unused members ovstring_chars_done and tab_offset;
11436 all uses removed.
11437 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
11438 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
11439 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
11440 (make_gap, copy_text, insert, insert_and_inherit)
11441 (insert_before_markers, insert_before_markers_and_inherit)
11442 (insert_1, count_combining_before, count_combining_after)
11443 (insert_1_both, insert_from_string)
11444 (insert_from_string_before_markers, insert_from_string_1)
11445 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
11446 (adjust_after_replace, adjust_after_insert, replace_range)
11447 (replace_range_2, del_range, del_range_1, del_range_byte)
11448 (del_range_both, del_range_2, modify_region)
11449 (prepare_to_modify_buffer, signal_before_change)
11450 (signal_after_change, Fcombine_after_change_execute):
11451 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11452 * intervals.c (traverse_intervals, rotate_right, rotate_left)
11453 (balance_an_interval, split_interval_right, split_interval_left)
11454 (find_interval, next_interval, update_interval)
11455 (adjust_intervals_for_insertion, delete_node, delete_interval)
11456 (interval_deletion_adjustment, adjust_intervals_for_deletion)
11457 (static_offset_intervals, offset_intervals)
11458 (merge_interval_right, merge_interval_left, make_new_interval)
11459 (graft_intervals_into_buffer, temp_set_point_both)
11460 (temp_set_point, set_point, adjust_for_invis_intang)
11461 (set_point_both, move_if_not_intangible, get_property_and_range)
11462 (get_local_map, copy_intervals, copy_intervals_to_string)
11463 (compare_string_intervals, set_intervals_multibyte_1):
11464 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11465 * intervals.h: Adjust decls to match defn changes elsewhere.
11466 (struct interval):
11467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11468 * keyboard.c (this_command_key_count, this_single_command_key_start)
11469 (before_command_key_count, before_command_echo_length, echo_now)
11470 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
11471 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
11472 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
11473 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
11474 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11475 (last_non_minibuf_size, last_point_position, echo_truncate)
11476 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
11477 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
11478 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
11479 (stuff_buffered_input):
11480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11481 (last_auto_save, command_loop_1, read_char):
11482 Use EMACS_INT, not int, to avoid integer overflow.
11483 (record_char): Avoid overflow in total_keys computation.
11484 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
11485 * keyboard.h: Adjust decls to match defn changes elsewhere.
11486 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
11487 (Fkey_description, Fdescribe_vector, Flookup_key):
11488 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11489 (click_position): New function, to check that positions are in range.
11490 (Fcurrent_active_maps):
11491 (describe_command):
11492 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11493 (Faccessible_keymaps, Fkey_description):
11494 (preferred_sequence_p):
11495 Don't assume fixnum can fit into int.
11496 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
11497 Check for integer overflow in size calculations.
11498 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
11499 avoid mishandling large integers.
11500 * lisp.h: Adjust decls to match defn changes elsewhere.
11501 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
11502 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
11503 (struct Lisp_Marker):
11504 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11505 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
11506 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
11507 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
11508 All callers changed.
11509 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
11510 Assume the arg has valid form, since it always does.
11511 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
11512 unsigned integer system type.
11513 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
11514 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
11515 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11516 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
11517 (duration_to_sec_usec): New decl.
11518 * lread.c (read_from_string_index, read_from_string_index_byte)
11519 (read_from_string_limit, readchar, unreadchar, openp)
11520 (read_internal_start, read1, oblookup):
11521 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11522 (Fload, readevalloop, Feval_buffer, Feval_region):
11523 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11524 (openp): Check for out-of-range argument to 'access'.
11525 (read1): Use int, not EMACS_INT, where int is wide enough.
11526 Don't assume fixnum fits into int.
6efdadfd 11527 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
11528 (read_filtered_event): Use duration_to_sec_usec
11529 to do proper overflow checking on durations.
d311d28c
PE
11530 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
11531 in size calculation.
11532 (Fexecute_kbd_macro):
11533 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11534 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
11535 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
11536 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
11537 (set_marker_both, set_marker_restricted_both, marker_position)
11538 (marker_byte_position, Fbuffer_has_markers_at):
11539 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11540 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 11541 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
11542 It now merely ensures that the menu is large enough, without
11543 necessarily growing it, as this avoids some integer overflow issues.
11544 All callers changed.
11545 (keymap_panes, parse_single_submenu, Fx_popup_menu):
11546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11547 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
11548 Use SAFE_ALLOCA_LISP, not alloca.
11549 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
11550 to EMACS_INT. Check that fixnums are in proper range for system types.
11551 * minibuf.c (minibuf_prompt_width, string_to_object)
11552 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
11553 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
11554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11555 (get_minibuffer, read_minibuf_unwind):
11556 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11557 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
11558 this simplifies overflow checking. All callers changed.
11559 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
11560 (Ftest_completion):
11561 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11562 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
11563 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
11564 Check that fixnums are in proper range for system types.
11565 (Fx_create_frame, Fx_show_tip):
11566 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11567 * nsfont.m (ns_findfonts, nsfont_list_family):
11568 Don't assume fixnum fits in long.
11569 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
11570 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11571 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
11572 wide enough.
17fdb222 11573 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
11574 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11575 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
11576 (PRINTDECLARE, PRINTPREPARE):
11577 (strout, print_string):
11578 (print, print_preprocess, print_check_string_charset_prop)
11579 (print_object):
11580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11581 (PRINTDECLARE):
11582 (temp_output_buffer_setup, Fprin1_to_string, print_object):
11583 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11584 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 11585 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 11586 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
11587 (print_error_message): Use SAFE_ALLOCA, not alloca.
11588 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
11589 (print_depth, new_backquote_output, print_number_index):
11590 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
11591 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
11592 (Fset_process_window_size, Fformat_network_address)
11593 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 11594 (sigchld_handler):
d311d28c 11595 Check that fixnums are in proper range for system types.
d44287d4 11596 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
11597 Check for process-ids out of pid_t range rather than relying on
11598 undefined behavior.
e4d81efc 11599 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
11600 (Fformat_network_address, read_process_output, send_process)
11601 (Fprocess_send_region, status_notify):
11602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11603 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
11604 (wait_reading_process_output, read_process_output, exec_sentinel):
11605 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11606 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
11607 (Faccept_process_output): Use duration_to_sec_usec to do proper
11608 overflow checking on durations.
dde14581
PE
11609 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
11610 Don't assume pid_t fits in int.
02481186
PE
11611 * process.h (struct Lisp_Process): Members tick and update_tick
11612 are now of type EMACS_INT, not int.
b62b53e8
PE
11613 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
11614 configured --with-wide-int.
d311d28c
PE
11615 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
11616 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
11617 * search.c (looking_at_1, string_match_1):
11618 (fast_string_match, fast_c_string_match_ignore_case)
11619 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
11620 (scan_newline, find_before_next_newline, search_command)
11621 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
11622 (set_search_regs, wordify):
11623 (Freplace_match):
11624 (Fmatch_data):
11625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11626 (string_match_1, search_buffer, set_search_regs):
11627 (Fmatch_data):
11628 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11629 (wordify): Check for overflow in size calculation.
11630 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
11631 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
11632 Check that fixnums are in proper range for system types.
11633 * sound.c (struct sound_device)
11634 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
11635 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11636 (Fplay_sound_internal):
11637 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 11638 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
11639 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
11640 (Fparse_partial_sexp):
11641 Don't assume fixnums can fit in int.
11642 (struct lisp_parse_state, find_start_pos, find_start_value)
11643 (find_start_value_byte, find_start_begv)
11644 (update_syntax_table, char_quoted, dec_bytepos)
11645 (find_defun_start, prev_char_comend_first, back_comment):
11646 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
11647 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
11648 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11649 (Finternal_describe_syntax_value): Check that match_lisp is a
11650 character, not an integer, since the code stuffs it into int.
11651 (scan_words, scan_sexps_forward):
11652 Check that fixnums are in proper range for system types.
11653 (Fforward_word):
11654 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11655 (scan_sexps_forward):
11656 Use CHARACTERP, not INTEGERP, since the value must fit into int.
11657 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
11658 * syntax.h: Adjust decls to match defn changes elsewhere.
11659 (struct gl_state_s):
11660 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
11661 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
11662 MOST_POSITIVE_FIXNUM.
d311d28c
PE
11663 * sysdep.c (wait_for_termination_1, wait_for_termination)
11664 (interruptible_wait_for_termination, mkdir):
11665 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
11666 (emacs_read, emacs_write):
11667 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
11668 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
11669 and double all fit in int.
d311d28c
PE
11670 * term.c (set_tty_color_mode):
11671 Check that fixnums are in proper range for system types.
11672 * termhooks.h (struct input_event):
11673 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11674 * textprop.c (validate_interval_range, interval_of)
11675 (Fadd_text_properties, set_text_properties_1)
11676 (Fremove_text_properties, Fremove_list_of_text_properties)
11677 (Ftext_property_any, Ftext_property_not_all)
11678 (copy_text_properties, text_property_list, extend_property_ranges)
11679 (verify_interval_modification):
11680 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11681 (Fnext_single_char_property_change)
11682 (Fprevious_single_char_property_change):
11683 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
11684 (copy_text_properties):
11685 Check for integer overflow in index calculation.
d311d28c
PE
11686 * undo.c (last_boundary_position, record_point, record_insert)
11687 (record_delete, record_marker_adjustment, record_change)
11688 (record_property_change):
11689 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11690 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
11691 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11692 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11693 (Fx_hide_tip, Fx_file_dialog):
11694 * w32menu.c (set_frame_menubar):
11695 Use ptrdiff_t, not int, for consistency with rest of code.
11696 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
11697 (select_window, Fdelete_other_windows_internal)
11698 (window_scroll_pixel_based, window_scroll_line_based)
11699 (Frecenter, Fset_window_configuration):
11700 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11701 (Fset_window_hscroll, run_window_configuration_change_hook)
11702 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 11703 (Fscroll_other_window, Frecenter):
d311d28c
PE
11704 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11705 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
11706 Don't assume fixnum fits in int.
11707 (Fset_window_scroll_bars):
11708 Check that fixnums are in proper range for system types.
11709 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
11710 (string_pos, c_string_pos, number_of_chars, init_iterator)
11711 (in_ellipses_for_invisible_text_p, init_from_display_pos)
11712 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
11713 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
11714 (face_before_or_after_it_pos, handle_invisible_prop)
11715 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
11716 (display_prop_intangible_p, string_buffer_position_lim)
11717 (string_buffer_position, handle_composition_prop, load_overlay_strings)
11718 (get_overlay_strings_1, get_overlay_strings)
11719 (iterate_out_of_display_property, forward_to_next_line_start)
11720 (back_to_previous_visible_line_start, reseat, reseat_to_string)
11721 (get_next_display_element, set_iterator_to_next)
11722 (get_visually_first_element, compute_stop_pos_backwards)
11723 (handle_stop_backwards, next_element_from_buffer)
11724 (move_it_in_display_line_to, move_it_in_display_line)
11725 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11726 (add_to_log, message_dolog, message_log_check_duplicate)
11727 (message2, message2_nolog, message3, message3_nolog
11728 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
11729 (current_message_1, truncate_echo_area, truncate_message_1)
11730 (set_message, set_message_1, store_mode_line_noprop)
11731 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
11732 (text_outside_line_unchanged_p, check_point_in_composition)
11733 (reconsider_clip_changes)
11734 (redisplay_internal, set_cursor_from_row, try_scrolling)
11735 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
11736 (redisplay_window, find_last_unchanged_at_beg_row)
11737 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
11738 (trailing_whitespace_p, find_row_edges, display_line)
11739 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
11740 (display_mode_element, store_mode_line_string)
11741 (pint2str, pint2hrstr, decode_mode_spec)
11742 (display_count_lines, display_string, draw_glyphs)
11743 (x_produce_glyphs, x_insert_glyphs)
11744 (rows_from_pos_range, mouse_face_from_buffer_pos)
11745 (fast_find_string_pos, mouse_face_from_string_pos)
11746 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11748 (safe_call, init_from_display_pos, handle_fontified_prop)
11749 (handle_single_display_spec, load_overlay_strings)
11750 (with_echo_area_buffer, setup_echo_area_for_printing)
11751 (display_echo_area, echo_area_display)
11752 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
11753 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
11754 (redisplay_window, dump_glyph_row, display_mode_line)
11755 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 11756 (handle_display_spec, display_prop_string_p):
d311d28c
PE
11757 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11758 (handle_single_display_spec, build_desired_tool_bar_string)
11759 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
11760 (get_specified_cursor_type):
11761 Check that fixnums are in proper range for system types.
11762 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
11763 (Flookup_image_map):
11764 Don't assume fixnums fit in int.
11765 (compare_overlay_entries):
11766 Avoid mishandling comparisons due to subtraction overflow.
11767 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
11768 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
11769 (handle_tool_bar_click):
11770 Use int, not unsigned, since we prefer signed and the signedness
11771 doesn't matter here.
11772 (get_next_display_element, next_element_from_display_vector):
11773 Use int, not EMACS_INT, when int is wide enough.
11774 (start_hourglass): Use duration_to_sec_usec to do proper
11775 overflow checking on durations.
11776 * xfaces.c (Fbitmap_spec_p):
11777 Check that fixnums are in proper range for system types.
11778 (compare_fonts_by_sort_order):
11779 Avoid mishandling comparisons due to subtraction overflow.
11780 (Fx_family_fonts, realize_basic_faces):
11781 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11782 (Fx_family_fonts):
11783 Don't assume fixnum fits in int.
11784 Use SAFE_ALLOCA_LISP, not alloca.
11785 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
11786 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
11787 (face_at_buffer_position, face_for_overlay_string)
11788 (face_at_string_position):
11789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11790 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
11791 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
11792 (Fx_show_tip):
11793 Check that fixnums are in proper range for system types.
11794 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11795 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
11796 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11797 (Fx_change_window_property): Don't assume fixnums fit in int.
11798 * xfont.c (xfont_chars_supported):
11799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11800 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
11801 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
11802 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11803 * xml.c (parse_region):
11804 * xrdb.c (magic_file_p):
11805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11806 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
11807 (x_get_local_selection, x_reply_selection_request)
11808 (x_handle_selection_request, wait_for_property_change):
11809 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11810 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
11811 short is wide enough.
11812 (x_send_client_event): Don't assume fixnum fits in int.
11813 * xterm.c (x_x_to_emacs_modifiers):
11814 Don't assume EMACS_INT overflows nicely into int.
11815 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
11816 may come from Lisp.
11817 (handle_one_xevent): NATNUMP can eval its arg twice.
11818 (x_connection_closed):
11819 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11820 * xterm.h: Adjust decls to match defn changes elsewhere.
11821 (struct scroll_bar): Use struct vectorlike_header
11822 rather than rolling our own approximation.
11823 (SCROLL_BAR_VEC_SIZE): Remove; not used.
11824
c6574eb5
GM
118252012-05-25 Glenn Morris <rgm@gnu.org>
11826
11827 * lisp.mk (lisp): Update for more files being compiled now.
11828
e8d32c7e
SM
118292012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
11830
48def666
SM
11831 * lread.c: Remove `read_pure' which makes no difference.
11832 (read_pure): Remove var.
11833 (unreadpure): Remove function.
11834 (readevalloop): Don't call read_list with -1 flag.
11835 (read1, read_vector): Don't test read_pure any more.
11836 (read_list): Simplify.
11837
e8d32c7e
SM
11838 * fileio.c, character.h: Minor style tweaks.
11839
4b2addb7
DA
118402012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
11841
11842 * window.h (clip_changed): Remove useless declaration.
11843
584461b2
JB
118442012-05-22 Juanma Barranquero <lekktu@gmail.com>
11845
11846 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
11847 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
11848
34374650
PE
118492012-05-22 Paul Eggert <eggert@cs.ucla.edu>
11850
11851 Remove src/m/*.
11852 This directory predates autoconf and is no longer needed nowadays.
11853 Move its few remaining bits of functionality to where they're needed.
11854 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
11855 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
11856 * m/template.h: Remove.
11857 * Makefile.in (M_FILE): Remove. All uses removed.
11858 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
11859 * lisp.h (USE_LSB_TAG):
11860 * mem-limits.h (EXCEEDS_LISP_PTR):
11861 Use VAL_MAX, not VALBITS, in #if.
11862 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
11863 (EMACS_UINT): Define unconditionally now.
11864 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
11865 (BITS_PER_EMACS_INT): New constants, replacing
11866 what used to be in config.h, but not useful in #if.
11867 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
11868 define them any more.
11869 (VAL_MAX): New macro.
11870 (VALMASK): Use it.
11871 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
11872 BITS_PER_EMACS_INT, in #if.
11873 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11874 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
11875 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
11876 * s/ms-w32.h (DATA_START):
11877 Move here from removed file m/intel386.h.
11878 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
11879 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
11880
261cb4bb
PE
118812012-05-21 Paul Eggert <eggert@cs.ucla.edu>
11882
11883 Assume C89 or later.
11884 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
11885 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
11886 (xrealloc):
11887 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
11888 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
11889 * textprop.c, tparam.c (NULL): Remove.
11890 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
11891 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
11892 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
11893 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
11894 * xterm.c (input_signal_count): Assume volatile works.
11895
ff23cd9f
KB
118962012-05-21 Ken Brown <kbrown@cornell.edu>
11897
11898 * xgselect.c (xg_select): Fix first argument in call to 'select'
11899 (bug#11508).
11900
1b170bc6
KB
119012012-05-20 Ken Brown <kbrown@cornell.edu>
11902
11903 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 11904 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 11905
b2f4d39f
KB
119062012-05-19 Ken Brown <kbrown@cornell.edu>
11907
11908 * xfns.c (x_in_use): Remove `static' qualifier.
11909 * xterm.h (x_in_use): Declare.
11910 * xgselect.c: Include xterm.h.
11911 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
11912 and `display_arg' (bug#9754).
11913
003fdae2
PE
119142012-05-19 Paul Eggert <eggert@cs.ucla.edu>
11915
9232a6d9
PE
11916 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
11917
003fdae2
PE
11918 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
11919 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
11920
784b56e2
EZ
119212012-05-18 Eli Zaretskii <eliz@gnu.org>
11922
11923 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
11924
11925 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 11926 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
11927
11928 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
11929 reference to image_cache->refcount.
11930 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
11931
a0a79cde
JL
119322012-05-17 Juri Linkov <juri@jurta.org>
11933
11934 * search.c (Fword_search_regexp, Fword_search_backward)
11935 (Fword_search_forward, Fword_search_backward_lax)
11936 (Fword_search_forward_lax): Move functions to isearch.el
11937 (bug#10145, bug#11381).
11938
b0572523
PE
119392012-05-16 Paul Eggert <eggert@cs.ucla.edu>
11940
11941 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
11942
9660f5fc
SM
119432012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
11944
11945 * lread.c (init_obarray): Declare Qt and Qnil as special.
11946
4374de83
GM
119472012-05-14 Glenn Morris <rgm@gnu.org>
11948
11949 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 11950 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 11951
dc44c39a
PE
119522012-05-14 Paul Eggert <eggert@cs.ucla.edu>
11953
078c97cb
PE
11954 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
11955
dc44c39a
PE
11956 * unexaix.c: Port to more-recent AIX compilers.
11957 (report_error, report_error_1, make_hdr, copy_sym)
11958 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
11959 Make arguments const char *, not char *, to avoid violations of C
11960 standard and to fix some AIX warnings reported by Gilles Pion.
11961
e18afed7 119622012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
11963
11964 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
11965 already have overlays loaded.
11966 (handle_single_display_spec): Before returning without displaying
11967 fringe bitmap, synchronize the bidi iterator with the main display
11968 iterator, by calling iterate_out_of_display_property.
11969 (iterate_out_of_display_property): Detect buffer iteration by
11970 testing that it->string is a Lisp string.
11971 (get_next_display_element): When the current object is exhausted,
11972 and there's something on it->stack, call set_iterator_to_next to
11973 proceed with what's on the stack, instead of returning zero.
11974 (set_iterator_to_next): If called at the end of a Lisp string,
11975 proceed to consider_string_end without incrementing string
11976 position. Don't increment display vector index past the end of
11977 the display vector. (Bug#11417)
c8fb9dc6
EZ
11978 (pos_visible_p): Don't report a position visible when move_it_to
11979 stopped at the last line of window, which happens to be scanned
11980 backwards by the bidi iteration. (Bug#11464)
ac268e67 11981
e18afed7 119822012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
11983
11984 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
11985 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
11986 are on a TTY, and thus unable to display on the fringes.
11987 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
11988 so we need to signal to the caller that this is a "replacing"
11989 display spec. This fixes display when the spec is invalid or we
11990 are on a TTY.
11991
e18afed7 119922012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
11993
11994 * unexaix.c (make_hdr): Fix typo in prototype.
11995 This bug broke the build on AIX. Problem reported by Gilles Pion.
11996
9d0a235a
MA
119972012-05-14 Michael Albinus <michael.albinus@gmx.de>
11998
11999 * keyboard.c (kbd_buffer_get_event): Read special events also in
12000 batch mode. (Bug#11415)
12001
9e6b06ed
GM
120022012-05-12 Glenn Morris <rgm@gnu.org>
12003
12004 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12005
c1a1d7a3
EZ
120062012-05-12 Eli Zaretskii <eliz@gnu.org>
12007
12008 * lisp.mk (lisp): Add newcomment.elc.
12009
3fe7cdc8
GM
120102012-05-12 Glenn Morris <rgm@gnu.org>
12011
12012 * Makefile.in (MKDIR_P): New, set by configure.
12013 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12014
53f7d2c0
PE
120152012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12016
12017 Remove unused function hourglass_started.
12018 * dispextern.h (hourglass_started):
12019 * w32fns.c (hourglass_started):
12020 * xdisp.c (hourglass_started): Remove.
12021
75aafb17
JB
120222012-05-10 Juanma Barranquero <lekktu@gmail.com>
12023
12024 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12025 Update dependencies.
12026
12959e8e
PE
120272012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12028
97107e2e
PE
12029 * xgselect.c (xg_select): Put maxfds+1 into a var.
12030 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12031
12959e8e
PE
12032 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12033
836d29b3
DA
120342012-05-10 Dave Abrahams <dave@boostpro.com>
12035
12036 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12037 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12038
5cb67954
MA
120392012-05-09 Michael Albinus <michael.albinus@gmx.de>
12040
12041 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 12042 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
12043 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12044 Initialize xd_registered_buses.
12045
3478ec45
PE
120462012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12047
b263a6b0
PE
12048 Untag more efficiently if USE_LSB_TAG.
12049 This is based on a proposal by YAMAMOTO Mitsuharu in
12050 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12051 For an admittedly artificial (nth 8000 longlist) benchmark on
12052 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12053 Emacs's overall text size by 1%.
12054 * lisp.h (XUNTAG): New macro.
12055 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12056 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12057 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12058 * eval.c (Fautoload):
12059 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12060 * frame.h (XFRAME): Use XUNTAG.
12061
3478ec45
PE
12062 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12063 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12064 Remove unportable assumptions about print widths of types like
12065 dbus_uint32_t.
12066 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12067 intptr_t when converting between pointer and integer, to avoid GCC
12068 warnings about wrong width.
12069
666b903b 120702012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
12071
12072 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12073 stack for each reader_thread, instead of defaulting to 8MB
12074 determined by the linker. This avoids failures in creating
12075 subprocesses on Windows 7, see the discussion in this thread:
12076 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12077
b120cc17
JC
120782012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12079
12080 Fix up display of the *Minibuf-0* buffer in the mini window.
12081 * keyboard.c (read_char): Don't clear the echo area if there's no
12082 message to clear.
12083 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 12084 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 12085
9a4b36f8
MA
120862012-05-07 Michael Albinus <michael.albinus@gmx.de>
12087
12088 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12089 batch mode.
12090
e5f9458f
CY
120912012-05-06 Chong Yidong <cyd@gnu.org>
12092
12093 * lisp.mk (lisp): Update.
12094
eceeb5fc 120952012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
12096
12097 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12098
71873e2b
SM
120992012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12100
12101 * data.c (PUT_ERROR): New macro.
12102 (syms_of_data): Use it. Add new error type `user-error'.
12103 * undo.c (user_error): New function.
12104 (Fprimitive_undo): Use it.
12105 * print.c (print_error_message): Adjust print style for `user-error'.
12106 * keyboard.c (user_error): New function.
12107 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12108
ab0fa4e4
PE
121092012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12110
12111 Do not limit current-time-string to years 1000..9999.
12112 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12113 (Fcurrent_time_string): Support any year that is supported by the
12114 underlying localtime representation. Don't use asctime, as it
12115 has undefined behavior for years outside the range -999..9999.
12116
7ed806a7
PE
121172012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12118
12119 Fix race conditions involving setenv, gmtime, localtime, asctime.
12120 Without this fix, interrupts could mess up code that uses these
12121 nonreentrant functions, since setting TZ invalidates existing
12122 tm_zone or tzname values, and since most of these functions return
12123 pointers to static storage.
12124 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12125 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12126 Grow the critical sections to include not just invoking
12127 localtime/gmtime, but also accessing these functions' results
12128 including their tm_zone values if any, and any related TZ setting.
12129 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
12130 so that the struct tm is saved in the critical section.
12131 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
12132 motivated by the fact that memory allocation needs to be outside
12133 the critical section.
12134
0c16dfed
DA
121352012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12136
12137 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12138 with RESET_INTERVAL.
12139
12140 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12141 Remove duplicated buffer name initialization.
12142
3f83ace8
JM
121432012-05-02 Jim Meyering <jim@meyering.net>
12144
12145 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12146
c7b8541e
JM
12147 * xfns.c (x_window): Use xstrdup (Bug#11375).
12148
90207a15 121492012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
12150
12151 * xdisp.c (pos_visible_p): If already at a newline from the
12152 display string before the 'while' loop, don't walk back the glyphs
12153 from it3.glyph_row. Solves assertion violation when the display
12154 string begins with a newline (egg.el). (Bug#11367)
12155
b593d6a9
AH
121562012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12157
12158 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12159 Move to simple.el.
12160
4737362e
GM
121612012-05-01 Glenn Morris <rgm@gnu.org>
12162
99cf43f9
GM
12163 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12164 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12165 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12166 All were removed before 23.1.
12167
9311dcff
GM
12168 * dispnew.c: Remove HAVE_LIBNCURSES test;
12169 it is always true on relevant platforms.
12170
4d5c6349
GM
12171 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12172 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12173
4737362e
GM
12174 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12175
74dd3a6b
AS
121762012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12177
12178 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12179 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12180 Remove.
12181
13c379ee
PE
121822012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12183
12184 Do not avoid creating empty evaporating overlays (Bug#9642).
12185 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12186 That is, do not delete an evaporating overlay if it becomes
12187 empty after its bounds are adjusted to fit within its buffer.
12188 This fix caused other problems, and I'm reverting it until we get
12189 to the bottom of them.
12190
a8e7d6d7 121912012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
12192
12193 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12194
a8e7d6d7 121952012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
12196
12197 * xdisp.c (pos_visible_p): If the window start position is beyond
12198 ZV, start the display from buffer beginning. Prevents assertion
12199 violation in init_iterator when the minibuffer window is scrolled
12200 via the scroll bar.
12201
12202 * window.c (window_scroll_pixel_based): Likewise.
12203
a8e7d6d7 122042012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
12205
12206 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12207
a8e7d6d7 122082012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
12209
12210 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12211 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12212
a8e7d6d7 122132012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 12214
b593d6a9
AH
12215 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12216 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 12217
1c6900d9
EZ
122182012-04-26 Eli Zaretskii <eliz@gnu.org>
12219
4c3fa1d9
EZ
12220 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12221 display element, check also the underlying string or buffer
12222 character. (Bug#11341)
12223
1c6900d9
EZ
12224 * w32menu.c: Include w32heap.h.
12225 (add_menu_item): If the call to AppendMenuW (via
12226 unicode_append_menu) fails, disable Unicode menus only if we are
12227 running on Windows 9X/Me.
12228
42bf8205
AS
122292012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12230
12231 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12232 (xgetint): Add missing shift for LSB tags.
12233
b1bac16e
MR
122342012-04-24 Martin Rudalics <rudalics@gmx.at>
12235
12236 * keyboard.c (read_char): Don't wipe echo area for select window
12237 events: These might get delayed via `mouse-autoselect-window'
12238 (Bug#11304).
12239
d69621cc
JB
122402012-04-24 Juanma Barranquero <lekktu@gmail.com>
12241
12242 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12243 manipulation of :loaded-from data.
12244
02fd101b
JB
122452012-04-23 Juanma Barranquero <lekktu@gmail.com>
12246
12247 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12248 now a cons (bug#11311).
12249
888bec30
PE
122502012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12251
89a438bd
PE
12252 Do not create empty overlays with the evaporate property (Bug#9642).
12253 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12254 if it becomes empty after its bounds are adjusted to fit within
12255 its buffer. Without this fix, in a nonempty buffer (let ((o
12256 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12257 yields an empty overlay that has the evaporate property, which is
12258 not supposed to happen.
12259
1068fe4d
PE
12260 Fix minor GTK3 problems found by static checking.
12261 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12262 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12263 (struct _EmacsFixedClass, emacs_fixed_get_type):
12264 Move decls here from emacsgtkfixed.h, since they needn't be public.
12265 (emacs_fixed_get_type): Now static.
12266 (emacs_fixed_class_init): Omit unused local.
12267 (emacs_fixed_child_type): Remove; unused.
12268 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12269 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12270 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12271 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12272 (EMACS_FIXED_GET_CLASS): Remove; unused.
12273 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12274
888bec30
PE
12275 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12276 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12277
de85e130
PE
122782012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12279
d0baac98 12280 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 12281 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
12282 (__malloc_size_t, __malloc_ptrdiff_t):
12283 Remove. All uses removed, replaced by the definiens if needed,
12284 since we can assume C89 or better now.
12285 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12286 (protect_malloc_state, align, get_contiguous_space)
12287 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12288 (malloc_atfork_handler_child, malloc_enable_thread)
12289 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12290 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
12291 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
12292 (special_realloc, _realloc_internal_nolock, _realloc_internal)
12293 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
12294 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
12295 Define using prototypes, not old style.
12296 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
12297 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
12298 (align): Don't assume that signed integer overflow wraps around.
12299 Omit unused local var.
12300 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
12301 (_free_internal_nolock, memalign, mallochook, reallochook):
12302 Omit no-longer-needed casts.
12303 (valloc): Use getpagesize, not __getpagesize.
12304 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
12305 (struct hdr): The 'magic' member is now size_t, not unsigned long.
12306
de85e130
PE
12307 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
12308
dcbf5805
MA
123092012-04-22 Michael Albinus <michael.albinus@gmx.de>
12310
12311 Move functions from C to Lisp. Make non-blocking method calls
12312 the default. Implement further D-Bus standard interfaces.
12313
12314 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
12315 (QCdbus_request_name_allow_replacement)
12316 (QCdbus_request_name_replace_existing)
12317 (QCdbus_request_name_do_not_queue)
12318 (QCdbus_request_name_reply_primary_owner)
12319 (QCdbus_request_name_reply_in_queue)
12320 (QCdbus_request_name_reply_exists)
12321 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
12322 (QCdbus_registered_serial, QCdbus_registered_method)
12323 (QCdbus_registered_signal): New Lisp objects.
12324 (XD_DEBUG_MESSAGE): Use sizeof.
12325 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
12326 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
12327 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
12328 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
12329 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
12330 (xd_signature, xd_append_arg): Allow float for integer types.
12331 (xd_get_connection_references): New function.
b593d6a9
AH
12332 (xd_get_connection_address): Rename from xd_initialize.
12333 Return cached address.
dcbf5805
MA
12334 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
12335 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
12336 level.
12337 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 12338 Return number of refcounts.
dcbf5805
MA
12339 (Fdbus_get_unique_name): Make stronger parameter check.
12340 (Fdbus_message_internal): New defun.
12341 (Fdbus_call_method, Fdbus_call_method_asynchronously)
12342 (Fdbus_method_return_internal, Fdbus_method_error_internal)
12343 (Fdbus_send_signal, Fdbus_register_service)
12344 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
12345 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
12346 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
12347 (Vdbus_compiled_version, Vdbus_runtime_version)
12348 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
12349 (Vdbus_message_type_method_return, Vdbus_message_type_error)
12350 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
12351 (Vdbus_registered_buses, Vdbus_registered_objects_table):
12352 Adapt docstring.
dcbf5805 12353
52828e02
PE
123542012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12355
da05bc4c
PE
12356 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
12357 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
12358 Do not assume ptrdiff_t is the same width as 'int'.
12359
52828e02
PE
12360 * alloc.c: Handle unusual debugging option combinations.
12361 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
12362 since the two debugging options are incompatible.
12363 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
12364 is defined.
12365 (mem_init, mem_insert, mem_insert_fixup):
12366 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
12367 (NEED_MEM_INSERT): Remove; no longer needed.
12368
f01769f9
LL
123692012-04-22 Leo Liu <sdl.web@gmail.com>
12370
12371 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
12372
5790543d
PE
123732012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12374
12375 * sysdep.c [__FreeBSD__]: Minor cleanups.
12376 (list_system_processes, system_process_attributes) [__FreeBSD__]:
12377 Use Emacs indenting style more consistently. Avoid some casts.
12378 Use 'double' consistently rather than mixing 'float' and 'double'.
12379
b91b7e4d
EW
123802012-04-21 Eduard Wiebe <usenet@pusto.de>
12381
b593d6a9
AH
12382 * sysdep.c (list_system_processes, system_process_attributes):
12383 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 12384
6114eb15
AS
123852012-04-21 Andreas Schwab <schwab@linux-m68k.org>
12386
12387 * lisp.mk (lisp): Update.
12388
2f38dff7
PE
123892012-04-20 Paul Eggert <eggert@cs.ucla.edu>
12390
12391 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
12392 It is never used otherwise.
12393
4ae29f89
SM
123942012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
12395
12396 * print.c (print_preprocess): Only check print_depth if print-circle
12397 is nil.
12398 (print_object): Check for cycles even when print-circle is nil and
12399 print-gensym is t, but only check print_depth if print-circle is nil.
12400
f30d612a
CY
124012012-04-20 Chong Yidong <cyd@gnu.org>
12402
12403 * process.c (wait_reading_process_output): If EIO occurs on a pty,
12404 set the status to "failed" and ensure that sentinel is run.
12405
c07a4c0b 124062012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
12407
12408 * process.c (Fset_process_inherit_coding_system_flag)
12409 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 12410 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 12411
c07a4c0b 124122012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
12413
12414 * xdisp.c (string_buffer_position_lim): Limit starting position to
12415 BEGV.
12416 (set_cursor_from_row): If called for a mode-line or header-line
12417 row, return zero immediately.
12418 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
12419 farther than the first row after the header line, if any.
12420 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
12421 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
12422
c07a4c0b 124232012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 12424
4ae29f89
SM
12425 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
12426 (bug#11238).
ad3a2b41 12427
c07a4c0b 124282012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 124292012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
12430
12431 configure: new option --enable-gcc-warnings (Bug#11207)
12432 * Makefile.in (C_WARNINGS_SWITCH): Remove.
12433 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
12434 (ALL_CFLAGS): Use new macros rather than old.
12435 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
12436 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
12437 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
12438 -Wunused-result, -Wunused-variable. This should go away once
12439 the Emacs and Gnulib regex code is merged.
12440 (xmalloc, xrealloc): Now static.
12441
aba027e8
PE
124422012-04-17 Paul Eggert <eggert@cs.ucla.edu>
12443
12444 * dired.c (Fsystem_groups): Remove unused local.
12445
e5a36063
GM
124462012-04-17 Glenn Morris <rgm@gnu.org>
12447
12448 * dired.c (Fsystem_users): Doc fix.
12449
316411f0
DA
124502012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
12451
12452 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
12453 (syms_of_dired): Add them.
12454
9426aba4
PE
124552012-04-16 Paul Eggert <eggert@cs.ucla.edu>
12456
b62a57be
PE
12457 Fix minor alloc.c problems found by static checking.
12458 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
12459 New extern decls, to avoid calling undeclared functions.
12460 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
12461 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
12462 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
12463 (NEED_MEM_INSERT): New macro.
12464 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 12465 Remove one incorrect comment and fix another.
b62a57be 12466
3539f31f
PE
12467 Fix minor ralloc.c problems found by static checking.
12468 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12469 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
12470 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
12471 (r_alloc_sbrk): Now static.
12472
a041960a
PE
12473 Improve ralloc.c interface checking.
12474 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12475 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
12476 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
12477 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
12478 [REL_ALLOC]: ... to here, to check interface.
12479 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
12480 Remove decls. This fixes an "It stinks!".
12481
9426aba4
PE
12482 * alloc.c (which_symbols): Fix alignment issue / type clash.
12483
d55c12ed
AS
124842012-04-15 Andreas Schwab <schwab@linux-m68k.org>
12485
12486 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
12487 (struct Lisp_Misc_Any): Likewise.
12488 (struct Lisp_Free): Likewise.
12489 * alloc.c (union aligned_Lisp_Symbol): Define.
12490 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
12491 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
12492 (union aligned_Lisp_Misc): Define.
12493 (MARKER_BLOCK_SIZE, struct marker_block): Use union
12494 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 12495 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 12496
b948ce8b
PE
124972012-04-14 Paul Eggert <eggert@cs.ucla.edu>
12498
12499 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
12500 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
12501 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
12502 * s/netbsd.h, s/sol2-6.h:
12503 Remove definition of GC_MARK_STACK, since the default now works.
12504 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
12505 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
12506 no longer the default.
12507 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
12508
35dc09a1 125092012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 12510
35dc09a1
GM
12511 * lread.c (lisp_file_lexically_bound_p):
12512 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 12513
35dc09a1
GM
125142012-04-14 Eli Zaretskii <eliz@gnu.org>
12515
12516 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
12517 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
12518
125192012-04-14 Jan Djärv <jan.h.d@swipnet.se>
12520
12521 * nsterm.m (constrainFrameRect): Always constrain when there is only
12522 one screen (Bug#10962).
12523
bcd86815
KB
125242012-04-13 Ken Brown <kbrown@cornell.edu>
12525
12526 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
12527
c25df26e
RT
125282012-04-13 Reuben Thomas <rrt@sc3d.org>
12529
12530 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
12531
0fc59f1e
DC
125322012-04-11 Daniel Colascione <dancol@dancol.org>
12533
12534 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
12535 against is gone. It's better to use vfork now so that when Cygwin
12536 gains a new, working vfork, we use it automatically (bug#10398).
12537
de8c03dc
SM
125382012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12539
12540 * window.c (save_window_save): Obey window-point-insertion-type.
12541
2f097256
GM
125422012-04-11 Glenn Morris <rgm@gnu.org>
12543
12544 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
12545
453b951e
SM
125462012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12547
12548 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
12549
75f1671a 125502012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
12551
12552 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
12553 (force_quit_count): New var.
12554 (handle_interrupt): Use it.
12555
2a8ce227
JB
125562012-04-10 Juanma Barranquero <lekktu@gmail.com>
12557
12558 * w32.c (w32_delayed_load): Record the full path of the library
12559 being loaded (bug#10424).
12560
935396c0
GM
125612012-04-09 Glenn Morris <rgm@gnu.org>
12562
05920a43
GM
12563 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
12564 not just in the obarray, before snarfing them. (Bug#11036)
12565
935396c0
GM
12566 * Makefile.in ($(leimdir)/leim-list.el):
12567 Pass EMACS rather than BUILT_EMACS.
12568
a18ecafa
TZ
125692012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
12570
12571 * process.c (make_process):
12572 * process.h: Add integer `gnutls_handshakes_tried' member to
12573 process struct.
12574
6bbef4e5
JC
12575 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
12576 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
12577
12578 * gnutls.c (gnutls_log_function2i): Convenience log function.
12579 (emacs_gnutls_read): Use new log functions,
12580 `gnutls_handshakes_tried' process member, and
12581 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
12582 attempts per process (connection).
12583
b4d3bc10
CY
125842012-04-09 Chong Yidong <cyd@gnu.org>
12585
12586 * eval.c (Fuser_variable_p, user_variable_p_eh)
12587 (lisp_indirect_variable): Functions deleted.
12588 (Fdefvar): Caller changed.
12589
12590 * callint.c (Finteractive, Fcall_interactively):
12591 * minibuf.c (Fread_variable): Callers changed.
12592
70f4d973
EZ
125932012-04-09 Eli Zaretskii <eliz@gnu.org>
12594
12595 * xdisp.c (set_cursor_from_row): If the display string appears in
12596 the buffer at position that is closer to point than the position
12597 after the display string, display the cursor on the first glyph of
12598 the display string. Fixes cursor display when a 'display' text
12599 property immediately follows invisible text. (Bug#11094)
12600
cb3c2e3e
PE
126012012-04-09 Paul Eggert <eggert@cs.ucla.edu>
12602
12603 composite.c: use 'double' consistently
12604 * composite.c (get_composition_id): Use 'double' consistently
12605 instead of converting 'float' to 'double' and vice versa; this is
12606 easier to understand and avoids a GCC warning.
12607
fd06db5d
GM
126082012-04-09 Glenn Morris <rgm@gnu.org>
12609
50fe702a
GM
12610 * Makefile.in: Generate leim-list with bootstrap-emacs, in
12611 preparation for dumping it with emacs. (Bug#4789)
12612 (leimdir): New variable.
12613 ($(leimdir)/leim-list.el): New rule.
12614 (emacs$(EXEEXT)): Depend on leim-list.el.
12615
fd06db5d
GM
12616 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
12617 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
12618 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
12619
55c131ee
AS
126202012-04-08 Andreas Schwab <schwab@linux-m68k.org>
12621
12622 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
12623 proper alignment.
12624
9209588f
JB
126252012-04-07 Juanma Barranquero <lekktu@gmail.com>
12626
12627 * xml.c (init_libxml2_functions) [WINDOWSNT]:
12628 Remove unused local variable.
12629
e3fb2efb
PE
126302012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12631
12632 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
12633 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
12634 (mark_memory): Mark Lisp_Objects only if pointers might hide in
12635 objects, as mark_maybe_pointer will catch them otherwise.
12636 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
12637 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
12638
b5385551
PE
126392012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12640
12641 Fix typo that broke non-Windows builds.
12642 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
12643
9078ead6
EZ
126442012-04-07 Eli Zaretskii <eliz@gnu.org>
12645
12646 Support building on MS-Windows with libxml2.
12647
12648 * makefile.w32-in (OBJ2): Add xml.$(O).
12649 (GLOBAL_SOURCES): Add xml.c.
12650 ($(BLD)/xml.$(O)): New dependency list.
12651
12652 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
12653 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
12654 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
12655 [!WINDOWSNT]: New macros.
12656 (init_libxml2_functions, libxml2_loaded_p): New functions.
12657 (parse_region): Call fn_xmlCheckVersion instead of using the macro
12658 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
12659 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
12660 Calls xmlCleanupParser only if libxml2 was loaded (or statically
12661 linked in).
6bbef4e5
JC
12662 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
12663 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
12664 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
12665
12666 * emacs.c: Don't include libxml/parser.h.
12667 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
12668 xmlCleanupParser directly.
12669
12670 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
12671
3811fdf3
EZ
126722012-04-07 Eli Zaretskii <eliz@gnu.org>
12673
12674 * indent.c (Fvertical_motion): If there is a display string at
12675 point, use it.vpos to compute how many lines to backtrack after
12676 move_it_to point. (Bug#11133)
12677
2f8e16b2
EZ
126782012-04-06 Eli Zaretskii <eliz@gnu.org>
12679
12680 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
12681 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
12682 about subtle differences between FETCH_CHAR* and STRING_CHAR*
12683 macros related to unification of CJK characters. For the details,
12684 see the discussion following the message here:
12685 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
12686
3d439cd1
CY
126872012-04-04 Chong Yidong <cyd@gnu.org>
12688
12689 * keyboard.c (Vdelayed_warnings_list): Doc fix.
12690
8bc53d00
EZ
126912012-04-01 Eli Zaretskii <eliz@gnu.org>
12692
12693 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
12694 instead of alloca. (Bug#11138)
12695
3b0512a3
AS
126962012-04-01 Andreas Schwab <schwab@linux-m68k.org>
12697
12698 * w32menu.c (is_simple_dialog): Properly check lisp types.
12699 (Bug#11141)
12700
8427ddd2
EZ
127012012-03-31 Eli Zaretskii <eliz@gnu.org>
12702
979022ef
EZ
12703 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
12704 position we get to after a call to move_it_to fails the
12705 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
12706 only if we wind up in a string from display property. (Bug#11063)
12707
a6b1c7cc
EZ
12708 * window.c (Fdelete_other_windows_internal): Invalidate the row
12709 and column information about mouse highlight, so that redisplay
12710 restores it after reallocating the glyph matrices. (Bug#7464)
12711
8427ddd2
EZ
12712 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
12713 string comes from a `display' text property, use the buffer
12714 position of that property as if we actually saw that position in
12715 the row's glyphs.
697ba24b
EZ
12716 (move_it_by_lines): Remove the assertion that
12717 "it->current_x == 0 && it->hpos == 0" which can be legitimately
12718 violated when there's a before-string at the beginning of a line.
12719 (Bug#11063)
8427ddd2 12720
65a0a738
EZ
127212012-03-30 Eli Zaretskii <eliz@gnu.org>
12722
12723 * xdisp.c (append_space_for_newline): If the default face was
12724 remapped, use the remapped face for the appended newline.
12725 (extend_face_to_end_of_line): Use the remapped default face for
12726 extending the face to the end of the line.
12727 (display_line): Call extend_face_to_end_of_line when the default
12728 face was remapped. (Bug#11068)
12729
581355cc
EZ
127302012-03-29 Eli Zaretskii <eliz@gnu.org>
12731
12732 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
12733
e8fc049f
SM
127342012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12735
12736 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
12737
4fb9a543
GM
127382012-03-27 Glenn Morris <rgm@gnu.org>
12739
12740 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
12741 Doc fixes.
12742
679910f1
KH
127432012-03-26 Kenichi Handa <handa@m17n.org>
12744
12745 * dispextern.h (struct glyph): Fix previous change. Change the
12746 bit length of glyphless.ch to 25 (Bug#11082).
12747
90d49b7f
CY
127482012-03-26 Chong Yidong <cyd@gnu.org>
12749
12750 * keyboard.c (Vselection_inhibit_update_commands): New variable.
12751 (command_loop_1): Use it; inhibit selection update for
12752 handle-select-window too (Bug#8996).
12753
f514f6f0
FP
127542012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
12755
e8fc049f 12756 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 12757
bf43fa51
KH
127582012-03-25 Kenichi Handa <handa@m17n.org>
12759
12760 * dispextern.h (struct glyph): Change the bit length of
12761 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
12762
8a0c01dd
EZ
127632012-03-24 Eli Zaretskii <eliz@gnu.org>
12764
12765 * s/ms-w32.h (tzname): Include time.h before redirecting to
12766 _tzname. Fixes the MSVC build. (Bug#9960)
12767
7d1c3a76
AS
127682012-03-24 Andreas Schwab <schwab@linux-m68k.org>
12769
8ed79523
AS
12770 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
12771 characters.
12772
7d1c3a76
AS
12773 * xterm.c (XTread_socket): Only modify handling_signal if
12774 !SYNC_INPUT. (Bug#11080)
12775
e99a9b8b
EZ
127762012-03-23 Eli Zaretskii <eliz@gnu.org>
12777
12778 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
12779 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
12780 when fetching a multibyte character consumes more bytes than
12781 CHAR_BYTES returns, due to unification of CJK characters in
12782 string_char. (Bug#11073)
12783
5063c0e1
TN
127842012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
12785
12786 * process.c (wait_reading_process_output): Handle pty disconnect
12787 by refraining from sending oneself a SIGCHLD (bug#10933).
12788
9f851fbd
CY
127892012-03-22 Chong Yidong <cyd@gnu.org>
12790
12791 * dispextern.h (struct it): New member string_from_prefix_prop_p.
12792
5063c0e1 12793 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
12794 Mark string as coming from a prefix property.
12795 (handle_face_prop): Use default face for prefix strings (Bug#4281).
12796 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
12797
fb5b8aca
CY
127982012-03-21 Chong Yidong <cyd@gnu.org>
12799
12800 * xfaces.c (Vface_remapping_alist): Doc fix.
12801
62356a1b
EZ
128022012-03-20 Eli Zaretskii <eliz@gnu.org>
12803
12804 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
12805 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
12806 Doc fixes.
62356a1b 12807
025de85b
CY
128082012-03-20 Chong Yidong <cyd@gnu.org>
12809
12810 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
12811 to reflect default non-nil value of redisplay-dont-pause.
12812
4827f94e
KH
128132012-03-19 Kenichi Handa <handa@m17n.org>
12814
12815 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
12816 it fit in a valid range (Bug#11003).
12817
e50a24a2
EZ
128182012-03-18 Eli Zaretskii <eliz@gnu.org>
12819
12820 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
12821 that is not from display property, accept the row as a "cursor
12822 row" if one of the string's character has a non-nil `cursor'
12823 property. Fixes cursor positioning when there are newlines in
12824 overlay strings, e.g. in icomplete.el. (Bug#11035)
12825
9af5ed87
PE
128262012-03-12 Paul Eggert <eggert@cs.ucla.edu>
12827
12828 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
12829
d1f55f16
CY
128302012-03-12 Chong Yidong <cyd@gnu.org>
12831
12832 * eval.c (inhibit_lisp_code): Rename from
12833 inhibit_window_configuration_change_hook; move from window.c.
12834
12835 * xfns.c (unwind_create_frame_1, Fx_create_frame):
12836 * window.c (run_window_configuration_change_hook)
12837 (syms_of_window): Callers changed.
12838
66c5eebd
CY
128392012-03-11 Chong Yidong <cyd@gnu.org>
12840
413df973
CY
12841 * keymap.c (Fkey_description): Doc fix (Bug#9700).
12842
66c5eebd
CY
12843 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
12844
1de11f56
CY
128452012-03-10 Chong Yidong <cyd@gnu.org>
12846
12847 * frame.c (other_visible_frames): Don't assume the selected frame
12848 is visible (Bug#10955).
12849
cae07000
SM
128502012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
12851
12852 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
12853
89c94350
JD
128542012-03-08 Jan Djärv <jan.h.d@swipnet.se>
12855
12856 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
12857 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
12858 zero (Bug#10954).
12859
999dd333
GM
128602012-03-03 Glenn Morris <rgm@gnu.org>
12861
01a6dcc8 12862 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 12863
de0100f2
EZ
128642012-03-02 Eli Zaretskii <eliz@gnu.org>
12865
12866 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
12867 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
12868 (redisplay_window, next_element_from_string): Fix typos in
12869 comments.
3e441275
EZ
12870 (redisplay_window): Pass to move_it_vertically the margin in
12871 pixels, not in screen lines.
de0100f2 12872
96a72ee9
GM
128732012-03-02 Glenn Morris <rgm@gnu.org>
12874
12875 * buffer.c (buffer-list-update-hook): Doc fix.
12876
312508d7
EZ
128772012-02-29 Eli Zaretskii <eliz@gnu.org>
12878
12879 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
12880 push_it before setting up the iterator for the first overlay
12881 string, even if we have an empty string loaded.
12882 (next_overlay_string): If there's an empty string on the iterator
12883 stack, pop the stack. (Bug#10903)
12884
27f3c637
PE
128852012-02-25 Paul Eggert <eggert@cs.ucla.edu>
12886
12887 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
12888 Suggested by Stefan Monnier in
12889 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
12890 * alloc.c (widen_to_Lisp_Object): New static function.
12891 (mark_memory): Also mark Lisp_Objects by fetching pointer words
12892 and widening them to Lisp_Objects. This would work even if
12893 USE_LSB_TAG is defined and wide integers are used, which might
12894 happen in a future version of Emacs.
12895
3c9dfce6
CY
128962012-02-25 Chong Yidong <cyd@gnu.org>
12897
fa74b241
CY
12898 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
12899 Doc fix.
12900
3c9dfce6
CY
12901 * xselect.c (Fx_selection_exists_p): Doc fix.
12902 (x_clipboard_manager_save_all): Print an informative message
12903 before saving to clipboard manager.
12904
9486df08
CY
129052012-02-24 Chong Yidong <cyd@gnu.org>
12906
12907 * keyboard.c (process_special_events): Handle all X selection
12908 requests in kbd_buffer, not just the next one (Bug#8869).
12909
f01d3321
CY
129102012-02-23 Chong Yidong <cyd@gnu.org>
12911
12912 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
12913 call when setting menu-bar-lines and tool-bar-lines parameters.
12914 (unwind_create_frame_1): New helper function.
12915
12916 * window.c (inhibit_window_configuration_change_hook): New var.
12917 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 12918 (syms_of_window): Initialize it.
f01d3321 12919
86b847b6
CY
129202012-02-22 Chong Yidong <cyd@gnu.org>
12921
12922 * xterm.c (x_draw_image_relief): Add missing type check for
12923 Vtool_bar_button_margin (Bug#10743).
12924
a59225b1
CY
129252012-02-21 Chong Yidong <cyd@gnu.org>
12926
12927 * fileio.c (Vfile_name_handler_alist): Doc fix.
12928
12929 * buffer.c (Fget_file_buffer): Protect against invalid file
12930 handler return value.
12931
310f5bd4
PE
129322012-02-20 Paul Eggert <eggert@cs.ucla.edu>
12933
cb3a28cc
PE
12934 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
12935 when computing $valmask.
12936
310f5bd4
PE
12937 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
12938 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
12939 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
12940 It's useless in that case, and it can cause problems on hosts
12941 that allocate halves of EMACS_INT values separately.
12942 Reported by Dan Horák. Diagnosed by Andreas Schwab in
12943 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
12944 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
12945 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
12946 it avoids undefined behavior on hosts where shifting right by more
12947 than the word width has undefined behavior.
12948
2375c96a
CY
129492012-02-19 Chong Yidong <cyd@gnu.org>
12950
12951 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
12952 (Funhandled_file_name_directory, Ffile_name_as_directory)
12953 (Fdirectory_file_name, Fexpand_file_name)
12954 (Fsubstitute_in_file_name): Protect against invalid file handler
12955 return values (Bug#10845).
12956
3eb49e71
EZ
129572012-02-18 Eli Zaretskii <eliz@gnu.org>
12958
12959 * .gdbinit (pitx): Fix incorrect references to fields of the
12960 iterator stack.
12961
7b926f3f
CY
129622012-02-17 Chong Yidong <cyd@gnu.org>
12963
12964 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
12965
11273115
PE
129662012-02-15 Paul Eggert <eggert@cs.ucla.edu>
12967
12968 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
12969 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
12970
c3a70e2b
CY
129712012-02-15 Chong Yidong <cyd@gnu.org>
12972
12973 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
12974 marked as special. Also, starting docstrings with * is obsolete.
12975
0ca43699
AS
129762012-02-13 Andreas Schwab <schwab@linux-m68k.org>
12977
12978 * gnutls.c (emacs_gnutls_write): Fix last change.
12979
2e8f3c56
LI
129802012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
12981
12982 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
12983 send_process.
12984
af70074f
SM
129852012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
12986
12987 * keymap.c (Fsingle_key_description): Handle char ranges.
12988
95986d52
CY
129892012-02-12 Chong Yidong <cyd@gnu.org>
12990
afd83bd1
CY
12991 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
12992 as that creates a dangerous corner case.
12993
95986d52
CY
12994 * window.c (Fdelete_window_internal): Invalidate the mouse
12995 highlight (Bug#9904).
12996
bd7da63e
GM
129972012-02-12 Glenn Morris <rgm@gnu.org>
12998
12999 * xselect.c (Fx_own_selection_internal)
13000 (Fx_get_selection_internal, Fx_disown_selection_internal)
13001 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13002 * nsselect.m (Fx_own_selection_internal)
13003 (Fx_disown_selection_internal, Fx_selection_exists_p)
13004 (Fx_selection_owner_p, Fx_get_selection_internal):
13005 Sync docs and argument specs with the xselect.c versions.
13006
77abcbc2
LI
130072012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13008
13009 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13010
90b671e2
EZ
130112012-02-11 Eli Zaretskii <eliz@gnu.org>
13012
1c0ca0b7
EZ
13013 * w32select.c (Fx_selection_exists_p): Sync doc string and
13014 argument list with xselect.c. (Bug#10783)
13015
13016 * w16select.c (Fx_selection_exists_p): Sync doc string and
13017 argument list with xselect.c. (Bug#10783)
90b671e2 13018
49241268
GM
130192012-02-10 Glenn Morris <rgm@gnu.org>
13020
13021 * fns.c (Fsecure_hash): Doc fix.
13022
f998bbe7 130232012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
13024
13025 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13026
0992bd9c
CY
130272012-02-07 Chong Yidong <cyd@gnu.org>
13028
13029 * buffer.c (Fbuffer_local_variables)
13030 (buffer_lisp_local_variables): Handle unbound vars correctly;
13031 don't let Qunbound leak into Lisp.
13032
af008560
GM
130332012-02-07 Glenn Morris <rgm@gnu.org>
13034
dd605cc4
GM
13035 * image.c (Fimagemagick_types): Doc fix.
13036
af008560
GM
13037 * image.c (imagemagick-render-type): Change it from a lisp object
13038 to an integer. Move the doc here from the lisp manual.
13039 Treat all values not equal to 0 the same.
13040
1449fa1d
CY
130412012-02-06 Chong Yidong <cyd@gnu.org>
13042
13043 * doc.c (store_function_docstring): Avoid applying docstring of
13044 alias to base function (Bug#2603).
13045
3723ec07
AS
130462012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13047
13048 * .gdbinit (pp1, pv1): Remove redundant defines.
13049 (pr): Use pp.
13050
79c1cc1e
CY
130512012-02-04 Chong Yidong <cyd@gnu.org>
13052
13053 * nsterm.m: Declare a global (Bug#10694).
13054
d7f29f8e
EZ
130552012-02-04 Eli Zaretskii <eliz@gnu.org>
13056
cae07000
SM
13057 * w32.c (get_emacs_configuration_options):
13058 Include --enable-checking, if specified, in the return value.
d7f29f8e 13059
3b95a6f9
MR
130602012-02-04 Martin Rudalics <rudalics@gmx.at>
13061
13062 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13063 after rounding frame sizes. (Bug#9723)
13064
d6fa96a6
EZ
130652012-02-04 Eli Zaretskii <eliz@gnu.org>
13066
13067 * keyboard.c (adjust_point_for_property): Don't position point
13068 before BEGV. (Bug#10696)
13069
df0b2940
PE
130702012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13071
13072 Handle overflow when computing char display width (Bug#9496).
13073 * character.c (char_width): Return EMACS_INT, not int.
13074 (char_width, c_string_width): Check for overflow when
13075 computing the width; this is possible now that individual
13076 characters can have unbounded width. Problem introduced
13077 by merge from Emacs 23 on 2012-01-19.
13078
6bee44d6
MA
130792012-02-02 Michael Albinus <michael.albinus@gmx.de>
13080
13081 * dbusbind.c (Fdbus_register_method): Mention the return value
13082 :ignore in the docstring.
13083
44f92739
GM
130842012-02-02 Glenn Morris <rgm@gnu.org>
13085
1b9f60cc
GM
13086 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13087
44f92739
GM
13088 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13089 Unconditionally set to t. (Bug#10673)
13090 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13091 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13092 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13093
c5d3843c
KH
130942012-02-02 Kenichi Handa <handa@m17n.org>
13095
13096 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13097 0, do not call append_composite_glyph.
13098
159462d4 130992012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
13100
13101 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13102 NULL (Bug#6988).
13103 (x_produce_glyphs): If the component of a composition is a null
13104 string, set it->pixel_width to 1 to avoid zero-width glyph.
13105
78cef877
EZ
131062012-02-01 Eli Zaretskii <eliz@gnu.org>
13107
13108 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13109 first 2 arguments are identical. This makes inserting large
13110 output from a subprocess an order of magnitude faster on
13111 MS-Windows, where all sbrk'ed memory is always contiguous.
13112
97897668
GM
131132012-01-31 Glenn Morris <rgm@gnu.org>
13114
13115 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 13116 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
13117 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13118
31fd3586
GM
131192012-01-29 Glenn Morris <rgm@gnu.org>
13120
13121 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13122
0e24a8b2
CY
131232012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13124
13125 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13126
cc0adcb0
CY
131272012-01-28 Chong Yidong <cyd@gnu.org>
13128
13129 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13130
acc28cb9
CY
131312012-01-26 Chong Yidong <cyd@gnu.org>
13132
9c69cfb7
CY
13133 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13134
acc28cb9
CY
13135 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13136 repeat counts (Bug#10507).
13137
48da7392
GM
131382012-01-26 Glenn Morris <rgm@gnu.org>
13139
13140 * lread.c (syms_of_lread): Doc fix.
13141
14af5f7f
CY
131422012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13143
13144 * coding.c (encode_designation_at_bol): Change return value to
13145 EMACS_INT.
13146
0b21c100
CY
131472012-01-25 Chong Yidong <cyd@gnu.org>
13148
13149 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13150
3c2907f7
CY
131512012-01-21 Chong Yidong <cyd@gnu.org>
13152
13153 * floatfns.c (Fcopysign): Make the second argument non-optional,
13154 since nil is not allowed anyway.
13155
959ad23f
AS
131562012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13157
13158 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13159 (send_process): Likewise.
13160
34a02f46
MR
131612012-01-19 Martin Rudalics <rudalics@gmx.at>
13162
13163 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
13164 (Vwindow_persistent_parameters): Do not use Qstate.
13165 Rewrite doc-strings.
34a02f46 13166
1259009a 131672012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
13168
13169 * character.c (char_width): New function.
70d4fdf6
GM
13170 (Fchar_width, c_string_width, lisp_string_width):
13171 Use char_width (Bug#9496).
25ed9e61 13172
6a6ee00d
MR
131732012-01-16 Martin Rudalics <rudalics@gmx.at>
13174
13175 * window.c (Vwindow_persistent_parameters): New variable.
13176 (Fset_window_configuration, save_window_save): Handle persistent
13177 window parameters.
13178
c85efaf7
EZ
131792012-01-14 Eli Zaretskii <eliz@gnu.org>
13180
13181 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13182 thrashing the stack of the thread. (Bug#9087)
13183
5944709e
PE
131842012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13185
13186 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13187
e71f5d99
EZ
131882012-01-11 Eli Zaretskii <eliz@gnu.org>
13189
13190 * xdisp.c (rows_from_pos_range): Handle the case where the
13191 highlight ends on a newline. (Bug#10464)
13192 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13193 he end column for display of highlight that ends on a newline
13194 before a R2L line.
13195
ce316182
GM
131962012-01-11 Glenn Morris <rgm@gnu.org>
13197
13198 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13199 from load-path also when installation-directory is nil. (Bug#10208)
13200
5b43da69
GM
132012012-01-10 Glenn Morris <rgm@gnu.org>
13202
74cc8ff9
GM
13203 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13204
7d8d6e4e
GM
13205 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13206 Update template values to be closer to their typical values these days.
5b43da69 13207
a0db8d43
EZ
132082012-01-09 Eli Zaretskii <eliz@gnu.org>
13209
13210 * xdisp.c (rows_from_pos_range): Accept additional argument
13211 DISP_STRING, and accept any glyph in a row whose object is that
13212 string as eligible for mouse highlight. Fixes mouse highlight of
13213 display strings from overlays. (Bug#10464)
13214
9a0115ab 132152012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 13216
b9110d6a 13217 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
13218 * fileio.c (auto_saving_dir_umask): New static var.
13219 (Fmake_directory_internal): Use it.
13220 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13221 creating the directory. The old code temporarily assigns
13222 too-generous permissions to the directory.
13223 (do_auto_save_eh): Clear it.
b9110d6a 13224 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
13225 that the var is always cleared.
13226
6c1bd3f3
EZ
132272012-01-07 Eli Zaretskii <eliz@gnu.org>
13228
13229 * search.c (scan_buffer): Pass character positions to
13230 know_region_cache, not byte positions. (Bug#6540)
13231
069d2b50
L
132322012-01-07 LynX <_LynX@bk.ru> (tiny change)
13233
13234 * w32.c (sys_rename): Report EXDEV when rename of a directory
13235 fails because the target is on another logical disk. (Bug#10284)
13236
75bf0d33
DB
132372012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13238
13239 * xterm.c (x_embed_request_focus): New function.
13240
13241 * xterm.h: Add prototype.
13242
13243 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13244
1c6e5a32
GM
132452012-01-05 Glenn Morris <rgm@gnu.org>
13246
13247 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13248
651e947e
EZ
132492012-01-01 Eli Zaretskii <eliz@gnu.org>
13250
13251 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13252 Load gnutls_transport_set_lowat only if GnuTLS version is below
13253 2.11.1.
13254 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13255 GnuTLS versions below 2.11.1.
13256
3778cdd8
AL
132572011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13258
13259 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13260 to the doc string advising against its use for altering the way
13261 windows are scrolled.
13262
0e5317f7
KH
132632011-12-28 Kenichi Handa <handa@m17n.org>
13264
13265 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13266 coding-system ASCII compatible only when it does not produce BOM
13267 on encoding (Bug#10383).
13268
93d5ca1f
JD
132692011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13270
13271 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13272 can scroll.
13273 (create_and_show_popup_menu): Always use menu_position_func for
13274 Gtk3 (Bug#10361).
13275
ca22b785
AS
132762011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13277
13278 * callint.c (Fcall_interactively): Don't truncate prompt string.
13279
d048e1e6
EZ
132802011-12-23 Eli Zaretskii <eliz@gnu.org>
13281
13282 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13283 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 13284 resumed from there (after widening). (Bug#10360)
d048e1e6 13285
5ccaba1f
JD
132862011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13287
13288 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13289
204ee57f
JD
132902011-12-21 Jan Djärv <jan.h.d@swipnet.se>
13291
b81d40f0
JB
13292 * nsterm.m (x_free_frame_resources):
13293 Release f->output_data.ns->miniimage.
204ee57f
JD
13294 (ns_index_color): Fix indentation. Do not retain
13295 color_table->colors[i].
13296
13297 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
13298 before returning.
13299
13300 * nsfns.m (x_set_background_color): Assign return value from
13301 ns_index_color to face-background instead of NSColor*.
13302 (ns_implicitly_set_icon_type): Fix indentation.
13303 Change assignment in for loop to comparison.
13304
13305 * emacs.c (ns_pool): New variable.
13306 (main): Assign ns_pool.
13307 (Fkill_emacs): Call ns_release_autorelease_pool.
13308
13309 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
13310 autorelease fdesc, release fdAttrs and tdict.
13311 (ns_get_covering_families): Release charset.
13312 (ns_findfonts): Release NSFontDescriptor created with new.
13313 (ns_uni_to_glyphs): Fix indentation.
13314 (setString): Release attrStr before assigning new value.
13315
c803b2b7
JD
133162011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13317
678f4426
JD
13318 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
13319 and NS_IMPL_COCOA.
13320 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
13321 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
13322
cd394be1 133232011-12-18 David Reitter <reitter@cmu.edu>
678f4426 13324
5fecd5fc
JD
13325 * nsterm.m (ns_term_init): Subscribe for notifications
13326 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
13327 to method trackingNotification in EmacsMenu.
13328
13329 * nsmenu.m (trackingMenu): New variable.
3771cb17 13330 (trackingNotification): New method (from Aquamacs).
5fecd5fc 13331 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 13332 from Aquamacs (Bug#7030).
678f4426
JD
13333
133342011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 13335
c803b2b7
JD
13336 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
13337 (symbol_to_nsstring): Fix indentation.
13338 (ns_symbol_to_pb): New function.
cae07000
SM
13339 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
13340 (Fns_rotate_cut_buffers_internal): Remove.
13341 (Fns_store_selection_internal): Rename from
c803b2b7
JD
13342 Fns_store_cut_buffer_internal.
13343 (ns_get_foreign_selection, Fx_own_selection_internal)
13344 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
13345 (Fns_get_selection_internal, Fns_store_selection_internal):
13346 Use ns_symbol_to_pb and check if return value is nil.
13347 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
13348 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
13349 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
13350 renamed to Sns_store_selection_internal.
13351 (ns_handle_selection_request): Move code to Fx_own_selection_internal
13352 and remove this function.
13353 (ns_handle_selection_clear): Remove, never used.
13354 (Fx_own_selection_internal): Move code from ns_handle_selection_request
13355 here.
13356
e1b01a3a
KB
133572011-12-17 Ken Brown <kbrown@cornell.edu>
13358
13359 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
13360 GID is unknown (Bug#10257).
13361
2adb6e85
PE
133622011-12-17 Paul Eggert <eggert@cs.ucla.edu>
13363
13364 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
13365 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
13366 which caused a build failure on GNU/Linux IA-64. This problem was
13367 introduced by my 2011-10-07 patch.
13368
d1d7b339
JL
133692011-12-15 Juri Linkov <juri@jurta.org>
13370
13371 * image.c (imagemagick_error): New function. (Bug#10112)
13372 (imagemagick_load_image): Comment out `MagickSetResolution' call.
13373 Use `imagemagick_error' where ImageMagick functions return
13374 `MagickFalse'.
13375 (Fimagemagick_types): Add `Fnreverse' to return the list in the
13376 proper order.
13377
100d5755
KH
133782011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13379
13380 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
13381 fill background (Bug#8992).
13382
454592a6
MR
133832011-12-13 Martin Rudalics <rudalics@gmx.at>
13384
13385 * window.c (Vwindow_combination_resize)
13386 (Vwindow_combination_limit): Use t instead of non-nil in
13387 doc-strings.
61d4b438
MR
13388 (Vrecenter_redisplay): Add first sentence of doc-string on
13389 separate line.
53524d93 13390 (Frecenter): Fix doc-string typo.
454592a6 13391
3633e3aa
KH
133922011-12-11 Kenichi Handa <handa@m17n.org>
13393
13394 * coding.c (Funencodable_char_position): Pay attention to the
13395 buffer text relocation (Bug#9389).
13396
7b9d523a 133972011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 13398
7b9d523a
JD
13399 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
13400 gtk_init (Bug#10100).
13401
b73189c6
EZ
134022011-12-10 Eli Zaretskii <eliz@gnu.org>
13403
13404 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
13405 IT->string is nil. (Bug#10263)
13406
f7dfe5d6
JD
134072011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13408
83faebb4
JD
13409 * nsterm.h (x_free_frame_resources): Declare.
13410
f7dfe5d6
JD
13411 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
13412 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
13413
13414 * nsterm.h (ns_get_defaults_value): Declare.
13415
13416 * nsterm.m (ns_default): Call ns_get_defaults_value.
13417
7cd4e72c
EZ
134182011-12-09 Eli Zaretskii <eliz@gnu.org>
13419
13420 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
13421 (Bug#10170)
13422
b34d7317
YM
134232011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13424
13425 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
13426 that where the value of an _OBJC_* symbol points to is in the .bss
13427 section (Bug#10240).
13428
76470ad1
KH
134292011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13430
13431 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 13432 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 13433
745fff94
KH
134342011-12-08 Kenichi Handa <handa@m17n.org>
13435
13436 * ftfont.c (get_adstyle_property): Fix previous change
13437 (Bug#10233).
13438
6e44397c
JB
134392011-12-07 Juanma Barranquero <lekktu@gmail.com>
13440
13441 * w32.c (init_environment): If no_site_lisp, remove site-lisp
13442 dirs from the default value of EMACSLOADPATH (bug#10208).
13443
7efa6272
GM
134442011-12-07 Glenn Morris <rgm@gnu.org>
13445
13446 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
13447 installation and source directories as well. (Bug#10208)
13448
f6fc4d87
CY
134492011-12-06 Chong Yidong <cyd@gnu.org>
13450
13451 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
13452
2bf26180
GM
134532011-12-06 Glenn Morris <rgm@gnu.org>
13454
13455 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
13456 as an error, not just -1. (Bug#10217)
13457
3a6ad4f0
CY
134582011-12-05 Chong Yidong <cyd@gnu.org>
13459
13460 * keyboard.c (process_special_events): New function.
13461 (swallow_events, Finput_pending_p): Use it (Bug#10195).
13462
75a3b399
PE
134632011-12-05 Paul Eggert <eggert@cs.ucla.edu>
13464
13465 * coding.c (encode_designation_at_bol): Don't use uninitialized
13466 local variable (Bug#9318).
13467
c3c9e25e
KH
134682011-12-05 Kenichi Handa <handa@m17n.org>
13469
13470 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
13471 return Qnil (Bug#8046, Bug#10193).
13472
5eb05ea3
KH
134732011-12-05 Kenichi Handa <handa@m17n.org>
13474
13475 * coding.c (encode_designation_at_bol): New args charbuf_end and
13476 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
13477 (coding_set_source): Return how many bytes coding->source was
13478 relocated.
13479 (coding_set_destination): Return how many bytes
13480 coding->destination was relocated.
13481 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 13482 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
13483
134842011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13485
13486 * coding.c (CODING_CHAR_CHARSET_P): New macro.
13487 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
13488 macro (Bug#9318).
13489
134902011-12-05 Andreas Schwab <schwab@linux-m68k.org>
13491
13492 The following changes are to fix Bug#9318.
13493
a79703f5 13494 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
13495 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
13496 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 13497 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 13498
7dbda6df
JB
134992011-12-05 Juanma Barranquero <lekktu@gmail.com>
13500
13501 * lisp.h (process_quit_flag): Fix external declaration.
13502
6d5eb5b0
SM
135032011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
13504
13505 Don't macro-inline non-performance-critical code.
13506 * eval.c (process_quit_flag): New function.
13507 * lisp.h (QUIT): Use it.
13508
a0c3fad0
JD
135092011-12-04 Jan Djärv <jan.h.d@swipnet.se>
13510
13511 * nsfns.m (get_geometry_from_preferences): New function.
13512 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
13513
6c07aac2
AS
135142011-12-04 Andreas Schwab <schwab@linux-m68k.org>
13515
13516 * emacs.c (Qkill_emacs): Define.
13517 (syms_of_emacs): Initialize it.
13518 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
13519 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
13520 (quit_throw_to_read_char): Add parameter `from_signal'.
13521 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
13522 * lisp.h (QUIT): Call Fkill_emacs if requested.
13523
c052ead4
JD
135242011-12-03 Jan Djärv <jan.h.d@swipnet.se>
13525
13526 * widget.c (update_wm_hints): Return if wmshell is null.
13527 (widget_update_wm_size_hints): New function.
13528
13529 * widget.h (widget_update_wm_size_hints): Declare.
13530
13531 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
13532 widget_update_wm_size_hints (Bug#10104).
13533
9e49252b
EZ
135342011-12-03 Eli Zaretskii <eliz@gnu.org>
13535
13536 * xdisp.c (handle_invisible_prop): If the invisible text ends just
13537 before a newline, prepare the bidi iterator for consuming the
13538 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 13539 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 13540
02b16839
JL
135412011-12-02 Juri Linkov <juri@jurta.org>
13542
13543 * search.c (Fword_search_regexp): New Lisp function created from
13544 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
13545 (Fword_search_backward, Fword_search_forward)
13546 (Fword_search_backward_lax, Fword_search_forward_lax):
13547 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
13548 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
13549
0068070e
SM
135502011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
13551
13552 * fileio.c (Finsert_file_contents): Move after-change-function call
13553 to before the "handled:" label, since all "goto handled" appear in
13554 cases where the *-change-functions have already been properly called
13555 (bug#10117).
13556
3360a3fc
AS
135572011-12-01 Andreas Schwab <schwab@linux-m68k.org>
13558
13559 * keyboard.c (interrupt_signal): Don't call kill-emacs when
13560 waiting for input. (Bug#10169)
13561
73d6c093
EZ
135622011-11-30 Eli Zaretskii <eliz@gnu.org>
13563
13564 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
13565 verifies glyph row's hash code--we have just reallocated the
13566 glyphs, so their contents can be complete garbage. (Bug#10164)
13567
febe6bea
JB
135682011-11-30 Juanma Barranquero <lekktu@gmail.com>
13569
13570 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
13571
801a4313
EZ
135722011-11-30 Eli Zaretskii <eliz@gnu.org>
13573
13574 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
13575 attributes are tested _before_ calling verify_row_hash, to protect
13576 against GCC re-ordering of the tests. (Bug#10164)
13577
2b56b87e
JD
135782011-11-29 Jan Djärv <jan.h.d@swipnet.se>
13579
13580 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
13581
13582 * xterm.c (handle_one_xevent): Only set async_visible and friends
13583 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 13584 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
13585 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
13586
dbf31225
PE
135872011-11-28 Paul Eggert <eggert@cs.ucla.edu>
13588
13589 Remove GCPRO-related macros that exist only to avoid shadowing locals.
13590 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
13591 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
13592 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13593 All uses changed to use GCPRO1 etc.
13594 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
13595 Revert to old implementation (i.e., before 2011-03-11).
13596
1305621b
YM
135972011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13598
13599 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
13600 of scroll runs so as to avoid assigning disabled bogus rows and
13601 unnecessary graphics copy operations.
13602
8c9afb46
EZ
136032011-11-27 Eli Zaretskii <eliz@gnu.org>
13604
13605 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
13606 (snprintf) [_MSC_VER]: Redirect to _snprintf.
13607 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
13608 (malloc, free, realloc, calloc): Redirect to e_* only when
13609 compiling Emacs.
13610
13611 * lisp.h (GCTYPEBITS): Move before first use.
13612 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
13613 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
13614 this macro definition.
13615
13616 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
13617 _MSC_VER.
13618
54e9e3bf
JD
136192011-11-27 Jan Djärv <jan.h.d@swipnet.se>
13620
6d5eb5b0
SM
13621 * gtkutil.c (xg_create_frame_widgets):
13622 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
13623 present with Gtk+ 2.0.
13624
83aca1cb
PE
136252011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13626
13627 * fileio.c (Finsert_file_contents): Undo previous change; see
13628 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13629
5b76caa4
PE
136302011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13631
13632 Rename locals to avoid shadowing.
13633 * fileio.c (Finsert_file_contents):
13634 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
13635 * process.c (wait_reading_process_output):
13636 Rename inner 'proc' to 'p' to avoid shadowing.
13637 Indent for consistency with usual Emacs style.
13638
8c535114
EZ
136392011-11-25 Eli Zaretskii <eliz@gnu.org>
13640
13641 * xdisp.c (redisplay_window): If cursor row is not fully visible
13642 after recentering, and scroll-conservatively is set to a large
13643 number, scroll window by a few more lines to make the cursor fully
13644 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
13645 (start_display): Don't move to the next line if the display should
13646 start at a newline that is part of a display vector or an overlay
13647 string. (Bug#10119)
8c535114 13648
fa4fdb5c
JL
136492011-11-24 Juri Linkov <juri@jurta.org>
13650
13651 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
13652 after the `MagickPingImage' call. (Bug#10112)
13653
90ec88df
CY
136542011-11-23 Chong Yidong <cyd@gnu.org>
13655
13656 * window.c (Fcoordinates_in_window_p): Accept only live windows.
13657
56e2e794
MR
136582011-11-23 Martin Rudalics <rudalics@gmx.at>
13659
13660 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
13661 making another buffer current. (Bug#10114)
13662
b6e64c41
GM
136632011-11-23 Glenn Morris <rgm@gnu.org>
13664
13665 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
13666
6b21de18
CY
136672011-11-23 Chong Yidong <cyd@gnu.org>
13668
13669 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
13670 using it (Bug#5984).
13671
b12cd789
EZ
136722011-11-22 Eli Zaretskii <eliz@gnu.org>
13673
13674 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
13675 and header-lines, as they don't have one computed for them.
13676 (Bug#10098)
13677
13678 * .gdbinit (prow): Make displayed values more self-explaining.
13679 Add row's hash code.
13680
261b6fd4
LMI
136812011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
13682
13683 * process.c (wait_reading_process_output): Fix asynchrounous
13684 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 13685 (wait_reading_process_output): Add comment and URL.
261b6fd4 13686
e7cfd277
JD
136872011-11-21 Jan Djärv <jan.h.d@swipnet.se>
13688
13689 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
13690
a9b9b7f5
CY
136912011-11-21 Chong Yidong <cyd@gnu.org>
13692
13693 * window.c (Fnext_window, Fprevious_window): Doc fix.
13694
b0d15b4f
SM
136952011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13696
13697 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
13698
fe7a3057
JB
136992011-11-20 Juanma Barranquero <lekktu@gmail.com>
13700
13701 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
13702
d2999b1a
MR
137032011-11-20 Martin Rudalics <rudalics@gmx.at>
13704
13705 * window.c (Fset_window_combination_limit): Rename argument
13706 STATUS to LIMIT.
13707 (Vwindow_combination_limit): Remove "status" from doc-string.
13708
d5ff9cd0
AS
137092011-11-20 Andreas Schwab <schwab@linux-m68k.org>
13710
13711 * m/ibms390.h: Remove.
13712 * m/ibms390x.h: Don't include "ibms390.h".
13713
a5bb9bd3
SM
137142011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13715
13716 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
13717 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
13718
cd1181db
JB
137192011-11-20 Juanma Barranquero <lekktu@gmail.com>
13720
13721 * casetab.c (Fset_case_table):
13722 * charset.c (Fcharset_after): Fix typos.
13723
615a3b8d 137242011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 13725
17e845af
PE
13726 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
13727 Otherwise, valgrind does not work on some platforms.
13728 Problem reported by Andreas Schwab in
6a0bf43d
PE
13729 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
13730 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
13731 is set, removing the need for VIRT_ADDRESS_VARIES.
13732 (PURE_P): Use a more-efficient implementation that needs just one
13733 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
13734 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
13735 to 4 (xorl, subq, cmpq, setbe).
13736 * alloc.c (pure): Always extern now, since that's the
13737 VIRT_ADDR_VARIES behavior.
13738 (PURE_POINTER_P): Use a single comparison, not two, for
13739 consistency with the new puresize.h.
13740 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
13741 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
13742 Remove VIRT_ADDR_VARIES no longer needed.
13743
f8fe6f96
EZ
137442011-11-19 Eli Zaretskii <eliz@gnu.org>
13745
13746 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
13747 (erase_phys_cursor, update_window_cursor, show_mouse_face)
13748 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
13749 behave as if the cursor position were at the window margin.
13750
13751 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
13752 and the cursor position is out of bounds, behave as if the cursor
13753 position were at the window margin. (Bug#10075)
13754
df05a53c
CY
137552011-11-18 Chong Yidong <cyd@gnu.org>
13756
13757 * window.c (Fwindow_combination_limit): Make first argument
13758 non-optional, since it is meaningless for live windows like the
13759 selected window.
61ccba97 13760
2071918e
DA
137612011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
13762
13763 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
13764
b50a28de
SM
137652011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
13766
13767 * intervals.c: Fix grafting over the whole buffer (bug#10071).
13768 (graft_intervals_into_buffer): Simplify.
13769
015137db
EZ
137702011-11-18 Eli Zaretskii <eliz@gnu.org>
13771
13772 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
13773 hash values of the two rows.
13774 (copy_row_except_pointers): Preserve the used[] arrays and the
13775 hash values of the two rows. (Bug#10035)
68c95424 13776 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
13777
13778 * xdisp.c (row_hash): New function, body extracted from
13779 compute_line_metrics.
13780 (compute_line_metrics): Call row_hash, instead of computing the
13781 hash code inline.
13782
13783 * dispnew.c (verify_row_hash): Call row_hash for computing the
13784 hash code of a row, instead of duplicating code from xdisp.c.
13785
13786 * dispextern.h (row_hash): Add prototype.
13787
a2addb04
TH
137882011-11-18 Tassilo Horn <tassilo@member.fsf.org>
13789
13790 * frame.c (delete_frame): Don't delete the terminal when the last
13791 X frame is closed if emacs is built with GTK toolkit.
13792
df85d315
JB
137932011-11-17 Juanma Barranquero <lekktu@gmail.com>
13794
13795 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
13796
a0c2d0ae
MR
137972011-11-17 Martin Rudalics <rudalics@gmx.at>
13798
13799 * window.c (Vwindow_splits): Rename to
13800 Vwindow_combination_resize. Suggested by Juri Linkov.
13801 (Fsplit_window_internal): Use Vwindow_combination_resize instead
13802 of Vwindow_splits.
13803
58179cce
JB
138042011-11-16 Juanma Barranquero <lekktu@gmail.com>
13805
7877f373
JB
13806 * nsfns.m (Fns_font_name):
13807 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 13808
b6f67890
MR
138092011-11-16 Martin Rudalics <rudalics@gmx.at>
13810
13811 * window.h (window): Rename slot "nest" to "combination_limit".
13812 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
13813 (Fset_window_nest): Rename to Fset_window_combination_limit.
13814 (Vwindow_nest): Rename to Vwindow_combination_limit.
13815 (recombine_windows, make_parent_window, make_window)
13816 (Fsplit_window_internal, saved_window)
13817 (Fset_window_configuration, save_window_save): Rename all
13818 occurrences of window_nest to window_combination_limit.
13819
c7015153
JB
138202011-11-15 Juanma Barranquero <lekktu@gmail.com>
13821
13822 * image.c (imagemagick_load_image): Fix typo.
13823
322ad6ec
EZ
138242011-11-14 Eli Zaretskii <eliz@gnu.org>
13825
13826 * xdisp.c (display_line): Move the call to
13827 highlight_trailing_whitespace before the call to
13828 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
13829 faces of all the glyphs to compute ROW's hash value.
13830 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 13831
f067b8ec
JB
138322011-11-14 Juanma Barranquero <lekktu@gmail.com>
13833
13834 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
13835 just return (bug#10044).
13836
1e5b2111
EZ
138372011-11-12 Eli Zaretskii <eliz@gnu.org>
13838
7ef3cbd5
EZ
13839 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
13840 with user-defined heap size. Bump the default size of the temacs
13841 heap to 27MB, to avoid memory warning when running temacs.
13842 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
13843
1e5b2111
EZ
13844 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
13845 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
13846 (verify_row_hash) [XASSERTS]: New function.
13847 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
13848 that the hash value of glyph rows is correct.
1e5b2111 13849
89d61221
MR
138502011-11-12 Martin Rudalics <rudalics@gmx.at>
13851
13852 * window.h (window): Remove splits slot.
13853 * window.c (Fwindow_splits, Fset_window_splits): Remove.
13854 (Fdelete_other_windows_internal, make_parent_window)
13855 (make_window, Fsplit_window_internal, Fdelete_window_internal)
13856 (Fset_window_configuration, save_window_save): Don't deal with
13857 split status of windows.
13858 (saved_window): Remove splits slot.
13859 (Vwindow_splits): Rewrite doc-string.
13860
97f18cc8
JD
138612011-11-11 Jan Djärv <jan.h.d@swipnet.se>
13862
13863 * xfns.c (unwind_create_frame):
13864 * nsfns.m (unwind_create_frame):
13865 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
13866 Vframe_list (Bug#9999).
13867
22a648b4
DA
138682011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
13869
0b381c7e 13870 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 13871
659afede
KH
138722011-11-11 Kenichi Handa <handa@m17n.org>
13873
13874 * callproc.c (Fcall_process): Set the member dst_multibyte of
13875 process_coding.
13876
9ac0394b
KH
138772011-11-11 Johan Bockgård <bojohan@gnu.org>
13878
13879 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
13880 avoid a crash (bug#9496).
13881
2fbdc249
CY
138822011-11-09 Chong Yidong <cyd@gnu.org>
13883
13884 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
13885 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
13886
ac6b1f81
PE
138872011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13888
13889 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
13890
09db192c
PE
138912011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13892
13893 Avoid some portability problems by eschewing 'extern inline' functions.
13894 The trivial performance wins aren't worth the portability hassles; see
13895 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
13896 et seq.
13897 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13898 (window_box_width, window_box_left, window_box_left_offset)
13899 (window_box_right, window_box_right_offset): Undo previous change,
13900 by removing the "extern"s.
13901 * intervals.c (adjust_intervals_for_insertion)
13902 (adjust_intervals_for_deletion): Undo previous change,
13903 making these static again.
13904 (offset_intervals, temp_set_point_both, temp_set_point)
13905 (copy_intervals_to_string): No longer inline.
13906 * xdisp.c (window_text_bottom_y, window_box_width)
13907 (window_box_height, window_box_left_offset)
13908 (window_box_right_offset, window_box_left, window_box_right)
13909 (window_box): No longer inline.
13910
105216ed
CY
139112011-11-08 Chong Yidong <cyd@gnu.org>
13912
13913 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
13914 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
13915 Signal an error if not a live window.
105216ed
CY
13916 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
13917 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
13918
ae9e237f
JB
139192011-11-07 Juanma Barranquero <lekktu@gmail.com>
13920
13921 * lisp.h (syms_of_abbrev): Remove declaration.
13922 Reported by CHENG Gao <chenggao@royau.me>.
13923
c7aa8333
EZ
139242011-11-07 Eli Zaretskii <eliz@gnu.org>
13925
13926 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
13927 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
13928 of temacs in GUI mode.
13929
be7f5545
MR
139302011-11-07 Martin Rudalics <rudalics@gmx.at>
13931
13932 * window.h: Declare delete_all_child_windows instead of
13933 delete_all_subwindows.
13934 * window.c (Fwindow_nest, Fset_window_nest)
13935 (Fset_window_new_total, Fset_window_new_normal)
13936 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
13937 (delete_all_subwindows): Rename to delete_all_child_windows.
13938 (Fdelete_other_windows_internal, Fset_window_configuration):
13939 Call delete_all_child_windows instead of delete_all_subwindows.
13940 * frame.c (delete_frame): Call delete_all_child_windows instead
13941 of delete_all_subwindows.
13942
ca78dc43
PE
139432011-11-07 Paul Eggert <eggert@cs.ucla.edu>
13944
13945 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
13946 This is also needed for porting to any host where GC_MARK_STACK is
13947 not GC_MAKE_GCPROS_NOOPS.
13948 (which_symbols): Use it.
13949
a0241d01
KH
139502011-11-07 Kenichi Handa <handa@m17n.org>
13951
13952 * coding.c (coding_set_destination): Check coding->src_pos only
13953 when coding->src_object is a buffer (bug#9910).
13954
13955 * process.c (send_process): Set the member src_multibyte of coding
13956 to 0 (bug#9911) when sending a unibyte text.
13957
13958 * callproc.c (Fcall_process): Set the member src_multibyte of
13959 process_coding to 0 (bug#9912).
13960
a64bfdfa 139612011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
13962
13963 * xmenu.c (cleanup_widget_value_tree): New function.
13964 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
13965 calling free_menubar_widget_value_tree directly (Bug#9830).
13966
cb41b32a
PE
139672011-11-06 Paul Eggert <eggert@cs.ucla.edu>
13968
13969 Fix some portability problems with 'inline'.
13970 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13971 (window_box_width, window_box_left, window_box_left_offset)
13972 (window_box_right, window_box_right_offset): Declare extern.
13973 Otherwise, these inline functions do not conform to C99 and
13974 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
13975 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
13976 * intervals.c (adjust_intervals_for_insertion)
13977 (adjust_intervals_for_deletion): Now extern, because otherwise the
13978 extern inline functions 'offset_intervals' couldn't refer to it.
13979 (static_offset_intervals): Remove.
13980 (offset_intervals): Rewrite using the old contents of
13981 static_offset_intervals. The old version didn't conform to C99
13982 because an extern inline function contained a reference to an
13983 identifier with static linkage.
13984
b7041366
AS
139852011-11-06 Andreas Schwab <schwab@linux-m68k.org>
13986
13987 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
13988 GC.
13989
88a37c4d
EZ
139902011-11-06 Eli Zaretskii <eliz@gnu.org>
13991
13992 * xdisp.c (init_iterator, reseat_to_string): Don't set the
13993 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
13994 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
13995 return Qleft_to_right.
13996
49745b39
CY
139972011-11-06 Chong Yidong <cyd@gnu.org>
13998
13999 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14000 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14001 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14002 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14003 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14004 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14005 (Fwindow_vscroll): Doc fix.
14006 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14007 argument, since it makes no sense to pass a live window and for
14008 consistency with window-child.
14009
1f05cd82
CS
140102011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14011
14012 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14013 support MSVC.
14014
22610910
JR
140152011-11-05 Jason Rumney <jasonr@gnu.org>
14016
14017 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14018 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14019 fonts (Bug#6029).
14020 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14021 bitwise arithmetic preventing use of unicode-sip and non-truetype
14022 opentype fonts.
14023
a06776b2
EZ
140242011-11-05 Eli Zaretskii <eliz@gnu.org>
14025
3ad924ba
EZ
14026 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14027 "emacs"-only part.
14028
a06776b2
EZ
14029 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14030 initialization code to keep similarity to xfns.c after changes
14031 from 2011-11-05.
14032
c9e7db78
JD
140332011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14034
a97f8f3f
JD
14035 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14036 (unwind_create_frame): New function (Bug#9943).
14037 (Fx_create_frame): Restructure code to be more similar to the one in
14038 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14039 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14040 Move terminal->reference_count++ just before making the frame official
14041 (Bug#9943).
14042
14043 * nsterm.m (x_free_frame_resources): New function.
14044 (x_destroy_window): Move code to x_free_frame_resources.
14045
c9e7db78 14046 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
14047 (Fx_create_frame, x_create_tip_frame):
14048 Move terminal->reference_count++ just before making the frame
75f1671a 14049 official. Move initialization of image_cache_refcount and
c9e7db78
JD
14050 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14051
a6fc3b5c
EZ
140522011-11-05 Eli Zaretskii <eliz@gnu.org>
14053
14054 Support MSVC build with newer versions of Visual Studio.
14055 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14056 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14057 nt/gmake.defs.
14058
14059 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14060 which are not supported by MSVC.
14061 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14062 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14063 bitfields.
14064 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14065 types in bitfields.
14066 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14067
14068 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14069
58179cce 140702011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
14071
14072 Support MSVC build with newer versions of Visual Studio.
14073 * w32.c: Don't include w32api.h for MSVC.
14074 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14075
14076 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14077 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14078 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14079 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14080 e_* cousins.
14081 (alloca) [_MSC_VER]: Define to _alloca.
14082
14083 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14084
14085 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14086
a58c13ed
EZ
140872011-11-04 Eli Zaretskii <eliz@gnu.org>
14088
14089 * xdisp.c (note_mouse_highlight): If either of
14090 previous/next-single-property-change returns nil, treat that as
14091 the beginning or the end of the buffer. (Bug#9955)
14092
fe0b6370
JD
140932011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14094
a58c13ed 14095 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
14096 label is not null (Bug#9951).
14097 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14098 may be NULL.
14099
89bd5ee1
EZ
141002011-11-04 Eli Zaretskii <eliz@gnu.org>
14101
14102 * window.c (Fwindow_body_size): Mention in the doc string that the
14103 return value is in frame's canonical units. (Bug#9949)
14104
84c3edb9
EZ
141052011-11-03 Eli Zaretskii <eliz@gnu.org>
14106
4e2fb5c7
EZ
14107 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14108
84c3edb9 14109 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 14110 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 14111 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 14112
bc17a887
EZ
141132011-11-01 Eli Zaretskii <eliz@gnu.org>
14114
14115 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14116 Don't stop backward scan on the continuation glyph, even though
14117 its CHARPOS is positive.
6d5eb5b0
SM
14118 (mouse_face_from_buffer_pos, note_mouse_highlight):
14119 Rename cover_string to disp_string.
bc17a887 14120
4ee88440
MR
141212011-11-01 Martin Rudalics <rudalics@gmx.at>
14122
14123 * window.c (temp_output_buffer_show): Don't use
14124 Vtemp_buffer_show_specifiers.
14125 (Vtemp_buffer_show_specifiers): Remove unused variable.
14126
c2ff3c02
EZ
141272011-10-30 Eli Zaretskii <eliz@gnu.org>
14128
14129 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14130 past the beginning of the current glyph matrix.
14131
58179cce 141322011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
14133
14134 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14135 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14136 HAVE_GTK3 (Bug#9869).
b77a6a7f 14137
3b574623
JD
14138 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14139 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14140
b77a6a7f
JD
14141 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14142
14143 * xterm.c: Declare x_handle_net_wm_state to return int.
14144 (handle_one_xevent): Check if we are iconified but don't have
14145 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14146 (get_current_wm_state): Return non-zero if not hidden,
14147 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14148 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14149 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14150 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14151
196e41e4
PE
141522011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14153
14154 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14155 so that this new function doesn't get optimized away by a
14156 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14157
021f2e1a
AS
141582011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14159
14160 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14161
8b058d44
EZ
141622011-10-29 Eli Zaretskii <eliz@gnu.org>
14163
14164 Fix the `xbytecode' command.
14165 * .gdbinit (xprintbytestr): New command.
b50a28de 14166 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
14167 (xbytecode): Print the byte-code string as well.
14168
4452fb80
EZ
141692011-10-29 Kim Storm <storm@cua.dk>
14170
8b058d44
EZ
14171 * alloc.c (which_symbols): New function.
14172
21b72067
AS
141732011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14174
14175 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14176 line. (Bug#9903)
14177
83ed7b5c
GM
141782011-10-29 Glenn Morris <rgm@gnu.org>
14179
14180 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14181 Not clear what it was for, and it causes various bugs. (Bug#9839)
14182
5a7a728b
EZ
141832011-10-28 Eli Zaretskii <eliz@gnu.org>
14184
14185 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14186 possible random value that matches one of those tested as
14187 condition to clear the mouse face.
14188
d3d0842f
CY
141892011-10-28 Chong Yidong <cyd@gnu.org>
14190
14191 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14192
31b39d13
DN
141932011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14194
14195 * window.c (make_window): Initialize phys_cursor_on_p.
14196
9aba6043
SM
141972011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14198
14199 * lisp.h (struct Lisp_Symbol): Update comments.
14200
c20992f4
JB
142012011-10-28 Juanma Barranquero <lekktu@gmail.com>
14202
14203 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14204
db4f02f2
EZ
142052011-10-28 Eli Zaretskii <eliz@gnu.org>
14206
14207 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14208 <oslsachem@gmail.com> for helping to debug this.
14209
14210 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14211 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14212 (g_b_init_get_glyph_outline_w): New static variables.
14213 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14214 (GetGlyphOutlineW_Proc): New typedefs.
14215 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
14216 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14217 New functions.
14218 (w32font_open_internal, compute_metrics):
14219 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
14220 instead of calling the "wide" APIs directly.
14221
14222 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14223
14224 * w32.h (syms_of_w32font): Add prototype.
14225
87e68db4
JB
142262011-10-27 Juanma Barranquero <lekktu@gmail.com>
14227
14228 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14229 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14230 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14231 (Fmove_to_window_line): Doc fix.
14232
435c1d67
CY
142332011-10-27 Chong Yidong <cyd@gnu.org>
14234
14235 * process.c (make_process): Set gnutls_state to NULL.
14236
14237 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14238 non-NULL, regardless of GNUTLS_INITSTAGE.
14239 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14240 an error. Set process slots as soon as we allocate them.
14241
14242 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14243
9c6c6f49
CY
142442011-10-27 Chong Yidong <cyd@gnu.org>
14245
9aba6043
SM
14246 * gnutls.c (emacs_gnutls_deinit): New function.
14247 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
14248 (Fgnutls_deinit, Fgnutls_boot): Use it.
14249
14250 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14251 (deactivate_process): Call emacs_gnutls_deinit.
14252
657d08d3
JB
142532011-10-27 Juanma Barranquero <lekktu@gmail.com>
14254
14255 * image.c (x_create_x_image_and_pixmap):
14256 * w32.c (sys_rename, w32_delayed_load):
14257 * w32font.c (fill_in_logfont):
14258 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14259
5430d399
JB
142602011-10-26 Juanma Barranquero <lekktu@gmail.com>
14261
14262 * w32fns.c (w32_default_color_map): New function,
14263 extracted from Fw32_default_color_map.
a7ef684b 14264 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 14265
fe0055fa
PE
142662011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14267
14268 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14269
e6346438
SM
142702011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14271
14272 * keyboard.c (test_undefined): New function (bug#9751).
14273 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14274
e112cc37
ET
142752011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14276
14277 * sysdep.c (init_sys_modes): Fix the check for the controlling
14278 terminal (Bug#6649).
14279
7b5d6677
EZ
142802011-10-20 Eli Zaretskii <eliz@gnu.org>
14281
14282 * dispextern.h (struct bidi_it): New member next_en_type.
14283
14284 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14285 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14286 current character, check also for next_en_type being WEAK_EN.
14287 (bidi_resolve_weak): Don't enter the expensive loop if the current
14288 position is before next_en_pos. Record the bidi type of the first
14289 non-ET, non-BN character we find, in addition to its position.
14290 (bidi_level_of_next_char): Invalidate next_en_type when
14291 next_en_pos is over-stepped.
14292
7da0b018
PE
142932011-10-20 Paul Eggert <eggert@cs.ucla.edu>
14294
14295 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
14296 * editfns.c: Rewrite current-time-zone so that it invokes
14297 the equivalent of (format-time-string "%Z") to get the time zone name.
14298 This fixes a bug when the time zone name contains characters that
14299 need converting from the system time locale to Emacs internal format.
14300 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
14301 that patch fixed format-time-string to do the conversion, but
14302 I forgot to fix current-time-zone.
14303 (format_time_string): New function, containing most of
14304 what Fformat_time_string used to contain.
14305 (Fformat_time_string): Rewrite in terms of format_time_string.
14306 This doesn't change this function's behavior.
14307 (current-time-zone): Rewrite to use format_time_string.
14308 This fixes the bug reported by Michael Schierl in
14309 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
14310 Jason Rumney's 2007-06-07 change worked around this bug, but
14311 didn't fix it.
14312 * systime.h (tzname, timezone): Remove no-longer-used declarations.
14313
8547b010
EZ
143142011-10-19 Eli Zaretskii <eliz@gnu.org>
14315
14316 * xdisp.c (start_display): If the character at POS is displayed
14317 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
14318 (try_window_reusing_current_matrix): If a line ends in a display
14319 vector or the next line starts in a display vector, continue
14320 redrawing the window even though the character position of
14321 start_row was reached.
8547b010
EZ
14322 (Bug#9771, part 2)
14323
4e948d15
CY
143242011-10-18 Chong Yidong <cyd@gnu.org>
14325
14326 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
14327 with nobreak-char-display too.
14328
4787455f
EZ
143292011-10-18 Eli Zaretskii <eliz@gnu.org>
14330
14331 Fix part 3 of bug#9771.
14332 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
14333 (bidi_resolve_neutral): Don't enter the expensive loop looking for
14334 non-neutral characters if the current character is a paragraph
14335 separator (a.k.a. Newline). This avoids running the same
14336 expensive loop twice, once when we consume the preceding newline
14337 and the other time when the line actually needs to be displayed.
14338 Avoid the loop when we see neutrals on the base embedding level
14339 following a character whose directionality is the same as the
14340 paragraph's. This avoids running the expensive loop when a line
14341 ends in a long sequence of neutrals, like control characters.
14342 Add assertion against STRONG_AL type. Slightly rearrange code
14343 that determines the type of a neutral given the first non-neutral
14344 that follows it.
14345 (bidi_level_of_next_char): Set next_en_pos to zero when
14346 invalidating its info.
14347
2c91f553
EZ
143482011-10-17 Eli Zaretskii <eliz@gnu.org>
14349
14350 * xdisp.c (push_display_prop): Determine whether to record string
14351 or buffer position by IT->string, not by IT->method. Allow
14352 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
14353 (move_it_vertically_backward): Don't look for character position
14354 immediately after the newline when in a continuation line.
14355 (Bug#9771, part 1)
2c91f553 14356
c7b08b0d
MR
143572011-10-15 Martin Rudalics <rudalics@gmx.at>
14358
14359 * window.c (coordinates_in_window): Rewrite and delabelize
14360 vertical border check. (Bug#5357) (Bug#9618)
14361
6b02f655
SM
143622011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
14363
14364 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
14365 errors in XSetWindowBorder (bug#9310).
14366
81d40c92
DA
143672011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
14368
14369 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
14370 avoid crash when xmalloc overrun checking is enabled.
14371
d4172c3b
EZ
143722011-10-13 Eli Zaretskii <eliz@gnu.org>
14373
14374 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
14375 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
14376 cursor motion with <left> and <right> arrow keys.
14377
14378 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
14379 some callers set that themselves.
14380
b00eea75
EZ
143812011-10-12 Eli Zaretskii <eliz@gnu.org>
14382
14383 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
14384 display string and the previous row comes from the same string and
14385 is empty. (Bug#9739) (Bug#9738)
14386
8fe012c4
SM
143872011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
14388
14389 * doc.c (get_doc_string): Encode file name (bug#9735).
14390
0074aef2
EZ
143912011-10-12 Eli Zaretskii <eliz@gnu.org>
14392
79beb178
EZ
14393 * bidi.c (bidi_level_of_next_char):
14394 * xdisp.c (get_visually_first_element): Remove old incorrect
14395 comments regarding the Unicode Line Separator character.
14396
0074aef2
EZ
14397 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
14398
6e4b3fbe
DA
143992011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
14400
14401 * alloc.c (Fgc_status): Do not access beyond zombies array
14402 boundary if nzombies > MAX_ZOMBIES.
14403 * alloc.c (dump_zombies): Add missing format specifier.
14404
0324f3af
PE
144052011-10-12 Paul Eggert <eggert@cs.ucla.edu>
14406
b5525cac
PE
14407 * xdisp.c (set_cursor_from_row): Simplify conditionals,
14408 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
14409
0324f3af
PE
14410 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
14411 Some packages use them to denote characters with modifiers.
14412
e9b5f888
AS
144132011-10-11 Andreas Schwab <schwab@linux-m68k.org>
14414
14415 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
14416 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
14417 matching a pp-number. Rename parameter var to var1.
14418
127827c0
SM
144192011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
14420
14421 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
14422
c8fd3bd0
GM
144232011-10-08 Glenn Morris <rgm@gnu.org>
14424
14425 * callint.c (Fcall_interactively): Give a more explicit error for the
14426 'c' case with a non-character input. (Bug#8479)
14427
352ec8ff
EZ
144282011-10-08 Eli Zaretskii <eliz@gnu.org>
14429
03669ccb
EZ
14430 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
14431 lines.
7061c986
EZ
14432 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
14433 lines that are hscrolled on the left.
03669ccb 14434
352ec8ff
EZ
14435 * dispnew.c (buffer_posn_from_coords): Account for a possible
14436 presence of header-line. (Bug#4426)
14437
a66cfb1c
SM
144382011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
14439
6b02f655
SM
14440 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
14441 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 14442
7c5ee88e
PE
144432011-10-07 Paul Eggert <eggert@cs.ucla.edu>
14444
14445 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
14446 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
14447 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
14448 this makes Emacs dump core during garbage collection on rare
14449 occasions. sizeof is obviously inferior to offsetof here, so
14450 stick with offsetof.
14451 (GC_POINTER_ALIGNMENT): New macro.
14452 (mark_memory): Omit 3rd (offset) arg; caller changed.
14453 Don't assume EMACS_INT alignment is the same as pointer alignment.
14454
df1bbe5b
SM
144552011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
14456
14457 * keyboard.c (read_key_sequence_remapped): New var.
14458 (read_key_sequence): Compute remapping in the right buffer.
14459 (command_loop_1): Use read_key_sequence's remapping directly.
14460
51553db6
SM
144612011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
14462
32c1fffd
SM
14463 * dired.c (file_name_completion): Don't expand file name.
14464 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
14465 before checking file name handler.
14466
51553db6
SM
14467 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
14468 they've been requested explicitly (bug#9591).
14469
b6bd1599 144702011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
14471
14472 * keymap.c (Fsingle_key_description): Use make_specified_string
14473 instead of build_string to build string from push_key_description.
14474 (Bug#5193)
14475
f701dc2a
PE
144762011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14477
4222c55d
PE
14478 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
14479 This fixes a Y2038 bug on 64-bit hosts.
14480 * buffer.c (reset_buffer):
14481 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
14482 (Fclear_buffer_auto_save_failure):
14483 Use 0, not -1, to represent an unset failure time, since time_t
14484 might not be signed.
14485
f701dc2a
PE
14486 Remove dependency on glibc malloc internals.
14487 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14488 Move back here from lisp.h, but with their new implementations.
14489 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14490 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
14491 * charset.c (charset_table_init): New static var.
14492 (syms_of_charset): Use it instead of xmalloc. This removes a
14493 dependency on glibc malloc internals. See Eli Zaretskii's comment in
14494 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
14495 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14496 Move back to alloc.c.
14497 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14498 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
14499
9ceebf39
JD
145002011-09-30 Jan Djärv <jan.h.d@swipnet.se>
14501
14502 * nsterm.m (windowDidResize): Call x_set_window_size only when
14503 ns_in_resize is true. Otherwise set pixelwidth/height and
14504 call change_frame_size (Bug#9628).
14505
cb993c58
PE
145062011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14507
3930c88b
PE
14508 Port --enable-checking=all to Fedora 14 x86-64.
14509 * charset.c (syms_of_charset): Also account for glibc malloc's
14510 internal overhead when calculating the initial malloc maximum.
14511
cb993c58
PE
14512 Port --enable-checking=all to Fedora 14 x86.
14513 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14514 Move to lisp.h.
14515 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
14516 (overrun_check_realloc, overrun_check_free):
14517 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
14518 That way, xmalloc returns a properly-aligned pointer even if
14519 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
14520 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
14521 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
14522 into account when calculating the initial malloc maximum.
14523 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14524 Move here from alloc.c, so that charset.c can use it too.
14525 Properly align; the old code wasn't right for common 32-bit hosts
14526 when configured with --enable-checking=all.
14527 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14528 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
14529
31bed486
EZ
145302011-09-29 Eli Zaretskii <eliz@gnu.org>
14531
04c70788 14532 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
14533 use EDOM.
14534
fbcaa2f3
EZ
145352011-09-28 Eli Zaretskii <eliz@gnu.org>
14536
14537 * xdisp.c (compute_display_string_end): If there's no display
14538 string at CHARPOS, return -1.
14539
14540 * bidi.c (bidi_fetch_char): When compute_display_string_end
14541 returns a negative value, treat the character as a normal
14542 character not covered by a display string. (Bug#9624)
14543
a239d4e9
JB
145442011-09-28 Juanma Barranquero <lekktu@gmail.com>
14545
14546 * lread.c (Fread_from_string): Fix typo in docstring.
14547
88652fd5
EZ
145482011-09-27 Eli Zaretskii <eliz@gnu.org>
14549
14550 * xdisp.c (handle_invisible_prop): If invisible text ends on a
14551 newline, reseat the iterator instead of bidi-iterating there one
14552 character at a time. (Bug#9610)
32c1fffd
SM
14553 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
14554 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 14555
ed497dd4
AS
145562011-09-27 Andreas Schwab <schwab@linux-m68k.org>
14557
14558 * lread.c (readevalloop): Use correct code for NBSP.
14559 (read1): Likewise. (Bug#9608)
14560
b2bf61aa
MA
145612011-09-25 Michael Albinus <michael.albinus@gmx.de>
14562
14563 * dbusbind.c (Fdbus_register_signal): When service is not
14564 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
14565
32bbb17c
GM
145662011-09-25 Glenn Morris <rgm@gnu.org>
14567
14568 * buffer.c (truncate-lines): Doc fix.
14569
94e0933e
CY
145702011-09-24 Chong Yidong <cyd@stupidchicken.com>
14571
14572 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
14573 (Fset_window_next_buffers): Doc fix.
14574
cddde921
GM
145752011-09-24 Glenn Morris <rgm@gnu.org>
14576
14577 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
14578
1260aef1
PE
145792011-09-24 Paul Eggert <eggert@cs.ucla.edu>
14580
25b4bfa0
PE
14581 Fix minor problems found by static checking.
14582 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
14583 * indent.c (Fvertical_motion): Fix == vs = typo.
14584
e3cbd34b
EZ
145852011-09-24 Eli Zaretskii <eliz@gnu.org>
14586
a66cfb1c
SM
14587 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
14588 Default value is now t. Doc fix.
6bf7006f 14589
e3cbd34b 14590 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 14591 logic when moving up, not only when moving down. Fix the
e3cbd34b 14592 confusing name and values of the it_overshoot_expected variable;
32c1fffd 14593 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
14594
14595 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
14596 CHARPOS is covered by a display string which includes newlines.
14597 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
14598 is covered by a display string with embedded newlines.
14599
a3de0cbd
MA
146002011-09-24 Michael Albinus <michael.albinus@gmx.de>
14601
14602 * dbusbind.c (Fdbus_register_signal): Add match rule to
14603 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
14604 (Fdbus_register_method, Vdbus_registered_objects_table):
14605 Fix docstring.
a3de0cbd 14606
b260039d
JM
146072011-09-24 Jim Meyering <meyering@redhat.com>
14608
32c1fffd 14609 do not ignore write error for any output size
b260039d
JM
14610 The previous change was incomplete.
14611 While it makes emacs --batch detect the vast majority of stdout
14612 write failures, errors were still ignored whenever the output size is
14613 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
14614 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
14615 && echo FAIL: ignored write error
14616 FAIL: ignored write error
14617 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
14618 && echo FAIL: ignored write error
14619 FAIL: ignored write error
14620 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
14621
8eca8a7c
AS
146222011-09-23 Andreas Schwab <schwab@linux-m68k.org>
14623
14624 * emacs.c (Fkill_emacs): In noninteractive mode exit
14625 non-successfully if a write error occurred on stdout. (Bug#9574)
14626
3341db62
EZ
146272011-09-21 Eli Zaretskii <eliz@gnu.org>
14628
14629 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
14630 the xassert test.
14631
14632 * dispextern.h (struct it): Update the comment documenting what
14633 can it->OBJECT be.
14634
8c203dbf
EZ
146352011-09-20 Eli Zaretskii <eliz@gnu.org>
14636
14637 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
14638 a display string, extend search for cursor position to end of row.
14639 (find_row_edges): If the row ends in a newline from a display
14640 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
14641 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
14642 (Fcurrent_bidi_paragraph_direction): Fix search for previous
14643 non-empty line. Fixes confusing cursor motion with arrow keys at
14644 the beginning of a line that starts with whitespace.
8c203dbf 14645
a4824228
LMI
146462011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14647
14648 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
14649 (bug#9493).
14650
33ed493b
CY
146512011-09-18 Chong Yidong <cyd@stupidchicken.com>
14652
14653 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
14654 boolean (Bug#9154).
14655
56cd55c8
EZ
146562011-09-18 Eli Zaretskii <eliz@gnu.org>
14657
14658 * xdisp.c (display_line): Record maximum and minimum buffer
14659 positions even if no glyphs were produced (e.g., by a zero-width
14660 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
14661 buffer positions that will be removed from the glyph row because
14662 they don't fit.
c02dcedf
EZ
14663 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
14664 column is beyond frame width: don't subtract 1 "pixel" when
14665 computing width of the stretch.
3e62b7e0
EZ
14666 (reseat_at_next_visible_line_start): Undo the change made on
14667 2011-09-17 that saved paragraph information and restored it after
14668 the call to `reseat'. (Bug#9545)
56cd55c8 14669
5ed99d36 146702011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
14671
14672 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
14673 and turn window cursor on if cleared (Bug#9415).
14674
5ed99d36 146752011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
14676
14677 * search.c (boyer_moore): Take unibyte characters from pattern
14678 literally. (Bug#9458)
14679
9bade7b2
EZ
146802011-09-18 Eli Zaretskii <eliz@gnu.org>
14681
14682 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
14683
e5e9d610
PE
146842011-09-18 Paul Eggert <eggert@cs.ucla.edu>
14685
87e4427a
PE
14686 Fix minor problem found by static checking.
14687 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
14688 initialized, to pacify gcc -Wuninitialized.
14689
e5e9d610
PE
14690 * fileio.c: Report proper errno when syscall falls.
14691 (Finsert_file_contents): Save and restore errno,
14692 so that report_file_error outputs the correct diagnostic.
14693 (Fwrite_region) [CLASH_DETECTION]: Likewise.
14694
a1674f0b
EZ
146952011-09-18 Eli Zaretskii <eliz@gnu.org>
14696
14697 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
14698
fbfb6dd4
EZ
146992011-09-17 Eli Zaretskii <eliz@gnu.org>
14700
14701 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
14702 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
14703
bb187662
EZ
147042011-09-17 Eli Zaretskii <eliz@gnu.org>
14705
1137e8b8 14706 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 14707 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
14708
14709 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
14710 (bidi_find_paragraph_start): Search back for paragraph beginning
14711 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
14712 (bidi_move_to_visually_next): Only trigger paragraph-related
14713 computations when the last character is a newline or at EOB, not
14714 just any NEUTRAL_B. (Bug#9470)
14715
bb187662
EZ
14716 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
14717 truncated lines if point is covered by a display string. (Bug#9524)
14718
2e621251
PE
147192011-09-16 Paul Eggert <eggert@cs.ucla.edu>
14720
14721 * xselect.c: Relax test for outgoing X longs (Bug#9498).
14722 (cons_to_x_long): New function.
14723 (lisp_data_to_selection_data): Use it. Correct the test for
14724 short-versus-long data; it was negated. Break out of vector
14725 loop, for efficiency, when a long datum is discovered.
14726
91a15bc6
SM
147272011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
14728
14729 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
14730
b41c3a35
EZ
147312011-09-16 Eli Zaretskii <eliz@gnu.org>
14732
14733 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
14734 GCC PR/17406) by declaring this function with external scope.
14735
7812ba2d
PE
147362011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14737
14738 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
14739 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
14740
cf7edc2a
AS
147412011-09-15 Andreas Schwab <schwab@linux-m68k.org>
14742
14743 * editfns.c (Fformat): Correctly handle text properties on "%%".
14744
bd01620e
EZ
147452011-09-15 Eli Zaretskii <eliz@gnu.org>
14746
14747 * xterm.c (x_draw_composite_glyph_string_foreground):
14748 * w32term.c (x_draw_composite_glyph_string_foreground):
14749 * term.c (encode_terminal_code):
14750 * composite.c (composition_update_it, get_composition_id):
14751 * xdisp.c (get_next_display_element)
14752 (fill_composite_glyph_string): Add comments about special meaning
14753 of TAB characters in a composition.
14754
a02719a3
PE
147552011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14756
14757 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
14758 This occurs when processing a multibyte format.
14759 Problem reported by Wolfgang Jenker.
a02719a3 14760
72589a3c
JB
147612011-09-15 Johan Bockgård <bojohan@gnu.org>
14762
14763 * xdisp.c (try_cursor_movement): Only check for exact match if
14764 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
14765
1c14176c
PE
147662011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14767
14768 Remove unused external symbols.
14769 * dispextern.h (calc_pixel_width_or_height): Remove decl.
14770 * xdisp.c (calc_pixel_width_or_height): Now static.
14771 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
14772 * indent.c (check_display_width):
14773 * w32term.c: Fix comment to match code.
14774 * xterm.c, xterm.h (x_catching_errors): Remove.
14775
d2eea5b5
PE
147762011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14777
14778 * xselect.c: Use signed conversions more consistently (Bug#9498).
14779 (selection_data_to_lisp_data): Assume incoming selection data are
14780 signed integers, not unsigned. This is to be consistent with
14781 outgoing selection data, which was modified to use signed integers
14782 in as part of the fix to Bug#9196 in response to Jan D.'s comment
14783 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
14784 expects long, not unsigned long.
14785
46888499
EZ
147862011-09-14 Eli Zaretskii <eliz@gnu.org>
14787
14788 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
14789 computation of loop end. Reported by Johan Bockgård
14790 <bojohan@gnu.org>.
14791
ef8ef9fb
CY
147922011-09-13 Chong Yidong <cyd@stupidchicken.com>
14793
14794 * frame.c (Fother_visible_frames_p): Function deleted.
14795
fa819fed
EZ
147962011-09-12 Eli Zaretskii <eliz@gnu.org>
14797
14798 * indent.c (compute_motion): Process display vector front to back
14799 rather than the other way around. (Bug#2496)
14800
2ba8e008
SM
148012011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
14802
14803 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
14804
20f53c69
CY
148052011-09-11 Chong Yidong <cyd@stupidchicken.com>
14806
14807 * minibuf.c (Fread_from_minibuffer): Doc fix.
14808
d562d7a4
EZ
148092011-09-11 Eli Zaretskii <eliz@gnu.org>
14810
14811 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
14812 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
14813
1c4d7f3d
LMI
148142011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14815
14816 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
14817 value for non-existent files.
14818
b885bf36
EZ
148192011-09-11 Eli Zaretskii <eliz@gnu.org>
14820
14821 * fileio.c (Finsert_file_contents): If the file cannot be opened,
14822 set its "size" to -1. This will set the modtime_size field of
14823 the corresponding buffer to -1, which is what
14824 verify-visited-file-modtime expects for files that do not exist.
14825 (Bug#9139)
14826
6612f0bf
PE
148272011-09-11 Paul Eggert <eggert@cs.ucla.edu>
14828
14829 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
14830 here ...
14831 * lisp.h: ... from here. push_key_description is no longer
14832 defined in keyboard.c, so its declaration should not be in
14833 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
14834 logically belongs with push_key_description.
14835
dfb3f755
PE
148362011-09-10 Paul Eggert <eggert@cs.ucla.edu>
14837
14838 * buffer.h: Include <sys/types.h> instead of <time.h>.
14839 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
14840 Problem reported by Herbert J. Skuhra.
14841
3134906c
LMI
148422011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
14843
14844 * xml.c (parse_region): Make the parsing work for
14845 non-comment-starting XML files again (bug#9144).
14846
8d903f4e
AS
148472011-09-10 Andreas Schwab <schwab@linux-m68k.org>
14848
14849 * image.c (gif_load): Fix calculation of bottom and right corner.
14850 (Bug#9468)
14851
80ad64f4
EZ
148522011-09-10 Eli Zaretskii <eliz@gnu.org>
14853
14854 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
14855 redisplay in small windows.
14856
208a048d
EZ
148572011-09-09 Eli Zaretskii <eliz@gnu.org>
14858
14859 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
14860
9b1c252e
MR
148612011-09-08 Martin Rudalics <rudalics@gmx.at>
14862
14863 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
14864 Operate on live windows only.
14865
2949f33b
JB
148662011-09-08 Juanma Barranquero <lekktu@gmail.com>
14867
14868 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
14869
e08dcafd
EZ
148702011-09-07 Eli Zaretskii <eliz@gnu.org>
14871
14872 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
14873 only under bidi iteration.
14874
115b96bd
JD
148752011-09-07 Jan Djärv <jan.h.d@swipnet.se>
14876
14877 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
14878
c8199d0f
PE
148792011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14880
14881 isnan: Fix porting problem to Solaris 10 with bundled gcc.
14882 Without this fix, the command to link temacs failed due to an
14883 undefined symbol __builtin_isnan. This is because
14884 /usr/include/iso/math_c99.h #defines isnan(x) to
14885 __builtin_isnan(x), but the bundled gcc, which identifies itself
14886 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
14887 a __builtin_isnan.
14888 * floatfns.c (isnan): #undef, and then #define to a clone of
14889 what's in data.c.
14890 (Fisnan): Always define, since it's always available now.
14891 (syms_of_floatfns): Always define isnan at the Lisp level.
14892
e39b275c 148932011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
14894
14895 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
14896
b2db44d9 148972011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 14898
f4af5137 14899 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
14900 The previous code assumed that file offsets (off_t values) fit in
14901 EMACS_INT variables, which is not true on typical 32-bit hosts.
14902 The code messed up by falsely reporting buffer overflow in cases
14903 such as (insert-file-contents "big" nil 1 2) into an empty buffer
14904 when "big" contains more than 2**29 bytes, even though this
14905 inserts just one byte and does not overflow the buffer.
14906 (Finsert_file_contents): Store file offsets as off_t
14907 values, not as EMACS_INT values. Check for overflow when
14908 converting between EMACS_INT and off_t. When checking for
14909 buffer overflow or for overlap, take the offsets into account.
14910 Don't use EMACS_INT for small values where int suffices.
14911 When checking for overlap, fix a typo: ZV was used where
14912 ZV_BYTE was intended.
14913 (Fwrite_region): Don't assume off_t fits into 'long'.
14914 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
14915
ecfc0a49
MA
149162011-09-05 Michael Albinus <michael.albinus@gmx.de>
14917
14918 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
14919
6511acf2 149202011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 14921
0999621a 14922 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
14923
14924 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 14925 (esprintf, exprintf, evxprintf): New functions.
62f19c19 14926 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 14927 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
14928 (modify_event_symbol): Do not assume that the length of
14929 name_alist_or_stem is safe to alloca and fits in int.
14930 (Fexecute_extended_command): Likewise for function name and binding.
14931 (Frecursion_depth): Wrap around reliably on integer overflow.
14932 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
14933 since some callers pass EMACS_INT values.
14934 (Fsingle_key_description): Don't crash if symbol name contains more
14935 than MAX_ALLOCA bytes.
14936 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
14937 (get_minibuffer): Arg is now EMACS_INT, not int.
14938 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 14939 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
14940 * window.h (command_loop_level, minibuf_level): Reflect API changes.
14941
2be7d702
PE
14942 * dbusbind.c (signature_cat): New function.
14943 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
14944 Do not overrun buffer; instead, report string overflow.
14945
9d1df220
PE
14946 * dispnew.c (add_window_display_history): Don't overrun buffer.
14947 Truncate instead; this is OK since it's just a log.
14948
33ef5c64
PE
14949 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
14950 even if the time zone offset is outlandishly large.
14951 Don't mishandle offset == INT_MIN.
14952
66c6fdd5
PE
14953 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
14954 when creating daemon; the previous buffer-overflow check was incorrect.
14955
d749b01b
PE
14956 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
14957 which has the guts of the old verror function.
14958
b5cd1905
PE
14959 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
14960 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
14961
6e1a67fb
PE
14962 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
14963 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 14964 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 14965 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
14966 length of string rather than counting it via multiple sprintfs;
14967 that's simpler and more reliable.
c21721cc
PE
14968 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
14969 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
14970 sprintf, in case result does not fit in int.
14971
c57b67fc
PE
14972 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
14973 (fontset_from_font): Print it.
14974
8a401434
PE
14975 * frame.c (tty_frame_count): Now printmax_t, not int.
14976 (make_terminal_frame, set_term_frame_name): Print it.
14977 (x_report_frame_params): In X, window IDs are unsigned long,
14978 not signed long, so print them as unsigned.
14979 (validate_x_resource_name): Check for implausibly long names,
14980 and don't assume name length fits in 'int'.
14981 (x_get_resource_string): Don't blindly alloca invocation name;
14982 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
14983 not fit in int.
14984
6e1a67fb
PE
14985 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
14986 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
14987 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
14988
0df02bf3
PE
14989 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
14990 Use esprintf, not sprintf, in case result does not fit in int.
14991
48e30793
PE
14992 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14993 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
14994 it as a large positive number.
14995 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
14996 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14997
a66ff6d8
PE
14998 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
14999 in case result does not fit in int.
15000
aca216ff
PE
15001 * print.c (float_to_string): Detect width overflow more reliably.
15002 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15003 buffer overrun. Don't assume list length fits in 'int'. Treat
15004 print length of 0 as 0, not as infinity; to be consistent with other
15005 uses of print length in this function. Don't overflow print length
15006 index. Don't assume hash table size fits in 'long', or that
15007 vectorlike size fits in 'unsigned long'.
15008
31c286f7
PE
15009 * process.c (make_process): Use printmax_t, not int, to format
15010 process-name gensyms.
15011
55e5faa1
PE
15012 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15013
80f2e268
PE
15014 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15015 to avoid potential buffer overrun.
15016
670741ab
PE
15017 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15018 if X resource line is longer than 512 bytes.
15019
b7163a50
PE
15020 * xfns.c (x_window): Make sprintf buffer a bit bigger
15021 to avoid potential buffer overrun.
15022
ae58ff1f
PE
15023 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15024
c43c8a6a
PE
15025 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15026
3f8236f4
PE
150272011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15028
53e9fe90 15029 Integer overflow fixes for scrolling, etc.
6511acf2
PE
15030 Without these, Emacs silently mishandles large integers sometimes.
15031 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
15032 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15033
6511acf2
PE
15034 * xdisp.c (try_window_id): Check Emacs fixnum range before
15035 converting to 'int'.
806add1d 15036
6511acf2 15037 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
15038 Check that an Emacs fixnum is in range before assigning it to 'int'.
15039 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15040 values converted from Emacs fixnums.
15041 (Frecenter): Don't wrap around a line count if it is out of 'int'
15042 range; instead, treat it as an extreme value.
15043 (Fset_window_configuration, compare_window_configurations):
15044 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15045
6511acf2
PE
15046 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15047 that can exceed INT_MAX. Check that EMACS_INT value is in range
15048 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
15049 (match_limit): Don't assume that a fixnum can fit in 'int'.
15050
6511acf2 15051 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
15052 exceed INT_MAX.
15053
6511acf2 15054 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
15055 (Fvertical_motion): Don't wrap around LINES values that don't fit
15056 in 'int'. Instead, treat them as extreme values. This is good
15057 enough for windows, which can't have more than INT_MAX lines anyway.
15058
fcb901a7
LMI
150592011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15060
0f2f6b6d
LMI
15061 * Require libxml/parser.h to avoid compilation warning.
15062
fcb901a7
LMI
15063 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15064
15065 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15066 since this reportedly can destroy thread storage.
15067
6e20a0d4
CY
150682011-08-30 Chong Yidong <cyd@stupidchicken.com>
15069
15070 * syntax.c (find_defun_start): Update all cache variables if
15071 exiting early (Bug#9401).
15072
148ae00e
EZ
150732011-08-30 Eli Zaretskii <eliz@gnu.org>
15074
f6cfbd8f
EZ
15075 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15076
148ae00e
EZ
15077 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15078 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15079 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15080
15081 * term.c (tty_append_glyph): New function.
15082 (produce_stretch_glyph): Static function and its prototype deleted.
15083
a66cfb1c
SM
15084 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15085 Add prototypes.
148ae00e 15086
c4a07a4c
PE
150872011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15088
15089 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15090 when checking :margin (Bug#9390).
15091 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 15092 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
15093 so that the name doesn't mislead. All uses changed.
15094
6bc8cd65
JB
150952011-08-28 Johan Bockgård <bojohan@gnu.org>
15096
15097 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15098 set_tty_hooks.
15099
dca4927e
EZ
151002011-08-27 Eli Zaretskii <eliz@gnu.org>
15101
15102 * xdisp.c (move_it_to): Don't bail out early when reaching
15103 position beyond to_charpos, if we are scanning backwards.
15104 (move_it_vertically_backward): When DY == 0, make sure we get to
15105 the first character in the line after the newline.
15106
f2cad773
PE
151072011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15108
15109 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15110 (ccl_driver): Do not generate an out-of-range pointer.
15111 (Fccl_execute_on_string): Remove unnecessary check for
15112 integer overflow, noted by Stefan Monnier in
15113 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15114 Remove a FIXME that didn't need fixing.
15115 Simplify the newly-introduced buffer reallocation code.
15116
0cae2cdb
JB
151172011-08-27 Juanma Barranquero <lekktu@gmail.com>
15118
15119 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15120
5fc295a4 151212011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 15122
70c60eb2 15123 Integer and memory overflow issues (Bug#9196).
726e0ab1 15124
d31850da
PE
15125 * doc.c (get_doc_string): Rework so that
15126 get_doc_string_buffer_size is the actual buffer size, rather than
15127 being 1 less than the actual buffer size; this makes xpalloc more
15128 convenient.
15129
a69fbedb
PE
15130 * image.c (x_allocate_bitmap_record, cache_image):
15131 * xselect.c (Fx_register_dnd_atom):
15132 Simplify previous changes by using xpalloc.
15133
fe5c5d37
PE
15134 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15135 since either will do and ptrdiff_t is convenient with xpalloc.
15136
0065d054
PE
15137 * charset.c (charset_table_size)
15138 (struct charset_sort_data.priority): Now ptrdiff_t.
15139 (charset_compare): Don't overflow if priorities differ greatly.
15140 (Fsort_charsets): Don't assume list length fits in int.
15141 Check for size-calculation overflow when allocating sort data.
15142 (syms_of_charset): Allocate an initial charset table that is
15143 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15144
15145 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15146
15147 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15148 The actual value is always <= INT_MAX, and leaving it unsigned made
15149 overflow checking harder.
15150
15151 * dispextern.h (struct glyph_matrix.rows_allocated)
15152 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15153 with xpalloc. The values are still always <= INT_MAX.
15154
15155 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15156
15157 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15158 (SAFE_NALLOCA): New macro.
15159
15160 * region-cache.c (struct boundary.pos, find_cache_boundary)
15161 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15162 (set_cache_region, invalidate_region_cache)
15163 (revalidate_region_cache, know_region_cache, region_cache_forward)
15164 (region_cache_backward, pp_cache):
15165 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15166 so that ptrdiff_t * can be passed to xpalloc.
15167 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15168 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15169 (pp_cache): Don't assume cache_len fits in int.
15170 * region-cache.h: Adjust extern decls to match.
15171
15172 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15173 EMACS_INT, since either will do, for xpalloc.
15174
15175 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15176 (xnmalloc, xnrealloc, xpalloc): New functions.
15177
726e0ab1
PE
15178 * bidi.c (bidi_shelve_header_size): New constant.
15179 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15180 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15181
51f30bc5 15182 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
15183 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15184 (overlay_strings):
15185 Don't update size of array until after memory allocation succeeds,
15186 because xmalloc/xrealloc may not return.
0065d054
PE
15187 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15188 now that we have proper integer overflow checking.
15189 (record_overlay_string, overlay_strings): Catch overflows when
15190 calculating size of overlay_str_buf.
726e0ab1 15191
0065d054
PE
15192 * callproc.c (Fcall_process): Check for size overflow when
15193 calculating size of args2.
15194 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15195 Normally we prefer signed values, but sticking with ptrdiff_t would
15196 require adding more-complicated checks.
726e0ab1
PE
15197
15198 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15199 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15200 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 15201 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
15202
15203 * character.c (Fstring): Check for size-calculation overflow.
15204
15205 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15206 unnecessary integer overflow. Check for size overflow.
15207 (encode_coding_object): Don't update size until xmalloc succeeds.
15208
15209 * composite.c (get_composition_id): Check for overflow in glyph
15210 length calculations.
15211
15212 Integer and memory overflow fixes for display code.
15213 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15214 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15215 (scrolling_window): Check for overflow in size calculations.
15216 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15217 Don't assume glyph table len fits in int.
15218 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15219 (row_table_size): Now ptrdiff_t, not int.
15220 (scrolling_window): Avoid overflow in size calculations.
15221 Don't update size until allocation succeeds.
15222 * fns.c (concat): Check for overflow in size calculations.
15223 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15224 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15225 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15226
15227 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15228 (get_doc_string): Check for size calculation overflow.
15229 Don't update size until allocation succeeds.
15230 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15231 EMACS_INT, where ptrdiff_t will do.
15232 (Fsubstitute_command_keys): Check for string overflow.
15233
15234 * editfns.c (set_time_zone_rule): Don't assume environment length
15235 fits in int.
15236 (message_length): Now ptrdiff_t, not int.
15237 (Fmessage_box): Don't update size until allocation succeeds.
15238 Don't assume message length fits in int.
15239 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15240
0065d054
PE
15241 * emacs.c (main): Do not reallocate argv, since there is a null at
15242 the end that can be overwritten, and this way there's no need to
15243 worry about size-calculation overflow.
15244 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
15245
15246 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15247 alloc succeeds.
15248 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15249
15250 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15251 (x_set_scroll_bar_width, x_figure_window_size):
15252 Check for integer overflow.
15253 (x_set_alpha): Do not assume XINT fits in int.
15254
15255 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15256 This is for the members text_lines, text_cols, total_lines, total_cols,
15257 where the system imposes an 'int' limit.
15258
15259 * fringe.c (Fdefine_fringe_bitmap):
15260 Don't update size until alloc works.
15261
15262 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15263 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15264
15265 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15266 Check for size-calculation overflow.
15267 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15268 do, as we prefer signed integers.
15269 (id_to_widget.max_size, id_to_widget.used)
15270 (xg_store_widget_in_map, xg_remove_widget_from_map)
15271 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15272 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15273 Use and return ptrdiff_t, not int.
15274 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15275 * gtkutil.h: Change prototypes to match the above.
15276
15277 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15278 are duplicate now that they've been promoted to lisp.h.
15279 (x_allocate_bitmap_record, x_alloc_image_color)
15280 (make_image_cache, cache_image, xpm_load):
15281 Don't update size until alloc is done.
15282 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15283 (x_detect_edges):
3256efce 15284 Check for size calculation overflow.
726e0ab1
PE
15285 (ct_colors_allocated_max): New constant.
15286 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15287 overflow.
3256efce 15288
726e0ab1
PE
15289 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15290 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
15291 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
15292 Use ptrdiff_t, not int, to count maps.
15293 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
15294 calculations. Don't update size until allocation succeeds.
15295 Redo calculations to avoid overflow.
726e0ab1
PE
15296 * keyboard.h: Change prototypes to match the above.
15297
15298 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
15299 to count maps.
15300 (current_minor_maps): Check for size calculation overflow.
15301 * keymap.h: Change prototypes to match the above.
15302
15303 * lread.c (read1, init_obarray): Don't update size until alloc done.
15304
15305 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
15306 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
15307
726e0ab1
PE
15308 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
15309 Now ptrdiff_t, not int.
15310 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
15311 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
15312
15313 * process.c (Fnetwork_interface_list): Check for overflow
15314 in size calculation.
15315
15316 * region-cache.c (move_cache_gap): Check for size calculation overflow.
15317
15318 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
15319 overflow. Don't bother calling xmalloc when xrealloc will do.
15320
15321 * search.c (Freplace_match): Check for size calculation overflow.
15322 (Fset_match_data): Don't assume list lengths fit in 'int'.
15323
15324 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
15325 for command line length. Do not attempt to address one before the
15326 beginning of an array, as that's not portable.
15327
15328 * term.c (max_frame_lines): Remove; unused.
15329 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
15330 not int.
15331 (encode_terminal_code, calculate_costs): Check for size
15332 calculation overflow.
15333 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
15334 table lengths and related sizes. Don't update size until alloc
15335 done. Redo calculations to avoid overflow.
15336 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
15337
15338 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
15339 subtracting pointers.
15340 (gobble_line): Check for overflow more carefully. Don't update size
15341 until alloc done.
15342
15343 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
15344 Don't update size until alloc done.
15345 Redo size calculations to avoid overflow.
15346 Check for size calculation overflow.
0065d054 15347 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
15348
15349 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
15350 Use ptrdiff_t, not int, for sizes.
15351 (store_mode_line_noprop_char): Don't update size until alloc done.
15352
0065d054
PE
15353 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
15354 Use ptrdiff_t, not int, for sizes.
15355 (Finternal_make_lisp_face, cache_face):
15356 Check for size calculation overflow.
15357 (cache_face): Treat size calculation overflows as if they were
15358 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
15359
15360 * xfns.c (x_encode_text, x_set_name_internal)
15361 (Fx_change_window_property): Use ptrdiff_t, not int, to count
15362 sizes, since they can exceed INT_MAX in size. Check for size
15363 calculation overflow.
15364
0065d054
PE
15365 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
15366 (xg_select): Check for size calculation overflow.
726e0ab1
PE
15367 Don't update size until alloc done.
15368
0065d054 15369 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 15370 as sprintf is limited to int lengths.
1d526e2f 15371
252c5ee1
PE
15372 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
15373 (X_LONG_MIN): New macros.
864d7ce7
PE
15374 Use them to make the following changes clearer.
15375 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
15376 This change doesn't affect the value now, but it may help remind
15377 future maintainers not to raise the value too much later.
15378 (SELECTION_QUANTUM): Remove, replacing with ...
15379 (selection_quantum): ... new function, which avoids overflow.
15380 All uses changed.
15381 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
15382 assumption that selection length fits in 'int'.
15383 (x_reply_selection_request, x_handle_selection_request)
15384 (x_get_window_property, receive_incremental_selection)
15385 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
15386 (lisp_data_to_selection_data, clean_local_selection_data):
15387 Use ptrdiff_t, not int, to record length of selection.
15388 (x_reply_selection_request, x_get_window_property)
15389 (receive_incremental_selection, x_property_data_to_lisp):
15390 Redo calculations to avoid overflow.
15391 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 15392 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
15393 something.
15394 (x_get_window_property, receive_incremental_selection)
15395 (lisp_data_to_selection_data, x_property_data_to_lisp):
15396 Check for size-calculation overflow.
15397 (x_get_window_property, receive_incremental_selection)
15398 (lisp_data_to_selection_data, Fx_register_dnd_atom):
15399 Don't store size until memory allocation succeeds.
15400 (x_get_window_property): Plug memory leak on memory exhaustion.
15401 Don't double-block input; malloc is safe here. Don't assume 2**34
15402 - 4 fits in unsigned long. Add an xassert to check
15403 XGetWindowProperty overflow. Be more careful about overflow
15404 calculations, and distinguish size from memory overflow better.
15405 (receive_incremental_selection): When tracing, don't assume
15406 unsigned int is less than INT_MAX.
15407 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
15408 harmful) conversions of unsigned short to int.
15409 (lisp_data_to_selection_data): Don't assume that integers
15410 in the range -65535 through -1 fit in an X unsigned short.
15411 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
15412 result parameters unless successful. Rely on cons_to_unsigned
15413 to report problems with elements; the old code wasn't right anyway.
15414 (x_check_property_data): Check for int overflow; we cannot use
15415 a wider type due to X limits.
15416 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
15417
726e0ab1 15418 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 15419
0065d054
PE
15420 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
15421 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
15422 (x_color_cells): Don't store size until memory allocation succeeds.
15423 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 15424 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
15425 (x_term_init): Don't assume length fits in int (sprintf is limited
15426 to int size).
bc18e09d 15427
ebfa62c0
PE
15428 Use ptrdiff_t for composition IDs.
15429 * character.c (lisp_string_width):
15430 * composite.c (composition_table_size, n_compositions)
15431 (get_composition_id, composition_gstring_from_id):
15432 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
15433 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
15434 * window.c (Frecenter):
15435 Use ptrdiff_t, not int, for composition IDs.
15436 * composite.c (get_composition_id): Check for integer overflow.
15437 * composite.h: Adjust prototypes to match the above changes.
15438
d3411f89
PE
15439 Use ptrdiff_t for hash table indexes.
15440 * category.c (hash_get_category_set):
15441 * ccl.c (ccl_driver):
15442 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
15443 * coding.c (coding_system_charset_list, detect_coding_system):
15444 * coding.h (struct coding_system.id):
15445 * composite.c (get_composition_id, gstring_lookup_cache):
15446 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
15447 * image.c (xpm_get_color_table_h):
15448 * lisp.h (hash_lookup, hash_put):
15449 * minibuf.c (Ftest_completion):
15450 Use ptrdiff_t for hash table indexes, not int (which is too
15451 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
15452 32-bit --with-wide-int hosts).
15453
e097a6fa
PE
15454 * charset.c (Fdefine_charset_internal): Check for integer overflow.
15455 Add a FIXME comment about memory leaks.
15456 (syms_of_charset): Don't assume xmalloc returns.
15457
5637687f
PE
15458 Don't assume that stated character widths fit in int.
15459 * character.c (Fchar_width, c_string_width, lisp_string_width):
15460 * character.h (CHAR_WIDTH):
15461 * indent.c (MULTIBYTE_BYTES_WIDTH):
15462 Use sanitize_char_width to avoid undefined and/or bad behavior
15463 with outlandish widths.
a66cfb1c 15464 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
15465 now that we have two such functions. All uses changed.
15466 (sanitize_char_width): New inline function.
15467
a2271ba2
PE
15468 Don't assume that tab-width fits in int.
15469 * character.h (sanitize_width): New inline function.
15470 (SANE_TAB_WIDTH): New macro.
15471 (ASCII_CHAR_WIDTH): Use it.
15472 * indent.c (sane_tab_width): Remove. All uses replaced by
15473 SANE_TAB_WIDTH (current_buffer).
15474 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
15475
18c52557
PE
15476 * fileio.c: Integer overflow issues with file modes.
15477 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
15478
caeeedc1
PE
15479 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
15480 Remove unreachable code.
15481 (read_hex, load_charset_map_from_file): Check for integer overflow.
15482
6df6ae42 15483 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
15484 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
15485 (x_send_scroll_bar_event): Likewise. Check that the size does not
15486 exceed limits imposed by XClientMessageEvent, as well as the usual
15487 ptrdiff_t and size_t limits.
15488
b13995db
PE
15489 * keyboard.c: Overflow, signedness and related fixes.
15490 (make_lispy_movement): Use same integer type in forward decl
15491 that is used in the definition.
15492 (read_key_sequence, keyremap_step):
15493 Change bufsize argument back to int, undoing my 2011-03-30 change.
15494 We prefer signed types, and int is wide enough here.
15495 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
15496 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
15497 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
15498 length, not size_t. Use ptrdiff_t for index, not int.
15499 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
15500 possibility of integer overflow.
15501
13464394
PE
15502 Overflow, signedness and related fixes for images.
15503
15504 * dispextern.h (struct it.stack[0].u.image.image_id)
15505 (struct_it.image_id, struct image.id, struct image_cache.size)
15506 (struct image_cache.used, struct image_cache.ref_count):
15507 * gtkutil.c (update_frame_tool_bar):
15508 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
15509 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
15510 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
15511 * nsmenu.m (update_frame_tool_bar):
15512 * xdisp.c (calc_pixel_width_or_height):
15513 * xfns.c (image_cache_refcount):
15514 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
15515 on typical 64-bit hosts.
15516
15517 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15518 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
15519 Omit unnecessary casts to int.
15520 (parse_image_spec): Check that integers fall into 'int' range
15521 when the callers expect that.
15522 (image_ascent): Redo ascent calculation to avoid int overflow.
15523 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
15524 (lookup_image): Remove unnecessary tests.
15525 (xbm_image_p): Locals are now of int, not EMACS_INT,
15526 since parse_image_check makes sure they fit into int.
15527 (png_load, gif_load, svg_load_image):
15528 Prefer int to unsigned where either will do.
15529 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
15530 old tiff_error_handler and tiff_warning_handler.
15531 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
15532 stack buffer overflows. It uses only the features of vsnprintf
15533 that are common to both POSIX and native Microsoft.
15534 (tiff_error_handler, tiff_warning_handler): Use it.
15535 (tiff_load, gif_load, imagemagick_load_image):
15536 Don't assume :index value fits in 'int'.
15537 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
15538 (imagemagick_load_image): Check that crop parameters fit into
15539 the integer types that MagickCropImage accepts. Don't assume
15540 Vimagemagick_render_type has a nonnegative value. Don't assume
15541 size_t fits in 'long'.
15542 (gs_load): Use printmax_t to print the widest integers possible.
15543 Check for integer overflow when computing image height and width.
15544
c11821d4
EZ
155452011-08-26 Eli Zaretskii <eliz@gnu.org>
15546
15547 * xdisp.c (redisplay_window): Don't force window start if point
15548 will be invisible in the resulting window. (Bug#9324)
15549
0c95fcf7
EZ
155502011-08-25 Eli Zaretskii <eliz@gnu.org>
15551
15552 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
15553 the display spec is of the form `(space ...)'.
15554 (handle_display_spec): Return the value returned by
15555 handle_single_display_spec, not just 1 or zero.
15556 (handle_single_display_spec): If the display spec is of the form
15557 `(space ...)', and specifies display in the text area, return 2
15558 rather than 1.
fee65a97 15559 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
15560 accurately, and prefer exact match for point under bidi.
15561 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
15562
15563 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
15564 into disp_prop; all users changed.
15565
15566 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
15567 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
15568 for the text covered by the display property.
15569
e4ed06f1
CY
155702011-08-25 Chong Yidong <cyd@stupidchicken.com>
15571
15572 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
15573 Change return value to nil.
15574 (Frecord_buffer): Delete unused function.
15575
f67cdd7f
EZ
155762011-08-24 Eli Zaretskii <eliz@gnu.org>
15577
5980d4c6
EZ
15578 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
15579 buffers, return left-to-right.
8610fe8b
EZ
15580 (set_cursor_from_row): Consider candidate row a win if its glyph
15581 represents a newline and point is on that newline. Fixes cursor
15582 positioning on the newline at EOL of R2L text within L2R
15583 paragraph, and vice versa.
15584 (try_cursor_movement): Check continued rows, in addition to
15585 continuation rows. Fixes unwarranted scroll when point enters a
15586 continued line of R2L text within an L2R paragraph, or vice versa.
15587 (cursor_row_p): Consider the case of point being equal to
15588 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
15589 from the end of a short line to the beginning of a continued line
15590 of R2L text within L2R paragraph.
15591 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
15592 composed characters.
5980d4c6 15593
f67cdd7f
EZ
15594 * bidi.c (bidi_check_type): Use xassert.
15595 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
15596 members.
15597
bca633fb
EZ
155982011-08-23 Eli Zaretskii <eliz@gnu.org>
15599
15600 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
15601 a character.
15602
4a5885a7
CY
156032011-08-23 Chong Yidong <cyd@stupidchicken.com>
15604
15605 * nsfont.m (ns_otf_to_script): Fix typo.
15606
0902a04e
KH
156072011-08-22 Kenichi Handa <handa@m17n.org>
15608
15609 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
15610 extra slot even if the purpose is char-code-property-table.
15611
1a2e6670
EZ
156122011-08-23 Eli Zaretskii <eliz@gnu.org>
15613
8ddde651
EZ
15614 * xdisp.c (redisplay_window): When computing centering_position,
15615 account for the height of the header line. (Bug#8874)
15616
425cc014
EZ
15617 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
15618 instead of CHAR_TO_BYTE. Fixes a crash when a completion
15619 candidate is selected by the mouse, and that candidate has a
15620 composed character under the mouse.
15621
1a2e6670
EZ
15622 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
15623 coordinates reported by pos-visible-in-window-p for a composed
15624 character in column zero.
15625
8b76d6f8
SM
156262011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
15627
15628 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
15629
dac347dd
EZ
156302011-08-22 Eli Zaretskii <eliz@gnu.org>
15631
15632 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
15633 consider it a hit if to_charpos is anywhere in the range of the
15634 composed buffer positions.
15635
e013fb34
CY
156362011-08-22 Chong Yidong <cyd@stupidchicken.com>
15637
15638 * image.c (gif_load): Don't assume that each subimage has the same
15639 dimensions as the base image. Handle disposal method that is
15640 "undefined" by the gif spec (Bug#9335).
15641
bd1ba3e8
CY
156422011-08-20 Chong Yidong <cyd@stupidchicken.com>
15643
15644 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 15645 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 15646
54a1215b
EZ
156472011-08-19 Eli Zaretskii <eliz@gnu.org>
15648
823564e5
EZ
15649 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
15650 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
15651 from an Org mode buffer to a Speedbar frame.
15652
54a1215b
EZ
15653 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
15654 a composition, take its buffer position from IT->cmp_it.charpos.
15655 Fixes cursor positioning at the beginning of a line that begins
15656 with a composed character.
15657
9778ebcc
EZ
156582011-08-18 Eli Zaretskii <eliz@gnu.org>
15659
0be6ee06
EZ
15660 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
15661 character bidirectional type, use STRONG_L instead. Fixes crashes
15662 in a buffer produced by `describe-categories'.
15663
9778ebcc
EZ
15664 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
15665 members before the level stack, so they would be saved and
15666 restored when copying iterator state. Fixes incorrect reordering
15667 around TABs covered by display properties.
15668
156bffbe
AS
156692011-08-18 Andreas Schwab <schwab@linux-m68k.org>
15670
6b02f655 15671 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 15672
72ad093b
CY
156732011-08-17 Chong Yidong <cyd@stupidchicken.com>
15674
15675 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
15676 (internal_condition_case_2, internal_condition_case_n):
15677 Remove unnecessary aborts (Bug#9081).
72ad093b 15678
35774242
EZ
156792011-08-17 Eli Zaretskii <eliz@gnu.org>
15680
15681 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
15682 has no `load' handler, try opening the file locally. (Bug#9311)
15683
db76dd85
KB
156842011-08-16 Ken Brown <kbrown@cornell.edu>
15685
15686 * gmalloc.c: Expand comment.
15687
b215eee5
EZ
156882011-08-16 Eli Zaretskii <eliz@gnu.org>
15689
15690 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
15691 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
15692
a4579d33
KB
156932011-08-16 Ken Brown <kbrown@cornell.edu>
15694
15695 Fix memory allocation problems in Cygwin build (Bug#9273).
15696
15697 * unexcw.c ( __malloc_initialized): Declare external variable.
15698 (fixup_executable): Force the dumped emacs to reinitialize malloc.
15699
8b76d6f8
SM
15700 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
15701 New variables.
a4579d33
KB
15702 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
15703 dumped emacs.
15704 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
15705 in the static heap.
15706 [CYGWIN] (special_realloc): New function.
15707 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
15708 requests to realloc storage in the static heap.
15709
3ebec551
PE
157102011-08-15 Paul Eggert <eggert@cs.ucla.edu>
15711
15712 * bidi.c (bidi_initialize): Remove unused local.
15713
9fd8be00
EZ
157142011-08-15 Eli Zaretskii <eliz@gnu.org>
15715
6b02f655
SM
15716 * bidimirror.h:
15717 * biditype.h: Remove file.
15718 * makefile.w32-in ($(BLD)/bidi.$(O)):
15719 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
15720
15721 * dispextern.h: Fix a typo in the comment to bidi_type_t.
15722
15723 * chartab.c: Improve commentary for the uniprop_table API.
15724
32413314
EZ
15725 * bidi.c (bidi_paragraph_init): Support zero value of
15726 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
15727 (bidi_initialize): Use uniprop_table instead of including
15728 biditype.h and bidimirror.h.
32413314 15729
9fd8be00
EZ
15730 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
15731 coordinates of the iterator when restoring from ppos_it.
15732 (Bug#9296)
15733
5cf2b69b
KH
157342011-08-14 Kenichi Handa <handa@m17n.org>
15735
15736 * process.c (create_process): Call setup_process_coding_systems
72ad093b 15737 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 15738
daf17d00
EZ
157392011-08-14 Eli Zaretskii <eliz@gnu.org>
15740
15741 * xdisp.c (move_it_in_display_line_to): Don't invoke
15742 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
15743 ppos_it. Fixes vertical cursor motion when line beginning is
15744 covered by an image. (Bug#9296)
15745
08e3161a
JD
157462011-08-14 Jan Djärv <jan.h.d@swipnet.se>
15747
15748 * nsterm.h (ns_run_ascript): Declare.
15749 (NSAPP_DATA2_RUNASSCRIPT): Define.
15750
15751 * nsfns.m (as_script, as_result, as_status): New static variables.
15752 (ns_run_ascript): New function.
5e617bc2 15753 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
15754 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
15755 the event loop. Get status from as_status (Bug#7276).
15756
15757 * nsterm.m (sendEvent): If event is NSApplicationDefined and
15758 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
15759 the event loop (Bug#7276).
15760
a3720aa2
AS
157612011-08-14 Andreas Schwab <schwab@linux-m68k.org>
15762
15763 * gnutls.c (QCgnutls_bootprop_priority)
15764 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
15765 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
15766 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
15767 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
15768 (QCgnutls_bootprop_verify_hostname_error)
15769 (QCgnutls_bootprop_callbacks_verify): Rename from
15770 Qgnutls_bootprop_..., all uses changed.
15771
15772 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
15773 uses changed.
15774
0a0d27fb
PE
157752011-08-14 Paul Eggert <eggert@cs.ucla.edu>
15776
19d5c50c
PE
15777 * xfaces.c (Qframe_set_background_mode): Now static.
15778 * dispextern.h (Qframe_set_background_mode): Remove decl.
15779
0a0d27fb
PE
15780 * process.c (Fnetwork_interface_info): Declare local only if needed.
15781
377538cb
JD
157822011-08-13 Jan Djärv <jan.h.d@swipnet.se>
15783
15784 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
15785 (Fnetwork_interface_list): Allocate in increments of bytes instead
15786 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
15787 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
15788 sockaddr.
15789 (struct ifflag_def): notrailers is smart on OSX.
15790 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
15791 Get hardware address with getifaddrs if available.
15792
08fff70c
EZ
157932011-08-12 Eli Zaretskii <eliz@gnu.org>
15794
15795 * xdisp.c (iterate_out_of_display_property): xassert that
15796 IT->position is set to within IT->object's boundaries. Break from
15797 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
15798 when IT->position is set up wrongly due to some bug.
15799 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
15800 (push_display_prop): Allow GET_FROM_STRING as IT->method on
15801 entry. Force push_it to save on the stack the current
15802 buffer/string position, to be restored by pop_it. Fix flags in
15803 the iterator structure wrt the object coming from a display
15804 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
15805 properties. (Bug#9284)
15806
7be1c708 158072011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 15808
7be1c708
CY
15809 * fontset.c (fontset_get_font_group): Add proper type checks.
15810 (Bug#9172)
aac0c6e3 15811
7be1c708 158122011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 15813
7be1c708
CY
15814 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
15815 and LC_VERSION_MIN_MACOSX.
15816 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
15817 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 15818
97bb72a6
EZ
158192011-08-08 Eli Zaretskii <eliz@gnu.org>
15820
15821 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
15822 no-display-properties-and-no-overlays under bidi display.
15823 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 15824 properties and overlays.
97bb72a6 15825
d5617611
CY
158262011-08-08 Chong Yidong <cyd@stupidchicken.com>
15827
37e11a63
CY
15828 * editfns.c (Fset_time_zone_rule): Document relationship with the
15829 setenv function.
15830
d5617611
CY
15831 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
15832 the font entity extracted from the cache (Bug#8109).
15833
58872834
CY
158342011-08-07 Chong Yidong <cyd@stupidchicken.com>
15835
15836 * composite.c (autocmp_chars): Don't reset point. That is done by
15837 restore_point_unwind (Bug#5984).
15838
75bfc667
JL
158392011-08-07 Juri Linkov <juri@jurta.org>
15840
15841 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
15842 to show the arg `TIME' instead of `TIMEVAL'.
15843
d1410150
EZ
158442011-08-06 Eli Zaretskii <eliz@gnu.org>
15845
15846 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
15847 display property strides EOL and includes a newline, as in
15848 longlines-mode. (Bug#9254)
75b771e4
EZ
15849 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
15850 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
15851
15852 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
15853 is non-zero, even if the data buffer is NULL. Fixes a crash in
15854 vertical-motion with longlines-mode. (Bug#9254)
15855
35928349
EZ
158562011-08-05 Eli Zaretskii <eliz@gnu.org>
15857
ec7cc85b
EZ
15858 * bidi.c <bidi_cache_total_alloc>: Now static.
15859 (bidi_initialize): Initialize bidi_cache_total_alloc.
15860
8b76d6f8 15861 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
15862 cache. (Bug#9221)
15863
15864 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
15865 amount allocated this far in `bidi_cache_total_alloc'.
15866 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
15867 non-zero, only free the data buffer without restoring the cache
15868 contents. All callers changed.
15869
15870 * dispextern.h (bidi_unshelve_cache): Update prototype.
15871
15872 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
15873 (move_it_in_display_line, move_it_to)
15874 (move_it_vertically_backward, move_it_by_lines): Replace the call
15875 to xfree to an equivalent call to bidi_unshelve_cache.
15876 (move_it_in_display_line_to): Fix logic of returning
412b6358 15877 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 15878
e2e2423b
EZ
158792011-08-05 Eli Zaretskii <eliz@gnu.org>
15880
15881 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
15882 came from a string character with a `cursor' property. (Bug#9229)
15883
ae9e757a
JD
158842011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15885
15886 * Makefile.in (LIB_PTHREAD): New variable.
15887 (LIBES): Add LIB_PTHREAD (Bug#9216).
15888
15889 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
15890 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
15891
213bd7f2
AS
158922011-08-04 Andreas Schwab <schwab@linux-m68k.org>
15893
6b02f655 15894 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 15895
99aaf75f
JD
158962011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15897
15898 * xterm.c (x_find_topmost_parent): New function.
15899 (x_set_frame_alpha): Find topmost parent window with
15900 x_find_topmost_parent and set the property there also (bug#9181).
15901 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
15902
c74e9d86
PE
159032011-08-04 Paul Eggert <eggert@cs.ucla.edu>
15904
15905 * callproc.c (Fcall_process): Avoid vfork clobbering
15906 the local vars buffer, coding_systems, current_dir.
15907
640c8776
SM
159082011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
15909
15910 * keymap.c (Fmake_composed_keymap): Move to subr.el.
15911
f26d0e4c
PE
159122011-08-03 Paul Eggert <eggert@cs.ucla.edu>
15913
8a10d76c
PE
15914 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
15915 so that it is not optimized away.
15916
f26d0e4c
PE
15917 * xdisp.c (compute_display_string_pos): Remove unused local.
15918
55439c61
EZ
159192011-08-02 Eli Zaretskii <eliz@gnu.org>
15920
15921 Fix slow cursor motion and scrolling in large buffers with
15922 selective display, like Org Mode buffers. (Bug#9218)
15923
15924 * dispextern.h (struct bidi_it): New member disp_prop_p.
15925
15926 * xdisp.c: Remove one-slot cache of display string positions.
15927 (compute_display_string_pos): Accept an additional argument
5e617bc2 15928 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
15929 for a display string or property. If found, set DISP_PROP_P
15930 non-zero.
15931
15932 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
15933 DISP_PROP_P, and pass it to compute_display_string_pos.
15934 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
15935 non-zero. All callers of bidi_fetch_char changed.
15936
fb33fa43
SM
159372011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
15938
15939 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
15940
b099e063
DM
159412010-12-03 Don March <don@ohspite.net>
15942
15943 * keymap.c (Fdefine_key): Fix non-prefix key error message when
15944 last character M-[char] is translated to ESC [char] (bug#7541).
15945
5cc7f7af
KH
159462011-08-02 Kenichi Handa <handa@m17n.org>
15947
d0fffa3f 15948 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
15949
15950 * chartab.c (uniprop_table): Make it non-static.
15951
525d5e6e
EZ
159522011-08-01 Eli Zaretskii <eliz@gnu.org>
15953
15954 * xdisp.c (forward_to_next_line_start): Accept additional argument
15955 BIDI_IT_PREV, and store into it the state of the bidi iterator had
15956 on the newline.
15957 (reseat_at_next_visible_line_start): Use the bidi iterator state
15958 returned by forward_to_next_line_start to restore the state of
15959 it->bidi_it after backing up to previous newline. (Bug#9212)
15960
31011111
AS
159612011-07-30 Andreas Schwab <schwab@linux-m68k.org>
15962
15963 * regex.c (re_comp): Protoize.
15964 (re_exec): Fix return type.
15965 (regexec): Fix type of `ret'. (Bug#9203)
15966
476371c4
PE
159672011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15968
e5d76069
PE
15969 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
15970 This is needed if max-image-size is a floating-point number.
15971
9a79b20c
AS
159722011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15973
15974 * print.c (print_object): Print empty symbol as ##.
15975
15976 * lread.c (read1): Read ## as empty symbol.
15977
d8c2fa78
AA
159782011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
15979
15980 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
15981 setting frame foreground color (Bug#9175).
15982 (x_set_background_color): Likewise.
15983
ffe57a7a
AA
15984 * nsmenu.m (-setText): Size tooltip dimensions precisely to
15985 contents (Bug#9176).
15986 (EmacsTooltip -init): Remove bezels and add shadows to
15987 tooltip windows.
15988
bf3492a5
AA
15989 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
15990 or scroll bar (Bug#8470).
15991
d55e9c53
AA
15992 * nsfont.m (nsfont_open): Remove assignment to voffset and
15993 unnecessary vars hshink, expand, hd, full_height, min_height.
15994 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
15995
15996 * nsterm.h (nsfont_info): Remove voffset field.
15997
d8c2fa78 159982011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
15999
16000 Implement strike-through and overline on NextStep (Bug#8863).
16001
16002 * nsfont.m (nsfont_open): Use underline position provided by font,
16003 instead of hard-coded value of 2.
16004 (nsfont_draw): Call ns_draw_text_decoration instead.
16005
16006 * nsterm.h: Add declaration for ns_draw_text_decoration.
16007
16008 * nsterm.m (ns_draw_text_decoration): New function for drawing
16009 underline, overline, and strike-through.
16010 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16011 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 16012 accommodate underlining, etc.
4843aac3 16013
4cc60b9b
EZ
160142011-07-28 Eli Zaretskii <eliz@gnu.org>
16015
bc7ece87
EZ
16016 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16017 default.
4cc60b9b 16018
476371c4
PE
160192011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16020
66606eea
PE
16021 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16022 Without this fix, if a signal arrives just after memory fills up,
16023 'malloc' might be invoked reentrantly.
16024
476371c4
PE
16025 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16026 In other words, assume that every image size is allowed, on non-X
16027 hosts. This assumption is probably wrong, but it lets Emacs compile.
16028
f3fcc40d
AS
160292011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16030
16031 * regex.c (re_iswctype): Convert return values to boolean.
16032
350c992f
EZ
160332011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16034
16035 * xdisp.c (compute_display_string_pos): Don't use cached display
16036 string position if the buffer had its restriction changed.
16037 (Bug#9184)
16038
5266b4bb
PE
160392011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16040
16041 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16042
2573a837 160432011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 16044
41f55ccd 16045 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 16046
39e378da
PE
16047 * bidi.c: Integer size and overflow fixes.
16048 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16049 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16050 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16051 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16052 (bidi_find_other_level_edge):
16053 Use ptrdiff_t instead of EMACS_INT where either will do.
16054 This works better on 32-bit hosts configured --with-wide-int.
16055 (bidi_cache_ensure_space): Check for size-calculation overflow.
16056 Use % rather than repeated addition, for better worst-case speed.
16057 Don't set bidi_cache_size until after xrealloc returns, because it
16058 might not return.
16059 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
16060 (bidi_cache_ensure_space): Also check that the bidi cache size
16061 does not exceed that of the largest Lisp string or buffer. See Eli
16062 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 16063
5e927815
PE
16064 * alloc.c (__malloc_size_t): Remove.
16065 All uses replaced by size_t. See Andreas Schwab's note
16066 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16067
ca4aa935
PE
16068 * image.c: Improve checking for integer overflow.
16069 (check_image_size): Assume that f is nonnull, since
16070 it is always nonnull in practice. This is one less thing to
16071 worry about when checking for integer overflow later.
16072 (x_check_image_size): New function, which checks for integer
16073 overflow issues inside X.
16074 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16075 This removes the need for a memory_full check.
16076 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16077 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16078 (xbm_read_bitmap_data): Change locals back to 'int', since
16079 their values must fit in 'int'.
16080 (xpm_load_image, png_load, tiff_load):
16081 Invoke x_create_x_image_and_pixmap earlier,
16082 to avoid much needless work if the image is too large.
16083 (tiff_load): Treat overly large images as if
16084 x_create_x_image_and_pixmap failed, not as malloc failures.
16085 (gs_load): Use x_check_image_size.
16086
5f8f9cc2
PE
16087 * gtkutil.c: Omit integer casts.
16088 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16089 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16090
5adf60bc
PE
16091 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16092
c8907a93
PE
16093 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16094 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16095 would wrongly return t on a 64-bit host.
16096
e3c25c68
PE
16097 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16098 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16099 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16100 and therefore cause GCC to emit a bogus diagnostic in some cases.
16101
3f791afe
PE
16102 * image.c: Integer signedness and overflow and related fixes.
16103 This is not an exhaustive set of fixes, but it's time to
16104 record what I've got.
16105 (lookup_pixel_color, check_image_size): Remove redundant decls.
16106 (check_image_size): Don't assume that arbitrary EMACS_INT values
16107 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16108 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16109 (tiff_load, imagemagick_load_image):
16110 Check for overflow in size calculations.
16111 (x_create_x_image_and_pixmap): Remove unnecessary test for
16112 xmalloc returning NULL; that can't happen.
16113 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16114 (xpm_color_bucket): Use better integer hashing function.
16115 (xpm_cache_color): Don't possibly over-allocate memory.
16116 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16117 (gif_memory_source):
16118 Use ptrdiff_t, not int or size_t, to record sizes.
16119 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16120 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16121 either works, as we prefer signed integers.
16122 (tiff_read_from_memory, tiff_write_from_memory):
16123 Return tsize_t, not size_t, since that's what the TIFF API wants.
16124 (tiff_read_from_memory): Don't fail simply because the read would
16125 go past EOF; instead, return a short read.
16126 (tiff_load): Omit no-longer-needed casts.
16127 (Fimagemagick_types): Don't assume size fits into 'int'.
16128
3cc5a532
PE
16129 Improve hashing quality when configured --with-wide-int.
16130 * fns.c (hash_string): New function, taken from sxhash_string.
16131 Do not discard information about ASCII character case; this
16132 discarding is no longer needed.
16133 (sxhash-string): Use it. Change sig to match it. Caller changed.
16134 * lisp.h: Declare it.
16135 * lread.c (hash_string): Remove, since we now use fns.c's version.
16136 The fns.c version returns a wider integer if --with-wide-int is
16137 specified, so this should help the quality of the hashing a bit.
16138
b312a492
PE
16139 * emacs.c: Integer overflow minor fix.
16140 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16141 Define only if GNU_LINUX.
16142 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16143
dfd153ae
PE
16144 * dispnew.c: Integer signedness and overflow fixes.
16145 Remove unnecessary forward decls, that were a maintenance hassle.
16146 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16147 All uses changed.
16148 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16149 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16150 (prepare_desired_row, line_draw_cost):
16151 Use int, not unsigned, where either works.
16152 (save_current_matrix, restore_current_matrix):
16153 Use ptrdiff_t, not size_t, where either works.
16154 (init_display): Check for overflow more accurately, and without
16155 relying on undefined behavior.
16156
a81d11a3
PE
16157 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16158 Remove, replacing with the new symbols in lisp.h. All uses changed.
16159 * fileio.c (make_temp_name):
16160 * filelock.c (lock_file_1, lock_file):
16161 * xdisp.c (message_dolog):
16162 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16163 Use pMd etc. instead.
16164 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16165 replacing the pWIDE etc. symbols removed from editfns.c.
16166
3300e6fd
PE
16167 * keyboard.h (num_input_events): Now uintmax_t.
16168 This is (very slightly) less likely to mess up due to wraparound.
16169 All uses changed.
16170
fd05c7e9
PE
16171 * buffer.c: Integer signedness fixes.
16172 (alloc_buffer_text, enlarge_buffer_text):
16173 Use ptrdiff_t rather than size_t when either will do, as we prefer
16174 signed integers.
16175
903fe15d
PE
16176 * alloc.c: Integer signedness and overflow fixes.
16177 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16178 (__malloc_size_t): Default to size_t, not to int.
16179 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16180 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16181 Prefer ptrdiff_t to size_t when either would do, as we prefer
16182 signed integers.
16183 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16184 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16185 Now const. Initialize with values that are in range even if char
16186 is signed.
16187 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16188 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16189 These functions do the right thing with sizes > 2**32.
16190 (check_depth): Now ptrdiff_t, not int.
16191 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16192 Adjust to new way of storing sizes. Check for size overflow bugs
16193 in rest of code.
16194 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16195 slightly wrong anyway, as it missed one instance of
16196 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16197 (refill_memory_reserve): Omit needless cast to size_t.
16198 (mark_object_loop_halt): Mark as externally visible.
16199
ac82cc6a
PE
16200 * xselect.c: Integer signedness and overflow fixes.
16201 (Fx_register_dnd_atom, x_handle_dnd_message):
16202 Use ptrdiff_t, not size_t, since we prefer signed.
16203 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16204 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16205 x_dnd_atoms_size and x_dnd_atoms_length.
16206
c2d1e36d
PE
16207 * doprnt.c: Prefer signed to unsigned when either works.
16208 * eval.c (verror):
16209 * doprnt.c (doprnt):
16210 * lisp.h (doprnt):
16211 * xdisp.c (vmessage):
16212 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16213 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16214 prefer signed arithmetic to avoid comparison confusion.
16215 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16216 but is a bit tricky.
16217
0e926e56
PE
16218 Assume freestanding C89 headers, string.h, stdlib.h.
16219 * data.c, doprnt.c, floatfns.c, print.c:
16220 Include float.h unconditionally.
16221 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16222 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16223 * regex.c: Likewise for stddef.h, string.h.
16224 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16225 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16226 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16227 (STDC_HEADERS): Remove obsolete defines.
16228 * sysdep.c: Include limits.h unconditionally.
16229
9cfdb3ec
PE
16230 Assume support for memcmp, memcpy, memmove, memset.
16231 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16232 * regex.c (memcmp, memcpy):
16233 Remove; we assume C89 now.
16234
16235 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16236 (__malloc_safe_bcopy): Remove; no longer needed.
16237
cf950e6b 16238 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
16239 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16240 well either way, and we prefer signed to unsigned.
16241
dbf38e02
LMI
162422011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16243
16244 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16245 closes the connection while we're reading (bug#9182).
16246
d6f0886c 162472011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 16248
d6f0886c
JD
16249 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16250 are specified (Bug#9168).
24e0f6b1 16251
2eb1f9e6
PE
162522011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16253
16254 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16255 Found by GCC static checking and --with-wide-int on a 32-bit host.
16256
22381272 162572011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
16258
16259 * xdisp.c (compute_display_string_pos): Fix logic of caching
16260 previous display string position. Initialize cached_prev_pos to
16261 -1. Fixes slow-down at the beginning of a buffer.
16262
f25e39b4
EZ
162632011-07-24 Eli Zaretskii <eliz@gnu.org>
16264
16265 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16266 for attrs[LFACE_FONTSET_INDEX].
16267
04c4b52e
PE
162682011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16269
16270 * xml.c (parse_region): Remove unused local
16271 that was recently introduced.
16272
c1734fbd
EZ
162732011-07-23 Eli Zaretskii <eliz@gnu.org>
16274
be18c5a5
EZ
16275 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16276 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16277
c1734fbd
EZ
16278 * xdisp.c (move_it_in_display_line_to): Record the best matching
16279 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
16280 exit if none of the characters scanned was an exact match.
16281 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
16282 when exact match is impossible due to invisible text, and the
16283 lines are truncated.
16284
a258d627
JD
162852011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16286
16287 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16288 for OSX >= 10.7.
16289
b6d5a689
EZ
162902011-07-22 Eli Zaretskii <eliz@gnu.org>
16291
0f74f785
EZ
16292 Fix a significant slow-down of cursor motion with C-n, C-p,
16293 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
16294 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 16295 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
16296 (next_element_from_buffer): Call compute_stop_pos_backwards to
16297 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
16298 base_level_stop.
16299 (reseat): Don't look for prev_stop, as that could mean a very long
16300 run.
16301 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
16302 <cached_disp_overlay_modiff>: Cache for last found display string
16303 position.
551918c1 16304 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
16305 about the same buffer in the same area of character positions, and
16306 the buffer wasn't changed since the time the display string
16307 position was cached.
551918c1 16308
b2d0c91a
EZ
163092011-07-22 Eli Zaretskii <eliz@gnu.org>
16310
16311 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
16312 is an integer, which is important for empty lines. (Bug#9149)
16313
043604ee
CY
163142011-07-22 Chong Yidong <cyd@stupidchicken.com>
16315
16316 * frame.c (Fmodify_frame_parameters): In tty case, update the
16317 default face if necessary (Bug#4238).
16318
da4adb04
CY
163192011-07-21 Chong Yidong <cyd@stupidchicken.com>
16320
16321 * editfns.c (Fstring_to_char): No need to explain what a character
16322 is in the docstring (Bug#6576).
16323
9abd0532
LMI
163242011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16325
16326 * xml.c (parse_region): Make sure we always return a tree.
16327
36881d16
HK
163282011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
16329
16330 * xml.c (parse_region): If a document contains only comments,
16331 return that, too.
16332
1e98674d
LMI
163332011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16334
16335 * xml.c (make_dom): Return comments, too.
16336
590bd467
PE
163372011-07-19 Paul Eggert <eggert@cs.ucla.edu>
16338
16339 Port to OpenBSD.
16340 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
16341 and the surrounding thread.
16342 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
16343 rather than fgets, and retry after EINTR. Otherwise, 'emacs
16344 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
16345 timer goes off.
16346 * s/openbsd.h (BROKEN_SIGIO): Define.
16347 * unexelf.c (unexec) [__OpenBSD__]:
16348 Don't update the .mdebug section of the Alpha COFF symbol table.
16349
f41628b2
LMI
163502011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16351
16352 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
16353 (bug#8460).
16354
b59b67c5
PE
163552011-07-18 Paul Eggert <eggert@cs.ucla.edu>
16356
15e3a074
PE
16357 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
16358 This fixes some race conditions on the permissions of any newly
16359 created file.
16360
41bed37d
PE
16361 * alloc.c (valid_pointer_p): Use pipe, not open.
16362 This fixes some permissions issues when debugging.
16363
b59b67c5
PE
16364 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
16365 If fchown fails to set both uid and gid, try to set just gid,
16366 as that is sometimes allowed. Adjust the file's mode to eliminate
16367 setuid or setgid bits that are inappropriate if fchown fails.
16368
925a6be7
SM
163692011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
16370
16371 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
16372 to compare Lisp_Objects.
16373 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
16374 global_gnutls_log_level, don't mistake it for a Lisp_Object.
16375 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
16376
52968808
AS
163772011-07-17 Andreas Schwab <schwab@linux-m68k.org>
16378
0a6a104b
AS
16379 * lread.c (read_integer): Unread even EOF character.
16380 (read1): Likewise. Properly record start position of symbol.
16381
52968808
AS
16382 * lread.c (read1): Read `#:' as empty uninterned symbol if no
16383 symbol character follows.
16384
9e381cdd
PE
163852011-07-17 Paul Eggert <eggert@cs.ucla.edu>
16386
16387 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
16388 This works around a problem with the previous change to Fcopy_file.
16389 Recent glibc declares fchown with __attribute__((warn_unused_result)),
16390 and without this change, GCC might complain about discarding
16391 fchown's return value.
16392
b5641435
JB
163932011-07-16 Juanma Barranquero <lekktu@gmail.com>
16394
16395 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
16396
a8031457
PE
163972011-07-16 Paul Eggert <eggert@cs.ucla.edu>
16398
16399 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
16400
dd889327
LMI
164012011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
16402
750c33f7
LMI
16403 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
16404 it's used from the C level.
16405
dd889327
LMI
16406 * process.c: Use the same condition for POLL_FOR_INPUT in both
16407 keyboard.c and process.c (bug#1858).
16408
87e86684
LM
164092011-07-09 Lawrence Mitchell <wence@gmx.li>
16410
16411 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
16412 (Fgnutls_boot): Use it.
16413
64348f40
AS
164142011-07-15 Andreas Schwab <schwab@linux-m68k.org>
16415
16416 * doc.c (Fsubstitute_command_keys): Revert last change.
16417
1d698799
LMI
164182011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
16419
f863868c
LMI
16420 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
16421 quotes the next character, and doesn't affect other longer
16422 sequences (bug#8935).
16423
1d698799
LMI
16424 * lread.c (syms_of_lread): Clarify that is isn't only
16425 `eval-buffer' and `eval-defun' that's affected by
16426 `lexical-binding' (bug#8460).
16427
aa4b6df6
EZ
164282011-07-15 Eli Zaretskii <eliz@gnu.org>
16429
16430 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 16431 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 16432
5d856da6
PE
164332011-07-14 Paul Eggert <eggert@cs.ucla.edu>
16434
ad6042bb
PE
16435 Fix minor problems found by static checking.
16436 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
16437 (elsz): Now a signed constant, not a size_t var. We prefer signed
16438 types to unsigned, to avoid integer comparison confusion. Without
16439 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
16440 "cannot optimize loop, the loop counter may overflow", a symptom
16441 of the confusion.
f00bbb22 16442 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
16443 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
16444
6468f31c
LMI
164452011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16446
49080b10
LMI
16447 * search.c (Fre_search_backward): Mention `case-fold-search' in
16448 all the re_search_* functions (bug#8138).
16449
6468f31c
LMI
16450 * keyboard.c (Fopen_dribble_file): Document when the file is
16451 closed (bug#8056).
16452
c965adc5
EZ
164532011-07-14 Eli Zaretskii <eliz@gnu.org>
16454
df9733bf
EZ
16455 * bidi.c (bidi_dump_cached_states): Fix format of displaying
16456 bidi_cache_idx.
16457
0bb23927
EZ
16458 Support bidi reordering of display and overlay strings.
16459 * xdisp.c (compute_display_string_pos)
16460 (compute_display_string_end): Accept additional argument STRING.
16461 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
16462 (reseat_to_string): Initialize bidi_it->string.s and
16463 bidi_it->string.schars.
16464 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
16465 NULL (avoids a crash in bidi_paragraph_init).
16466 Initialize itb.string.lstring.
0bb23927
EZ
16467 (init_iterator): Call bidi_init_it only of a valid
16468 buffer position was specified. Initialize paragraph_embedding to
16469 L2R.
16470 (reseat_to_string): Initialize the bidi iterator.
16471 (display_string): If we need to ignore text properties of
16472 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
16473 original value of -1 will not work with bidi.)
16474 (compute_display_string_pos): First arg is now struct
16475 `text_pos *'; all callers changed. Support display properties on
16476 Lisp strings.
16477 (compute_display_string_end): Support display properties on Lisp
16478 strings.
16479 (init_iterator, reseat_1, reseat_to_string): Initialize the
16480 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
16481 when iterating on a string not from display properties).
640c8776
SM
16482 (compute_display_string_pos, compute_display_string_end):
16483 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
16484 arrow keys.
16485 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
16486 base_level_stop; instead, set base_level_stop to BEGV.
16487 Fixes crashes in vertical-motion.
0bb23927
EZ
16488 (next_element_from_buffer): Improve commentary for when
16489 the iterator is before prev_stop.
16490 (init_iterator): Initialize bidi_p from the default value of
16491 bidi-display-reordering, not from buffer-local value. Use the
16492 buffer-local value only if initializing for buffer iteration.
16493 (handle_invisible_prop): Support invisible properties on strings
16494 that are being bidi-reordered.
16495 (set_iterator_to_next): Support bidi reordering of C strings and
16496 Lisp strings.
16497 (next_element_from_string): Support bidi reordering of Lisp
16498 strings.
16499 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
16500 (display_string): Support display of R2L glyph rows.
16501 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
16502 (init_iterator): Don't initialize it->bidi_p for strings
16503 here.
16504 (reseat_to_string): Initialize it->bidi_p for strings here.
16505 (next_element_from_string, next_element_from_c_string)
16506 (next_element_from_buffer): Add xassert's for correspondence
16507 between IT's object being iterated and it->bidi_it.string
16508 structure.
16509 (face_before_or_after_it_pos): Support bidi iteration.
16510 (next_element_from_c_string): Handle the case of the first string
16511 character that is not the first one in the visual order.
16512 (get_visually_first_element): New function, refactored from common
16513 parts of next_element_from_buffer, next_element_from_string, and
16514 next_element_from_c_string.
16515 (tool_bar_lines_needed, redisplay_tool_bar)
16516 (display_menu_bar): Force left-to-right direction. Add a FIXME
16517 comment for making that be controlled by a user option.
16518 (push_it, pop_it): Save and restore the state of the
16519 bidi iterator. Save and restore the bidi_p flag.
16520 (pop_it): Iterate out of display property for string iteration as
16521 well.
16522 (iterate_out_of_display_property): Support iteration over strings.
16523 (handle_single_display_spec): Set up it->bidi_it for iteration
16524 over a display string, and call bidi_init_it.
16525 (handle_single_display_spec, next_overlay_string)
16526 (get_overlay_strings_1, push_display_prop): Set up the bidi
16527 iterator for displaying display or overlay strings.
16528 (forward_to_next_line_start): Don't use the shortcut if
16529 bidi-iterating.
16530 (back_to_previous_visible_line_start): If handle_display_prop
16531 pushed the iterator stack, restore the internal state of the bidi
16532 iterator by calling bidi_pop_it same number of times.
16533 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
16534 and we are bidi-iterating, don't decrement the iterator position;
16535 instead, set the first_elt flag in the bidi iterator, to produce
16536 the same effect.
16537 (reseat_1): Remove redundant setting of string_from_display_prop_p.
16538 (push_display_prop): xassert that we are iterating a buffer.
16539 (push_it, pop_it): Save and restore paragraph_embedding member.
16540 (handle_single_display_spec, next_overlay_string)
16541 (get_overlay_strings_1, reseat_1, reseat_to_string)
16542 (push_display_prop): Set up the `unibyte' member of bidi_it.string
16543 correctly. Don't assume unibyte strings are not bidi-reordered.
16544 (compute_display_string_pos)
16545 (compute_display_string_end): Fix handling the case of C string.
16546 (push_it, pop_it): Save and restore from_disp_prop_p.
16547 (handle_single_display_spec, push_display_prop): Set the
16548 from_disp_prop_p flag.
16549 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
16550 (pop_it): Call iterate_out_of_display_property only if we are
16551 popping after iteration over a string that came from a display
16552 property. Fix a typo in popping stretch info. Add an assertion
16553 for verifying that the iterator position is in sync with the bidi
16554 iterator.
16555 (handle_single_display_spec, get_overlay_strings_1)
16556 (push_display_prop): Fix initialization of paragraph direction for
16557 string when that of the parent object is not yet determined.
16558 (reseat_1): Call bidi_init_it to resync the bidi
16559 iterator with IT's position. (Bug#7616)
16560 (find_row_edges): If ROW->start.pos gives position
16561 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
16562 (handle_stop, back_to_previous_visible_line_start, reseat_1):
16563 Reset the from_disp_prop_p flag.
16564 (SAVE_IT, RESTORE_IT): New macros.
16565 (pos_visible_p, face_before_or_after_it_pos)
16566 (back_to_previous_visible_line_start)
16567 (move_it_in_display_line_to, move_it_in_display_line)
16568 (move_it_to, move_it_vertically_backward, move_it_by_lines)
16569 (try_scrolling, redisplay_window, display_line): Use them when
16570 saving a temporary copy of the iterator and restoring it back.
16571 (back_to_previous_visible_line_start, reseat_1)
16572 (init_iterator): Empty the bidi cache "stack".
16573 (move_it_in_display_line_to): If iterator ended up at
16574 EOL, but we never saw any buffer positions smaller than
16575 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
16576 motion in bidi-reordered lines.
16577 (move_it_in_display_line_to): Record prev_method and prev_pos
16578 immediately before the call to set_iterator_to_next. Fixes cursor
16579 motion in bidi-reordered lines with stretch glyphs and strings
16580 displayed in margins. (Bug#8133) (Bug#8867)
16581 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
16582 TO_CHARPOS.
640c8776
SM
16583 (pos_visible_p): Support positions in bidi-reordered lines.
16584 Save and restore bidi cache.
0bb23927
EZ
16585
16586 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
16587 (bidi_paragraph_info): Delete unused struct.
16588 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
16589 (bidi_cache_start): New variable.
16590 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
16591 to zero.
16592 (bidi_cache_fetch_state, bidi_cache_search)
16593 (bidi_cache_find_level_change, bidi_cache_iterator_state)
16594 (bidi_cache_find, bidi_peek_at_next_level)
16595 (bidi_level_of_next_char, bidi_find_other_level_edge)
16596 (bidi_move_to_visually_next): Compare cache index with
16597 bidi_cache_start rather than with zero.
16598 (bidi_fetch_char): Accept new argument STRING; all callers
16599 changed. Support iteration over a string. Support strings with
16600 display properties. Support unibyte strings. Fix the type of
16601 `len' according to what STRING_CHAR_AND_LENGTH expects.
16602 (bidi_paragraph_init, bidi_resolve_explicit_1)
16603 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
16604 (bidi_level_of_next_char, bidi_move_to_visually_next):
16605 Support iteration over a string.
0bb23927
EZ
16606 (bidi_set_sor_type, bidi_resolve_explicit_1)
16607 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
16608 can now be zero (for strings); special values 0 and -1 were
16609 changed to -1 and -2, respectively.
16610 (bidi_char_at_pos): New function.
16611 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
16612 Call it instead of FETCH_MULTIBYTE_CHAR.
16613 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
16614 initialized to valid values.
16615 (bidi_init_it): Don't initialize charpos and bytepos with invalid
16616 values.
16617 (bidi_level_of_next_char): Allow the sentinel "position" to pass
16618 the test for valid cached positions. Fix the logic for looking up
16619 the sentinel state in the cache. GCPRO the Lisp string we are
16620 iterating.
16621 (bidi_push_it, bidi_pop_it): New functions.
16622 (bidi_initialize): Initialize the bidi cache start stack pointer.
16623 (bidi_cache_ensure_space): New function, refactored from part of
16624 bidi_cache_iterator_state. Don't assume the required size is just
16625 one BIDI_CACHE_CHUNK away.
16626 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
16627 (bidi_count_bytes, bidi_char_at_pos): New functions.
16628 (bidi_cache_search): Don't assume bidi_cache_last_idx is
16629 always valid if bidi_cache_idx is valid.
16630 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
16631 is valid if it's going to be used.
16632 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
16633 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
16634 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16635 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
16636 (bidi_find_other_level_edge, bidi_cache_start_stack):
16637 All variables related to cache indices are now EMACS_INT.
c965adc5 16638
0bb23927
EZ
16639 * dispextern.h (struct bidi_string_data): New structure.
16640 (struct bidi_it): New member `string'. Make flag members be 1-bit
16641 fields, and put them last in the struct.
640c8776
SM
16642 (compute_display_string_pos, compute_display_string_end):
16643 Update prototypes.
0bb23927
EZ
16644 (bidi_push_it, bidi_pop_it): Add prototypes.
16645 (struct iterator_stack_entry): New members bidi_p,
16646 paragraph_embedding, and from_disp_prop_p.
16647 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
16648 (bidi_shelve_cache, bidi_unshelve_cache):
16649 Declare prototypes.
0bb23927
EZ
16650
16651 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
16652 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
16653 and vector-like objects.
16654
16655 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
16656 cache around display iteration.
16657
16658 * window.c (Fwindow_end, window_scroll_pixel_based)
16659 (displayed_window_lines, Frecenter): Save and restore the bidi
16660 cache around display iteration.
16661
3bbd2265
LMI
166622011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16663
16664 * editfns.c (Fdelete_region): Clarify the use of the named
16665 parameters (bug#6788).
16666
adc47434
MR
166672011-07-14 Martin Rudalics <rudalics@gmx.at>
16668
16669 * indent.c (Fvertical_motion): Set and restore w->pointm when
16670 saving and restoring the window's buffer (Bug#9006).
16671
837c31f8
LMI
166722011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
16673
16674 * editfns.c (Fstring_to_char): Clarify just what is returned
16675 (bug#6576). Text by Eli Zaretskii.
16676
ac389d0c
JB
166772011-07-13 Juanma Barranquero <lekktu@gmail.com>
16678
16679 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
16680
0be0ce47
EZ
166812011-07-13 Eli Zaretskii <eliz@gnu.org>
16682
16683 * buffer.c (mmap_find): Fix a typo.
16684
cd18e7e3
JB
166852011-07-13 Johan Bockgård <bojohan@gnu.org>
16686
16687 Fix execution of x selection hooks.
16688 * xselect.c (Qx_lost_selection_functions)
16689 (Qx_sent_selection_functions): New vars.
16690 (syms_of_xselect): DEFSYM them.
16691 (x_handle_selection_request): Pass Qx_sent_selection_functions
16692 rather than Vx_sent_selection_functions to Frun_hook_with_args.
16693 (x_handle_selection_clear,x_clear_frame_selections):
16694 Pass Qx_lost_selection_functions rather than
16695 Vx_lost_selection_functions to Frun_hook_with_args.
16696
47ea7f44
PE
166972011-07-13 Paul Eggert <eggert@cs.ucla.edu>
16698
ac389d0c 16699 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
16700 The old code sometimes used this field without initializing it.
16701
47ea7f44
PE
16702 * alloc.c (gc_sweep): Don't read past end of array.
16703 In theory, the old code could also have corrupted Emacs internals,
16704 though it'd be very unlikely.
16705
bc985c87
AS
167062011-07-12 Andreas Schwab <schwab@linux-m68k.org>
16707
16708 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 16709 argument. (Bug#4026)
bc985c87 16710
0cf34688
LMI
167112011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
16712
b3dadd76
LMI
16713 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
16714 key" (bug#4257).
16715
0cf34688
LMI
16716 * window.c (Fset_window_start): Doc fix (bug#4199).
16717 (Fset_window_hscroll): Ditto.
16718
270768cd
PE
167192011-07-12 Paul Eggert <eggert@cs.ucla.edu>
16720
077e3dda 16721 Fix minor new problems caught by GCC 4.6.1.
270768cd 16722 * term.c (init_tty): Remove unused local.
490011a6 16723 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 16724 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 16725 not used otherwise.
270768cd 16726
b1f58454
CY
167272011-07-12 Chong Yidong <cyd@stupidchicken.com>
16728
16729 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
16730
22b9578d
LMI
167312011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16732
6e70ab07
LMI
16733 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
16734 are the mini-buffer and the echo area (bug#3320).
16735
22b9578d
LMI
16736 * term.c (init_tty): Remove support for supdup, c10 and perq
16737 terminals, which are no longer supported (bug#1482).
16738
8974cc9f
JB
167392011-07-10 Johan Bockgård <bojohan@gnu.org>
16740
16741 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
16742
a560d974
JD
167432011-07-10 Jan Djärv <jan.h.d@swipnet.se>
16744
16745 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
16746 for non-popups (Bug#3642).
16747
1dae0f0a
AS
167482011-07-10 Andreas Schwab <schwab@linux-m68k.org>
16749
268c2c36 16750 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 16751 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
16752 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
16753 * cm.c (losecursor): Likewise.
1dae0f0a
AS
16754 * data.c (fmod): Likewise.
16755 * dispnew.c (swap_glyphs_in_rows): Likewise.
16756 * emacs.c (memory_warning_signal): Likewise.
16757 * floatfns.c (float_error): Likewise.
16758 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
16759 (otf_open, font_otf_capability, generate_otf_features)
16760 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
16761 Likewise.
16762 * image.c (pbm_read_file): Likewise.
16763 * indent.c (string_display_width): Likewise.
16764 * intervals.c (check_for_interval, search_for_interval)
16765 (inc_interval_count, count_intervals, root_interval)
16766 (adjust_intervals_for_insertion, make_new_interval): Likewise.
16767 * lread.c (defalias): Likewise.
268c2c36 16768 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
16769 * regex.c (set_image_of_range_1, set_image_of_range)
16770 (regex_grow_registers): Likewise.
16771 * sysdep.c (strerror): Likewise.
16772 * termcap.c (valid_filename_p, tprint, main): Likewise.
16773 * tparam.c (main): Likewise.
16774 * unexhp9k800.c (run_time_remap, save_data_space)
16775 (update_file_ptrs, read_header, write_header, calculate_checksum)
16776 (copy_file, copy_rest, display_header): Likewise.
16777 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
16778 Likewise.
16779 * xdisp.c (check_it): Likewise.
16780 * xfaces.c (register_color, unregister_color, unregister_colors):
16781 Likewise.
16782 * xfns.c (print_fontset_result): Likewise.
16783 * xrdb.c (member, fatal, main): Likewise.
16784
99033785
PE
167852011-07-10 Paul Eggert <eggert@cs.ucla.edu>
16786
16787 Fix minor problems found by static checking (Bug#9031).
16788 * chartab.c (char_table_set_range, map_sub_char_table):
16789 Remove unused locals.
16790 (uniprop_table): Now static.
16791 * composite.c (_work_char): Remove unused static var.
16792
9cb2ac56
JB
167932011-07-09 Juanma Barranquero <lekktu@gmail.com>
16794
16795 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
16796
f25661f0
JD
167972011-07-09 Jan Djärv <jan.h.d@swipnet.se>
16798
16799 * gtkutil.c (qttip_cb): Remove code without function.
16800
8278c4fe
EZ
168012011-07-09 Eli Zaretskii <eliz@gnu.org>
16802
16803 * w32.c (pthread_sigmask): New stub.
16804
1692ae2d 168052011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 16806
8a6ebd58 16807 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
16808 sigprocmask is portable only for single-threaded applications, and
16809 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
16810 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
16811 (LIBES): Use it.
16812 * callproc.c (Fcall_process):
16813 * process.c (create_process):
16814 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
16815 Use pthread_sigmask, not sigprocmask.
123403e4 16816
1b854618
JD
168172011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16818
16819 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
16820 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
16821 wrong (Bug#8591).
16822
3fe4b549
JD
168232011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16824
0ce7e563
JD
16825 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
16826 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
16827 (xg_hide_tooltip): Fix comment.
16828
3fe4b549
JD
16829 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
16830 in registerServicesMenuSendTypes.
16831 (validRequestorForSendType): Don't check ns_return_types.
16832
16833 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
16834 ns_return_type.
16835
5df75e47
JR
168362011-07-08 Jason Rumney <jasonr@gnu.org>
16837
22610910
JR
16838 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
16839 SH_SHOW for hidden windows (Bug#5482).
16840
5df75e47
JR
16841 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
16842 frame struct members of non-existent frames (Bug#6284).
16843
699c10bd
JD
168442011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16845
4393663b
JD
16846 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
16847 variable firstTime not needed on OSX >= 10.6.
16848 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
16849 >= 10.5. Use setKnobProportion, setDoubleValue.
16850
16851 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
16852 (MAC_OS_X_VERSION_10_5): Define if not defined.
16853 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
16854 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
16855 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
16856
16857 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 16858 cString and lossyCString on OSX >= 10.4.
4393663b 16859
58179cce 16860 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
16861 sizeToFit on OSX >= 10.2.
16862
16863 * nsimage.m (allocInitFromFile): Don't use deprecated method
16864 bestRepresentationForDevice on OSX >= 10.6.
16865
16866 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
16867 to avoid warning.
16868
16869 * emacs.c: Declare unexec_init_emacs_zone.
16870
a63e0781
JD
16871 * nsgui.h: Fix compiler warning about gnulib redefining verify.
16872
699c10bd
JD
16873 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
16874
16875 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
16876 on svcsMenu (Bug#8842).
16877
16878 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
16879 ns_return_types.
16880 (Fns_list_services): Just return Qnil on 10.6, code not working there.
16881
16882 * nsterm.m (QUTF8_STRING): Declare.
16883 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
16884 (validRequestorForSendType): Return type is (id).
16885 Change indexOfObjectIdenticalTo to indexOfObject.
16886 Check if we have local selection before returning self (Bug#8842).
16887 (writeSelectionToPasteboard): Put local selection into paste board
16888 if we have a local selection (Bug#8842).
16889 (syms_of_nsterm): DEFSYM QUTF8_STRING.
16890
16891 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
16892 (ns_get_local_selection): Declare.
16893
54e10184
LMI
168942011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
16895
9888ff71
LMI
16896 * keymap.c (describe_map_tree): Don't insert a double newline at
16897 the end of the buffer (bug#1169) and return whether we inserted
16898 something.
16899
54e10184
LMI
16900 * callint.c (Fcall_interactively): Change "reading args" to
16901 "providing args" to try to clarify what it does (bug#1010).
16902
15fa4783
KH
169032011-07-07 Kenichi Handa <handa@m17n.org>
16904
16905 * composite.c (composition_compute_stop_pos): Ignore a static
16906 composition starting before CHARPOS (Bug#8915).
16907
16908 * xdisp.c (handle_composition_prop): Likewise.
16909
a8815b00
EZ
169102011-07-07 Eli Zaretskii <eliz@gnu.org>
16911
16912 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
16913 (Bug#9015)
16914
ef7b981d 169152011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
16916
16917 * character.h (unicode_category_t): New enum type.
16918
16919 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
16920 (Qchar_code_property_table): New variable.
16921 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
16922 (UNIPROP_COMPRESSED_FORM_P): New macros.
16923 (char_table_ascii): Uncompress the compressed values.
16924 (sub_char_table_ref): New arg is_uniprop. Callers changed.
16925 Uncompress the compressed values.
ac389d0c 16926 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
16927 (char_table_ref_and_range): Uncompress the compressed values.
16928 (sub_char_table_set): New arg is_uniprop. Callers changed.
16929 Uncompress the compressed values.
16930 (sub_char_table_set_range): Args changed. Callers changed.
16931 (char_table_set_range): Adjuted for the above change.
16932 (map_sub_char_table): Delete args default_val and parent. Add arg
16933 top. Give decoded values to a Lisp function.
640c8776 16934 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
16935 values to a Lisp function. Gcpro more variables.
16936 (uniprop_table_uncompress)
16937 (uniprop_decode_value_run_length): New functions.
16938 (uniprop_decoder, uniprop_decoder_count): New variables.
16939 (uniprop_get_decoder, uniprop_encode_value_character)
16940 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
16941 New functions.
16942 (uniprop_encoder, uniprop_encoder_count): New variables.
16943 (uniprop_get_encoder, uniprop_table)
16944 (Funicode_property_table_internal, Fget_unicode_property_internal)
16945 (Fput_unicode_property_internal): New functions.
16946 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
16947 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 16948 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
16949 char-code-property-alist.
16950
640c8776 16951 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
16952 Vunicode_category_table.
16953
640c8776 16954 * font.c (font_range): Adjust for the change of
c805dec0
KH
16955 Vunicode_category_table.
16956
76b397fb
DN
169572011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
16958
16959 * m/iris4d.h: Remove file, move contents ...
16960 * s/irix6-5.h: ... here.
16961
22b4128e
PE
169622011-07-06 Paul Eggert <eggert@cs.ucla.edu>
16963
16964 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
16965 * alloc.c (mark_buffer):
16966 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
16967 (clone_per_buffer_values): Don't assume that
22b4128e
PE
16968 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
16969 This isn't true in general, and it's particularly not true
16970 if Emacs is configured with --with-wide-int.
16971 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
16972 New macros, used in the buffer.c change.
16973
869795d6
JD
169742011-07-05 Jan Djärv <jan.h.d@swipnet.se>
16975
16976 * xsettings.c: Use both GConf and GSettings if both are available.
16977 (store_config_changed_event): Add comment.
16978 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
16979 (store_tool_bar_style_changed): New functions.
5e617bc2 16980 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
16981 (struct xsettings): Move font inside HAVE_XFT.
16982 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 16983 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 16984 Move inside HAVE_XFT.
640c8776 16985 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
16986 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
16987 also.
16988 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 16989 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 16990 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
16991 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
16992 (parse_settings): Move check for font inside HAVE_XFT.
16993 (read_settings, apply_xft_settings): Add comment.
16994 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
16995 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
16996 call store_font_name_changed.
16997 (xft_settings_event): Add comment.
16998 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
16999 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17000 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17001 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17002 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
17003 (xsettings_get_system_font, xsettings_get_system_normal_font):
17004 Add comment.
869795d6 17005
d8ed26bd
PE
170062011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17007
17008 Random fixes. E.g., (random) never returned negative values.
17009 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17010 subseconds part to the entropy, as that's a bit more random.
17011 Prefer signed to unsigned, since the signedness doesn't matter and
17012 in general we prefer signed. When given a limit, use a
17013 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17014 latter isn't right if USE_2_TAGS_FOR_INTS.
17015 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17016 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17017
cabf1cac
SM
170182011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17019
17020 * textprop.c (text_property_stickiness):
17021 Obey Vtext_property_default_nonsticky.
17022 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17023 * w32fns.c (syms_of_w32fns):
17024 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17025
6e9b2be9
PE
170262011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17027
17028 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17029 This is more efficient than Ffile_directory_p and avoids a minor race.
17030
90186c68
LMI
170312011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17032
7c301272
LMI
17033 * buffer.c (Foverlay_put): Say what the return value is
17034 (bug#7835).
17035
c4f2d8d4
LMI
17036 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17037 is a directory before asking whether to use the file name
17038 (bug#7564).
ad637907
LMI
17039 (barf_or_query_if_file_exists): Make the "File is a directory"
17040 error be more correct.
c4f2d8d4 17041
90186c68
LMI
17042 * fns.c (Frequire): Remove the mention of the .gz files, since
17043 that's installation-specific, but keep the mention of
17044 `get-load-suffixes'.
17045
da64016e
PE
170462011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17047
17048 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17049 Report string overflow if the output is too long.
17050
7d47b580
JB
170512011-07-04 Juanma Barranquero <lekktu@gmail.com>
17052
a555cb87
JB
17053 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17054 (syms_of_gnutls): Remove duplicate DEFSYM for
17055 Qgnutls_bootprop_verify_hostname_error, an error for
17056 Qgnutls_bootprop_verify_error (which is no longer used).
17057
7d47b580
JB
17058 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17059 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17060 Also (re)move comments that are misplaced or no longer relevant.
17061
1e49bfab
LMI
170622011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17063
17064 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17065
1485f4c0
CY
170662011-07-03 Chong Yidong <cyd@stupidchicken.com>
17067
17068 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17069 and background color parameters if they have been changed.
17070
a9ab721e
LMI
170712011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17072
17073 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17074
cf7cff57
PE
170752011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17076
2e13213d
PE
17077 * xsettings.c (SYSTEM_FONT): Define only when used.
17078 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17079
cf7cff57
PE
17080 * keymap.c (access_keymap_1): Now static.
17081
7a8e04f7
CY
170822011-07-02 Chong Yidong <cyd@stupidchicken.com>
17083
17084 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17085 leave any prefix arg for the up event (Bug#1586).
17086
61352f62
LMI
170872011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17088
69bb1ef7
LMI
17089 * lread.c (syms_of_lread): Mention single symbols defined by
17090 `defvar' or `defconst' (bug#7154).
17091
61352f62 17092 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 17093 (Frequire): Mention get-load-suffixes.
61352f62 17094
28545e04
MR
170952011-07-02 Martin Rudalics <rudalics@gmx.at>
17096
17097 * window.h (window): Remove clone_number slot.
17098 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17099 Remove.
17100 (make_parent_window, make_window, saved_window)
17101 (Fset_window_configuration, save_window_save): Don't deal with
17102 clone numbers.
17103 * buffer.c (Qclone_number): Remove declaration.
17104 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17105
3349e122
SM
171062011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17107
17108 Add multiple inheritance to keymaps.
17109 * keymap.c (Fmake_composed_keymap): New function.
17110 (Fset_keymap_parent): Simplify.
17111 (fix_submap_inheritance): Remove.
17112 (access_keymap_1): New function extracted from access_keymap to handle
17113 embedded parents and handle lists of maps.
17114 (access_keymap): Use it.
17115 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17116 (Fcopy_keymap): Handle embedded parents.
17117 (Fcommand_remapping, define_as_prefix): Simplify.
17118 (Fkey_binding): Simplify.
17119 (syms_of_keymap): Move minibuffer-local-completion-map,
17120 minibuffer-local-filename-completion-map,
17121 minibuffer-local-must-match-map, and
17122 minibuffer-local-filename-must-match-map to Elisp.
17123 (syms_of_keymap): Defsubr make-composed-keymap.
17124 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17125 (parse_menu_item): Trivial simplification.
17126
3279eb87
GM
171272011-07-01 Glenn Morris <rgm@gnu.org>
17128
17129 * Makefile.in (SETTINGS_LIBS): Fix typo.
17130
39cb9e56 171312011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
17132
17133 * coding.c (Fencode_coding_string): Record the last coding system
17134 used, as the function doc string says (bug#8738).
17135
0949d2b6
JD
171362011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17137
17138 * xsettings.c (store_monospaced_changed): Take new font as arg and
17139 check for change against current_mono_font.
17140 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17141 (emacs_settings_constructor, emacs_settings_get_property)
17142 (emacs_settings_set_property, emacs_settings_class_init)
17143 (emacs_settings_init, gsettings_obj): Remove.
17144 (something_changedCB): New function for HAVE_GSETTINGS.
17145 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17146 with value as argument.
17147 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17148 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 17149 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
17150 "changed".
17151
17152 * xgselect.c: Add defined (HAVE_GSETTINGS).
17153 (xgselect_initialize): Ditto.
17154
17155 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17156 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17157 xg_select.
17158
bbc6b304
PE
171592011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17160
17161 * eval.c (struct backtrace): Simplify and port the data structure.
17162 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17163 signed bit field, as this assumption is not portable and it makes
17164 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17165 "char debug_on_exit : 1" as this is not portable either; instead,
17166 use the portable "unsigned int debug_on_exit : 1". Remove unused
17167 member evalargs. Remove obsolete comments about cc bombing out.
17168
9851bfc5
JD
171692011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17170
51bb811f 17171 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
17172 Let HAVE_GSETTINGS override HAVE_GCONF.
17173 (store_monospaced_changed): New function.
17174 (EMACS_SETTINGS): A new type derived from GObject to handle
17175 GSettings notifications.
17176 (emacs_settings_constructor, emacs_settings_get_property)
17177 (emacs_settings_set_property, emacs_settings_class_init):
17178 New functions.
17179 (gsettings_client, gsettings_obj): New variables.
17180 (GSETTINGS_SCHEMA): New define.
17181 (something_changedCB): Call store_monospaced_changed.
17182 (init_gsettings): New function.
17183 (xsettings_initialize): Call init_gsettings.
17184 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17185 to NULL.
17186
640c8776 17187 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
17188 GCONF_CFLAGS/LIBS.
17189
5386012d
MR
171902011-06-29 Martin Rudalics <rudalics@gmx.at>
17191
17192 * window.c (resize_root_window, grow_mini_window)
17193 (shrink_mini_window): Rename Qresize_root_window to
17194 Qwindow_resize_root_window and Qresize_root_window_vertically to
17195 Qwindow_resize_root_window_vertically.
17196
f13e0b08
PE
171972011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17198
17199 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17200
94515237
JB
172012011-06-27 Juanma Barranquero <lekktu@gmail.com>
17202
17203 * makefile.w32-in: Redesign dependencies so they reflect more
17204 clearly which files are directly included by each source file,
17205 and not through other includes.
17206
e43b6e43
MR
172072011-06-27 Martin Rudalics <rudalics@gmx.at>
17208
17209 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17210 (sort_overlays, overlay_strings): When an overlay's clone number
17211 matches the window's clone number process the overlay even if
17212 the overlay's window property doesn't match the current window.
17213
d68443dc
MR
17214 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17215 (Fwindow_hchild): Rename to Fwindow_left_child.
17216 (Fwindow_next): Rename to Fwindow_next_sibling.
17217 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
17218 (resize_window_check): Rename to window_resize_check.
17219 (resize_window_apply): Rename to window_resize_apply.
17220 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17221 (Fdelete_other_windows_internal, resize_frame_windows)
17222 (Fsplit_window_internal, Fdelete_window_internal)
17223 (grow_mini_window, shrink_mini_window)
17224 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 17225
c7e73be5
JD
172262011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17227
17228 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17229 (emacs_fixed_set_min_size): Remove.
17230 (emacs_fixed_new): Take frame as argument.
17231
17232 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17233 (_EmacsFixedPrivate): Remove minwidth/height.
17234 Add struct frame *f.
17235 (emacs_fixed_init): Initialize priv->f.
17236 (get_parent_class, emacs_fixed_set_min_size): Remove.
17237 (emacs_fixed_new): Set priv->f to argument.
17238 (emacs_fixed_get_preferred_width)
17239 (emacs_fixed_get_preferred_height): Use min_width/height from
17240 frames size_hint to set minimum and natural (Bug#8919).
17241 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17242 and use min_width/height from frames size_hint to set
17243 min_width/height (Bug#8919).
17244
17245 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
17246 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17247 Fix indentation.
c7e73be5 17248
cf99dcf8
EZ
172492011-06-26 Eli Zaretskii <eliz@gnu.org>
17250
17251 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17252 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17253 called at ZV.
17254
029529ac
CY
172552011-06-26 Chong Yidong <cyd@stupidchicken.com>
17256
17257 * process.c (wait_reading_process_output): Bypass select if
17258 waiting for a cell while ignoring keyboard input, and input is
17259 pending. Suggested by Jan Djärv (Bug#8869).
17260
7a7ef429
PE
172612011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17262
17263 Use gnulib's dup2 module instead of rolling our own.
17264 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17265
11fdef7d 172662011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
17267
17268 * dispnew.c (scrolling_window): Before scrolling, turn off a
17269 mouse-highlight in the window being scrolled.
17270
cd3520a4
JB
172712011-06-24 Juanma Barranquero <lekktu@gmail.com>
17272
17273 Move DEFSYM to lisp.h and use everywhere.
17274
17275 * character.h (DEFSYM): Move declaration...
17276 * lisp.h (DEFSYM): ...here.
17277
17278 * gnutls.c:
17279 * minibuf.c:
17280 * w32menu.c:
17281 * w32proc.c:
17282 * w32select.c: Don't include character.h.
17283
17284 * alloc.c (syms_of_alloc):
17285 * buffer.c (syms_of_buffer):
17286 * bytecode.c (syms_of_bytecode):
17287 * callint.c (syms_of_callint):
17288 * casefiddle.c (syms_of_casefiddle):
17289 * casetab.c (init_casetab_once):
17290 * category.c (init_category_once, syms_of_category):
17291 * ccl.c (syms_of_ccl):
17292 * cmds.c (syms_of_cmds):
17293 * composite.c (syms_of_composite):
17294 * dbusbind.c (syms_of_dbusbind):
17295 * dired.c (syms_of_dired):
17296 * dispnew.c (syms_of_display):
17297 * doc.c (syms_of_doc):
17298 * editfns.c (syms_of_editfns):
17299 * emacs.c (syms_of_emacs):
17300 * eval.c (syms_of_eval):
17301 * fileio.c (syms_of_fileio):
17302 * fns.c (syms_of_fns):
17303 * frame.c (syms_of_frame):
17304 * fringe.c (syms_of_fringe):
17305 * insdel.c (syms_of_insdel):
17306 * keymap.c (syms_of_keymap):
17307 * lread.c (init_obarray, syms_of_lread):
17308 * macros.c (syms_of_macros):
17309 * msdos.c (syms_of_msdos):
17310 * print.c (syms_of_print):
17311 * process.c (syms_of_process):
17312 * search.c (syms_of_search):
17313 * sound.c (syms_of_sound):
17314 * syntax.c (init_syntax_once, syms_of_syntax):
17315 * terminal.c (syms_of_terminal):
17316 * textprop.c (syms_of_textprop):
17317 * undo.c (syms_of_undo):
17318 * w32.c (globals_of_w32):
17319 * window.c (syms_of_window):
17320 * xdisp.c (syms_of_xdisp):
17321 * xfaces.c (syms_of_xfaces):
17322 * xfns.c (syms_of_xfns):
17323 * xmenu.c (syms_of_xmenu):
17324 * xsettings.c (syms_of_xsettings):
17325 * xterm.c (syms_of_xterm): Use DEFSYM.
17326
4228cf16
TZ
173272011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
17328
cd3520a4 17329 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 17330
7fcccf1e
PE
173312011-06-23 Paul Eggert <eggert@cs.ucla.edu>
17332
7efb4e0e
PE
17333 Integer and buffer overflow fixes (Bug#8873).
17334
ff5844ad
PE
17335 * print.c (printchar, strout): Check for string overflow.
17336 (PRINTPREPARE, printchar, strout):
17337 Don't set size unless allocation succeeds.
17338
90532f02
PE
17339 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
17340 for sizes. Check for string overflow more accurately.
17341 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
17342
6d84508d
PE
17343 * macros.c: Integer and buffer overflow fixes.
17344 * keyboard.h (struct keyboard.kbd_macro_bufsize):
17345 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
17346 Use ptrdiff_t, not int, for sizes.
17347 Don't increment bufsize until after realloc succeeds.
17348 Check for size-calculation overflow.
17349 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
17350
437b2cb4
PE
17351 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
17352
8b9ac8b4
PE
17353 * lread.c: Integer overflow fixes.
17354 (read_integer): Radix is now EMACS_INT, not int,
17355 to improve quality of diagnostics for out-of-range radices.
17356 Calculate buffer size correctly for out-of-range radices.
17357 (read1): Check for integer overflow in radices, and in
17358 read-circle numbers.
82cb60d3
PE
17359 (read_escape): Avoid int overflow.
17360 (Fload, openp, read_buffer_size, read1)
17361 (substitute_object_recurse, read_vector, read_list, map_obarray):
17362 Use ptrdiff_t, not int, for sizes.
17363 (read1): Use EMACS_INT, not int, for sizes.
20270765 17364 Check for size overflow.
8b9ac8b4 17365
7fcccf1e
PE
17366 * image.c (cache_image): Check for size arithmetic overflow.
17367
bfbbd7e7
PE
17368 * lread.c: Integer overflow issues.
17369 (saved_doc_string_size, saved_doc_string_length)
17370 (prev_saved_doc_string_size, prev_saved_doc_string_length):
17371 Now ptrdiff_t, not int.
17372 (read1): Don't assume doc string length fits in int. Check for
17373 out-of-range doc string lengths.
17374 (read_list): Don't assume file position fits in int.
39019e54 17375 (read_escape): Check for hex character overflow.
bfbbd7e7 17376
4e323265
LL
173772011-06-22 Leo Liu <sdl.web@gmail.com>
17378
17379 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
17380 Move to minibuffer.el.
17381
85fece3e
PE
173822011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17383
20b84ce9 17384 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
17385 The following patches are for when GLYPH_DEBUG && !XASSERT.
17386 * dispextern.h (trace_redisplay_p, dump_glyph_string):
17387 * dispnew.c (flush_stdout):
17388 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
17389 Mark as externally visible.
17390 * dispnew.c (check_window_matrix_pointers): Now static.
17391 * dispnew.c (window_to_frame_vpos):
17392 * xfns.c (unwind_create_frame):
17393 * xterm.c (x_check_font): Remove unused local.
17394 * scroll.c (CHECK_BOUNDS):
17395 * xfaces.c (cache_fache): Rename local to avoid shadowing.
17396 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
17397 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
17398 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
17399 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
17400 Now static.
17401 (debug_method_add): Use va_list and vsprintf rather than relying
17402 on undefined behavior with wrong number of arguments.
17403 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
17404 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
17405 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
17406 since we're not interested in debugging glyphs with old libraries.
17407 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
17408 GCC 4.6.0's static checking.
17409
0766b489
PE
174102011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17411
31fd4b32
PE
17412 Integer overflow and signedness fixes (Bug#8873).
17413 A few related buffer overrun fixes, too.
17414
b79e8648
PE
17415 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
17416
0766b489
PE
17417 * dispextern.h (struct face.stipple):
17418 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
17419 (x_bitmap_mask, x_allocate_bitmap_record)
17420 (x_create_bitmap_from_data, x_create_bitmap_from_file)
17421 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
17422 (x_create_bitmap_from_xpm_data):
17423 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
17424 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
17425 (.bitmaps_last):
17426 * xfaces.c (load_pixmap):
17427 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
17428 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
17429 (.bitmaps_last, struct x_output.icon_bitmap):
17430 Use ptrdiff_t, not int, for bitmap indexes.
17431 (x_allocate_bitmap_record): Check for size overflow.
17432 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
17433
b081724f
PE
17434 Use ptrdiff_t, not int, for overlay counts.
17435 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
17436 * editfns.c (overlays_around, get_pos_property):
17437 * textprop.c (get_char_property_and_overlay):
17438 * xdisp.c (next_overlay_change, note_mouse_highlight):
17439 * xfaces.c (face_at_buffer_position):
21514da7
PE
17440 * buffer.c (OVERLAY_COUNT_MAX): New macro.
17441 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
17442 (Fnext_overlay_change, Fprevious_overlay_change)
17443 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 17444 Use ptrdiff_t, not int, for sizes.
21514da7 17445 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 17446
3de73e5e
PE
17447 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
17448
2606c57b
PE
17449 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
17450 (x_session_initialize): Do not assume string length fits in int.
17451
aaafe47a
PE
17452 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
17453 This is unlikely, but can occur if DPI is outlandish.
17454
2674ddc8 17455 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
17456 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
17457
28154962
PE
17458 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
17459 * xrdb.c (magic_file_p, search_magic_path):
17460 Omit last arg SUFFIX; it was always 0. All callers changed.
17461 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
17462
7de51af5
PE
17463 * xfont.c (xfont_match): Avoid need for strlen.
17464
25ed6cc3
PE
17465 * xfns.c: Don't assume strlen fits in int.
17466 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
17467
4eab31dd
PE
17468 * xdisp.c (message_log_check_duplicate): Return intmax_t,
17469 not unsigned long, as we prefer signed integers. All callers changed.
17470 Detect integer overflow in repeat count.
17471 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 17472 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 17473
171e2a58
PE
17474 * termcap.c: Don't assume sizes fit in int and never overflow.
17475 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
17476 (gobble_line): Check for size-calculation overflow.
17477
ad39faca 17478 * minibuf.c (Fread_buffer):
6e5bb2dc 17479 * lread.c (intern, intern_c_string):
74ca2eb3
PE
17480 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
17481 Don't assume string length fits in int.
17482
52c61c22 17483 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
17484 * gtkutil.c (style_changed_cb): Avoid need for strlen.
17485
b5b8c9e5
PE
17486 * font.c: Don't assume string length fits in int.
17487 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
17488 Use ptrdiff_t, not int.
ccd6111c
PE
17489 (font_intern_prop): Don't assume string length fits in int.
17490 Don't assume integer property fits in fixnum.
17491 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 17492
882f0d81 17493 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 17494 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
17495 Reformulate so as not to need the command string.
17496 Invoke gzip -cd rather than gunzip, as it's more portable.
17497 (lock_info_type, lock_file_1, lock_file):
17498 Don't assume pid_t and time_t fit in unsigned long.
17499 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
17500 (current_lock_owner): Prefer signed type for sizes.
17501 Use memcpy, not strncpy, where memcpy is what is really wanted.
17502 Don't assume (via atoi) that time_t and pid_t fit in int.
17503 Check for time_t and/or pid_t out of range, e.g., via a network share.
17504 Don't alloca where an auto var works fine.
17505
93f4cf88
PE
17506 * fileio.c: Fix some integer overflow issues.
17507 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
17508 Don't assume string length fits in int.
17509 (directory_file_name): Don't assume string length fits in long.
17510 (make_temp_name): Don't assume pid fits in int, or that its print
17511 length is less than 20.
17512
f3e92b69
PE
17513 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
17514
1bfdaf10
PE
17515 * coding.c (make_subsidiaries): Don't assume string length fits in int.
17516
35016e9a
PE
17517 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
17518
3d1e65a1
PE
17519 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
17520 We prefer signed integers, even for size calculations.
17521
0b963a93
PE
17522 * emacs.c: Don't assume string length fits in 'int'.
17523 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
17524 (main): Don't invoke strlen when not needed.
17525
573f4b54
PE
17526 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
17527 (XD_DEBUG_MESSAGE): Don't waste a byte.
17528
989f33ba
PE
17529 * callproc.c (getenv_internal_1, getenv_internal)
17530 (Fgetenv_internal):
965d34eb
PE
17531 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
17532
e4d29b33
PE
17533 * lread.c (invalid_syntax): Omit length argument.
17534 All uses changed. This doesn't fix a bug, but it simplifies the
17535 code away from its former Hollerith-constant appearance, and it's
17536 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 17537 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 17538
eb49b136
PE
17539 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
17540 This didn't break anything, but it didn't help either.
17541 It's confusing to put a bogus integer in a place where the actual
17542 value does not matter.
9f62aeb1 17543 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 17544 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 17545
15375a22
PE
17546 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
17547 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
17548 implementation.
b61cc01c
PE
17549 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
17550 We prefer signed types, and the value cannot exceed the EMACS_INT
17551 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
17552 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
17553 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
17554 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 17555
53b2623d
PE
17556 * indent.c (sane_tab_width): New function.
17557 (current_column, scan_for_column, Findent_to, position_indentation)
17558 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 17559 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 17560
51cab52b 17561 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 17562
f2ed8a70
PE
17563 * lisp.h (lint_assume): New macro.
17564 * composite.c (composition_gstring_put_cache):
17565 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
17566
abe80cc6
PE
17567 * editfns.c, insdel.c:
17568 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 17569
b02c740e
PE
17570 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
17571
ebc96716
PE
17572 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
17573
b4e50fa0 17574 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 17575 Use much-faster test for byte-length change.
311d5d7c 17576 Don't assume string byte-length fits in 'int'.
a4cf38e4 17577 Check that character arg fits in 'int'.
85461888 17578 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 17579
c0c1ee9f
PE
17580 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
17581
a498d7f4
PE
17582 * fns.c (concat): Catch string overflow earlier.
17583 Do not rely on integer wraparound.
17584
51cab52b
PE
17585 * dispextern.h (struct it.overlay_strings_charpos)
17586 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
17587 * xdisp.c (forward_to_next_line_start)
17588 (back_to_previous_visible_line_start)
17589 (reseat_at_next_visible_line_start, next_element_from_buffer):
17590 Don't arbitrarily truncate the value of 'selective' to int.
17591
76031fad
PE
17592 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
17593
5eb55db9
PE
17594 * composite.c: Don't truncate sizes to 'int'.
17595 (composition_gstring_p, composition_reseat_it)
17596 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
17597 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
17598 not EMACS_UINT, for indexes.
5eb55db9 17599
0703a717
PE
17600 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
17601
d6202519
PE
17602 * buffer.c: Include <verify.h>.
17603 (struct sortvec.priority, struct sortstr.priority):
8961a454 17604 Now EMACS_INT, not int.
c20998a7 17605 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
17606 (struct sortstr.size, record_overlay_string)
17607 (struct sortstrlist.size, struct sortlist.used):
17608 Don't truncate size to int.
17609 (record_overlay_string): Check for size-calculation overflow.
d6202519 17610 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 17611
d5a19415
JM
176122011-06-22 Jim Meyering <meyering@redhat.com>
17613
029529ac 17614 Don't leak an XBM-image-sized buffer
d5a19415
JM
17615 * image.c (xbm_load): Free the image buffer after using it.
17616
a9041e6c
PE
176172011-06-21 Paul Eggert <eggert@cs.ucla.edu>
17618
17619 Port to Sun C.
17620 * composite.c (find_automatic_composition): Omit needless 'return 0;'
17621 that Sun C diagnosed.
17622 * fns.c (secure_hash): Fix pointer signedness issue.
17623 * intervals.c (static_offset_intervals): New function.
17624 (offset_intervals): Use it.
17625
7f3f739f
LL
176262011-06-21 Leo Liu <sdl.web@gmail.com>
17627
17628 * deps.mk (fns.o):
17629 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
17630 sha512.h.
17631
17632 * fns.c (secure_hash): Rename from crypto_hash_function and change
17633 the first arg to accept symbols.
5b66d427 17634 (Fsecure_hash): New primitive.
7f3f739f
LL
17635 (syms_of_fns): New symbols.
17636
76147d94
DD
176372011-06-20 Deniz Dogan <deniz@dogan.se>
17638
17639 * process.c (Fset_process_buffer): Clarify return value in
17640 docstring.
17641
7d7d0045
CY
176422011-06-18 Chong Yidong <cyd@stupidchicken.com>
17643
17644 * dispnew.c (add_window_display_history): Use BVAR.
17645
17646 * xdisp.c (debug_method_add): Use BVAR.
17647 (check_window_end, dump_glyph_matrix, dump_glyph)
17648 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
17649
17650 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
17651 Likewise.
17652
17653 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
17654 check till after the cache is created in init_frame_faces.
17655
ff2bc410
SM
176562011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
17657
17658 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
17659
28177add
PE
176602011-06-16 Paul Eggert <eggert@cs.ucla.edu>
17661
dd3482fe
PE
17662 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
17663 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
17664 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
17665
393d71f3 17666 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
17667 * fileio.c (Finsert_file_contents):
17668 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
17669 Remove the old (too-loose) buffer overflow checks.
17670 They weren't needed, since make_gap checks for buffer overflow.
17671 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
17672 The old code merely checked for Emacs fixnum overflow, and relied
17673 on undefined (wraparound) behavior. The new code avoids undefined
17674 behavior, and also checks for ptrdiff_t and/or size_t overflow.
17675
2e6813b0 17676 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
17677 Tune. Don't use wider integers than needed. Don't use alloca.
17678 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 17679
599a9e4f
PE
17680 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
17681
99561444
PE
17682 * insdel.c, lisp.h (buffer_overflow): New function.
17683 (insert_from_buffer_1, replace_range, replace_range_2):
17684 * insdel.c (make_gap_larger):
17685 * editfns.c (Finsert_char):
17686 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
17687
28177add
PE
17688 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
17689
e69dafad
PE
176902011-06-15 Paul Eggert <eggert@cs.ucla.edu>
17691
4baa020d 17692 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 17693
b1c46f02
PE
17694 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
17695 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
17696
e69dafad
PE
17697 * fileio.c: Don't assume EMACS_INT fits in off_t.
17698 (emacs_lseek): New static function.
17699 (Finsert_file_contents, Fwrite_region): Use it.
17700 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
17701
566684ea
PE
17702 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
17703
e6966cd6
PE
17704 * fns.c: Don't overflow int when computing a list length.
17705 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
17706 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
17707 truncation on 64-bit hosts. Check for QUIT every
17708 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
17709 faster and is responsive enough.
17710 (Flength): Report an error instead of overflowing an integer.
17711 (Fsafe_length): Return a float if the value is not representable
17712 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 17713 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 17714 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 17715
dd0b0efb
PE
17716 * alloc.c: Check that resized vectors' lengths fit in fixnums.
17717 (header_size, word_size): New constants.
17718 (allocate_vectorlike): Don't check size overflow here.
17719 (allocate_vector): Check it here instead, since this is the only
17720 caller of allocate_vectorlike that could cause overflow.
17721 Check that the new vector's length is representable as a fixnum.
17722
86fe5cfe
PE
17723 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
17724 The previous code was bogus. For example, next_almost_prime (32)
17725 returned 39, which is undesirable as it is a multiple of 3; and
17726 next_almost_prime (24) returned 25, which is a multiple of 5 so
17727 why was the code bothering to check for multiples of 7?
17728
80e88859
PE
17729 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
17730
4a2f0ad6
PE
17731 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
17732
f66c7cf8
PE
17733 Variadic C functions now count arguments with ptrdiff_t.
17734 This partly undoes my 2011-03-30 change, which replaced int with size_t.
17735 Back then I didn't know that the Emacs coding style prefers signed int.
17736 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
17737 were being counted with int, which may truncate counts on 64-bit
17738 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
17739 * lisp.h (struct Lisp_Subr.function.aMANY)
17740 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
17741 Arg counts are now ptrdiff_t, not size_t.
17742 All variadic functions and their callers changed accordingly.
17743 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
17744 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
17745 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
17746 * callint.c (Fcall_interactively): Check arg count for overflow,
17747 to avoid potential buffer overrun. Use signed char, not 'int',
17748 for 'varies' array, so that we needn't bother to check its size
17749 calculation for overflow.
17750 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
17751 * eval.c (apply_lambda):
17752 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
17753 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
17754 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
17755
a1759b76
PE
17756 * callint.c (Fcall_interactively): Don't use index var as event count.
17757
d96be9fc
PE
17758 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
17759 * mem-limits.h (SIZE): Remove; no longer used.
17760
a690a978 17761 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 17762
578c21e6
PE
17763 Remove unnecessary casts.
17764 * xterm.c (x_term_init):
17765 * xfns.c (x_set_border_pixel):
17766 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
17767 These aren't needed now that we assume ANSI C.
17768
96f53c6c
PE
17769 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
17770 It's more likely to cause problems (due to unsigned overflow)
17771 than to cure them.
17772
83c77d31
PE
17773 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
17774
ee2079f1
PE
17775 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
17776
6da65536
PE
17777 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
17778
7147c4a4
PE
17779 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
17780
193e32d9
PE
17781 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
17782
e5533da6
PE
17783 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
17784
9910e595
PE
17785 GLYPH_CODE_FACE returns EMACS_INT, not int.
17786 * dispextern.h (merge_faces):
17787 * xfaces.c (merge_faces):
01103c44
PE
17788 * xdisp.c (get_next_display_element, next_element_from_display_vector):
17789 Don't assume EMACS_INT fits in int.
9910e595 17790
2638320e
PE
17791 * character.h (CHAR_VALID_P): Remove unused parameter.
17792 * fontset.c, lisp.h, xdisp.c: All uses changed.
17793
045eb8d9
PE
17794 * editfns.c (Ftranslate_region_internal): Omit redundant test.
17795
c1f134b5
PE
17796 * fns.c (concat): Minor tuning based on overflow analysis.
17797 This doesn't fix any bugs. Use int to hold character, instead
17798 of constantly refetching from Emacs object. Use XFASTINT, not
17799 XINT, for value known to be a character. Don't bother comparing
17800 a single byte to 0400, as it's always less.
17801
395fcb93 17802 * floatfns.c (Fexpt):
327eeec8
PE
17803 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
17804
abbd3d23
PE
17805 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
17806 for characters.
17807
684a03ef
PE
17808 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
17809
0fed43f3
PE
17810 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
17811 Without this fix, on a 64-bit host (aset S 0 4294967386) would
17812 incorrectly succeed when S was a string, because 4294967386 was
17813 truncated before it was used.
17814
8fd02eb7
PE
17815 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
17816 Otherwise, an out-of-range integer could cause undefined behavior
17817 on a 64-bit host.
17818
f8c86b69
PE
17819 * composite.c: Use int, not EMACS_INT, for characters.
17820 (fill_gstring_body, composition_compute_stop_pos): Use int, not
17821 EMACS_INT, for values that are known to be in character range.
17822 This doesn't fix any bugs but is the usual style inside Emacs and
17823 may generate better code on 32-bit machines.
17824
34206dd2
PE
17825 Make sure a 64-bit char is never passed to ENCODE_CHAR.
17826 This is for reasons similar to the recent CHAR_STRING fix.
17827 * charset.c (Fencode_char): Check that character arg is actually
17828 a character. Pass an int to ENCODE_CHAR.
17829 * charset.h (ENCODE_CHAR): Verify that the character argument is no
17830 wider than 'int', as a compile-time check to prevent future regressions
17831 in this area.
17832
c5958d4c 17833 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
17834
17835 Make sure a 64-bit char is never passed to CHAR_STRING.
17836 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
17837 by silently ignoring the top 32 bits, allowing some values
17838 that were far too large to be valid characters.
17839 * character.h: Include <verify.h>.
17840 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
17841 arguments are no wider than unsigned, as a compile-time check
17842 to prevent future regressions in this area.
17843 * data.c (Faset):
01103c44 17844 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
17845 (Fsubst_char_in_region):
17846 * fns.c (concat):
17847 * xdisp.c (decode_mode_spec_coding):
17848 Adjust to CHAR_STRING's new requirement.
17849 * editfns.c (Finsert_char, Fsubst_char_in_region):
17850 * fns.c (concat): Check that character args are actually
17851 characters. Without this test, these functions did the wrong
17852 thing with wildly out-of-range values on 64-bit hosts.
17853
d37ca623
PE
17854 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
17855 These casts should not be needed on 32-bit hosts, either.
17856 * keyboard.c (read_char):
17857 * lread.c (Fload): Remove casts to unsigned.
17858
ea204efb
PE
17859 * lisp.h (UNSIGNED_CMP): New macro.
17860 This fixes comparison bugs on 64-bit hosts.
17861 (ASCII_CHAR_P): Use it.
17862 * casefiddle.c (casify_object):
01103c44 17863 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
17864 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
17865 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
17866 * dispextern.h (FACE_FROM_ID):
17867 * keyboard.c (read_char): Use UNSIGNED_CMP.
17868
41cb286c
PE
17869 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
17870 not to EMACS_INT, to avoid GCC warning.
17871
4a1b9832
PE
17872 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
17873
55daad71
PE
17874 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
17875 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
17876 isn't needed on 32-bit machines.
8f95c75c 17877
01103c44
PE
17878 * buffer.c (Fgenerate_new_buffer_name):
17879 Use EMACS_INT for count, not int.
0ceccced 17880 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
17881
17882 * data.c (Qcompiled_function): Now static.
17883
c6f072e7
PE
17884 * window.c (window_body_lines): Now static.
17885
20ce5912
PE
17886 * image.c (gif_load): Rename local to avoid shadowing.
17887
9c4c5f81
PE
17888 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
17889 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
17890 * alloc.c (make_save_value): Integer argument is now of type
17891 ptrdiff_t, not int.
17892 (mark_object): Use ptrdiff_t, not int.
17893 * lisp.h (pD): New macro.
17894 * print.c (print_object): Use it.
17895
c0c5c8ae
PE
17896 * alloc.c: Use EMACS_INT, not int, to count objects.
17897 (total_conses, total_markers, total_symbols, total_vector_size)
17898 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
17899 (total_free_floats, total_floats, total_free_intervals)
17900 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
17901 Now EMACS_INT, not int. All uses changed.
17902 (Fgarbage_collect): Compute overall total using a double, so that
17903 integer overflow is less likely to be a problem. Check for overflow
17904 when converting back to an integer.
5a25e253
PE
17905 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
17906 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
17907 These were 'int' variables that could overflow on 64-bit hosts;
17908 they were never used, so remove them instead of repairing them.
211a0b2a 17909 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
17910 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
17911 Previously, this ceilinged at INT_MAX, but that doesn't work on
17912 64-bit machines.
e46bb31a 17913 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 17914
c78baabf 17915 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 17916 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
17917 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
17918 when a (possibly-narrower) signed value would do just as well.
17919 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 17920
c9d624c6
PE
17921 * alloc.c: Catch some string size overflows that we were missing.
17922 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
17923 for convenience in STRING_BYTES_MAX.
17924 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
17925 The definition here is exact; the one in lisp.h was approximate.
17926 (allocate_string_data): Check for string overflow. This catches
17927 some instances we weren't catching before. Also, it catches
17928 size_t overflow on (unusual) hosts where SIZE_MAX <= min
17929 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
17930 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 17931
c9d624c6
PE
17932 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
17933 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 17934 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 17935
353032ce
PE
17936 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
17937
2bccce07
PE
17938 * alloc.c (Fmake_string): Check for out-of-range init.
17939
0ac30604
SM
179402011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
17941
17942 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
17943
c195f2de
JD
179442011-06-14 Jan Djärv <jan.h.d@swipnet.se>
17945
17946 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
17947 xg_get_default_scrollbar_width.
17948
17949 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
17950 (int_gtk_range_get_value): Move to the scroll bar part of the file.
17951 (style_changed_cb): Call update_theme_scrollbar_width and call
17952 x_set_scroll_bar_default_width and xg_frame_set_char_size for
17953 all frames (Bug#8505).
17954 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
17955 Call gtk_window_set_resizable if HAVE_GTK3.
17956 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
17957 and height if HAVE_GTK3 (Bug#8505).
17958 (scroll_bar_width_for_theme): New variable.
17959 (update_theme_scrollbar_width): New function.
17960 (xg_get_default_scrollbar_width): Move code to
17961 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
17962 (xg_initialize): Call update_theme_scrollbar_width.
17963
17964 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
17965
17966 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
17967
e10ac9f1
MR
179682011-06-12 Martin Rudalics <rudalics@gmx.at>
17969
17970 * frame.c (make_frame): Call other_buffer_safely instead of
17971 other_buffer.
17972
17973 * window.c (temp_output_buffer_show): Call display_buffer with
17974 second argument Vtemp_buffer_show_specifiers and reset latter
17975 immediately after the call.
17976 (Vtemp_buffer_show_specifiers): New variable.
17977 (auto_window_vscroll_p, next_screen_context_lines)
17978 (Vscroll_preserve_screen_position): Remove leading asterisks from
17979 doc-strings.
17980
2d3c217e 179812011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 17982
7b7f97e8 17983 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
17984 * buffer.c (Qclone_number): Remove for now, as it's unused.
17985 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
17986 (record_buffer): Remove unused local.
17987 * frame.c (other_visible_frames, frame_buffer_list): Now static.
17988 (set_frame_buffer_list): Remove; unused.
17989 * frame.h (other_visible_frames): Remove decl.
17990 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
17991 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
17992 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
17993 if HAVE_GPM.
17994 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
17995 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
17996 Define only if HAVE_GPM.
17997 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
17998 (update_hints_inhibit): Remove; never set. All uses removed.
17999 * widgetprv.h (emacsFrameClassRec): Remove decl.
18000 * window.c (delete_deletable_window): Now returns void, since it
18001 wasn't returning anything.
18002 (compare_window_configurations): Remove unused locals.
18003 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18004 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
18005 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18006 the same widths as pointers. This follows up on the 2011-05-06 patch.
18007 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18008 * xterm.h: Likewise.
18009 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18010
1384b89e
JB
180112011-06-12 Juanma Barranquero <lekktu@gmail.com>
18012
18013 * makefile.w32-in: Update dependencies.
18014 (LISP_H): Add lib/intprops.h.
18015
1100a63c
CY
180162011-06-11 Chong Yidong <cyd@stupidchicken.com>
18017
18018 * image.c (gif_load): Add animation frame delay to the metadata.
18019 (syms_of_image): Use DEFSYM. New symbol `delay'.
18020
6198ccd0
MR
180212011-06-11 Martin Rudalics <rudalics@gmx.at>
18022
18023 * window.c (delete_deletable_window): Re-add.
18024 (Fset_window_configuration): Rewrite to handle dead buffers and
18025 consequently deletable windows.
18026 (window_tree, Fwindow_tree): Remove. Supply functionality in
18027 window.el.
18028 (compare_window_configurations): Simplify code.
18029
b6e3633c
AS
180302011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18031
1ab0dee5
AS
18032 * image.c (imagemagick_load_image): Fix type mismatch.
18033 (Fimagemagick_types): Likewise.
18034
b6e3633c
AS
18035 * window.h (replace_buffer_in_windows): Declare.
18036
9397e56f
MR
180372011-06-11 Martin Rudalics <rudalics@gmx.at>
18038
18039 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18040 Qclone_number. Remove external declaration of Qdelete_window.
18041 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18042 code.
640c8776
SM
18043 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18044 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
18045 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18046 buffer list implementation.
18047 (other_buffer_safely): New function.
18048 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18049 calls to replace_buffer_in_windows and
18050 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18051 if allowed.
18052 (record_buffer): Inhibit quitting and rewrite using quittable
18053 functions. Run Qbuffer_list_update_hook if allowed.
18054 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
18055 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18056 Move switch-to-buffer to window.el.
9397e56f
MR
18057 (bury-buffer): Move to window.el.
18058 (Vbuffer_list_update_hook): New variable.
18059
18060 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18061 section.
18062
18063 * window.h (resize_frame_windows): Move up in code.
18064 (Fwindow_frame): Remove EXFUN.
18065 (replace_buffer_in_all_windows): Remove prototype.
18066 (replace_buffer_in_windows_safely): Add prototype.
18067
18068 * window.c: Declare Qdelete_window static again. Move down
18069 declaration of select_count.
18070 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18071 (Fother_window): Move to window.el.
18072 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18073 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18074 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18075 window.el.
18076 (replace_buffer_in_windows): Implement by calling
18077 Qreplace_buffer_in_windows.
18078 (replace_buffer_in_all_windows): Remove with some functionality
18079 moved into replace_buffer_in_windows_safely.
18080 (replace_buffer_in_windows_safely): New function.
18081 (select_window_norecord, select_frame_norecord): Move in front
18082 of run_window_configuration_change_hook. Remove now obsolete
18083 declarations.
640c8776
SM
18084 (Fset_window_buffer): Rewrite doc-string.
18085 Call Qrecord_window_buffer.
9397e56f
MR
18086 (keys_of_window): Move binding for other-window to window.el.
18087
b50691aa
CY
180882011-06-11 Chong Yidong <cyd@stupidchicken.com>
18089
18090 * dispextern.h (struct image): Replace data member, whose int_val
18091 and ptr_val fields were not used by anything, with a single
18092 lisp_val object.
18093
18094 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18095 (gif_clear_image, gif_load, imagemagick_load_image)
18096 (gs_clear_image, gs_load): Callers changed.
18097
3f754b86
PE
180982011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18099
cca69397
PE
18100 * buffer.h: Include <time.h>, for time_t.
18101 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18102
109e28d0
PE
18103 Fix minor problems found by static checking.
18104
60737f02
PE
18105 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18106
4b66faf3
PE
18107 Make identifiers static if they are not used in other modules.
18108 * data.c (Qcompiled_function, Qframe, Qvector):
18109 * image.c (QimageMagick, Qsvg):
18110 * minibuf.c (Qmetadata):
18111 * window.c (resize_window_check, resize_root_window): Now static.
18112 * window.h (resize_window_check, resize_root_window): Remove decls.
18113
109e28d0
PE
18114 * window.c (window_deletion_count, delete_deletable_window):
18115 Remove; unused.
46a4ce9e
PE
18116 (window_body_lines): Now static.
18117 (Fdelete_other_windows_internal): Mark vars as initialized.
18118 Make sure 'resize_failed' is initialized.
18119 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18120 (resize_window_apply): Remove unused local.
18121 * window.h (delete_deletable_window): Remove decl.
18122
109e28d0 18123 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
18124 (imagemagick_load_image): Fix pointer signedness problem by changing
18125 last arg from unsigned char * to char *. All uses changed.
18126 Also, fix a local for similar reasons.
18127 Remove unused locals. Remove locals to avoid shadowing.
18128 (fn_rsvg_handle_free): Remove; unused.
18129 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 18130 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 18131
3f754b86
PE
18132 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18133
2547adb1
CY
181342011-06-10 Chong Yidong <cyd@stupidchicken.com>
18135
18136 * image.c (gif_load): Fix omitted cast error introduced by
18137 2011-06-06 change.
18138
2c8e37d4
MR
181392011-06-10 Martin Rudalics <rudalics@gmx.at>
18140
18141 * window.h (resize_proportionally, orig_total_lines)
18142 (orig_top_line): Remove from window structure.
18143 (set_window_height, set_window_width, change_window_heights)
18144 (Fdelete_window): Remove prototypes.
18145 (resize_frame_windows): Remove duplicate declaration.
18146
440a42e3
EZ
181472011-06-10 Eli Zaretskii <eliz@gnu.org>
18148
18149 * window.h (resize_frame_windows, resize_window_check)
18150 (delete_deletable_window, resize_root_window)
18151 (resize_frame_windows): Declare prototypes.
18152
18153 * window.c (resize_window_apply): Make definition be "static" to
18154 match the prototype.
18155
562dd5e9
MR
181562011-06-10 Martin Rudalics <rudalics@gmx.at>
18157
18158 * window.c: Remove declarations of Qwindow_size_fixed,
18159 window_min_size_1, window_min_size_2, window_min_size,
18160 size_window, window_fixed_size_p, enlarge_window, delete_window.
18161 Remove static from declaration of Qdelete_window, it's
18162 temporarily needed by Fbury_buffer.
18163 (replace_window): Don't assign orig_top_line and
18164 orig_total_lines.
18165 (Fdelete_window, delete_window): Remove. Window deletion is
18166 handled by window.el.
640c8776
SM
18167 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18168 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
18169 (Fdelete_other_windows): Remove. Deleting other windows is
18170 handled by window.el.
18171 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18172 handled in window.el.
18173 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18174 Window minimum sizes are handled in window.el.
18175 (shrink_windows, size_window, set_window_height)
18176 (set_window_width, change_window_heights, window_height)
18177 (window_width, CURBEG, CURSIZE, enlarge_window)
18178 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18179 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18180 handled in window.el.
18181 (make_dummy_parent): Rename to make_parent_window and give it a
18182 second argument horflag.
18183 (make_window): Don't set resize_proportionally any more.
18184 (Fsplit_window): Remove. Windows are split in window.el.
18185 (save_restore_action, save_restore_orig_size)
18186 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18187 Resize mini windows in window.el.
18188 (grow_mini_window, shrink_mini_window): Implement by calling
18189 Qresize_root_window_vertically, resize_window_check and
18190 resize_window_apply.
640c8776
SM
18191 (saved_window, Fset_window_configuration, save_window_save):
18192 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
18193 resize_proportionally.
18194 (window_min_height, window_min_width): Move to window.el.
18195 (keys_of_window): Move bindings for delete-other-windows,
18196 split-window, delete-window and enlarge-window to window.el.
18197
18198 * buffer.c: Temporarily extern Qdelete_window.
18199 (Fbury_buffer): Temporarily call Qdelete_window instead of
18200 Fdelete_window (Fbury_buffer will move to window.el soon).
18201
18202 * frame.c (set_menu_bar_lines_1): Remove code handling
18203 orig_top_line and orig_total_lines.
18204
18205 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18206 set_window_height but set heights directly.
18207 (change_frame_size_1): Use resize_frame_windows.
18208
18209 * xdisp.c (init_xdisp): Don't use set_window_height but set
18210 heights directly.
18211
640c8776
SM
18212 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18213 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
18214 run_window_configuration_change_hook.
18215
18216 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18217 instead of change_window_heights and run
18218 run_window_configuration_change_hook.
18219
1a13852e
MR
182202011-06-09 Martin Rudalics <rudalics@gmx.at>
18221
18222 * window.c (replace_window): Rename second argument REPLACEMENT to
18223 NEW. New third argument SETFLAG. Rewrite.
18224 (delete_window, make_dummy_parent): Call replace_window with
18225 third argument 1.
18226 (window_list_1): Move down in code.
18227 (run_window_configuration_change_hook): Move set_buffer part
18228 before select_frame_norecord part in order to unwind correctly.
18229 Rename count1 to count.
18230 (recombine_windows, delete_deletable_window, resize_root_window)
18231 (Fdelete_other_windows_internal)
18232 (Frun_window_configuration_change_hook, make_parent_window)
18233 (resize_window_check, resize_window_apply, Fresize_window_apply)
18234 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
18235 (Fdelete_window_internal, Fresize_mini_window_internal):
18236 New functions.
1a13852e
MR
18237 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18238
f3d1777e
MR
182392011-06-08 Martin Rudalics <rudalics@gmx.at>
18240
496e208e
MR
18241 * window.h (window): Add some new members to window structure -
18242 normal_lines, normal_cols, new_total, new_normal, clone_number,
18243 splits, nest, prev_buffers, next_buffers.
18244 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 18245 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 18246
f3d1777e
MR
18247 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18248 Remove.
496e208e
MR
18249 (make_dummy_parent): Set new members of windows structure.
18250 (make_window): Move down in code. Handle new members of window
18251 structure.
18252 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18253 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18254 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18255 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
18256 (Fset_window_next_buffers, Fset_window_clone_number):
18257 New functions.
496e208e
MR
18258 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18259 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18260 Doc-string fixes.
18261 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18262 Argument WINDOW can be now internal window too.
18263 (Fwindow_use_time): Move up in code.
18264 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18265 Rewrite doc-string.
18266 (Fset_window_configuration, saved_window)
18267 (Fcurrent_window_configuration, save_window_save): Handle new
18268 members of window structure.
b9e809c2
MR
18269 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18270 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18271 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18272 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18273 Qget_mru_window, Qresize_root_window,
18274 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18275 Qauto_buffer_name; staticpro them.
f3d1777e 18276
abde8f8c
MR
182772011-06-07 Martin Rudalics <rudalics@gmx.at>
18278
18279 * window.c (Fwindow_total_size, Fwindow_left_column)
18280 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18281 (Fwindow_list_1): New functions.
18282 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
18283 (Fwindow_width, Fscroll_left, Fscroll_right):
18284 Use window_body_cols instead of window_box_text_cols.
18285 (delete_window, Fset_window_configuration):
18286 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
18287 (delete_all_subwindows): Take a window as argument and not a
18288 structure. Rewrite.
190b47e6
MR
18289 (window_loop): Remove handling of GET_LRU_WINDOW and
18290 GET_LARGEST_WINDOW.
18291 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
18292
18293 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
18294 window_box_text_cols. delete_all_subwindows now takes a
18295 Lisp_Object as argument.
abde8f8c 18296
640c8776
SM
18297 * indent.c (compute_motion, Fcompute_motion):
18298 Use window_body_cols instead of window_box_text_cols.
abde8f8c 18299
fa8a67e6
MR
18300 * frame.c (delete_frame): Call delete_all_subwindows with root
18301 window as argument.
18302
a54e3482
DC
183032011-06-07 Daniel Colascione <dan.colascione@gmail.com>
18304
18305 * fns.c (Fputhash): Document return value.
18306
60002bf5
CY
183072011-06-06 Chong Yidong <cyd@stupidchicken.com>
18308
18309 * image.c (gif_load): Implement gif89a spec "no disposal" method.
18310
0c671da6 183112011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 18312
b862a52a 18313 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 18314
be44ca6c
PE
18315 Check for overflow when converting integer to cons and back.
18316 * charset.c (Fdefine_charset_internal, Fdecode_char):
18317 Use cons_to_unsigned to catch overflow.
18318 (Fencode_char): Use INTEGER_TO_CONS.
18319 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
18320 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
18321 * data.c (long_to_cons, cons_to_long): Remove.
18322 (cons_to_unsigned, cons_to_signed): New functions.
18323 These signal an error for invalid or out-of-range values.
18324 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
18325 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
18326 * font.c (Ffont_variation_glyphs):
18327 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
18328 * lisp.h: Include <intprops.h>.
18329 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
18330 (cons_to_signed, cons_to_unsigned): New decls.
18331 (long_to_cons, cons_to_long): Remove decls.
18332 * undo.c (record_first_change): Use INTEGER_TO_CONS.
18333 (Fprimitive_undo): Use CONS_TO_INTEGER.
18334 * xfns.c (Fx_window_property): Likewise.
18335 * xselect.c: Include <limits.h>.
18336 (x_own_selection, selection_data_to_lisp_data):
18337 Use INTEGER_TO_CONS.
18338 (x_handle_selection_request, x_handle_selection_clear)
18339 (x_get_foreign_selection, Fx_disown_selection_internal)
18340 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
18341 (lisp_data_to_selection_data): Use cons_to_unsigned.
18342 (x_fill_property_data): Use cons_to_signed.
18343 Report values out of range.
18344
d1f3d2af
PE
18345 Check for buffer and string overflow more precisely.
18346 * buffer.h (BUF_BYTES_MAX): New macro.
18347 * lisp.h (STRING_BYTES_MAX): New macro.
18348 * alloc.c (Fmake_string):
18349 * character.c (string_escape_byte8):
18350 * coding.c (coding_alloc_by_realloc):
18351 * doprnt.c (doprnt):
18352 * editfns.c (Fformat):
18353 * eval.c (verror):
18354 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
18355 since they may not be the same number.
18356 * editfns.c (Finsert_char):
18357 * fileio.c (Finsert_file_contents):
18358 Likewise for BUF_BYTES_MAX.
18359
dd52fcea
PE
18360 * image.c: Use ptrdiff_t, not int, for sizes.
18361 (slurp_file): Switch from int to ptrdiff_t.
18362 All uses changed.
18363 (slurp_file): Check that file size fits in both size_t (for
18364 malloc) and ptrdiff_t (for sanity and safety).
18365
7f9bbdbb
PE
18366 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
18367 if b->modtime has its maximal value.
18368
dfe18f82
PE
18369 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
18370
84acfcf0
PE
18371 Don't assume time_t can fit into int.
18372 * buffer.h (struct buffer.modtime): Now time_t, not int.
18373 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
18374 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
18375
ccd9a01a
PE
18376 Minor fixes for signed vs unsigned integers.
18377 * character.h (MAYBE_UNIFY_CHAR):
18378 * charset.c (maybe_unify_char):
18379 * keyboard.c (read_char, reorder_modifiers):
18380 XINT -> XFASTINT, since the integer must be nonnegative.
18381 * ftfont.c (ftfont_spec_pattern):
18382 * keymap.c (access_keymap, silly_event_symbol_error):
18383 XUINT -> XFASTINT, since the integer must be nonnegative.
18384 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
18385 since it makes no difference and we prefer signed.
18386 * keyboard.c (record_char): Use XUINT when all the neighbors do.
18387 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
18388 nonnegative.
18389
d6d100dd
SM
183902011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
18391
18392 * window.h (Fwindow_frame): Declare.
18393
2b6148e4
PE
183942011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18395
18396 * alloc.c: Simplify handling of large-request failures (Bug#8800).
18397 (SPARE_MEMORY): Always define.
18398 (LARGE_REQUEST): Remove.
18399 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
18400
f230ecc9
MR
184012011-06-06 Martin Rudalics <rudalics@gmx.at>
18402
727e958e
MR
18403 * lisp.h: Move EXFUNS for Fframe_root_window,
18404 Fframe_first_window and Fset_frame_selected_window to window.h.
18405
18406 * window.h: Move EXFUNS for Fframe_root_window,
18407 Fframe_first_window and Fset_frame_selected_window here from
18408 lisp.h.
18409
18410 * frame.c (Fwindow_frame, Fframe_first_window)
18411 (Fframe_root_window, Fframe_selected_window)
18412 (Fset_frame_selected_window): Move to window.c.
18413 (Factive_minibuffer_window): Move to minibuf.c.
18414 (Fother_visible_frames_p): New function.
18415
18416 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
18417
f230ecc9
MR
18418 * window.c (decode_window, decode_any_window): Move up in code.
18419 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
18420 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
18421 (Fwindow_buffer): Move up and rewrite doc-string.
18422 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
18423 (Fwindow_prev): New functions.
727e958e
MR
18424 (Fwindow_frame): Move here from frame.c. Accept any window as
18425 argument.
18426 (Fframe_root_window, Fframe_first_window)
18427 (Fframe_selected_window): Move here from frame.c. Accept frame
18428 or arbitrary window as argument. Update doc-strings.
18429 (Fminibuffer_window): Move up in code.
18430 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
18431 (Fset_frame_selected_window): Move here from frame.c.
18432 Marginal rewrite.
727e958e
MR
18433 (Fselected_window, select_window, Fselect_window): Move up in
18434 code. Minor doc-string fixes.
f230ecc9 18435
4d09bcf6
PE
184362011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18437
18438 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
18439 Do not assume that spare memory exists; that assumption is valid
18440 only if SYSTEM_MALLOC.
18441 (LARGE_REQUEST): New macro, so that the issue of large requests
18442 is separated from the issue of spare memory.
18443
810928a2
AS
184442011-06-05 Andreas Schwab <schwab@linux-m68k.org>
18445
172418ad
AS
18446 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
18447 format. (Bug#8806)
18448
43f862f7
AS
18449 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
18450
810928a2
AS
18451 * xfns.c (x_set_scroll_bar_default_width): Move declarations
18452 before statements.
18453
a059fe24
JD
184542011-06-05 Jan Djärv <jan.h.d@swipnet.se>
18455
18456 * gtkutil.c (xg_get_default_scrollbar_width): New function.
18457
18458 * gtkutil.h: Declare xg_get_default_scrollbar_width.
18459
18460 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
18461 min width by calling x_set_scroll_bar_default_width (Bug#8505).
18462
989bf368
JB
184632011-06-05 Juanma Barranquero <lekktu@gmail.com>
18464
18465 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
18466
4b80f674
CY
184672011-06-04 Chong Yidong <cyd@stupidchicken.com>
18468
18469 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
18470 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
18471 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
18472 New error handlers.
4b80f674
CY
18473 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
18474 Obey Vx_select_enable_clipboard_manager. Catch errors in
18475 x_clipboard_manager_save (Bug#8779).
18476 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 18477 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 18478
99a33b77 184792011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
18480
18481 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
18482
99a33b77 184832011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
18484
18485 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
18486 in the current matrix if keep_current_p is non-zero.
18487
8264569d
EZ
184882011-06-04 Eli Zaretskii <eliz@gnu.org>
18489
18490 * bidi.c (bidi_level_of_next_char): Fix last change.
18491
57f97249
EZ
184922011-06-03 Eli Zaretskii <eliz@gnu.org>
18493
fec2107c 18494 Support bidi reordering of text covered by display properties.
57f97249 18495
fec2107c
EZ
18496 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
18497 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
18498 (bidi_cache_search, bidi_cache_iterator_state)
18499 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
18500 (bidi_level_of_next_char, bidi_move_to_visually_next):
18501 Support character positions inside a run of characters covered by a
fec2107c
EZ
18502 display string.
18503 (bidi_paragraph_init, bidi_resolve_explicit_1)
18504 (bidi_level_of_next_char): Call bidi_fetch_char and
18505 bidi_fetch_char_advance instead of FETCH_CHAR and
18506 FETCH_CHAR_ADVANCE.
18507 (bidi_init_it): Initialize new members.
18508 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
18509 definitions.
18510 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
18511 instead of using explicit *_CHAR codes.
d6d100dd
SM
18512 (bidi_resolve_explicit, bidi_resolve_weak):
18513 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
18514 bidirectional text is supported only in multibyte buffers.
18515 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
18516 it to initialize the frame_window_p member of struct bidi_it.
18517 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
18518 (bidi_resolve_explicit, bidi_resolve_weak)
18519 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
18520 bidi_it->nchars is non-positive.
18521 (bidi_level_of_next_char): Don't try to lookup the cache for the
18522 next/previous character if nothing is cached there yet, or if we
18523 were just reseat()'ed to a new position.
c40e2fb2 18524
0e14fe90
EZ
18525 * xdisp.c (set_cursor_from_row): Set start and stop points
18526 according to the row's direction when priming the loop that looks
18527 for the glyph on which to display cursor.
18528 (single_display_spec_intangible_p): Function deleted.
18529 (display_prop_intangible_p): Reimplement to call
18530 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
18531 Accept 3 additional arguments needed by handle_display_spec.
18532 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
18533 values: lists, `(when COND...)' forms, etc.
18534 (single_display_spec_string_p): Support property values that are
18535 lists with the argument STRING its top-level element.
18536 (display_prop_string_p): Fix the condition for processing a
18537 property that is a list to be consistent with handle_display_spec.
fec2107c 18538 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
18539 last portion of handle_display_prop.
18540 (compute_display_string_pos): Accept additional argument
18541 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
18542 value of a `display' property is a "replacing spec".
18543 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
18544 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
18545 the display property, but just return a value indicating whether
18546 the display property will replace the characters it covers.
18547 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
18548 frame_window_p members of struct bidi_it.
d6d100dd
SM
18549 (compute_display_string_pos, compute_display_string_end):
18550 New functions.
fec2107c
EZ
18551 (push_it): Accept second argument POSITION, where pop_it should
18552 jump to continue iteration.
18553 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 18554
fec2107c
EZ
18555 * keyboard.c (adjust_point_for_property): Adjust the call to
18556 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
18557
18558 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
18559 (bidi_init_it): Update prototypes.
18560 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
18561 (compute_display_string_pos, compute_display_string_end):
18562 Declare prototypes.
fec2107c
EZ
18563 (struct bidi_it): New members nchars and disp_pos. ch_len is now
18564 EMACS_INT.
fc6f18ce 18565
40087514 185662011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 18567
57f53182
PE
18568 Malloc failure behavior now depends on size of allocation.
18569 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
18570 * lisp.h: Change signatures accordingly.
18571 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
18572 All callers changed. (Bug#8762)
18573
18574 * gnutls.c: Use Emacs's memory allocators.
18575 Without this change, the gnutls library would invoke malloc etc.
18576 directly, which causes problems on non-SYNC_INPUT hosts, and which
18577 runs afoul of improving memory_full behavior. (Bug#8761)
18578 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
18579 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
18580 xfree instead of the default malloc, realloc, free.
18581 (Fgnutls_boot): No need to check for memory allocation failure,
18582 since xmalloc does that for us.
18583
ac32cd99 18584 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
18585 * category.c (hash_get_category_set):
18586 * ccl.c (ccl_driver):
18587 * charset.c (Fdefine_charset_internal):
18588 * charset.h (struct charset.hash_index):
18589 * composite.c (get_composition_id, gstring_lookup_cache)
18590 (composition_gstring_put_cache):
18591 * composite.h (struct composition.hash_index):
18592 * dispextern.h (struct image.hash):
18593 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
18594 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
18595 (hashfn_equal, hashfn_user_defined, make_hash_table)
18596 (maybe_resize_hash_table, hash_lookup, hash_put)
18597 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
18598 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
18599 (Fsxhash, Fgethash, Fputhash, Fmaphash):
18600 * image.c (make_image, search_image_cache, lookup_image)
18601 (xpm_put_color_table_h):
18602 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 18603 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 18604 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 18605 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
18606 * alloc.c (allocate_vectorlike):
18607 Check for overflow in vector size calculations.
18608 * ccl.c (ccl_driver):
18609 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
18610 * fns.c, image.c: Remove unnecessary static decls that would otherwise
18611 need to be updated by these changes.
40087514
PE
18612 * fns.c (make_hash_table, maybe_resize_hash_table):
18613 Check for integer overflow with large hash tables.
0de4bb68
PE
18614 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
18615 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
18616 (SXHASH_REDUCE): New macro.
18617 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
18618 Use it instead of discarding useful hash info with large hash values.
18619 (sxhash_float): New function.
18620 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
18621 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
18622 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
18623 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
18624 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
18625 Adjust signatures to match updated version of code.
18626 (consing_since_gc): Now EMACS_INT, since a single hash table can
18627 use more than INT_MAX bytes.
18628
698d32e2
DN
186292011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
18630
18631 Make it possible to build with GCC-4.6+ -O2 -flto.
18632
18633 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
18634
fd6fa53f
SM
186352011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
18636
18637 * minibuf.c (get_minibuffer, read_minibuf_unwind):
18638 Call minibuffer-inactive-mode.
18639
864db017
JB
186402011-05-31 Juanma Barranquero <lekktu@gmail.com>
18641
18642 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
18643 Update dependencies.
18644
2ad0baf4
DN
186452011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18646
18647 * data.c (init_data): Remove code for UTS, this system is not
18648 supported anymore.
18649
4fcc2638
DN
186502011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18651
18652 Don't force ./temacs to start in terminal mode.
18653
18654 * frame.c (make_initial_frame): Initialize faces in all cases, not
18655 only when CANNOT_DUMP is defined.
18656 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
18657
c56e0fd5
DN
186582011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18659
18660 * dispnew.c (add_window_display_history): Use const for the string
18661 pointer. Remove declaration, not needed.
18662
333d54da 186632011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 18664
55d4c1b2 18665 Use 'inline', not 'INLINE'.
333d54da 18666 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
18667 * alloc.c, fontset.c (INLINE): Remove.
18668 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
18669 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
18670 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
18671 * gmalloc.c (register_heapinfo): Use inline unconditionally.
18672 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
18673
738db178
DN
186742011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18675
18676 Make it possible to run ./temacs.
18677
18678 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
18679 syms_of_callproc does the same thing. Remove test for
18680 "initialized", do it in the caller.
18681 * emacs.c (main): Avoid calling set_initial_environment when dumping.
18682
620c53a6
SM
186832011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
18684
18685 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
18686 (read_minibuf): Use get_minibuffer.
18687 (syms_of_minibuf): Use DEFSYM.
18688 (Qmetadata): New var.
18689 * data.c (Qbuffer): Don't make it static.
18690 (syms_of_data): Use DEFSYM.
18691
e003a292
PE
186922011-05-31 Paul Eggert <eggert@cs.ucla.edu>
18693
18694 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
18695 (CCL_CODE_MIN): New macro.
18696
ed008a6d
PE
186972011-05-30 Paul Eggert <eggert@cs.ucla.edu>
18698
3687c2ef
PE
18699 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
18700
ed008a6d
PE
18701 * eval.c (Qdebug): Now static.
18702 * lisp.h (Qdebug): Remove decl. This reverts a part of the
18703 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
18704 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
18705
d66c4c7c
CY
187062011-05-29 Chong Yidong <cyd@stupidchicken.com>
18707
18708 * image.c: Various fixes to ImageMagick code comments.
18709 (Fimagemagick_types): Doc fix.
18710
5fbc2025
PE
187112011-05-29 Paul Eggert <eggert@cs.ucla.edu>
18712
0196f88a
PE
18713 Minor fixes prompted by GCC 4.6.0 warnings.
18714
18715 * xselect.c (converted_selections, conversion_fail_tag): Now static.
18716
5fbc2025
PE
18717 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
18718 (x_clipboard_manager_save_all): Move extern decl to ...
18719 * xterm.h: ... here, so that it can be checked for consistency.
18720
1dd3c2d9
CY
187212011-05-29 Chong Yidong <cyd@stupidchicken.com>
18722
18723 * xselect.c (x_clipboard_manager_save_frame)
18724 (x_clipboard_manager_save_all): New functions.
18725 (Fx_clipboard_manager_save): Lisp function deleted.
18726
18727 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
18728 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
18729
18730 * xterm.h: Update prototype.
18731
5ba6571d
WX
187322011-05-28 William Xu <william.xwl@gmail.com>
18733
18734 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
18735 exiting (Bug#8239).
18736
3eaff834
JM
187372011-05-28 Jim Meyering <meyering@redhat.com>
18738
e1900994 18739 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
18740 * fns.c (to_uchar): Define.
18741 (crypto_hash_function): Use it to convert some newly-signed
18742 variables to unsigned, to avoid sign-extension bugs. For example,
18743 without this change, (md5 "truc") would evaluate to
18744 45723a2aff78ff4fff7fff1114760e62 rather than the expected
18745 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 18746 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 18747
0f6990a7
PE
187482011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18749
18750 Integer overflow fixes.
c8a9ca5a 18751
08686060
PE
18752 * dbusbind.c: Serial number integer overflow fixes.
18753 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
18754 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
18755 to hold a serial number that is too large for a fixnum.
18756 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18757 Check for serial numbers out of range. Decode any serial number
59568bf0 18758 that was so large that it became a float. (Bug#8722)
08686060 18759
2d1fc3c7
PE
18760 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
18761 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18762 Use XFASTINT rather than XUINT when numbers are nonnegative.
18763 (xd_append_arg, Fdbus_method_return_internal):
18764 (Fdbus_method_error_internal): Likewise. Also, for unsigned
18765 arguments, check that Lisp number is nonnegative, rather than
59568bf0 18766 silently wrapping negative numbers around. (Bug#8722)
30217ff0 18767 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 18768 (Bug#8722)
2d1fc3c7 18769
c8a9ca5a
PE
18770 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
18771
519e1d69
PE
18772 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
18773
6df6ae42 18774 ccl: Add integer overflow checks.
30569699
PE
18775 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
18776 (IN_INT_RANGE): New macros.
18777 (ccl_driver): Use them to check for integer overflow when
18778 decoding a CCL program. Many of the new checks are whether XINT (x)
18779 fits in int; it doesn't always, on 64-bit hosts. The new version
18780 doesn't catch all possible integer overflows, but it's an
847044ea 18781 improvement. (Bug#8719)
30569699 18782
c11285dc
PE
18783 * alloc.c (make_event_array): Use XINT, not XUINT.
18784 There's no need for unsigned here.
18785
fdccd48e
PE
18786 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
18787 This follows up to the 2011-05-06 change that substituted uintptr_t
18788 for EMACS_INT. This case wasn't caught back then.
18789
37910ab2
PE
18790 Rework Fformat to avoid integer overflow issues.
18791 * editfns.c: Include <float.h> unconditionally, as it's everywhere
18792 now (part of C89). Include <verify.h>.
18793 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
18794 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
18795 (Fformat): Avoid the prepass trying to compute sizes; it was only
18796 approximate and thus did not catch overflow reliably. Instead, walk
18797 through the format just once, formatting and computing sizes as we go,
18798 checking for integer overflow at every step, and allocating a larger
18799 buffer as needed. Keep track separately whether the format is
18800 multibyte. Keep only the most-recently calculated precision, rather
18801 than them all. Record whether each argument has been converted to
18802 string. Use EMACS_INT, not int, for byte and char and arg counts.
18803 Support field widths and precisions larger than INT_MAX. Avoid
18804 sprintf's undefined behavior with conversion specifications such as %#d
18805 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
18806 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
18807 formatting out-of-range floating point numbers with int
9173deec 18808 formats. (Bug#8668)
37910ab2 18809
2e6578fb
PE
18810 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
18811
0ae6bdee
PE
18812 * data.c: Avoid integer truncation in expressions involving floats.
18813 * data.c: Include <intprops.h>.
18814 (arith_driver): When there's an integer overflow in an expression
18815 involving floating point, convert the integers to floating point
18816 so that the resulting value does not suffer from catastrophic
18817 integer truncation. For example, on a 64-bit host (* 4
18818 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
18819 Do not rely on undefined behavior after integer overflow.
18820
de883a70
PE
18821 merge count_size_as_multibyte, parse_str_to_multibyte
18822 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 18823 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
18824 Check for integer overflow.
18825 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
18826 since it's now a duplicate of the other. This is more of
18827 a character than a buffer op, so better that it's in character.c.
18828 * fns.c, print.c: Adjust to above changes.
18829
2ff916cb
PE
188302011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
18831
18832 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
18833
f1b54466
PE
188342011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18835
fb1ac845
PE
18836 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18837 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
18838 (x_clipboard_manager_save): Now static.
18839 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
18840
f1b54466
PE
18841 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18842 (crypto_hash_function): Now static.
18843 Fix pointer signedness problems. Avoid unnecessary initializations.
18844
a9f737ee
CY
188452011-05-27 Chong Yidong <cyd@stupidchicken.com>
18846
18847 * termhooks.h (Vselection_alist): Make it terminal-local.
18848
18849 * terminal.c (create_terminal): Initialize it.
18850
18851 * xselect.c: Support for clipboard managers.
18852 (Vselection_alist): Move to termhooks.h as terminal-local var.
18853 (LOCAL_SELECTION): New macro.
18854 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
18855 (symbol_to_x_atom): Remove gratuitous arg.
18856 (x_handle_selection_request, lisp_data_to_selection_data)
18857 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
18858 (x_own_selection, x_get_local_selection, x_convert_selection):
18859 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
18860 (some_frame_on_display): Delete unused function.
18861 (Fx_own_selection_internal, Fx_get_selection_internal)
18862 (Fx_disown_selection_internal, Fx_selection_owner_p)
18863 (Fx_selection_exists_p): New optional frame arg.
18864 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
18865 (x_handle_selection_clear): Don't treat other terminals with the
18866 same keyboard specially. Use the terminal-local Vselection_alist.
18867 (x_clear_frame_selections): Use Frun_hook_with_args.
18868
18869 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
18870
18871 * xterm.h: Add support for those atoms.
18872
e067f0c1
CY
188732011-05-26 Chong Yidong <cyd@stupidchicken.com>
18874
18875 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
18876 (converted_selections, conversion_fail_tag): New global variables.
18877 (x_selection_request_lisp_error): Free the above.
18878 (x_get_local_selection): Remove unnecessary code.
18879 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
18880 of converted selections stored in converted_selections.
18881 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
18882 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
18883 (x_convert_selection): New function.
18884 (x_handle_selection_event): Simplify.
18885 (x_get_foreign_selection): Don't ignore incoming requests while
18886 waiting for an answer; this will fail when we implement
18887 SAVE_TARGETS, and seems unnecessary anyway.
18888 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
18889 (Vx_sent_selection_functions): Doc fix.
18890
0f4aebc0
LL
188912011-05-26 Leo Liu <sdl.web@gmail.com>
18892
18893 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
18894
e61124cd
YM
188952011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18896
18897 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
18898
18899 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
18900 for fringe update if it has periodic bitmap.
ac389d0c 18901 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
18902 and fringe_bitmap_periodic_p.
18903
18904 * fringe.c (get_fringe_bitmap_data): New function.
18905 (draw_fringe_bitmap_1, update_window_fringes): Use it.
18906 (update_window_fringes): Record periodicity of fringe bitmap in glyph
18907 row. Mark glyph row for fringe update if periodicity changed.
18908
18909 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
18910 for fringe update unless it has periodic bitmap.
18911
f16d9837
KH
189122011-05-25 Kenichi Handa <handa@m17n.org>
18913
18914 * xdisp.c (get_next_display_element): Set correct it->face_id for
18915 a static composition.
18916
e1b90ef6
LL
189172011-05-24 Leo Liu <sdl.web@gmail.com>
18918
18919 * deps.mk (fns.o):
18920 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
18921
18922 * fns.c (crypto_hash_function, Fsha1): New function.
18923 (Fmd5): Use crypto_hash_function.
18924 (syms_of_fns): Add Ssha1.
18925
7400048f
PE
189262011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18927
18928 * gnutls.c: Remove unused macros.
18929 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
18930 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
18931 Remove macros that are defined and never used.
18932 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
18933
abb71cf4
CY
189342011-05-22 Chong Yidong <cyd@stupidchicken.com>
18935
18936 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
18937 (Fx_get_selection_internal): Minor cleanup.
18938 (Fx_own_selection_internal): Rename arguments for consistency with
18939 select.el.
18940
6307db39
PE
189412011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18942
18943 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
18944
f3d4e0a4
CY
189452011-05-22 Chong Yidong <cyd@stupidchicken.com>
18946
18947 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
18948
4d8ade89
YM
189492011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18950
18951 * dispnew.c (scrolling_window): Don't exclude the case that the
18952 last enabled row in the desired matrix touches the bottom boundary.
18953
32078c8d
GM
189542011-05-21 Glenn Morris <rgm@gnu.org>
18955
18956 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
18957 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
18958 and add some more files.
32078c8d 18959
7285dc67
EZ
189602011-05-20 Eli Zaretskii <eliz@gnu.org>
18961
18962 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
18963 report_file_error introduced by the change from 2011-05-07.
18964
89d1bd22
PE
189652011-05-20 Paul Eggert <eggert@cs.ucla.edu>
18966
18967 * systime.h (Time): Define only if emacs is defined.
18968 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
18969 where the include path doesn't have X11/X.h by default. See
18970 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
18971
cd394be1 189722011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
18973
18974 * composite.c (find_automatic_composition): Fix previous change.
18975
b9704ad9
GM
189762011-05-20 Glenn Morris <rgm@gnu.org>
18977
18978 * lisp.mk: New file, split from Makefile.in.
18979 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
18980 (shortlisp): Remove.
18981 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
18982
4a720484
GM
189832011-05-19 Glenn Morris <rgm@gnu.org>
18984
18985 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
18986 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
18987 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
18988 (lisp): Set the order to that of loadup.el.
18989 (shortlisp): Make it a copy of $lisp.
18990 (SOME_MACHINE_LISP): Remove.
18991 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
18992 Use just $shortlisp, not $SOME_MACHINE_LISP too.
18993
a28d4396
KH
189942011-05-18 Kenichi Handa <handa@m17n.org>
18995
18996 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
18997 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
18998 (find_automatic_composition): Mostly rewrite for efficiency.
18999
a2b1fa8e
JB
190002011-05-18 Juanma Barranquero <lekktu@gmail.com>
19001
19002 * makefile.w32-in: Update dependencies.
19003
8e1f5610
CS
190042011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19005
19006 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 19007 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 19008
7025ee00 190092011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 19010
cdfa6eab
PE
19011 Fix some integer overflow issues, such as string length overflow.
19012
06d6db33
PE
19013 * insdel.c (count_size_as_multibyte): Check for string overflow.
19014
2b4560a8
PE
19015 * character.c (lisp_string_width): Check for string overflow.
19016 Use EMACS_INT, not int, for string indexes and lengths; in
19017 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19018 the resulting string length overflows an EMACS_INT; instead,
19019 report a string overflow if no precision given. When checking for
19020 precision exhaustion, use a check that cannot possibly have
19021 integer overflow. (Bug#8675)
19022 * character.h (lisp_string_width): Adjust to new signature.
19023
cb93f9be
PE
19024 * alloc.c (string_overflow): New function.
19025 (Fmake_string): Use it. This doesn't change behavior, but saves
19026 a few bytes and will simplify future changes.
19027 * character.c (string_escape_byte8): Likewise.
19028 * lisp.h (string_overflow): New decl.
19029
1a1f3366
PE
19030 Fixups, following up to the user-interface timestamp change.
19031 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19032 for UI timestamps, instead of unsigned long.
9fbd6841
PE
19033 * msdos.c (mouse_get_pos): Likewise.
19034 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
19035 * w32gui.h (Time): Define by including "systime.h" rather than by
19036 declaring it ourselves. (Bug#8664)
19037
d4e3e4d3
PE
19038 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19039 * image.c (clear_image_cache): Likewise.
19040
f6a24d19
PE
19041 * term.c (term_mouse_position): Don't assume time_t wraparound.
19042
08dc5ae6
PE
19043 Be more systematic about user-interface timestamps.
19044 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
19045 and sometimes 'EMACS_UINT', to represent these timestamps.
19046 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
19047 This makes the code easier to follow, and makes it easier to catch
19048 integer overflow bugs such as Bug#8664.
19049 * frame.c (Fmouse_position, Fmouse_pixel_position):
19050 Use Time, not unsigned long, for user-interface timestamps.
19051 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19052 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19053 * keyboard.h (last_event_timestamp): Likewise.
19054 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19055 * menu.h (xmenu_show): Likewise.
19056 * term.c (term_mouse_position): Likewise.
19057 * termhooks.h (struct input_event.timestamp): Likewise.
19058 (struct terminal.mouse_position_hook): Likewise.
19059 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19060 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19061 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19062 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19063 what it was before.
19064 * menu.h, termhooks.h: Include "systime.h", for Time.
19065
8e55734a
PE
19066 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19067 Don't assume that the difference between two unsigned long values
19068 can fit into an integer. At this point, we know button_down_time
19069 <= event->timestamp, so the difference must be nonnegative, so
19070 there's no need to cast the result if double-click-time is
19071 nonnegative, as it should be; check that it's nonnegative, just in
19072 case. This bug is triggered when events are more than 2**31 ms
86db42d2 19073 apart (about 25 days). (Bug#8664)
8e55734a 19074
841f1b75 19075 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 19076 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 19077
3e26f69c
PE
19078 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19079 that always fit in int. Use a sentinel instead of a counter, to
19080 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
19081 * frame.h (struct frame): Use int for menu_bar_items_used
19082 instead of EMACS_INT, since it always fits in int.
3e26f69c 19083
5cc152c0
PE
19084 * menu.c (grow_menu_items): Check for int overflow.
19085
d89eb65e
PE
19086 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19087
5235bd3e
PE
19088 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19089 Before, the code was not consistent. These values cannot exceed
19090 2**31 - 1 so there's no need to make them unsigned.
19091 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19092 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19093 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19094 as modifiers.
19095 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19096
bc827e23
PE
19097 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19098 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19099 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19100 presumably because the widths might not match.
19101
78eb494e
PE
19102 * window.c (size_window): Avoid needless test at loop start.
19103
04f2d78b
CB
191042011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19105
19106 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19107
d2fc7e3d 191082011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
19109
19110 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19111
d2fc7e3d 191122011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
19113
19114 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19115 `width' to `bar_area_x' and `bar_area_width', respectively.
19116 (x_scroll_run): Take account of fringe background extension.
19117
04f2d78b
CB
19118 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19119 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
19120 `bar_area_width', respectively.
19121 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19122 background extension.
19123
79b70037
GM
191242011-05-10 Jim Meyering <meyering@redhat.com>
19125
19126 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19127
2f142cc5
JB
191282011-05-10 Juanma Barranquero <lekktu@gmail.com>
19129
19130 * image.c (Finit_image_library): Return t for built-in image types,
19131 like pbm and xbm. (Bug#8640)
19132
57679c86
AS
191332011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19134
19135 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19136
888c9e86
EZ
191372011-05-07 Eli Zaretskii <eliz@gnu.org>
19138
b0512a1d
EZ
19139 * w32console.c (Fset_screen_color): Doc fix.
19140 (Fget_screen_color): New function.
19141 (syms_of_ntterm): Defsubr it.
19142
7285dc67
EZ
19143 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19144 unlink the temporary file if Fcall_process didn't create it in the
19145 first place.
19146 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19147 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
19148 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19149 cue to call_process_cleanup not to close that handle.
19150
4d3fcc8e
BK
191512011-05-07 Ben Key <bkey76@gmail.com>
19152
19153 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19154 one of two shell specific rules, either bootstrap-temacs-CMD or
19155 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19156 to the previous implementation of the bootstrap-temacs rule.
19157 The bootstrap-temacs-CMD rule is similar to the previous
19158 implementation of the bootstrap-temacs rule except that it
19159 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19160 variable.
19161
19162 These changes, along with some changes to nt/configure.bat,
19163 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19164 earlier fix to add support for --cflags and --ldflags options
19165 that include quotes so that it works whether make uses cmd or
19166 sh as the shell.
19167
b4289b64
MA
191682011-05-06 Michael Albinus <michael.albinus@gmx.de>
19169
19170 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19171 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19172 is a constant.
19173 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19174 a string. Handle both cases.
19175 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19176 (Fdbus_register_method): Use Qinvalid_function.
19177
af4c0e28
JB
191782011-05-06 Juanma Barranquero <lekktu@gmail.com>
19179
19180 * makefile.w32-in: Update dependencies.
19181 (LISP_H): Add inttypes.h and stdin.h.
19182 (PROCESS_H): Add unistd.h.
19183
c51453d9
EZ
191842011-05-06 Eli Zaretskii <eliz@gnu.org>
19185
19186 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19187 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19188
8ff0ac3c 191892011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 19190
4c4b566b
PE
19191 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19192
aab2b9b5
PE
19193 * term.c (vfatal): Remove stray call to va_end.
19194 It's not needed and the C Standard doesn't allow it here anyway.
19195
c378da0b
PE
19196 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19197 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19198
288b08c7
PE
19199 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19200 bytes.
19201
e3601888
PE
19202 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19203
db6c0e74
PE
19204 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19205
dd5963ea
PE
19206 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19207
88c9450f
PE
19208 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19209
2f9442b8
PE
19210 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19211
c032b5f8
PE
19212 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19213 * charset.c (Fdefine_charset_internal): Don't initialize
19214 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 19215 32-bit int (Bug#8600).
a108c10b
PE
19216
19217 * lread.c (read_integer): Be more consistent with string-to-number.
19218 Use string_to_number to do the actual conversion; this avoids
19219 rounding errors and fixes some other screwups. Without this fix,
19220 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19221 (digit_to_number): Move earlier, for benefit of read_integer.
19222 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 19223 not a digit in any supported base. (Bug#8602)
a108c10b 19224
ad5f9eea
PE
19225 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19226
aec1708a
PE
19227 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19228 to match comment at start of function. This also removes a
19229 GCC warning about overflow in a 32+64-bit port.
19230
47be4ab5
PE
19231 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19232
371cac43
PE
19233 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19234 Reported by Stefan Monnier in
19235 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
19236 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19237 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 19238
d01a7826
PE
19239 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19240 (EMACS_UINTPTR): Likewise, with uintptr_t.
19241
7fd47d5c
PE
19242 * lisp.h: Prefer 64-bit EMACS_INT if available.
19243 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19244 on 32-bit hosts that have 64-bit int, so that they can access
19245 large files.
122b0c86
PE
19246 However, temporarily disable this change unless the temporary
19247 symbol WIDE_EMACS_INT is defined.
7fd47d5c 19248
8727937b
PE
19249 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19250
8ac068ac
PE
19251 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19252 This removes an assumption that EMACS_INT and long are the same
19253 width as pointers. The assumption is true for Emacs porting targets
19254 now, but we want to make other targets possible.
19255 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19256 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19257 In the rest of the code, change types of integers that hold casted
19258 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19259 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19260 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19261 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19262 No need to cast type when ORing.
19263 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19264 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19265 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19266 assume EMACS_INT is the same width as char *.
19267 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19268 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19269 Remove no-longer-needed casts.
19270 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19271 (xg_tool_bar_help_callback, xg_make_tool_item):
19272 Use EMACS_INTPTR to hold an integer
19273 that will be cast to void *; this can avoid a GCC warning
19274 if EMACS_INT is not the same width as void *.
19275 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19276 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19277 (current_message_1, set_message_1):
19278 Use a local to convert to proper width without a cast.
19279 * xmenu.c (dialog_selection_callback): Likewise.
19280
ede49d71
PE
19281 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19282 Also, don't assume VALBITS / RAND_BITS is less than 5,
19283 and don't rely on undefined behavior when shifting a 1 left into
19284 the sign bit.
19285 * lisp.h (get_random): Change signature to match.
19286
2f30ecd0
PE
19287 * lread.c (hash_string): Use size_t, not int, for hash computation.
19288 Normally we prefer signed values; but hashing is special, because
19289 it's better to use unsigned division on hash table sizes so that
19290 the remainder is nonnegative. Also, size_t is the natural width
19291 for hashing into memory. The previous code used 'int', which doesn't
19292 retain enough info to hash well into very large tables.
19293 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
19294
2a866e7b
PE
19295 * dbusbind.c: Don't possibly lose pointer info when converting.
19296 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19297 Use XPNTR rather than XHASH, so that the high-order bits of
19298 the pointer aren't lost when converting through void *.
19299
51639eac
PE
19300 * eval.c (Fautoload): Don't double-shift a pointer.
19301
92394119
PE
19302 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
19303
dbdb9a7c
JB
193042011-05-06 Juanma Barranquero <lekktu@gmail.com>
19305
19306 * gnutls.c (DEF_GNUTLS_FN):
19307 * image.c (DEF_IMGLIB_FN): Make function pointers static.
19308
db7a0b4f
AS
193092011-05-05 Andreas Schwab <schwab@linux-m68k.org>
19310
19311 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
19312 marker. (Bug#8610)
19313
cd394be1 193142011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
19315
19316 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
19317 New version that can reserve upto 2GB of heap space.
19318
f7ff1b0f 193192011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
19320
19321 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
19322
639c109b
TZ
193232011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
19324
19325 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
19326 `gnutls_certificate_set_x509_key_file'.
19327
d2127135
JB
193282011-05-05 Juanma Barranquero <lekktu@gmail.com>
19329
19330 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
19331 Update dependencies.
19332
e968f4f3
JB
193332011-05-04 Juanma Barranquero <lekktu@gmail.com>
19334
19335 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
19336 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
19337 Remove unused parameter `fildes'.
19338 * process.c (read_process_output, send_process): Don't pass it.
19339
84d358f0
JB
193402011-05-04 Juanma Barranquero <lekktu@gmail.com>
19341
19342 Fix previous change: the library cache is defined in w32.c.
19343 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
19344 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
19345
0898ca10
JB
193462011-05-04 Juanma Barranquero <lekktu@gmail.com>
19347
19348 Implement dynamic loading of GnuTLS on Windows.
19349
19350 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
19351 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
19352 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19353 Declare.
19354
19355 * gnutls.c (Qgnutls_dll): Define.
19356 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
19357 (gnutls_*): Declare function pointers.
19358 (init_gnutls_functions): New function to initialize function pointers.
19359 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
19360 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
19361 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19362 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
19363 (emacs_gnutls_write, emacs_gnutls_read)
19364 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
19365 (Fgnutls_available_p): New function.
19366 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
19367 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
19368 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
19369
19370 * image.c: Include w32.h.
19371 (Vimage_type_cache): Delete.
19372 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
19373 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
19374 (w32_delayed_load): Move to w32.c.
19375
19376 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
19377
19378 * w32.c (QCloaded_from, Vlibrary_cache): Define.
19379 (w32_delayed_load): Move from image.c. When loading a library, record
19380 its filename in the :loaded-from property of the library id.
19381 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
19382 Initialize and staticpro them.
19383 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
19384
19385 * process.c: Include lisp.h before w32.h, not after.
19386 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
19387 instead of gnutls_record_check_pending.
19388
19389 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
19390
ff4de4aa
TZ
193912011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
19392
19393 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
19394 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
19395 as passed in.
19396
abe95abb
JD
193972011-05-03 Jan Djärv <jan.h.d@swipnet.se>
19398
19399 * xterm.c (x_set_frame_alpha): Do not set property on anything
19400 else than FRAME_X_OUTER_WINDOW (Bug#8608).
19401
e16e55d4
JB
194022011-05-02 Juanma Barranquero <lekktu@gmail.com>
19403
19404 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
19405
bafcf6a5
JB
194062011-05-02 Juanma Barranquero <lekktu@gmail.com>
19407
19408 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
19409 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
19410 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
19411 (gnutls_global_initialized, Qgnutls_bootprop_priority)
19412 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
19413 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
19414 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
19415 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
19416 (Qgnutls_bootprop_callbacks_verify): Make static.
19417
e7a6747f
AS
194182011-05-01 Andreas Schwab <schwab@linux-m68k.org>
19419
19ed11ba
AS
19420 * callproc.c: Indentation fixup.
19421
e7a6747f 19422 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
19423 (wait_for_termination, interruptible_wait_for_termination):
19424 Move after wait_for_termination_1.
e7a6747f 19425
1ef14cb4
LMI
194262011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
19427
19428 * sysdep.c (interruptible_wait_for_termination): New function
19429 which is like wait_for_termination, but allows keyboard
19430 interruptions.
19431
19432 * callproc.c (Fcall_process): Add (:file "file") as an option for
19433 the STDOUT buffer.
19434 (Fcall_process_region): Ditto.
19435
330d880c
EZ
194362011-04-30 Eli Zaretskii <eliz@gnu.org>
19437
8db90b73
EZ
19438 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
19439 rather than `XVECTOR (FOO)->size'.
19440
330d880c
EZ
19441 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
19442 inttypes.h, as a gnulib replacement is used if it not available in
19443 system headers.
19444
15cbd324
EZ
194452011-04-21 Eli Zaretskii <eliz@gnu.org>
19446
19447 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
19448 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
19449 of MOST_POSITIVE_FIXNUM. (Bug#8528)
19450
19451 * coding.c (coding_alloc_by_realloc): Error out if destination
19452 will grow beyond MOST_POSITIVE_FIXNUM.
19453 (decode_coding_emacs_mule): Abort if there isn't enough place in
19454 charbuf for the composition carryover bytes. Reserve an extra
19455 space for up to 2 characters produced in a loop.
19456 (decode_coding_iso_2022): Abort if there isn't enough place in
19457 charbuf for the composition carryover bytes.
19458
194592011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 19460
ae940cca
EZ
19461 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
19462 aborting when %lld or %lll format is passed.
19463 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
19464 %llo or %llx format is passed. (Bug#8545)
19465
03ab8921
EZ
19466 * window.c (window_scroll_line_based): Use a marker instead of
19467 simple variables to record original value of point. (Bug#7952)
19468
afda1437
EZ
19469 * doprnt.c (doprnt): Fix the case where a multibyte sequence
19470 produced by %s or %c overflows available buffer space. (Bug#8545)
19471
f76dee0c
PE
194722011-04-28 Paul Eggert <eggert@cs.ucla.edu>
19473
19474 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 19475 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 19476
fdc5744d
JB
194772011-04-28 Juanma Barranquero <lekktu@gmail.com>
19478
19479 * w32.c (init_environment): Warn about defaulting HOME to C:\.
19480
638f053a
JB
194812011-04-28 Juanma Barranquero <lekktu@gmail.com>
19482
19483 * keyboard.c (Qdelayed_warnings_hook): Define.
19484 (command_loop_1): Run `delayed-warnings-hook'
19485 if Vdelayed_warnings_list is non-nil.
19486 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
19487 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
19488
d178f871
EZ
194892011-04-28 Eli Zaretskii <eliz@gnu.org>
19490
19491 * doprnt.c (doprnt): Don't return value smaller than the buffer
19492 size if the message was truncated. (Bug#8545).
19493
b124fd93
JB
194942011-04-28 Juanma Barranquero <lekktu@gmail.com>
19495
19496 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
19497 (Fx_window_property): #if-0 the whole functions, not just the bodies.
19498
e810457d
PE
194992011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19500
19501 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
19502
ea51cceb
JB
195032011-04-27 Juanma Barranquero <lekktu@gmail.com>
19504
19505 * makefile.w32-in: Update dependencies.
19506
94dcfacf
EZ
195072011-04-27 Eli Zaretskii <eliz@gnu.org>
19508
19509 Improve `doprnt' and its usage. (Bug#8545)
19510 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
19511 `format_end'. Remove support for %l as a conversion specifier.
19512 Don't use xrealloc. Improve diagnostics when the %l size modifier
19513 is used. Update the commentary.
19514
19515 * eval.c (verror): Simplify calculation of size_t.
19516
19517 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
19518 messages.
19519
f61f41d7
PE
195202011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
19521
19522 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
19523 change.
19524
96fb4434
PE
195252011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19526
19527 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
19528 This makes this file independent of the recent pseudovector change.
19529
671875da 195302011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 19531
69e9b5a3
PE
19532 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
19533
b5f869a7 19534 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 19535 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 19536 Remove unused local.
c8926152 19537 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 19538
841a1577 19539 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
19540 GCC 4.6.0 optimizes based on type-based alias analysis.
19541 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
19542 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
19543 != &v->size, and therefore "v->size = 1; b->size = 2; return
19544 v->size;" must therefore return 1. This assumption is incorrect
19545 for Emacs, since it type-puns struct Lisp_Vector * with many other
19546 types. To fix this problem, this patch adds a new type struct
f904488f 19547 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
19548 and pseudovectors, and helps optimizing compilers not get fooled
19549 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
19550 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
19551 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
19552 the size member.
eab3844f
PE
19553 (XSETPVECTYPE): Rewrite in terms of new macro.
19554 (XSETPVECTYPESIZE): New macro, specifying both type and size.
19555 This is a bit clearer, and further avoids the possibility of
19556 undesirable aliasing.
19557 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 19558 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
19559 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
19560 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
19561 (ASIZE): Now uses header.size rather than size.
19562 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
19563 to avoid the hassle of writing XVECTOR (foo)->header.size.
19564 (struct vectorlike_header): New type.
eab3844f
PE
19565 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
19566 object, to help avoid aliasing.
19567 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
19568 (SUBRP): Likewise, since Lisp_Subr is a special case.
19569 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
19570 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
19571 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 19572 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
19573 changed to be "header.size" and "header.next".
19574 * buffer.h (struct buffer): Likewise.
19575 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
19576 * frame.h (struct frame): Likewise.
19577 * process.h (struct Lisp_Process): Likewise.
19578 * termhooks.h (struct terminal): Likewise.
19579 * window.c (struct save_window_data, struct saved_window): Likewise.
19580 * window.h (struct window): Likewise.
19581 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
19582 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
19583 * buffer.c (init_buffer_once): Likewise.
19584 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
19585 special case.
19586 * process.c (Fformat_network_address): Use local var for size,
19587 for brevity.
19588
0df1eac5
PE
19589 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
19590
847ab9d1 19591 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
19592 * data.c (atof): Remove decl; no longer used or needed.
19593 (digit_to_number): Move to lread.c.
19594 (Fstring_to_number): Use new string_to_number function, to be
19595 consistent with how the Lisp reader treats infinities and NaNs.
19596 Do not assume that floating-point numbers represent EMACS_INT
19597 without losing information; this is not true on most 64-bit hosts.
19598 Avoid double-rounding errors, by insisting on integers when
19599 parsing non-base-10 numbers, as the documentation specifies.
19600 * lisp.h (string_to_number): New decl, replacing ...
19601 (isfloat_string): Remove.
bc0a5c13 19602 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 19603 (read1): Do not accept +. and -. as integers; this
452f4150
PE
19604 appears to have been a coding error. Similarly, do not accept
19605 strings like +-1e0 as floating point numbers. Do not report
19606 overflow for integer overflows unless the base is not 10 which
19607 means we have no simple and reliable way to continue.
19608 Break out the floating-point parsing into a new
19609 function string_to_number, so that Fstring_to_number parses
19610 floating point numbers consistently with the Lisp reader.
04f2d78b 19611 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
19612 (E_CHAR, EXP_INT): Remove, replacing with ...
19613 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
19614 (string_to_number): New function, replacing isfloat_string.
19615 This function checks for valid syntax and produces the resulting
19616 Lisp float number too. Rework it so that string-to-number
bc0a5c13 19617 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
19618 so that overflow for non-base-10 numbers is reported only when
19619 there's no portable and simple way to convert to floating point.
452f4150 19620
67769ffc
PE
19621 * textprop.c (set_text_properties_1): Rewrite for clarity,
19622 and to avoid GCC warning about integer overflow.
19623
c20db43f
PE
19624 * intervals.h (struct interval): Use EMACS_INT for members
19625 where EMACS_UINT might cause problems. See
19626 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
19627 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
19628 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
19629 All uses changed.
37aa2f85
PE
19630 (offset_intervals): Tell GCC not to worry about length overflow
19631 when negating a negative length.
c20db43f 19632
2538aa2f
PE
19633 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
19634 (overrun_check_free): Likewise.
19635
f2d3008d
PE
19636 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
19637 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
19638 word size.
19639
ec8df744
PE
19640 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19641 (gnutls_make_error): Rename local to avoid shadowing.
19642 (gnutls_emacs_global_deinit): ifdef out; not used.
19643 (Fgnutls_boot): Use const for pointer to readonly storage.
19644 Comment out unused local. Fix pointer signedness problems.
19645
640ee02d
PE
19646 * lread.c (openp): Don't stuff size_t into an 'int'.
19647 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
19648 about possible signed overflow.
19649
6048fb2a
PE
19650 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19651 (GDK_KEY_g): Don't define if already defined.
19652 (xg_prepare_tooltip): Avoid pointer signedness problem.
19653 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
19654
fa3c87e1
PE
19655 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
19656 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
19657
2172544b
PE
19658 * xfns.c (Fx_window_property): Simplify a bit,
19659 to make a bit faster and to avoid GCC 4.6.0 warning.
19660 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
19661
9b821a21
PE
19662 * fns.c (internal_equal): Don't assume size_t fits in int.
19663
3c616cfa
PE
19664 * alloc.c (compact_small_strings): Tighten assertion a little.
19665
c2982e87
PE
19666 Replace pEd with more-general pI, and fix some printf arg casts.
19667 * lisp.h (pI): New macro, generalizing old pEd macro to other
19668 conversion specifiers. For example, use "...%"pI"d..." rather
19669 than "...%"pEd"...".
19670 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 19671 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
19672 * alloc.c (check_pure_size): Don't overflow by converting size to int.
19673 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
19674 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
19675 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
19676 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
19677 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
19678 64-bit hosts.
19679 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
19680 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
19681 * print.c (safe_debug_print, print_object): Likewise.
19682 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
19683 to int.
6f04d126
PE
19684 Use pI instead of if-then-else-abort. Use %p to avoid casts,
19685 avoiding the 0 flag, which is not portable.
c2982e87
PE
19686 * process.c (Fmake_network_process): Use pI to avoid cast.
19687 * region-cache.c (pp_cache): Likewise.
19688 * xdisp.c (decode_mode_spec): Likewise.
19689 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
19690 behavior on 64-bit hosts with printf arg.
6f04d126 19691 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
19692 (x_stop_queuing_selection_requests): Likewise.
19693 (x_get_window_property): Don't truncate byte count to an 'int'
19694 when tracing.
0b432f21 19695
5e073ec7
PE
19696 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
19697 here, since it parses constructs like leading '-' and spaces,
19698 which are not wanted; and it overflows with large numbers.
19699 Instead, simply match F[0-9]+, which is what is wanted anyway.
19700
36372bf9
PE
19701 * alloc.c: Remove unportable assumptions about struct layout.
19702 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
19703 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
19704 (allocate_vectorlike, make_pure_vector): Use the new macros,
19705 plus offsetof, to remove unportable assumptions about struct layout.
19706 These assumptions hold on all porting targets that I know of, but
19707 they are not guaranteed, they're easy to remove, and removing them
19708 makes further changes easier.
19709
0b432f21
PE
19710 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
19711 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
19712 (string_overrun_cookie): Now const. Use initializers that
19713 don't formally overflow signed char, to avoid warnings.
000098c1
PE
19714 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
19715 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
19716 (allocate_buffer): Don't assume sizeof (struct buffer) is a
19717 multiple of sizeof (EMACS_INT); it need not be, if
19718 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 19719 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 19720
895009e1
JB
197212011-04-26 Juanma Barranquero <lekktu@gmail.com>
19722
19723 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
19724
6a7a1b0b
TZ
197252011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
19726
19727 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 19728 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
19729 Reported by Paul Eggert <eggert@cs.ucla.edu>.
19730
841a1577 197312011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
19732
19733 * lisp.h (Qdebug): List symbol.
895009e1 19734 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
19735 * keyboard.c (debug-on-event): New variable.
19736 (handle_user_signal): Break into debugger when debug-on-event
19737 matches the current signal symbol.
19738
f2d3ba6f
DN
197392011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
19740
19741 * alloc.c (check_sblock, check_string_bytes)
19742 (check_string_free_list): Convert to standard C.
19743
42ce4c63
TZ
197442011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
19745
19746 * w32.c (emacs_gnutls_push): Fix typo.
19747
825cd63c
EZ
197482011-04-25 Eli Zaretskii <eliz@gnu.org>
19749
fb11d64d
EZ
19750 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
19751 "cast to pointer from integer of different size".
19752
825cd63c
EZ
19753 Improve doprnt and its use in verror. (Bug#8545)
19754 * doprnt.c (doprnt): Document the set of format control sequences
19755 supported by the function. Use SAFE_ALLOCA instead of always
19756 using `alloca'.
19757
19758 * eval.c (verror): Don't limit the buffer size at size_max-1, that
19759 is one byte too soon. Don't use xrealloc; instead xfree and
19760 xmalloc anew.
19761
e061a11b
TZ
197622011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
19763
19764 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
19765 callbacks stage.
19766
19767 * gnutls.c: Renamed global_initialized to
19768 gnutls_global_initialized. Added internals for the
19769 :verify-hostname-error, :verify-error, and :verify-flags
19770 parameters of `gnutls-boot' and documented those parameters in the
19771 docstring. Start callback support.
9173deec
JB
19772 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
19773 unless a fatal error occurred. Call gnutls_alert_send_appropriate
19774 on error. Return error code.
e061a11b
TZ
19775 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
19776 (emacs_gnutls_read): Likewise.
19777 (Fgnutls_boot): Return handshake error code.
19778 (emacs_gnutls_handle_error): New function.
19779 (wsaerror_to_errno): Likewise.
19780
19781 * w32.h (emacs_gnutls_pull): Add prototype.
19782 (emacs_gnutls_push): Likewise.
19783
19784 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
19785 (emacs_gnutls_push): Likewise.
19786
197872011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
19788
19789 * process.c (wait_reading_process_output): Check if GnuTLS
19790 buffered some data internally if no FDs are set for TLS
19791 connections.
19792
19793 * makefile.w32-in (OBJ2): Add gnutls.$(O).
19794 (LIBS): Link to USER_LIBS.
19795 ($(BLD)/gnutls.$(0)): New target.
19796
fa6996bc
EZ
197972011-04-24 Eli Zaretskii <eliz@gnu.org>
19798
eb35682e
EZ
19799 * xdisp.c (handle_single_display_spec): Rename the
19800 display_replaced_before_p argument into display_replaced_p, to
19801 make it consistent with the commentary. Fix typos in the
19802 commentary.
19803
e2ad650c
EZ
19804 * textprop.c (syms_of_textprop): Remove dead code.
19805 (copy_text_properties): Delete obsolete commentary about an
19806 interface that was deleted long ago. Fix typos in the description
19807 of arguments.
19808
1b2de274
EZ
19809 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
19810 to changes in oldXMenu/XMenu.h from 2011-04-16.
19811 <menu_help_message, prev_menu_help_message>: Constify.
19812 (IT_menu_make_room): menu->help_text is now `const char **';
19813 adjust.
19814
19815 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
19816 to changes in oldXMenu/XMenu.h from 2011-04-16.
19817 (struct XMenu): Declare `help_text' `const char **'.
19818
19819 * xfaces.c <Qunspecified>: Make extern again.
19820
19821 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 19822 required by POSIX.
1b2de274 19823
762b15be
EZ
19824 * doc.c (get_doc_string): Improve the format passed to `error'.
19825
19826 * doprnt.c (doprnt): Improve commentary.
19827
19828 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
19829
19830 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
19831 them with etags.
19832
f1052e5d
EZ
19833 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
19834 changes in globals.h immediately force recompilation.
762b15be
EZ
19835 (TAGS): Depend on $(CURDIR)/m/intel386.h and
19836 $(CURDIR)/s/ms-w32.h.
19837 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 19838
fa6996bc
EZ
19839 * character.c (Fchar_direction): Function deleted.
19840 (syms_of_character): Don't defsubr it.
19841 <char-direction-table>: Deleted.
19842
e6c3da20
EZ
198432011-04-23 Eli Zaretskii <eliz@gnu.org>
19844
19845 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
19846 * doprnt.c: Include limits.h.
19847 (SIZE_MAX): New macro.
04f2d78b
CB
19848 (doprnt): Return a size_t value. 2nd arg is now size_t.
19849 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
19850 Improve overflow protection. Support `l' modifier for integer
19851 conversions. Support %l conversion. Don't assume an EMACS_INT
19852 argument for integer conversions and for %c.
19853
19854 * lisp.h (doprnt): Restore prototype.
19855
19856 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
19857 $(SRC)/character.h.
19858
19859 * Makefile.in (base_obj): Add back doprnt.o.
19860
19861 * deps.mk (doprnt.o): Add back prerequisites.
19862 (callint.o): Depend on character.h.
19863
19864 * eval.c (internal_lisp_condition_case): Include the handler
19865 representation in the error message.
19866 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
19867 when breaking from the loop.
19868
19869 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
19870
19871 * callint.c (Fcall_interactively): When displaying error message
19872 about invalid control letter, pass the character's codepoint, not
19873 a pointer to its multibyte form. Improve display of the character
19874 in octal and display also its hex code.
19875
19876 * character.c (char_string): Use %x to display the (unsigned)
19877 codepoint of an invalid character, to avoid displaying a bogus
19878 negative value.
19879
19880 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
19881 `error', not SYMBOL_NAME itself.
19882
19883 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
19884 character arguments to `error'.
19885
19886 * charset.c (check_iso_charset_parameter): Fix incorrect argument
19887 to `error' in error message about FINAL_CHAR argument. Make sure
19888 FINAL_CHAR is a character, and use %c when it is passed as
19889 argument to `error'.
19890
4ffd0d6b 198912011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
19892
19893 * s/ms-w32.h (localtime): Redirect to sys_localtime.
19894
19895 * w32.c: Include <time.h>.
19896 (sys_localtime): New function.
19897
4ffd0d6b 198982011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
19899
19900 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
19901
4ffd0d6b 19902 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 19903
4ffd0d6b 199042011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 19905
4ffd0d6b
GM
19906 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
19907 zombies (Bug#8467).
aac0c6e3 19908
04c56954
EZ
199092011-04-19 Eli Zaretskii <eliz@gnu.org>
19910
19911 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
19912 gl_state.e_property when gl_state.object is Qt.
19913
19914 * insdel.c (make_gap_larger): Remove limitation of buffer size
19915 to <= INT_MAX.
19916
16a43933
CY
199172011-04-18 Chong Yidong <cyd@stupidchicken.com>
19918
19919 * xdisp.c (lookup_glyphless_char_display)
19920 (produce_glyphless_glyph): Handle cons cell entry in
19921 glyphless-char-display.
19922 (Vglyphless_char_display): Document it.
19923
19924 * term.c (produce_glyphless_glyph): Handle cons cell entry in
19925 glyphless-char-display.
19926
4581706e
CY
199272011-04-17 Chong Yidong <cyd@stupidchicken.com>
19928
19929 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
19930
19931 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
19932
19933 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
19934 definition for no-X builds.
19935
4887c6e2 199362011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 19937
fd35b6f9
PE
19938 Static checks with GCC 4.6.0 and non-default toolkits.
19939
5c1ccb01
PE
19940 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
19941
006c5daa
PE
19942 * process.c (keyboard_bit_set): Define only if SIGIO.
19943 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
19944 (send_process): Repair possible setjmp clobbering.
19945
efc736d3
PE
19946 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
19947
4e2fe2e6
PE
19948 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
19949
f97334a2
PE
19950 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
19951
4e75f29d
PE
19952 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
19953 Define only if needed.
19954
90efadd1
PE
19955 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
19956 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 19957 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 19958
3c647824
PE
19959 * dispextern.h (struct redisplay_interface): Rename param
19960 to avoid shadowing.
e264f262 19961 * termhooks.h (struct terminal): Likewise.
761383f4 19962 * xterm.c (xembed_send_message): Likewise.
3c647824 19963
b58c5c4a
PE
19964 * insdel.c (make_gap_smaller): Define only if
19965 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
19966
cad59032
PE
19967 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
19968 it.
19969
c339dc2e
PE
19970 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
19971 so that we aren't warned about unused symbols.
19972
91a3e27b
PE
19973 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
19974
399c71d3 19975 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 19976
8ffc96f5
PE
19977 * xfns.c (x_real_positions): Mark locals as initialized.
19978
eef9bc79
PE
19979 * xmenu.c (xmenu_show): Don't use uninitialized vars.
19980
098db9dd
PE
19981 * xterm.c: Fix problems found by static analysis with other toolkits.
19982 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
19983 (x_dispatch_event): Declare static if USE_GTK, and
19984 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 19985 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 19986 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
19987 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
19988 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 19989
eb18f6cc
PE
19990 * xmenu.c (menu_help_callback): Pointer type fixes.
19991 Use const pointers when pointing at readonly data. Avoid pointer
19992 signedness clashes.
19993 (FALSE): Remove unused macro.
19994 (update_frame_menubar): Remove unused decl.
19995
1fe72bf8
PE
19996 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
19997
60d9e1db
PE
19998 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
19999 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20000 (single_menu_item): Rename local to avoid shadowing.
20001
39261c26
PE
20002 * keyboard.c (make_lispy_event): Remove unused local var.
20003
018c5e19
PE
20004 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20005 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20006
63d2b86e
PE
20007 * bitmaps: Change bitmaps from unsigned char back to the X11
20008 compatible char. Avoid the old compiler warnings about
20009 out-of-range initializers by using, for example, '\xab' rather
20010 than 0xab.
20011
aefd87e1
PE
20012 * xgselect.c (xgselect_initialize): Check vs interface
20013 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20014
bf501fb9
PE
20015 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20016
e9829fdf
PE
20017 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20018 to read-only memory.
20019
1086c095
PE
20020 * fns.c (vector): Remove; this old hack is no longer needed.
20021
2baccd04 20022 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 20023 Remove unused var.
dde42981 20024 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 20025
72391843 20026 * xrdb.c (x_load_resources): Omit unused local.
3565b346 20027
436c16df 20028 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 20029 (x_window): Rename locals to avoid shadowing.
dc5ddd85 20030 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 20031
92bb796d 20032 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 20033 (x_term_init): Remove local to avoid shadowing.
92bb796d 20034
764430a3 20035 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
20036
20037 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20038 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20039
d1dfb56c
EZ
200402011-04-16 Eli Zaretskii <eliz@gnu.org>
20041
c4354cb4
EZ
20042 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20043
d1dfb56c
EZ
20044 Fix regex.c, syntax.c and friends for buffers > 2GB.
20045 * syntax.h (struct gl_state_s): Declare character position members
20046 EMACS_INT.
20047
20048 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20049
04f2d78b
CB
20050 * textprop.c (verify_interval_modification, interval_of):
20051 Declare arguments EMACS_INT.
d1dfb56c
EZ
20052
20053 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20054 EMACS_INT.
20055
20056 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20057
20058 * indent.c (Fvertical_motion): Local variable it_start is now
20059 EMACS_INT.
20060
20061 * regex.c (re_match, re_match_2, re_match_2_internal)
20062 (bcmp_translate, regcomp, regexec, print_double_string)
20063 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20064 (re_compile_pattern, re_exec): Declare arguments and local
20065 variables `size_t' and `ssize_t' and return values `regoff_t', as
20066 appropriate.
20067 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20068 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20069 <compile_stack_type>: `size' and `avail' are now `size_t'.
20070
20071 * regex.h <regoff_t>: Use ssize_t, not int.
20072 (re_search, re_search_2, re_match, re_match_2): Arguments that
20073 specify buffer/string position and length are now ssize_t and
20074 size_t. Return type is regoff_t.
20075
613052cd
BK
200762011-04-16 Ben Key <bkey76@gmail.com>
20077
20078 * nsfont.m: Fixed bugs in ns_get_family and
20079 ns_descriptor_to_entity that were caused by using free to
20080 deallocate memory blocks that were allocated by xmalloc (via
20081 xstrdup). This caused Emacs to crash when compiled with
20082 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20083 --enable-checking=xmallocoverrun). xfree is now used to
20084 deallocate these memory blocks.
20085
4170f62f 200862011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 20087
71b41406
PE
20088 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20089
9587a89d
PE
20090 emacs_write: Accept and return EMACS_INT for sizes.
20091 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20092 et seq.
20093 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20094 Accept and return EMACS_INT.
20095 (emacs_gnutls_write): Return the number of bytes written on
20096 partial writes.
20097 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
20098 (emacs_read, emacs_write): Remove check for negative size, as the
20099 Emacs source code has been audited now.
9587a89d
PE
20100 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20101 (emacs_read, emacs_write): Use it.
273a5f82
PE
20102 * process.c (send_process): Adjust to the new signatures of
20103 emacs_write and emacs_gnutls_write. Do not attempt to store
20104 a byte offset into an 'int'; it might overflow.
9587a89d 20105 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 20106
3e047f51
PE
20107 * sound.c: Don't assume sizes fit in 'int'.
20108 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 20109 Return EMACS_INT, not int.
3e047f51 20110 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
20111 Accept EMACS_INT, not int.
20112 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
20113 record read return values.
20114
cc39a9db
BK
201152011-04-15 Ben Key <bkey76@gmail.com>
20116
c9d0ec6d
JB
20117 * keyboard.c (Qundefined): Don't declare static since it is used
20118 in nsfns.m.
20119 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20120 static since they are used in nsfont.m.
cc39a9db 20121
6c60eb9f
SM
201222011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20123
20124 * process.c (Qprocessp): Don't declare static.
20125 * lisp.h (Qprocessp): Declare again.
20126
7990b61a
JB
201272011-04-15 Juanma Barranquero <lekktu@gmail.com>
20128
20129 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20130
5d4cb038
PE
201312011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20132
8bd7b830 20133 Improve C-level modularity by making more things 'static'.
cd64ea1d 20134
e3b27b31
PE
20135 Don't publish debugger-only interfaces to other modules.
20136 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20137 (verify_bytepos, count_markers): Move decls to the only modules
20138 that need them.
20139 * region-cache.h (pp_cache): Likewise.
20140 * window.h (check_all_windows): Likewise.
20141 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20142
5d4cb038
PE
20143 * sysdep.c (croak): Now static, if
20144 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20145 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
20146
20147 * alloc.c (refill_memory_reserve): Now static if
20148 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20149 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 20150
e87b6180
PE
20151 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20152 Define only if USE_LUCID.
20153
ac64929e
PE
20154 * xrdb.c (x_customization_string, x_rm_string): Now static.
20155
6f37259d
PE
20156 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20157 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20158
1683e3ab
PE
20159 * xdisp.c (draw_row_with_mouse_face): Now static.
20160 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20161
de9c2632
PE
20162 * window.h (check_all_windows): Mark externally visible.
20163
2b96acb7
PE
20164 * window.c (window_deletion_count): Now static.
20165
20166 * undo.c: Make symbols static if they're not exported.
20167 (last_undo_buffer, last_boundary_position, pending_boundary):
20168 Now static.
20169
50436f33
PE
20170 * textprop.c (interval_insert_behind_hooks): Now static.
20171 (interval_insert_in_front_hooks): Likewise.
20172
64520e5c
PE
20173 * term.c: Make symbols static if they're not exported.
20174 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20175 (max_frame_lines, tty_set_terminal_modes):
20176 (tty_reset_terminal_modes, tty_turn_off_highlight):
20177 (get_tty_terminal): Now static.
20178 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20179 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 20180 HAVE_WINDOW_SYSTEM.
64520e5c
PE
20181 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20182 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20183
1fa53021
PE
20184 * sysdep.c: Make symbols static if they're not exported.
20185 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20186 Now static.
20187 (sigprocmask_set, full_mask): Remove; unused.
20188 (wait_debugging): Mark as visible.
20189 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20190 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20191
d4b43b22
PE
20192 * syntax.c (syntax_temp): Define only if !__GNUC__.
20193
b7c513d0
PE
20194 * sound.c (current_sound_device, current_sound): Now static.
20195
989b29ad
PE
20196 * search.c (searchbufs, searchbuf_head): Now static.
20197
13a55a78
PE
20198 * scroll.c (scroll_cost): Remove; unused.
20199 * dispextern.h (scroll_cost): Remove decl.
20200
de68a1fc
PE
20201 * region-cache.h (pp_cache): Mark as externally visible.
20202
40ccffa6
PE
20203 * process.c: Make symbols static if they're not exported.
20204 (process_tick, update_tick, create_process, chan_process):
20205 (Vprocess_alist, proc_buffered_char, datagram_access):
20206 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20207 (deactivate_process): Mark defn as static, as well as decl.
20208 * lisp.h (create_process): Remove decl.
20209 * process.h (chan_process, Vprocess_alist): Remove decls.
20210
ad64fc97
PE
20211 * print.c: Make symbols static if they're not exported.
20212 (print_depth, new_backquote_output, being_printed, print_buffer):
20213 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20214 (print_interval, print_number_index, initial_stderr_stream):
20215 Now static.
20216 * lisp.h (Fprinc): Remove decl.
20217 (debug_output_compilation_hack): Mark as externally visible.
20218
adddb265
PE
20219 * sysdep.c (croak): Move decl from here to syssignal.h.
20220 * syssignal.h (croak): Put it here, so the API can be checked when
20221 'croak' is called from dissociate_if_controlling_tty.
20222
1717ede2
PE
20223 * minibuf.c: Make symbols static if they're not exported.
20224 (minibuf_save_list, choose_minibuf_frame): Now static.
20225 * lisp.h (choose_minibuf_frame): Remove decl.
20226
fa5fb2bc
PE
20227 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20228
1e3890d1
PE
20229 * lread.c: Make symbols static if they're not exported.
20230 (read_objects, initial_obarray, oblookup_last_bucket_number):
20231 Now static.
20232 (make_symbol): Remove; unused.
20233 * lisp.h (initial_obarray, make_symbol): Remove decls.
20234
8a1414fa
PE
20235 * keyboard.c: Make symbols static if they're not exported.
20236 (single_kboard, recent_keys_index, total_keys, recent_keys):
20237 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20238 (this_single_command_key_start, echoing, last_auto_save):
20239 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20240 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20241 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20242 (Vlispy_mouse_stem, double_click_count):
20243 Now static.
20244 (force_auto_save_soon): Define only if SIGDANGER.
20245 (ignore_mouse_drag_p): Now static if
20246 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20247 (print_help): Remove; unused.
20248 (stop_character, last_timer_event): Mark as externally visible.
20249 * keyboard.h (ignore_mouse_drag_p): Declare only if
20250 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20251 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20252 * lisp.h (echoing): Remove decl.
20253 (force_auto_save_soon): Declare only if SIGDANGER.
20254 * xdisp.c (redisplay_window): Simplify code, to make it more
20255 obvious that ignore_mouse_drag_p is not accessed if !defined
20256 USE_GTK && !defined HAVE_NS.
20257
93ea6e8f
PE
20258 * intervals.c: Make symbols static if they're not exported.
20259 (merge_properties_sticky, merge_interval_right, delete_interval):
20260 Now static.
20261 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20262
77382fcc
PE
20263 * insdel.c: Make symbols static if they're not exported.
20264 However, leave prepare_to_modify_buffer alone. It's never
20265 called from outside this function, but that appears to be a bug.
20266 (combine_after_change_list, combine_after_change_buffer):
4889fc82 20267 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
20268 (adjust_after_replace_noundo): Remove; unused.
20269 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 20270 (signal_before_change): Remove decls.
77382fcc 20271
9306c32e
PE
20272 * indent.c (val_compute_motion, val_vmotion): Now static.
20273
cd44d2eb
PE
20274 * image.c: Make symbols static if they're not exported.
20275 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20276 if USE_GTK.
20277 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20278 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
20279
ad9a7a06
PE
20280 * fringe.c (standard_bitmaps): Now static.
20281 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20282
81626931
PE
20283 * frame.c: Make symbols static if they're not exported.
20284 (x_report_frame_params, make_terminal_frame): Now static.
20285 (get_frame_param): Now static, unless HAVE_NS.
20286 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20287 (x_get_resource_string): Remove; not used.
20288 * frame.h (make_terminal_frame, x_report_frame_params):
20289 (x_get_resource_string); Remove decls.
20290 (x_fullscreen_adjust): Declare only if WINDOWSNT.
20291 * lisp.h (get_frame_param): Declare only if HAVE_NS.
20292
239f9db9
PE
20293 * font.c, fontset.c: Make symbols static if they're not exported.
20294 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
20295 (FACE_SUITABLE_FOR_CHAR_P): Use it.
20296 * font.c (font_close_object): Now static.
20297 * font.h (font_close_object): Remove.
20298 * fontset.c (FONTSET_OBJLIST): Remove.
20299 (free_realized_fontset) #if-0 the body, which does nothing.
20300 (face_suitable_for_char_p): #if-0, as it's never called.
20301 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
20302 * xfaces.c (face_at_string_position):
20303 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
20304 since 0 is always ASCII.
20305
dfcf3579
PE
20306 * fns.c (weak_hash_tables): Now static.
20307
5045092b
PE
20308 * fileio.c: Make symbols static if they're not exported.
20309 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
20310 (Vwrite_region_annotation_buffers): Now static.
20311
57a96f5c
PE
20312 * eval.c: Make symbols static if they're not exported.
20313 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
20314 * lisp.h (backtrace_list): Remove decl.
20315
35f08c38
PE
20316 * emacs.c: Make symbols static if they're not exported.
20317 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
20318 (fatal_error_code, fatal_error_signal_hook, standard_args):
20319 Now static.
20320 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
20321 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
20322 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
20323 * lisp.h (fatal_error_signal_hook): Remove decl.
20324 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
20325
f44bd759
PE
20326 * editfns.c: Move a (normally-unused) function to its only use.
20327 * editfns.c, lisp.h (get_operating_system_release): Remove.
20328 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
20329 worth the hassle of breaking this out.
20330
b532497d
PE
20331 * xterm.c: Make symbols static if they're not exported.
20332 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
20333 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
20334 (x_destroy_window, x_delete_display):
20335 Now static.
20336 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
20337 (x_mouse_leave): Remove; unused.
20338 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
20339 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
20340 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
20341 Remove decls.
20342 (x_mouse_leave): Declare only if WINDOWSNT.
20343 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
20344 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
20345 USE_X_TOOLKIT.
20346
1675728f
PE
20347 * ftxfont.c: Make symbols static if they're not exported.
20348 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
20349 HAVE_FREETYPE.
20350 * font.h (ftxfont_driver): Likewise.
20351
e4cebfca
PE
20352 * xfns.c: Make symbols static if they're not exported.
20353 (x_last_font_name, x_display_info_for_name):
20354 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
20355 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
20356 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
20357 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
20358 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
20359 (last_show_tip_args): Now static.
20360 (xic_defaut_fontset, xic_create_fontsetname): Define only if
20361 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
20362 (x_screen_planes): Remove; unused.
20363 * dispextern.h (x_screen_planes): Remove decl.
20364
5bf46f05
PE
20365 * dispnew.c: Make symbols static if they're not exported.
20366 * dispextern.h (redraw_garbaged_frames, scrolling):
20367 (increment_row_positions): Remove.
20368 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
20369 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
20370 Now static.
20371 (redraw_garbaged_frames): Remove; unused.
20372
435f4c28
PE
20373 * xfaces.c: Make symbols static if they're not exported.
20374 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
20375 Remove decls.
20376 * xterm.h (defined_color): Remove decls.
20377 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
20378 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
20379 (menu_face_changed_default, defined_color, free_realized_face):
20380 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
20381 (ascii_face_of_lisp_face): Remove; unused.
20382
8524aef3
PE
20383 * xdisp.c: Make symbols static if they're not exported.
20384 * dispextern.h (scratch_glyph_row, window_box_edges):
20385 (glyph_to_pixel_coords, set_cursor_from_row):
20386 (get_next_display_element, set_iterator_to_next):
20387 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
20388 (show_mouse_face): Remove decls
20389 * frame.h (message_buf_print): Likewise.
20390 * lisp.h (pop_message, set_message, check_point_in_composition):
20391 Likewise.
20392 * xterm.h (set_vertical_scroll_bar): Likewise.
20393 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
20394 (message_buf_print, scratch_glyph_row, displayed_buffer):
20395 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
20396 (get_next_display_element, show_mouse_face, window_box_edges):
20397 (frame_to_window_pixel_xy, check_point_in_composition):
20398 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
20399 (glyph_to_pixel_coords): Remove; unused.
20400
16390cd2
PE
20401 * dired.c (file_name_completion): Now static.
20402
20403 * dbusbind.c (xd_in_read_queued_messages): Now static.
20404
a25f4dfa
PE
20405 * lisp.h (circular_list_error, FOREACH): Remove; unused.
20406 * data.c (circular_list_error): Remove.
20407
14a9c8df
PE
20408 * commands.h (last_point_position, last_point_position_buffer):
20409 (last_point_position_window): Remove decls.
20410 * keyboard.c: Make these variables static.
20411
04f2d78b
CB
20412 * coding.h (coding, code_convert_region, encode_coding_gap):
20413 Remove decls.
74ab6df5
PE
20414 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
20415 (iso_code_class, detect_coding, code_convert_region): Now static.
20416 (encode_coding_gap): Remove; unused.
20417
38dfbee1
PE
20418 * chartab.c (chartab_chars, chartab_bits): Now static.
20419
a2cb4e63
PE
20420 * charset.h (charset_iso_8859_1): Remove decl.
20421 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
20422 Now static.
20423
127198fd
PE
20424 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
20425 * ccl.c (Vccl_program_table): Now static.
20426 (check_ccl_update): Remove; unused.
20427
d85b608f
PE
20428 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
20429 * category.h: ... from here.
20430 * category.c (check_category_table, set_category_set): Now static.
20431
31cd66f3
PE
20432 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
20433 * lisp.h: Remove these decls.
20434
c358e587
PE
20435 * buffer.c (buffer_count): Remove unused var.
20436
e78aecca
PE
20437 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
20438 so that it's not optimized away.
20439 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
20440 * dispextern.h (bidi_dump_cached_states): Remove, since it's
20441 exported only to the debugger.
20442
e192d7d3 20443 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 20444 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 20445
92470028
PE
20446 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
20447 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
20448 was inaccessible from Lisp.
20449 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
20450 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
20451
244ed907
PE
20452 alloc.c: Import and export fewer symbols, and remove unused items.
20453 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
20454 is defined.
20455 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
20456 it's not optimized away by whole-program optimization.
20457 (message_enable_multibyte, free_misc): Remove.
20458 (catchlist, handlerlist, mark_backtrace):
20459 Declare only if BYTE_MARK_STACK.
20460 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
20461 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
20462 (message_enable_multibyte): Remove decl.
20463 (free_misc, interval_free_list, float_block, float_block_index):
20464 (n_float_blocks, float_free_list, cons_block, cons_block_index):
20465 (cons_free_list, last_marked_index):
20466 Now static.
20467 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
20468 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20469 (mark_backtrace): Define only if BYTE_MARK_STACK.
20470 * xdisp.c (message_enable_multibyte): Now static.
20471
61c2b50e 20472 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
20473 This makes it easier for human readers (and static analyzers)
20474 to see whether these variables are used from other modules.
20475 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
20476 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
20477 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
20478 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
20479 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
20480 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
20481 * xmenu.c, xselect.c:
20482 Declare Q* vars static if they are not used in other modules.
20483 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
20484 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
20485 Remove decls of unexported vars.
20486 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
20487
95c82688
PE
20488 * lisp.h (DEFINE_FUNC): Make sname 'static'.
20489
16a97296
PE
20490 Make Emacs functions such as Fatom 'static' by default.
20491 This makes it easier for human readers (and static analyzers)
20492 to see whether these functions can be called from other modules.
20493 DEFUN now defines a static function. To make the function external
20494 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
20495 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
20496 (Finit_image_library):
16a97296
PE
20497 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
20498 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
20499 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
20500 Remove decls, since these functions are now static.
20501 (Funintern, Fget_internal_run_time): New decls, since these functions
20502 were already external.
95c82688 20503
16a97296
PE
20504 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
20505 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
20506 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
20507 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
20508 * keyboard.c, keymap.c, lread.c:
20509 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
20510 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
20511 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
20512 Mark functions with DEFUE instead of DEFUN,
20513 if they are used in other modules.
20514 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
20515 decls for now-static functions.
20516 * buffer.h (Fdelete_overlay): Remove decl.
20517 * callproc.c (Fgetenv_internal): Mark as internal.
20518 * composite.c (Fremove_list_of_text_properties): Remove decl.
20519 (Fcomposition_get_gstring): New forward static decl.
20520 * composite.h (Fcomposite_get_gstring): Remove decl.
20521 * dired.c (Ffile_attributes): New forward static decl.
20522 * doc.c (Fdocumntation_property): New forward static decl.
20523 * eval.c (Ffetch_bytecode): New forward static decl.
20524 (Funintern): Remove extern decl; now in .h file where it belongs.
20525 * fileio.c (Fmake_symbolic_link): New forward static decl.
20526 * image.c (Finit_image_library): New forward static decl.
20527 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
20528 * intervals.h (Fprevious_property_change):
20529 (Fremove_list_of_text_properties): Remove decls.
20530 * keyboard.c (Fthis_command_keys): Remove decl.
20531 (Fcommand_execute): New forward static decl.
20532 * keymap.c (Flookup_key): New forward static decl.
20533 (Fcopy_keymap): Now static.
20534 * keymap.h (Flookup_key): Remove decl.
20535 * process.c (Fget_process): New forward static decl.
20536 (Fprocess_datagram_address): Mark as internal.
20537 * syntax.c (Fsyntax_table_p): New forward static decl.
20538 (skip_chars): Remove duplicate decl.
20539 * textprop.c (Fprevious_property_change): New forward static decl.
20540 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
20541 Now internal.
20542 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
20543 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
20544
785bbd42
PE
20545 * editfns.c (Fformat): Remove unreachable code.
20546
8b913b57
AS
205472011-04-14 Andreas Schwab <schwab@linux-m68k.org>
20548
20549 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
20550 change. (Bug#8496)
20551
a6744a35
EZ
205522011-04-13 Eli Zaretskii <eliz@gnu.org>
20553
20554 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
20555 when at ZV. (Bug#8487)
20556
e7974947
AS
205572011-04-12 Andreas Schwab <schwab@linux-m68k.org>
20558
baad03f0
AS
20559 * charset.c (Fclear_charset_maps): Use xfree instead of free.
20560 (Bug#8437)
20561 * keyboard.c (parse_tool_bar_item): Likewise.
20562 * sound.c (sound_cleanup, alsa_close): Likewise.
20563 * termcap.c (tgetent): Likewise.
20564 * xfns.c (x_default_font_parameter): Likewise.
20565 * xsettings.c (read_and_apply_settings): Likewise.
20566
e7974947
AS
20567 * alloc.c (overrun_check_malloc, overrun_check_realloc)
20568 (overrun_check_free): Protoize.
20569
28272684
PE
205702011-04-12 Paul Eggert <eggert@cs.ucla.edu>
20571
20572 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
20573 since callers should never pass a negative size.
20574 Change the signature to match that of plain 'read' and 'write'; see
20575 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
20576 * lisp.h: Update prototypes of emacs_write and emacs_read.
20577
11997c76
EZ
205782011-04-11 Eli Zaretskii <eliz@gnu.org>
20579
20580 * xdisp.c (redisplay_window): Don't try to determine the character
20581 position of the scroll margin if the window start point w->startp
e896f03c 20582 is outside the buffer's accessible region. (Bug#8468)
11997c76 20583
8a2cbd72
EZ
205842011-04-10 Eli Zaretskii <eliz@gnu.org>
20585
20586 Fix write-region and its subroutines for buffers > 2GB.
20587 * fileio.c (a_write, e_write): Modify declaration of arguments and
20588 local variables to support buffers larger than 2GB.
20589 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
20590
20591 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
20592 argument, local variables, and return value.
20593
20594 * lisp.h: Update prototypes of emacs_write and emacs_read.
20595
20596 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
20597
4073e537 205982011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 20599
1ebfdcb6
PE
20600 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
20601
b2ded58d
PE
20602 Fix more problems found by GCC 4.6.0's static checks.
20603
7d66342c
PE
20604 * xdisp.c (vmessage): Use a better test for character truncation.
20605
bbf47d44
PE
20606 * charset.c (load_charset_map): <, not <=, for optimization,
20607 and to avoid potential problems with integer overflow.
9248994d 20608 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 20609 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 20610 * editfns.c (Fformat): Likewise.
1e69125e 20611 * syntax.c (skip_chars): Likewise.
3befa583 20612
e3019616
PE
20613 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
20614 This also lets GCC 4.6.0 generate slightly better loop code.
20615
becfa255
PE
20616 * callint.c (Fcall_interactively): <, not <=, for optimization.
20617 (Fcall_interactively): Count the number of arguments produced,
20618 not the number of arguments given. This is simpler and lets GCC
20619 4.6.0 generate slightly better code.
20620
dae0cd48
PE
20621 * ftfont.c: Distingish more carefully between FcChar8 and char.
20622 The previous code passed unsigned char * to a functions like
20623 strlen and xstrcasecmp that expect char *, which does not
20624 conform to the C standard.
20625 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
20626 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
20627 char * when the C standard requires it.
20628
76032d70
PE
20629 * keyboard.c (read_char): Remove unused var.
20630
eb3f1cc8
PE
20631 * eval.c: Port to Windows vsnprintf (Bug#8435).
20632 Include <limits.h>.
20633 (SIZE_MAX): Define if the headers do not.
20634 (verror): Do not give up if vsnprintf returns a negative count.
20635 Instead, grow the buffer. This ports to Windows vsnprintf, which
20636 does not conform to C99. Problem reported by Eli Zaretskii.
20637 Also, simplify the allocation scheme, by avoiding the need for
20638 calling realloc, and removing the ALLOCATED variable.
20639
70476b54
PE
20640 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
20641
12020a9e
PE
20642 Remove invocations of doprnt, as Emacs now uses vsnprintf.
20643 But keep the doprint source code for now, as we might revamp it
20644 and use it again (Bug#8435).
ea6c7ae6
PE
20645 * lisp.h (doprnt): Remove.
20646 * Makefile.in (base_obj): Remove doprnt.o.
20647 * deps.mk (doprnt.o): Remove.
20648
5fdb398c
PE
20649 error: Print 32- and 64-bit integers portably (Bug#8435).
20650 Without this change, on typical 64-bit hosts error ("...%d...", N)
20651 was used to print both 32- and 64-bit integers N, which relied on
20652 undefined behavior.
61bdb816 20653 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
20654 * lisp.h (error, verror): Mark as printf-like functions.
20655 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
20656 Report overflow in size calculations when allocating printf buffer.
20657 Do not truncate output string at its first null byte.
20658 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
20659 Truncate the output at a character boundary, since vsnprintf does not
20660 do that.
20661 * charset.c (check_iso_charset_parameter): Convert internal
20662 character to string before calling 'error', since %c now has the
20663 printf meaning.
20664 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
20665 overflow when computing char to be passed to 'error'. Do not
20666 pass Lisp_Object to 'error'; pass the integer instead.
20667 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
20668 formatted with plain %d.
20669
b189fa66
PE
20670 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
20671
bff87ef0
PE
20672 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
20673
7e2cac20
PE
20674 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
20675
ce4d90b5
PE
20676 * xterm.c (x_catch_errors): Remove duplicate declaration.
20677
266c9547
PE
20678 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
20679
79c49ad2
PE
20680 * xdisp.c, lisp.h (message_nolog): Remove; unused.
20681
368f4090
JM
206822011-04-10 Jim Meyering <meyering@redhat.com>
20683
20684 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
20685 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
20686 return ssize_t not "int", and use size_t as the buffer length.
20687 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
20688 * gnutls.h: Update declarations.
20689 * process.c (read_process_output): Use ssize_t, to match.
20690 (send_process): Likewise.
20691
a32d4040
CY
206922011-04-09 Chong Yidong <cyd@stupidchicken.com>
20693
20694 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
20695
8546720e 206962011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 20697
04f2d78b
CB
20698 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
20699 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 20700
8546720e
GM
20701 * xterm.c (handle_one_xevent):
20702 * xmenu.c (create_and_show_popup_menu):
20703 * xselect.c (x_decline_selection_request)
20704 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 20705
0a2f5c1a 207062011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
20707
20708 Fix some uses of `int' instead of EMACS_INT.
20709 * search.c (string_match_1, fast_string_match)
20710 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
20711 (scan_buffer, find_next_newline_no_quit)
20712 (find_before_next_newline, search_command, Freplace_match)
20713 (Fmatch_data): Make some `int' variables be EMACS_INT.
20714
20715 * xdisp.c (display_count_lines): 3rd argument and return value now
20716 EMACS_INT. All callers changed.
20717 (pint2hrstr): Last argument is now EMACS_INT.
20718
20719 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
20720 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
20721 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
20722 (decode_coding_utf_16, decode_coding_emacs_mule)
20723 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
20724 (decode_coding_ccl, decode_coding_charset)
20725 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
20726 (decode_coding_iso_2022, decode_coding_emacs_mule)
20727 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
20728 <char_offset, last_offset>: Declare EMACS_INT.
20729 (encode_coding_utf_8, encode_coding_utf_16)
20730 (encode_coding_emacs_mule, encode_invocation_designation)
20731 (encode_designation_at_bol, encode_coding_iso_2022)
20732 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
20733 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
20734 Declare EMACS_INT.
20735 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
20736 (encode_invocation_designation): Last argument P_NCHARS is now
20737 EMACS_INT.
20738 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
20739 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
20740
20741 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
20742 All users changed.
20743
20744 * ccl.c (Fccl_execute_on_string): Declare some variables
20745 EMACS_INT.
20746
8546720e 207472011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
20748
20749 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
20750
4e19a977
CS
207512011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
20752
20753 * process.c (Fformat_network_address): Doc fix.
20754
87302331
R
207552011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
20756
ee7683eb 20757 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 20758
cbb59342
CY
207592011-04-08 Chong Yidong <cyd@stupidchicken.com>
20760
20761 * keyboard.c (read_char): Call Lisp function help-form-show,
20762 instead of using internal_with_output_to_temp_buffer.
20763 (Qhelp_form_show): New var.
e0d38eeb 20764 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
20765
20766 * print.c (internal_with_output_to_temp_buffer): Function deleted.
20767
20768 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
20769
e67a13ab
CY
207702011-04-06 Chong Yidong <cyd@stupidchicken.com>
20771
04f2d78b
CB
20772 * process.c (Flist_processes): Remove to Lisp.
20773 (list_processes_1): Delete.
e67a13ab 20774
973f782d
EZ
207752011-04-06 Eli Zaretskii <eliz@gnu.org>
20776
7c106b1e
EZ
20777 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
20778
973f782d
EZ
20779 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
20780
41cf7d1a 207812011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 20782
ca23cc88
PE
20783 Fix more problems found by GCC 4.6.0's static checks.
20784
f390e2d5
PE
20785 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
20786
42eea0d0
PE
20787 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
20788
b69769da 20789 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 20790
f9541e84
PE
20791 * xdisp.c (vmessage): Mark as a printf-like function.
20792
13841b55
PE
20793 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
20794
c136c10f
PE
20795 * sound.c (sound_warning): Don't crash if arg contains a printf format.
20796
5e2d4a30
PE
20797 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
20798 printf-like functions.
20799 (tiff_load): Add casts to remove these marks before passing them
20800 to system-supplied API.
20801
583f48b9
PE
20802 * eval.c (Fsignal): Remove excess argument to 'fatal'.
20803
b25d760e
PE
20804 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
20805 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
20806 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
20807 directly, rather than having caller test rule sign. This avoids
20808 some unnecessary tests.
20809 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
20810 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
20811 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 20812
bc7b6697 20813 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 20814 (xfont_open): Avoid unnecessary tests.
bc7b6697 20815
27ccc379
PE
20816 * composite.c (composition_gstring_put_cache): Use unsigned integer.
20817
dcd5c89a
PE
20818 * composite.h, composite.c (composition_gstring_put_cache):
20819 Use EMACS_INT, not int, for length.
20820
b13a45c6
PE
20821 * composite.h (COMPOSITION_DECODE_REFS): New macro,
20822 breaking out part of COMPOSITION_DECODE_RULE.
20823 (COMPOSITION_DECODE_RULE): Use it.
20824 * composite.c (get_composition_id): Remove unused local vars,
20825 by using the new macro.
20826
1e792e4d
PE
20827 * textprop.c (set_text_properties_1): Change while to do-while,
20828 since the condition is always true at first.
20829
dc6c6455 20830 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
20831 (interval_deletion_adjustment): Return unsigned value.
20832 All uses changed.
dc6c6455 20833
aba7731a
PE
20834 * process.c (list_processes_1, create_pty, read_process_output):
20835 (exec_sentinel): Remove vars that were set but not used.
afd4052b 20836 (create_pty): Remove unnecessary "volatile"s.
bc57d757 20837 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 20838 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 20839 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 20840
fdfc4bf3
PE
20841 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
20842
fca8fe46 20843 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 20844 (update_syntax_table): Use unsigned instead of int.
fca8fe46 20845
06a0259a 20846 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 20847 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 20848 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 20849
e7b9e80f
PE
20850 * print.c (print_error_message): Avoid int overflow.
20851
56201685
PE
20852 * font.c (font_list_entities): Redo for clarity,
20853 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
20854
78834453 20855 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 20856 (font_score): Avoid potential overflow in diff calculation.
78834453 20857
0bc0b309 20858 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 20859 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 20860
e610eaca
PE
20861 * eval.c (funcall_lambda): Rename local to avoid shadowing.
20862
b895abce
PE
20863 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
20864 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
20865 can always succeed if overflow has undefined behavior.
20866
1f1d9321 20867 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 20868 (wordify): Omit three unnecessary tests.
1f1d9321 20869
c59478bc
PE
20870 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
20871 All callers changed. This avoids the need for an unused var.
20872
79b73827
PE
20873 * casefiddle.c (casify_region): Remove var that is set but not used.
20874
a4db5dfe
PE
20875 * dired.c (file_name_completion): Remove var that is set but not used.
20876
43aae36e
PE
20877 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
20878
2a47c44d 20879 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 20880 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 20881
a37c69bf
PE
20882 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
20883 Check for integer overflow on size calculations.
20884
328ab8e7
PE
20885 * buffer.c (Fprevious_overlay_change): Remove var that is set
20886 but not used.
20887
e5a2a5cb
PE
20888 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
20889 Remove vars that are set but not used.
8d84a6eb 20890 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 20891 (timer_check_2): Mark vars as initialized.
e5a2a5cb 20892
a60e5f68
PE
20893 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
20894
f661cb61 20895 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 20896 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 20897
f0397f5a
PE
20898 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
20899 that are set but not used.
20900
8664db06 20901 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 20902 if XCreateBitmapFromData fails (Bug#8410).
8664db06 20903
6abdaa4a
PE
20904 * xselect.c (x_get_local_selection, x_handle_property_notify):
20905 Remove vars that are set but not used.
20906
0ce7538d 20907 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 20908 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 20909
9ae848fc
PE
20910 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
20911 Remove var that is set but not used.
0b918413
PE
20912 (scroll_bar_windows_size): Now size_t, not int.
20913 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
20914 Check for overflow.
9ae848fc 20915
a5a62657
PE
20916 * xfaces.c (realize_named_face): Remove vars that are set but not used.
20917 (map_tty_color) [!defined MSDOS]: Likewise.
20918
5c5cdd39
PE
20919 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
20920
66ebf983
PE
20921 * coding.c: Remove vars that are set but not used.
20922 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
20923 All callers changed.
20924 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
20925 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
20926 (decode_coding_charset): Remove vars that are set but not used.
20927
1be4d761
PE
20928 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
20929 that is set but not used.
20930
47553fa8
PE
20931 * print.c (print_object): Remove var that is set but not used.
20932
1f7196bf 20933 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
20934 The gnulib version avoids calling malloc in the usual case,
20935 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
20936 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
20937 * filelock.c (current_lock_owner): Likewise.
20938 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
20939 * sysdep.c: Include allocator.h, careadlinkat.h.
20940 (emacs_no_realloc_allocator): New static constant.
20941 (emacs_readlink): New function.
fdb61804
PE
20942 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
20943 ../lib/careadlinkat.h.
d1fdcab7 20944
f84c17c7
SM
209452011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
20946
20947 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
20948 first non-nil return value).
20949
ef3862ad
JD
209502011-04-03 Jan Djärv <jan.h.d@swipnet.se>
20951
20952 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
20953 if not defined (Bug#8403).
20954
376a7006
JB
209552011-04-02 Juanma Barranquero <lekktu@gmail.com>
20956
20957 * xdisp.c (display_count_lines): Remove parameter `start',
20958 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20959 (get_char_face_and_encoding): Remove parameter `multibyte_p',
20960 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20961 (fill_stretch_glyph_string): Remove parameters `row' and `area',
20962 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
20963 and thereabouts. All callers changed.
20964 (get_per_char_metric): Remove parameter `f', unused since
20965 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20966
6ca3801d
JM
209672011-04-02 Jim Meyering <meyering@redhat.com>
20968
20969 do not dereference NULL upon failed strdup
20970 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
20971 (ns_get_family): Likewise.
20972
d8e2b5ba
JB
209732011-04-02 Juanma Barranquero <lekktu@gmail.com>
20974
20975 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
20976
8c74fcbd
JD
209772011-04-02 Jan Djärv <jan.h.d@swipnet.se>
20978
20979 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
20980 later (Bug#8403).
20981
7200d79c
SM
209822011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
20983
03408648 20984 Add lexical binding.
7200d79c 20985
03408648
SM
20986 * window.c (Ftemp_output_buffer_show): New fun.
20987 (Fsave_window_excursion):
20988 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
20989
20990 * lread.c (lisp_file_lexically_bound_p): New function.
20991 (Fload): Bind Qlexical_binding.
20992 (readevalloop): Remove `evalfun' arg.
20993 Bind Qinternal_interpreter_environment.
20994 (Feval_buffer): Bind Qlexical_binding.
20995 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
20996 Mark as dynamic.
20997 (syms_of_lread): Declare `lexical-binding'.
20998
20999 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21000
21001 * keyboard.c (eval_dyn): New fun.
21002 (menu_item_eval_property): Use it.
ca105506
SM
21003
21004 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 21005
03408648
SM
21006 * fns.c (concat, mapcar1): Accept byte-code-functions.
21007
21008 * eval.c (Fsetq): Handle lexical vars.
21009 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21010 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21011 (FletX, Flet): Obey lexical binding.
21012 (Fcommandp): Handle closures.
21013 (Feval): New `lexical' arg.
21014 (eval_sub): New function extracted from Feval. Use it almost
21015 everywhere where Feval was used. Look up vars in lexical env.
21016 Handle closures.
21017 (Ffunctionp): Move from subr.el.
21018 (Ffuncall): Handle closures.
21019 (apply_lambda): Remove `eval_flags'.
21020 (funcall_lambda): Handle closures and new byte-code-functions.
21021 (Fspecial_variable_p): New function.
21022 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21023 but without exporting it to Lisp.
23aba0ea 21024
23aba0ea 21025 * doc.c (Fdocumentation, store_function_docstring):
03408648 21026 * data.c (Finteractive_form): Handle closures.
23aba0ea 21027
03408648
SM
21028 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21029 interactive spec.
ba83908c 21030
04f2d78b
CB
21031 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21032 New byte-codes.
03408648
SM
21033 (exec_byte_code): New function extracted from Fbyte_code to handle new
21034 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 21035
03408648 21036 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 21037
03408648 21038 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 21039
e2abce01
JB
210402011-03-31 Juanma Barranquero <lekktu@gmail.com>
21041
21042 * xdisp.c (redisplay_internal): Fix prototype.
21043
63696a73 210442011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 21045
63696a73 21046 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
21047 (try_scrolling): Use it when setting scroll_limit.
21048 Limit scrolling to 100 screen lines.
63696a73
EZ
21049 (redisplay_window): Even when falling back on "recentering",
21050 position point in the window according to scroll-conservatively,
21051 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21052
21053 (try_scrolling): When point is above the window, allow searching
21054 as far as scroll_max, or one screenful, to compute vertical
21055 distance from PT to the scroll margin position. This prevents
21056 try_scrolling from unnecessarily failing when
21057 scroll-conservatively is set to a value slightly larger than the
21058 window height. Clean up the case of PT below the margin at bottom
21059 of window: scroll_max can no longer be INT_MAX. When aggressive
21060 scrolling is in use, don't let point enter the opposite scroll
21061 margin as result of the scroll.
21062 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
21063 threshold of 100 lines for never-recentering scrolling.
21064
e4cc2dfc
JB
210652011-03-31 Juanma Barranquero <lekktu@gmail.com>
21066
21067 * dispextern.h (move_it_by_lines):
21068 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21069 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21070 (message_log_check_duplicate): Remove parameters `prev_bol' and
21071 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21072 (redisplay_internal): Remove parameter `preserve_echo_area',
21073 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21074
21075 * indent.c (Fvertical_motion):
21076 * window.c (window_scroll_pixel_based, Frecenter):
21077 Don't pass `need_y_p' to `move_it_by_lines'.
21078
1c470562
SM
210792011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21080
44f230aa
SM
21081 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21082 steal a few bits to be more compact.
21083 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21084 Remove unneeded casts.
21085
1c470562
SM
21086 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21087
888adce9
ZK
210882011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21089
21090 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21091 binding" message (bug#7967).
21092
f838ed7b
PE
210932011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21094
77861b95
PE
21095 Fix more problems found by GCC 4.6.0's static checks.
21096
de6dbc14
PE
21097 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21098 Remove unused local var.
21099
f838ed7b
PE
21100 * editfns.c (Fmessage_box): Remove unused local var.
21101
792c7b2b
PE
21102 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21103 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21104 Omit unused local vars.
c499e557 21105 * window.c (shrink_windows): Omit unused local var.
b01a1c29 21106 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
21107 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21108 Omit unused local var.
21109
ba0165e1
PE
21110 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21111 Don't assume string length fits in int.
32ad8845 21112 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 21113 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 21114
3c59b4c9
PE
21115 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21116 instead of alloca (Bug#8344).
21117
a3eed478 21118 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 21119 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 21120
eb4d412d
PE
21121 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21122
1658b401
PE
21123 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21124 concerns.
21125
21126 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21127
21128 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 21129
9a2c6e05
PE
21130 * keyboard.c (syms_of_keyboard): Use the same style as later
21131 in this function when indexing through an array. This also
21132 works around GCC bug 48267.
21133
03d0a109
PE
21134 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21135
44f730c8
PE
21136 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21137
fe75f926
PE
21138 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21139 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21140
ffa8c828
PE
21141 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21142 This avoids undefined behavior on integer overflow, and is a bit
21143 more convenient anyway since it is compared to a size_t variable.
21144
c5101a77
PE
21145 Variadic C functions now count arguments with size_t, not int.
21146 This avoids an unnecessary limitation on 64-bit machines, which
21147 caused (substring ...) to crash on large vectors (Bug#8344).
21148 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21149 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 21150 All variadic functions and their callers changed accordingly.
c5101a77
PE
21151 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21152 * data.c (arith_driver, float_arith_driver): Likewise.
21153 * editfns.c (general_insert_function): Likewise.
21154 * eval.c (struct backtrace.nargs, interactive_p)
21155 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21156 (funcall_lambda, mark_backtrace): Likewise.
21157 * fns.c (concat): Likewise.
21158 * frame.c (x_set_frame_parameters): Likewise.
21159 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21160 0 if not found, not -1. All callers changed.
21161
dd3f25f7
PE
21162 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21163 (stack_copy_size): Now size_t, not int.
21164 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21165
461c2ab9
JB
211662011-03-28 Juanma Barranquero <lekktu@gmail.com>
21167
21168 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21169 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21170 All callers changed.
21171
21172 * lisp.h (multibyte_char_to_unibyte):
21173 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21174 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21175 * character.h (CHAR_TO_BYTE8):
21176 * cmds.c (internal_self_insert):
21177 * editfns.c (general_insert_function):
21178 * keymap.c (push_key_description):
21179 * search.c (Freplace_match):
21180 * xdisp.c (message_dolog, set_message_1): All callers changed.
21181
f6d62986
SM
211822011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21183
21184 * keyboard.c (safe_run_hook_funcall): New function.
21185 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21186 don't set the hook to nil, but remove the offending function instead.
21187 (Qcommand_hook_internal): Remove, unused.
21188 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21189 Vcommand_hook_internal.
21190
21191 * eval.c (enum run_hooks_condition): Remove.
21192 (funcall_nil, funcall_not): New functions.
21193 (run_hook_with_args): Call each function through a `funcall' argument.
21194 Remove `cond' argument, now redundant.
21195 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21196 (Frun_hook_with_args_until_failure): Adjust accordingly.
21197 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21198
1db5b1ad
JB
211992011-03-28 Juanma Barranquero <lekktu@gmail.com>
21200
21201 * dispextern.h (string_buffer_position): Remove declaration.
21202
21203 * print.c (strout): Remove parameter `multibyte', unused since
21204 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21205
21206 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21207 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21208 All callers changed.
21209
21210 * w32.c (_wsa_errlist): Use braces for struct initializers.
21211
21212 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21213 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21214 All callers changed.
21215 (string_buffer_position): Likewise. Also, make static (it's never
21216 used outside xdisp.c).
21217 (cursor_row_p): Remove parameter `w', unused since
21218 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21219 (decode_mode_spec): Remove parameter `precision', introduced during
21220 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21221 All callers changed.
21222
5ffb62aa
JD
212232011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21224
21225 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21226
461c2ab9 212272011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
21228
21229 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21230 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21231 (ns_update_auto_hide_menu_bar): New functions.
21232 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21233 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21234 ns_constrain_all_frames.
21235 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21236 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21237
5c380ffb
JD
212382011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21239
21240 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21241
9af30bdf
GM
212422011-03-27 Glenn Morris <rgm@gnu.org>
21243
21244 * syssignal.h: Replace RETSIGTYPE with void.
21245 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21246 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21247 Replace SIGTYPE with void everywhere.
21248 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21249 * s/template.h (SIGTYPE): Remove commented out definition.
21250
e2abce01
JB
212512011-03-26 Eli Zaretskii <eliz@gnu.org>
21252
21253 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21254 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21255
f868cd8a
JB
212562011-03-26 Juanma Barranquero <lekktu@gmail.com>
21257
59eb0929
JB
21258 * w32.c (read_unc_volume): Use parameter `henum', instead of
21259 global variable `wget_enum_handle'.
21260
21261 * keymap.c (describe_vector): Remove parameters `indices' and
21262 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21263 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21264
f868cd8a
JB
21265 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21266
21267 * keyboard.c (timer_check): Remove parameter `do_it_now',
21268 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21269 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21270 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21271
21272 * keyboard.c (read_char):
21273 * w32menu.c (w32_menu_display_help):
21274 * xmenu.c (show_help_event, menu_help_callback):
21275 Adjust calls to `show_help_echo'.
21276
21277 * gtkutil.c (xg_maybe_add_timer):
21278 * keyboard.c (readable_events):
21279 * process.c (wait_reading_process_output):
21280 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21281
21282 * insdel.c (adjust_markers_gap_motion):
21283 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21284 (gap_left, gap_right): Don't call it.
21285
2ecf6fdb
CY
212862011-03-25 Chong Yidong <cyd@stupidchicken.com>
21287
21288 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21289 incurred during fontification.
21290
6b1f9ba4
JB
212912011-03-25 Juanma Barranquero <lekktu@gmail.com>
21292
21293 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
21294 (DEFVAR_PER_BUFFER): Don't pass it.
21295
21296 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
21297 (scrolling_window): Don't pass it.
21298
0f4a96b5
JB
212992011-03-25 Juanma Barranquero <lekktu@gmail.com>
21300
21301 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
21302
21303 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
21304 and `suffix'.
21305 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
21306 of variables specific to SELinux and computation of `encoded_absname'.
21307
21308 * image.c (XPutPixel): Remove unused variable `height'.
21309
21310 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
21311
21312 * unexw32.c (get_section_info): Remove unused variable `section'.
21313
21314 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
21315 (system_process_attributes): Remove unused variable `sess'.
21316 (sys_read): Remove unused variable `err'.
21317
21318 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
21319 (w32_wnd_proc): Remove unused variable `isdead'.
21320 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
21321 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
21322 (x_create_tip_frame): Remove unused variable `tem'.
21323
21324 * w32inevt.c (w32_console_read_socket):
21325 Remove unused variable `no_events'.
21326
21327 * w32term.c (x_draw_composite_glyph_string_foreground):
21328 Remove unused variable `width'.
21329
1149507c
JB
213302011-03-24 Juanma Barranquero <lekktu@gmail.com>
21331
21332 * w32term.c (x_set_glyph_string_clipping):
21333 Don't pass uninitialized region to CombineRgn.
21334
9c88f339
JB
213352011-03-23 Juanma Barranquero <lekktu@gmail.com>
21336
21337 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
21338 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
21339 (Fx_close_connection): Remove unused variable `i'.
21340
21341 * w32font.c (w32font_draw): Return number of glyphs.
21342 (w32font_open_internal): Remove unused variable `i'.
21343 (w32font_driver): Add missing initializer.
21344
21345 * w32menu.c (utf8to16): Remove unused variable `utf16'.
21346 (fill_in_menu): Remove unused variable `items_added'.
21347
21348 * w32term.c (last_mouse_press_frame): Remove static global variable.
21349 (w32_clip_to_row): Remove unused variable `f'.
21350 (x_delete_terminal): Remove unused variable `i'.
21351
21352 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
21353 (NOTHING): Remove unused static global variable.
21354 (uniscribe_check_otf): Remove unused variable `table'.
21355 (uniscribe_font_driver): Add missing initializers.
21356
dee091a3
JD
213572011-03-23 Julien Danjou <julien@danjou.info>
21358
21359 * term.c (Fsuspend_tty, Fresume_tty):
21360 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
21361 * window.c (temp_output_buffer_show):
21362 * insdel.c (signal_before_change):
21363 * frame.c (Fhandle_switch_frame):
21364 * fileio.c (Fdo_auto_save):
21365 * emacs.c (Fkill_emacs):
21366 * editfns.c (save_excursion_restore):
21367 * cmds.c (internal_self_insert):
21368 * callint.c (Fcall_interactively):
21369 * buffer.c (Fkill_all_local_variables):
21370 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
21371 Use Frun_hooks.
0f4a96b5 21372 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 21373 unconditionally since it does the check itself.
dee091a3 21374
2c520ab5 213752011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 21376
c9c49752
PE
21377 Fix more problems found by GCC 4.5.2's static checks.
21378
8abc3f12
PE
21379 * coding.c (encode_coding_raw_text): Avoid unnecessary test
21380 the first time through the loop, since we know p0 < p1 then.
21381 This also avoids a gcc -Wstrict-overflow warning.
21382
a2d26660
PE
21383 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
21384 leading to a memory leak, possible in functions like
21385 load_charset_map_from_file that can allocate an unbounded number
b12ef411 21386 of objects (Bug#8318).
a2d26660 21387
916c72e9
PE
21388 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
21389 that could (at least in theory) be that large.
21390
19ab8a18
PE
21391 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
21392 This is less likely to overflow, and avoids undefined behavior if
21393 overflow does occur. All callers changed. Use strtoul to scan
21394 for the unsigned long integer.
b7cbbd6f
PE
21395 (pint2hrstr): Simplify and tune code slightly.
21396 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 21397
f0641eff
PE
21398 * scroll.c (do_scrolling): Work around GCC bug 48228.
21399 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
21400
7f650bb9
PE
21401 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
21402 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
21403 (validate_x_resource_name): Simplify count usage.
21404 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 21405
37dd57d1
PE
21406 * fileio.c (Fcopy_file): Report error if fchown or fchmod
21407 fail (Bug#8306).
81e56e61 21408
699979fc 21409 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 21410
401bf9b4
PE
21411 * process.c (Fmake_network_process): Use socklen_t, not int,
21412 where POSIX says socklen_t is required in portable programs.
21413 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 21414 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
21415 (Fmake_network_process, server_accept_connection):
21416 (wait_reading_process_output, read_process_output):
21417 Likewise.
21418
b93aacde
PE
21419 * process.c: Rename or move locals to avoid shadowing.
21420 (list_processes_1, Fmake_network_process):
21421 (read_process_output_error_handler, exec_sentinel_error_handler):
21422 Rename or move locals.
4dc343ee 21423 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 21424 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 21425 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 21426 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 21427 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 21428
af8a867c 21429 Make tparam.h and terminfo.c consistent.
44f230aa
SM
21430 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
21431 Include tparam.h instead, since it declares them.
af8a867c
PE
21432 * cm.h (PC): Remove extern decl; tparam.h now does this.
21433 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
21434 * terminfo.c: Include tparam.h, to check interfaces.
21435 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
21436 (tparam): Adjust signature to match interface in tparam.h;
21437 this removes some undefined behavior. Check that outstring and len
21438 are zero, which they always are with Emacs.
21439 * tparam.h (PC, BC, UP): New extern decls.
21440
0248044d 21441 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 21442 (xftfont_open): Rename locals to avoid shadowing.
0248044d 21443
8ff096c1 21444 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
21445 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
21446 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 21447 (ftfont_list): Remove unused local.
49eaafba
PE
21448 (get_adstyle_property, ftfont_pattern_entity):
21449 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
21450 Rename locals to avoid shadowing.
8ff096c1 21451
e2be39f6
PE
21452 * xfont.c (xfont_list_family): Mark var as initialized.
21453
c9735e30
PE
21454 * xml.c (make_dom): Now static.
21455
8f5201ae
PE
21456 * composite.c (composition_compute_stop_pos): Rename local to
21457 avoid shadowing.
b246f932
PE
21458 (composition_reseat_it): Remove unused locals.
21459 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 21460 (composition_update_it): Mark var as initialized.
11b61122
PE
21461 (find_automatic_composition): Mark vars as initialized,
21462 with a FIXME (Bug#8290).
8f5201ae 21463
760fbc2c
PE
21464 character.h: Rename locals to avoid shadowing.
21465 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
21466 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
21467 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
21468 (BUF_DEC_POS): Be more systematic about renaming local temporaries
21469 to avoid shadowing.
21470
ff08eb85
PE
21471 * textprop.c (property_change_between_p): Remove; unused.
21472
fc7bf025
PE
21473 * intervals.c (interval_start_pos): Now static.
21474
235d7abc
PE
21475 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
21476
44f230aa
SM
21477 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
21478 Rename locals to avoid shadowing.
3e7d6594 21479
50060332
PE
21480 * sound.c (wav_play, au_play, Fplay_sound_internal):
21481 Fix pointer signedness.
d01f234b 21482 (alsa_choose_format): Remove unused local var.
c83b8872
PE
21483 (wav_play): Initialize a variable to 0, to prevent undefined
21484 behavior (Bug#8278).
50060332 21485
c4fc4e30
PE
21486 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
21487
918436ed
PE
21488 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
21489
c939f91b
PE
21490 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
21491 clobbering (Bug#8298).
b9c7f648
PE
21492 * sysdep.c (sys_subshell): Likewise.
21493 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 21494
6bd8c144
PE
21495 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
21496 This should get cleaned up, so that child_setup has the
21497 same signature on all platforms.
21498
7710357c 21499 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 21500 (relocate_fd): Rename locals to avoid shadowing.
7710357c 21501
c59da222
CY
215022011-03-22 Chong Yidong <cyd@stupidchicken.com>
21503
21504 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
21505 not to be necessary, and produces flickering.
21506
66b87493
GM
215072011-03-20 Glenn Morris <rgm@gnu.org>
21508
21509 * config.in: Remove file.
21510
45b6f6d5
JB
215112011-03-20 Juanma Barranquero <lekktu@gmail.com>
21512
21513 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
21514 are now in src/globals.h.
21515 (syms_of_minibuf): Remove spurious & from previous change.
21516
cd394be1 215172011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
21518
21519 * minibuf.c (completing-read-function): New variable.
21520 (completing-read-default): Rename from completing-read.
21521 (completing-read): Call completing-read-function.
21522
b14e3e21
CY
215232011-03-19 Juanma Barranquero <lekktu@gmail.com>
21524
21525 * xfaces.c (Fx_load_color_file):
21526 Read color file from absolute filename (bug#8250).
21527
f2b726e6
JB
215282011-03-19 Juanma Barranquero <lekktu@gmail.com>
21529
21530 * makefile.w32-in: Update dependencies.
21531
09f6ff02
EZ
215322011-03-17 Eli Zaretskii <eliz@gnu.org>
21533
21534 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
21535
29a6015a
PE
215362011-03-17 Paul Eggert <eggert@cs.ucla.edu>
21537
a3a6c54e
PE
21538 Fix more problems found by GCC 4.5.2's static checks.
21539
b766f867
PE
21540 * process.c (make_serial_process_unwind, send_process_trap):
21541 (sigchld_handler): Now static.
21542
be02381c
PE
21543 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
21544 That way, the code declares only the vars that it needs.
21545 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
21546 * s/cygwin.h (PTY_ITERATION): Likewise.
21547 * s/darwin.h (PTY_ITERATION): Likewise.
21548 * s/gnu-linux.h (PTY_ITERATION): Likewise.
21549
57048744
PE
21550 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
21551 * process.c (allocate_pty): Don't declare stb unless it's needed.
21552
7914961c 21553 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
21554 (CONSTANTLIM): Remove; unused.
21555 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
21556 Define only if needed.
7914961c 21557
b3967b18
PE
21558 * unexelf.c (unexec): Name an expression,
21559 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
21560 Use a different way to cause a compilation error if anyone uses
21561 n rather than nn, a way that does not involve shadowing.
73366a00 21562 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 21563
29a6015a
PE
21564 * deps.mk (unexalpha.o): Remove; unused.
21565
43cfc33e 21566 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 21567 * unexec.h: New file.
ce701a33
PE
21568 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
21569 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
21570 Depend on unexec.h.
21571 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
21572 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
21573 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 21574 Change as necessary to match prototype in unexec.h.
ce701a33 21575
01f44d5a
PE
21576 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
21577 shadowing.
4f63c6bb 21578 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 21579
a6670b0b
PE
21580 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
21581 Rename locals to avoid shadowing.
21582
cef2010d 21583 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 21584 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 21585
d4d7173a
PE
21586 * print.c (Fredirect_debugging_output): Fix pointer signedess.
21587
f08b802a
PE
21588 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
21589 warning when compiling print.c.
21590
3ddb0639
PE
21591 * font.c (font_unparse_fcname): Abort in an "impossible" situation
21592 instead of using an uninitialized var.
5ad03b97 21593 (font_sort_entities): Mark var as initialized.
3ddb0639 21594
170a2692
PE
21595 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
21596
e663c700
PE
21597 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
21598 pointers to constants.
89bc529a 21599 (font_parse_fcname): Remove unused vars.
7b81e2d0 21600 (font_delete_unmatched): Now static.
ea838e10 21601 (font_get_spec): Remove; unused.
13a547c6
PE
21602 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
21603 (font_update_drivers, Ffont_get_glyphs, font_add_log):
21604 Rename or move locals to avoid shadowing.
e663c700 21605
2a80c887 21606 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 21607 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 21608
1384fa33 21609 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 21610 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 21611
8b2c52e9
PE
21612 * alloc.c (mark_backtrace): Move decl from here ...
21613 * lisp.h: ... to here, so that it can be checked.
21614
475545b5 21615 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 21616 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
21617 (lisp_indirect_variable): Name an expression,
21618 to avoid gcc -Wbad-function-cast warning.
1faed8ae 21619 (Fdefvar): Rename locals to avoid shadowing.
475545b5 21620
b1349114 21621 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 21622 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 21623 Use const pointer when appropriate.
b1349114 21624
a2928364
PE
21625 * lisp.h (get_system_name, get_operating_system_release):
21626 Move decls here, to check interfaces.
21627 * process.c (get_operating_system_release): Move decl to lisp.h.
21628 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
21629 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
21630 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
21631 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
21632 (Fformat_time_string, Fencode_time, Finsert_char):
21633 (Ftranslate_region_internal, Fformat):
21634 Rename or remove local vars to avoid shadowing.
9710023e 21635 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 21636
a415e694
PE
21637 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
21638 avoid shadowing.
21639
8ef4622d
PE
21640 * lisp.h (eassert): Check that the argument compiles, even if
21641 ENABLE_CHECKING is not defined.
21642
946f9a5b
PE
21643 * data.c (Findirect_variable): Name an expression, to avoid
21644 gcc -Wbad-function-cast warning.
112396d6 21645 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 21646 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
21647 (Fmake_variable_buffer_local, Fmake_local_variable):
21648 Mark variables as initialized.
52746918 21649 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 21650
e5aab7e7 21651 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
21652 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
21653 Rename locals to avoid shadowing.
dff45157
PE
21654 (mark_stack): Move local variables into the #ifdef region where
21655 they're used.
7bc26fdb
PE
21656 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
21657 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
21658 needed otherwise.
21659 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
21660 (GC_STRING_CHARS): Remove; not used.
d40d4be1 21661 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 21662
e5aab7e7
PE
21663 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
21664 avoids undefined behavior in theory.
21665
4da60324
PE
21666 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
21667
88043301
PE
21668 Use functions, not macros, for up- and down-casing (Bug#8254).
21669 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21670 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
21671 to use the following functions instead of these macros.
21672 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
21673 EMACS_INT, since callers assume the returned value fits in int.
21674 (upcase1): Likewise, for UPCASE_TABLE.
21675 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 21676 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 21677 the race-condition problem in the old DOWNCASE.
88043301 21678
19ed5445
PE
21679 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
21680 Rename locals to avoid shadowing.
21681 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
21682 (regex_compile, re_search_2, re_match_2_internal):
21683 Remove unused local vars.
952db0d7
PE
21684 (FREE_VAR): Rewrite so as not to use empty "else",
21685 which gcc can warn about.
da053e48 21686 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
21687 (RETALLOC_IF): Define only if needed.
21688 (WORDCHAR_P): Likewise. This one is never needed, but is used
21689 only in a comment talking about a compiler bug, so put inside
21690 the #if 0 of that comment.
21691 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
21692 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
21693 Remove; unused.
19ed5445 21694
1f3561e4 21695 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
21696 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
21697 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 21698
ded6f8f7
PE
21699 * search.c (simple_search): Remove unused var.
21700
dbd37a95
PE
21701 * dired.c (compile_pattern): Move decl from here ...
21702 * lisp.h: ... to here, so that it can be checked.
21703 (struct re_registers): New forward decl.
21704
7e47afad
PE
21705 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
21706
85f24f61
PE
21707 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
21708 All uses changed.
21709 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
21710 Rename locals to avoid shadowing.
5671df8f 21711 (Fvertical_motion): Mark locals as initialized.
85f24f61 21712
181aa2be 21713 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 21714 (casify_region): Mark local as initialized.
181aa2be 21715
930d429c
PE
21716 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
21717
7082eac6
PE
21718 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
21719 New macros, so that the caller can use some names other than
21720 gcpro1, gcpro2, etc.
21721 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
21722 of the new macros.
21723 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
21724 argument, for consistency with GCPRO2_VAR, etc: it is now the
21725 prefix of the variable, not the variable itself. All uses
21726 changed.
38b2c076
PE
21727 * dired.c (directory_files_internal, file_name_completion):
21728 Rename locals to avoid shadowing.
21729
15206ed9
PE
21730 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
21731 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
21732 dired.c's scmp function, had undefined behavior.
21733 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21734 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
21735 * buffer.h: ... to here, because these macros use current_buffer,
21736 and the new implementation with inline functions needs to have
21737 current_buffer in scope now, rather than later when the macros
21738 are used.
21739 (downcase, upcase1): New static inline functions.
21740 (DOWNCASE, UPCASE1): Reimplement using these functions.
21741 This avoids undefined behavior in expressions like
21742 DOWNCASE (x) == DOWNCASE (y), which previously suffered
21743 from race conditions in accessing the global variables
21744 case_temp1 and case_temp2.
21745 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
21746 * lisp.h (case_temp1, case_temp2): Remove their decls.
21747 * character.h (ASCII_CHAR_P): Move from here ...
21748 * lisp.h: ... to here, so that the inline functions mentioned
21749 above can use them.
21750
4a6bea26
PE
21751 * dired.c (directory_files_internal_unwind): Now static.
21752
f14b7e14
PE
21753 * fileio.c (file_name_as_directory, directory_file_name):
21754 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
21755 Now static.
2893f146
PE
21756 (file_name_as_directory): Use const pointers when appropriate.
21757 (Fexpand_file_name): Likewise. In particular, newdir might
21758 point at constant storage, so make it a const pointer.
fd4ead52 21759 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
21760 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
21761 signedness issues.
f839df0c
PE
21762 (Fset_file_times, Finsert_file_contents, auto_save_error):
21763 Rename locals to avoid shadowing.
f14b7e14 21764
5716756e 21765 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
21766 (Ftry_completion, Fall_completions): Rename or remove locals
21767 to avoid shadowing.
5716756e 21768
b4c3046a
PE
21769 * marker.c (bytepos_to_charpos): Remove; unused.
21770
b45db522
PE
21771 * lisp.h (verify_bytepos, count_markers): New decls,
21772 so that gcc does not warn that these functions aren't declared.
21773
85876d07
PE
21774 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
21775 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 21776 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 21777 (copy_text): Remove unused local var.
85876d07 21778
03d78a21 21779 * filelock.c (within_one_second): Now static.
b3dd38ab 21780 (lock_file_1): Rename local to avoid shadowing.
03d78a21 21781
5df8f01b
PE
21782 * buffer.c (fix_overlays_before): Mark locals as initialized.
21783 (fix_start_end_in_overlays): Likewise. This function should be
21784 simplified by using pointers-to-pointers, but that's a different
21785 matter.
b1d876f1 21786 (switch_to_buffer_1): Now static.
8f54f30a
PE
21787 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
21788 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 21789
a70072c9 21790 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 21791 Fix pointer signedness issue.
edced198
PE
21792 (sys_subshell): Mark local as volatile if checking for lint,
21793 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 21794 (MAXPATHLEN): Define only if needed.
a70072c9 21795
a0977c44
PE
21796 * process.c (serial_open, serial_configure): Move decls from here ...
21797 * systty.h: ... to here, so that they can be checked.
21798
a884fdcc
PE
21799 * fns.c (get_random, seed_random): Move extern decls from here ...
21800 * lisp.h: ... to here, so that they can be checked.
21801
604efe86 21802 * sysdep.c (reset_io): Now static.
b8950c94 21803 (wait_for_termination_signal): Remove; unused.
604efe86 21804
38fc62d9
PE
21805 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
21806 (copy_keymap_item, append_key, push_text_char_description):
21807 Now static.
1004a21a 21808 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 21809 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
21810 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
21811 (describe_map_tree):
21812 Rename locals to avoid shadowing.
38fc62d9 21813
2f2650da
PE
21814 * keyboard.c: Declare functions static if they are not used elsewhere.
21815 (echo_char, echo_dash, cmd_error, top_level_2):
21816 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
21817 (read_char, kbd_buffer_get_event, make_lispy_position):
21818 (make_lispy_event, make_lispy_movement, apply_modifiers):
21819 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
21820 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
21821 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 21822 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 21823 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 21824
a053e86c 21825 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
21826 (mark_kboards): Move decl here ...
21827 * alloc.c (mark_kboards): ... from here.
a053e86c 21828
4752793e
PE
21829 * lisp.h (force_auto_save_soon): New decl.
21830
74f10ca7 21831 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
21832 (DEFINE_DUMMY_FUNCTION): New macro.
21833 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
21834 Use it.
c03cd23f
PE
21835 (main): Add casts to avoid warnings
21836 if GCC considers string literals to be constants.
74f10ca7 21837
022e70d4
PE
21838 * lisp.h (fatal_error_signal): Add decl, since it's exported.
21839
59d6fe83
PE
21840 * dbusbind.c: Pointer signedness fixes.
21841 (xd_signature, xd_append_arg, xd_initialize):
21842 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21843 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21844 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
21845 (Fdbus_register_signal): Use SSDATA when the context wants char *.
21846
78320123
PE
21847 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
21848 if GCC considers string literals to be constants.
49cebcca 21849 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 21850
35ac2a97
SM
218512011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
21852
fb103ca9
SM
21853 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
21854 (print_preprocess, print_object): New macro to fix last change.
21855
35ac2a97
SM
21856 * print.c (print_preprocess): Don't forget font objects.
21857
62973b41
JB
218582011-03-16 Juanma Barranquero <lekktu@gmail.com>
21859
21860 * emacs.c (USAGE3): Doc fixes.
21861
0e48bb22
AS
218622011-03-15 Andreas Schwab <schwab@linux-m68k.org>
21863
21864 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
21865 structure.
21866
7684e57b
JB
218672011-03-14 Juanma Barranquero <lekktu@gmail.com>
21868
21869 * lisp.h (VWindow_system, Qfile_name_history):
21870 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
21871 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
21872 (w32_system_caret_x, w32_system_caret_y): Declare extern.
21873
21874 * w32select.c: Don't #include "keyboard.h".
c96bbc66 21875 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
21876
21877 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
21878 * w32console.c (detect_input_pending, read_input_pending)
21879 (encode_terminal_code):
21880 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
21881 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
21882 (w32_system_caret_y, Qfile_name_history):
21883 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
21884 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
21885 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
21886 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
21887 * w32proc.c (Qlocal, report_file_error):
21888 * w32term.c (Vwindow_system, updating_frame):
21889 * w32uniscribe.c (initialized, uniscribe_font_driver):
21890 Remove unneeded extern declarations.
21891
2aa46d6c
CY
218922011-03-14 Chong Yidong <cyd@stupidchicken.com>
21893
c96bbc66 21894 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 21895
cffc6f3b
CY
218962011-03-13 Chong Yidong <cyd@stupidchicken.com>
21897
21898 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
21899 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
21900 These macros can no longer be used for assignment.
21901
44f230aa
SM
21902 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
21903 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
21904 (record_buffer_markers, fetch_buffer_markers): New functions for
21905 recording and fetching special buffer markers.
21906 (set_buffer_internal_1, set_buffer_temp): Use them.
21907
21908 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
21909
21910 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
21911
21912 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
21913 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
21914
21915 * xdisp.c (hscroll_window_tree):
21916 (reconsider_clip_changes): Use PT instead of BUF_PT.
21917
d251f04b
EZ
219182011-03-13 Eli Zaretskii <eliz@gnu.org>
21919
21920 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
21921 $(EMACS_ROOT)/lib/intprops.h.
21922
f0c77cd1
PE
219232011-03-13 Paul Eggert <eggert@cs.ucla.edu>
21924
3eca4629
PE
21925 Fix more problems found by GCC 4.5.2's static checks.
21926
7c86ee98
PE
21927 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
21928 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
21929 (xg_free_frame_widgets): Make it clear that a local variable is
21930 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
21931 (gdk_window_get_screen): Make it clear that this macro is needed
21932 only if USE_GTK_TOOLTIP.
1e5524e7
PE
21933 (int_gtk_range_get_value): New function, which avoids a diagnostic
21934 from gcc -Wbad-function-cast.
21935 (xg_set_toolkit_scroll_bar_thumb): Use it.
21936 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
21937 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
21938 (get_utf8_string, xg_get_file_with_chooser):
21939 Rename locals to avoid shadowing.
21940 (create_dialog): Move locals to avoid shadowing.
7c86ee98 21941
41729b81
PE
21942 * xgselect.c (xg_select): Remove unused var.
21943
f0c77cd1
PE
21944 * image.c (four_corners_best): Mark locals as initialized.
21945 (gif_load): Initialize transparent_p to zero (Bug#8238).
21946 Mark another local as initialized.
ec6cf4c6 21947 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 21948
ce0ad53d 21949 * image.c (clear_image_cache): Now static.
d5d5a617 21950 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 21951 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
21952 (x_edge_detection): Remove unnecessary cast that
21953 gcc -Wbad-function-cast diagnoses.
2037898d 21954 (gif_load): Fix pointer signedness.
6ae141d6
PE
21955 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
21956 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 21957
33383987 219582011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 21959
d32df629
PE
21960 Improve quality of tests for time stamp overflow.
21961 For example, without this patch (encode-time 0 0 0 1 1
21962 1152921504606846976) returns the obviously-bogus value (-948597
21963 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
21964 reports time overflow. See
21965 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
21966 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
21967 * editfns.c: Include limits.h and intprops.h.
21968 (TIME_T_MIN, TIME_T_MAX): New macros.
21969 (time_overflow): Move earlier, to before first use.
21970 (hi_time, lo_time): New functions, for an accurate test for
21971 out-of-range times.
21972 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
21973 (Fget_internal_run_time): Don't assume time_t fits in int.
21974 (make_time): Use list2 instead of Fcons twice.
21975 (Fdecode_time): More accurate test for out-of-range times.
21976 (check_tm_member): New function.
21977 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
21978 (lisp_time_argument): Don't rely on undefined left-shift and
21979 right-shift behavior when checking for time stamp overflow.
8be6f318 21980
fe31d94c
PE
21981 * editfns.c (time_overflow): New function, refactoring common code.
21982 (Fformat_time_string, Fdecode_time, Fencode_time):
21983 (Fcurrent_time_string): Use it.
21984
8be6f318
PE
21985 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
21986 * dired.c (make_time): Move to ...
21987 * editfns.c (make_time): ... here.
21988 * systime.h: Note the move.
21989
09d9db2c 219902011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 21991
126bc0dc
YM
21992 * fringe.c (update_window_fringes): Remove unused variables.
21993
c47cbdfd
YM
21994 * unexmacosx.c (copy_data_segment): Also copy __got section.
21995 (Bug#8223)
21996
7ac80be9
EZ
219972011-03-12 Eli Zaretskii <eliz@gnu.org>
21998
c96bbc66 21999 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
22000 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22001 Constify `char *' arguments and their references according to
22002 prototypes in tparam.h.
22003
ecb0f94d 22004 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 22005
7ac80be9
EZ
22006 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22007 Adapt all references accordingly.
22008
22009 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22010
ef1fd07e
TT
220112011-03-11 Tom Tromey <tromey@redhat.com>
22012
22013 * buffer.c (syms_of_buffer): Remove obsolete comment.
22014
7ef4b50c
EZ
220152011-03-11 Eli Zaretskii <eliz@gnu.org>
22016
22017 * termhooks.h (encode_terminal_code): Declare prototype.
22018
22019 * msdos.c (encode_terminal_code): Don't declare prototype.
22020
22021 * term.c (encode_terminal_code): Now external again, used by
22022 w32console.c and msdos.c.
22023
44f230aa
SM
22024 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22025 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 22026
4b1ec863 220272011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 22028
1714f52b 22029 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 22030
4b1ec863
PE
22031 * fringe.c (update_window_fringes): Mark locals as initialized
22032 (Bug#8227).
22033 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 22034
524c7aa6
PE
22035 * alloc.c (mark_fringe_data): Move decl from here ...
22036 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22037 to check its interface.
22038 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22039
a5c0af81 22040 * fontset.c (free_realized_fontset): Now static.
7519b8cd 22041 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 22042 (fontset_font): Mark local as initialized.
a9a06e0b 22043 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 22044
b4716021
PE
22045 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22046
811e9bac 22047 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 22048 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
22049 (x_own_selection, Fx_disown_selection_internal): Rename locals
22050 to avoid shadowing.
22051 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 22052
7e3ab302
PE
22053 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22054 so that the caller can use some name other than gcpro1.
22055 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
22056 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22057 (Fx_backspace_delete_keys_p):
22058 Use them to avoid shadowing, and rename vars to avoid shadowing.
22059 (x_decode_color, x_set_name, x_window): Now static.
6b437900 22060 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 22061 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
22062 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22063 Remove unused locals.
7e3ab302
PE
22064 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22065 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22066 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22067 macros.
f78faa98 22068
e2b13473
PE
22069 * xterm.h (x_mouse_leave): New decl.
22070
77f23912
PE
22071 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22072 Remove unused functions.
cdf4ba58
PE
22073 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22074 (x_calc_absolute_position): Now static.
7411c686 22075 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 22076 Don't declare local "event" unless it's used.
ed7bf3a5
PE
22077 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22078 unless they are used.
38d0b34a
PE
22079 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22080 (x_fatal_error_signal): Remove; not used.
a6067996
PE
22081 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22082 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22083 (x_error_catcher, x_connection_closed, x_error_handler):
22084 (x_error_quitter, xembed_send_message, x_iconify_frame):
22085 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 22086 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 22087 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 22088
44f230aa
SM
22089 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22090 Rename or move locals to avoid shadowing.
6b463e58 22091 (tty_defined_color, merge_face_heights): Now static.
5967d051 22092 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
22093 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22094 does not deduce is never used uninitialized.
73719eba
PE
22095 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22096 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 22097
426994c3 22098 * terminal.c (store_terminal_param): Now static.
5489860b 22099
032f1620 22100 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 22101 (set_frame_menubar): Remove unused local.
d4323972 22102 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
22103 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22104 since they might point to immutable storage.
281585b0
PE
22105 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22106 since it's unused otherwise.
032f1620 22107
367c19e5 22108 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 22109 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
22110 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22111 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 22112 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
22113 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22114 does not deduce are never used uninitialized.
70739cbe 22115
07b48fa9
PE
22116 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22117
8868a238 22118 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
22119 * window.c (window_loop, size_window):
22120 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 22121
7e5cf297 22122 * window.c (display_buffer): Now static.
d6550a9f
PE
22123 (size_window): Mark variables that gcc -Wuninitialized
22124 does not deduce are never used uninitialized.
a586633d
PE
22125 * window.h (check_all_windows): New decl, to forestall
22126 gcc -Wmissing-prototypes diagnostic.
5b555da1 22127 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 22128
f6095868
PE
22129 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22130 shadowing.
22131 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
22132 Include <limits.h>.
22133 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22134 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
22135 (load_charset_map): Mark variables that gcc -Wuninitialized
22136 does not deduce are never used uninitialized.
53df7c11 22137 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 22138
f38b440c
PE
22139 * coding.c (coding_set_source, coding_set_destination):
22140 Use "else { /* comment */ }" rather than "else /* comment */;"
22141 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
22142 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22143 a block, when the outer 'i' will do.
22144 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22145 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22146 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22147 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22148 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22149 Rename locals to avoid shadowing.
22150 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
22151 * coding.c (emacs_mule_char, encode_invocation_designation):
22152 Now static, since they're not used elsewhere.
413bb2db 22153 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 22154 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
22155 (decode_coding_emacs_mule): Mark variables that gcc
22156 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
22157 (detect_coding_iso_2022): Initialize a local variable that might
22158 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 22159 this initialization is needed. (Bug#8211)
5f58e762
PE
22160 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22161 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22162 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22163 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22164 Remove unused macros.
f38b440c 22165
232b38b9 22166 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 22167 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 22168 * character.c (string_count_byte8): Likewise.
232b38b9 22169
fb90da1b
PE
22170 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22171 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22172
fb93dbc2
PE
22173 * chartab.c (copy_sub_char_table): Now static, since it's not used
22174 elsewhere.
5c156ace
PE
22175 (sub_char_table_ref_and_range, char_table_ref_and_range):
22176 Rename locals to avoid shadowing.
bbcd0949 22177 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 22178
7d3b3862 22179 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 22180 (BIDI_BOB): Remove unused macro.
7d3b3862 22181
6be7d3da
PE
22182 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22183 deduce are never used uninitialized.
c2ed9c8b 22184 * term.c (encode_terminal_code): Likewise.
6be7d3da 22185
75f8807f 22186 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 22187
50938595
PE
22188 * tparam.h: New file.
22189 * term.c, tparam.h: Include it.
22190 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22191 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22192 Move these decls to tparam.h, and make them agree with what
22193 is actually in tparam.c. The previous trick of using incompatible
22194 decls in different modules does not conform to the C standard.
22195 All callers of tparam changed to use tparam's actual API.
22196 * tparam.c (tparam1, tparam, tgoto):
22197 Use const pointers where appropriate.
22198
fbceeba2
PE
22199 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22200 * cm.h (struct cm): Likewise.
22201 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22202 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22203 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22204 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22205 (turn_on_face, init_tty): Likewise.
22206 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 22207
7f3f1250
PE
22208 * term.c (term_mouse_position): Rename local to avoid shadowing.
22209
e6ca6543
PE
22210 * alloc.c (mark_ttys): Move decl from here ...
22211 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22212
c40f8d15
AS
222132011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22214
22215 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22216
cfe0661d
JB
222172011-03-09 Juanma Barranquero <lekktu@gmail.com>
22218
22219 * search.c (compile_pattern_1): Remove argument regp, unused since
22220 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22221 (compile_pattern): Don't pass it.
22222
0afb4571
J
222232011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22224
22225 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22226 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22227 for ! HAVE_GTK3.
22228 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22229
22230 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22231
22232 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22233 gdk_window_get_screen, gdk_window_get_geometry,
22234 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22235 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22236 (xg_get_pixbuf_from_pixmap): New function.
22237 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22238 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22239 Call xg_get_pixbuf_from_pixmap instead of
22240 gdk_pixbuf_get_from_drawable.
22241 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22242 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22243 (xg_check_special_colors): Use GtkStyleContext and its functions
22244 for HAVE_GTK3.
22245 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22246 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22247 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
22248 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22249 Call gtk_widget_get_preferred_size.
0afb4571
J
22250 (xg_frame_resized): gdk_window_get_geometry only takes 5
22251 parameters.
44f230aa
SM
22252 (xg_win_to_widget, xg_event_is_for_menubar):
22253 Call gdk_x11_window_lookup_for_display.
0afb4571
J
22254 (xg_set_widget_bg): New function.
22255 (delete_cb): New function.
895009e1 22256 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 22257 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
22258 (xg_set_background_color): Call xg_set_widget_bg.
22259 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22260 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22261 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22262 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22263 if ! HAVE_GTK3.
22264 (update_frame_tool_bar): Call gtk_widget_hide.
22265 (xg_initialize): Use GDK_KEY_g.
22266
22267 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22268 if ! HAVE_GTK3
22269 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22270
22271 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22272 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22273 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22274
1c2cc4ef
JB
222752011-03-08 Juanma Barranquero <lekktu@gmail.com>
22276
22277 * w32xfns.c (select_palette): Check success of RealizePalette against
22278 GDI_ERROR, not zero.
22279
33383987 22280See ChangeLog.11 for earlier changes.
aac0c6e3
MR
22281
22282;; Local Variables:
22283;; coding: utf-8
aac0c6e3
MR
22284;; End:
22285
ab422c4d 22286 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
22287
22288 This file is part of GNU Emacs.
22289
22290 GNU Emacs is free software: you can redistribute it and/or modify
22291 it under the terms of the GNU General Public License as published by
22292 the Free Software Foundation, either version 3 of the License, or
22293 (at your option) any later version.
22294
22295 GNU Emacs is distributed in the hope that it will be useful,
22296 but WITHOUT ANY WARRANTY; without even the implied warranty of
22297 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22298 GNU General Public License for more details.
22299
22300 You should have received a copy of the GNU General Public License
22301 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.