Merge FFAP's URI-detection code into thingatpt.el.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
5257b701
DC
12013-02-03 Daniel Colascione <dancol@dancol.org>
2
3 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
4 daemon mode works on cygw32 when Emacs is installed and not just
5 during development.
6
8ea41ea9
PE
72013-02-02 Paul Eggert <eggert@cs.ucla.edu>
8
9 Avoid file time stamp bug on MS-Windows (Bug#13149).
10 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
11 as FAT32 doesn't update time stamps when truncating them.
12 Also, check that a file time stamp is not a multiple of 100 ns;
13 this should catch all instances of the problem on MS-Windows,
14 as its native file system resolution is 100 ns or worse, and
15 checking for a non-multiple of 100 ns should impose only a small
16 overhead on systems with ns resolution.
17
94fbc901 182013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 19
e7ac588e
EZ
20 Avoid encoding file names on MS-Windows when they need to be run
21 through dostounix_filename.
22 * w32.c (normalize_filename): Accept an additional argument
23 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
24 downcase it even if w32-downcase-file-names is non-nil.
25 (dostounix_filename): Accept an additional argument MULTIBYTE and
26 pass it to normalize_filename.
27 (emacs_root_dir): Adjust.
28
29 * msdos.h (dostounix_filename): Adjust prototype.
30
31 * w32.h (dostounix_filename): Adjust prototype.
32
33 * msdos.c (dostounix_filename): Accept an additional argument and
34 ignore it.
35 (init_environment): Adjust callers of dostounix_filename.
36
37 * fileio.c (Ffile_name_directory, file_name_as_directory)
38 (directory_file_name, Fexpand_file_name)
39 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
40 dostounix_filename.
41 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
42 non-nil.
43 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
44 variables, as egetenv is case-insensitive for DOS_NT.
45
46 * dired.c (file_name_completion): Don't call Fdirectory_file_name
47 with an encoded file name.
48
49 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name): Adjust
50 calls to dostounix_filename.
51
52 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
53
54 * unexw32.c (unexec): Adjust call to dostounix_filename.
55
56 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
57
58 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
59 dostounix_filename.
60
61 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
62 dostounix_filename.
63
e7c3fb06
EZ
64 * callproc.c (Fcall_process): Make sure program name in PATH and
65 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
66 is passed to exec/spawnve, which fails unless the file-name
67 encoding is UTF-8.
68
18a80473
EZ
69 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
70 even if w32-quote-process-args is nil.
71
35e85499
PE
722013-02-01 Paul Eggert <eggert@cs.ucla.edu>
73
74 Fix timestamp bug when write-region appends nothing (Bug#13149).
75 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
76 the file's time stamp doesn't change if Emacs happens to write nothing
77 to the file, and on a buggy file system this could cause Emacs to
78 incorrectly infer that the file system doesn't have the bug.
79 Avoid this problem by inhibiting the inference in this case.
80
422ff52b
DA
812013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
82
83 * window.h (struct window): Convert base_line_number, base_line_pos
84 and column_number_displayed members from Lisp_Object to ptrdiff_t.
85 Convert region_showing member from Lisp_Object to bitfield.
86 Remove sequence_number member. Adjust comments.
87 * window.c (sequence_number): Remove.
88 (make_window): Initialize column_number_displayed.
89 * print.c (print_object): Follow the printed representation of
90 frames and print window pointer to distinguish between windows.
91 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
92 * xdisp.c (wset_base_line_number, wset_base_line_pos)
93 (wset_column_number_displayed, wset_region_showing): Remove.
94 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
95 (try_scrolling, try_cursor_movement, redisplay_window)
96 (try_window_reusing_current_matrix, try_window_id, display_line)
97 (display_mode_lines, decode_mode_spec): Adjust users.
98 * .gdbinit (pwinx): Do not print sequence_number.
99
8654f9d7
PE
1002013-02-01 Paul Eggert <eggert@cs.ucla.edu>
101
102 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
103 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
104 * dired.c: Include <fcntl.h>.
105 (open_directory): New function, which uses open and fdopendir
106 rather than opendir. DOS_NT platforms still use opendir, though.
107 (directory_files_internal, file_name_completion): Use it.
108 (file_attributes): New function, with most of the old Ffile_attributes.
109 (directory_files_internal, Ffile_attributes): Use it.
110 (file_attributes, file_name_completion_stat): First arg is now fd,
111 not dir name. All uses changed. Use fstatat rather than lstat +
112 stat.
113 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
114 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
115 (emacs_readlinkat): New function, with much of the old
116 Ffile_symlink_p, but with an fd argument for speed.
117 It uses readlinkat rather than careadlinkatcwd, so that it
118 need not assume the working directory.
119 (Ffile_symlink_p): Use it.
120 * filelock.c (current_lock_owner): Use emacs_readlinkat
121 rather than emacs_readlink.
122 * lisp.h (emacs_readlinkat): New decl.
123 (READLINK_BUFSIZE, emacs_readlink): Remove.
124 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
125 (emacs_norealloc_allocator, emacs_readlink): Remove.
126 This stuff is moved to fileio.c.
127 * w32.c (fstatat, readlinkat): New functions.
128 (careadlinkat): Don't check that fd == AT_FDCWD.
129 (careadlinkatcwd): Remove; no longer needed.
130
9dbda100
GM
1312013-01-31 Glenn Morris <rgm@gnu.org>
132
133 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
134 (Fwrite_region): Update for new choose_write_coding_system args.
135 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
136 (syms_of_fileio): Add choose-write-coding-system.
137
3f82a88a 1382013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
139
140 * w32.c (sys_open): Zero out the flags for the new file descriptor.
141 (sys_close): Zero out the flags for the file descriptor before
142 closing it. (Bug#13546)
143
806fed21
EZ
144 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
145 (logon_network_drive, stat_worker, symlink, chase_symlinks): Use
146 CharNextExA and CharPrevExA to iterate over file names encoded in
147 DBCS. (Bug#13553)
148
6ee4509a
EZ
149 * w32.c (w32_get_long_filename, init_environment, readlink):
150 Support file names encoded in DBCS codepages.
26854e9c
EZ
151 (readlink): Use the current file-name-coding-system, not the ANSI
152 codepage, to decode and handle targets of symlinks.
6ee4509a 153
cf01a359
EZ
1542013-01-28 Eli Zaretskii <eliz@gnu.org>
155
156 * w32.c (opendir): Now accepts a 'const char *'.
157
6fd326b7
DA
1582013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
159
160 Remove obsolete redisplay code. See the discussion at
161 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
162 * dispnew.c (preemption_period, preemption_next_check): Remove.
163 (Vredisplay_preemption_period): Likewise.
164 (update_frame, update_single_window, update_window, update_frame_1):
165 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
166 used, following the 2012-06-22 change.
167
d8cd7742
EZ
1682013-01-25 Eli Zaretskii <eliz@gnu.org>
169
170 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
171
266fee4f
DA
1722013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
173
174 * font.c (num_fonts): Remove the leftover from old
175 debugging code. Adjust comment style here and there.
59e624b3
DA
176 * insdel.c (insert_1): Remove.
177 * lisp.h (insert_1): Remove prototype.
178 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 179
830e46e6 1802013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
181
182 * w32.c (max_filename_mbslen): New function.
183 (normalize_filename, readdir): Use it to detect locales where ANSI
184 encoding of file names uses a double-byte character set (DBCS).
185 If a DBCS encoding is used, advance by characters using
186 CharNextExA, instead of incrementing a 'char *' pointer. Use
187 _mbslwr instead of _strlwr. (Bug#13515)
188
81abbb95
EZ
189 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
190 request of memory reservation to 1.7GB. (Bug#13065)
191
830e46e6 1922013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
193
194 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
195 at check_extra_latin label. (Bug#13505)
196
fd3ceb09
DA
1972013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
198
199 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
200 Avoid redundant calls to strlen.
201
edfa7fa0
DA
2022013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
203
204 Drop async_visible and async_iconified fields of struct frame.
205 This is possible because async input is gone; for details, see
206 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
207 * frame.h (struct frame): Remove async_visible and async_iconified
208 members, convert garbaged to unsigned bitfield. Adjust comments.
209 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
210 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
211 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
212 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
213 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
214 * w32term.c: Ditto.
215 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
216 properly. Likewise for obscured.
217 * xterm.c: Ditto.
266fee4f 218 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
219 properly.
220 * nsterm.m: Ditto.
221 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
222
5ad86e34
DA
2232013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
224
225 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
226 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
227
b09cca6a
SM
2282013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
229
230 * xdisp.c (message2, message2_nolog): Remove functions.
231 (message3, message3_nolog): Extract nbytes and multibyteness directly
232 from the string. Change all callers.
233 (message3_nolog): Don't set message_enable_multibyte since set_message
234 will reset it anyway.
235 (message1, message1_nolog): Use message3.
236 (vmessage): Use a stack allocated buffer rather than f->message_buf.
237 (with_echo_area_buffer): Remove last two arguments. Update all callers.
238 (set_message): Drop all but the second arg, which has to be a string.
239 (set_message_1): Simplify now that we know that a1 is NULL and the
240 second arg is a string.
241 * frame.h (struct frame): Remove `message_buf' field.
242 Use glyphs_initialized_p instead.
243 (FRAME_MESSAGE_BUF): Remove macro.
244 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
245 * lisp.h (message2, message2_nolog): Remove declarations.
246 (message3, message3_nolog): Update declarations.
247 * keyboard.c (read_char_minibuf_menu_text)
248 (read_char_minibuf_menu_width): Remove vars.
249 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
250 to correctly handle multibyte strings.
251 * frame.c (delete_frame): Don't free message_buf any more.
252 * editfns.c (message_text, message_length): Remove vars.
253 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
254 * fileio.c (auto_save_error): Use message3 instead of message2.
255 * dispnew.c (adjust_frame_message_buffer): Remove function.
256
54ab1c5a
EZ
2572013-01-23 Eli Zaretskii <eliz@gnu.org>
258
259 * w32term.c (w32fullscreen_hook): Account correctly for the screen
260 real estate used for the tool bar and the menu bar.
261
6c27465b
DA
2622013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
263
264 * insdel.c (prepare_to_modify_buffer): Force redisplay if
265 hidden buffer is prepared to modification (Bug#13164).
266
9d93ce29
DA
2672013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
268
269 * window.h (struct window): Change window_end_valid member from
270 Lisp_Object to a bitfield. Adjust comments.
271 (wset_window_end_valid): Remove.
272 * window.c (adjust_window_count): Clear window_end_valid.
273 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
274 (Fwindow_line_height, set_window_buffer, Frecenter)
275 (Fsplit_window_internal, Fdelete_other_windows_internal)
276 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
277 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
278 * xdisp.c (check_window_end, reconsider_clip_changes)
279 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
280 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
281 (find_first_unchanged_at_end_row, try_window_id): Likewise.
282
1dcb8ea2
DA
2832013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
284
285 * xdisp.c (mark_window_display_accurate): Simplify the loop
286 assuming that the only one of vchild, hchild or buffer window
287 slots is non-nil. Call mark_window_display_accurate_1 for
288 the leaf windows only.
289 (mark_window_display_accurate_1): Always assume leaf window.
290 Adjust comment.
291
b41b8a7e
PE
2922013-01-22 Paul Eggert <eggert@cs.ucla.edu>
293
593a5f2e
PE
294 * emacs.c (Qkill_emacs_hook): Now static.
295
b41b8a7e
PE
296 * fileio.c (Finsert_file_contents): Simplify.
297 Remove unnecessary assignments and tests.
298
84e5ed96
EZ
2992013-01-21 Eli Zaretskii <eliz@gnu.org>
300
301 * w32.c (acl_set_file): Don't test for errors unless
302 set_file_security returns FALSE. Avoids spurious errors when
303 saving files.
304
2ef88fd4
DA
3052013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
306
307 * fileio.c (Finsert_file_contents): Revert code introduced at
308 2013-01-18 in favor of the simpler and generally better fix.
309 Save stack space by removing 'buffer' and reusing 'read_buf'
310 where appropriate.
311
d7a0a7c9
PE
3122013-01-19 Paul Eggert <eggert@cs.ucla.edu>
313
314 * lisp.h (eabs): Define unconditionally (Bug#13419).
315 The old "#if !defined (eabs)" was an unnecessary revenant of back
316 when this macro was called "abs". Document 'eabs' better.
317
795e7a5b 3182013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
319
320 * fns.c (Frandom): Doc fix.
321
59ac2d13
EZ
3222013-01-19 Eli Zaretskii <eliz@gnu.org>
323
324 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
325 segfault when there are lots of overlays.
326
327 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
328 when there are lots of overlays. See
329 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
330 for the details and a way to reproduce.
331
b3fbb395
PE
3322013-01-19 Paul Eggert <eggert@cs.ucla.edu>
333
3a955a1f
PE
334 * fileio.c: Use O_APPEND to append.
335 This corresponds better to the natural interpretation of "append",
336 and avoids the need to open the output file twice, or to invoke
337 lseek when APPEND is neither nil nor a number.
338 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
339 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
340 file possibly twice, and lseeking to its end; this avoids the
341 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
342 at the same time: the combination is never needed and apparently
343 it doesn't work with DOS_NT.
344
21cd50b8
PE
345 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
346 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
347
b3fbb395
PE
348 Allow floating-point file offsets.
349 Problem reported by Vitalie Spinu in
350 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
351 * fileio.c (emacs_lseek): Remove.
352 (file_offset): New function.
353 (Finsert_file_contents, Fwrite_region): Use it.
354
73c14218
CY
3552013-01-19 Chong Yidong <cyd@gnu.org>
356
357 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
358 aborting on Fsignal (Bug#13289).
359
6a9465f3
EZ
3602013-01-19 Eli Zaretskii <eliz@gnu.org>
361
362 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
363 set_file_security as failure due to insufficient privileges.
364 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 365 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 366
fa705c99
PE
3672013-01-19 Paul Eggert <eggert@cs.ucla.edu>
368
9fe43ff6
PE
369 Work around bug in CIFS and vboxsf file systems (Bug#13149).
370 The bug was observed on Ubuntu operating inside a virtual machine,
371 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
372 The workaround introduces a race condition on non-buggy hosts,
373 but it's an unlikely race and anyway there's a nearly identical
374 nearby race that can't be fixed.
375 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
376 New static vars.
377 (Fwrite_region): Test for file system time stamp bug.
378 (init_fileio): New function.
379 * lisp.h (init_fileio): Declare it.
380 * emacs.c (main): Call it.
381
fa705c99
PE
382 * fileio.c (Finsert_file_contents): Simplify new diagnostic
383 and make it more consistent with other stat-failure diagnostics.
384
e07469fa
DA
3852013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
386
387 Fix crash when inserting data from non-regular files. See
388 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
389 for the error description produced by valgrind.
390 * fileio.c (read_non_regular): Rename to read_contents.
391 Free Lisp_Save_Value object used to pass parameters.
392 (read_non_regular_quit): Rename to read_contents_quit.
393 (Finsert_file_contents): Redesign internal file reading loop to adjust
394 gap and end positions after each read and so help make_gap to work
395 properly. Do not signal an I/O error too early and so do not leave
396 not yet decoded characters in a buffer, which was the reason of
397 redisplay crash. Use list2 to build return value. Adjust comments.
398
67722112
PE
3992013-01-17 Paul Eggert <eggert@cs.ucla.edu>
400
401 Close a race when statting and reading files (Bug#13149).
402 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
403 This avoids a race if the file is renamed between stat and open.
404 This race is not the problem originally noted in Bug#13149;
405 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
406
468afbac
DA
4072013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
408
409 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
410 objects, related functions and macros.
411 (make_save_value): Adjust prototype.
412 (make_save_pointer): New prototype.
413 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
414 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
415 * alloc.c (format_save_value): Rename to make_save_value.
416 (make_save_pointer): New function.
417 (record_xmalloc): Use make_save_pointer.
418 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
419 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
420 Change users of make_save_value to make_save_pointer.
421 Likewise for format_save_value and make_save_value.
422
0e70695a
DA
4232013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
424
425 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
426 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
427 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
428 debugging stubs.
429
963ea40f
PE
4302013-01-15 Paul Eggert <eggert@cs.ucla.edu>
431
432 * alloc.c (free_save_value): Now static.
433
3346c1d0
DA
4342013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
435
436 * keymap.c (map_keymap_internal): Use format_save_value.
437 (map_keymap_char_table_item): Adjust accordingly.
438 * fileio.c (non_regular_fd, non_regular_inserted)
439 (non_regular_nbytes): Remove.
440 (Finsert_file_contents): Convert trytry to ptrdiff_t. Use
441 format_save_value to pass parameters to read_non_regular.
442 (read_non_regular): Use XSAVE_ macros to extract parameters.
443 Adjust comment.
444 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
445 format_save_value.
446 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
447
2b30549c
DA
4482013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
449
450 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
451 extraction from any Lisp_Save_Value slot. Add type checking.
452 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
453 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
454 * xselect.c: All users changed.
455
1b971ac1
DA
4562013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
457
458 Some convenient bits to deal with Lisp_Save_Values.
459 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
460 (allocate_misc): Remove prototype.
461 (format_save_value): New prototype.
462 * alloc.c (allocate_misc): Revert back to static.
463 (format_save_value): New function to build Lisp_Save_Value
464 object with the specified internal structure.
465 (make_save_value): Reimplement using format_save_value.
466 * editfns.c (save_excursion_save): Use format_save_value.
467 (save_excursion_restore): Use XSAVE_OBJECT.
468
c50cf2ea
PE
4692013-01-14 Paul Eggert <eggert@cs.ucla.edu>
470
471 Avoid needless casts with XSAVE_POINTER.
472 * alloc.c (mark_object) [GC_MARK_STACK]:
473 * dired.c (directory_files_internal_unwind):
474 * fileio.c (do_auto_save_unwind):
475 * gtkutil.c (pop_down_dialog):
476 * keymap.c (map_keymap_char_table_item):
477 * lread.c (load_unwind):
478 * nsmenu.m (pop_down_menu):
479 * print.c (print_object) [GC_MARK_STACK]:
480 * xfns.c (clean_up_file_dialog):
481 * xmenu.c (cleanup_widget_value_tree):
482 Omit casts between XSAVE_POINTER and a pointer type.
483
9d5a1260
DA
4842013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
485
486 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
487 * eval.c (eval_sub): Protect `form' from being GCed before its
488 car and cdr becomes protected with the backtrace entry.
489
73ebd38f
DA
4902013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
491
492 Make Lisp_Save_Value more versatile storage for up to four objects.
493 * lisp.h (toplevel): Enumeration to describe types of saved objects.
494 (struct Lisp_Save_Value): New layout. Adjust comments.
495 (XSAVE_POINTER): New macro.
496 (XSAVE_INTEGER): Likewise.
497 (allocate_misc): Add prototype.
498 (free_misc): Likewise.
499 * alloc.c (allocate_misc): Now global.
500 (free_misc): Likewise. Adjust comment.
501 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
502 (free_save_value): Likewise.
503 (mark_object): Likewise.
504 * editfns.c (save_excursion_save): Pack everything within
505 Lisp_Save_Value and so avoid xmalloc.
506 (save_excursion_restore): Adjust to match new layout. Use free_misc
507 because we do not allocate extra memory any more. Add eassert.
508 * print.c (print_object): New code to print Lisp_Save_Value. Do not
509 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
510 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
511 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
512 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
513
b826986f
JD
5142013-01-13 Jan Djärv <jan.h.d@swipnet.se>
515
516 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
517 (nsfont_draw): Remove disabling of LCD smoothing.
518 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 519 Bug#11484 with LCD smoothing on.
b826986f 520
c0511b57 5212013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 522
b6f960a0
PE
523 Fix SIGDANGER handlers, for AIX (Bug#13408).
524 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
525 Move handlers here from emacs.c; they were out of place.
526
616763d5
JD
5272013-01-11 Jan Djärv <jan.h.d@swipnet.se>
528
529 * xterm.c (syms_of_xterm): Adjust documentation for
530 scroll-bar-adjust-thumb-portion.
531
0b59090b 5322012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
533
534 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
535 determine whether scroll bar thumb size should be adjusted or
536 not. Use variable for MOTIF.
537
538 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
539 GTK.
540
7bc916b4
JD
5412013-01-13 Jan Djärv <jan.h.d@swipnet.se>
542
eac4d08f
JD
543 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
544 event is generated.
545 (doCommandBySelector:): Set processingCompose to NO.
546
7bc916b4
JD
547 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
548 Remove check for fkeys count > zero, block/unblock fixes the real bug.
549 (nsfont_list_family): Add block/unblock_input calls.
550 (nsfont_open): Move block_input earlier. Add unblock_input before early
551 return.
552 (nsfont_draw): Add block/unblock_input calls.
553
bdc9b756
PE
5542013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
555
556 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
557 for old_charpos and old_bytepos.
558
ee56a6dc
PE
5592013-01-12 Paul Eggert <eggert@cs.ucla.edu>
560
561 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
562 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
563 Clear tzvalbuf_in_environ if this workaround is in effect.
564 Problem and fix reported by Kazuhiro Ito.
565
9fc9a531
AH
5662013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
567
568 * insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
569 ambiguous doc string cross-reference(s).
570
571 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
572 doc string cross-reference(s).
573
574 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
575 string cross-reference(s).
576
6020559a
DA
5772013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
578
579 Avoid unnecessary byte position calculation for the gap movement.
580 Since all users of move_gap do CHAR_TO_BYTE for other purposes
581 anyway, all of them should use move_gap_both instead.
582 * lisp.h (move_gap): Remove prototype.
583 * insdel.c (move_gap): Remove.
584 (move_gap_both): Add eassert.
585 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
586 * xml.c (parse_region): Likewise.
587
b8956427
PE
5882013-01-11 Paul Eggert <eggert@cs.ucla.edu>
589
590 emacsclient -t should not suspend Emacs server (Bug#13387)
591 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
592 New functions.
593 * term.c (init_tty): Use them instead of rolling our own code.
594 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
595 switches from 'signal' to 'pthread_sigmask', which is safer in
596 multithreaded applications.
597 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
598 which has already arranged for that.
599 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
600 This is the main part of the bug fix.
601
0b59090b 6022013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
603
604 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
605 x_last_font_name (Bug#13403).
606
58cc0a01
DA
6072013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
608
609 Omit buffer_slot_type_mismatch and use generic predicates to enforce
610 the type of per-buffer values where appropriate.
611 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
612 predicate, which is how it's really used now. Adjust comment.
613 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
614 * buffer.c (buffer_slot_type_mismatch): Remove.
615 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
616 predicate. Adjust comment.
617 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
618 fill-column, left-margin, tab-width, buffer-saved-size,
619 left-margin-width, right-margin-width, left-fringe-width,
620 right-fringe-width, scroll-bar-width and buffer-display-count.
621 Use Qstringp for default-directory, buffer-file-name,
622 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
623 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
624 line-spacing.
625 * data.c (store_symval_forwarding): Adjust to call the predicate.
626
5104861e
JB
6272013-01-09 Juanma Barranquero <lekktu@gmail.com>
628
629 * w32.c (get_name_and_id, acl_set_file):
630 * w32term.c (w32fullscreen_hook): Remove unused local variables.
631
eefd7278
DA
6322013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
633
634 * lisp.h (make_gap_1): New prototype.
635 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
636 gap size values.
637 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
638 naming convention.
639 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 640 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
641 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
642 (make_gap_1): New function to adjust the gap of any buffer.
643 * coding.c (coding_alloc_by_making_gap): Use it.
644 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
645 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
646
073ca75b
JL
6472013-01-08 Juri Linkov <juri@jurta.org>
648
649 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
650 of (supports :underline (:style wave)). (Bug#13000)
651
3bace969
AH
6522013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
653
654 * undo.c (Fprimitive_undo): Move to simple.el.
655 (syms_of_undo): Remove declarations for Sprimitive_undo.
656
63a63bd4
SM
6572013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
658
659 * keyboard.c (echo_add_key): Rename from echo_add_char.
660
56ed110a
CY
6612013-01-06 Chong Yidong <cyd@gnu.org>
662
663 * keyboard.c (echo_add_char): New function, factored out from
664 echo_char. Don't add a space if the previous echo string was
665 empty (Bug#13255).
666 (echo_char): Use it.
667 (read_key_sequence): When echoing mock input, ensure that the
668 trailing dash is properly added.
669
b630991b
EZ
6702013-01-05 Eli Zaretskii <eliz@gnu.org>
671
672 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
673 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
674 digits for buffer positions, before misalignment starts.
675 Display "0" for integer "object" field.
b630991b
EZ
676 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
677 Display the newline glyph more unambiguously.
678
f032a318
YM
6792013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
680
681 * nsterm.m (ns_draw_underwave):
682 * w32term.c (w32_draw_underwave):
683 * xterm.c (x_draw_underwave): Make underwave look more triangular
684 and also degrade gracefully for small fonts. (Bug#13000)
685
4240dd3c
YM
686 * nsterm.m (ns_draw_text_decoration):
687 * w32term.c (x_draw_glyph_string):
688 * xterm.c (x_draw_glyph_string): Don't use previous underline
689 thickness and position if previous underline type is underwave.
690
553081a5
SM
6912013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
692
693 * fileio.c (Ffile_acl): Undocument return format.
694
9539d465 6952013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
696
697 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
698
71376d4b
PE
6992013-01-02 Paul Eggert <eggert@cs.ucla.edu>
700
701 Simplify via eabs.
702 * dired.c (file_name_completion):
703 * doc.c (get_doc_string):
704 * floatfns.c (round2):
705 * font.c (font_score, font_delete_unmatched):
706 * fringe.c (compute_fringe_widths):
707 * lread.c (read_list):
708 * minibuf.c (Ftry_completion):
709 * term.c (tty_ins_del_lines):
710 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
711 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
712
a7f11948
EZ
7132012-12-31 Eli Zaretskii <eliz@gnu.org>
714
715 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
716 correctly.
717 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
718 for the bug this caused.
719
84cc1ab6
PE
7202012-12-30 Paul Eggert <eggert@cs.ucla.edu>
721
722 * coding.c (Qmac): Now static.
723
5a1d858b
JD
7242012-12-30 Jan Djärv <jan.h.d@swipnet.se>
725
726 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
727 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
728 handlebox_widget. Set toolbar_in_hbox to false/true, set
729 toolbar_is_packed to true.
730 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
731 (update_frame_tool_bar): Check toolbar_is_packed for packing.
732 Show all on TOOLBAR_TOP_WIDGET.
733 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
734 by TOOLBAR_TOP_WIDGET.
735 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
736 Check toolbar_is_packed.
8b745d92
JD
737 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
738 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
739 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
740 false.
741 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
742 (xg_update_menubar): Update title only if
743 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
744 (xg_update_submenu): Skip tearoff only if
745 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
746 (xg_initialize): Initialize xg_detached_menus only if
747 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
748
749 * xterm.h (struct x_output): Surround handlebox_widget with
750 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
751 toolbar_in_hbox is bool.
752
d5e5e7b4 7532012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
754
755 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
756 (LIBS_GNUSTEP): Define.
757 (LIBES): Add $(LIBS_GNUSTEP).
758 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
759
d5e5e7b4 7602012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
761
762 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
763 continuation glyph on a TTY with an indication of an empty line.
764 (Bug#13277)
765
e7ae8039
EZ
7662012-12-29 Eli Zaretskii <eliz@gnu.org>
767
ccad023b
EZ
768 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
769 file's SELinux context or ACLs successfully set, nil otherwise.
770 (Bug#13298)
8d23a331 771 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 772
e7ae8039
EZ
773 * w32proc.c (reader_thread): Avoid passing NULL handles to
774 SetEvent and WaitForSingleObject.
775
7456e13f
PE
7762012-12-28 Paul Eggert <eggert@cs.ucla.edu>
777
778 Port EXTERNALLY_VISIBLE to Clang 3.2.
779 * conf_post.h (__has_attribute): New macro.
780 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
781
1ab0c851
GM
7822012-12-27 Glenn Morris <rgm@gnu.org>
783
784 * cygw32.c (Fcygwin_convert_file_name_to_windows)
785 (Fcygwin_convert_file_name_from_windows): Doc fixes.
786
82e2a1f0 7872012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 788
63a63bd4
SM
789 * fileio.c (file_name_as_directory, directory_file_name):
790 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
791 came from a multibyte or a unibyte Lisp string; all callers
792 adjusted. Don't assume the input string is always multibyte.
793 (Bug#13262)
794 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
795 don't ENCODE_FILE them, and return a unibyte string if the input
796 was unibyte.
797 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
798 don't assume the input strings will always be multibyte. If the
799 input strings are multibyte, decode strings obtained from C
800 library functions.
801
8847a0de
DA
8022012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
803
804 * lisp.h (toplevel): Add two notices to the comment about
805 defining a new Lisp data type.
6cda572a
DA
806 * print.c (print_object): If Lisp_Save_Value object's pointer
807 is the address of a memory area containing Lisp_Objects, try
808 to print them.
809 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 810
4b298d5a
DA
8112012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
812
813 * keyboard.c (record_asynch_buffer_change): Initialize an event
814 only if it's really needed.
815 * frame.h (enum output_method): Remove output_mac member since
816 it's a leftover from the deleted code.
817 * frame.c (Fframep): Adjust user here ...
818 * terminal.c (Fterminal_live_p): ... and here.
819 * coding.c (Qmac): Now here because it's only used to denote
820 end-of-line encoding type.
821 (syms_of_coding): DEFSYM it.
822 * frame.h (Qmac): Remove duplicated declaration.
823
12384b01
PE
8242012-12-26 Paul Eggert <eggert@cs.ucla.edu>
825
826 * window.c (select_window_1): Now static, since it's used only here.
827
f1665bdc
EZ
8282012-12-25 Eli Zaretskii <eliz@gnu.org>
829
830 * window.c (window_body_cols): Subtract display margins from the
831 window body width on TTYs as well. See
832 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
833 for the original report.
834
9a0d4f34
DA
8352012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
836
837 * xdisp.c (redisplay_window): Remove inner local variable
838 because the outer shadowed one has the same meaning.
cd78d9b1
DA
839 * xterm.h (struct x_output): Remove toolbar_detached member since it's
840 set but never used.
841 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
842 (xg_create_tool_bar): Adjust users.
9a0d4f34 843
f9e7c67e
DA
8442012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
845
846 * buffer.h (BUF_COMPACT): New macro to follow the common style.
847 * buffer.c (Fget_buffer_create): Use it to set compact field of
848 struct buffer_text to avoid accessing an uninitialized value
849 when compact_buffer is called for the first time.
850 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
851 (Fset_buffer_modified_p): Use buffer_window_count to check
852 whether the buffer is displayed in some window.
853 * xdisp.c (message_dolog): Likewise.
f9e7c67e 854
299614f3
EZ
8552012-12-23 Eli Zaretskii <eliz@gnu.org>
856
40ff07a5
EZ
857 * w32.c (acl_set_file): If setting the file security descriptor
858 fails, and the new DACL is identical to the existing one, silently
859 return success. This fixes problems for users backing up their
860 own files without having the necessary privileges for setting
861 security descriptors.
862
299614f3
EZ
863 * w32proc.c (reader_thread): Do not index fd_info[] with negative
864 values.
865 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
866 after WaitForSingleObject returns normally. This expedites reader
867 thread shutdown when delete_child triggers it.
868 (reap_subprocess): More accurate commentary for why we call
869 delete_child only when cp->fd is negative.
870
871 * w32.c (sys_close): Do not call delete_child on a subprocess
872 whose handle is not yet closed. Instead, set its file descriptor
873 to a negative value, so that reap_subprocess will call
63a63bd4
SM
874 delete_child on that subprocess when its SIGCHLD arrives.
875 This avoids closing handles used for communications between sys_select
299614f3
EZ
876 and reader_thread, which doesn't give sys_select a chance to
877 notice that the process exited and invoke the SIGCHLD handler for
878 it.
879
cf162aee
JD
8802012-12-23 Jan Djärv <jan.h.d@swipnet.se>
881
882 * nsfns.m (Fns_do_applescript): Run event loop until script has
883 been executed (Bug#12969).
884 (ns_run_ascript): Chech as_script for nil, set to nil after
885 executing script.
886
94900bfe
MR
8872012-12-22 Martin Rudalics <rudalics@gmx.at>
888
889 * window.c (Fselect_window): Reword doc-string (Bug#13248).
890
b2faf49c
EZ
8912012-12-22 Eli Zaretskii <eliz@gnu.org>
892
893 * w32term.c (w32fullscreen_hook): New function.
894 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
895
7efa3fb3
EZ
8962012-12-21 Eli Zaretskii <eliz@gnu.org>
897
bb085aed
EZ
898 * fileio.c (Finsert_file_contents): Doc fix.
899
7efa3fb3
EZ
900 * w32proc.c (new_child, delete_child, find_child_pid): For a
901 subprocess, consider its slot being in use as long as its process
902 handle (procinfo.hProcess) is not NULL. This avoids reusing the
903 slot when a new process is started immediately after killing
904 another one, without waiting enough time for the first process to
905 be reaped and resources allocated for it be orderly freed.
906 (Bug#13086)
907 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
908
c1f02afa
CY
9092012-12-21 Chong Yidong <cyd@gnu.org>
910
911 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
912
5bec25eb
CY
913 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
914
a4b0cca1 9152012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
916
917 * w32.c (get_name_and_id): Always pass NULL as the first argument
918 of lookup_account_sid. Avoids crashes with UNC file names that
919 refer to DFS domains, not to specific machine names. (Bug#12621)
920 Remove now unused argument FNAME; all callers changed.
921 (get_file_owner_and_group): Remove now unused argument FNAME; all
922 callers changed.
923
34b4b7eb
CY
9242012-12-21 Chong Yidong <cyd@gnu.org>
925
926 * editfns.c (Finsert_char): Since read-char-by-name now signals an
927 error for invalid chars, don't check for a nil return value.
928
13002885
DA
9292012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
930
931 Avoid calls to CHAR_TO_BYTE if byte position is known.
932 * editfns.c (make_buffer_string_both): Use move_gap_both.
933 (Fbuffer_string): Use make_buffer_string_both.
934 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
935 Adjust comment.
936 (buf_bytepos_to_charpos): Likewise.
937 (charpos_to_bytepos): Remove.
938 * fileio.c (Finsert_file_contents): Use move_gap_both.
939 * search.c (Freplace_match): Likewise.
9a0d4f34 940 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
941 names for byte positions.
942 * lisp.h (charpos_to_bytepos): Remove prototype.
943 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
944 * insdel.c (move_gap): Likewise.
945
99e9311c
PE
9462012-12-20 Paul Eggert <eggert@cs.ucla.edu>
947
948 * xdisp.c (redisplay_internal): Remove now-unused local.
949
e02230bf
SM
9502012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
951
952 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
953 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 954 proper value of frame-local variables (bug#13225).
e02230bf 955
1687fb14
DA
9562012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
957
958 * textprop.c (set_text_properties_1): Do not allow NULL interval.
959 Rename 4th argument since it may be buffer or string. Adjust comment.
960 * intervals.c (graft_intervals_info_buffer): Find an interval here.
961
a2f07cd2
DA
9622012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
963
964 * coding.c (Fdetect_coding_region): Do not check start and end with
965 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
966 (code_convert_region): Likewise.
967
474d441e
EZ
9682012-12-18 Eli Zaretskii <eliz@gnu.org>
969
970 * w32.c (acl_get_file, acl_set_file): Run the file name through
971 map_w32_filename, and resolve any symlinks in the file name, like
972 Posix platforms do.
973 (acl_set_file): Call revert_to_self, if any privileges were
974 enabled.
975
8725c076
JB
9762012-12-17 Juanma Barranquero <lekktu@gmail.com>
977
978 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
979 ($(BLD)/w32.$(O)): Update dependencies.
980
1e101a4b
SM
9812012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
982
983 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
984 propagate redisplay's scrolling (if any) to the right window.
985 (redisplay_internal): Use ensure_selected_frame.
986 (display_mode_lines): Complete last fix.
987 * window.c (select_window_1): New func, extracted from select_window.
988 (select_window): Use it.
989 * window.h (select_window_1): Declare.
990
66447e07
EZ
9912012-12-17 Eli Zaretskii <eliz@gnu.org>
992
993 Emulate Posix ACL APIs on MS-Windows.
994 * w32.c: Include sddl.h and sys/acl.h.
995 (SDDL_REVISION_1): Define if not already defined.
996 (g_b_init_get_security_descriptor_dacl)
997 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
998 (g_b_init_is_valid_security_descriptor)
999 (g_b_init_set_file_security): New static flags.
1000 (globals_of_w32): Initialize them to zero.
1001 (SetFileSecurity_Name): New string constant.
1002 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1003 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1004 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1005 (IsValidSecurityDescriptor_Proc): New typedefs.
1006 (get_file_security, get_security_descriptor_owner)
1007 (get_security_descriptor_group): Set errno to ENOTSUP.
1008 (set_file_security, get_security_descriptor_dacl)
1009 (is_valid_security_descriptor, convert_sd_to_sddl)
1010 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
1011 (acl_free, acl_get_file, acl_set_file): New functions.
1012
1013 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
1014
207a7ef0
PE
10152012-12-17 Paul Eggert <eggert@cs.ucla.edu>
1016
1017 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
1018 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
1019 for some of that bug's symptoms can now cause Emacs to abort.
1020 Remove the workaround.
1021 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
1022 The bug that caused SIGCHLD to get lost has been fixed, and the
1023 workaround for it can now cause Emacs to abort.
1024
17fdfc15
PE
10252012-12-16 Paul Eggert <eggert@cs.ucla.edu>
1026
1027 * sysdep.c (emacs_abort): Bump backtrace size to 40.
1028 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
1029 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1030
7c3d167f
RF
10312012-12-16 Romain Francoise <romain@orebokech.com>
1032
1033 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
1034 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 1035 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
1036 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
1037
1038 * Makefile.in (LIBACL_LIBS): New macro.
1039 (LIBES): Use it.
1040
7d80ea23
PE
10412012-12-15 Paul Eggert <eggert@cs.ucla.edu>
1042
1043 * fileio.c (internal_delete_file): Use bool for boolean.
1044
b0728617
EZ
10452012-12-15 Eli Zaretskii <eliz@gnu.org>
1046
1047 Fix bug #13079 on MS-Windows with temp files not being deleted.
1048 * w32.h (_child_process): New members input_file and
1049 pending_deletion.
1050 (register_child): First argument is now pid_t.
1051 (record_infile, record_pending_deletion): New prototypes.
1052
1053 * w32proc.c (new_child): Initialize input_file and
1054 pending_deletion members of the child.
1055 (delete_child): Delete the child's temporary input file, if any,
1056 that is pending deletion.
1057 (register_child): First argument is now pid_t.
1058 (record_infile, record_pending_deletion): New functions.
1059 (reap_subprocess): Fix a typo in DebPrint string.
1060 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
1061
1062 * fileio.c (internal_delete_file): Return an int again: non-zero
1063 if delete-file succeeds, zero otherwise.
1064
1065 * lisp.h (internal_delete_file): Adjust prototype.
1066
1067 * callproc.c (Fcall_process): Don't overwrite infile with result
1068 of DECODE_FILE.
1069 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
1070 asynchronous subprocess, record the name of the input file name,
1071 if any.
1072 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
1073 delete the file, record it as pending deletion when the subprocess
1074 exits.
1075
7e90af26
EZ
10762012-12-14 Eli Zaretskii <eliz@gnu.org>
1077
1078 * editfns.c [HAVE_PWD_H]: Include grp.h.
1079
1080 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
1081
97976f9f
PE
10822012-12-14 Paul Eggert <eggert@cs.ucla.edu>
1083
1084 Fix permissions bugs with setgid directories etc. (Bug#13125)
1085 * dired.c (Ffile_attributes): Return t as the 9th attribute,
1086 to mark it as a placeholder. The old value was often wrong.
1087 The only user of this attribute has been changed to use
1088 file-ownership-preserved-p instead, with its new group arg.
1089 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
1090
26ec1f49
SM
10912012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
1092
ad966fe7
SM
1093 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
1094 Keep selected_window and selected_frame in sync.
26ec1f49 1095
5c207910
EZ
10962012-12-14 Eli Zaretskii <eliz@gnu.org>
1097
1098 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
1099 try to get accurate owner and group information from NT file
1100 security APIs. This is to make most callers of 'stat' and
1101 'lstat', which don't need that information, much faster.
1102
26ec1f49
SM
1103 * dired.c (Ffile_attributes) [WINDOWSNT]:
1104 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
1105 owner and group information from 'lstat'.
1106
893f52d8
PE
11072012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1108
4c95c9a5
PE
1109 * fileio.c (Finsert_file_contents): Don't put tail into head area,
1110 as that confuses set-auto-coding, so insist on the head-read
1111 returning the full 1024 bytes. Let lseek compute the tail offset;
1112 less work for us. Do not ignore I/O errors when reading the tail.
1113
893f52d8
PE
1114 * xdisp.c: Minor style fixes.
1115 (init_iterator): Hoist assignment out of if-expression.
1116 (markpos_of_region): Callers now test for sign, not for -1.
1117
40d1e434
DA
11182012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
1119
1120 Minor redisplay optimization when the region length is zero.
1121 * xdisp.c (markpos_of_region): New function.
1122 (init_iterator): Do not highlight the region of zero length.
1123 (redisplay_window): Check whether the region is of non-zero length.
1124 (try_cursor_movement): Allow if the region length is zero.
1125 (try_window_reusing_current_matrix, try_window_id): Likewise.
1126
727f9739 11272012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
1128
1129 * search.c (search_buffer): Check the inverse translations of each
1130 character in pattern when the buffer being searched is unibyte.
1131 (Bug#13084)
1132
727f9739 11332012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
1134
1135 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
1136 files, fixing a regression from 24.2.
645c6a30 1137 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 1138
d20704ef
PE
11392012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1140
1141 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
1142 fstat shouldn't fail, and if it does fail copy-file should not proceed.
1143 Remove unnecessary S_ISLNK test, as (contra the comments) this
1144 function can't copy symlinks. Improve quality of error message
1145 when attempting to copy files that are neither regular files nor
1146 directories.
1147
2dd61a9b
DA
11482012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
1149
1150 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
1151 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
1152 * window.c (Frecenter):
1153 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
1154 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
1155
cc98b684
DC
11562012-12-12 Daniel Colascione <dancol@dancol.org>
1157
1e101a4b 1158 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
1159 the dumped Emacs is not a sparse file, greatly improving Cygwin
1160 "make bootstrap" performance.
1161
38e791fd
MA
11622012-12-11 Michael Albinus <michael.albinus@gmx.de>
1163
1164 * inotify.c (inotify_callback): Generate an Emacs event for every
1165 incoming inotify event.
1166
f9d1448f
EZ
11672012-12-11 Eli Zaretskii <eliz@gnu.org>
1168
1169 * xdisp.c (handle_face_prop): Fix logic of computing
1170 it->start_of_box_run_p.
1171 (append_space_for_newline): If the glyph row is R2L, reset the
1172 iterator's end_of_box_run_p flag before prepending the space glyph.
1173 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
1174 iterator's start_of_box_run_p flag before prepending the stretch.
1175 (append_glyph, produce_image_glyph, append_composite_glyph)
1176 (append_stretch_glyph, append_glyphless_glyph): Reverse the
1177 left_box_line_p and right_box_line_p flags of the glyph for R2L
1178 glyph rows. (Bug#13011)
1179
c6afe371
DA
11802012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1181
1182 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
1183 if changed buffer is not shown in a window.
1184 * insdel.c (prepare_to_modify_buffer): Likewise.
1185 * window.c (replace_buffer_in_windows_safely): Do nothing
1186 if buffer is not shown in a window.
1187 (Fforce_window_update): Likewise if string or buffer argument
1188 is passed.
1189
1b47babd
EZ
11902012-12-11 Eli Zaretskii <eliz@gnu.org>
1191
1192 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
1193 encoded_file_name, which is what it is.
1194
4c1acb95
DA
11952012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1196
1197 Consistently use marker_position and marker_byte_position.
1198 * fringe.c (Ffringe_bitmaps_at_pos):
1199 * indent.c (Fvertical_motion):
1200 * insdel.c (prepare_to_modify_buffer):
1201 * keyboard.c (make_lispy_position):
1202 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
1203 (window_scroll_pixel_based, displayed_window_lines)
1204 (Fset_window_configuration):
1205 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
1206 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
1207 Replace direct access to marker fields with calls
1208 to marker_position and/or marker_byte_position.
1209
0eeb69fe
JB
12102012-12-11 Juanma Barranquero <lekktu@gmail.com>
1211
1212 * makefile.w32-in (SIG2STR_H): New macro.
1213 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
1214 ($(BLD)/w32notify.$(O)): Update dependencies.
1215
1cf1bbd5
DC
12162012-12-10 Daniel Colascione <dancol@dancol.org>
1217
8db4b52f
DC
1218 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
1219 Windows file notification functionality unless WINDOWSNT.
1220
1cf1bbd5
DC
1221 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
1222 declarations.
1223
1224 * w32fns.c (cache_system_info): Initialize the global hinst
1225 variable here so various initialization calls DTRT.
1226
1e101a4b 1227 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
1228 (hinst): Remove unneeded extern declaration.
1229 (_start): Remove initialization of above variables; remove
1230 initialization of hinst, as cache_system_info now does that.
1231
1232 * emacs.c (main): Call cache_system_info early in startup; we
1233 previously weren't calling it in Cygwin builds.
1234
26ec1f49
SM
1235 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
1236 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
1237 and link it to Emacs.
1238
98a07056
DA
12392012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
1240
1241 Per-buffer window counters.
1242 * buffer.h (struct buffer): New member window_count.
1243 (buffer_window_count): New function.
1244 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1245 Initialize window_count.
1246 (Fkill_buffer): Verify window_count for the buffer being killed.
1247 (modify_overlay): Do not force redisplay if buffer is not shown
1248 in any window.
1249 (init_buffer_once): Initialize window_count for buffer_defaults
1250 and buffer_local_symbols.
1251 * window.h (buffer_shared): Remove declaration.
1252 (wset_buffer): Convert from inline ...
1253 * window.c (wset_buffer): ... to an ordinary function.
1254 (adjust_window_count): New function.
1255 (make_parent_window): Use it.
1256 * xdisp.c (buffer_shared): Remove.
1257 (redisplay_internal, redisplay_window): Adjust users.
1258 (buffer_shared_and_changed): Use per-buffer window counter.
1259
2b8c9064
EZ
12602012-12-10 Eli Zaretskii <eliz@gnu.org>
1261
1262 Support for filesystem notifications on MS-Windows.
1263 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
1264 and this is a TTY frame, signal the caller that keyboard input is
1265 available.
1266
1267 * w32xfns.c (drain_message_queue): Now returns an int: an
1268 indication whether any WM_EMACS_FILENOTIFY messages were found in
1269 the queue.
1270
1271 * w32inevt.c (handle_file_notifications): New function.
1272 (w32_console_read_socket): Call it to process file notifications.
1273
1274 * w32console.c (initialize_w32_display): Record the main thread ID
1275 in dwMainThreadId.
1276
1277 * deps.mk (inotify.o): New dependency list.
1278
1279 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
1280
1281 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
1282 (WM_EMACS_END): Bump value by 1.
1283 (notification_buffer_in_use, file_notifications)
1284 (notifications_size, notifications_desc): Declare.
1285 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
1286 Add prototypes.
1287
1288 * w32term.c (lispy_file_action, queue_notifications): New functions.
1289 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
1290 <Qrenamed_to>: New symbols.
1291 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
1292
1293 * w32notify.c: New file, implements file event notifications for
1294 MS-Windows.
1295
1296 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
1297 by posting it to the w32_read_socket queue.
1298
1e101a4b 1299 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
1300
1301 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
1302 (GLOBAL_SOURCES): Add w32notify.c
1303 ($(BLD)/w32notify.$(O)): New set of dependencies.
1304
1305 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
1306
1e101a4b
SM
1307 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
1308 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
1309 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
1310 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
1311 w32notify-handle-event by default.
1312
1313 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
1314 syms_of_w32notify.
1315
81606b10
RS
13162012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
1317
2b8c9064 1318 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 1319 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
1320
1321 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
1322
1323 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
1324 (syms_of_keyboard): DEFSYM it.
1325 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
1326 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
1327 Qfile_inotify events.
1328 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
1329 special-event-map to inotify-handle-event.
1330
1331 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
1332
1333 * Makefile.in (base_obj): Add inotify.o.
1334
1335 * inotify.c: New file.
1336
265c2fbf 13372012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
1338
1339 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
1340
265c2fbf 13412012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
1342
1343 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
1344 DWORD_PTR, for compatibility with 64-bit builds.
1345
a06ae17d 1346 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
1347 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
1348 (system_process_attributes): Use SIZE_T rather than DWORD, for
1349 compatibility with 64-bit builds.
1350
265c2fbf 13512012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
1352
1353 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
1354
265c2fbf 13552012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
1356
1357 * indent.c (Fvertical_motion): If a display string will be
1358 displayed on the left or the right margin, don't consider it as a
1359 factor in cursor positioning. (Bug#13108)
1360
265c2fbf 13612012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
1362
1363 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
1364
5f460827
PE
13652012-12-10 Paul Eggert <eggert@cs.ucla.edu>
1366
1367 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
1368 for string length.
1369
a16e75cd
EZ
13702012-12-08 Eli Zaretskii <eliz@gnu.org>
1371
1372 * w32.c (unsetenv): Return 0 if the input string is too long.
1373
5745a7df
PE
13742012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1375
1376 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
1377 * alloc.c (xputenv): New function.
1378 * dbusbind.c (Fdbus_init_bus):
1379 * emacs.c (main):
1380 * xterm.c (x_term_init):
1381 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
1382 * editfns.c (initial_tz): Move static var decl up.
1383 (tzvalbuf_in_environ): New static var.
1384 (init_editfns): Initialize these two static vars.
1385 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
1386 Save old TZ value on stack, if it's small.
1387 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
1388 instead, use xputenv+unsetenv to set and restore TZ.
1389 (environbuf): Remove static var. All uses removed.
1390 (Fset_time_zone_rule): Do not save TZ and environ;
1391 no longer needed here.
1392 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
1393 Move to inside set_time_zone_rule; they don't need file scope any more.
1394 (set_time_zone_rule): Maintain the TZ=value string separately.
1395 (syms_of_editfns): Don't initialize initial_tz;
1396 init_editfns now does it.
1397 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
1398 * lisp.h (xputenv): New decl.
1399
c56efa40
FP
14002012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
1401
1402 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
1403
75ceee05
EZ
14042012-12-08 Eli Zaretskii <eliz@gnu.org>
1405
1406 * w32.c (unsetenv, sys_putenv): New functions.
1407
1b6dbfeb
CY
14082012-12-08 Chong Yidong <cyd@gnu.org>
1409
1410 * editfns.c (Finsert_char): Make the error message more
1411 informative (Bug#12992).
1412
d983a10b
PE
14132012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1414
7be78020
PE
1415 Simplify get_lim_data.
1416 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
1417 Remove USG and vlimit methods; no longer used these days.
1418 Add #error catchall just in case.
1419
d983a10b
PE
1420 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
1421 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
1422 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
1423 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
1424 (deleted_pid_list, Fdelete_process, create_process)
1425 (record_child_status_change, handle_child_signal, deliver_child_signal)
1426 (init_process_emacs, syms_of_process):
1427 Assume SIGCHLD is defined.
1428 (parse_signal): Remove. All uses removed.
1429 (abbr_to_signal): New static function.
1430 (Fsignal_process): Use it to convert signal names to ints.
1431 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
1432 kill (getpgrp (), ...).
1433 (emacs_sigaction_init): Assume SIGCHLD is defined.
1434 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
1435 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
1436 * syssignal.h (EMACS_KILLPG): Remove.
1437 All uses replaced by 'kill' with a negative pid.
1438 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
1439 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
1440
9cdde1e2
PE
14412012-12-07 Paul Eggert <eggert@cs.ucla.edu>
1442
1443 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
1444 This will cause a production Emacs to dump core instead of
1445 infinite-looping.
1446
822995f8
DA
14472012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1448
1449 * frame.c (make_frame): Do not set window's buffer to t.
1450 * window.c (Fsplit_window_internal): Likewise. Previously it was
1451 used to indicate that the window is being set up. Now we use
1452 set_window_buffer for all new windows, so the condition in ...
1453 (Fset_window_buffer): ... is always true and can be removed.
1454
ed08365b
DA
14552012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1456
1457 Convenient macro to check whether the buffer is hidden.
1458 * buffer.h (BUFFER_HIDDEN_P): New macro.
1459 * frame.c (make_frame): Use it. Adjust comment.
1460 * buffer.c (candidate_buffer): New function.
1461 (Fother_buffer, other_buffer_safely): Use it.
1462
e86f5134
EZ
14632012-12-06 Eli Zaretskii <eliz@gnu.org>
1464
1465 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
1466 if the child process is still running. Instead, exit the wait
1467 loop and return zero. (Bug#13086)
1468
1700db3c
DA
14692012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1470
1471 * frame.h (x_char_width, x_char_height): Remove prototypes.
1472 * w32term.h (x_char_width, x_char_height): Likewise.
1473 * xfns.c (x_char_width, x_char_height): Remove.
1474 * w32fns.c (x_char_width, x_char_height): Likewise.
1475 * nsfns.c (x_char_width, x_char_height): Likewise.
1476 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
1477 all window frames.
1478 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
1479 * keyboard.c (command_loop_1): Remove prototype.
1480 (command_loop_2, top_level_1): Add static to match prototype.
1481
35fb8050
PE
14822012-12-06 Paul Eggert <eggert@cs.ucla.edu>
1483
1484 Fix a recently-introduced delete-process race condition.
1485 * callproc.c, process.h (record_kill_process):
1486 New function, containing part of the old call_process_kill.
1487 (call_process_kill): Use it.
1488 This does not change call_process_kill's behavior.
1489 * process.c (Fdelete_process): Use record_kill_process to fix a
1490 race condition that could cause Emacs to lose track of a child.
1491
565212e5
DA
14922012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1493
1494 Avoid code duplication between prev_frame and next_frame.
1495 * frame.c (candidate_frame): New function. Add comment.
1496 (prev_frame, next_frame): Use it. Adjust comment.
1497
d8ad4d3f 14982012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
1499
1500 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
1501 fails, signal an error instead of continuing with an empty
1502 string. (Bug#13079)
7c2fcf9b
EZ
1503 Encode expanded temp file pattern before passing it to mkstemp or
1504 mktemp.
d3cefd13 1505
2e7cddd3
EZ
1506 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
1507 Encode the file name before passing it to dostounix_filename, in
1508 case it will downcase it (under w32-downcase-file-names).
1509 (Bug#12933)
1510
644d3f0d
PE
15112012-12-05 Paul Eggert <eggert@cs.ucla.edu>
1512
1513 Minor call-process cleanups.
1514 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
1515 at the same time as other platforms, to simplify analysis.
1516 No need for fd0_volatile since we have synch_process_fd.
1517 Avoid needless emacs_close; arg is always negative.
1518
396376f1
AS
15192012-12-04 Andreas Schwab <schwab@linux-m68k.org>
1520
1521 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
1522 processes.
1523
350f51ad
DA
15242012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
1525
1526 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
1527 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
1528 and mouse_face_hidden members to a bitfields.
1529 * frame.h (struct frame): Remove set-but-not-used space_width member.
1530 (FRAME_SPACE_WIDTH): Remove.
1531 * nsterm.m, w32term.c, xterm.c: Adjust users.
1532 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
1533 member. Adjust users. Convert term_initted, delete_in_insert_mode,
1534 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
1535 members to a bitfields.
1536
bc9dbce6
PE
15372012-12-03 Paul Eggert <eggert@cs.ucla.edu>
1538
bb5f74ee
PE
1539 Don't let call-process be a zombie factory (Bug#12980).
1540 Fixing this bug required some cleanup of the signal-handling code.
1541 As a side effect, this change also fixes a longstanding rare race
1542 condition whereby Emacs could mistakenly kill unrelated processes,
1543 and it fixes a bug where a second C-g does not kill a recalcitrant
1544 synchronous process in GNU/Linux and similar platforms.
1545 The patch should also fix the last vestiges of Bug#9488,
1546 a bug which has mostly been fixed on the trunk by other changes.
1547 * callproc.c, process.h (synch_process_alive, synch_process_death)
1548 (synch_process_termsig, sync_process_retcode):
1549 Remove. All uses removed, to simplify analysis and so that
1550 less consing is done inside critical sections.
1551 * callproc.c (call_process_exited): Remove. All uses replaced
1552 with !synch_process_pid.
1553 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
1554 These take the role of what used to be in unwind-protect arg.
1555 All uses changed.
1556 (block_child_signal, unblock_child_signal):
1557 New functions, to avoid races that could kill innocent-victim processes.
1558 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
1559 (call_process_kill): Record killed processes as deleted, so that
1560 zombies do not clutter up the system. Do this inside a critical
1561 section, to avoid a race that would allow the clutter.
1562 (call_process_cleanup): Fix code so that the second C-g works again
1563 on common platforms such as GNU/Linux.
1564 (Fcall_process): Create the child process in a critical section,
1565 to fix a race condition. If creating an asynchronous process,
1566 record it as deleted so that zombies do not clutter up the system.
1567 Do unwind-protect for WINDOWSNT too, as that's simpler in the
1568 light of these changes. Omit unnecessary call to emacs_close
1569 before failure, as the unwind-protect code does that.
1570 * callproc.c (call_process_cleanup):
1571 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
1572 * process.c (record_deleted_pid): New function, containing
1573 code refactored out of Fdelete_process.
1574 (Fdelete_process): Use it.
1575 (process_status_retrieved): Remove. All callers changed to use
1576 child_status_change.
1577 (record_child_status_change): Remove, folding its contents into ...
1578 (handle_child_signal): ... this signal handler. Now, this
1579 function is purely a handler for SIGCHLD, and is not called after
1580 a synchronous waitpid returns; the synchronous code is moved to
1581 wait_for_termination. There is no need to worry about reaping
1582 more than one child now.
1583 * sysdep.c (get_child_status, child_status_changed): New functions.
1584 (wait_for_termination): Now takes int * status and bool
1585 interruptible arguments, too. Do not record child status change;
1586 that's now the caller's responsibility. All callers changed.
1587 Reimplement in terms of get_child_status.
1588 (wait_for_termination_1, interruptible_wait_for_termination):
1589 Remove. All callers changed to use wait_for_termination.
1590 * syswait.h: Include <stdbool.h>, for bool.
1591 (record_child_status_change, interruptible_wait_for_termination):
1592 Remove decls.
1593 (record_deleted_pid, child_status_changed): New decls.
1594 (wait_for_termination): Adjust to API changes noted above.
1595
bc9dbce6
PE
1596 * bytecode.c, lisp.h (Qbytecode): Remove.
1597 No longer needed after 2012-11-20 interactive-p changes.
1598
3cf3c607
EZ
15992012-12-03 Eli Zaretskii <eliz@gnu.org>
1600
1601 * xdisp.c (redisplay_window): If the cursor is visible, but inside
1602 the scroll margin, move point outside the margin. (Bug#13055)
1603
005c8d13
JD
16042012-12-03 Jan Djärv <jan.h.d@swipnet.se>
1605
1606 * gtkutil.c (my_log_handler): New function.
1607 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
1608
20edc1c9
DA
16092012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1610
1611 * lisp.h (modify_region): Rename to...
1612 (modify_region_1): ...new prototype.
1613 * textprop.c (modify_region): Now static. Adjust users.
1614 * insdel.c (modify_region): Rename to...
1615 (modify_region_1): ...new function to work with current buffer.
1616 Adjust comment and users. Use true and false for booleans.
1617
62c2e5ed
DA
16182012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1619
1620 * alloc.c (free_save_value): New function.
1621 (safe_alloca_unwind): Use it.
1622 * lisp.h (free_save_value): New prototype.
1623 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
1624 Add comment.
1625 (save_excursion_restore): Adjust to match saved data structure.
1626 Use free_save_value to offload some work from GC. Drop obsolete
1627 #if 0 code.
1628
c5bc2d1d 16292012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
1630
1631 * fileio.c (Vauto_save_list_file_name): Doc fix.
1632
c5bc2d1d 16332012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
1634
1635 * w32fns.c: Remove prototype of atof.
1e101a4b 1636 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 1637 builds.
1e101a4b 1638 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
1639
1640 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
1641 with 64-bit builds.
1642
1643 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1644 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
1645 defined.
1646
c5bc2d1d 16472012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 1648
a9de9f0c 1649 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 1650
21e54a94
PE
16512012-12-02 Paul Eggert <eggert@cs.ucla.edu>
1652
2dd2e622
PE
1653 Fix xpalloc confusion after memory is exhausted.
1654 * alloc.c (xpalloc): Comment fix.
1655 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
1656 and signals an error, do not clear charset_table_size, as
1657 charset_table is still valid.
1658 * doprnt.c (evxprintf): Clear *BUF after freeing it.
1659
21e54a94
PE
1660 Use execve to avoid need to munge environ (Bug#13054).
1661 * callproc.c (Fcall_process):
1662 * process.c (create_process):
1663 Don't save and restore environ; no longer needed.
1664 * callproc.c (child_setup):
1665 Use execve, not execvp, to preserve environ.
1666
3e5490f7
PE
16672012-12-01 Paul Eggert <eggert@cs.ucla.edu>
1668
1669 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
1670
75b4f59c
YM
16712012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1672
1673 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
1674 display for sliced images (Bug#10500).
1675
1676 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
1677
f8aff4c6
JB
16782012-11-30 Juanma Barranquero <lekktu@gmail.com>
1679
1680 * doc.c (Fdocumentation): Re-add handling of function-documentation,
1681 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
1682
3940b924
DA
16832012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
1684
1685 * xdisp.c (window_outdated): Remove eassert since it hits
1686 some suspicious corner cases (see Bug#13007 and Bug#13012).
1687 (mode_line_update_needed): New function.
1688 (redisplay_internal, redisplay_window): Use it.
1689 (ensure_selected_frame): New function.
1690 (redisplay_internal, unwind_redisplay): Use it.
1691 (redisplay_internal): Move comment about buffer_shared...
1692 (buffer_shared_and_changed): ...near to its real use.
1693
4a9204fe
PE
16942012-11-29 Paul Eggert <eggert@cs.ucla.edu>
1695
1696 * callproc.c (Fcall_process): Don't misreport vfork failure.
1697
60aeceb8
PE
16982012-11-28 Paul Eggert <eggert@cs.ucla.edu>
1699
1700 * callproc.c (Fcall_process): Fix vfork portability problems.
1701 Do not assume that fd[0], count, filefd, and save_environ survive
1702 vfork. Fix bug whereby wrong errno value could be reported for
1703 pipe failure. Some minor cleanups, too, as follows. Move buf and
1704 bufsize to the context where they're needed. Change new_argv to
1705 be of type char **, as this is more convenient and avoids casts.
1706 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
1707 Now local constants, not macros.
1708
00dc3ead
KH
17092012-11-18 Kenichi Handa <handa@gnu.org>
1710
1711 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
1712 for the variable "f".
1713
e1bf05c1
KH
17142012-11-13 Kenichi Handa <handa@gnu.org>
1715
1716 * font.c (font_unparse_xlfd): Exclude special characters from the
1717 generating XLFD name.
1718
22626a85
PE
17192012-11-27 Paul Eggert <eggert@cs.ucla.edu>
1720
350e0088
PE
1721 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
1722 * dired.c (stat_uname, stat_gname):
1723 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
1724
22626a85
PE
1725 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
1726 * dired.c (directory_files_internal, file_name_completion):
1727 Assume EAGAIN and EINTR are defined.
350e0088 1728
22626a85
PE
1729 * fileio.c (Fcopy_file): Assume EISDIR is defined.
1730 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
1731 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
1732 * lread.c (readbyte_from_file): Assume EINTR is defined.
1733 * process.c (wait_reading_process_output, send_process) [subprocesses]:
1734 Assume EIO and EAGAIN are defined.
1735 * unexcoff.c (write_segment): Assume EFAULT is defined.
1736
5c9cf0a3 17372012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
1738
1739 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
1740 (Bug#11964)
1741
22294a56
EZ
1742 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
1743 highlighting on the frame was cleared. Prevents assertion
1744 violations when repeatedly clicking on the "Top" link of the
1745 "bread-crumbs" in Info buffers.
1746
5fbab051
PE
17472012-11-25 Paul Eggert <eggert@cs.ucla.edu>
1748
1749 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
1750
bcd77a2b
KB
17512012-11-24 Ken Brown <kbrown@cornell.edu>
1752
1753 * keyboard.c (HAVE_MOUSE):
1754 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
1755 were always defined.
1756
d125ca15 17572012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 1758
24becea4
EZ
1759 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
1760 between bpos_covered and bpos_max. This fixes cursor display when
1761 several display strings follow each other.
1762
8654a41b
EZ
1763 * .gdbinit (pgx): If the glyph's object is a string, display the
1764 pointer to string data, rather than the value of the string object
1765 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
1766
cb5867b1
EZ
1767 * indent.c (Fvertical_motion): If the starting position is covered
1768 by a display string, return to one position before that, to avoid
1769 overshooting it inside move_it_to. (Bug#12930)
1770
f418b22e
DA
17712012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
1772
1773 * frame.h (struct frame): Remove display_preempted member
1774 since all users are dead long ago.
1775 * nsterm.h (struct x_output): Use the only dummy member.
1776 * w32menu.c (pending_menu_activation): Remove since not
1777 really used.
1778 (set_frame_menubar): Adjust user.
1779 * w32term.h (struct x_output): Drop outdated #if 0 code.
1780 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
1781 asked_for_visible and menubar_active members.
1782 Drop unused pending_menu_activation member.
f418b22e
DA
1783 * xterm.h (struct x_output): Drop outdated #if 0 code.
1784 Use bitfields for explicit_parent, asked_for_visible,
1785 has_been_visible and net_wm_state_hidden_seen members.
1786
a879f0ea
EZ
17872012-11-23 Eli Zaretskii <eliz@gnu.org>
1788
1789 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
1790 of a literal "/". (Bug#12955)
1791 (gl-stamp): Invoke fc.exe directly, not through cmd.
1792
95ef7787
PE
17932012-11-23 Paul Eggert <eggert@cs.ucla.edu>
1794
1795 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
1796 * dired.c: Assume HAVE_DIRENT_H.
1797 (NAMLEN): Remove, replacing with ...
1798 (dirent_namelen): New function. All uses changed. Use the GNU macro
1799 _D_EXACT_NAMELEN if available, as it's faster than strlen.
1800 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
1801 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
1802 * makefile.w32-in (DIR_H): Remove. All uses replaced with
1803 $(NT_INC)/dirent.h.
1804 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
1805 * ndir.h: Rename to ../nt/inc/dirent.h.
1806 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
1807 Do not include <dirent.h>; no longer needed.
1808 * w32.c: Include <dirent.h> rather than "ndir.h".
1809
12645ae6
CY
18102012-11-23 Chong Yidong <cyd@gnu.org>
1811
1812 * xftfont.c (xftfont_open): Remove duplicate assignment.
1813
5c747675
DA
18142012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1815
1816 * alloc.c (Fgarbage_collect): Unblock input after clearing
1817 gc_in_progress to avoid note_mouse_highlight glitch with GC.
1818 * frame.h (FRAME_MOUSE_UPDATE): New macro.
1819 * msdos.c (IT_frame_up_to_date): Use it here...
1820 * w32term.c (w32_frame_up_to_date): ...here...
1821 * xterm.c (XTframe_up_to_date): ...and here...
1822 * nsterm.m (ns_frame_up_to_date): ...but not here.
1823 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
1824 Adjust users.
1825 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
1826 Do not check whether GC is in progress.
1827
6ceeb5f1
DA
18282012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1829
1830 * xdisp.c (window_buffer_changed): New function.
1831 (update_menu_bar, update_tool_bar): Use it to
1832 simplify large 'if' statements.
1833 (redisplay_internal): Generalize commonly used
1834 'tail' and 'frame' local variables.
1835
ec84768f
EZ
18362012-11-22 Eli Zaretskii <eliz@gnu.org>
1837
1838 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
1839 with Windows system header.
1840
9239d970
PE
18412012-11-21 Paul Eggert <eggert@cs.ucla.edu>
1842
1843 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
1844 * alloc.c: Assume unistd.h exists.
1845 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
1846 * sysdep.c (get_current_dir_name): Assume getcwd exists.
1847 (getwd) [USG]: Remove; no longer needed.
1848 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
1849 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
1850 * w32.h (getcwd): Remove decl.
1851
954bba56
SM
18522012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
1853
1854 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
1855 Make it set selected_window as well.
1856 (update_tool_bar): Use it.
1857
6ef2e5ef 18582012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
1859
1860 * emacs.c (main): Set the G_SLICE environment variable for all
1861 Cygwin builds, not just GTK builds. See
1862 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
1863
6ef2e5ef 18642012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
1865
1866 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1867 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
1868 Define for the MSVC compiler.
1869
6ef2e5ef 1870 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
1871
1872 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
1873 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
1874 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
1875 dostounix_filename assumes it gets a unibyte string.
1876 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
1877 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
1878
eadf1faa
SM
18792012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1880
1881 Conflate Qnil and Qunbound for `symbol-function'.
1882 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
1883 * lread.c (init_obarray): Set `function' fields to Qnil.
1884 * eval.c (Fcommandp): Ignore Qunbound.
1885 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
1886 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
1887 Test NILP rather than Qunbound.
1888 (Ffmakunbound): Set to Qnil.
1889 (Fsymbol_function): Never signal an error.
1890 (Finteractive_form): Ignore Qunbound.
1891
b83fdfa9
PE
18922012-11-20 Paul Eggert <eggert@cs.ucla.edu>
1893
1894 * eval.c (interactive_p): Remove no-longer-used decl.
1895
952580c5
DA
18962012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
1897
1898 * xdisp.c (buffer_shared): Adjust comment.
1899 (buffer_shared_and_changed): New function.
1900 (prepare_menu_bars, redisplay_internal): Use it to
1901 decide whether all windows or frames should be updated.
ea6de9b1
DA
1902 (window_outdated): New function.
1903 (text_outside_line_unchanged_p, redisplay_window): Use it.
1904 (redisplay_internal): Likewise. Fix indentation.
952580c5 1905
23ba2705
SM
19062012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1907
1908 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
1909 (syms_of_eval): Remove corresponding defsubr.
1910 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
1911
6e9f7997
DC
19122012-11-19 Daniel Colascione <dancol@dancol.org>
1913
1914 * w32fns.c (Fx_file_dialog):
1915 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
1916 cygwin_convert_file_name*.
1917
1918 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
1919 Rename cygwin_convert_path* to cygwin_convert_file_name*.
1920
552a1590
PE
19212012-11-18 Paul Eggert <eggert@cs.ucla.edu>
1922
1923 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
1924
2ac9538d 19252012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
1926
1927 * w32select.c: Include w32common.h before w32term.h, so that
1928 windows.h gets included before w32term.h uses some of its
1929 features, see below.
1930
23ba2705
SM
1931 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
1932 New typedefs.
1933 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
1934 New prototypes.
d8715cdf
EZ
1935 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
1936
2ac9538d 19372012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
1938
1939 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
1940 (ns_select): Return at once if events are held (Bug#12834).
1941
2ac9538d 19422012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 1943
1944 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
1945 Needed following 2012-10-20 change. (Bug#12902)
1946
c1f7ba3a
JB
19472012-11-18 Juanma Barranquero <lekktu@gmail.com>
1948
1949 * w32proc.c (waitpid): Remove unused label get_result.
1950
a75ce9d3
JB
19512012-11-17 Juanma Barranquero <lekktu@gmail.com>
1952
1953 * makefile.w32-in (SYSWAIT_H): New macro.
1954 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
1955 ($(BLD)/sysdep.$(O)): Update dependencies.
1956
49cdacda
PE
19572012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1958
1959 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
1960 * callproc.c (relocate_fd): Assume F_DUPFD.
1961 * emacs.c, term.c (O_RDWR): Remove.
1962 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
1963 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
1964 * nsterm.m: Assume <fcntl.h> exists.
1965 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
1966 (create_pty, Fmake_network_process, server_accept_connection)
1967 (wait_reading_process_output, init_process_emacs):
1968 Assume O_NONBLOCK.
1969 (wait_reading_process_output): Put in a special case for WINDOWSNT
1970 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
1971 It's not clear this is needed, but it's a more-conservative change.
1972 (create_process): Assume FD_CLOEXEC.
1973 (create_process, create_pty): Assume O_NOCTTY.
1974 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
1975 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
1976 Omit if not DOS_NT, since F_GETFL is not defined there.
1977 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
1978 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
1979 (O_NOCTTY): Remove.
1980 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
1981 lack it, since gnulib guarantees this.
1982 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
1983
22bae83f
EZ
19842012-11-17 Eli Zaretskii <eliz@gnu.org>
1985
6ad30855
EZ
1986 * w32.c (faccessat): Pretend that directories have the execute bit
1987 set. Emacs expects that, e.g., in files.el:cd-absolute.
1988
22bae83f
EZ
1989 * w32proc.c (create_child): Don't clip the PID of the child
1990 process to fit into an Emacs integer, as this is no longer a
1991 restriction.
1992 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
1993 reaping only the process specified by PID argument, if that is
1994 positive. Use PID instead of dead_child to know which process to
1995 reap. Wait for the child to die only if WNOHANG is not in
1996 OPTIONS.
1997 (sys_select): Don't set dead_child.
1998
1999 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2000 as it is no longer needed.
2001
2002 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2003 no longer needed.
2004 (record_child_status_change): Remove the setting of
2005 record_at_most_one_child for the !WNOHANG case.
2006
a631d0e0
PE
20072012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2008
2009 Fix problems in ns port found by static checking.
2010 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
2011 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
2012 not to process group.
2013 (ns_select): Use emacs_write, not write, as that's more robust
2014 in the presence of signals.
2015 (fd_handler:): Check for read errors.
2016
d56f2e49
GM
20172012-11-16 Glenn Morris <rgm@gnu.org>
2018
2019 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
2020
96e05507 20212012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
2022
2023 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
2024
96e05507 20252012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
2026
2027 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
2028 use the same value of thread handle.
2029 (start_timer_thread): If the timer thread exited (due to error),
2030 clean up by closing the two handles it used. Duplicate the caller
2031 thread's handle here, so it gets duplicated only once, when
2032 launching the timer thread. Set priority of the timer thread, not
2033 the caller thread.
2034 (getitimer): Don't duplicate the caller thread's handle here.
2035 (Bug#12832)
2036
96e05507 20372012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
2038
2039 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
2040 called (Bug#12834).
2041
3d082a26
PE
20422012-11-16 Paul Eggert <eggert@cs.ucla.edu>
2043
2044 Remove no-longer-used pty_max_bytes variable.
2045 * process.c (pty_max_bytes): Remove; unused.
2046 (send_process): Do not set it.
2047
b72c161c
JB
20482012-11-15 Juanma Barranquero <lekktu@gmail.com>
2049
2050 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
2051 Update dependencies.
2052
bf20ea80
PE
20532012-11-15 Paul Eggert <eggert@cs.ucla.edu>
2054
2055 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
2056 This follows up on the 2012-09-29 patch that removed indirection
2057 for the 'function' field. Reported by Sergey Vinokurov in
2058 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
2059
14f20728
EZ
20602012-11-14 Eli Zaretskii <eliz@gnu.org>
2061
2062 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
2063 different name, as the MS runtime does not have such a function,
2064 and probably never will.) All callers changed. Ignore DIRFD
2065 value if PATH is an absolute file name, to match Posix spec
2066 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
2067 symlinks.
2068
77731919
DA
20692012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
2070
2071 * xdisp.c (echo_area_display, redisplay_internal):
2072 Omit redundant check whether frame_garbaged is set.
2073
73dcdb9f
PE
20742012-11-14 Paul Eggert <eggert@cs.ucla.edu>
2075
2076 Use faccessat, not access, when checking file permissions (Bug#12632).
2077 This fixes a bug that has been present in Emacs since its creation.
2078 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
2079 which must set some sort of record. (Torek's bug report was against
2080 a predecessor of GNU Emacs, but GNU Emacs happened to have the
2081 same common flaw.) See Torek's Usenet posting
2082 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
2083 Posted: Fri Apr 8 14:18:56 1983.
2084 * Makefile.in (LIB_EACCESS): New macro.
2085 (LIBES): Use it.
2086 * callproc.c (init_callproc):
2087 * charset.c (init_charset):
2088 * fileio.c (check_existing, check_executable, check_writable)
2089 (Ffile_readable_p):
2090 * lread.c (openp, load_path_check):
2091 * process.c (allocate_pty):
2092 * xrdb.c (file_p):
2093 Use effective UID when checking permissions, not real UID.
2094 * callproc.c (init_callproc):
2095 * charset.c (init_charset):
2096 * lread.c (load_path_check, init_lread):
2097 Test whether directories are accessible, not merely whether they exist.
2098 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
2099 * fileio.c (check_existing, check_executable, check_writable)
2100 (Ffile_readable_p):
2101 Use symbolic names instead of integers for the flags, as they're
2102 portable now.
2103 (check_writable): New arg AMODE. All uses changed.
2104 Set errno on failure.
2105 (Ffile_readable_p): Use faccessat, not stat + open + close.
2106 (Ffile_writable_p): No need to call check_existing + check_writable.
2107 Just call check_writable and then look at errno. This saves a syscall.
2108 dir should never be nil; replace an unnecessary runtime check
2109 with an eassert. When checking the parent directory of a nonexistent
2110 file, check that the directory is searchable as well as writable, as
2111 we can't create files in unsearchable directories.
2112 (file_directory_p): New function, which uses 'stat' on most platforms
2113 but faccessat with D_OK (for efficiency) if WINDOWSNT.
2114 (Ffile_directory_p, Fset_file_times): Use it.
2115 (file_accessible_directory_p): New function, which uses a single
2116 syscall for efficiency.
2117 (Ffile_accessible_directory_p): Use it.
2118 * xrdb.c (file_p): Use file_directory_p.
2119 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
2120 * lread.c (openp): When opening a file, use fstat rather than
2121 stat, as that avoids a permissions race. When not opening a file,
2122 use file_directory_p rather than stat.
2123 (dir_warning): First arg is now a usage string, not a format.
2124 Use errno. All uses changed.
2125 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
2126 that merely introduced a race.
2127 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
2128 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
2129 and similarly for the other O_* flags.
2130 * w32.c (sys_faccessat): Rename from sys_access and switch to
2131 faccessat's API. All uses changed.
2132 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
2133 (magic_db): Rename from magic_file_p.
2134 (magic_db, search_magic_path): Return an XrmDatabase rather than a
2135 char *, so that we don't have to test for file existence
2136 separately from opening the file for reading. This removes a race
2137 fixes a permission-checking problem, and simplifies the code.
2138 All uses changed.
2139 (file_p): Remove; no longer needed.
2140
2a14f83b
DA
21412012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
2142
2143 Omit glyphs initialization at startup.
2144 * dispnew.c (glyphs_initialized_initially_p): Remove.
2145 (adjust_frame_glyphs_initially): Likewise. Adjust users.
2146 (Fredraw_frame): Move actual code from here...
c7085245 2147 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
2148 (Fredraw_display): Use redraw_frame.
2149 * xdisp.c (clear_garbaged_frames): Likewise.
2150
f78ee6af 21512012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
2152
2153 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
2154 passed to pint2str and pint2hrstr to be at most the size of the
2155 frame's decode_mode_spec_buffer. This avoids crashes with very
2156 large values of FIELD_WIDTH argument to decode_mode_spec.
2157 (Bug#12867)
2158
b95a9c0c
PE
21592012-11-13 Paul Eggert <eggert@cs.ucla.edu>
2160
2161 Fix a race with verify-visited-file-modtime (Bug#12863).
2162 Since at least 1991 Emacs has ignored an mtime difference of no
2163 more than one second, but my guess is that this was to work around
2164 file system bugs that were fixed long ago. Since the race is
2165 causing problems now, let's remove that code.
2166 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
2167 whose time stamp is off by no more than a second. Insist that the
2168 file time stamps match exactly.
2169
be49ba74
DA
21702012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2171
2172 * frame.h (struct frame): Convert external_tool_bar member to
2173 1-bit unsigned bitfield.
2174 * termhooks.h (struct terminal): Remove mouse_moved member since
2175 all users are long dead. Adjust comment on mouse_position_hook.
2176
5b04e9f9
DA
21772012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2178
2179 Simplify by using FOR_EACH_FRAME here and there.
2180 * frame.c (next_frame, prev_frame, other_visible_frames)
2181 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
2182 * w32term.c (x_window_to_scroll_bar): Likewise.
2183 * window.c (window_list): Likewise.
2184 * xdisp.c (x_consider_frame_title): Likewise.
2185 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
2186 * xfns.c (x_window_to_frame, x_any_window_to_frame)
2187 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
2188 * xmenu.c (menubar_id_to_frame): Likewise.
2189 * xselect.c (frame_for_x_selection): Likewise.
2190 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
2191 (x_window_to_menu_bar): Likewise.
2192 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
2193
76ae24d7
PE
21942012-11-12 Paul Eggert <eggert@cs.ucla.edu>
2195
12cc4337
PE
2196 * data.c (Qdefalias_fset_function): Now static.
2197
76ae24d7
PE
2198 Another tweak to vectorlike_header change.
2199 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
2200 Remove, and replace all uses with ...
2201 (next_in_free_list, set_next_in_free_list):
2202 New functions, which respect C's aliasing rules better.
2203
1479c557
PE
22042012-11-11 Paul Eggert <eggert@cs.ucla.edu>
2205
2206 * window.c (list4i): Rename from 'quad'. All uses changed.
2207 Needed because <sys/types.h> defines 'quad' on Solaris 10.
2208
11235c03
JB
22092012-11-11 Juanma Barranquero <lekktu@gmail.com>
2210
2211 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
2212 warning about mixing declarations and code in ISO C90.
2213
6baf66d5 22142012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
2215
2216 * window.c (Fsplit_window_internal): Set combination limit of
2217 new parent window to t iff Vwindow_combination_limit is t;
2218 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 2219 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 2220
6baf66d5 22212012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
2222
2223 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
2224 amount when the scroll margins are too large. When scrolling
2225 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
2226 scroll margin within a reasonable number of screen lines.
2227 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
2228 point is positioned many lines beyond the window top/bottom.
2229 (Bug#12811)
2230
508f51f5
EZ
2231 * ralloc.c (relinquish): If real_morecore fails to return memory
2232 to the system, don't crash; instead, leave the last heap
2233 unchanged and return. (Bug#12774)
2234
32e5c58c
SM
22352012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2236
2237 * lisp.h (AUTOLOADP): New macro.
2238 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
2239 * data.c (Ffset): Remove special ad-advice-info handling.
2240 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
2241 (Fsubr_arity): CSE.
2242 (Finteractive_form): Simplify.
2243 (Fquo): Don't insist on having at least 2 arguments.
2244 (Qdefalias_fset_function): New var.
2245
719b0aa5
JD
22462012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2247
4ab15c3e
JD
2248 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
2249
719b0aa5
JD
2250 * nsfont.m (Qcondensed, Qexpanded): New variables.
2251 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
2252 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
2253
535cc8e9
DA
22542012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2255
2256 Fix recently introduced crash on MS-Windows (Bug#12839).
2257 * w32term.h (struct scroll_bar): Use convenient header.
2258 (SCROLL_BAR_VEC_SIZE): Remove.
2259 * w32term.c (x_scroll_bar_create): Use VECSIZE.
2260
7d377c48
DA
22612012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2262
2263 Tweak last vectorlike_header change.
2264 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
2265 vectorlike object on the free list. This is introduced to avoid
2266 some (but not all) pointer casting and aliasing problems, see
2267 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
2268 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
2269 objects.
2270 (xvectype, xvecsize): Use them to examine Lisp_Object values.
2271
7ad27466
JD
22722012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2273
32e5c58c 2274 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
2275 been removed, so remove them here also.
2276
57618ecf
SM
22772012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2278
2279 * doc.c (Fdocumentation): Handle new property
2280 dynamic-docstring-function to replace the old ad-advice-info.
2281
53371430
PE
22822012-11-09 Paul Eggert <eggert@cs.ucla.edu>
2283
2284 * fns.c (Qeql, hashtest_eq): Now static.
2285
61ddb1b9
SM
22862012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2287
2288 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
2289 * fns.c (hashfn_eq, hashfn_eql, sxhash):
2290 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
2291 * buffer.c (compare_overlays): Use XLI rather than XHASH.
2292
04a2d0d3
PE
22932012-11-08 Paul Eggert <eggert@cs.ucla.edu>
2294
2295 Use same hash function for hashfn_profiler as for hash_string etc.
2296 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
2297 * lisp.h (sxhash_combine): New inline function, with the contents
2298 of the old SXHASH_COMBINE.
2299 * profiler.c (hashfn_profiler): Use it, instead of having a
2300 special hash function containing a comparison that always yields 1.
2301
de5ef41a
SM
23022012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2303
2304 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
2305 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
2306 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
2307 Remove unused vars.
2308
a23c4171
JD
23092012-11-08 Jan Djärv <jan.h.d@swipnet.se>
2310
2311 * image.c (xpm_make_color_table_h): Fix compiler error because
2312 make_hash_table changed.
2313
0b59090b 23142012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
2315
2316 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
2317
b7432bb2
SM
23182012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2319
2320 Use ad-hoc comparison function for the profiler's hash-tables.
2321 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
2322 (make_log): Use them.
2323 (handle_profiler_signal): Don't inhibit quit any longer since we don't
2324 call Fequal any more.
2325 (Ffunction_equal): New function.
2326 (cmpfn_profiler, hashfn_profiler): New functions.
2327 (syms_of_profiler): Initialize them.
2328 * lisp.h (struct hash_table_test): New struct.
2329 (struct Lisp_Hash_Table): Use it.
2330 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
2331 * fns.c (make_hash_table): Take a struct to describe the test.
2332 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
2333 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
2334 (hash_lookup, hash_remove_from_table): Move assertion checking of
2335 hashfn result here. Check hash-equality before calling cmpfn.
2336 (Fmake_hash_table): Adjust call to make_hash_table.
2337 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
2338 (syms_of_fns): Initialize them.
2339 * emacs.c (main): Move syms_of_fns earlier.
2340 * xterm.c (syms_of_xterm):
2341 * category.c (hash_get_category_set): Adjust call to make_hash_table.
2342 * print.c (print_object): Adjust to new hash-table struct.
2343 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
2344
88002743
EZ
23452012-11-08 Eli Zaretskii <eliz@gnu.org>
2346
2347 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
2348 value of w32-scroll-lock-modifier is neither nil nor one of the
2349 known key modifiers. (Bug#12806)
2350
914adc42
DA
23512012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2352
2353 Shrink struct vectorlike_header to the only size field.
2354 * lisp.h (enum pvec_type): Avoid explicit enum member values.
2355 Adjust comment.
2356 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
2357 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
2358 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
2359 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
2360 information from the vector header. Adjust comment.
2361 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
2362 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
2363 layout.
2364 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
2365 (struct vectorlike_header): Remove next member. Adjust comment.
2366 (struct Lisp_Subr): Add convenient header. Adjust comment.
2367 (allocate_pseudovector): Adjust prototype.
2368 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
2369 (sweep_string, lisp_malloc): Remove useless prototypes.
2370 (enum mem_type): Adjust comment.
2371 (NEXT_IN_FREE_LIST): New macro.
2372 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
2373 (Fmake_bool_vector): Likewise.
2374 (struct large_vector): New type to represent allocation unit for
2375 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
2376 (large_vectors): Change type to struct large_vector.
2377 (allocate_vector_from_block): Simplify.
2378 (PSEUDOVECTOR_NBYTES): Replace with...
2379 (vector_nbytes): ...new function. Adjust users.
2380 (sweep_vectors): Adjust processing of large vectors.
2381 (allocate_vectorlike): Likewise.
2382 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
2383 Add easserts. Adjust XSETPVECTYPESIZE usage.
2384 (allocate_buffer): Use BUFFER_PVEC_INIT.
2385 (live_vector_p): Adjust to match large vector.
2386 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
2387 * buffer.h (struct buffer): Add next member.
2388 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
2389 New macros.
2390 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
2391 * fns.c (internal_equal): Adjust to match enum pvec_type change.
2392 (copy_hash_table): Adjust to match vector header change.
2393 * lread.c (defsubr): Use XSETPVECTYPE.
2394 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
2395 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
2396 (xvecsize): New command.
2397
c66f21ea
DA
23982012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2399
2400 * keyboard.c (event_to_kboard): Do not dereference
2401 frame_or_window field of SELECTION_REQUEST_EVENT
2402 and SELECTION_CLEAR_EVENT events (Bug#12814).
2403 * xterm.h (struct selection_input_event): Adjust comment.
2404
eb147960
EZ
24052012-11-07 Eli Zaretskii <eliz@gnu.org>
2406
dab72075
EZ
2407 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
2408 such as Scroll Lock, if the respective keys are treated as
2409 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 2410 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 2411
5890e400
DA
24122012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
2413
2414 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
2415
b6b3b294
PE
24162012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2417
2418 Restore some duplicate definitions (Bug#12814).
2419 This undoes part of the 2012-11-03 changes. Some people build
2420 with plain -g rather than with -g3, and they need the duplicate
2421 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
2422 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
2423 Define as macros, as well as as enums or as constants.
2424
e770aad5
JD
24252012-11-06 Jan Djärv <jan.h.d@swipnet.se>
2426
2427 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
2428 to keypad keys (Bug#12816).
2429
68f8f1c0
PE
24302012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2431
2432 Minor adjustments of recently-changed frame functions.
2433 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
2434 known to be a frame (we're in the FRAMEP branch).
2435 * lisp.h (Qframep): Remove decl. frame.h declares this.
2436 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
2437 since they're meant for Lisp fixnum values.
2438
72f94d4b
DA
24392012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2440
2441 * window.c (Fwindow_combination_limit): Revert to the only
2442 required argument and adjust docstring as suggested in
2443 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
2444 by Martin Rudalics <rudalics@gmx.at>.
2445
d9f07150
DA
24462012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2447
2448 Widely used frame validity and checking functions.
2449 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
2450 * frame.c (decode_live_frame, decode_any_frame): New functions.
2451 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
2452 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
2453 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
2454 (Fframe_pointer_visible_p): Use decode_any_frame.
2455 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
2456 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
2457 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
2458 (Fframe_focus): Likewise. Allow zero number of arguments.
2459 Adjust docstring.
2460 (frame_buffer_list, frame_buffer_predicate): Remove.
2461 * lisp.h (frame_buffer_predicate): Remove prototype.
2462 * buffer.c (Fother_buffer): Use decode_any_frame.
2463 * xdisp.c (Ftool_bar_lines_needed): Likewise.
2464 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
2465 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
2466 (Fclose_font, Ffont_info): Use decode_live_frame.
2467 * fontset.c (check_fontset_name): Likewise.
2468 * terminal.c (Fframe_terminal): Likewise.
2469 * w32fns.c (check_x_frame): Likewise.
2470 * window.c (Fminibuffer_window, Fwindow_at)
2471 (Fcurrent_window_configuration): Likewise.
2472 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
2473 Likewise. Allow zero number of arguments. Adjust docstring.
2474 * dispnew.c (Fredraw_frame): Likewise.
2475 * xfaces.c (frame_or_selected_frame): Remove.
2476 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
2477 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
2478 (Fframe_face_alist): Use decode_live_frame.
2479 * xfns.c (check_x_frame): Likewise.
2480
89bc0592
DA
24812012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2482
2483 * window.c (quad): New function.
2484 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
2485 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
2486 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
2487 (Fwindow_line_height): Use it.
2488 (Fwindow_fringes): Use list3.
2489 (Fwindow_scroll_bars): Use list4.
2490 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
2491 (Fwindow_combination_limit): Allow zero number of arguments.
2492
c8e3a9c3
EZ
24932012-11-05 Eli Zaretskii <eliz@gnu.org>
2494
2495 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
2496
8e2417bf 2497 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 2498 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 2499 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 2500
209c6a58
CY
25012012-11-05 Chong Yidong <cyd@gnu.org>
2502
2503 * process.c (wait_reading_process_output): Revert previous change.
2504
8148369c
PE
25052012-11-05 Paul Eggert <eggert@cs.ucla.edu>
2506
dd0333b6
PE
2507 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
2508 This removes code that has been obsolete since around 1990.
2509 * callproc.c (Fcall_process):
2510 * emacs.c (main):
2511 * process.c (create_process):
2512 * term.c (dissociate_if_controlling_tty):
2513 Assume setsid exists.
2514 * callproc.c (child_setup): Assume setpgid exists and behaves as
2515 per POSIX.1-1988 or later.
2516 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
2517 * emacs.c (shut_down_emacs):
2518 * sysdep.c (sys_suspend, init_foreground_group):
2519 Assume getpgrp behaves as per POSIX.1-1998 or later.
2520 * msdos.c (setpgrp): Remove.
2521 (tcgetpgrp, setpgid, setsid): New functions.
2522 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
2523 * term.c (no_controlling_tty): Remove; unused.
2524 * w32proc.c (setpgrp): Remove.
2525 (setsid, tcgetpgrp): New functions.
2526
8148369c
PE
2527 Simplify by assuming __fpending.
2528 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
2529 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
2530 Do not assume that __fpending's result fits in int.
2531
76abf5e5
PE
25322012-11-04 Paul Eggert <eggert@cs.ucla.edu>
2533
06b63c9b
PE
2534 Remove EMACS_OUTQSIZE+sleep hack.
2535 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
2536 than 2400 bps, which throttled Emacs by having it sleep.
2537 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
2538 was added, and anyway those old terminals are long dead.
2539 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
2540 without the dispnew.c change, as dispnew.c doesn't include systty.h.
2541
76abf5e5
PE
2542 Fix data-loss with --version (Bug#9574).
2543 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
2544 as we can't assume that emacs_strerror is initialized, and strerror
2545 is good enough here.
2546 (main): Invoke atexit earlier, to catch earlier instances of
2547 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
2548
8f31e74b
MM
25492012-11-04 Michael Marchionna <tralfaz@pacbell.net>
2550
2551 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
2552 (keyDown): Remap keypad keys to X11 virtual key codes.
2553
0d879dca
PE
25542012-11-03 Paul Eggert <eggert@cs.ucla.edu>
2555
7ccfb720
PE
2556 Fix data-loss with --batch (Bug#9574).
2557 * emacs.c: Include <close-stream.h>.
2558 (close_output_streams): New function.
2559 (main): Pass it to atexit, so that Emacs closes stdout and stderr
2560 and handles errors appropriately.
2561 (Fkill_emacs): Don't worry about flushing, as close_output_stream
2562 does that now.
2563
0b3d4a47
PE
2564 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
2565 The symptom is a diagnostic "GLib-WARNING **: In call to
2566 g_spawn_sync(), exit status of a child process was requested but
2567 SIGCHLD action was set to SIG_IGN and ECHILD was received by
2568 waitpid(), so exit status can't be returned." The diagnostic
2569 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
2570 The real bug is a race condition between Emacs and glib: Emacs
2571 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
2572 so that glib can't find it. Work around the bug by invoking
2573 waitpid only on subprocesses that Emacs itself creates.
2574 * process.c (create_process, record_child_status_change):
2575 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
2576 know the pid rather than having the callee infer it.
2577 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
2578 (create_process): Set new 'alive' member if child is created.
2579 (process_status_retrieved): New function.
2580 (record_child_status_change): Use it.
2581 Accept negative 1st argument, which means to wait for the
2582 processes that Emacs already knows about. Move special-case code
2583 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
2584 processes that have already been waited for, by testing and
2585 clearing new 'alive' member.
2586 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
2587 now does this internally.
2588 (handle_child_signal): Let record_child_status_change do all
2589 the work, since we do not want to reap all exited child processes,
2590 only the child processes that Emacs itself created.
2591 * process.h (Lisp_Process): New boolean member 'alive'.
2592
0d879dca
PE
2593 Omit duplicate definitions no longer needed with gcc -g3.
2594 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
2595 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
2596 Define only as macros. There's no longer any need to also define
2597 these symbols as enums or as constants, since we now assume
2598 gcc -g3 when debugging.
2599
3478f4b5
EZ
26002012-11-03 Eli Zaretskii <eliz@gnu.org>
2601
2602 * lisp.mk: Adjust comments to the fact that term/internal is now
2603 loaded from loadup.el.
2604
2605 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
2606 (msdos_fatal_signal): New function.
2607 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
2608 its argument list.
2609
2610 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
2611 for GCC versions before 4.
2612 (emacs_raise): Define to call msdos_fatal_signal.
2613
2614 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
2615 iterator when starting in the middle of a display or overlay
2616 string. (Bug#12745)
2617
85fabcb7
CY
26182012-11-03 Chong Yidong <cyd@gnu.org>
2619
2620 * process.c (wait_reading_process_output): Clean up the last
2621 change.
2622
893cc455
CY
26232012-11-03 Jim Paris <jim@jtan.com> (tiny change)
2624
2625 * process.c (wait_reading_process_output): Avoid a race condition
2626 with SIGIO delivery (Bug#11536).
2627
0f7b074f
CY
26282012-11-03 Chong Yidong <cyd@gnu.org>
2629
2630 * buffer.c (cursor_type): Untabify docstring.
2631
3737fee7
DA
26322012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2633
2634 * frame.h (struct frame): Drop can_have_scroll_bars member
2635 which is meaningless for a long time. Adjust comments.
2636 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
2637 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
2638
b6a9e8b1
DA
26392012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2640
2641 * window.c (decode_next_window_args): Update window arg after
2642 calling decode_live_window and so fix crash reported at
2643 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
2644 by Juanma Barranquero <lekktu@gmail.com>.
2645 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
2646 * font.c (Ffont_at): Likewise.
2647
600d4768
JD
26482012-11-01 Jan Djärv <jan.h.d@swipnet.se>
2649
2650 * widget.c (resize_cb): New function.
2651 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
2652 (EmacsFrameResize): Check if all is up to date before changing frame
2653 size.
2654
1005b4b9
EZ
26552012-11-02 Eli Zaretskii <eliz@gnu.org>
2656
2657 Implement backtrace output for fatal errors on MS-Windows.
2658 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
2659 (BACKTRACE_LIMIT_MAX): New macro.
2660 (w32_backtrace): New function.
2661 (emacs_abort): Use w32_backtrace when the user chooses not to
2662 attach a debugger. Update the text of the abort dialog.
2663
b9e9df47
DA
26642012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2665
2666 Window-related stuff cleanup here and there.
2667 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
2668 Use decode_any_window.
2669 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
2670 * xdisp.c (Fformat_mode_line): Likewise.
2671 * font.c (Ffont_at): Use decode_live_window.
2672 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
2673 * window.c (decode_next_window_args): Likewise.
2674 (decode_any_window): Remove static.
2675 * window.h (decode_any_window): Add prototype.
2676 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
2677 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
2678 respectively.
2679
2b371ff7
DA
26802012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2681
2682 Remove pad from struct input_event.
2683 * termhooks.h (struct input_event): Remove padding field.
2684 Adjust comment.
2685 * keyboard.c (event_to_kboard): Simplify because frame_or_window
2686 member is never cons for a long time. Adjust comment.
2687 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
2688 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
2689 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
2690 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
2691
7e8b50d9
EZ
26922012-11-01 Eli Zaretskii <eliz@gnu.org>
2693
2694 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
2695
322aea6d
PE
26962012-10-31 Paul Eggert <eggert@cs.ucla.edu>
2697
2698 Fix crash when using Emacs as commit editor for git (Bug#12697).
2699 * callproc.c (setpgrp): Remove macro, as we now use setpgid
2700 and it is configured in conf_post.h.
2701 (Fcall_process): Don't invoke both setsid and setpgid; the former
2702 is enough, if it exists.
2703 * callproc.c (Fcall_process, child_setup):
2704 * process.c (create_process): Use setpgid.
2705 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
2706 for the real thing.
2707 * dispnew.c (init_display): Initialize the foreground group
2708 if we are running a tty display.
2709 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
2710 * lisp.h (init_foreground_group): New decl.
2711 * sysdep.c (inherited_pgroup): New static var.
2712 (init_foreground_group, tcsetpgrp_without_stopping)
2713 (narrow_foreground_group, widen_foreground_group): New functions.
2714 (init_sys_modes): Narrow foreground group.
2715 (reset_sys_modes): Widen foreground group.
2716
220cb2bd
MA
27172012-10-31 Michael Albinus <michael.albinus@gmx.de>
2718
2719 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
2720
218e997a
MR
27212012-10-31 Martin Rudalics <rudalics@gmx.at>
2722
2723 * minibuf.c (read_minibuf): Restore current buffer since
2724 choose_minibuf_frame calling Fset_frame_selected_window may
2725 change it (Bug#12766).
2726
02615da0
JD
27272012-10-30 Jan Djärv <jan.h.d@swipnet.se>
2728
2729 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
2730
aee5b18e
KH
27312012-10-30 Kenichi Handa <handa@gnu.org>
2732
2733 * font.c (Ffont_at): If WINDOW is specified and it is not
2734 displaying the current buffer, signal an error.
2735
ba116008
DC
27362012-10-29 Daniel Colascione <dancol@dancol.org>
2737
de5ef41a
SM
2738 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
2739 In preparation for fixing bug#12739, move these functions from
ba116008
DC
2740 here...
2741
2742 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
2743 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
2744 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 2745
640bf8ad
EZ
27462012-10-28 Eli Zaretskii <eliz@gnu.org>
2747
2748 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
2749 (timer_loop, getitimer, setitimer): Use it instead of
2750 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
2751 'clock'.
2752 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
2753 literal 10000.
2754
64ccff5f
JD
27552012-10-28 Jan Djärv <jan.h.d@swipnet.se>
2756
2757 * nsterm.m (NO_APPDEFINED_DATA): New define.
2758 (last_appdefined_event_data): New variable
2759 (last_appdefined_event): Remove.
2760 (ns_select): Initialize t from last_appdefined_event_data instead
2761 of [last_appdefined_event data1].
2762 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
2763 remove last_appdefined_event (Bug#12698).
2764
e483264c
SM
27652012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2766
2767 * frame.c (x_set_font): Catch internal error.
2768
6c16c13e
EZ
27692012-10-27 Eli Zaretskii <eliz@gnu.org>
2770
e483264c
SM
2771 Avoid overflow in w32 implementation of interval timers.
2772 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
2773 actually executes.
2774 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
2775 'volatile ULONGLONG' types. All the other data which was
2776 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
2777 (GetThreadTimes_Proc): New typedef.
2778 (w32_get_timer_time): New function, returns a suitable time value
2779 for the timer.
2780 (timer_loop): Enter critical section when accessing ULONGLONG
2781 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
2782 atomic. Call 'w32_get_timer_time' instead of 'clock'.
2783 Remove unused variable.
6c16c13e
EZ
2784 (init_timers): Initialize s_pfn_Get_Thread_Times.
2785 (start_timer_thread): Don't assign itimer->caller_thread here.
2786 (getitimer): Assign itimer->caller_thread here.
2787 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 2788 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 2789
ccc83f50
EZ
27902012-10-26 Eli Zaretskii <eliz@gnu.org>
2791
2792 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
2793 mouse movement events if the menu bar is active. This avoids
2794 producing a busy "hour-glass" cursor by Windows if the mouse
2795 pointer is positioned over a tooltip shown for some menu item.
2796
69deda53
PE
27972012-10-25 Paul Eggert <eggert@cs.ucla.edu>
2798
2799 Don't assume process IDs fit in int.
2800 * emacs.c (shut_down_emacs) [!DOS_NT]:
2801 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
2802 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
2803 Use pid_t, not int, to store process IDs, as 'int'
2804 is not wide enough on a few platforms (e.g., AIX and IRIX).
2805
7e70a152
KH
28062012-10-23 Kenichi Handa <handa@gnu.org>
2807
2808 The following change is to make face-font-rescale-alist work
2809 correctly for non-ASCII fonts.
2810
2811 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
2812 (font_open_for_lface): Handle Vface_font_rescale_alist.
2813
49238e7f
CY
28142012-10-23 Chong Yidong <cyd@gnu.org>
2815
2816 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
2817
5ec86886
JD
28182012-10-21 Jan Djärv <jan.h.d@swipnet.se>
2819
ef446959
JD
2820 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
2821 for screen font.
2822 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
2823
5ec86886
JD
2824 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
2825 event (Bug#12681).
2826
ee7a418d
GM
28272012-10-21 Glenn Morris <rgm@gnu.org>
2828
2829 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
2830
4973679b
PE
28312012-10-20 Paul Eggert <eggert@cs.ucla.edu>
2832
2833 Port to OpenBSD 5.1.
2834 * frame.c (Fmouse_position, Fmouse_pixel_position):
2835 * xdisp.c (produce_stretch_glyph):
2836 Declare local vars only when they're needed.
2837 This is clearer and avoids a warning on OpenBSD about unused vars.
2838 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
2839 This is safer, and avoids OpenBSD warnings about unused vars.
2840 * keyboard.c (record_menu_key): Remove unnecessary decl.
2841 (poll_timer): Define only if POLL_FOR_INPUT is defined.
2842 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
2843 as our definition clashes with OpenBSD's.
2844 * xfaces.c (load_face_colors, check_lface_attrs)
2845 (get_lface_attributes_no_remap, get_lface_attributes)
2846 (lface_fully_specified_p, x_supports_face_attributes_p)
2847 (tty_supports_face_attributes_p, face_fontset, realize_face)
2848 (realize_x_face, realize_tty_face):
2849 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
2850 merely Lisp_Object *. This is more informative and avoids
2851 a warning on OpenBSD about accessing beyond an object's size.
2852
c664f463
CY
28532012-10-20 Chong Yidong <cyd@gnu.org>
2854
2855 * lread.c (Fload): Doc fix (Bug#12592).
2856
6ec83f92 28572012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
2858
2859 * font.c (Ffont_at): Fix previous change.
2860
d2824928
EZ
28612012-10-19 Eli Zaretskii <eliz@gnu.org>
2862
e483264c
SM
2863 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
2864 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
2865 for the reasons.
2866
d2824928
EZ
2867 * alloc.c (NSTATICS): Decrease to 0x800.
2868
f60d391f
SM
28692012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
2870
4a0e1924 2871 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
2872 error (bug#12677).
2873
1a9327d5
JD
28742012-10-18 Jan Djärv <jan.h.d@swipnet.se>
2875
2876 * nsterm.m (ns_select): Check writefds before call to
2877 FD_ISSET (Bug#12668).
2878
14145a1e
DC
28792012-10-18 Daniel Colascione <dancol@dancol.org>
2880
2881 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
2882 (staticpro): If we run out of staticpro slots, die with an
2883 informative error instead of just calling emacs_abort.
2884
1f76f6f5
MR
28852012-10-18 Martin Rudalics <rudalics@gmx.at>
2886
2887 Fix two flaws reported by Dmitry Antipov.
2888 * window.c (Ftemp_output_buffer_show): Remove.
2889 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
2890 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
2891
fcf14875
EZ
28922012-10-17 Eli Zaretskii <eliz@gnu.org>
2893
1f76f6f5
MR
2894 * makefile.w32-in ($(BLD)/w32.$(O)):
2895 ($(BLD)/vm-limit.$(O)):
2896 ($(BLD)/term.$(O)):
2897 ($(BLD)/unexw32.$(O)):
2898 ($(BLD)/fileio.$(O)):
a68089e4
EZ
2899 ($(BLD)/dispnew.$(O)): Update dependencies.
2900
2901 * w32term.h (w32_initialize_display_info, initialize_w32_display):
2902 Add prototypes.
2903
2904 * w32proc.c: Include ctype.h.
2905
2906 * w32.h (init_environment, check_windows_init_file)
2907 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
2908 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
2909 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
2910 (sys_link): Add prototypes.
2911
2912 * w32.c: Include w32select.h.
2913 (sys_access, e_malloc, sys_select): Add prototypes.
2914 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
2915
2916 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
2917
2918 * unexw32.c: Include lisp.h and w32.h.
2919
2920 * term.c [WINDOWSNT]: Include w32term.h.
2921
2922 * process.c [WINDOWSNT]: Add prototype of sys_select.
2923
2924 * fileio.c [WINDOWSNT]: Include w32.h.
2925
2926 * dispnew.c [WINDOWSNT]: Include w32.h.
2927
fcf14875
EZ
2928 * cygw32.c (Fcygwin_convert_path_to_windows)
2929 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
2930 Lisp_Object values. (Bug#12661)
2931
2932 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
2933 to Lisp_Object. (Bug#12661)
2934
fe0b1ec4
KH
29352012-10-17 Kenichi Handa <handa@gnu.org>
2936
2937 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
2938 invalidate.
2939
d556ebf9
DA
29402012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2941
2942 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 2943 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 2944
f0863a54
DA
29452012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2946
2947 Do not verify indirection counters of killed buffers (Bug#12579).
2948 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
2949 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
2950
12fbe755
DA
29512012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2952
2953 * alloc.c (Fmake_byte_code): Fix typo in comment.
2954 * print.c (print_interval): Define as static to match prototype.
2955 * indent.c (disptab_matches_widthtab, recompute_width_table):
2956 Convert to eassert.
2957
61655b89
DA
29582012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2959
2960 * editfns.c (get_system_name): Remove.
2961 * lisp.h (get_system_name): Remove prototype.
2962 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
2963 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
2964
9520f2f2
DC
29652012-10-15 Daniel Colascione <dancol@dancol.org>
2966
2967 * dbusbind.c: Add comment explaining reason for previous change.
2968
dca778d5
MR
29692012-10-15 Martin Rudalics <rudalics@gmx.at>
2970
2971 * window.c (Fwindow_end): Rewrite check whether cached position
2972 can be used (Bug#12600).
2973 (resize_frame_windows, grow_mini_window, shrink_mini_window):
2974 Set windows_or_buffers_changed.
2975
3e0341b0
DC
29762012-10-15 Daniel Colascione <dancol@dancol.org>
2977
2978 * dbusbind.c: Fix cygw32 build break when compiling with dbus
2979 enabled by undefining the symbol "interface", which the platform
2980 headers define to something incompatible.
2981
33d4113c
DC
29822012-10-14 Daniel Colascione <dancol@dancol.org>
2983
2984 * image.c (init_tiff_functions, init_imagemagick_functions)
2985 (init_svg_functions): Fix cygw32 build break by using these
2986 functions only when WINDOWSNT _and_ HAVE_NTGUI.
2987
a36fb15e
JD
29882012-10-14 Jan Djärv <jan.h.d@swipnet.se>
2989
2990 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
2991
537f336d
JD
29922012-10-13 Jan Djärv <jan.h.d@swipnet.se>
2993
2994 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
2995
0ba06a77
KH
29962012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
2997
2998 * coding.c (detect_coding): Set coding->id before calling
2999 this->detector.
3000
ce2fe65a
AS
30012012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3002
3003 * fileio.c: Formatting fixes.
3004
d6453ce4
PE
30052012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3006
3007 Fix some stat-related races.
3008 * fileio.c (Fwrite_region): Avoid race condition if a file is
3009 removed or renamed by some other process immediately after Emacs
3010 writes it but before Emacs stats it. Do not assume that stat (or
3011 fstat) succeeds.
3012 * image.c (slurp_file): Resolve the file name with fopen + fstat
3013 rather than stat + fopen.
3014 (pbm_read_file) [0]: Remove unused code with stat race.
3015 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
3016 Remove ineffective code with stat race.
3017
06485aa8
SM
30182012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3019
3020 * doc.c (get_doc_string): Don't signal an error if the file is missing.
3021
167e3640
JD
30222012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3023
3024 * nsterm.m (hold_event_q): New static variable.
3025 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
3026 ! q_event_ptr.
3027 (hold_event): New function.
3028 (ns_read_socket): If hold_event_q have events, store them and
3029 return (Bug#12384).
3030 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
3031 is zero (Bug#12384).
3032
c40239df
JB
30332012-10-12 Juanma Barranquero <lekktu@gmail.com>
3034
3035 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
3036
bb385a92
EZ
30372012-10-12 Eli Zaretskii <eliz@gnu.org>
3038
2a9f1099
EZ
3039 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
3040
bb385a92
EZ
3041 * fileio.c (check_existing): New function.
3042 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
3043 instead of calling 'stat', when what's needed is to check whether
3044 a file exists. This avoids expensive system calls on MS-Windows.
3045 (Bug#12587)
3046
8599b23a 3047 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
3048
3049 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
3050 determine whether a file exists and is not a directory.
3051
3052 * lisp.h (check_existing): Add prototype.
3053
2b9c2e68
JD
30542012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3055
3056 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
3057
81749a23
GM
30582012-10-12 Glenn Morris <rgm@gnu.org>
3059
3060 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
3061
5253a5fd
SM
30622012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3063
389a94a5
SM
3064 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
3065
5253a5fd
SM
3066 * eval.c (Fautoload): Remember previous autoload status in load-history.
3067
7cded46f
PE
30682012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3069
3070 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
3071 * lread.c (load_each_byte, new_backquote_flag, readchar)
3072 (read_filtered_event, lisp_file_lexically_bound_p)
3073 (safe_to_load_version, Fload, complete_filename_p, openp)
3074 (build_load_history, readevalloop, read_escape, read1)
3075 (string_to_number, read_vector, read_list):
3076 * macros.c (Fstart_kbd_macro):
3077 * marker.c (CONSIDER):
3078 * menu.c (parse_single_submenu, digest_single_submenu)
3079 (find_and_return_menu_selection, Fx_popup_menu):
3080 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
3081 (Ftry_completion):
3082 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
3083 (ns_menu_show):
3084 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
3085 (xmenu_show, xdialog_show):
3086 Use bool for booleans.
3087 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
3088 as it's not a predicate. All uses changed. Omit unnecessary
3089 buffer termination.
3090
549c3414
DA
30912012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
3092
3093 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
3094 (save_excursion_restore): Do not restore mark if it was not saved.
3095
e85aafe7
PE
30962012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3097
fd2f90cf
PE
3098 * marker.c (cached_modiff): EMACS_INT, not int.
3099
c1af190b
PE
3100 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
3101 instead of having a wrong decl.
e85aafe7
PE
3102 * nsmenu.m (waiting_for_input): Remove wrong decl.
3103
e738ca56
PE
31042012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3105
9fa1de30
PE
3106 keyboard.c, keymap.c: Use bool for booleans.
3107 * dispnew.c (sit_for): Distinguish between 3-way display_option
3108 and boolean do_display.
3109 * keyboard.c (single_kboard, this_command_key_count_reset)
3110 (waiting_for_input, echoing, immediate_quit, input_pending)
3111 (interrupt_input, interrupts_deferred, pop_kboard)
3112 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
3113 (command_loop_1, adjust_point_for_property)
3114 (safe_run_hooks_error, input_polling_used, read_char):
3115 (help_char_p, readable_events, kbd_buffer_events_waiting)
3116 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
3117 (lucid_event_type_list_p, get_input_pending):
3118 (gobble_input, menu_separator_name_p, menu_bar_item)
3119 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
3120 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
3121 (keyremap_step, test_undefined, read_key_sequence)
3122 (detect_input_pending, detect_input_pending_ignore_squeezables)
3123 (detect_input_pending_run_timers, requeued_events_pending_p)
3124 (quit_throw_to_read_char, Fset_input_interrupt_mode):
3125 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
3126 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
3127 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
3128 (accessible_keymaps_1, Fkey_description, push_key_description):
3129 (shadow_lookup, struct where_is_internal_data)
3130 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
3131 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
3132 (describe_map, describe_vector):
3133 * menu.c (single_menu_item):
3134 * nsmenu.m (ns_update_menubar):
3135 * process.c (wait_reading_process_output):
3136 * search.c (scan_buffer, scan_newline):
3137 Use bool for boolean.
3138 * keyboard.c (timers_run, swallow_events)
3139 (detect_input_pending_run_timers):
3140 * process.c (wait_reading_process_output):
3141 Use unsigned for counter where wraparound-on-overflow is desired,
3142 since unsigned is guaranteed to have that behavior and signed is not.
3143 (read_char): Use ptrdiff_t for string length.
3144 (get_input_pending): Remove first argument, since it was always
3145 the same pointer-to-int (now pointer-to-boolean) &input_pending,
3146 and behave as if it had that value. Return new value of
3147 input_pending. All callers changed.
3148 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
3149 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
3150 a string length.
3151 * keymap.c (push_key_description): Omit last arg, which was always 1.
3152 All callers changed.
3153
e738ca56
PE
3154 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
3155
29f21cdf
JB
31562012-10-10 Juanma Barranquero <lekktu@gmail.com>
3157
3158 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
3159 ($(BLD)/term.$(O)): Update dependencies.
3160
6aea7528
DA
31612012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3162
3163 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
3164 * lisp.h (enum pvec_type): Adjust comments and omit explicit
3165 initializer for PVEC_NORMAL_VECTOR.
3166
5f3f57be
PE
31672012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3168
3169 Clean out old termopts cruft.
3170 * termopts.h (flow_control, meta_key): Remove unused decls.
3171 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
3172 Don't include termopts.h.
3173
3e98c68e
DA
31742012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3175
3176 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
3177
77e344e5
PE
31782012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3179
3180 * commands.h (immediate_quit): Remove duplicate decl.
3181
5683d7cd
JD
31822012-10-09 Jan Djärv <jan.h.d@swipnet.se>
3183
3184 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
3185 caching.
3186 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 3187 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 3188
cf5fc6db
EZ
31892012-10-09 Eli Zaretskii <eliz@gnu.org>
3190
b15736e6
EZ
3191 * w32fns.c (w32_last_error): Change the return value to DWORD, to
3192 match what GetLastError returns. Explain why the function is
3193 needed.
3194
cf5fc6db
EZ
3195 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
3196 'is_tooltip_frame', to avoid confusion with its global namesake.
3197
f99714ce
DC
31982012-10-08 Daniel Colascione <dancol@dancol.org>
3199
3200 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
3201 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
3202 build that caused Emacs to display the hourglass cursor forever.
f99714ce 3203
fd59cb29
GM
3204 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
3205 which is broken under remote desktop, calculate the number of
3206 colors available for a display based on the display's number of
3207 planes and number of bits per pixel per plane. (bug#10397).
3208
62c480c9 32092012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 3210
62c480c9
JD
3211 * nsfont.m (Vfonts_in_cache): New variable.
3212 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
3213 are used. Add cached fonts to Vfonts_in_cache.
3214 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
3215
607446ba
JB
32162012-10-08 Juanma Barranquero <lekktu@gmail.com>
3217
fd5125ad
JB
3218 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
3219 in nt/config.nt.
46979e0b
JB
3220 (FONT_H): Define after FRAME_H.
3221 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
3222 Update dependencies.
fd5125ad 3223
607446ba
JB
3224 * w32term.c: Remove leftover declaration of keyboard_codepage.
3225
b6f4e300
EZ
32262012-10-08 Eli Zaretskii <eliz@gnu.org>
3227
c54ebba4
EZ
3228 * makefile.w32-in (FONT_H): Add $(FRAME_H).
3229 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
3230 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
3231 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
3232 ($(BLD)/unexw32.$(O)):
3233 ($(BLD)/w32.$(O)):
3234 ($(BLD)/w32console.$(O)):
3235 ($(BLD)/w32fns.$(O)):
3236 ($(BLD)/w32heap.$(O)):
3237 ($(BLD)/w32menu.$(O)):
15c720a3 3238 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 3239
b6f4e300
EZ
3240 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
3241 'const char *'.
3242 (x_to_w32_color): Don't modify the argument, modify a copy instead.
3243
501199a3
DC
32442012-10-08 Daniel Colascione <dancol@dancol.org>
3245
3246 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
3247 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
3248 accidental message numbering hole. Change other messages to
3249 match.
3250
3251 * w32select.h (HAVE_W32SELECT): Remove.
3252
3253 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 3254 w32common.h instead of w32heap.h.
501199a3
DC
3255
3256 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
3257 (get_allocation_unit, get_processor_type, get_w32_major_version)
3258 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3259 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3260 (OS_NT, os_subtype, cache_system_info): Move declarations to
3261 w32common.
3262
3263 * w32heap.c: Include w32common.h.
3264 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
3265 (w32_minor_version, w32_build_number, w32_subtype):
3266 Remove duplicate definitions.
501199a3
DC
3267
3268 * w32fns.c: Include w32common.h; include w32heap.h only in
3269 WINDOWSNT.
3270
3271 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
3272 Use `report_file_error' instead of `error' in order to better
3273 inform users of what went wrong. Increase NTGUI_UNICODE file
3274 dialog box file name length to 32k, the maximum allowed by the NT
3275 kernel.
3276
3277 * w32common.h: New file.
3278 (ROUND_UP, ROUND_DOWN, get_page_size)
3279 (get_allocation_unit, get_processor_type, get_w32_major_version)
3280 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3281 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3282 (OS_NT, os_subtype, cache_system_info): Move here.
3283
3284 * unexw32.c, unexcw.c: Include w32common.h.
3285
3286 * emacs.c (main): Use (defined (WINDOWSNT) || defined
3287 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
3288 to call syms_of_w32select.
3289
3290 * cygw32.h: Remove obsolete EXFUN declarations.
3291
3292 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
3293
3294 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
3295 of w32inevt.o from SOME_MACHINE_OBJECTS.
3296
93aa5c81
DC
32972012-10-08 Daniel Colascione <dancol@dancol.org>
3298
3299 * image.c: Permanent fix for JPEG compilation issue --- limit
3300 jpeglib `boolean' redefinition to Cygwin builds.
3301
d424f3d8
EZ
33022012-10-08 Eli Zaretskii <eliz@gnu.org>
3303
8ee4c6ce
EZ
3304 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
3305
d424f3d8
EZ
3306 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
3307 Cygwin.
3308
e08348a0
DC
33092012-10-08 Daniel Colascione <dancol@dancol.org>
3310
3311 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
3312 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
3313 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
3314 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
3315 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
3316 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
3317 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
3318 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
3319 now a supported configuration.
3320
3321 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 3322 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
3323
3324 * conf_post.h:
3325 (_DebPrint) declare tracing facility for W32 debugging. We need
3326 to unify tracing later.
3327
3328 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
3329 unconditional use of W32 Unicode functions. Cygwin runs only on
3330 100% Unicode operating systems.
3331
3332 * cygw32.c: New file. Define Cygwin-specific facilities.
3333 (Fcygwin_convert_path_to_windows)
3334 (Fcygwin_convert_path_from_windows): New user functions for
3335 accessing Cygwin path-munging routines.
3336
3337 * cygw32.h: New file.
3338 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
3339 UTF-16LE strings temporarily inside non-Lisp-visible string
3340 objects.
3341
3342 (w32_strerror): Just what it says on the tin.
3343
3344 * emacs.c: Make the NS fork-then-exec code for daemon-launching
3345 also run for Cygwin; both systems have the same problem with using
3346 GUI facilities in a forked child. Also call syms_of_cygw32,
3347 syms_of_w32select in correct places.
3348
3349 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
3350 needs fork-then-exec for daemon launching.
3351
3352 * font.h: Include frame.h.
3353
3354 * image.c: Use the image library cache machinery only when we're
3355 compiling for native WINDOWSNT; Cygwin can use shared libraries
3356 like any other Unixlike system.
3357
3358 * keyboard.c: Clarify a comment regarding the input loop.
3359
3360 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
3361 functions directly instead of trying to detect at runtime that our
3362 host operating system supports them. We make this change for two
3363 reasons: Cygwin lacks support for the multibyte character
3364 conversion functions used by the legacy menu code, and Cygwin
3365 never needs to rely on non-Unicode APIs.
3366
3367 * unexw32.c (hinst): Declare extern.
3368
3369 * w32.c: Change header order;
3370 (w32_strerror): Move to w32fns.c because we need it for
3371 non-WINDOWSNT builds.
3372
3373 * w32.h: Add #error macro to make sure we don't include w32.h for
3374 Cygwin builds. Remove w32select declarations.
3375
3376 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 3377 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
3378
3379 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
3380 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
3381 POSIXy alternative.
3382 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
3383 (w32_major_version, w32_minor_version, w32_build_number)
3384 (os_subtype, sound_type): Define here
3385 (w32_defined_color): Make color parameter const for consistency
3386 with other _defined_color functions.
3387 (w32_createwindow): Unconditionally call w32_init_class instead of
3388 doing so only when hprevinst is non-NULL. Plumbing hprevinst
3389 through the code is complex and unnecessary because class
3390 registration is practically free.
3391 (w32_name_of_message): New EMACSDEBUG-only function.
3392 (Fset_message_beep): Move here
3393 (Fx_open_connection): Require that the display name for Windows be
3394 "w32" for consistency, emacsclient disambiguation, and maybe, one
3395 day, multi-window-system support.
3396 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
3397 Cygwin files for W32 GUI facilities, since these clearly don't
3398 expect Cygwin names.
3399 (_DebPrint): Define.
3400 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
3401 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
3402 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
3403 (w32_last_error): Remove.
3404
3405 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
3406
3407 * w32heap.c (syspage_mask): Declare here.
3408 (cache_system_info): Remove.
3409
3410 * w32inevt.c (faked_key): Define globally, not statically.
3411 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
3412 (w32_console_toggle_lock_key): Move to w32fns.c.
3413
3414 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
3415
3416 * w32proc.c (_DebPrint): Move to w32fns.c.
3417 * w32select.c: Include string.h, stdio.h for Cygwin.
3418 * w32select.h: New File.
3419
3420 * w32term.c: Include io.h for non-CYGWIN builds; needed for
3421 get_osfhandle.
3422 (w32_message_fd): New variable. Under Cygwin, holds the file
3423 descriptor the system used to tell us about pending thread
3424 messages.
3425
3426 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
3427 that prevented compilation under non-WINDOWSNT systems.
3428
3429 (w32_initialize): Open /dev/windows and assign it to
3430 w32_message_fd. Provide w32 feature.
3431
3432 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
3433 (WM_EMACS_INPUT_READY): add.
3434 (prepend_msg, w32_message_fd): Declare globally.
3435
3436 * w32xfns.c:
3437 (keyboard_handle): Use only when WINDOWSNT.
3438 (notify_msg_ready): New function. Posts a message to the main
3439 thread's message queue under CYGWIN, which wakes up the main
3440 thread from select(2) by making the /dev/windows file descriptor
3441 ready. Under WINDOWSNT, it sets an event the same way the old
3442 code did.
3443
3444 (post, prepend_msg): Actually call notify_msg_ready instead of
3445 setting the input event directly.
3446
98daa893
EZ
34472012-10-07 Eli Zaretskii <eliz@gnu.org>
3448
3449 * ralloc.c (relinquish): If a heap is ready to be relinquished,
3450 but it still has blocs in it, don't return it to the system,
3451 instead of aborting. (Bug#12402)
3452
3bc0a2f7
JD
34532012-10-07 Jan Djärv <jan.h.d@swipnet.se>
3454
8ad5b73b 3455 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 3456
335f5ae4
JD
3457 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
3458 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
3459 (syms_of_nsterm): Remove comment about Panther and above for
3460 ns-antialias-text.
335f5ae4
JD
3461 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
3462 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
3463 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
3464
3465 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
3466 MAC_OS_X_VERSION_10_4.
3467
8ad5b73b
JD
3468 * nsmenu.m (fillWithWidgetValue:): Remove code for <
3469 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
3470
3471 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
3472
3473 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
3474 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
3475
3bc0a2f7
JD
3476 * nsterm.m (ns_in_resize): Remove (Bug#12479).
3477 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
3478 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
3479 Remove ns_in_resize check.
3bc0a2f7
JD
3480 (ns_clear_frame_area): Remove resize handle code.
3481
3482 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
3483 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
3484 Remove ns_in_resize check.
3bc0a2f7 3485
c622b48f
PE
34862012-10-07 Paul Eggert <eggert@cs.ucla.edu>
3487
3488 Improve sys_siglist detection.
3489 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
3490 defined as a macro, as is done in Solaris.
3491 (sys_siglist_entries): New macro.
3492 (save_strsignal): Use it.
3493 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
3494 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
3495
04fafa46
JD
34962012-10-06 Jan Djärv <jan.h.d@swipnet.se>
3497
3498 * nsfns.m (Fx_create_frame): Call x_default_parameter with
3499 fullscreen/Fullscreen.
3500
3501 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
3502 tobar_height is new.
3503
3504 * nsterm.m (x_make_frame_visible): Check for fullscreen.
3505 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
3506 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
3507 (windowDidResize:): Check for correct window if old style fullscreen.
3508 Capitalize word in comment. Remove incorrect comment.
3509 (initFrameFromEmacs:): tbar_height renamed tibar_height.
3510 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
3511 error in drawing background.
1f9f395d 3512 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
3513 Set toolbar values to zero, save old height in tobar_height.
3514 Restore tool bar height when leaving fullscreen.
3515 (canBecomeMainWindow): New function.
3516
c6e21c03
PE
35172012-10-06 Paul Eggert <eggert@cs.ucla.edu>
3518
3519 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
3520
0d9f584b
EZ
35212012-10-05 Eli Zaretskii <eliz@gnu.org>
3522
a65fbb5f
EZ
3523 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
3524
0d9f584b 3525 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
3526 that time stamps of directories could also be changed.
3527 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
3528 FILE_WRITE_ATTRIBUTES access rights.
3529
3530 * fileio.c (Fset_file_times): Special-case ignoring errors for
3531 directories only on MSDOS, not on MS-Windows.
3532
e8757f09 35332012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
3534
3535 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
3536
7604f298
EZ
35372012-10-04 Eli Zaretskii <eliz@gnu.org>
3538
3539 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
3540 see whether CreateFile failed.
3541
88d69b7d
PE
35422012-10-04 Paul Eggert <eggert@cs.ucla.edu>
3543
3544 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
3545 to avoid similar races.
3546 * keyboard.c (pending_signals): Now bool, not int.
3547
7509f454
PE
3548 Port timers to OpenBSD, plus check for timer failures.
3549 OpenBSD problem reported by Han Boetes.
3550 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
3551 and/or setitimer.
3552 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
3553 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
3554 like OpenBSD, which has timer_settime but does not declare it.
3555 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
3556 whether to use itimerspec-related primitives. All uses of
3557 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
3558
a3c5c0c5
PE
35592012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3560
3561 * profiler.c (handle_profiler_signal): Fix a malloc race
3562 that caused Emacs to hang on Fedora 17 when profiling Lisp.
3563
914e743b
JD
35642012-10-02 Jan Djärv <jan.h.d@swipnet.se>
3565
3566 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
3567
d8ab37a8
EZ
35682012-10-02 Eli Zaretskii <eliz@gnu.org>
3569
3570 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
3571 consistent with the change in return value of 'safe_strsignal'.
3572
b3ecad33
PE
35732012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3574
0a99eee1
PE
3575 Prefer plain 'static' to 'static inline' (Bug#12541).
3576 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
3577 (bidi_set_sor_type, bidi_push_embedding_level)
3578 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
3579 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
3580 (bidi_cache_search, bidi_cache_ensure_space)
3581 (bidi_cache_iterator_state, bidi_cache_find)
3582 (bidi_peek_at_next_level, bidi_set_paragraph_end)
3583 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3584 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
3585 Now 'static', not 'static inline'.
3586
b3ecad33
PE
3587 Count overruns when profiling; change units to ns.
3588 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
3589 Give extra weight to samples after overruns, to attempt to count
3590 the time more accurately.
3591 (setup_cpu_timer): Change sampling interval units from ms to ns, since
3592 the underlying primitives nominally do ns.
3593 (Fprofiler_cpu_start): Document the change. Mention that
3594 the sampling intervals are only approximate.
3595
090cf9db
SM
35962012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
3597
3598 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
3599
3600 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
3601 case for the special 0 coding-system.
3602
3603 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
3604 (Fmake_overlay): Remove redundant tests.
64edc777 3605 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 3606
81550bf4
JB
36072012-10-02 Juanma Barranquero <lekktu@gmail.com>
3608
3609 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
3610 Update dependencies.
3611
aa1ba90e
PE
36122012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3613
3614 Fix a malloc race condition involving strsignal.
3615 A signal can arrive in the middle of a malloc, and Emacs's signal
3616 handler can invoke strsignal, which can invoke malloc, which is
3617 not portable. This race condition bug makes Emacs hang on GNU/Linux.
3618 Fix it by altering the signal handler so that it does not invoke
3619 strsignal.
3620 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
3621 * process.c (status_message): Use const pointer, in case strsignal
3622 is #defined to safe_strsignal.
3623 * sysdep.c (sys_siglist, init_signals): Always define and
3624 initialize a substitute sys_siglist if the system does not define
3625 one, even if HAVE_STRSIGNAL.
3626 (safe_strsignal): Rename from strsignal. Always define,
3627 using sys_siglist. Return a const pointer.
3628 * syssignal.h (safe_strsignal): New decl.
3629 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
3630
ace917bd
EZ
36312012-10-01 Eli Zaretskii <eliz@gnu.org>
3632
3633 * w32proc.c (timer_loop): Fix code that waits for timer
3634 expiration, to avoid high CPU usage.
3635
9eb71b9c
SM
36362012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
3637
3638 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
3639 (sweep_weak_table): Remove redundant prototypes.
3640
b3317662
FP
36412012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
3642
3643 * emacs.c: Move the inclusion of TERM_HEADER after including
3644 windows.h on WINDOWSNT. This avoids compilation problems with
3645 MSVC.
3646
f0e5f225
EZ
36472012-10-01 Eli Zaretskii <eliz@gnu.org>
3648
2d7d1608
EZ
3649 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
3650 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
3651 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
3652 as the previous version used 'void *'.
3653
3654 * ralloc.c (ROUNDUP): Fix last change.
3655 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
3656 'size_t'.
3657
f0e5f225
EZ
3658 * w32proc.c <disable_itimers>: New static flag.
3659 (init_timers): Initialize it to zero, after creating the critical
3660 sections used by the timer threads.
3661 (term_timers): Set to 1 before deleting the critical sections.
3662 (getitimer, setitimer): If disable_itimers is non-zero, return an
3663 error indication without doing anything. Reported by Fabrice
3664 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
3665 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
3666 return results.
3667 [!HAVE_SETITIMER]: Behave as the previous version that didn't
3668 support timers.
f0e5f225
EZ
3669
3670 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
3671 term_ntproc after all the other bookkeeping, to get timers working
3672 as long as possible.
3673
82ef37c1
PE
36742012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3675
b3a4c387
PE
3676 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
3677 Suggested by Juri Linkov in
3678 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
3679
b0ab8123
PE
3680 Prefer plain 'static' to 'static inline' (Bug#12541).
3681 With static functions, modern compilers inline pretty well by
3682 themselves; advice from programmers often hurts as much as it helps.
3683 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
3684 this change shrinks the text size of the Emacs executable by 1.1%
3685 without affecting CPU significantly in my benchmark.
3686 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
3687 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
3688 (mark_maybe_object, mark_maybe_pointer, bounded_number):
3689 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3690 (bset_auto_fill_function, bset_auto_save_file_format)
3691 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3692 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3693 (bset_cache_long_line_scans, bset_case_fold_search)
3694 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3695 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3696 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3697 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3698 (bset_header_line_format, bset_indicate_buffer_boundaries)
3699 (bset_indicate_empty_lines, bset_invisibility_spec)
3700 (bset_left_fringe_width, bset_major_mode, bset_mark)
3701 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3702 (bset_name, bset_overwrite_mode, bset_pt_marker)
3703 (bset_right_fringe_width, bset_save_length)
3704 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3705 (bset_scroll_up_aggressively, bset_selective_display)
3706 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3707 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
3708 (set_buffer_overlays_after):
3709 * category.c (bset_category_table):
3710 * charset.c (read_hex):
3711 * coding.c (produce_composition, produce_charset)
3712 (handle_composition_annotation, handle_charset_annotation)
3713 (char_encodable_p):
3714 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
3715 (assign_row, set_frame_matrix_frame, make_current)
3716 (add_row_entry):
3717 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
3718 * fns.c (maybe_resize_hash_table):
3719 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
3720 * gmalloc.c (register_heapinfo):
3721 * image.c (lookup_image_type):
3722 * intervals.c (set_interval_object, set_interval_left)
3723 (set_interval_right, copy_interval_parent, rotate_right)
3724 (rotate_left, balance_possible_root_interval):
3725 * keyboard.c (kset_echo_string, kset_kbd_queue)
3726 (kset_keyboard_translate_table, kset_last_prefix_arg)
3727 (kset_last_repeatable_command, kset_local_function_key_map)
3728 (kset_overriding_terminal_local_map, kset_real_last_command)
3729 (kset_system_key_syms, clear_event, set_prop):
3730 * lread.c (digit_to_number):
3731 * marker.c (attach_marker, live_buffer, set_marker_internal):
3732 * nsterm.m (ns_compute_glyph_string_overhangs):
3733 * process.c (pset_buffer, pset_command)
3734 (pset_decode_coding_system, pset_decoding_buf)
3735 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
3736 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
3737 (pset_status, pset_tty_name, pset_type, pset_write_queue):
3738 * syntax.c (bset_syntax_table, dec_bytepos):
3739 * terminal.c (tset_param_alist):
3740 * textprop.c (interval_has_some_properties)
3741 (interval_has_some_properties_list):
3742 * window.c (wset_combination_limit, wset_dedicated)
3743 (wset_display_table, wset_hchild, wset_left_fringe_width)
3744 (wset_left_margin_cols, wset_new_normal, wset_new_total)
3745 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3746 (wset_right_fringe_width, wset_right_margin_cols)
3747 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
3748 (wset_vertical_scroll_bar_type, wset_window_parameters):
3749 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3750 (wset_column_number_displayed, wset_region_showing)
3751 (window_box_edges, run_window_scroll_functions)
3752 (append_glyph_string_lists, prepend_glyph_string_lists)
3753 (append_glyph_string, set_glyph_string_background_width)
3754 (append_glyph, append_composite_glyph)
3755 (take_vertical_position_into_account):
3756 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
3757 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
3758 (lface_hash, lface_same_font_attributes_p, lookup_face):
3759 * xml.c (libxml2_loaded_p):
3760 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
3761 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
3762 Now 'static', not 'static inline'.
3763
05584c31
PE
3764 * bidi.c: Tune.
3765 (bidi_copy_it): Do the whole copy with a single memcpy.
3766 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
3767
86ec63ba
PE
3768 Revert the FOLLOW-SYMLINKS change for file-attributes.
3769 Doing it right would require several changes to Tramp, and there's
3770 not enough time to get that tested before the freeze today.
3771 * dired.c (directory_files_internal, Ffile_attributes):
3772 Undo last change.
3773
82ef37c1
PE
3774 * frame.c (x_report_frame_params): Port better to wider ints.
3775 Do not assume that EMACS_UINT is the same width as uprintmax_t,
3776 or that pointers can be printed in 15 decimal digits.
3777 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
3778
62aba0d4
FP
37792012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
3780
3781 Support x64 build on MS-Windows.
3782 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
3783 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
3784 compatibility with x64.
5e4daaf3 3785 (x_get_focus_frame): Add prototype.
62aba0d4
FP
3786
3787 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
3788 defining an XRectangle structure.
3789
3790 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
3791 arithmetics for compatibility with x64.
3792
3793 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
3794 compatibility with x64.
3795
3796 * w32heap.h: Adjust prototypes and declarations.
3797
3798 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
3799 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
3800 DWORD, long, and unsigned long, for compatibility with x64.
3801 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
3802 (sbrk): Argument is now of type ptrdiff_t.
3803
3804 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
3805 less than 0x0500.
3806 (w32_msg_pump): Use WPARAM type for 'result'.
3807
3808 * w32.c (init_environment, get_emacs_configuration): Support AMD64
3809 architecture.
3810 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
3811 compatibility with x64.
3812
3813 * vm-limit.c (lim_data): Now size_t.
3814 (check_memory_limits): Adjust prototypes of real_morecore and
3815 __morecore to receive argument of type ptrdiff_t. Use size_t for
3816 five_percent and data_size.
3817
3818 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
3819 variables, for compatibility with x64.
3820 (rva_to_section, offset_to_section, relocate_offset)
3821 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
3822 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
3823 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
3824 for compatibility with x64.
3825
3826 * sysdep.c (STDERR_FILENO): Define if not already defined.
3827
3828 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
3829 (__morecore): Argument type is now ptrdiff_t.
3830 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
3831 (relinquish): Use ptrdiff_t type for 'excess'.
3832 (r_alloc_sbrk): Argument type is now ptrdiff_t.
3833
3834 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
3835 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
3836 instead of a literal number.
3837
3838 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
3839 (min): Define only if not already defined.
3840
3841 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
3842 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
3843 hosts.
3844
3845 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
3846 'bitmaps' is a pointer.
3847
3848 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
3849
3850 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
3851
e7a2937b
PE
38522012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3853
3854 file-attributes has a new optional arg FOLLOW-SYMLINKS.
3855 * dired.c (directory_files_internal, Ffile_attributes):
3856 New arg follow_symlinks. All uses changed.
3857
b43d62ae
SM
38582012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
3859
3860 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
3861
c06c382a
EZ
38622012-09-30 Eli Zaretskii <eliz@gnu.org>
3863
3864 Support atimers and CPU profiler via profile.c on MS-Windows.
3865 * w32proc.c (sig_mask, crit_sig): New static variables.
3866 (sys_signal): Support SIGALRM and SIGPROF.
3867 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 3868 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
3869 sigfillset, and sigprocmask are no longer no-ops.
3870 (sigismember): New function.
3871 (struct itimer_data): New definition.
3872 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
3873 (crit_prof): New static variables.
3874 (MAX_SINGLE_SLEEP): New definition.
3875 (timer_loop, stop_timer_thread, term_timers, init_timers)
3876 (start_timer_thread, getitimer, setitimer): New functions.
3877 (alarm): No longer a no-op, calls setitimer.
3878
3879 * w32.c (term_ntproc): Call term_timers.
3880 (init_ntproc): Make sure all signals are unblocked at startup, to
3881 erase any traces of dumping. Call init_timers.
3882
3883 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
3884 Windows-specific code to display the hourglass mouse pointer is no
3885 longer used.
3886 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
3887 to hourglass timer expiration.
3888 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
3889 Remove, no longer used.
b43d62ae
SM
3890 (w32_note_current_window, show_hourglass, hide_hourglass):
3891 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
3892 window systems.
3893 (syms_of_w32fns): Don't initialize hourglass_timer.
3894
3895 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
3896 WINDOWSNT as well.
3897 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
3898
3899 * w32.h (init_timers, term_timers): Add prototypes.
3900
95402d5f
KH
39012012-09-30 Kenichi Handa <handa@gnu.org>
3902
3903 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
3904 to the buffer relocation which may be caused by ccl_driver.
3905
dd946752
JD
39062012-09-30 Jan Djärv <jan.h.d@swipnet.se>
3907
d7e642cc
JD
3908 * xfns.c (Fx_file_dialog): Update comment.
3909
3910 * w32fns.c (Fx_file_dialog): Update comment.
3911
3912 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
3913 Initialize panel name field if OSX >= 10.6.
3914
3915 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
3916
dd946752
JD
3917 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
3918
3919 * nsterm.m (NEW_STYLE_FS): New define.
3920 (ns_fullscreen_hook, windowWillEnterFullScreen)
3921 (windowDidEnterFullScreen, windowWillExitFullScreen)
3922 (windowDidExitFullScreen, toggleFullScreen, handleFS)
3923 (setFSValue): New functions.
3924 (EmacsFSWindow): New implementation.
3925 (canBecomeKeyWindow): New function for EmacsFSWindow.
3926 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
3927 (dealloc): Release nonfs_window if in fullscreen.
3928 (updateFrameSize:): Call windowDidMove to update top/left.
3929 (windowWillResize:toSize:): Check if frame is still maximized.
3930 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
3931 next_maximized, maximized_width, maximized_height and nonfs_window.
3932 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
3933 tbar_height.
3934 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 3935 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
3936
3937 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
3938 (EmacsView): Add variables for fullscreen.
3939 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
3940 (EmacsFSWindow): New interface for fullscreen.
3941
427730eb
JB
39422012-09-30 Juanma Barranquero <lekktu@gmail.com>
3943
3944 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3945
48de8b12
CY
39462012-09-30 Chong Yidong <cyd@gnu.org>
3947
3948 * fns.c (Frandom): Doc fix.
3949
5938d519
MR
39502012-09-30 Martin Rudalics <rudalics@gmx.at>
3951
3952 * window.c (Vwindow_combination_limit): New default value.
3953 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
3954
cb5b0266
PE
39552012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3956
3957 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
3958 Suggested by Eli Zaretskii in
3959 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
3960
84f72efd
EZ
39612012-09-30 Eli Zaretskii <eliz@gnu.org>
3962
3963 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
3964 HAVE_TIMER_SETTIME is defined.
3965
9d4dcdc9
PE
39662012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3967
d89460ed
PE
3968 Profiler improvements: more-accurate timers, overflow checks.
3969 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
3970 signal.h, setjmp.h. Include systime.h instead.
3971 (saturated_add): New function.
3972 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
3973 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
3974 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
3975 New static vars.
84f72efd 3976 (enum profiler_cpu_running): New enum.
d89460ed
PE
3977 (profiler_cpu_running): Now of that enum type, not bool.
3978 All uses changed to store the new value.
3979 (handle_profiler_signal): Rename from sigprof_handler_1,
3980 for consistency with other handlers. Do not check whether
3981 cpu_log is a hash-table if garbage collecting, since it
3982 doesn't matter in that case.
3983 (deliver_profiler_signal): Rename from sigprof_handler,
3984 for consistency with other handlers.
3985 (setup_cpu_timer): New function, with much of what used to be in
3986 Fprofiler_cpu_start. Check for out-of-range argument.
3987 Prefer timer_settime if available, and prefer
3988 thread cputime clocks, then process cputime clocks, then
3989 monotonic clocks, to the old realtime clock. Use make_timeval
3990 to round more-correctly when falling back to setitimer.
3991 (Fprofiler_cpu_start): Use it.
3992 (Fprofiler_cpu_stop): Prefer timer_settime if available.
3993 Don't assume that passing NULL as the 2nd argument of setitimer
3994 is the same as passing a pointer to all-zero storage.
3995 Ignore SIGPROF afterwards.
3996 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
3997 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
3998 non-fatal signal handlers. Ignore SIGPROF on startup.
3999 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4000 in profiler.c, since sysdep.c now uses it.
4001
9d4dcdc9
PE
4002 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4003 Suggested by Eli Zaretskii in
4004 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4005
8e5691a0
JB
40062012-09-29 Juanma Barranquero <lekktu@gmail.com>
4007
4008 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4009
e7c1b6ef
SM
40102012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
4011
4012 * lisp.h (struct backtrace): Remove indirection for `function' field.
4013 * xdisp.c (redisplay_internal):
4014 * profiler.c (record_backtrace, sigprof_handler_1):
4015 * alloc.c (Fgarbage_collect):
4016 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
4017 (Fbacktrace_frame): Adjust accordingly.
4018
e61d39cd 40192012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
4020
4021 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
4022 (Frun_hook_with_args_until_failure): Doc fixes.
4023
404043ea
EZ
40242012-09-28 Eli Zaretskii <eliz@gnu.org>
4025
4026 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
4027 Qautomatic_redisplay and change the symbol name. All users changed.
4028
704d3f45
TM
40292012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
4030
4031 * profiler.c (sigprof_handler): Fix race condition.
4032
757140ff
GM
40332012-09-28 Glenn Morris <rgm@gnu.org>
4034
4035 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4036
a615a3ae
PE
40372012-09-27 Paul Eggert <eggert@cs.ucla.edu>
4038
4039 Check more robustly for timer_settime.
89d17fd0
PE
4040 * Makefile.in (LIB_TIMER_TIME): New macro.
4041 (LIBES): Add it.
a615a3ae
PE
4042 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
4043 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
4044 call timer_settime.
4045
3670daf7
TM
40462012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4047
4048 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
4049
6a586b7f
JB
40502012-09-26 Juanma Barranquero <lekktu@gmail.com>
4051
4052 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4053
41c8bfcf
PE
40542012-09-26 Paul Eggert <eggert@cs.ucla.edu>
4055
4056 * character.h (MAYBE_UNIFY_CHAR): Remove.
4057 * charset.c, charset.h (maybe_unify_char): Now static.
4058 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
4059 Since this stuff is now private to charset.c, there's no need for
4060 a public macro and no need to inline by hand.
4061
3a880af4
SM
40622012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4063 Stefan Monnier <monnier@iro.umontreal.ca>
4064 Juanma Barranquero <lekktu@gmail.com>
611b7507 4065
3a880af4
SM
4066 * profiler.c: New file.
4067 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
4068 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
4069 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
4070 * emacs.c (main): Call syms_of_profiler.
4071 * alloc.c (Qautomatic_gc): New constant.
4072 (MALLOC_PROBE): New macro.
4073 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
4074 (total_bytes_of_live_objects): New function.
4075 (Fgarbage_collect): Use it. Record itself in backtrace_list.
4076 Call malloc_probe for the memory profiler.
4077 (syms_of_alloc): Define Qautomatic_gc.
4078 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
4079 race condition.
4080 (struct backtrace): Move definition...
4081 * lisp.h (struct backtrace): ..here.
4082 (Qautomatic_gc, profiler_memory_running): Declare vars.
4083 (malloc_probe, syms_of_profiler): Declare functions.
4084 * xdisp.c (Qautomatic_redisplay): New constant.
4085 (redisplay_internal): Record itself in backtrace_list.
4086 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 4087
5938d519 40882012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
40892012-09-25 Juanma Barranquero <lekktu@gmail.com>
4090
4091 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
4092
e26fd2e4
PE
40932012-09-25 Paul Eggert <eggert@cs.ucla.edu>
4094
4095 Prefer POSIX timers if available.
4096 They avoid a race if the timer is too close to the current time.
4097 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
4098 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 4099 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 4100
eedec3ee
EZ
41012012-09-25 Eli Zaretskii <eliz@gnu.org>
4102
4103 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
4104 CHAR_STRING_ADVANCE.
4105 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
4106 STRING_CHAR_ADVANCE.
4107
aa15c6bb
JB
41082012-09-25 Juanma Barranquero <lekktu@gmail.com>
4109
4110 Move Vlibrary_cache to emacs.c and reset before dumping.
4111
4112 * lisp.h (reset_image_types): Declare.
4113 [WINDOWSNT] (Vlibrary_cache): Declare.
4114
4115 * image.c (reset_image_types): New function.
4116
4117 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
4118 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
4119 (Fdump_emacs): Reset Vlibrary_cache and image_types.
4120
4121 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
4122 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
4123
4124 * w32.h (Vlibrary_cache): Do not declare.
4125
54d629be
EZ
41262012-09-25 Eli Zaretskii <eliz@gnu.org>
4127
16b22fef
EZ
4128 * w32proc.c (sys_signal): Handle all signals defined by the
4129 MS-Windows runtime, not just SIGCHLD. Actually install the signal
4130 handlers for signals supported by Windows. Don't override
4131 term_ntproc as the handler for SIGABRT.
4132 (sigaction): Rewrite to call sys_signal instead of duplicating its
4133 code.
4134 (sys_kill): Improve commentary.
4135
4136 * w32.c (term_ntproc): Accept (and ignore) one argument, for
4137 consistency with a signature of a signal handler. All callers
4138 changed.
4139 (init_ntproc): Accept an argument DUMPING. If dumping, don't
4140 install term_ntproc as a signal handler for SIGABRT, as that
4141 should be done by the dumped Emacs.
4142
4143 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
4144
4145 * w32select.c (term_w32select): Protect against repeated
4146 invocation by setting clipboard_owner to NULL after calling
4147 DestroyWindow.
4148
4149 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
4150 and term_ntproc to their modified signatures.
4151
54d629be
EZ
4152 * character.c (char_string, string_char): Remove calls to
4153 MAYBE_UNIFY_CHAR. See the discussion starting at
4154 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
4155 for the details.
4156
59f7af81
CY
41572012-09-25 Chong Yidong <cyd@gnu.org>
4158
4159 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
4160
22e8cf4a
SM
41612012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
4162
4163 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
4164 when encountering an unknown bytecode.
4165
578098f3
PE
41662012-09-24 Paul Eggert <eggert@cs.ucla.edu>
4167
4168 image.c, indent.c: Use bool for booleans.
4169 * dispextern.h (struct image_type): Members valid_p, load, init
4170 now return bool, not int. All uses changed.
4171 * image.c: Omit unnecessary static decls.
4172 (x_create_bitmap_mask, x_build_heuristic_mask):
4173 Return void, not int, since callers don't care about the return value.
4174 (x_create_bitmap_mask, define_image_type, valid_image_p)
4175 (struct image_keyword, parse_image_spec, image_spec_value)
4176 (check_image_size, image_background)
4177 (image_background_transparent, x_clear_image_1)
4178 (postprocess_image, lookup_image, x_check_image_size)
4179 (x_create_x_image_and_pixmap, xbm_image_p)
4180 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
4181 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
4182 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
4183 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
4184 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
4185 (png_image_p, init_png_functions, png_load_body, png_load)
4186 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
4187 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
4188 (init_gif_functions, gif_load, imagemagick_image_p)
4189 (imagemagick_load_image, imagemagick_load, svg_image_p)
4190 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
4191 (gs_load):
4192 * nsimage.m (ns_load_image):
4193 * nsterm.m (ns_defined_color):
4194 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
4195 * xfns.c (x_defined_color):
4196 * xterm.c (x_alloc_lighter_color_for_widget)
4197 (x_alloc_nearest_color_1, x_alloc_nearest_color)
4198 (x_alloc_lighter_color):
4199 * indent.c (disptab_matches_widthtab, current_column)
4200 (scan_for_column, string_display_width, indented_beyond_p)
4201 (compute_motion, vmotion, Fvertical_motion):
4202 Use bool for booleans.
4203
a5f2b6ec
CY
42042012-09-24 Chong Yidong <cyd@gnu.org>
4205
4206 * chartab.c (Fset_char_table_default): Obsolete function removed.
4207
18e27ea8
PE
42082012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4209
afea8a8a
PE
4210 Move pid_t related decls out of lisp.h.
4211 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
4212 (interruptible_wait_for_termination):
4213 Move these decls from lisp.h to syswait.h, since they use pid_t.
4214 Needed on FreeBSD; see Herbert J. Skuhra in
4215 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
4216 * callproc.c: Include syswait.h.
4217
18e27ea8
PE
4218 gnutls.c, gtkutil.c: Use bool for boolean.
4219 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
4220 (emacs_gnutls_handle_error):
4221 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
4222 (xg_hide_tooltip, xg_create_frame_widgets)
4223 (create_dialog, xg_uses_old_file_dialog)
4224 (xg_get_file_with_chooser, xg_get_file_with_selection)
4225 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
4226 (xg_item_label_same_p, xg_update_menubar)
4227 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
4228 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
4229 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
4230 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
4231 (update_frame_tool_bar, free_frame_tool_bar):
4232 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
4233 * nsmenu.m (ns_update_menubar):
4234 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
4235 * xfns.c (Fx_show_tip) [USE_GTK]:
4236 Use bool for boolean.
4237 * gtkutil.c (xg_update_frame_menubar):
4238 * xmenu.c (update_frame_menubar):
4239 Return void, not int, since caller ignores return value.
4240 * gtkutil.c (xg_change_toolbar_position):
4241 Return void, not 1.
4242
af0e9f75
JB
42432012-09-23 Juanma Barranquero <lekktu@gmail.com>
4244
4245 * makefile.w32-in (BLOCKINPUT_H): Remove.
4246 (SYSSIGNAL_H): New macro.
4247 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
4248 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
4249 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
4250 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
4251 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
4252 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
4253 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
4254 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
4255 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
4256 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
4257 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
4258 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
4259 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
4260 ($(BLD)/w32xfns.$(O)): Update dependencies.
4261
5101529e
EZ
42622012-09-23 Eli Zaretskii <eliz@gnu.org>
4263
4264 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
4265 fatal_error_backtrace.
4266
4267 * w32proc.c (sys_kill): Undo last change: don't do anything when
4268 invoked to deliver SIGABRT to our own process. This is now
4269 handled by emacs_raise.
4270
2c3ee0ad
JB
42712012-09-23 Juanma Barranquero <lekktu@gmail.com>
4272
4273 * w32term.c (w32_read_socket): Remove leftover reference to
4274 interrupt_input_pending.
4275
62a1d661
PE
42762012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4277
4278 Do not use SA_NODEFER.
4279 Problem reported by Dani Moncayo in
4280 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
4281 * alloc.c (die):
4282 * sysdep.c (emacs_abort): Do not reset signal handler.
4283 * emacs.c (terminate_due_to_signal): Reset signal handler here.
4284 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
4285 wanted even on POSIXish hosts, and it doesn't work on Windows.
4286
a0942b9a
JD
42872012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4288
4289 * xterm.c (x_term_init): Call fixup_locale before and after calling
4290 gtk_init (Bug#12392).
4291
d07ff9db
CY
42922012-09-23 Chong Yidong <cyd@gnu.org>
4293
4294 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
4295 Vdynamic_library_alist.
4296
4297 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
4298 (Fgnutls_available_p): Caller changed.
4299
4300 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
4301 (Flibxml_parse_xml_region): Likewise.
4302
4303 * dispextern.h (struct image_type): Remove arg from init function.
4304
4305 * image.c (Finit_image_library, lookup_image_type)
4306 (define_image_type): Remove now-unneeded second arg.
4307 (init_xpm_functions, init_png_functions, init_jpeg_functions)
4308 (init_tiff_functions, init_gif_functions, init_svg_functions):
4309 Arglist and w32_delayed_load calling convention changed.
4310 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 4311 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 4312
4d7e6e51
PE
43132012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4314
4315 Simplify and avoid signal-handling races (Bug#12471).
4316 * alloc.c (die):
4317 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
4318 Avoid recursive loop if there's a fatal error in the function itself.
4319 * atimer.c (pending_atimers):
4320 * blockinput.h: Don't include "atimer.h"; no longer needed.
4321 (interrupt_input_pending): Remove. All uses removed.
4322 pending_signals now counts both atimers and ordinary interrupts.
4323 This is less racy than having three separate pending-signal flags.
4324 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
4325 (input_blocked_p):
4326 Rename from their upper-case counterparts BLOCK_INPUT,
4327 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
4328 INPUT_BLOCKED_P, and turn into functions. All uses changed.
4329 This makes it easier to access volatile variables more accurately.
4330 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
4331 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
4332 that's more reliable if the code is buggy and sets
4333 interrupt_input_blocked to a negative value. All uses changed.
4334 * atimer.c (deliver_alarm_signal):
4335 Remove. No need to deliver this to the parent; any thread can
4336 handle this signal now. All uses replaced by underlying handler.
4337 * atimer.c (turn_on_atimers):
4338 * dispnew.c (handle_window_change_signal):
4339 * emacs.c (handle_danger_signal):
4340 * keyboard.c (kbd_buffer_get_event):
4341 Don't reestablish signal handler; not needed with sigaction.
4342 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
4343 (UNBLOCK_INPUT_TO):
4344 Rework to avoid unnecessary accesses to volatile variables.
4345 (UNBLOCK_INPUT_TO): Now a function.
4346 (totally_unblock_input, unblock_input): New decls.
4347 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
4348 (init_data): Remove. Necessary stuff now done in init_signal.
4349 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
4350 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
4351 (fatal_error_code): Remove; no longer needed.
4352 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
4353 it doesn't always backtrace. All uses changed. No need to reset
4354 signal to default, since sigaction and/or die does that for us now.
4355 Use emacs_raise (FOO), not kill (getpid (), FOO).
4356 (main): Check more-accurately whether we're dumping.
4357 Move fatal-error setup to sysdep.c
4358 * floatfns.c: Do not include "syssignal.h"; no longer needed.
4359 * gtkutil.c (xg_get_file_name, xg_get_font):
4360 Remove no-longer-needed signal-mask manipulation.
4361 * keyboard.c, process.c (POLL_FOR_INPUT):
4362 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
4363 * keyboard.c (read_avail_input): Remove.
4364 All uses replaced by gobble_input.
4365 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
4366 (kbd_buffer_store_event_hold, gobble_input):
4367 (record_asynch_buffer_change) [USABLE_SIGIO]:
4368 (store_user_signal_events):
4369 No need to mess with signal mask.
4370 (gobble_input): If blocking input and there are terminals, simply
4371 set pending_signals to 1 and return. All hooks changed to not
4372 worry about whether input is blocked.
4373 (process_pending_signals): Clear pending_signals before processing
4374 them, in case a signal comes in while we're processing.
4375 By convention callers now test pending_signals before calling us.
4376 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
4377 New functions, to support changes to blockinput.h.
4378 (handle_input_available_signal): Now extern.
4379 (reinvoke_input_signal): Remove. All uses replaced by
4380 handle_async_input.
4381 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
4382 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
4383 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
4384 Clear sigmask reliably, even if Fsignal returns, which it can.
4385 Omit unnecessary accesses to volatile var.
4386 (quit_throw_to_read_char): No need to restore sigmask.
4387 * keyboard.c (gobble_input, handle_user_signal):
4388 * process.c (wait_reading_process_output):
4389 Call signal-handling code rather than killing ourselves.
4390 * lisp.h: Include <float.h>, for...
4391 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
4392 (pending_signals): Now volatile.
4393 (syms_of_data): Now const if IEEE floating point.
4394 (handle_input_available_signal) [USABLE_SIGIO]:
4395 (terminate_due_to_signal, record_child_status_change): New decls.
4396 * process.c (create_process): Avoid disaster if memory is exhausted
4397 while we're processing a vfork, by tightening the critical section
4398 around the vfork.
4399 (send_process_frame, process_sent_to, handle_pipe_signal)
4400 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
4401 ignores SIGPIPE.
4402 (send_process): No need for setjmp/longjmp any more, since the
4403 SIGPIPE stuff is now gone. Instead, report an error if errno
4404 is EPIPE.
4405 (record_child_status_change): Now extern. PID and W are now args.
4406 Return void, not bool. All callers changed.
4407 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
4408 Remove. All uses removed. This bug should be fixed now in a
4409 different way.
4410 (wait_for_termination_1): Use waitpid rather than sigsuspend,
4411 and record the child status change directly. This avoids the
4412 need to futz with the signal mask.
4413 (process_fatal_action): Move here from emacs.c.
4414 (emacs_sigaction_flags): New function, containing
4415 much of what used to be in emacs_sigaction_init.
4416 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
4417 caught by emacs, to make races less likely.
4418 (deliver_process_signal): Rename from handle_on_main_thread.
4419 All uses changed.
4420 (BACKTRACE_LIMIT_MAX): Now at top level.
4421 (thread_backtrace_buffer, threadback_backtrace_pointers):
4422 New static vars.
4423 (deliver_thread_signal, deliver_fatal_thread_signal):
4424 New functions, for more-accurate delivery of thread-specific signals.
4425 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
4426 (deliver_arith_signal): Handle in this thread, not
4427 in the main thread, since it's triggered by this thread.
4428 (maybe_fatal_sig): New function.
4429 (init_signals): New arg DUMPING so that we can be more accurate
4430 about whether we're dumping. Caller changed.
4431 Treat thread-specific signals differently from process-general signals.
4432 Block all signals while handling fatal error; that's safer.
4433 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
4434 on IEEE hosts.
4435 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
4436 Ignore SIGPIPE unless batch.
4437 (emacs_backtrace): Output backtrace for the appropriate thread,
4438 which is not necessarily the main thread.
4439 * syssignal.h: Include <stdbool.h>.
4440 (emacs_raise): New macro.
4441 * xterm.c (x_connection_signal): Remove; no longer needed
4442 now that we use sigaction.
4443 (x_connection_closed): No need to mess with sigmask now.
4444 (x_initialize): No need to reset SIGPIPE handler here, since
4445 init_signals does this for us now.
4446
8f4635e9
JD
44472012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4448
4449 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 4450 background rect may be larger (Bug#12245).
8f4635e9 4451
3296976d
CY
44522012-09-23 Chong Yidong <cyd@gnu.org>
4453
4454 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
4455
d41e491e
PE
44562012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4457
4458 * .gdbinit: Just stop at fatal_error_backtrace.
4459 See Stefan Monnier's request in
4460 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
4461 Remove no-longer-used query of system type.
4462
c88b867f
CY
44632012-09-22 Chong Yidong <cyd@gnu.org>
4464
4465 * search.c (Freplace_match): Doc fix (Bug#12325).
4466
4467 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
4468
4469 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
4470 (Fline_end_position): Doc fix.
4471
4472 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
4473
bb4d86b4
CY
44742012-09-22 Chong Yidong <cyd@gnu.org>
4475
4476 * dispextern.h (struct image_type): Add new slot, storing a type
4477 initialization function.
4478
4479 * image.c (define_image_type): Call the image initializer function
4480 if it is defined. Arguments and return value changed.
4481 (valid_image_p, make_image): Callers changed.
4482 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
4483 (gif_type, imagemagick_type, svg_type, gs_type):
4484 Add initialization functions.
bb4d86b4
CY
4485 (Finit_image_library): Call lookup_image_type.
4486 (CHECK_LIB_AVAILABLE): Macro deleted.
4487 (lookup_image_type): Call define_image_type here, rather than via
4488 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
4489 (syms_of_image): Move define_image_type calls for xbm_type and
4490 pbm_type to lookup_image_type.
4491
df9685f3
EZ
44922012-09-22 Eli Zaretskii <eliz@gnu.org>
4493
4494 * keyboard.c (timer_check_2): Move calculation of 'timers' and
4495 'idle_timers' from here ...
4496 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
4497 lists, to avoid infloops when the timer does something stupid,
4498 like reinvoke itself with the same or smaller time-out.
4499 (Bug#12447)
4500
8e17c9ba
MR
45012012-09-22 Martin Rudalics <rudalics@gmx.at>
4502
4503 * window.c (Fsplit_window_internal): Handle only Qt value of
4504 Vwindow_combination_limit separately.
4505 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
4506 (Vwindow_combination_limit): New default value.
4507 Rewrite doc-string.
8e17c9ba 4508
589bd69b
EZ
45092012-09-22 Eli Zaretskii <eliz@gnu.org>
4510
4511 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
4512 the new overlay string. (Bug#10159)
4513
01108e3f
PE
45142012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4515
4516 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
4517 or that fprintf is async-signal-safe. POSIX doesn't require
4518 either assumption.
4519
82f8cd94
CY
45202012-09-22 Chong Yidong <cyd@gnu.org>
4521
4522 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
4523 (Bug#8207).
4524
3cccbd87
KH
45252012-09-22 Kenichi Handa <handa@gnu.org>
4526
4527 * composite.c (composition_reseat_it): Handle the case that a
4528 grapheme cluster is not covered by a single font (Bug#12352).
4529
09c01941
CY
45302012-09-21 Chong Yidong <cyd@gnu.org>
4531
4532 * image.c (define_image_type): Avoid adding duplicate types to
4533 image_types (Bug#12463). Suggested by Jörg Walter.
4534
acfa068f 45352012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
4536
4537 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
4538 (print_load_command_name): Add case LC_DATA_IN_CODE.
4539 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
4540
acfa068f 45412012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
4542
4543 * eval.c (Frun_hook_with_args_until_success)
4544 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
4545
acfa068f 45462012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
4547
4548 * fileio.c (Ffile_selinux_context): Only call freecon when
4549 lgetfilecon succeeded.
4550 (Fset_file_selinux_context): Likewise. (Bug#12444)
4551
acfa068f 45522012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
4553
4554 * xdisp.c (try_window_reusing_current_matrix): Under bidi
4555 reordering, locate the cursor by calling set_cursor_from_row; if
4556 that fails, clear the desired glyph matrix before returning a
4557 failure indication to the caller. Fixes leaving garbled display
4558 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
4559 (compute_stop_pos_backwards): Fix a typo that caused crashes while
4560 scrolling through multibyte text.
aa36e4d2 4561
e99f70c8
SM
45622012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
4563
4564 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
4565 calling mark_vectorlike since that's the one that marks the window.
4566 (mark_discard_killed_buffers): Mark the final cdr.
4567 * window.h (struct window): Move prev/next_buffers to the
4568 non-standard fields.
4569 * window.c (make_window): Initialize prev/next_buffers manually.
4570
f75beb47
PE
45712012-09-20 Paul Eggert <eggert@cs.ucla.edu>
4572
4573 Omit unused arg EXPECTED from socket hooks.
4574 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
4575 * nsterm.m (ns_term_init):
4576 * termhooks.h (struct terminal.read_socket_hook):
4577 * w32inevt.c (w32_console_read_socket):
4578 * w32term.c (w32_read_socket):
4579 * xterm.c (XTread_socket):
4580 Omit unused arg EXPECTED. All callers changed.
4581 (store_user_signal_events): Return void, not int, since callers no
4582 longer care about the return value. All uses changed.
4583
b019b76a
JB
45842012-09-20 Juanma Barranquero <lekktu@gmail.com>
4585
4586 * w32gui.h (XParseGeometry): Do not declare.
4587
05642592
PE
45882012-09-19 Paul Eggert <eggert@cs.ucla.edu>
4589
e4bce92a 4590 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 4591 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
4592 <http://bugs.gnu.org/12471#8> (last line).
4593
05642592
PE
4594 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
4595 (XParseGeometry): Now static. Substitute extremal values for
4596 values that are out of range.
4597
e543ae91
JD
45982012-09-19 Jan Djärv <jan.h.d@swipnet.se>
4599
4600 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
4601
4602 * nsfns.m (XParseGeometry): Remove.
4603 (Fx_create_frame): Call x_set_offset to correctly interpret
4604 top_pos in geometry.
4605
3a880af4 4606 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
4607 (Fx_parse_geometry): If there is a space in string, call
4608 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
4609
45ba16c7
EZ
46102012-09-17 Eli Zaretskii <eliz@gnu.org>
4611
c8b9f1bc
EZ
4612 * search.c (scan_buffer): Use character positions in calls to
4613 region_cache_forward and region_cache_backward, not byte
4614 positions. (Bug#12196)
4615
b4c932a2
EZ
4616 * w32term.c (w32_read_socket): Set pending_signals to 1, like
4617 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
4618
45ba16c7
EZ
4619 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
4620 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
4621 emacs_blocked_malloc, now deleted.
4622
eeceac93
PE
46232012-09-17 Paul Eggert <eggert@cs.ucla.edu>
4624
4625 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
4626 The workaround was for improving performance on Solaris 2.4, but
4627 is getting in the way now. Emacs will still work if someone is
4628 still running Solaris 2.4 in a museum somewhere; Sun dropped
4629 support for Solaris 2.4 in 2003.
4630 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
4631 * process.c (create_process) [HAVE_WORKING_VFORK]:
4632 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
4633 since Emacs no longer uses vfork on that platform.
4634
78f83752
GM
46352012-09-17 Glenn Morris <rgm@gnu.org>
4636
4637 * emacs.c: Use COPYRIGHT.
4638
634b8cac
PE
46392012-09-16 Paul Eggert <eggert@cs.ucla.edu>
4640
0caaedb1
PE
4641 Remove configure's --without-sync-input option (Bug#12450).
4642 When auditing signal-handling in preparation for cleaning it up,
4643 I found that SYNC_INPUT has race conditions and would be a real
4644 pain to fix. Since it's an undocumented and deprecated
4645 configure-time option, now seems like a good time to remove it.
4646 Also see <http://bugs.gnu.org/11080#16>.
4647 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
4648 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
4649 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4650 (malloc_hysteresis):
4651 (check_depth) [XMALLOC_OVERRUN_CHECK]:
4652 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
4653 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
4654 (dont_register_blocks, bytes_used_when_reconsidered)
4655 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
4656 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
4657 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 4658 Remove. All uses removed.
0caaedb1
PE
4659 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
4660 implementation, one that depends on whether the new macro
4661 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
4662 is defined.
4663 * atimer.c (run_timers, handle_alarm_signal):
4664 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
4665 (handle_async_input, process_pending_signals)
4666 (handle_input_available_signal, init_keyboard):
4667 * nsterm.m (ns_read_socket):
4668 * process.c (wait_reading_process_output):
4669 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
4670 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
4671 (emacs_write):
4672 * xterm.c (XTread_socket):
4673 Assume SYNC_INPUT.
4674 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
4675 * eval.c (handling_signal): Remove. All uses removed.
4676 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
4677 All uses replaced with the SYNC_INPUT version.
4678 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
4679 Remove decls.
4680 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4681 Now static.
4682
634b8cac
PE
4683 * font.c (Ffont_shape_gstring): Remove unused local.
4684
83da1b55
GM
46852012-09-16 Glenn Morris <rgm@gnu.org>
4686
518650a5
GM
4687 * Makefile.in (clean): No longer run nextstep's clean.
4688
83da1b55
GM
4689 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
4690 (ns_frag): Remove.
4691 (ns-app): Move here from ns.mk, and simplify.
4692 (clean): Simplify nextstep entry.
4693 * ns.mk: Remove file.
4694
85a43e2e
KH
46952012-09-17 Kenichi Handa <handa@gnu.org>
4696
4697 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
4698 not covert the last few charactes.
4699
ba13e616 47002012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
4701
4702 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
4703 here, but just check the validity of glyphs in the glyph-string.
4704
a8c729af
MR
47052012-09-16 Martin Rudalics <rudalics@gmx.at>
4706
3a880af4
SM
4707 * window.c (Fwindow_parameter, Fset_window_parameter):
4708 Accept any window as argument (Bug#12452).
a8c729af 4709
c077c059
JD
47102012-09-16 Jan Djärv <jan.h.d@swipnet.se>
4711
4712 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
4713 to ns_term_init to avoid memory leak.
4714
4715 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
4716 explicit retain/release.
4717 (ns_term_init): Only allow one display. Initialize outerpool and
4718 ns_*_types.
4719
39a57ad0
PE
47202012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4721
4722 Port _setjmp fix to POSIXish hosts as well as Microsoft.
4723 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
4724 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
4725 the Microsoft problem in a different way, by altering ../nt/config.nt.
4726
7105c8cb
EZ
47272012-09-15 Eli Zaretskii <eliz@gnu.org>
4728
4729 * w32xfns.c:
4730 * w32uniscribe.c:
4731 * w32term.c:
4732 * w32select.c:
4733 * w32reg.c:
4734 * w32proc.c:
4735 * w32menu.c:
4736 * w32inevt.c:
4737 * w32heap.c:
4738 * w32font.c:
4739 * w32fns.c:
4740 * w32console.c:
4741 * w32.c:
4742 * w16select.c: Remove inclusion of setjmp.h, as it is now included
4743 by lisp.h. This completes removal of setjmp.h inclusion
4744 erroneously announced in the previous commit. (Bug#12446)
4745
4746 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
4747 more accurate.
4748
4749 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
4750 not defined as a macro. The latter happens on MS-Windows.
4751 (Bug#12446)
4752
0328b6de
PE
47532012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4754
4755 Port better to POSIX hosts lacking _setjmp (Bug#12446).
4756 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 4757 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
4758 only reason for the instance was because "lisp.h" was included.
4759 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
4760 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
4761 and _longjmp with the new symbols. Emacs already uses _setjmp if
4762 available, so this change affects only POSIXish hosts that have
4763 sigsetjmp but not _setjmp, such as some versions of Solaris and
4764 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
4765 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
4766 (png_load_body) [HAVE_PNG]:
4767 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
4768 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
4769 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
4770 since PNG requires jmp_buf. This is the only exception to the
4771 general rule that we now use sys_setjmp and sys_longjmp.
4772 This exception is OK since this code does not change the signal
4773 mask or longjmp out of a signal handler.
4774
2af03429
PE
47752012-09-14 Paul Eggert <eggert@cs.ucla.edu>
4776
4777 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4778 Include "syssignal.h", for 'main_thread'.
4779
2f294edf
DA
47802012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
4781
4782 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
4783 * insdel.c (replace_range, replace_range_2):
4784 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
4785 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
4786 Remove redundant check before calling offset_intervals.
4787
6b533e9c
MR
47882012-09-14 Martin Rudalics <rudalics@gmx.at>
4789
4790 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
4791 current buffer (Bug#12387).
4792
2a7931e3
JB
47932012-09-14 Juanma Barranquero <lekktu@gmail.com>
4794
4795 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
4796
c18e885b
PE
47972012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4798
4799 Use a more backwards-compatible timer format (Bug#12430).
4800 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
4801 vector element, not from the 4th, since PSECS is now at the end.
4802 (Fcurrent_idle_time): Doc fix.
4803
d59a1afb
DA
48042012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
4805
4806 Function to mark objects and remove killed buffers at once.
4807 * alloc.c (discard_killed_buffers): Rename to ...
4808 (mark_discard_killed buffers) ... new name. Add marking
4809 of remaining objects. Fix comment. Adjust users.
4810 (mark_object): Do not touch frame buffer lists here.
4811 * frame.c (delete_frame): Reset frame buffer lists here.
4812
5f0cb45a
PE
48132012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4814
8ea47e3a
PE
4815 Better workaround for GNOME bug when --enable-gcc-warnings.
4816 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
4817 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
4818 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
4819
4a4bbad2
PE
4820 Simplify SIGIO usage (Bug#12408).
4821 The code that dealt with SIGIO was crufty and confusing, e.g., it
4822 played tricks like "#undef SIGIO" but these tricks were not used
4823 consistently. Simplify mostly by not #undeffing standard symbols,
4824 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
4825 or not as we please) rather than "defined SIGIO" (standard symbol
4826 that we probably shouldn't #undef).
4827 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
4828 Modules that need it can include it.
4829 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
4830 * dispextern.h (ignore_sigio): New decl.
4831 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
4832 unconditionally, since it's now a no-op if !USABLE_SIGIO.
4833 * emacs.c (shut_down_emacs):
4834 * keyboard.c (kbd_buffer_store_event_hold):
4835 Use ignore_sigio rather than invoking 'signal' directly.
4836 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
4837 for FIONREAD.
4838 (FIONREAD, SIGIO): Do not #undef.
4839 (tty_read_avail_input): Use #error rather than a syntax error.
4840 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
4841 for I_PIPE, used by SETUP_SLAVE_PTY.
4842 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
4843 * sysdep.c (croak): Remove; no longer needed. This bit of
4844 temporary code, with Fred N. Fish's comment that it's temporary,
4845 has been in Emacs since at least 1992!
4846 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
4847 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
4848 * syssignal.h (croak): Remove decl.
4849 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
4850 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
4851 now that we're termios-only.
4852 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
4853 * term.c (dissociate_if_controlling_tty): Use #error rather than
4854 a run-time error.
4855
5f0cb45a
PE
4856 Work around GCC and GNOME bugs when --enable-gcc-warnings.
4857 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
4858 to work around GNOME bug 683906.
4859 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
4860 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
4861 This works around GCC bug 54561.
4862
40bce90b
PE
48632012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4864
4865 More fixes for 'volatile' and setjmp/longjmp.
4866 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
4867 * image.c (struct png_load_context) [HAVE_PNG]: New type.
4868 (png_load_body) [HAVE_PNG]:
4869 (jpeg_load_body) [HAVE_JPEG]:
4870 New function, with most of the old parent function's body.
4871 (png_load) [HAVE_PNG]:
4872 (jpeg_load) [HAVE_JPEG]:
4873 Invoke the new function, to avoid longjmp munging our locals.
4874 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
4875 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
4876 longjmp is passed 2, as the C standard doesn't guarantee this.
4877 Instead, store the failure code into mgr->failure_code.
4878
bfeae2cf
SM
48792012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4880
4881 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
4882 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
4883 (syms_of_keyboard): Remove support for unread-command-char.
4884
8099e36b
EZ
48852012-09-12 Eli Zaretskii <eliz@gnu.org>
4886
4887 * w32proc.c (sys_kill): If PID is our process ID and the signal is
4888 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
4889 violation. (Bug#12426)
4890
92547ff9
PE
48912012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4892
4893 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
4894
45b82ad0
SM
48952012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4896
4897 * eval.c: Add `inhibit-debugger'.
4898 (Qinhibit_debugger): New symbol.
4899 (call_debugger): Bind it instead of Qdebug_on_error.
4900 (maybe_call_debugger): Test Vinhibit_debugger.
4901 (syms_of_eval): Define inhibit-debugger.
4902 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
4903 (syms_of_xdisp): Remove inhibit-debug-on-message.
4904
5779a1dc
PE
49052012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4906
50f2e553
PE
4907 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
4908 If a nonvolatile local variable is written before a _longjmp to
4909 the frame containing the variable, and is read after the _longjmp,
4910 the value read is indeterminate. Some local variables of type
4911 'struct handler' and 'struct catchtag' are used in this way, so
4912 mark each of their slots as volatile if the slot can be set before
4913 _longjmp and read afterwards.
4914 * lisp.h (struct handler): var and chosen_clause are now volatile.
4915 (struct catchtag): val, next, and pdlcount are now volatile.
4916
ae1d87e2
PE
4917 * bidi.c (bidi_push_it, bidi_pop_it):
4918 * fns.c (copy_hash_table):
4919 * image.c (define_image_type):
4920 * keyboard.c (kbd_buffer_store_event_hold):
4921 * process.c (Fprocess_send_eof):
4922 * xfaces.c (x_create_gc) [HAVE_NS]:
4923 * xgselect.c (xg_select):
4924 Prefer assignment to memcpy when either will do.
4925
5779a1dc
PE
4926 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
4927 Use pointer-to-a-pointer to simplify and avoid a NILP check each
4928 time an item is removed. No need to mark this function 'inline';
4929 the compiler knows better than we do.
4930
c4c9756b
JD
49312012-09-11 Jan Djärv <jan.h.d@swipnet.se>
4932
4933 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
4934 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
4935 to change_frame_size (Bug#12388).
4936 (windowDidResize:): Pass YES to updateFrameSize.
4937
4938 * nsterm.h: Add delay parameter to updateFrameSize.
4939
d73e321c
DA
49402012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4941
4942 Discard killed buffers from deleted window and frame objects.
4943 This reduces an amount of references to killed buffers and
4944 helps GC to reclaim them faster.
4945 * alloc.c (discard_killed_buffers): New function.
4946 (mark_object): Use it for deleted windows and frames.
4947 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 4948 or deleted frame, restore its global binding.
d73e321c
DA
4949 * data.c (swap_in_global_binding): Add GC notice.
4950 (swap_in_symval_forwarding): Use convenient set_blv_where.
4951 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
4952 * window.h: ... to here.
4953
e578f381
DA
49542012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4955
4956 Convenient macro to check whether the buffer is live.
4957 * buffer.h (BUFFER_LIVE_P): New macro.
4958 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
4959 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
4960
3057e615
YM
49612012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4962
4963 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
4964 composition cases (Bug#12364).
4965
4966 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
4967 overhang of succeeding glyphs overlapping box cursor.
4968
4969 * w32term.c (x_draw_glyph_string): Likewise.
4970
6fda35f2
PE
49712012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4972
c990426a
PE
4973 Simplify, document, and port floating-point (Bug#12381).
4974 The porting part of this patch fixes bugs on non-IEEE platforms
4975 with frexp, ldexp, logb.
4976 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
4977 Now static.
4978 * floatfns.c: Simplify discussion of functions that Emacs doesn't
4979 support, by removing commented-out code and briefly listing the
4980 C89 functions excluded. The commented-out stuff was confusing
4981 maintenance, e.g., we thought we needed cbrt but it was commented out.
4982 (logb): Remove decl; no longer needed.
4983 (isfinite): New macro, if not already supplied.
4984 (isnan): Don't replace any existing macro.
4985 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
4986 are present on all C89 platforms.
4987 (Ffrexp): Do not special-case zero, as frexp does the right thing
4988 for that case.
4989 (Flogb): Do not use logb, as it doesn't have the desired meaning
4990 on hosts that use non-base-2 floating point. Instead, stick with
4991 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
4992 frexp, to avoid getting an unspecified result.
4993
6fda35f2
PE
4994 * xdisp.c (Qinhibit_debug_on_message): Now static.
4995
16130a58
JD
49962012-09-10 Jan Djärv <jan.h.d@swipnet.se>
4997
4998 * nsterm.m (ns_update_begin): Set clip path to whole view by using
4999 NSBezierPath (Bug#12131).
5000
d105a573
CY
50012012-09-10 Chong Yidong <cyd@gnu.org>
5002
5003 * fns.c (Fdelq, Fdelete): Doc fix.
5004
ff55dfe8
PE
50052012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5006
5007 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5008 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5009
e7032e7c
SM
50102012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
5011
5012 * lisp.h (make_lisp_ptr): New macro to replace XSET.
5013 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
5014 Use it.
5015
e9957956
EZ
50162012-09-09 Eli Zaretskii <eliz@gnu.org>
5017
aba05ce9
EZ
5018 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
5019 left fringe if the window has a left margin. This avoids leaving
5020 traces of the cursor because its leftmost pixel is not drawn over.
5021
e9957956
EZ
5022 * dispnew.c (update_window_line): When the left margin area of a
5023 screen line is updated, set the redraw_fringe_bitmaps_p flag of
5024 that screen line. (Bug#12277)
5025
f6196b87
PE
50262012-09-09 Paul Eggert <eggert@cs.ucla.edu>
5027
5028 Assume C89 or later for math functions (Bug#12381).
5029 This simplifies the code, and makes it a bit smaller and faster,
5030 and (most important) makes it easier to clean up signal handling
5031 since we can stop worring about floating-point exceptions in
5032 library code. That was a problem before C89, but the problem
5033 went away many years ago on all practical Emacs targets.
5034 * data.c, image.c, lread.c, print.c:
5035 Don't include <math.h>; no longer needed.
5036 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
5037 might be autoconfigured, as that never happens.
5038 * data.c (fmod):
5039 * doprnt.c (DBL_MAX_10_EXP):
5040 * print.c (DBL_DIG):
5041 Remove. C89 or later always defines these.
5042 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
5043 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
5044 (arith_error, domain_error, domain_error2):
5045 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
5046 no longer needed -- we simply return what C returns. All uses removed.
5047 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
5048 the wrapped code.
5049 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
5050 Remove. All uses expanded, as these macros are no longer used
5051 more than once and are now more trouble than they're worth.
5052 (Ftan): Use tan, not sin / cos.
5053 (Flogb): Assume C89 frexp.
5054 (fmod_float): Assume C89 fmod.
5055 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
5056 (init_floatfns): Remove. All uses removed.
5057
9d7f1863
JD
50582012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5059
5060 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
5061 compositeToPoint for OSX < 10.6 (Bug#12390).
5062
eabf0404
PE
50632012-09-08 Paul Eggert <eggert@cs.ucla.edu>
5064
5065 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
5066 This produces more-accurate results.
5067
0b3b1d23
JD
50682012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5069
5070 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
5071 changes (Bug#12088).
5072
6dcef6ec
CY
50732012-09-08 Chong Yidong <cyd@gnu.org>
5074
5075 * syntax.c (Fstring_to_syntax): Doc fix.
5076
aa7d57c5
JD
50772012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5078
5079 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
5080 in the internal border.
5081 (x_set_window_size): Remove static variables and their usage.
5082 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
5083 (ns_after_update_window_line, ns_draw_fringe_bitmap):
5084 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
5085 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
5086 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
5087 (ns_fix_rect_ibw): Remove.
5088 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
5089 (ns_dumpglyphs_box_or_relief): Ditto.
5090 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
5091 adjustment.
5092 (ns_dumpglyphs_image): Ditto.
fc0c31f8 5093 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
5094 border adjustment.
5095 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
5096 their usage. Add fringe_extended_p and its use as in other terms.
5097 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
5098 scroll bar was removed.
5099 (updateFrameSize): New function.
5100 (windowDidResize): Move code to updateFrameSize and call it.
5101
5102 * nsterm.h (EmacsView): Add updateFrameSize.
5103
1a5432bc
CY
51042012-09-07 Chong Yidong <cyd@gnu.org>
5105
b4f5313e
CY
5106 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
5107
1a5432bc
CY
5108 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
5109
1a4f1e9b
PE
51102012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5111
5112 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
5113 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
5114 Problem introduced when merging patches. Noted by Eli Zaretskii in
5115 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
5116 * floatfns.c: Comment fix.
5117 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
5118 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
5119 and anyway the declaration is harmless even if SIGDANGER is not defined.
5120 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
5121 defined BROKEN_FIONREAD). systty.h formerly did this, but other
5122 source files not surprisingly expected syssignal.h to define, or
5123 not define, SIGIO, and it's cleaner to do it that way, for consistency.
5124 Include <sys/ioctl.h>, for FIONREAD.
5125 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
5126 This eliminates a problem whereby other files mysteriously had
5127 to include "syssignal.h" before including "systty.h" if they
5128 wanted to use "#ifdef SIGIO".
5129
bc8000ff
EZ
51302012-09-07 Eli Zaretskii <eliz@gnu.org>
5131
3e6d6928
EZ
5132 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
5133
5134 * w32.c (sigemptyset): Empty the set.
5135 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
5136
bc8000ff
EZ
5137 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
5138
b4fa72f2
DA
51392012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
5140
5141 * alloc.c (mark_buffer): Revert unsafe marking optimization.
5142 (mark_object): Likewise for frame objects.
5143
30730c93
PE
51442012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5145
5146 * syssignal.h (handle_on_main_thread): Always declare,
5147 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
5148 This ports to platforms without HAVE_PTHREAD.
5149
2fe28299
PE
51502012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5151
5152 Signal-handler cleanup (Bug#12327).
5153 Emacs's signal handlers were written in the old 4.2BSD style with
5154 sigblock and sigmask and so forth, and this led to some
5155 inefficiencies and confusion. Rewrite these to use
5156 pthread_sigmask etc. without copying signal sets around. Also,
5157 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
5158 'signal', and instead use functions that do not attempt to take
5159 over the system name space. This patch causes Emacs's text
5160 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
5161 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
5162 Do not include <signal.h> or "syssignal.h", as these
5163 modules do not use signals.
5164 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
5165 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
5166 Do not include <signal.h>, as "syssignal.h" does that for us now.
5167 * atimer.c (sigmask_atimers): New function.
5168 (block_atimers, unblock_atimers): New functions,
5169 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
5170 All uses replaced.
5171 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
5172 no longer needed here.
5173 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 5174 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
5175 * sysdep.c (struct save_signal): New member 'action', replacing
5176 old member 'handler'.
5177 (save_signal_handlers, restore_signal_handlers):
5178 Use sigaction instead of 'signal' to save and restore.
5179 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
5180 New function. All users of 'signal' modified to use set_sighandler
5181 if they're writeonly, and to use sys_signal if they're read+write.
5182 (emacs_sigaction_init, forwarded_signal): New functions.
5183 (sys_signal): Remove. All uses replaced by calls to sigaction
5184 and emacs_sigaction_init, or by direct calls to 'signal'.
5185 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
5186 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
5187 all uses replaced by pthread_sigmask etc. calls.
5188 * syssignal.h: Include <signal.h>.
5189 (emacs_sigaction_init, forwarded_signal): New decls.
5190 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
5191 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
5192 (sigmask, sys_sigmask): Remove; no longer needed.
5193 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
5194 (sigblock, sigunblock, sigfree):
5195 (sigsetmask) [!defined sigsetmask]:
5196 Remove. All uses replaced by pthread_sigmask.
5197 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
5198 no longer need to be replaced, and its typical old uses
5199 are now done via emacs_sigaction_init and sigaction.
5200 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
5201 (sys_sigdel): Remove; unused.
5202 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
5203
0216c128
EZ
52042012-09-06 Eli Zaretskii <eliz@gnu.org>
5205
5206 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
5207 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
5208
c752cfa9
DA
52092012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5210
5211 Explicitly mark buffer_defaults and buffer_local_symbols.
5212 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
5213 mark_local_symbols here.
5214 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
5215 since special buffers aren't marked here any more.
5216 (allocate_buffer): Chain new buffer with all_buffers here...
5217 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
5218 not here.
5219 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
5220 (syms_of_buffer): Remove staticpro of the above.
5221 (init_buffer_once): Set names for buffer_defaults and
5222 buffer_local_symbols.
5223
a864ef14
PE
52242012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5225
5226 Use bool for booleans in font-related modules.
5227 * font.c (font_intern_prop, font_style_to_value)
5228 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
5229 (generate_otf_features, font_check_otf_features, font_check_otf)
5230 (font_match_p, font_list_entities, font_at):
5231 * fontset.c (fontset_id_valid_p, reorder_font_vector
5232 (fontset_find_font, Fset_fontset_font)
5233 (face_suitable_for_char_p) [0]:
5234 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
5235 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
5236 (m17n_flt_initialized, ftfont_shape_by_flt):
5237 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
5238 * nsfont.m (nsfont_draw):
5239 * w32font.c (w32font_draw):
5240 * w32term.c (x_draw_glyphless_glyph_string_foreground):
5241 Use bool for booleans.
5242 * font.h: Adjust to above API changes.
5243 (struct font, struct font_driver, struct font_driver_list):
5244 Use bool for booleans.
5245 (struct font): Remove useless member encoding_type.
5246 All users removed.
5247 * fontset.c, xftfont.c: Omit unnecessary static decls.
5248
0699fc18
DA
52492012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5250
5251 * alloc.c (mark_object): Revert window marking code
5252 since it's unsafe for the Fset_window_configuration.
5253
20ef56db
PE
52542012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5255
2fe28299 5256 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
5257 Be more systematic about preserving errno whenever a signal
5258 handler returns, even if it's not in the main thread. Do this by
5259 renaming signal handlers to distinguish between signal delivery
5260 and signal handling. All uses changed.
5261 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
5262 * data.c (deliver_arith_signal): Rename from arith_error.
5263 * dispnew.c (deliver_window_change_signal): Rename from
5264 window_change_signal.
5265 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
5266 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
5267 * keyboard.c (deliver_input_available_signal): Rename from
5268 input_available_signal.
5269 (deliver_user_signal): Rename from handle_user_signal.
5270 (deliver_interrupt_signal): Rename from interrupt_signal.
5271 * process.c (deliver_pipe_signal): Rename from send_process_trap.
5272 (deliver_child_signal): Rename from sigchld_handler.
5273 * atimer.c (handle_alarm_signal):
5274 * data.c (handle_arith_signal):
5275 * dispnew.c (handle_window_change_signal):
5276 * emacs.c (handle_fatal_signal, handle_danger_signal):
5277 * keyboard.c (handle_input_available_signal):
5278 * keyboard.c (handle_user_signal, handle_interrupt_signal):
5279 * process.c (handle_pipe_signal, handle_child_signal):
5280 New functions, with the actual signal-handling code taken from the
5281 original respective signal handlers, sans the sporadic attempts to
5282 preserve errno, since that's now done by handle_on_main_thread.
5283 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
5284 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
5285 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5286 Move to sysdep.c.
5287 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5288 Move initialization of main_thread to sysdep.c's init_signals.
5289 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
5290 our usage, and simplifies the mainline code.
5291 (record_child_status_change): New static function, as a helper
5292 for handle_child_signal, and with most of the old child handler's
5293 contents.
5294 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
5295 (handle_child_signal): Use the above.
5296 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5297 Moved here from emacs.c.
5298 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
5299 code moved here from emacs.c's main function.
5300 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
5301 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
5302 This lets callers save and restore errno properly.
20ef56db 5303
e3ccf108
DA
53042012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5305
5306 Remove redundant or unused things here and there.
5307 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
5308 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
5309 * editfns.c (Fcompare_buffer_substrings): Likewise.
5310 * frame.h (struct terminal, struct font_driver_list):
5311 Remove redundant declarations.
5312 * window.h (Qleft, Qright): Likewise.
5313
697e1e39
DA
53142012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5315
5316 Do not mark objects from deleted buffers, windows and frames.
5317 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
5318 (mark_object): Likewise for windows and frames.
5319
c1ca42ca
DA
53202012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5321
5322 * alloc.c (valid_lisp_object_p): Treat killed buffers,
5323 buffer_defaults and buffer_local_symbols as valid objects.
5324 Return special value to denote them.
5325
014d93be
PE
53262012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5327
f75d7a91
PE
5328 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
5329 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
5330 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
5331 (file_name_absolute_p, Fsubstitute_in_file_name):
5332 (check_executable, check_writable, Ffile_accessible_directory_p)
5333 (Fset_file_selinux_context, Fdefault_file_modes)
5334 (Finsert_file_contents, choose_write_coding_system)
5335 (Fwrite_region, build_annotations, a_write, e_write)
5336 (Fdo_auto_save):
5337 * filelock.c (boot_time_initialized, get_boot_time)
5338 (get_boot_time_1, lock_file_1, within_one_second):
5339 * floatfns.c (in_float):
5340 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
5341 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
5342 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
5343 * lisp.h (struct Lisp_Hash_Table.cmpfn):
5344 * window.c (compare_window_configurations):
5345 Use bool for booleans.
5346 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
5347 (Fdefault_file_modes): Now mode_t, not int, for modes.
5348 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
5349 (internal_delete_file): Now returns void, not a (boolean) int,
5350 since nobody was looking at the return value.
5351 * lisp.h, window.h: Adjust to above API changes.
5352
014d93be
PE
5353 * xdisp.c (set_message): Simplify and reindent last change.
5354
776f29e1
JB
53552012-09-05 Juanma Barranquero <lekktu@gmail.com>
5356
5357 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
5358
7f7e0167
LI
53592012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
5360
5361 * eval.c (call_debugger): Make the function non-static so that we
5362 can call it from set_message.
5363
5364 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
5365 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
5366
cf29dd84
PE
53672012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5368
5369 Give more-useful info on a fatal error (Bug#12328).
5370 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
5371 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
5372 of doing the work ourselves.
5373 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
5374 do most of the work.
5375 (fatal_error_backtrace): New function, taken from the guts
5376 of the old fatal_error_signal, but with a new option to output
5377 a backtrace.
5378 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
5379 info about the signal than just its number.
5380 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
5381 * sysdep.c: Include <execinfo.h>
5382 (emacs_backtrace): New function, taken partly from the previous
5383 code of the 'die' function.
5384 (emacs_abort): Call fatal_error_backtrace rather than abort.
5385
972debf2
SM
53862012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
5387
5388 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
5389 eager (load-time) macro-expansion.
5390 * lisp.mk (lisp): Add macroexp.
5391
1088b922
PE
53922012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5393
5394 Simplify redefinition of 'abort' (Bug#12316).
5395 Do not try to redefine the 'abort' function. Instead, redo
5396 the code so that it calls 'emacs_abort' rather than 'abort'.
5397 This removes the need for the NO_ABORT configure-time macro
5398 and makes it easier to change the abort code to do a backtrace.
5399 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
5400 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
5401 Remove; sysdep.c's emacs_abort now takes its place.
5402 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
5403 'abort' changed to use 'emacs_abort'.
5404 * msdos.c (dos_abort) [defined abort]: Remove; not used.
5405 (abort) [!defined abort]: Rename to ...
5406 (emacs_abort): ... new name.
5407 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
5408 the place of the old 'abort' in emacs.c.
5409 * w32.c, w32fns.c (abort): Do not #undef.
5410 * w32.c (emacs_abort): Rename from w32_abort.
5411
30934d33
EZ
54122012-09-04 Eli Zaretskii <eliz@gnu.org>
5413
5414 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
5415 offsets[j].dv, since the y axis of the screen coordinates points
5416 down, while the y axis of the font definition coordinates points
5417 up. This fixes display of Arabic diacritics such as KASRA and
5418 KASRATAN. (Bug#11860)
5419
af26b72c
PE
54202012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5421
5422 Be more systematic about _setjmp vs setjmp.
5423 * alloc.c (test_setjmp, mark_stack):
5424 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
5425 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
5426 (png_load, my_error_exit, jpeg_load):
5427 * process.c (send_process_trap, send_process):
5428 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
5429 The underscored versions are up to 30x faster on some hosts.
5430 Formerly, the code used setjmp+longjmp sometimes and
5431 _setjmp+_longjmp at other times, with no particular reason to
5432 prefer setjmp+longjmp.
5433
26d4541d
PE
54342012-09-03 Paul Eggert <eggert@cs.ucla.edu>
5435
d42f4f0f 5436 Fix minor problem found by static checking.
26d4541d 5437 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 5438
c5e28e39
MR
54392012-09-03 Martin Rudalics <rudalics@gmx.at>
5440
5441 * buffer.c (Fdelete_all_overlays): New function.
5442
3eab3ca9
CY
54432012-09-03 Chong Yidong <cyd@gnu.org>
5444
5445 * gtkutil.c: Add extern decl for Qxft.
5446
c04889f8
PE
54472012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5448
1882aa38
PE
5449 * emacs.c, eval.c: Use bool for boolean.
5450 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
5451 (malloc_using_checking) [DOUG_LEA_MALLOC]:
5452 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
5453 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
5454 (main, decode_env_path, Fdaemon_initialized):
5455 * eval.c (call_debugger, Finteractive_p, interactive_p):
5456 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
5457 (maybe_call_debugger, Fbacktrace):
5458 * process.c (read_process_output, exec_sentinel):
5459 Use bool for booleans.
5460 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
5461 All callers changed.
5462 * eval.c (interactive_p): Omit always-true boolean argument
5463 EXCLUDE_SUBRS_P. All callers changed.
5464 * dispextern.h, lisp.h: Reflect above API changes.
5465 * firstfile.c (dummy): Use the address of 'main', whose signature
5466 won't change, instead of the address of 'initialize', whose
5467 signature just changed from int to bool.
5468 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
5469 * msdos.c (fatal_error_in_progress): ... from here.
5470 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
5471 of incrementing it.
5472 (redisplay_internal, unwind_redisplay): Simply clear
5473 REDISPLAYING_P when unwinding, instead of saving its previous,
5474 always-false value and then restoring it.
5475
a411ac43
PE
5476 Clean up some extern decls.
5477 Mostly, this hoists extern decls out of .c files and into .h files.
5478 That way, we're more likely to catch errors if the interfaces change.
5479 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
5480 declare xg_mark_data.
5481 * dispextern.h (x_frame_parm_handlers):
5482 * font.h (Qxft):
5483 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
5484 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
5485 (Qultra_bold, Qoblique, Qitalic):
5486 Move extern decl here from .c file.
5487 * alloc.c (xg_mark_data) [USE_GTK]:
5488 * doc.c (Qclosure):
5489 * eval.c (Qlexical_binding):
5490 * fns.c (time) [!HAVE_UNISTD_H]:
5491 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
5492 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
5493 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
5494 * lread.c (Qinternal_interpreter_environment):
5495 * minibuf.c (Qbuffer):
5496 * process.c (QCfamily, QCfilter):
5497 * widget.c (free_frame_faces):
5498 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
5499 * xfont.c (x_clear_errors):
5500 * xterm.c (x_frame_parm_handlers):
5501 Remove now-redundant extern decls.
5502 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
5503 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
5504 Now static.
5505 * xfaces.c: Remove unnecessary static decls.
5506 * xterm.c (updating_frame): Remove decl of nonexistent object.
5507
c04889f8
PE
5508 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
5509 when building globals.h, as the objects that are not built on
5510 this host are not needed to compile C files on this host.
5511
8b339673
JD
55122012-09-02 Jan Djärv <jan.h.d@swipnet.se>
5513
5514 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
5515
5516 * frame.h: Add missing prototype for x_wm_set_size_hint.
5517
a08d4ba7
PE
55182012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5519
5520 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
5521 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
5522 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
5523 (Fsubstitute_command_keys):
5524 * editfns.c (region_limit, find_field, Fconstrain_to_field)
5525 (save_excursion_save, save_excursion_restore)
5526 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
5527 (format_time_string, general_insert_function)
5528 (make_buffer_string, make_buffer_string_both)
5529 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
5530 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
5531 (copy_text, insert_1, insert_1_both, insert_from_string)
5532 (insert_from_string_before_markers, insert_from_string_1)
5533 (insert_from_buffer, insert_from_buffer_1, replace_range)
5534 (replace_range_2, del_range_1, del_range_byte, del_range_both)
5535 (del_range_2, modify_region):
5536 * intervals.c (intervals_equal, balance_possible_root_interval)
5537 (adjust_intervals_for_insertion, merge_properties_sticky)
5538 (graft_intervals_into_buffer, lookup_char_property)
5539 (adjust_for_invis_intang, set_point_both)
5540 (get_property_and_range, compare_string_intervals)
5541 (set_intervals_multibyte_1, set_intervals_multibyte):
5542 * keyboard.c (decode_timer):
5543 Use bool for boolean.
5544 * intervals.h, lisp.h, systime.h: Reflect above API changes.
5545 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
5546
48c948de
CY
55472012-09-02 Chong Yidong <cyd@gnu.org>
5548
5549 * keymap.c (push_key_description): Print M-TAB as C-M-i
5550 (Bug#11758).
5551
6c49a40b
JB
55522012-09-02 Juanma Barranquero <lekktu@gmail.com>
5553
5554 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
5555 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
5556 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
5557 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
5558 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
5559 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
5560 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5561
4dfbd238
EZ
55622012-09-01 Eli Zaretskii <eliz@gnu.org>
5563
7e510e28
EZ
5564 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
5565 more than one grapheme cluster passed to the shaper: compute the
5566 offset adjustment values separately for each cluster. (Bug#11860)
5567
4dfbd238
EZ
5568 * image.c: Restore mistakenly removed inclusion of w32.h. Without
5569 it, GCC doesn't see prototypes of w32_delayed_load, and complains
5570 about implicit conversions from integer to pointer.
5571
86571ae0
DC
55722012-09-01 Daniel Colascione <dancol@dancol.org>
5573
5574 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
5575 system used too early.
5576
0e23ef9d
PE
55772012-09-01 Paul Eggert <eggert@cs.ucla.edu>
5578
5579 Better seed support for (random).
5580 * emacs.c (main): Call init_random.
5581 * fns.c (Frandom): Set the seed from a string argument, if given.
5582 Remove long-obsolete Gentzel cruft.
5583 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
5584 (init_random): New function.
5585
17a2cbbd
DC
55862012-09-01 Daniel Colascione <dancol@dancol.org>
5587
5588 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
5589 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
5590 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
5591 x_wm_set_size_hint, x_query_colors, x_real_positions,
5592 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
5593 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
5594 all of which have been moved to common code.
5595
5596 * xfaces.c: Include TERM_HEADER instead of listing all possible
5597 window-system headers.
5598
5599 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
5600 to match header.
5601
5602 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
5603 directly accessing frame internals.
5604
f18cbb28 5605 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
5606 globals_of_w32font.
5607
5608 * process.c: Include TERM_HEADER instead of listing all possible
5609 window-system headers.
5610
3a880af4
SM
5611 * nsterm.h: Remove declarations now in frame.h.
5612 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
5613
5614 * menu.c: Include TERM_HEADER instead of listing all possible
5615 window-system headers.
5616
5617 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
5618 window system.
5619
5620 * keyboard.c: Include TERM_HEADER instead of listing all possible
5621 window-system headers.
5622
5623 * image.c: Include TERM_HEADER instead of listing all possible
5624 window-system headers. Declare Vlibrary_cache when compiling for
5625 Windows.
5626
5627 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
5628 window system declarations.
5629
5630 * frame.h: Move common functions here: set_frame_menubar,
5631 x_set_window_size, x_sync, x_get_focus_frame,
5632 x_set_mouse_position, x_set_mouse_pixel_position,
5633 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
5634 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
5635 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
5636 x_activate_menubar, x_real_positions, x_bitmap_icon,
5637 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
5638 and x_query_colors.
5639
5640 * frame.c: Include TERM_HEADER instead of listing all possible
5641 window-system headers.
5642
5643 * font.c: Include TERM_HEADER instead of listing all possible
5644 window-system headers.
5645
5646 * emacs.c: Include TERM_HEADER.
5647
f18cbb28
EZ
5648 * dispnew.c: Include TERM_HEADER instead of listing all possible
5649 window-system headers.
17a2cbbd 5650
f18cbb28 5651 * ccl.h: Include character.h.
17a2cbbd
DC
5652
5653 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
5654 the current window system; include in list of objects to link into
5655 Emacs.
5656
c650a5de
DA
56572012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5658
5659 Remove mark_ttys function and fix tty_display_info initialization.
5660 * lisp.h (mark_ttys): Remove prototype.
5661 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
5662 to mark_ttys because all possible values of 'top_frame' slot are
5663 the frames which are reachable from Vframe_list.
5664 * term.c (mark_ttys): Remove.
5665 (init_tty): Safely initialize 'top_frame' slot with Qnil.
5666
4e0f6479
DA
56672012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5668
5669 Change struct frame bitfields from unsigned char to unsigned.
5670 * frame.h (struct frame): Change type of 'display_preempted',
5671 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
5672 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
5673 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
5674 bitfields from unsigned char to unsigned.
5675
8b96a52c
DA
56762012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5677
5678 Remove unused member of struct x_output and struct w32_output.
5679 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
5680 * w32term.h (struct w32_output): Likewise.
5681
b4444c8a
JD
56822012-08-30 Jan Djärv <jan.h.d@swipnet.se>
5683
5684 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
5685 does not become zero (Bug#12234).
5686
b98521db
PE
56872012-08-30 Paul Eggert <eggert@cs.ucla.edu>
5688
5689 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
5690 for GCC 4.7.1 x86-64.
5691
31d02438
GM
56922012-08-30 Glenn Morris <rgm@gnu.org>
5693
5694 * lread.c (init_lread): For out-of-tree builds, only add the
5695 source directory's site-lisp dir to the load-path if it exists,
5696 consistent with in-tree builds. (Bug#12302)
5697
7f8941d8
JD
56982012-08-28 Jan Djärv <jan.h.d@swipnet.se>
5699
5700 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 5701 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
5702 (windowShouldClose:): Set window_closed.
5703 (dealloc): New member, free button_values.
fc0c31f8
JB
5704 (process_dialog:): Make member function. Remove window argument,
5705 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
5706 in button_values.
5707 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 5708 with tag. Remove return self, declare return value as void.
7f8941d8
JD
5709 (addString:row:): Remove return self, declare return value as void.
5710 (addSplit): Remove return self, declare return value as void.
5711 (clicked:): Remove return self, declare return value as void.
fc0c31f8 5712 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
5713 (initFromContents:isQuestion:): Adjust call to process_dialog.
5714 Code formatting change.
5715 (timeout_handler:): Set timer_fired to YES.
5716 (runDialogAt:): Set timer_fired to NO.
5717 Handle click on close button as quit.
5718
5719 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
5720 Add window_closed and button_values. Add void as return value for
5721 add(Button|String|Split). addButton takes int instead of Lisp_Object.
5722 Add process_dialog as new member.
5723
eada0861 57242012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 5725
eada0861
GM
5726 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
5727 is not one of the heaps we manage. (Bug#12242)
5728
57292012-08-28 Glenn Morris <rgm@gnu.org>
5730
5731 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
5732
457294dd
MR
57332012-08-28 Martin Rudalics <rudalics@gmx.at>
5734
5735 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
5736 auto-buffer-name window parameter. Install revision of reverted
5737 fix.
457294dd 5738
4f2daf31
DA
57392012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5740
5741 Do not allow to set major mode for a dead buffer.
5742 * buffer.c (Fset_buffer_major_mode): Signal an error
5743 if the buffer is dead.
5744 (Fother_buffer, other_buffer_safely): Remove redundant
5745 nested declaration.
5746
66322887
DA
57472012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5748
5749 Always use set_buffer_if_live to restore original buffer at unwind.
5750 * buffer.h (record_unwind_current_buffer): New function.
5751 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
5752 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
5753 * undo.c, window.c: Adjust users.
5754 * buffer.c (set_buffer_if_live): Fix comment.
5755
a3d794a1
DA
57562012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5757
5758 Fix usage of set_buffer_internal.
5759 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
5760 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
5761 * coding.c (decode_coding): Omit redundant test.
5762 * fileio.c (decide_coding_unwind): Likewise.
5763 * fns.c (secure_hash): Likewise.
5764 * insdel.c (modify_region): Likewise.
5765 * keyboard.c (command_loop_1): Likewise.
5766 * print.c (PRINTFINISH): Likewise.
5767 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
5768
59ea14cd
PE
57692012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5770
5771 * dispnew.c: Use bool for boolean.
5772 (frame_garbaged, display_completed, delayed_size_change)
5773 (fonts_changed_p, add_window_display_history)
5774 (add_frame_display_history, verify_row_hash)
5775 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
5776 (row_equal_p, realloc_glyph_pool)
5777 (allocate_matrices_for_frame_redisplay)
5778 (showing_window_margins_p)
5779 (adjust_frame_glyphs_for_frame_redisplay)
5780 (build_frame_matrix_from_leaf_window, make_current)
5781 (mirrored_line_dance, mirror_line_dance, update_frame)
5782 (update_window_tree, update_single_window)
5783 (check_current_matrix_flags, update_window, update_text_area)
5784 (update_window_line, set_window_update_flags, scrolling_window)
5785 (update_frame_1, scrolling, buffer_posn_from_coords)
5786 (do_pending_window_change, change_frame_size)
5787 (change_frame_size_1, sit_for):
5788 Use bool for boolean.
5789 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
5790 and remove last int (actually boolean) argument, which was always 0.
5791 All callers changed.
5792 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
5793 * dispextern.h (struct composition_it): Use bool for boolean.
5794 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
5795 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
5796 * dired.c (file_name_completion):
5797 Use bool for boolean. (This was missed in an earlier change.)
5798
95072a94
MR
57992012-08-27 Martin Rudalics <rudalics@gmx.at>
5800
5801 * window.c (Fset_window_configuration): Revert first part of
5802 last change.
5803
0f19feff
JD
58042012-08-27 Jan Djärv <jan.h.d@swipnet.se>
5805
5806 * nsterm.h (NSPanel): New class variable dialog_return.
5807
3a880af4
SM
5808 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
5809 Initialize dialog_return.
0f19feff
JD
5810 (windowShouldClose:): Use stop instead of stopModalWithCode.
5811 (clicked:): Ditto, and also set dialog_return (Bug#12258).
5812 (timeout_handler:): Use stop instead of abortModal. Send a dummy
5813 event.
5814 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
5815 modal loop returns.
5816
f10fe38f
PE
58172012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5818
de1339b0
PE
5819 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
5820 * composite.c (find_composition, composition_gstring_p)
5821 (composition_reseat_it, find_automatic_composition):
5822 * data.c (let_shadows_buffer_binding_p)
5823 (let_shadows_global_binding_p, set_internal, make_blv)
5824 (Fmake_variable_buffer_local, Fmake_local_variable)
5825 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
5826 (cons_to_signed, arith_driver):
5827 * dbusbind.c (xd_in_read_queued_messages):
5828 * dired.c (directory_files_internal, file_name_completion):
5829 Use bool for booleans.
5830 * dired.c (file_name_completion):
5831 * process.h (fd_callback):
5832 Omit int (actually boolean) argument. It wasn't being used.
5833 All uses changed.
5834 * composite.h, lisp.h: Reflect above API changes.
5835
f10fe38f
PE
5836 * cmds.c, coding.c: Use bool for booleans.
5837 * cmds.c (move_point, Fself_insert_command):
5838 * coding.h (struct composition status, struct coding_system):
5839 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
5840 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
5841 (emacs_mule_char, decode_coding_emacs_mule)
5842 (encode_coding_emacs_mule, detect_coding_iso_2022)
5843 (decode_coding_iso_2022, encode_invocation_designation)
5844 (encode_designation_at_bol, encode_coding_iso_2022)
5845 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
5846 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
5847 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
5848 (encode_coding_raw_text, detect_coding_charset)
5849 (decode_coding_charset, encode_coding_charset, detect_eol)
5850 (detect_coding, get_translation_table, produce_chars)
5851 (consume_chars, reused_workbuf_in_use)
5852 (make_conversion_work_buffer, code_conversion_save)
5853 (decode_coding_object, encode_coding_object)
5854 (detect_coding_system, char_encodable_p)
5855 (Funencodable_char_position, code_convert_region)
5856 (code_convert_string, code_convert_string_norecord)
5857 (Fset_coding_system_priority):
5858 * fileio.c (Finsert_file_contents):
5859 Use bool for booleans.
5860 * coding.h, lisp.h: Reflect above API changes.
5861 * coding.c: Remove unnecessary static function decls.
5862 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
5863 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
5864 not a boolean 'int', since callers never look at the return value.
5865 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
5866 * coding.h (decoding_buffer_size, encoding_buffer_size)
5867 (emacs_mule_string_char): Remove unused extern decls.
5868 (struct iso_2022_spec, struct coding_system):
5869 Use 'unsigned int : 1' for boolean fields, since there's more than one.
5870 (struct emacs_mule_spec): Remove unused field 'full_support'.
5871 All initializations removed.
5872 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
5873
5474c384
DA
58742012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5875
f10fe38f 5876 Fix spare memory change (Bug#12286).
5474c384
DA
5877 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
5878 (valid_lisp_object_p): Likewise.
5879
c4b6914d
MR
58802012-08-27 Martin Rudalics <rudalics@gmx.at>
5881
5882 * window.c (Fset_window_configuration): Record any window's old
5883 buffer if it's replaced (see Bug#8789). If the new current
5884 buffer doesn't appear in the selected window, go to its old
5885 point (Bug#12208).
5886
35aaa1ea
DA
58872012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5888
5889 Special MEM_TYPE_SPARE to denote reserved memory.
5890 * alloc.c (enum mem_type): New memory type.
5891 (refill_memory_reserve): Use new type for spare memory.
5892 This prevents live_cons_p and live_string_p from incorrect
5893 detection of uninitialized objects from spare memory as live.
5894
6af64513
PE
58952012-08-26 Paul Eggert <eggert@cs.ucla.edu>
5896
8b2e00a3
PE
5897 Spelling fixes.
5898 * Makefile.in (.PHONY): versioclean -> versionclean.
5899
b52d6985
PE
5900 Remove unused external symbols.
5901 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
5902 * window.c (Qwindow_valid_p, decode_valid_window):
5903 Now static, not extern.
5904 * data.c (Qinterval): Remove; unused.
5905 (syms_of_data): Do not define 'interval'.
5906 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
5907 * window.h (decode_valid_window):
5908 Remove decls.
5909
d5172d4f
PE
5910 * character.c, charset.c, chartab.c: Use bool for booleans.
5911 * character.c (lisp_string_width, string_count_byte8)
5912 (string_escape_byte8):
5913 * charset.c (charset_map_loaded, load_charset_map, read_hex):
5914 (load_charset_map_from_file, map_charset_chars)
5915 (Fdefine_charset_internal, define_charset_internal)
5916 (Fdeclare_equiv_charset, find_charsets_in_text)
5917 (Ffind_charset_region, char_charset, Fiso_charset):
5918 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
5919 (sub_char_table_set, sub_char_table_set_range)
5920 (char_table_set_range, optimize_sub_char_table)
5921 (map_sub_char_table):
5922 Use bool for boolean.
5923 * character.c (str_to_unibyte): Omit last boolean argument; it was
5924 always 0. All callers changed.
5925 * character.h, charset.h: Adjust to match previous changes.
5926 * character.h (char_printable_p): Remove decl of nonexistent function.
5927 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
5928 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
5929 are all boolean, so make them single-bit bitfields.
5930
6af64513
PE
5931 * lisp.h (ASET): Remove attempt to detect side effects.
5932 It was meant to be temporary and it often doesn't work,
5933 because when IDX has side effects the behavior of IDX==IDX
5934 is undefined. See Stefan Monnier in
5935 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
5936
e1f29348
BR
59372012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5938
5939 * lisp.h (functionp): New function (extracted from Ffunctionp).
5940 (FUNCTIONP): Use it.
5941 * eval.c (Ffunctionp): Use it.
5942
17c05d74
PE
59432012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5944
0f46bc75
PE
5945 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
5946 as that's faster and simpler than static storage. Don't bother
5947 with the g_main_context_query overhead if g_main_context_pending
5948 says no events are pending.
5949 (gfds, gfds_size): Remove these static vars.
5950 (xgselect_initialize): Remove; no longer needed.
5951 All uses and decls removed.
5952
ee4c0f69
PE
5953 * emacs.c (fatal_error_signal_hook): Remove.
5954 All uses removed. This leftover from old code was always 0.
5955
17c05d74
PE
5956 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
5957 * casefiddle.c (casify_object, casify_region):
5958 * casetab.c (set_case_table):
5959 * category.c, category.h (word_boundary_p):
5960 * category.h (CHAR_HAS_CATEGORY):
5961 Use bool for booleans, instead of int.
5962
391ceac5
EZ
59632012-08-25 Eli Zaretskii <eliz@gnu.org>
5964
5965 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
5966
2f221583
PE
59672012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5968
f4a681b0
PE
5969 On assertion failure, print backtrace if available.
5970 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
5971 (die) [ENABLE_CHECKING]: Print a backtrace if available.
5972 * Makefile.in (LIB_EXECINFO): New macro.
5973 (LIBES): Use it.
5974
2f221583
PE
5975 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
5976 * bytecode.c (exec_byte_code):
5977 * callint.c (check_mark, Fcall_interactively):
5978 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
5979 (getenv_internal, sync_process_alive, call_process_exited):
5980 * lisp.h (USE_SAFE_ALLOCA):
5981 Use bool for booleans, instead of int.
5982 * lisp.h, process.h: Adjust prototypes to match above changes.
5983 * callint.c (Fcall_interactively): Don't assume the mark's
5984 offset fits in 'int'.
5985
37ef52bb
PE
59862012-08-24 Paul Eggert <eggert@cs.ucla.edu>
5987
5988 * buffer.c, buffer.h: Use bool for boolean.
5989 * buffer.c (reset_buffer_local_variables)
5990 (buffer_lisp_local_variables, Fset_buffer_modified_p)
5991 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
5992 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
5993 (overlay_touches_p, overlay_strings, Foverlay_put)
5994 (report_overlay_modification, call_overlay_mod_hooks):
5995 (mmap_enlarge, mmap_set_vars):
5996 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
5997 Use bool for booleans, instead of int.
5998 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
5999 since the 1-or-0 return value is always ignored anyway.
6000 (mmap_initialized_p):
6001 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6002 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6003
2cc21167
PE
60042012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6005
6006 * bidi.c: Use bool for boolean.
6007 This is a bit more readable, and makes the text segment of bidi.o
6008 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6009 Presumably it's faster too.
6010 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
6011 Now bool.
6012 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6013 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
6014 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
6015 (bidi_explicit_dir_char, bidi_level_of_next_char)
6016 (bidi_find_other_level_edge, bidi_move_to_visually_next):
6017 Use bool for booleans, instead of int.
6018 * dispextern.h (bidi_init_it, bidi_paragraph_init)
6019 (bidi_unshelve_cache): Adjust decls to match code.
6020
7db4ddf4
MR
60212012-08-23 Martin Rudalics <rudalics@gmx.at>
6022
6023 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
6024 argument.
6025
b1bb8011
PE
60262012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6027
6028 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
6029 * atimer.h: Include <stdbool.h>.
6030
ff687885
DN
60312012-08-22 Dan Nicolaescu <dann@gnu.org>
6032
6033 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
6034 compile time tests instead of run time tests on systems that do
6035 not use them.
6036 (FRAME_MAC_P): Remove leftover from deleted code.
6037 * frame.c (syms_of_frame): Remove leftover from deleted code.
6038
4ce7a138
JD
60392012-08-22 Jan Djärv <jan.h.d@swipnet.se>
6040
6041 * nsterm.m (insertText:): Don't clear modifiers if code is space.
6042
d733ec6d
PE
60432012-08-22 Paul Eggert <eggert@cs.ucla.edu>
6044
6045 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
6046 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 6047 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
6048 (fontset_add): Return void, for FONTSET_ADD.
6049
d0d2d26f
PE
60502012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6051
fce31d69
PE
6052 * alloc.c: Use bool for booleans.
6053 (gc_in_progress, abort_on_gc)
6054 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6055 (dont_register_blocks) [GC_MALLOC_CHECK]:
6056 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
6057 (check_string_bytes, make_specified_string, memory_full)
6058 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
6059 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
6060 (mark_stack, valid_pointer_p, make_pure_string)
6061 (Fgarbage_collect, survives_gc_p, gc_sweep):
6062 Use bool for booleans, instead of int.
6063 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6064 Remove unused local.
6065 * alloc.c (PURE_POINTER_P):
6066 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
6067 * editfns.c (Fformat):
6068 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
6069 (Fdo_auto_save):
6070 * fns.c (sweep_weak_table):
6071 * lisp.h (suppress_checking, push_message, survives_gc_p)
6072 (make_pure_string, gc_in_progress, abort_on_gc):
6073 * lread.c (readchar, read1):
6074 * print.c (Fprin1_to_string):
6075 * xdisp.c (push_message):
6076 Use bool for booleans affected directly or indirectly by
6077 alloc.c's changes.
6078
d0d2d26f
PE
6079 Make recently-introduced setters macros.
6080 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
6081 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
6082 (set_fontset_default, set_fontset_fallback): Rename from their
6083 upper-case counterparts, and make them functions rather than macros.
6084 This is more consistent with the other recently-introduced setters.
6085 These don't need to be inline, since they're local.
6086
d18e2bb6
JD
60872012-08-21 Jan Djärv <jan.h.d@swipnet.se>
6088
6089 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
6090 the loop (Bug#12247).
6091
1b9d9d16
PE
60922012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6093
6094 * lisp.h (vcopy): Use memcpy rather than our own loop.
6095 This fixes a performance regression introduced by the recent
6096 addition of vcopy. This means 'vcopy' will need to be modified
6097 for a copying collector, but that's OK. Also, tighten the
6098 checking in the assertion.
6099
b2f09701
EZ
61002012-08-21 Eli Zaretskii <eliz@gnu.org>
6101
6102 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
6103 components for RTL text (Bug#11860). Adjust X-OFFSET of each
6104 non-base glyph for the width of the base character, according to
e1f29348
BR
6105 what x_draw_composite_glyph_string_foreground expects.
6106 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
6107 expectations, to produce correct width of the composed character.
6108 Reverse the sign of the DU offset produced by ScriptPlace.
6109
9b994fed
PE
61102012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6111
6112 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
6113
086ca913
DA
61142012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6115
6116 Avoid direct writes to contents member of struct Lisp_Vector.
6117 * lisp.h (vcopy): New function to copy data into vector.
6118 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
6119 * fns.c (Ffillarray): Use ASET.
6120 * keyboard.c (timer_check_2): Use AREF and ASET.
6121 (append_tool_bar_item, Frecent_keys): Use vcopy.
6122 * lread.c (read_vector): Use ASET.
6123 * msdos.c (Frecent_doskeys): Use vcopy.
6124 * xface.c (Finternal_copy_lisp_face): Use vcopy.
6125 (Finternal_merge_in_global_face): Use ASET and vcopy.
6126 * xfont.c (xfont_list_pattern): Likewise.
6127
5481664a
MR
61282012-08-21 Martin Rudalics <rudalics@gmx.at>
6129
6130 * window.c (Fwindow_point): For the selected window always return
6131 the position of its buffer's point.
6132 (Fset_window_point): For the selected window always go in its
6133 buffer to the specified position.
6134
6d470bdd
DA
61352012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6136
6137 Setter macros for fontsets.
6138 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
6139 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
6140 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
6141 Adjust users.
6142
24564fe1
GM
61432012-08-20 Glenn Morris <rgm@gnu.org>
6144
6145 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6146 Don't assume that `ln -f' works.
6147
0a05a035
EZ
61482012-08-20 Eli Zaretskii <eliz@gnu.org>
6149
6150 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
6151 and later about non-assignments with no effect. See discussion at
6152 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
6153 details.
6154
e46f2325
DA
61552012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6156
6157 Inline setter functions for Lisp_Objects slots of struct specbinding.
6158 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
6159 Adjust users.
6160
734fbd86
MR
61612012-08-20 Martin Rudalics <rudalics@gmx.at>
6162
6163 * window.c (select_window): Always make selected window's buffer
6164 current.
6165
f1a95992
DA
61662012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6167
6168 Use AREF and ASET for docstrings of category tables.
6169 * category.h (CATEGORY_DOCSTRING): Use AREF.
6170 (SET_CATEGORY_DOCSTRING): Use ASET.
6171 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
6172
e83064be
DA
61732012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6174
6175 Inline setter functions for hash table members.
6176 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
6177 (set_hash_hash, set_hash_index): Rename with _slot suffix.
6178 (set_hash_key_and_value, set_hash_index, set_hash_next)
6179 (set_hash_hash): New functions.
6180 * charset.c, fns.c: Adjust users.
6181
4ce60d2e
DA
61822012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6183
6184 Inline getter and setter functions for per-buffer values.
6185 * buffer.h (per_buffer_default, set_per_buffer_default)
6186 (per_buffer_value, set_per_buffer_value): New functions.
6187 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
6188 * buffer.c, data.c: Adjust users.
6189
c06c9690
JB
61902012-08-20 Juanma Barranquero <lekktu@gmail.com>
6191
6192 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
6193
32bd4250
PE
61942012-08-19 Paul Eggert <eggert@cs.ucla.edu>
6195
bad03192 6196 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
6197 as gnulib does this if the system doesn't.
6198 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
6199 Remove declaration. MS-Windows declares it on stdlib.h which is
6200 included by conf_post.h.
b69a6d22
PE
6201 * emacs.c (environ) [DOUG_LEA_MALLOC]:
6202 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
6203 * vm-limit.c: Include <unistd.h>, for 'environ'.
6204
22d7feb2
PE
6205 * unexaix.c, unexcoff.c: Include "mem-limits.h".
6206 (start_of_data): Remove decl; mem-limits.h provides it.
6207
32bd4250
PE
6208 * xdisp.c (handle_invisible_prop): Make it a bit faster
6209 and avoid a gcc -Wmaybe-uninitialized diagnostic.
6210
450809af
CY
62112012-08-19 Chong Yidong <cyd@gnu.org>
6212
6213 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
6214 ends (Bug#3874).
6215
9e677988
AS
62162012-08-19 Andreas Schwab <schwab@linux-m68k.org>
6217
6b1319ce
AS
6218 * .gdbinit: Use call instead of set when calling a function in the
6219 inferior.
6220
9e677988
AS
6221 * data.c (set_internal): Don't use set_blv_found.
6222 (Fkill_local_variable): Likewise.
6223
d7191076
AA
62242012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
6225
6226 * nsfont.m (ns_ascii_average_width): Ensure the string
6227 ascii_printable is initialized with a null-terminated character
6228 array. Otherwise, it can contain undesired extra characters.
6229
e757f1c6
PE
62302012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6231
6232 port new setting code to Sun C 5.8 2005/10/13
6233 * chartab.c, lisp.h (char_table_set, char_table_set_range):
6234 Return void, not Lisp_Object. Otherwise, the compiler
6235 complains about (A?B:C) where B is void and C is Lisp_Object
6236 when compiling CHAR_TABLE_SET, due to the recent change to
6237 the API of sub_char_table_set_contents.
6238
a999ce26
CY
62392012-08-18 Chong Yidong <cyd@gnu.org>
6240
6241 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
6242 for the string case (Bug#3874).
6243
3f22b86f
PE
62442012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6245
39eb03f1
PE
6246 * buffer.h (BSET): Remove (Bug#12215).
6247 Replace all uses with calls to new setter functions.
6248 (bset_bidi_paragraph_direction, bset_case_canon_table)
6249 (bset_case_eqv_table, bset_directory, bset_display_count)
6250 (bset_display_time, bset_downcase_table)
6251 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
6252 (bset_last_selected_window, bset_local_var_alist)
6253 (bset_mark_active, bset_point_before_scroll, bset_read_only)
6254 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
6255 (bset_width_table):
6256 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6257 (bset_auto_fill_function, bset_auto_save_file_format)
6258 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6259 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6260 (bset_cache_long_line_scans, bset_case_fold_search)
6261 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6262 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6263 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6264 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6265 (bset_header_line_format, bset_indicate_buffer_boundaries)
6266 (bset_indicate_empty_lines, bset_invisibility_spec)
6267 (bset_left_fringe_width, bset_major_mode, bset_mark)
6268 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6269 (bset_name, bset_overwrite_mode, bset_pt_marker)
6270 (bset_right_fringe_width, bset_save_length)
6271 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6272 (bset_scroll_up_aggressively, bset_selective_display)
6273 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6274 (bset_word_wrap, bset_zv_marker):
6275 * category.c (bset_category_table):
6276 * syntax.c (bset_syntax_table):
6277 New setter functions.
6278
6a09a33b
PE
6279 * process.h (PSET): Remove (Bug#12215).
6280 Replace all uses with calls to new setter functions.
6281 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6282 (PROCESS_INLINE): New macro.
6283 (pset_childp): New setter function.
6284 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
6285 * process.c (PROCESS_INLINE):
6286 Define to EXTERN_INLINE, so that the corresponding functions
6287 are compiled into code.
6288 (pset_buffer, pset_command, pset_decode_coding_system)
6289 (pset_decoding_buf, pset_encode_coding_system)
6290 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
6291 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
6292 (pset_type, pset_write_queue): New setter functions.
6293
e8c17b81
PE
6294 * window.h (WSET): Remove (Bug#12215).
6295 Replace all uses with calls to new setter functions.
6296 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6297 (WINDOW_INLINE): New macro.
6298 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
6299 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
6300 (wset_total_lines, wset_vertical_scroll_bar)
6301 (wset_window_end_pos, wset_window_end_valid)
6302 (wset_window_end_vpos): New setter functions.
6303 * window.c (WINDOW_INLINE):
6304 Define to EXTERN_INLINE, so that the corresponding functions
6305 are compiled into code.
6306 (wset_combination_limit, wset_dedicated, wset_display_table)
6307 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
6308 (wset_new_normal, wset_new_total, wset_next_buffers)
6309 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6310 (wset_prev_buffers, wset_right_fringe_width)
6311 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
6312 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
6313 (wset_window_parameters):
6314 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6315 (wset_column_number_displayed, wset_region_showing):
6316 New setter functions.
6317
3f22b86f
PE
6318 * termhooks.h (TSET): Remove (Bug#12215).
6319 Replace all uses with calls to new setter functions.
6320 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6321 (TERMHOOKS_INLINE): New macro.
6322 (tset_charset_list, tset_selection_alist): New setter functions.
6323 * terminal.c (TERMHOOKS_INLINE):
6324 Define to EXTERN_INLINE, so that the corresponding functions
6325 are compiled into code.
6326 (tset_param_alist): New setter function.
6327
742af32f
PE
63282012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6329
15dbb4d6
PE
6330 * keyboard.h (KSET): Remove (Bug#12215).
6331 Replace all uses with calls to new setter functions.
6332 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6333 (KEYBOARD_INLINE): New macro.
6334 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
6335 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
6336 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
6337 New setter functions.
6338 * keyboard.c (KEYBOARD_INLINE):
6339 Define to EXTERN_INLINE, so that the corresponding functions
6340 are compiled into code.
6341 (kset_echo_string, kset_kbd_queue)
6342 (kset_keyboard_translate_table, kset_last_prefix_arg)
6343 (kset_last_repeatable_command, kset_local_function_key_map)
6344 (kset_overriding_terminal_local_map, kset_real_last_command)
6345 (kset_system_key_syms): New setter functions.
6346
f00af5b1
PE
6347 * frame.h (FSET): Remove (Bug#12215).
6348 Replace all uses with calls to new setter functions.
6349 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6350 (FRAME_INLINE): New macro.
6351 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
6352 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
6353 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
6354 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
6355 (fset_param_alist, fset_root_window, fset_scroll_bars)
6356 (fset_selected_window, fset_title, fset_tool_bar_items)
6357 (fset_tool_bar_position, fset_tool_bar_window): New functions.
6358 * frame.c (FRAME_INLINE):
6359 Define to EXTERN_INLINE, so that the corresponding functions
6360 are compiled into code.
6361 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
6362
0c94c8d6
PE
6363 A few more naming-convention fixes for getters and setters.
6364 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
6365 and rename from buffer_overlays_set_before.
6366 (set_buffer_overlays_after): Move here from buffer.h, and rename
6367 from buffer_overlays_set_after.
6368 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
6369 All uses changed.
6370 (set_buffer_intervals): Rename from buffer_set_intervals.
6371 * intervals.c (set_interval_object): Move here from intervals.h,
6372 and rename from interval_set_object.
6373 (set_interval_left): Move here from intervals.h, and rename from
6374 interval_set_left.
6375 (set_interval_right): Move here from intervals.h, and rename from
6376 interval_set_right.
6377 (copy_interval_parent): Move here from intervals.h, and rename from
6378 interval_copy_parent.
6379 * intervals.h (set_interval_parent): Rename from interval_set_parent.
6380 (set_interval_plist): Rename from interval_set_plist.
6381 Return void, not Lisp_Object, since no caller uses the result.
6382 * lisp.h (string_intervals): Rename from string_get_intervals.
6383 (set_string_intervals): Rename from string_set_intervals.
6384
34dabdb7
PE
6385 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
6386 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 6387 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
6388 All uses changed. See the end of
6389 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
6390
742af32f
PE
6391 * lisp.h (CSET): Remove (Bug#12215).
6392 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
6393 (set_char_table_purpose): New functions,
6394 replacing CSET. All uses changed. For example, replace
6395 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 6396 "set_char_table_parent (char_table, parent);".
742af32f
PE
6397 The old version was confusing because it used the same name
6398 'parent' for two different things.
6399
a04e2c62
DA
64002012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6401
6402 Functions to get and set Lisp_Object fields of buffer-local variables.
6403 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
6404 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
6405 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
6406 * data.c, eval.c, frame.c: Adjust users.
6407
383dcbf9
CY
64082012-08-17 Chong Yidong <cyd@gnu.org>
6409
6410 * xfaces.c (merge_face_vectors): If the target font specfies a
6411 font spec, make the font's attributes take precedence over
6412 directly-specified attributes.
6413 (merge_face_ref): Recognize :font.
6414
44386687
DA
64152012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6416
6417 Do not use memcpy for copying intervals.
6418 * intervals.c (reproduce_interval): New function.
6419 (reproduce_tree, reproduce_tree_obj): Use it.
6420 (reproduce_tree_obj): Remove prototype.
6421
927c7216
PE
64222012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6423
6424 * lisp.h (duration_to_sec_usec): Remove unused decl.
6425
93044f7b
AA
64262012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
6427
6428 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
6429 to an allocated instance of NSString, not to the class itself.
6430
9851e4a5
JB
64312012-08-17 Juanma Barranquero <lekktu@gmail.com>
6432
6433 * makefile.w32-in (C_CTYPE_H): New macro.
6434 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
6435 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
6436 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6437
620f13b0
PE
64382012-08-16 Paul Eggert <eggert@cs.ucla.edu>
6439
6440 Use ASCII tests for character types.
6441 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
6442 * xfns.c, xterm.c:
6443 Don't include <ctype.h>; was not needed.
6444 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
6445 * sysdep.c, xfaces.c:
6446 Include <c-ctype.h> instead of <ctype.h>.
6447 * nsterm.m: Include <c-ctype.h>.
6448 * charset.c (read_hex):
6449 * doc.c (Fsnarf_documentation):
6450 * fileio.c (IS_DRIVE) [WINDOWSNT]:
6451 (DRIVE_LETTER) [DOS_NT]:
6452 (Ffile_name_directory, Fexpand_file_name)
6453 (Fsubstitute_in_file_name):
6454 * font.c (font_parse_xlfd, font_parse_fcname):
6455 * frame.c (x_set_font_backend):
6456 * gtkutil.c (xg_get_font):
6457 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
6458 * nsimage.m (hexchar):
6459 * nsterm.m (ns_xlfd_to_fontname):
6460 * sysdep.c (system_process_attributes):
6461 * xfaces.c (hash_string_case_insensitive):
6462 Use C-locale tests instead of locale-specific tests for character
6463 types, since we want the ASCII interpretation here, not the
6464 interpretation suitable for whatever happens to be the current locale.
6465
52162052
MR
64662012-08-16 Martin Rudalics <rudalics@gmx.at>
6467
6468 Consistently check windows for validity/liveness
6469 (Bug#11984, Bug#12025, Bug#12026).
6470 * lisp.h (CHECK_VALID_WINDOW): New macro.
6471 * window.c (decode_window): Rename to decode_live_window.
6472 (decode_valid_window, Fwindow_valid_p): New functions.
6473 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
6474 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
6475 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
6476 (Fwindow_prev_sibling, Fwindow_combination_limit)
6477 (Fset_window_combination_limit, Fwindow_use_time)
6478 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
6479 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
6480 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
6481 (Fwindow_hscroll, Fset_window_hscroll)
6482 (Fwindow_redisplay_end_trigger)
6483 (Fset_window_redisplay_end_trigger, Fwindow_edges)
6484 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
6485 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6486 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
6487 (Fwindow_end, Fset_window_point, Fset_window_start)
6488 (Fpos_visible_in_window_p, Fwindow_line_height)
6489 (Fwindow_dedicated_p, Fset_window_dedicated_p)
6490 (Fwindow_prev_buffers, Fset_window_prev_buffers)
6491 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
6492 (Fset_window_parameter, Fwindow_display_table)
6493 (Fset_window_display_table, Fdelete_other_windows_internal)
6494 (Fset_window_buffer, Fset_window_new_total)
6495 (Fset_window_new_normal, Fdelete_window_internal)
6496 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
6497 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
6498 (Fwindow_scroll_bars): Check whether argument window is a valid or
6499 live window. Update doc-strings.
6500 (syms_of_window): New symbol Qwindow_valid_p.
6501 * keyboard.c (Fposn_at_x_y): Check whether argument
6502 frame_or_window denotes a valid window.
6503
2751c80f
DA
65042012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6505
6506 Fix previous char table change.
6507 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
6508 * chartab.c (optimize_sub_char_table): Likewise.
6509
032a42c8
CY
65102012-08-16 Chong Yidong <cyd@gnu.org>
6511
a2d19368
CY
6512 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
6513
032a42c8
CY
6514 * xfont.c (xfont_open):
6515 * xftfont.c (xftfont_open): Set the font's max_width field.
6516
6517 * nsfont.m (nsfont_open): Similar to the Xft backend, set
6518 min_width to space_width and average_width to the average over
6519 printable ASCII characters.
6520 (ns_char_width): Code cleanup.
6521 (ns_ascii_average_width): New utility function.
6522
6523 * font.h (struct font): Update comments.
6524
a098c930
DA
65252012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6526
032a42c8 6527 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
6528 * lisp.h (CSET): New macro.
6529 (char_table_set_extras, char_table_set_contents)
6530 (sub_char_table_set_contents): New function.
6531 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
6532 * syntax.c: Adjust users.
6533
8be3a09c
SM
65342012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
6535
6536 * eval.c (eval_sub): Bind lexical-binding.
6537 * lread.c (Qlexical_binding): Make non-static.
6538
ac4845a6
JD
65392012-08-15 Jan Djärv <jan.h.d@swipnet.se>
6540
ddee6515
JD
6541 * nsmenu.m (popupSession): Remove.
6542 (pop_down_menu): Remove endModalSession.
6543 (timeout_handler:): New method.
6544 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
6545 Call runModalForWindow. Check timer_fired when it returns.
6546 If not set, cancel timer and break out of loop.
6547 Otherwise loop again, with a new timeout.
6548
6549 * nsterm.m: Include fcntl.h if present.
6550 (fd_entry, t_readfds, inNsSelect): Remove.
6551 (select_writefds, select_valid, select_timeout, selfds)
6552 (select_mutex, apploopnr): Add.
6553 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
6554 Otherwise call kbd_buffer_store_event.
6555 (ns_send_appdefined): Remove release of fd_entry.
6556 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
6557 Increment and decrement apploopnr.
6558 (ns_select): If no file descriptors, just do a NSTimer.
6559 Otherwise copy read/write masks and start select thread (fd_handler).
6560 Start main loop and wait for application defined event.
6561 Inform select thread to stop selecting after main loop is exited.
6562 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 6563 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
6564 (fd_handler:): Loop forever, wait for info from the main thread
6565 to either start or stop selecting. When select returns, send
6566 and appdefined event.
6567 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
6568 If not call kbd_buffer_store_event.
6569
6570 * nsterm.h (EmacsApp): fd_handler takes id argument.
6571 (EmacsDialogPanel): Add timer_fired and timeout_handler.
6572
ac4845a6
JD
6573 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
6574
eb424fe3
EZ
65752012-08-15 Eli Zaretskii <eliz@gnu.org>
6576
6577 * region-cache.c (move_cache_gap): Update gap_len using the actual
6578 growth of the boundaries array. Do not change cache_len.
6579 (Bug#12196)
6580
4e6a86c6
DA
65812012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6582
6583 Generalize and cleanup font subsystem checks.
6584 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
6585 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
6586 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 6587
5bf192ca
DA
65882012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6589
6590 * gtkutil.c (xg_get_font): Use pango_units_to_double.
6591
f2045622
CY
65922012-08-15 Chong Yidong <cyd@gnu.org>
6593
8be3a09c
SM
6594 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
6595 When using the new font chooser, use gtk_font_chooser_get_font_desc to
6596 extract the font descriptor instead of just the font name.
6597 In that case, return a font spec instead of a string.
f2045622
CY
6598 (x_last_font_name): Move to this file from xfns.c.
6599
6600 * xfns.c (Fx_select_font): The return value can also be a font
6601 spec. Move x_last_font_name management to gtkutil.c.
6602
6603 * xfaces.c: Make font weight and style symbols non-static.
6604
7f6feb56
SM
66052012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
6606
6607 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
6608 (bug#12117).
6609
fecbd8ff
SM
66102012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
6611
6612 * alloc.c (Fgarbage_collect): Use plural form consistently.
6613
9b8d5165
EZ
66142012-08-14 Eli Zaretskii <eliz@gnu.org>
6615
6616 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
6617 iteration through the command loop. Fixes a problem whereby mouse
6618 movements are ignored until the first mouse click.
6619
f5d9e83a
PE
66202012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6621
6622 Use bool, not int, for Lisp booleans.
6623 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
6624 makes Emacs a bit smaller and presumably a bit faster.
6625 * lisp.h: Include <stdbool.h>.
6626 (struct Lisp_Boolfwd, defvar_bool):
6627 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
6628 * regex.c [!emacs]: Include <stdbool.h>.
6629 (false, true): Remove; <stdbool.h> does this for us now.
6630
55802e4a
CY
66312012-08-14 Chong Yidong <cyd@gnu.org>
6632
4abcdac8
CY
6633 * character.c (Fcharacterp): Doc fix (Bug#12076).
6634
6635 * data.c (Findirect_variable): Doc fix (Bug#11040).
6636
55802e4a
CY
6637 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
6638
6639 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 6640 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 6641
8e99d072
BR
66422012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6643
6644 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
6645 (bug#12022).
6646
08908aca
MR
66472012-08-14 Martin Rudalics <rudalics@gmx.at>
6648
6649 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
6650 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
6651 * minibuf.c (choose_minibuf_frame, read_minibuf):
6652 * w32fns.c (x_create_tip_frame):
6653 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
6654 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
6655
56120d6f
PE
66562012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6657
6658 * intervals.c (offset_intervals): Remove obsolete comment.
6659
67b77c0b
AS
66602012-08-14 Andreas Schwab <schwab@linux-m68k.org>
6661
6662 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
6663
f48b82fd
GR
66642012-08-14 Gergely Risko <gergely@risko.hu>
6665
6666 * coding.c (decode_coding): Record buffer modification before
6667 disabling undo_list (Bug#11773).
6668
fd318b54
DA
66692012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6670
6671 Revert and cleanup some recent overlay changes.
6672 * buffer.h (enum overlay_type): Remove.
6673 (buffer_get_overlays, buffer_set_overlays): Likewise.
6674 (buffer_set_overlays_before, buffer_set_overlays_after):
6675 New function. Adjust users.
6676 (unchain_both): Add eassert.
6677
41a62dd9
DA
66782012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6679
6680 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
6681
5884c324
PE
66822012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6683
6684 * gtkutil.c (xg_mark_data): Don't assume C99.
6685
ca06f160
JD
66862012-08-13 Jan Djärv <jan.h.d@swipnet.se>
6687
6688 * gtkutil.c (xg_frame_tb_info): New struct.
6689 (TB_INFO_KEY): New define.
6690 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
6691 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
6692 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
6693 if not present.
6694 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 6695 is up to date. Otherwise store new data.
ca06f160
JD
6696 (free_frame_tool_bar): Free xg_frame_tb_info if present.
6697
7864a3f7
DA
66982012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6699
6700 Use KSET for write access to Lisp_Object members of struct kboard.
6701 * keyboard.h (KSET): New macro.
6702 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
6703 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
6704 * xterm.c: Adjust users.
6705
4c31be61
DA
67062012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6707
6708 Use BSET for write access to Lisp_Object members of struct buffer.
6709 * buffer.h (BSET): New macro.
6710 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
6711 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
6712 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
6713 * window.c, xdisp.c, xfns.c: Adjust users.
6714
14ae4239
BT
67152012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
6716
6717 * lread.c (syms_of_lread): Initialize Vlexical_binding.
6718
32bcadb4
JD
67192012-08-11 Jan Djärv <jan.h.d@swipnet.se>
6720
3d29b2ce 6721 * nsterm.m (not_in_argv): New function.
fc0c31f8 6722 (application:openFile, application:openTempFile:):
3d29b2ce
JD
6723 (application:openFileWithoutUI:, application:openFiles:): Open file
6724 if not_in_argv returns non-zero (bug#12171).
6725
32bcadb4 6726 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
6727 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
6728 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
6729 (xg_get_font_name): Use those functions/macros here.
6730 Reported by Frans Oilinki <moilinki@gmail.com>.
6731
9ff9402d 67322012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
6733
6734 * unexmacosx.c (copy_data_segment): Copy initialized data in
6735 statically linked libraries from input file rather than memory.
6736
db74a5fc
YM
6737 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
6738 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
6739 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
6740
25e65510
GM
67412012-08-10 Glenn Morris <rgm@gnu.org>
6742
6743 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
6744 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
6745
7961135c
DA
67462012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6747
6748 Fix last change to allow compilation with low optimization levels.
6749 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
6750 Reported by Jan Djärv <jan.h.d@swipnet.se>.
6751
42b3a444
DA
67522012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6753
6754 Use common inline syntax in intervals.h.
6755 * intervals.h (INTERVALS_INLINE): New macro.
6756 Change all users from LISP_INLINE.
6757
9fb0c957
DA
67582012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6759
6760 Define Qnone once for all platforms.
6761 * frame.c (Qnone): Define here.
6762 (syms_of_frame): DEFSYM it.
6763 * lisp.h (Qnone): New declaration.
6764 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
6765 * xfns.c: Remove duplication. Adjust users.
6766
65e8ee52
DA
67672012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6768
6769 Remove unused macros from intervals.h.
6770 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
6771 * intervals.c: Adjust comment.
6772
9b855fd6
EZ
67732012-08-10 Eli Zaretskii <eliz@gnu.org>
6774
6775 * w32fns.c <w32_unicode_gui>: New static variable.
6776 (globals_of_w32fns): Initialize it according to os_subtype.
6777 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
6778 testing os_subtype.
6779
39cb9e56 67802012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
6781 Eli Zaretskii <eliz@gnu.org>
6782
6783 Fix bug #10299 with Unicode characters sent by customized
6784 keyboards created by MSKLC.
6785 * w32fns.c (INIT_WINDOW_CLASS): New macro.
6786 (w32_init_class): Use it to initialize the Emacs class with either
6787 ANSI or Unicode API calls.
6788 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
6789 later.
6790 (w32_wnd_proc): If the character code sent by WM_CHAR or
6791 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
6792 original message. Call DefWindowProcW on NT and later.
6793
9374581a
GM
67942012-08-10 Glenn Morris <rgm@gnu.org>
6795
4b94e8cf
GM
6796 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
6797
9374581a
GM
6798 * lisp.h (DIRECTORY_SEP): Let configure set it.
6799
a2752828
DA
68002012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
6801
6802 Use TSET for write access to Lisp_Object slots of struct terminal.
6803 * termhooks.h (TSET): New macro.
6804 * coding.c, terminal.c, xselect.c: Adjust users.
6805
cc92c454
SM
68062012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
6807
6808 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
6809 the failing expression, include them in the error message.
6810 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
6811 * lisp.h (internal_condition_case_n): Update declaration.
6812
4cb3e6b3
DA
68132012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6814
6815 Inline functions to examine and change buffer overlays.
6816 * buffer.c (unchain_both): New function.
6817 * buffer.h (buffer_get_overlays, buffer_set_overlays):
6818 (buffer_has_overlays): New function.
6819 (enum overlay_type): New enum.
6820 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
6821 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
6822
8707c1e5
DA
68232012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6824
6825 Inline functions to examine and change buffer intervals.
6826 * alloc.c (mark_interval_tree): Remove.
6827 (MARK_INTERVAL_TREE): Simplify.
6828 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
6829 * intervals.c (buffer_balance_intervals): New function.
6830 (graft_intervals_into_buffer): Adjust indentation.
6831 (set_intervals_multibyte): Simplify.
6832 * buffer.h (BUF_INTERVALS): Remove.
6833 (buffer_get_intervals, buffer_set_intervals): New function.
6834 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
6835 * intervals.c, textprop.c: Adjust users.
6836
ad8c997f
DA
68372012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6838
6839 Inline functions to examine and change string intervals.
6840 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
6841 (string_get_intervals, string_set_intervals): New function.
6842 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
6843 * lread.c, print.c, textprop.c: Adjust users.
6844
32ac3a6b
GM
68452012-08-08 Glenn Morris <rgm@gnu.org>
6846
6847 * lisp.mk (lisp): Remove language/persian.elc.
6848
77c7bcb1
DA
68492012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6850
6851 Cleanup intervals.
6852 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
6853 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
6854 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
6855 Adjust comment. Move under #if 0.
77c7bcb1
DA
6856 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
6857 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
6858
9c08a8d4
DA
68592012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6860
6861 Check total length of intervals with eassert.
6862 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
6863 * intervals.c: Change all users to eassert.
6864
26d16b35
EZ
68652012-08-07 Eli Zaretskii <eliz@gnu.org>
6866
14ae4239
BT
6867 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
6868 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
6869 INTERNAL_FIELD in Lisp_Cons.
6870
c644523b
DA
68712012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6872
6873 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
6874 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
6875 name since all xname users are fixed long time ago. Do not
6876 use INTERNAL_FIELD.
6877 (set_symbol_name, set_symbol_function, set_symbol_plist):
6878 (set_symbol_next, set_overlay_plist): New function.
6879 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
6880 (struct Lisp_Overlay): Likewise.
6881 (CVAR, MVAR, SVAR): Remove.
6882 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
6883 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
6884 * xterm.c: Adjust users.
6885 * .gdbinit: Change to use name field of struct Lisp_Symbol
6886 where appropriate.
6887
6a3d20cc
DA
68882012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6889
6890 Basic functions to set Lisp_Object and pointer slots of intervals.
6891 * intervals.h (interval_set_parent, interval_set_object):
6892 (interval_set_left, interval_set_right, interval_set_plist):
6893 (interval_copy_parent): New function.
6894 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
6895 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
6896 Adjust indentation.
6a3d20cc
DA
6897 (INTERVAL_SIZE): Remove. Adjust users.
6898 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
6899
4d2b044c
DA
69002012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6901
6902 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
6903 * process.h (PGET): Remove.
6904 (struct Lisp_Process): Do not use INTERNAL_FIELD.
6905 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6906
d3d50620
DA
69072012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6908
6909 Drop WGET and revert read access to Lisp_Objects slots of struct window.
6910 * window.h (WGET): Remove.
6911 (struct window): Do not use INTERNAL_FIELD.
6912 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6913 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6914 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6915 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6916 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6917 Adjust users.
6918
d10a51dc
CY
69192012-08-07 Chong Yidong <cyd@gnu.org>
6920
6921 * window.c (Fwindow_edges, Fwindow_pixel_edges)
6922 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
6923 (Fdelete_window_internal): Signal an error if the window is not on
6924 a live frame (Bug#12025).
6925
e69b0960
DA
69262012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6927
6928 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
6929 * frame.h (FGET): Remove.
6930 (struct frame): Do not use INTERNAL_FIELD.
6931 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6932 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6933 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6934 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6935
25a20a3a
JB
69362012-08-06 Juanma Barranquero <lekktu@gmail.com>
6937
6938 * w32.c: Silence compiler warnings.
6939 (map_w32_filename): Remove unused variable `is_fat'.
6940 (chase_symlinks): Add parentheses around expression.
6941
1c6f11f4
GM
69422012-08-06 Glenn Morris <rgm@gnu.org>
6943
1db4583a
GM
6944 * sysdep.c: Respect BROKEN_GETWD.
6945
1c6f11f4
GM
6946 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
6947 Let configure handle it.
6948 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
6949
2b90362b
DA
69502012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6951
6952 Use GCALIGNMENT where appropriate.
6953 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
6954 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
6955 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
6956
5f50daf2
EZ
69572012-08-06 Eli Zaretskii <eliz@gnu.org>
6958
14ae4239
BT
6959 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
6960 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 6961
cbcc7007
SM
69622012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
6963
6964 * buffer.h (struct buffer): Revert `indirections' to a simple int;
6965 that should be sufficient for everyone.
6966
4d365fa4
JD
69672012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6968
6969 * keyboard.c (timer_check_2): Add break so timer_check returns next
6970 timeout.
6971
dd86bd82
DA
69722012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6973
6974 Fix Windows build errors introduced after converting to WGET and WSET.
6975 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
6976 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6977
054e1668
JD
69782012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6979
6980 * nsterm.m (ns_frame_rehighlight): Use FSET.
6981
6982 * nsmenu.m (ns_update_menubar): Use FSET.
6983
21238f11
DA
69842012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6985
6986 Separate read and write access to Lisp_Object slots of Lisp_Process.
6987 * process.h (PGET, PSET): New macros similar to AREF and ASET.
6988 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6989
077288cf
DA
69902012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6991
6992 Separate read and write access to Lisp_Object slots of struct window.
6993 * window.h (WGET, WSET): New macros similar to AREF and ASET.
6994 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6995 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6996 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6997 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6998 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6999 Adjust users.
7000
71688bd7
DA
70012012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7002
7003 Fix Windows build errors introduced after converting to FGET and FSET.
7004 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7005 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7006 (w32_judge_scroll_bars): Change to use FSET.
7007 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7008
f99bac93
DA
70092012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7010
7011 Fix replacement typo.
7012 * window.c (replace_window): Set root_window instead of
7013 selected_window. This fixes a total window subsystem
7014 malfunction reported by Bastien Guerry <bzg@gnu.org>.
7015
8c2a0f2d
GM
70162012-08-06 Glenn Morris <rgm@gnu.org>
7017
7018 * lisp.mk (lisp): Add language/persian.elc.
7019
edd74c35
DA
70202012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7021
7022 Separate read and write access to Lisp_Object slots of struct frame.
7023 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
7024 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7025 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7026 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7027 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7028
8671676c
AS
70292012-08-05 Andreas Schwab <schwab@linux-m68k.org>
7030
7031 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
7032
663e2b3f
DA
70332012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
7034
7035 Generalize common compile-time constants.
7036 * lisp.h (header_size, bool_header_size, word_size): Now here.
7037 (struct Lisp_Vector): Add comment.
7038 (struct Lisp_Bool_Vector): Move up to define handy constants.
7039 (VECSIZE, PSEUDOVECSIZE): Simplify.
7040 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
7041 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
7042 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
7043 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
7044 * xfont.c, xmenu.c: Use word_size where appropriate.
7045
d32e47af
LM
70462012-08-05 Lawrence Mitchell <wence@gmx.li>
7047
7048 * search.c (Freplace_match): Treat \? in the replacement text
7049 literally (Bug#8161).
7050
e5d9c0d1
CY
70512012-08-05 Chong Yidong <cyd@gnu.org>
7052
7053 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
7054 * frame.c (Vdelete_frame_functions):
7055 * emacs.c (Vkill_emacs_hook): Doc fix.
7056
8da0576b
EZ
70572012-08-04 Eli Zaretskii <eliz@gnu.org>
7058
7059 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
7060 --with-x-toolkit=no builds.
7061 Reported by Carsten Mattner <carstenmattner@gmail.com>.
7062
02676e5d
CY
70632012-08-04 Chong Yidong <cyd@gnu.org>
7064
7065 * syntax.c (Fmodify_syntax_entry): Doc fix.
7066
97147da9
EZ
70672012-08-04 Eli Zaretskii <eliz@gnu.org>
7068
76151e2c
EZ
7069 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
7070 * w32.c (init_environment): Change the default values of many
7071 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
7072 them into environment when they were not already defined.
7073 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 7074 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
7075 (check_windows_init_file): Now external, not static.
7076 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
7077 called when Vload_path is already set up.
7078
7079 * w32.h (check_windows_init_file): Add prototype.
7080
7081 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
7082 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
7083 compatibility with Posix platforms.
7084 (main): Move the call to check_windows_init_file to here from
7085 w32.c.
7086 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
7087 any, in the DEFALT argument into the root of the Emacs build or
7088 installation tree, as appropriate.
7089
7090 * callproc.c (init_callproc_1): Call decode_env_path instead of
7091 doing its equivalent by hand.
7092 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
7093 the code that sets Vexec_path run on MS-Windows.
7094
7095 * lread.c (init_lread): Add comments to #ifdef's.
7096
97147da9
EZ
7097 * msdos.c (dos_set_window_size, IT_update_begin)
7098 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
7099 instead of direct references.
7100
185ee146
PE
71012012-08-04 Paul Eggert <eggert@cs.ucla.edu>
7102
7103 Export DEFAULT_REHASH_* to GDB.
7104 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
7105 Now constants, not macros.
7106
8834c57a
PE
71072012-08-03 Paul Eggert <eggert@cs.ucla.edu>
7108
98c6f1e3
PE
7109 Remove unnecessary casts involving pointers.
7110 These casts are no longer needed now that we assume C89 or later,
7111 since they involve casting to or from void *.
7112 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
7113 (make_pure_float, make_pure_vector):
7114 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
7115 * macros.c (Fstart_kbd_macro):
7116 * menu.c (find_and_return_menu_selection):
7117 * minibuf.c (read_minibuf_noninteractive):
7118 * sysdep.c (closedir):
7119 * xdisp.c (x_produce_glyphs):
7120 * xfaces.c (compare_fonts_by_sort_order):
7121 * xfns.c (x_real_positions, select_visual):
7122 * xselect.c (x_stop_queuing_selection_requests)
7123 (x_get_window_property, x_get_window_property_as_lisp_data):
7124 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
7125 Remove unnecessary pointer casts.
7126 * alloc.c (record_xmalloc): New function.
7127 * lisp.h (record_xmalloc): New decl.
7128 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
7129 more like a function. This is because the pointer cast is not
7130 needed. All uses changed.
7131 * print.c (print_string, print_error_message): Avoid length recalc.
7132
8834c57a
PE
7133 Improve fix for macroexp crash with debugging (Bug#12118).
7134 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
7135 ARRAY_MARK_FLAG when checking subscripts, because ASET is
7136 not supposed to be invoked from the garbage collector.
7137 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
7138 (gc_aset): New function, which is like ASET but can be
7139 used in the garbage collector.
7140 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7141 (set_hash_index): Use it instead of ASET.
7142
6dad7178
EZ
71432012-08-03 Eli Zaretskii <eliz@gnu.org>
7144
7145 Support symlinks on latest versions of MS-Windows.
7146 * w32.c: Include winioctl.h and aclapi.h.
7147 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
7148 (revert_to_self): Forward declarations of static functions.
7149 <static BOOL g_b_init_get_security_info>:
7150 <g_b_init_create_symbolic_link>: New static flags.
7151 (globals_of_w32): Initialize them to zero.
7152 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
7153 (map_w32_filename): Improve commentary. Simplify switch.
7154 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
7155 headers (most versions of MinGW w32api don't).
7156 (get_security_info, create_symbolic_link)
7157 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
7158 New functions.
7159 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
7160 in the argument file name.
7161 (sys_access): Call unc_volume_file_attributes only if
7162 GetFileAttributes fails with network-related error codes.
7163 (sys_rename): Diagnose renaming of a symlink when the user doesn't
7164 have the required privileges.
14ae4239 7165 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
7166 get_file_security_desc.
7167 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
7168 with addition of handling of symlinks and support for 'lstat'.
7169 If possible, get file's attributes and security information by
6dad7178
EZ
7170 handle, not by name. Produce S_IFLNK bit for symlinks, when
7171 called from 'lstat'.
7172 (stat, lstat): New functions, call 'stat_worker'.
7173 (symlink, readlink, careadlinkat): Rewritten to create and resolve
7174 symlinks when the underlying filesystem supports them.
7175
f162bcc3
PE
71762012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7177
79ea6c20
PE
7178 Fix macroexp crash on Windows with debugging (Bug#12118).
7179 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
7180 checking subscripts; problem introduced with the recent
7181 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
7182 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
7183 since it's used in non-static inline functions now.
7184
c0ce93fd
PE
7185 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
7186 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 7187
f162bcc3
PE
7188 Use C99-style 'extern inline' if available.
7189 * buffer.h (BUFFER_INLINE):
7190 * category.h (CATEGORY_INLINE):
7191 * character.h (CHARACTER_INLINE):
7192 * charset.h (CHARSET_INLINE):
7193 * composite.h (COMPOSITE_INLINE):
7194 * dispextern.h (DISPEXTERN_INLINE):
7195 * lisp.h (LISP_INLINE):
7196 * systime.h (SYSTIME_INLINE):
7197 New macro, replacing 'static inline' in this header.
7198 * buffer.h, category.h, character.h, charset.h, composite.h:
7199 * dispextern.h, lisp.h, systime.h:
7200 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7201 * alloc.c (LISP_INLINE):
7202 * buffer.c (BUFFER_INLINE):
7203 * category.c (CATEGORY_INLINE):
7204 * character.c (CHARACTER_INLINE):
7205 * charset.c (CHARSET_INLINE):
7206 * composite.c (COMPOSITE_INLINE):
7207 * dispnew.c (DISPEXTERN_INLINE):
7208 * sysdep.c (SYSTIME_INLINE):
7209 Define to EXTERN_INLINE, so that the corresponding functions
7210 are compiled into code.
7211 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
7212 (INLINE_HEADER_END): New macros.
7213 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
7214 since it's used in non-static inline functions now.
a8333d03 7215 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 7216
837b365b
GM
72172012-08-02 Glenn Morris <rgm@gnu.org>
7218
d66b744d
GM
7219 * s/: Remove empty directory.
7220
837b365b
GM
7221 * s/ms-w32.h: Move to ../nt/inc.
7222 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
7223 Update for new ms-w32.h location.
7224
13294f95
PE
72252012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7226
7227 Port to Solaris 8.
7228 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
7229
90df0db3
GM
72302012-08-02 Glenn Morris <rgm@gnu.org>
7231
7232 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
7233 hard-coding the path separator.
7234
4939150c
PE
72352012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7236
7237 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
7238 This how ASET and AREF are supposed to work, and makes
7239 it easier to think about future improvements. See
7240 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
7241 * charset.h (set_charset_attr): New function.
7242 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
7243 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
7244 (aref_addr): New function. All uses of &AREF(...) changed.
7245 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7246 (set_hash_index): New functions. All lvalue-style uses of
7247 HASH_KEY etc. changed.
7248 * keyboard.c (set_prop): New function. All lvalue-style uses
7249 of PROP changed.
7250
947b2afd
AA
72512012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
7252
7253 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
7254 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 7255 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
7256 * nsfns.m (ns_set_name_as_filename): Likewise.
7257 * nsmenu.m (ns_update_menubar): Likewise.
7258 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
7259
4f5d0325
EZ
72602012-08-01 Eli Zaretskii <eliz@gnu.org>
7261
2008beae
EZ
7262 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
7263 Adapt to latest changes in field names of the corresponding Lisp
288479f6 7264 objects.
2008beae 7265
4f5d0325
EZ
7266 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
7267
fe3cc771
GM
72682012-08-01 Glenn Morris <rgm@gnu.org>
7269
7270 * s/msdos.h: Remove file.
7271 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
7272 * Makefile.in (S_FILE): Remove.
7273 (config_h): Remove S_FILE.
7274
c90acc54
JB
72752012-08-01 Juanma Barranquero <lekktu@gmail.com>
7276
7277 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
7278 Remove; moved to nt/config.nt.
7279
d8a05828
DA
72802012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7281
7282 Use INTERNAL_FIELD for conses and overlays.
7283 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
7284 Remove obsolete comment.
7285 (MVAR): New macro.
7286 (struct Lisp_Overlay): Use INTERNAL_FIELD.
7287 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
7288
8271d590
DA
72892012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7290
7291 Use INTERNAL_FIELD for symbols.
7292 * lisp.h (SVAR): New macro. Adjust users.
7293 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
7294 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
7295
3193acd2
DA
72962012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7297
7298 Use INTERNAL_FIELD for processes.
7299 * process.h (PVAR): New macro. Adjust style.
7300 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
7301 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
7302
3a45383a
DA
73032012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7304
7305 Use INTERNAL_FIELD for windows.
7306 * window.h (WVAR): New macro.
7307 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
7308 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7309 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7310 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
7311 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
7312 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7313
c1dbc63c
PE
73142012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7315
7316 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
7317
5c0c0e8a
GM
73182012-08-01 Glenn Morris <rgm@gnu.org>
7319
7320 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
7321 Move to configure.ac.
7322
552a99b4
JB
73232012-08-01 Juanma Barranquero <lekktu@gmail.com>
7324
7325 * makefile.w32-in (CONFIG_H): Update dependencies.
7326 (CONF_POST_H): New macro.
7327
7328 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
7329
8d8e2dfe
GM
73302012-07-31 Glenn Morris <rgm@gnu.org>
7331
bc96620a
GM
7332 * Makefile.in (S_FILE): No longer set by configure.
7333
476b1b2d
GM
7334 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
7335 is available.
7336 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
7337
b2c7a106
GM
7338 * process.h (NULL_DEVICE):
7339 * emacs.c (SEPCHAR):
7340 * editfns.c (USER_FULL_NAME): Let configure set them.
7341
d53d062a
GM
7342 * s/README, s/template.h: Remove files.
7343
4515017f
GM
7344 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
7345
8d8e2dfe
GM
7346 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
7347 Move to configure.ac.
7348
5b20b3cc
EZ
73492012-07-31 Eli Zaretskii <eliz@gnu.org>
7350
1e0afd9a
EZ
7351 * .gdbinit (xframe): Adapt to introduction of FVAR and the
7352 resulting renaming of 'struct frame' members.
7353
5b20b3cc
EZ
7354 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
7355
7356 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
7357 after introduction of FVAR.
7358
f1310128
JD
73592012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7360
79e721e0
JD
7361 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
7362
7363 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
7364 instead of compositeToPoint.
7365 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
7366
8d7c7eed 7367 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 7368
e34f7f79
DA
73692012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7370
7371 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
7372 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 7373 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
7374 (BVAR): Change to use INTERNAL_FIELD.
7375 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
7376 (KVAR): Change to use INTERNAL_FIELD.
7377 * frame.h (FVAR): New macro.
7378 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
7379 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
7380 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
7381 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
7382 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7383
c09bfb2f
DA
73842012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7385
7386 Miscellaneous fixes for non-default X toolkits.
7387 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
7388 * xterm.c (x_frame_of_widget): Remove redundant prototype.
7389 Move under #ifdef USE_LUCID.
7390 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
7391 definition and usage to avoid warnings.
7392
14c114ae
JD
73932012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7394
7395 * nsterm.m (openFiles): Fix previous checkin.
7396
3bd21e82
PE
73972012-07-31 Paul Eggert <eggert@cs.ucla.edu>
7398
7399 * indent.c (compute_motion): Remove unused local.
7400
c1529ded
GM
74012012-07-31 Glenn Morris <rgm@gnu.org>
7402
400d5621
GM
7403 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
7404
268e2432
GM
7405 * conf_post.h [USG5_4]:
7406 Move remaining contents of s/usg5-4-common.h here.
7407 * s/usg5-4-common.h: Remove file.
7408
7552f3ee
GM
7409 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
7410 * s/irix6-5.h: Remove file.
7411
6a381852
GM
7412 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
7413 * s/darwin.h: Remove file.
7414
c1529ded
GM
7415 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
7416 * s/hpux10-20.h: Remove file, which is now empty.
7417
b429a4ee
GM
74182012-07-30 Glenn Morris <rgm@gnu.org>
7419
7420 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
7421 * Makefile.in (config_h): Add conf_post.h.
7422 * makefile.w32-in (CONFIG_H): Add conf_post.h.
7423
adff3182
JD
74242012-07-30 Jan Djärv <jan.h.d@swipnet.se>
7425
7426 * nsterm.m (ns_do_open_file): New variable.
b9031d69 7427 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
7428 (openFile, openTempFile, openFileWithoutUI, openFiles):
7429 Open files only if ns_do_open_file.
adff3182 7430
c32af1e4
PE
74312012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7432
7393bcbb
PE
7433 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
7434 This no-op macro hasn't been needed for many years.
7435 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
7436
c32af1e4
PE
7437 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
7438 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
7439 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
7440 gdb_make_enums_visible.
7441 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
7442 (DIRECTORY_SEP): Now a constant, not a macro.
7443
302fc036
EZ
74442012-07-30 Eli Zaretskii <eliz@gnu.org>
7445
7446 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
7447 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
7448
7449 * w32term.c <w32_keyboard_codepage>: Renamed from
7450 keyboard_codepage and now external. All users changed.
7451
7452 * w32term.h: Add declaration of w32_keyboard_codepage.
7453
7454 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
7455 the codepage to translate keys to Unicode. If this argument is
7456 -1, use the value returned by GetConsoleCP. All callers changed.
7457
88fb40b4
PE
74582012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7459
0aee6912
PE
7460 Update .PHONY listings in makefiles.
7461 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
7462 bootstrap-clean, distclean, maintainer-clean, versioclean,
7463 extraclean, frc.
7464
88fb40b4
PE
7465 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
7466 This is a bit clearer. Fix some commentary typos.
7467
0a763bd1
GM
74682012-07-30 Glenn Morris <rgm@gnu.org>
7469
32bac6d6
GM
7470 * s/netbsd.h: Let configure include signal.h if needed.
7471 Remove file, which is now empty.
7472
b65e7c46
GM
7473 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
7474 Let configure set them.
7475 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
7476 No more need to undefine.
0a763bd1 7477
169304bd
AS
74782012-07-30 Andreas Schwab <schwab@linux-m68k.org>
7479
7480 * keymap.c (Fkey_description): Don't remove 0x80 bit from
7481 non-single-byte char when adding meta modifier. (Bug#12090)
7482
6cd7a139
DA
74832012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7484
7485 Convert safe_call to use variable number of arguments.
7486 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
7487 (safe_call2): Fix comment.
7488 * lisp.h (safe_call): Adjust prototype.
7489 * coding.c (encode_coding_object): Change to use safe_call2.
7490 * xfaces.c (merge_face_heights): Change to use safe_call1.
7491
d34d6ffc
GM
74922012-07-30 Glenn Morris <rgm@gnu.org>
7493
7b8a48e4 7494 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 7495 does that unconditionally. Remove file, which is now empty.
7b8a48e4 7496
d34d6ffc
GM
7497 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
7498 Remove empty files.
7499
03a660a6
PE
75002012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7501
7502 Export to GDB most of lisp.h's remaining object-like macros.
7503 * lisp.h (min, max): Move earlier, because they're used earlier now.
7504 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
7505 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
7506 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
7507 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
7508 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
7509 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
7510 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
7511 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
7512 Now constants, for GDB. They need not be macros.
7513 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
7514 Now constants, for GDB, as well as macros, for static initializers.
7515 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
7516 Move to after the definition of struct Lisp_Char_Table,
7517 since the former now needs that type defined.
7518 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
7519 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
7520 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
7521 New enums, for gdb_make_enums_visible.
7522 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 7523 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
7524 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
7525 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
7526 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
7527 enum maxargs, enum MAX_ALLOCA.
7528 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
7529 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
7530 no longer needed, now that they are done in lisp.h.
7531
e499d0ee
DA
75322012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7533
7534 Cleanup string bytes checking.
7535 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
7536 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
7537 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
7538 (check_sblock, compact_small_strings): Simplify.
7539
d5040d2d
PE
75402012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7541
7542 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
7543 These macros are confusing and no longer need to be defined, as
7544 the enum values now suffice. All uses replaced with definiens.
7545 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
7546
7f259ae6
JB
75472012-07-29 Juanma Barranquero <lekktu@gmail.com>
7548
7549 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
7550 ($(BLD)/w32console.$(O)): Update dependencies.
7551
7e63e0c3
DA
75522012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7553
7554 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
7555 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
7556 time. Adjust users.
7557 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
7558
ffd817eb
JD
75592012-07-29 Jan Djärv <jan.h.d@swipnet.se>
7560
7561 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
7562 setting sitelisp (Bug#12010).
7563
417a7a0e
EZ
75642012-07-29 Eli Zaretskii <eliz@gnu.org>
7565
14ae4239 7566 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
7567
7568 * w32heap.c (cache_system_info):
7569 * w32.c (sys_rename):
7570 * w32proc.c (find_child_console, sys_kill): All users changed.
7571
387d4d92
PE
75722012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7573
7574 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
7575
55a6cca6
EZ
75762012-07-29 Eli Zaretskii <eliz@gnu.org>
7577
7578 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
7579
dbcf001c
DA
75802012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7581
7582 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
7583 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
7584 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 7585
e2688e4a
DA
75862012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7587
7588 Generalize marker debugging code under MARKER_DEBUG and use eassert.
7589 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
7590 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
7591 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
7592 (replace_range, replace_range_2, del_range_2): Change to eassert.
7593 * marker.c (byte_char_debug_check): Adjust style.
7594
b46a6a83
PE
75952012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7596
7597 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
7598 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
7599 long-ago-commented-out code that talks about "WIN32".
7600 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
7601 All uses changed.
7602
e32a5799
PE
76032012-07-28 Paul Eggert <eggert@cs.ucla.edu>
7604
7605 Use Gnulib stdalign module (Bug#9772, Bug#9960).
7606 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
7607 Simplify by using alignof.
7608 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
7609 * lisp.h: Include <stdalign.h>.
7610 (GCALIGNMENT): New macro and constant.
7611 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
7612 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
7613 (stdalign): New macro, if not already defined.
7614
df81cd29
EZ
76152012-07-28 Eli Zaretskii <eliz@gnu.org>
7616
01bd1b0d
EZ
7617 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
7618 * w32inevt.c: Include w32inevt.h.
7619 (w32_read_console_input): New inline function, calls either
7620 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
7621 w32_console_unicode_input.
7622 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
7623 (w32_kbd_patch_key, key_event): Use the codepage returned by
7624 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
7625 (key_event): use uChar.UnicodeChar only if
7626 w32_console_unicode_input is non-zero.
7627
7628 * w32console.c: Include w32heap.h.
7629 <w32_console_unicode_input>: New global variable.
7630 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
7631 family of Windows, zero otherwise.
7632
7633 * w32inevt.h: Declare w32_console_unicode_input.
7634
df81cd29
EZ
7635 * xdisp.c (init_iterator): Don't reference tip_frame in a build
7636 --without-x. (Bug#11742)
7637
c20fdd9e
PE
76382012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7639
7640 Adjust GDB to reflect pvec_type changes (Bug#12036).
7641 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
7642 2012-07-04 changes to pseudovector representation.
7643 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 7644
32770973 76452012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
7646
7647 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
7648 bus address.
7649 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
7650
3438fe21
EZ
76512012-07-27 Eli Zaretskii <eliz@gnu.org>
7652
bcfbc9de
EZ
7653 * alloc.c (listn): Fix the order the arguments are consed onto the
7654 list.
7655
3438fe21
EZ
7656 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
7657 enumeration constants, as PURE and HEAP are too general, and clash
7658 with other headers and sources, such as gmalloc.c and the
7659 MS-Windows system headers. All users changed.
7660
eeaea515
DA
76612012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7662
7663 Revert last save_excursion_save and save_excursion_restore changes.
7664 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
7665 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
7666
073c88c2
DA
76672012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7668
7669 Fix recently-introduced typos in Windows port.
7670 Reported by Martin Rudalics <rudalics@gmx.at>.
7671 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 7672 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 7673
4706125e
PE
76742012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7675
7676 Improve GDB symbol export (Bug#12036).
7677 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
7678 arms of an 'if', not using conditional expressions; otherwise GDB
7679 complains about the types in the unevaluated arm when the argument
7680 is an integer literal.
7681 (xgetint): Simplify expression.
7682 * alloc.c (gdb_make_enums_visible): New constant. This ports to
7683 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
7684 Zaretskii in <http://bugs.gnu.org/12036#13>.
7685 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
7686 needed now that we have gdb_make_enums_visible.
7687 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
7688 (enum enum_USE_LSB_TAG):
7689 New enum types, packaging up enums that need to be exported to GDB.
7690
694b6c97
DA
76912012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7692
7693 Utility function to make a list from specified amount of objects.
7694 * lisp.h (enum constype): New datatype.
7695 (listn): New prototype.
7696 * alloc.c (listn): New function.
7697 (Fmemory_use_count, syms_of_alloc): Use it.
7698 * buffer.c (syms_of_buffer): Likewise.
7699 * callint.c (syms_of_callint): Likewise.
7700 * charset.c (define_charset_internal): Likewise.
7701 * coding.c (syms_of_coding): Likewise.
7702 * keymap.c (syms_of_keymap): Likewise.
7703 * search.c (syms_of_search): Likewise.
7704 * syntax.c (syms_of_syntax): Likewise.
7705 * w32.c (init_environment): Likewise.
7706 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
7707 * xdisp.c (syms_of_xdisp): Likewise.
7708 * xfns.c (syms_of_xfns): Likewise.
7709
6195f384
DA
77102012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7711
7712 Fast save_excursion_save and save_excursion_restore.
7713 * lisp.h (struct Lisp_Excursion): New data type.
7714 (PVEC_EXCURSION): New pseudovector type.
7715 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
7716 to deal with it. Adjust comments.
7717 (init_marker, attach_marker): New prototype.
7718 (unchain_marker): Adjust prototype.
7719 * marker.c (attach_marker): Change to global.
7720 (init_marker): New function.
7721 * alloc.c (Fmake_marker, build_marker): Use it.
7722 (build_marker): More easserts.
7723 (mark_object): Handle struct Lisp_Excursion.
7724 * editfns.c (save_excursion_save, save_excursion_restore):
7725 Reimplement to use struct Lisp_Excursion. Add comments.
7726
5eceb8fb
PE
77272012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7728
7729 Fix export of symbols to GDB (Bug#12036).
7730 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
7731 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
7732 emacs.c, as this is a more-suitable home. Had this been done earlier
7733 the fix for 12036 would have avoided some of the problems noted in
7734 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
7735 would have been more obvious.
562157c8
PE
7736 * emacs.c: Do not include <verify.h>; no longer needed.
7737 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
7738 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
7739 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7740 Remove; now done in lisp.h.
7741 * lisp.h (PUBLISH_TO_GDB): New macro.
7742 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
7743 (DATA_SEG_BITS): Use it.
7744 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
7745 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
7746 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
7747 not be usable in #if. This simplifies things.
7748
d6749401
JB
77492012-07-26 Juanma Barranquero <lekktu@gmail.com>
7750
7751 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
7752
1781b9e9
PE
77532012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7754
d89518db 7755 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
7756 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
7757 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
7758 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
7759 Adjust to changes in lisp.h and emacs.c, by using
7760 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
7761 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
7762 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
7763 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
7764 instead of gdb_valbits.
7765 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
7766 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
7767 instead of gdb_array_mark_flag.
7768 (xboolvector): Get size from $->size, not $->header.size.
7769 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
7770 (xreload, hook-run, hookpost-run): Remove.
7771 * emacs.c: Include <verify.h>.
7772 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
7773 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
7774 Remove.
7775 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
7776 (gdb_USE_LSB_TAG): New enum constants.
7777 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7778 Also define these as enum constants, so they're visible to GDB.
7779 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
7780 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
7781 as constants, so they're visible to GDB.
7782 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
7783 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
7784 Now enum constants, not macros, so they're visible to GDB.
7785 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
7786 more convenient now. All uses changed.
7787 (VALMASK) [USE_LSB_TAG]: Also define in this case.
7788 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
7789
3628596a
DA
77902012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
7791
7792 Explicitly free restriction data that are not needed anymore.
7793 * editfns.c (save_restriction_restore): Free restriction data.
7794
7abaf5cc
SM
77952012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
7796
7797 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
7798 add argument, tune behavior, and adjust all callers.
7799
71f88e00
PE
78002012-07-25 Paul Eggert <eggert@cs.ucla.edu>
7801
7802 Use typedef for EMACS_INT, EMACS_UINT.
7803 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
7804 than macros. This simplifies debugging in the usual case, since
7805 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
7806 and it allows expressions involving EMACS_INT casts.
7807 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
7808
57ec3034
JD
78092012-07-25 Jan Djärv <jan.h.d@swipnet.se>
7810
7811 * nsterm.m (ns_read_socket): Return early if there is a modal
7812 window (Bug#12043).
7813
8137e7b3
MR
78142012-07-25 Martin Rudalics <rudalics@gmx.at>
7815
7816 * frame.c (Fredirect_frame_focus): In doc-string don't mention
7817 that FOCUS-FRAME can be omitted.
7818
04e9897c
DA
78192012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
7820
7821 Adjust buffer text indirection counters at the end of Fkill_buffer.
7822 * buffer.c (Fkill_buffer): Adjust indirection counters when the
7823 buffer is definitely dead. This should really fix an issue reported
7824 by Christoph Scholtes again. (Bug#12007).
7825 (init_buffer_once): Initialize indirection counters of
7826 buffer_defaults and buffer_local_symbols (for sanity and safety).
7827
8a0484e1
EZ
78282012-07-24 Eli Zaretskii <eliz@gnu.org>
7829
7830 * xdisp.c (init_iterator): Don't compute dimensions of truncation
7831 and continuation glyphs on tooltip frames, leave them at zero.
7832 Avoids continued lines in tooltips. (Bug#11832)
7833
fa691a83
DA
78342012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
7835
7836 Simplify copy_overlay.
04e9897c 7837 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
7838 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
7839
436bc8e0
EZ
78402012-07-23 Eli Zaretskii <eliz@gnu.org>
7841
7842 * print.c (print_object): Don't crash when a frame's name is nil
7843 or invalid. (Bug#12025)
7844
7845 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
7846 it signals an error when a tooltip frame is being created.
7847
d7a7fda3
DA
78482012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
7849
7850 Cleanup miscellaneous objects allocation and initialization.
7851 * alloc.c (allocate_misc): Change to static. Add argument to
7852 specify the subtype. Adjust comment and users.
7853 (build_overlay): New function.
7854 * buffer.c (copy_overlays, Fmake_overlay): Use it.
7855 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
7856 (allocate_misc): Remove prototype.
7857 (build_overlay): Add prototype.
7858
78592012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
7860
7861 Swap buffer text indirection counters in Fbuffer_swap_text.
7862 * buffer.c (Fbuffer_swap_text): Swap indirections too.
7863 This avoids crash reported by Christoph Scholtes at
7864 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
7865
9d7fa573
JD
78662012-07-22 Jan Djärv <jan.h.d@swipnet.se>
7867
7868 * nsmenu.m (Popdown_data): New struct.
7869 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
7870 free Popdown_data.
7871 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
7872 (initWithContentRect): Make imgView and contentView non-static
7873 and autorelease them. Also autorelease img and matrix (Bug#12005).
7874 (dealloc): Remove (Bug#12005).
7875
0dd6d66d
DA
78762012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7877
7878 Adjust consing_since_gc when objects are explicitly freed.
7879 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
7880 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
7881 (free_cons, free_misc): Subtract object size from consing_since_gc.
7882
d36d71df
DA
78832012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7884
7885 Simplify and cleanup markers positioning code.
7886 * marker.c (attach_marker): More useful eassert.
7887 (live_buffer, set_marker_internal): New function.
7888 (Fset_marker, set_marker_restricted): Use set_marker_internal.
7889 (set_marker_both, set_marker_restricted_both): Use live_buffer.
7890
fb9ea40f
PE
78912012-07-22 Paul Eggert <eggert@cs.ucla.edu>
7892
7893 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
7894 as it's limited by the amount of memory, not by INT_MAX.
7895
2d5c5f7d
EZ
78962012-07-21 Eli Zaretskii <eliz@gnu.org>
7897
07fb592e
EZ
7898 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
7899 in special-event-map. See the discussion at
7900 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
7901 for the reasons.
7902
37a9eac8 7903 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
7904 info.dwItemData. Fixes crashes on 64-bit Windows.
7905 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 7906
c4328746
JD
79072012-07-21 Jan Djärv <jan.h.d@swipnet.se>
7908
fc0c31f8 7909 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 7910 (conversationIdentifier): Return value is NSInteger.
784051c4 7911 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 7912
6e5d1c12
CY
79132012-07-21 Chong Yidong <cyd@gnu.org>
7914
7915 * window.c (decode_any_window): Signal an error if the window is
7916 on a dead frame (Bug#11984).
7917
9928463d
DA
79182012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7919
7920 Add indirection counting to speed up Fkill_buffer.
7921 * buffer.h (struct buffer): New member.
7922 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
7923 (Fmake_indirect_buffer): Set indirection counter to -1, increment
7924 base buffer indirection counter.
7925 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
7926 (Fkill_buffer): Adjust indirection counters as needed, don't walk
7927 through buffer list if indirection counter is 0.
7928
f8643a6b
DA
79292012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7930
7931 Extend the value returned by Fgarbage_collect with heap statistics.
7932 * alloc.c (Qheap): New symbol.
7933 (syms_of_alloc): DEFSYM it.
7934 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
7935 (Fmemory_free): Remove.
7936 (syms_of_alloc): Don't defsubr it.
7937 * buffer.c (Fcompact_buffer): Remove.
7938 (syms_of_buffer): Don't defsubr it.
7939
dac616ff
DA
79402012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7941
7942 Make maybe_gc inline.
7943 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
7944 * lisp.h (consing_since_gc, gc_relative_threshold)
7945 (memory_full_cons_threshold): Revert declaration.
7946 (maybe_gc): Remove prototype, define as inline.
7947 * alloc.c: Remove old commented-out code.
7948 (consing_since_gc, gc_relative_threshold)
7949 (memory_full_cons_threshold): Revert to global.
7950 (maybe_gc): Remove.
7951
d7ea76b4
DA
79522012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7953
7954 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
7955 * lisp.h (build_unibyte_string): New function.
7956 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
7957 * sysdep.c, w32fns.c, xfns.c: Use it.
7958 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
7959 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
7960 Adjust users accordingly.
7961 * font.h (font_open_by_name): Adjust prototype.
7962
765e61e3
DA
79632012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7964
7965 Cleanup calls to Fgarbage_collect.
7966 * lisp.h (maybe_gc): New prototype.
7967 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7968 Remove declarations.
7969 * alloc.c (maybe_gc): New function.
7970 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7971 Make them static.
7972 * bytecode.c (MAYBE_GC): Use maybe_gc.
7973 * eval.c (eval_sub, Ffuncall): Likewise.
7974 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
7975 to avoid dependency from auto-save feature.
7976
52b852c7
PE
79772012-07-19 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
7980 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
7981 'for_each_per_buffer_object_at'.
7982 All uses changed. It's better to use upper-case for macros that
7983 cannot be implemented as functions, to give the reader a clue
7984 that they're special.
7985
5db81e33
SM
79862012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
7987
7988 * alloc.c (Fgarbage_collect): Tweak docstring.
7989
5b835e1d
DA
79902012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7991
7992 Tweak the value returned from Fgarbage_collect again.
7993 * alloc.c (Fgarbage_collect): New return value, as confirmed in
7994 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
7995 Adjust documentation.
7996 (total_vector_bytes): Rename to total_vector_slots, adjust
7997 accounting.
7998 (total_free_vector_bytes): Rename to total_free_vector_slots,
7999 adjust accounting.
8000 (Qstring_bytes, Qvector_slots): New symbols.
8001 (syms_of_alloc): DEFSYM them.
8002
9cd47b72
DA
80032012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8004
8005 Buffer compaction primitive which may be used from Lisp.
8006 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8007 (syms_of_buffer): Register Fcompact_buffer.
8008 * alloc.c (Fgarbage_collect): Use compact_buffer.
8009 * buffer.h (compact_buffer): New prototype.
8010 (struct buffer_text): New member.
8011
d17337e5
DA
80122012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8013
8014 New macro to iterate over all buffers, miscellaneous cleanups.
8015 * lisp.h (all_buffers): Remove declaration.
8016 * buffer.h (all_buffers): Add declaration, with comment.
8017 (for_each_buffer): New macro.
8018 * alloc.c (Fgarbage_collect, mark_object): Use it.
8019 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
8020 (init_buffer): Likewise.
8021 * data.c (Fset_default): Likewise.
8022 * coding.c (code_conversion_restore): Remove redundant check
8023 for dead buffer.
8024 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
8025
60cfd278
AS
80262012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8027
8028 Fix bug that created negative-length intervals.
8029 * intervals.c (merge_interval_right, merge_interval_left):
8030 Do not zero out this interval if it is absorbed by its children,
8031 as this interval's total length doesn't change in that case. See
8032 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
8033
d06714cb
PE
80342012-07-18 Paul Eggert <eggert@cs.ucla.edu>
8035
83713154
PE
8036 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
8037 when invoking (make-bool-vector N t) and N is a positive
8038 multiple of 8 -- the last 8 bits were mistakenly cleared.
8039
d06714cb
PE
8040 Remove some struct layout assumptions in bool vectors.
8041 * alloc.c (bool_header_size): New constant.
8042 (header_size, word_size): Move earlier, as they're now used earlier.
8043 Use 'word_size' in a few more places, where it's appropriate.
8044 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
8045 padding before the data member of a bool vector.
8046 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
8047 than doing the check by hand with an abort ().
8048
464d5a5e
SM
80492012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8050
5fbc0409
SM
8051 * eval.c (Fdefvar): Don't check constants since we only set the var if
8052 it's not yet defined anyway (bug#11904).
8053
464d5a5e
SM
8054 * lisp.h (last_undo_boundary): Declare new var.
8055 * keyboard.c (command_loop_1): Set it.
8056 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
8057 were auto-added by the command loop (bug#11774).
8058
8dc2e44a
AS
80592012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8060
8061 * w32font.c (Qsymbol): Remove local definition.
8062 (syms_of_w32font): Don't DEFSYM it.
8063
169925ec
DA
80642012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8065
8066 Fix sweep_vectors to handle large bool vectors correctly.
8067 * alloc.c (sweep_vectors): Account total_vector_bytes for
8068 bool vectors larger than VBLOCK_BYTES_MAX.
8069
5fbfb018
CY
80702012-07-18 Chong Yidong <cyd@gnu.org>
8071
8072 * frame.c (x_set_frame_parameters): Revert bogus change introduced
8073 in 2012-05-25 commit by Paul Eggert (Bug#11738).
8074
3ab6e069
DA
80752012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8076
8077 Return more descriptive data from Fgarbage_collect.
8078 Suggested by Stefan Monnier in
8079 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
8080 * alloc.c (bounded_number): New function.
8081 (total_buffers, total_vectors): New variable.
8082 (total_string_size): Rename to total_string_bytes, adjust users.
8083 (total_vector_size): Rename to total_vector_bytes, adjust users.
8084 (sweep_vectors): Account total_vectors and total_vector_bytes.
8085 (Fgarbage_collect): New return value. Adjust documentation.
8086 (gc_sweep): Account total_buffers.
8087 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
8088 (VECTOR_SIZE): Remove.
8089 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
8090 (Qinterval, Qmisc): New symbols.
8091 (syms_of_data): Initialize them.
8092 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
8093 (Qcons, Qbuffer): New declarations.
8094
6d02fe5b
PE
80952012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8096
8097 * alloc.c (Fmemory_free): Account for memory-free's own storage.
8098 Round up, not down. Improve doc.
8099
b7ffe040
DA
81002012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8101
8102 Restore old code in allocate_string_data to avoid Faset breakage.
8103 Reported by Julien Danjou <julien@danjou.info> in
8104 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
8105 * alloc.c (allocate_string_data): Restore old code with minor
8106 adjustments, fix comment to explain this subtle issue.
8107
4dc7c8d5
SM
81082012-07-17 Eli Zaretskii <eliz@gnu.org>
8109
8110 Remove FILE_SYSTEM_CASE.
8111 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
8112
8113 * fileio.c (FILE_SYSTEM_CASE): Don't define.
8114 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
8115 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
8116 call-process-region passes it through expand-file-name.
8117
8118 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
8119
81202012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8121
8122 Fix crash when creating indirect buffer (Bug#11917)
8123 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
8124 Don't handle unbound variables specially if non-zero.
8125 (Fbuffer_local_variables): Pass zero.
8126 (clone_per_buffer_values): Pass non-zero.
8127
81282012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8129
8130 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
8131 to make the loop interruptible.
8132
81332012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8134
8135 * gnutls.c (emacs_gnutls_handshake): Only retry if
8136 GNUTLS_E_INTERRUPTED.
8137
cce7fefc
DA
81382012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8139
8140 Cleanup and convert miscellaneous checks to eassert.
8141 * alloc.c (mark_interval): Fix comment, partially rephrase
8142 old comment from intervals.h (see below).
8143 * intervals.c (find_interval, adjust_intervals_for_insertion)
8144 (delete_interval, adjust_intervals_for_deletion)
8145 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
8146 Convert to eassert.
8147 (adjust_intervals_for_insertion, make_new_interval):
8148 Remove obsolete and unused code.
8149 * intervals.h (struct interval): Remove obsolete comment.
8150 * textprotp.c (erase_properties): Remove unused code.
8151 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
8152 (Fremove_list_of_text_properties): Convert to eassert.
8153
9ea10cc3
CY
81542012-07-17 Chong Yidong <cyd@gnu.org>
8155
8156 * editfns.c (Finsert_char): Doc fix.
8157
3900d5de
DA
81582012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8159
8160 Fix previous change to make Fmemory_free always accurate.
8161 * alloc.c (make_interval): Update total_free_intervals.
8162 (make_float): Likewise for total_free_floats.
8163 (free_cons, Fcons): Likewise for total_free_conses.
8164 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
8165 Likewise for total_free_vector_bytes.
8166 (Fmake_symbol): Likewise for total_free_symbols.
8167 (bytes_free): Remove.
8168
7098646f
DA
81692012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8170
8171 Simple free memory accounting feature.
8172 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
8173 (sweep_vectors): Accumulate size of free vectors.
8174 (Fgarbage_collect): Setup bytes_free.
8175 (Fmemory_free): New function.
8176 (syms_of_alloc): Register it.
8177
22657b40
DA
81782012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8179
8180 Cleanup overlays checking.
8181 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
8182 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
8183 eassert and OVERLAYP.
8184 (sort_overlays): Change to use OVERLAYP.
8185
ddfc8813
RK
81862012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
8187
8188 * editfns.c (Finsert_char): Make it interactive, and make the
8189 second arg optional. Copy interactive spec and docstring from
8190 ucs-insert.
8191
7c26cf3c
PE
81922012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8193
8194 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
8195 Unlike the other wrapped functions, fabs has an unspecified
8196 effect on errno.
8197
5d127af9
JD
81982012-07-16 Jan Djärv <jan.h.d@swipnet.se>
8199
8200 * nsterm.m (keyDown): Interpret flags without left/right bits
8201 as the left key (Bug#11670).
8202
6a0dd1d7
DA
82032012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8204
8205 Remove empty and useless init functions.
8206 * lisp.h (init_character_once, init_fns, init_image)
8207 (init_filelock, init_sound): Remove prototype.
8208 * character.c (init_character_once): Remove.
8209 * filelock.c (init_filelock): Likewise.
8210 * fns.c (init_fns): Likewise.
8211 * image.c (init_image): Likewise.
8212 * sound.c (init_sound): Likewise.
8213 * emacs.c (main): Adjust accordingly.
8214
7a6136fd
DA
82152012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8216
8217 * gtkutil.h: Tiny cleanups.
8218 (use_old_gtk_file_dialog): Remove useless declaration.
8219 (xg_uses_old_file_dialog): Add suggested const attribute.
8220
ce811ad9
EZ
82212012-07-15 Eli Zaretskii <eliz@gnu.org>
8222
8223 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
8224 (bidi_paragraph_init): Use it to limit search forward for a strong
8225 directional character in abnormally large paragraphs full of
8226 neutral or weak characters. (Bug#11943)
8227
c9adfeaa
SF
82282012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
8229
8230 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
8231 the toolbar (Bug#9451).
8232 (xg_make_tool_item): Give the widget event box a transparent
8233 background.
8234
fff62aa9
DA
82352012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8236
8237 Cleanup basic allocation variables and functions.
8238 * alloc.c (ignore_warnings, init_intervals, init_float)
8239 (init_cons, init_symbol, init_marker): Remove.
8240 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
8241 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
8242 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
8243 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
8244 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
8245 (staticidx, init_alloc_once, init_strings, free_ablock):
8246 Remove redundant initialization.
8247 * fns.c (init_weak_hash_tables): Remove.
8248 * lisp.h (init_weak_hash_tables): Remove prototype.
8249
9730daca
DA
82502012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8251
8252 Use zero_vector where appropriate.
8253 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
8254 accordingly.
8255 * lisp.h (zero_vector): New declaration.
8256 * font.c (null_vector): Remove.
8257 (syms_of_font): Remove initialization and staticpro.
8258 (font_list_entities, font_find_for_lface): Change to use zero_vector.
8259 * keymap.c (Faccessible_keymaps): Likewise.
8260
2e2d2a13
LL
82612012-07-15 Leo Liu <sdl.web@gmail.com>
8262
8263 * fringe.c: Fix typo in comments.
8264
cd276f6e
LL
82652012-07-14 Leo Liu <sdl.web@gmail.com>
8266
8267 * fringe.c: Add a new bitmap exclamation-mark.
8268
5a1131d9
EZ
82692012-07-14 Eli Zaretskii <eliz@gnu.org>
8270
8271 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
8272
8273 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
8274 (HAVE_MENUS): Don't define, defined by editing config.in with
8275 msdos/sed2v2.inp.
8276 (GMALLOC_INHIBIT_VALLOC): Don't define.
8277 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
8278
22e983b7
JB
82792012-07-14 Juanma Barranquero <lekktu@gmail.com>
8280
8281 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
8282
5b3f250f
GM
82832012-07-14 Glenn Morris <rgm@gnu.org>
8284
8285 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
8286 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
8287 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
8288
33d63ff4
GM
82892012-07-13 Glenn Morris <rgm@gnu.org>
8290
5b633342
GM
8291 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
8292
33d63ff4
GM
8293 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
8294 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
8295
b55b9f85
JD
82962012-07-13 Jan Djärv <jan.h.d@swipnet.se>
8297
0dc8cf50
JD
8298 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
8299 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
8300 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
8301 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
8302 where appropriate.
8303 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
8304 as boolean expression.
8305 (x_set_window_size): Remove unused variable toolbar.
8306 (ns_get_color_default, ns_mod_to_lisp): Remove.
8307 (ns_mouse_position): Remove unused variables xchar and ychar.
8308 (ns_compute_glyph_string_overhangs): Remove unused variable face.
8309 (ns_set_vertical_scroll_bar): Remove unused variable count.
8310 (ns_delete_terminal): Remove unused variable i.
8311 (ns_term_init): Remove unused variables r, g and b.
8312 (mouseDown): Remove unused variable window.
8313 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
8314 (initFrameFromEmacs): Remove unused variable vbextra.
8315 (mouseEntered): Remove unused variables p and dpyinfo.
8316 (mouseExited): Remove unused variables p and r.
8317 (ns_define_frame_cursor, ns_clear_frame_area)
8318 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
8319 (menuDown): Assign [sender tag] to variable and cast the variable.
8320
8321 * nsterm.h (menuDown): Add id as type to argument sender.
8322 (ns_display_info_for_name): Add Lisp_Object argument.
8323 (ns_term_init): Add Lisp_Object argument.
8324 (ns_map_event_to_object): Add void argument.
8325 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
8326 prototype with arguments and only declare if __OBJC__.
8327 (nxatoms_of_nsselect): Add void argument.
8328 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
8329 (ns_alloc_autorelease_pool): Add void argument.
8330 (ns_release_autorelease_pool): Add void* argument.
8331 (ns_get_defaults_value): Add const char* argument.
8332
8333 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
8334 (initFromContents): Use SSDATA where appropriate.
8335 (ns_update_menubar): Add braces to ambigous if-else.
8336 (initWithTitle): Put () around assignment in if statement.
8337 (ns_menu_show): Remove unused variables window and keymap.
8338 (update_frame_tool_bar): Remove unused variable selected_p.
8339 (initWithContentRect): Remove unused variable this_cmd_name.
8340
8341 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
8342 appropriate.
8343 (setXBMColor): Remove unused variable len.
8344 (setPixmapData): Put () around assignment in loop statement.
8345
8346 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
8347 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
8348 where appropriate.
8349 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
8350 around assignment in loop statement.
8351 (nsfont_open): Remove unused variable i.
8352 (nsfont_open): Remove unused variable len.
8353 (nsfont_draw): Remove unused variable cs.
8354
8355 * nsfns.m (x_set_icon_name, ns_set_name_internal)
8356 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
8357 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
8358 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
8359 (Fns_font_name, Fns_perform_service)
8360 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
8361 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
8362 (ns_set_name): Remove unused variable view.
8363 (x_set_menu_bar_lines): Remove unused variable olines.
8364 (x_set_tool_bar_lines): Remove unused variable root_window.
8365 (Fns_list_colors): Put () around assignment in while statement.
8366 (Fns_perform_service): Remove unused variable len.
8367 (Fns_display_usable_bounds): Remove unused variable top.
8368 (syms_of_nsfns): Remove unused variable i.
8369
b55b9f85
JD
8370 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
8371 memcpy (Bug#11907).
8372
ed9265fc 83732012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
8374
8375 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
8376 and free it with DestroyExceptionInfo (Bug#11558).
8377
ef099b57
JB
83782012-07-13 Juanma Barranquero <lekktu@gmail.com>
8379
8380 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
8381 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
8382 Set here, not in nt/config.nt.
8383
ea814a5d
EZ
83842012-07-13 Eli Zaretskii <eliz@gnu.org>
8385
8386 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
8387 cursor overflow into the last glyph on display line when the right
8388 fringe is off. (Bug#11832)
8389
1a952767
PE
83902012-07-13 Paul Eggert <eggert@cs.ucla.edu>
8391
8392 * xdisp.c (produce_special_glyphs): Now static.
8393 * dispextern.h (produce_special_glyphs): Remove decl.
8394
983188fd
GM
83952012-07-13 Glenn Morris <rgm@gnu.org>
8396
8d7c7eed 8397 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
8398 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
8399
983188fd
GM
8400 * s/usg5-4-common.h (USG, USG5):
8401 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
8402 * s/sol2-6.h (SOLARIS2):
8403 * s/irix6-5.h (IRIX6_5):
8404 * s/hpux10-20.h (USG, USG5, HPUX):
8405 * s/gnu-linux.h (USG, GNU_LINUX):
8406 * s/freebsd.h (BSD_SYSTEM):
8407 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
8408 * s/cygwin.h (CYGWIN):
8409 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
8410 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
8411
d1e68667 84122012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
8413
8414 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 8415
6de0e799
GM
84162012-07-13 Glenn Morris <rgm@gnu.org>
8417
739ae010
GM
8418 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
8419
dbee5793
GM
8420 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
8421
6de0e799
GM
8422 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
8423 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
8424
b82da769
GM
84252012-07-12 Glenn Morris <rgm@gnu.org>
8426
4fae5a7a 8427 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
8428
8429 * process.c (init_process_emacs): Rename from init_process.
8430 The old name is also the name of a Mach system call.
8431 * lisp.h, emacs.c: Update for this name change.
8432 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
8433 longer needed.
8434
5a979817
EZ
84352012-07-12 Eli Zaretskii <eliz@gnu.org>
8436
8437 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
8438 memmove call that removes glyphs covered by the left truncation
8439 glyph. Improve commentary.
8440 (display_line): Fix display of continuation glyphs on GUI frames
8441 when the right fringe is turned off and variable-size fonts are
8442 used in the window. Move the code that appends a stretch glyph to
8443 produce_special_glyphs, so that it could be used for truncation
8444 and continuation glyphs alike.
8445 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
8446 glyph of a suitably computed width, to align the special glyphs at
8447 the window margin. Code moved from display_line. (Bug#11832)
8448
3e91a053
GM
84492012-07-12 Glenn Morris <rgm@gnu.org>
8450
ba9e4b84
GM
8451 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
8452
8453 * s/gnu-linux.h, s/hpux10-20.h:
8454 Do not unconditionally define HAVE_XRMSETDATABASE.
8455
3e91a053
GM
8456 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
8457
b300b1f4
PE
84582012-07-12 Paul Eggert <eggert@cs.ucla.edu>
8459
8460 Fix typos that broke OS X build.
8461 Reported by Randal L. Schwartz in
8462 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
8463 * nsterm.m (ns_timeout): Add missing local decl.
8464 (ns_get_color): snprintf -> sprintf, to fix typo.
8465
6e777848
GM
84662012-07-12 Glenn Morris <rgm@gnu.org>
8467
3f922c37
GM
8468 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
8469 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
8470 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
8471 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
8472
0ab7b23a
GM
8473 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
8474 Move PTY_OPEN to configure.
8475
6e777848
GM
8476 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8477 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
8478 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
8479
4a7edc24
DA
84802012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
8481
8482 Use empty_unibyte_string where applicable.
8483 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
8484 * lread.c (read1): Likewise.
8485 * xsettings.c (syms_of_xsettings): Likewise.
8486
308aab79
GM
84872012-07-12 Glenn Morris <rgm@gnu.org>
8488
42bd1719
GM
8489 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
8490 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
8491 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
8492 * s/hpux10-20.h (RUN_TIME_REMAP):
8493 * s/bsd-common.h (TABDLY): Move to configure.
8494
8495 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
8496
8497 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
8498
ea0bbd17 8499 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 8500 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
8501
8502 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 8503
308aab79
GM
8504 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
8505 * s/template.h: Move NARROWPROTO to configure.
8506
ee1cf5cf
GM
85072012-07-11 Glenn Morris <rgm@gnu.org>
8508
30fe9bf4
GM
8509 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
8510 unused since 2011-01-17 change to systty.h.
8511
ee1cf5cf
GM
8512 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
8513 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8514 Move HAVE_PTYS and HAVE_SOCKETS to configure.
8515
63e47e07
PE
85162012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8517
8518 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
8519
c43fb4c3
GM
85202012-07-11 Glenn Morris <rgm@gnu.org>
8521
8522 * s/darwin.h, s/gnu-linux.h, s/template.h:
8523 Move INTERRUPT_INPUT to configure.
8524
e8df9267
DA
85252012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8526
8527 Minor adjustments to interning code.
8528 * lisp.h (intern, intern_c_string): Redefine as static inline
8529 wrappers for intern_1 and intern_c_string_1, respectively.
8530 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
8531 * lread.c (intern_1, intern_c_string_1, oblookup):
8532 Simplify Vobarray checking.
e8df9267
DA
8533 * font.c (font_intern_prop): Likewise. Adjust comment.
8534 * w32font.c (intern_font_name): Likewise.
8535
34348bd4
AS
85362012-07-11 Andreas Schwab <schwab@linux-m68k.org>
8537
d96a1e0c
AS
8538 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
8539
34348bd4
AS
8540 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
8541 of Fcar/Fcdr if possible.
8542 * font.c (check_otf_features): Likewise.
8543 * fontset.c (Fnew_fontset): Likewise.
8544 * gnutls.c (Fgnutls_boot): Likewise.
8545 * minibuf.c (read_minibuf): Likewise.
8546 * msdos.c (IT_set_frame_parameters): Likewise.
8547 * xmenu.c (Fx_popup_dialog): Likewise.
8548 * w32menu.c (Fx_popup_dialog): Likewise.
8549
c8add24e
GM
85502012-07-11 Glenn Morris <rgm@gnu.org>
8551
4b575b3c
GM
8552 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
8553 since nothing has defined it on these platforms.
8554
09f4e3b0
GM
8555 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
8556 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
8557
172bedef
GM
8558 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8559 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8560 Move CLASH_DETECTION to configure.
8561
249685df
GM
8562 * s/gnu.h: Remove file, which is now empty.
8563
c8add24e
GM
8564 * s/gnu.h, s/gnu-linux.h:
8565 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
8566
b41253a3
JW
85672012-07-11 John Wiegley <johnw@newartisans.com>
8568
8569 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
8570 function attribute, so we only use it if it exists in the
8571 compiler.
8572
d923b542
DA
85732012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8574
8575 Avoid call to strlen in fast_c_string_match_ignore_case.
8576 * search.c (fast_c_string_match_ignore_case): Change to use
8577 length argument. Adjust users accordingly.
8578 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
8579
5ebbef1d
PE
85802012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8581
bb352260
PE
8582 Assume mkdir, rmdir.
8583 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
8584 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
8585
57054ddd
PE
8586 Assume rename.
8587 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
8588
b747d3f7
PE
8589 Assume perror.
8590 * s/hpux10-20.h (HAVE_PERROR): Remove.
8591 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
8592 Remove dummy definition, as this problem was obsolete long ago.
8593
5ebbef1d
PE
8594 Assume strerror.
8595 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
8596
984e7f30
DA
85972012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8598
8599 Avoid calls to strlen in font processing functions.
8600 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
8601 (font_open_by_name): Change to use length argument.
8602 Adjust users accordingly.
d923b542
DA
8603 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
8604 Adjust prototypes.
8605 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
8606 Change to return ptrdiff_t.
984e7f30
DA
8607 (xfont_list_pattern, xfont_match): Use length returned by
8608 xfont_decode_coding_xlfd.
8609 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
8610
20e94fdd
GM
86112012-07-11 Glenn Morris <rgm@gnu.org>
8612
9d596af3
GM
8613 * s/darwin.h, s/freebsd.h, s/netbsd.h:
8614 Move DONT_REOPEN_PTY to configure.
8615
20e94fdd
GM
8616 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
8617 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
8618
e99a530f
PE
86192012-07-10 Paul Eggert <eggert@cs.ucla.edu>
8620
22ffb973
PE
8621 Remove "#define unix" that is no longer needed (Bug#11905).
8622 * s/aix4-2.h (unix): Remove; no longer needed.
8623
e9a9ae03
PE
8624 EMACS_TIME simplification (Bug#11875).
8625 This replaces macros (which typically do not work in GDB)
8626 with functions, typedefs and enums, making the code easier to debug.
8627 The functional style also makes code easier to read and maintain.
8628 * systime.h: Include <sys/time.h> on all hosts, not just if
8629 WINDOWSNT, since 'struct timeval' is needed in general.
8630 (EMACS_TIME): Now a typedef, not a macro.
8631 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
8632 not macros.
8633 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
8634 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
8635 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
8636 (EMACS_TIME_LE): Now functions, not macros.
8637 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
8638 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
8639 which are not functions. All uses rewritten to use:
8640 (make_emacs_time): New function.
8641 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
8642 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
8643 not functions. All uses rewritten to use the following, respectively:
8644 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
8645 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 8646 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
8647 * fileio.c (Fcopy_file):
8648 * xterm.c (XTflash): Get the current time closer to when it's used.
8649 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
8650
ffacb126
PE
8651 * bytecode.c (targets): Suppress -Woverride-init warnings.
8652
e99a530f
PE
8653 Simplify by avoiding confusing use of strncpy etc.
8654 * doc.c (Fsnarf_documentation):
8655 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
8656 * frame.c (Fmake_terminal_frame):
8657 * gtkutil.c (get_utf8_string):
8658 * lread.c (openp):
8659 * nsmenu.m (ns_update_menubar):
8660 * regex.c (regerror):
8661 Prefer memcpy to strncpy and strncat when either will do.
8662 * fileio.c (Fsubstitute_in_file_name):
8663 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
8664 (menu_separator_name_p):
8665 * nsmenu.m (ns_update_menubar):
8666 Prefer memcmp to strncmp when either will do.
8667 * nsterm.m: Include <ftoastr.h>.
8668 (ns_get_color):
8669 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
8670 Prefer snprintf to strncpy.
8671 * nsterm.m (ns_term_init):
8672 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
8673 * nsterm.m (ns_term_init):
8674 Avoid the need for strncpy, by using build_string or
8675 make_unibyte_string directly. Use dtoastr, not snprintf.
8676 * process.c (Fmake_network_process): Diagnose service names that
8677 are too long, rather than silently truncating them or creating
8678 non-null-terminated names.
8679 (Fnetwork_interface_info): Likewise, for interface names.
8680 * sysdep.c (system_process_attributes) [GNU_LINUX]:
8681 Prefer sprintf to strncat.
8682 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
8683 Prefer vsnprintf to vsprintf + strncpy.
8684
c59592b3
GM
86852012-07-10 Glenn Morris <rgm@gnu.org>
8686
8687 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
8688 Clarify fallback case.
8689
7d7bbefd
DA
86902012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8691
8692 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
8693 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
8694 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 8695 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
8696 where argument type is known to be a Lisp_Cons.
8697
3a4c8000
TT
86982012-07-10 Tom Tromey <tromey@redhat.com>
8699
8700 * bytecode.c (BYTE_CODE_THREADED): New macro.
8701 (BYTE_CODES): New macro. Replaces all old byte-code defines.
8702 (enum byte_code_op): New type.
8703 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
8704 (exec_byte_code): Use them. Use token threading when applicable.
8705
2a0213a6
DA
87062012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8707
8708 Optimize pure C strings initialization.
8709 * lisp.h (make_pure_string): Fix prototype.
8710 (build_pure_c_string): New function, defined as static inline. This
8711 provides a better opportunity to optimize away calls to strlen when
8712 the function is called with compile-time constant argument.
8713 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
8714 argument, adjust users accordingly. Use build_pure_c_string where
8715 appropriate.
8716 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
8717 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
8718 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
8719
cb1caeaf
DA
87202012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8721
8722 Avoid calls to strlen in miscellaneous functions.
8723 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
8724 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
8725 * lread.c (openp): Likewise.
8726
c293e30c
DA
87272012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8728
8729 Avoid calls to strlen in path processing functions.
8730 * fileio.c (file_name_as_directory): Add comment. Change to add
8731 srclen argument and return the length of result. Adjust users
8732 accordingly.
8733 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
8734 swap 1st and 2nd arguments to obey the common convention.
8735 Adjust users accordingly.
c293e30c
DA
8736 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
8737
9e059e3f
GM
87382012-07-10 Glenn Morris <rgm@gnu.org>
8739
d02eb359
GM
8740 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
8741 Move PENDING_OUTPUT_COUNT definition to configure.
8742
882cf227
GM
8743 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
8744 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
8745 * s/gnu.h (DATA_START): Move definitions to configure.
8746
af6e839f
GM
8747 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
8748 We include usg5-4-common.h, which defines them both.
8749
40289a12
GM
8750 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
8751 O_RDONLY already includes it).
8752
9e059e3f
GM
8753 Stop ns builds setting the EMACSLOADPATH environment variable.
8754 * nsterm.m (ns_load_path): Rename from ns_init_paths.
8755 Now it does not set EMACSLOADPATH, just returns the load-path string.
8756 * nsterm.h: Update accordingly.
8757 * lread.c [HAVE_NS]: Include nsterm.h.
8758 (init_lread) [HAVE_NS]: Use ns_load_path.
8759 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
8760
7c4e8ec0
GM
87612012-07-09 Glenn Morris <rgm@gnu.org>
8762
d4f600ff
GM
8763 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
8764 since the included bsd-common.h does so.
8765
cbb31951
GM
8766 Stop ns builds setting the EMACSPATH environment variable.
8767 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
8768 (ns_init_paths): Do not set EMACSPATH.
8769 * nsterm.h (ns_exec_path): Add it.
8770 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
8771 Use ns_exec_path.
8772
7c4e8ec0
GM
8773 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
8774
26bccfae
PE
87752012-07-09 Paul Eggert <eggert@cs.ucla.edu>
8776
a0bee46f
PE
8777 * process.c (wait_reading_process_output): 'waitchannels' was unset
8778 when read_kbd || !NILP (wait_for_cell); fix this.
8779
5994c183
PE
8780 Add GCC-style 'const' attribute to functions that can use it.
8781 * character.h (char_resolve_modifier_mask):
8782 * keyboard.h (make_ctrl_char):
8783 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
8784 (init_character_once, next_almost_prime, init_fns, init_image)
8785 (flush_pending_output, init_sound):
8786 * mem-limits.h (start_of_data):
8787 * menu.h (finish_menu_items):
8788 Add ATTRIBUTE_CONST.
8789 * emacs.c (DEFINE_DUMMY_FUNCTION):
8790 Declare the dummy function with ATTRIBUTE_CONST.
8791 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
8792 Add decls with ATTRIBUTE_CONST.
8793
26bccfae
PE
8794 Minor improvements to make_formatted_string.
8795 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
8796 where int is good enough, as vsprintf returns an int.
8797 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
8798
a8290ec3
DA
87992012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8800
8801 Use make_formatted_string to avoid double length calculation.
8802 * lisp.h (make_formatted_string): New prototype.
8803 * alloc.c (make_formatted_string): New function.
8804 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 8805 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
8806 * editfns.c (Fcurrent_time_zone): Likewise.
8807 * filelock.c (get_boot_time): Likewise.
8808 * frame.c (make_terminal_frame, set_term_frame_name)
8809 (x_report_frame_params): Likewise.
8810 * image.c (gs_load): Likewise.
8811 * minibuf.c (get_minibuffer): Likewise.
8812 * msdos.c (dos_set_window_size): Likewise.
8813 * process.c (make_process): Likewise.
8814 * xdisp.c (ensure_echo_area_buffers): Likewise.
8815 * xsettings.c (apply_xft_settings): Likewise.
8816
d01ba2f1
GM
88172012-07-09 Glenn Morris <rgm@gnu.org>
8818
8819 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
8820 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
8821 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
8822 * nsterm.h (ns_etc_directory): Add it.
8823 * callproc.c [HAVE_NS]: Include nsterm.h.
8824 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
8825
f1f924b6
DA
88262012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8827
8828 Move marker debugging code under MARKER_DEBUG.
8829 * marker.c (MARKER_DEBUG): Move marker debugging code under
8830 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
8831 for bootstrap with --enable-checking (~3x slowdown reported
8832 by Juanma Barranquero <lekktu@gmail.com>).
8833 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
8834
ab531b66
PE
88352012-07-08 Paul Eggert <eggert@cs.ucla.edu>
8836
8837 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
8838 See <http://bugs.gnu.org/11825#29>.
8839
c4b3bc8a
EZ
88402012-07-08 Eli Zaretskii <eliz@gnu.org>
8841
8842 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
8843 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
8844 (display_line): Add commentary about displaying truncation glyphs
8845 on GUI frames.
8846 (produce_special_glyphs): Move here from term.c.
8847
8848 * term.c (produce_special_glyphs): Move to xdisp.c.
8849
8850 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
8851 section.
c4b3bc8a 8852
b676b881
AS
88532012-07-07 Andreas Schwab <schwab@linux-m68k.org>
8854
f17c5273
AS
8855 * xdisp.c (display_line): Avoid warning about implicit declaration
8856 of FRAME_FONT.
8857
298819b9
AS
8858 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
8859
b676b881
AS
8860 * lisp.h: Remove empty conditional.
8861
6045c4fd
PE
88622012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8863
b3350bf9
PE
8864 * lread.c (load_path_check): Now static.
8865
6045c4fd
PE
8866 Fix some minor --with-ns problems found by static checking.
8867 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
8868 (x_set_font) [!HAVE_X_WINDOWS]:
8869 * image.c (xpm_load_image) [HAVE_NS]:
8870 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
8871 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
8872 Remove unused local.
8873 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
8874 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
8875 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
8876 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
8877 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
8878 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
8879 Fix pointer signedness problem.
8880 * xfaces.c (FRAME_X_FONT_TABLE):
8881 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
8882
929e7845
GM
88832012-07-07 Glenn Morris <rgm@gnu.org>
8884
8885 * lread.c (load_path_check): New function, split from init_lread.
8886 (init_lread): Reorganize. Motivation:
8887 If EMACSLOADPATH is set, check/warn about that rather than the
8888 defaults, which we are not going to use. Hence we can remove
8889 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
8890 Don't warn if site-lisp directories are missing.
8891 If not installed, start from a blank load-path, since
8892 PATH_LOADSEARCH refers to the eventual installation directories.
8893
58dd0aa4
EZ
88942012-07-07 Eli Zaretskii <eliz@gnu.org>
8895
8896 Support truncation and continuation glyphs on GUI frames, when
8897 fringes are disabled. (Bug#11832)
8898 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
8899 continuation glyphs even if on GUI frames.
8900 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
8901 or both, are absent.
8902 (start_display, move_it_in_display_line_to): Handle the case of a
8903 GUI frame without a fringe to display continuation or truncation
8904 glyphs.
8905 (insert_left_trunc_glyphs): Support GUI frames: make sure
8906 truncation glyphs overwrite enough glyphs from the current line to
8907 have sufficient space in pixels.
8908 (display_line): Support truncation and continuation glyphs on GUI
8909 frames. If some spare pixels are left on the line after inserting
8910 the truncation glyphs, fill that space with a stretch glyph of a
8911 suitably computed width.
8912
8913 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
8914 produce_glyphs, to support GUI sessions.
8915
31571fd7
PE
89162012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8917
5a16b9bc
PE
8918 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
8919
f3047c75
PE
8920 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
8921
31571fd7
PE
8922 Do not require float-time's arg to fit in time_t (Bug#11825).
8923 This works better on hosts where time_t is unsigned, and where
8924 float-time is applied to the (negative) difference between two times.
8925 * editfns.c (decode_time_components): Last arg is now double *,
8926 not int *, and means to store all the result as a double, without
8927 worrying about whether the seconds part fits in time_t.
8928 All callers changed.
8929 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
8930 All callers changed.
8931 (Ffloat_time): Do not fail merely because the specified time falls
8932 outside of time_t range.
8933
4516fbef
GM
89342012-07-07 Glenn Morris <rgm@gnu.org>
8935
8936 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
8937 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
8938 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
8939
07adc2c6
JB
89402012-07-07 Juanma Barranquero <lekktu@gmail.com>
8941
8942 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
8943 Update dependencies.
8944
8945 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
8946
fd573f31
PE
89472012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8948
fee5959d
PE
8949 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
8950 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
8951 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
8952 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
8953 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
8954 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
8955
fd573f31
PE
8956 * xfont.c (compare_font_names): Redo to omit the need for casts.
8957
ddadbc0e
AS
89582012-07-06 Andreas Schwab <schwab@linux-m68k.org>
8959
fca8d6b6
AS
8960 * xfns.c (Fx_change_window_property): Doc fix.
8961 * w32fns.c (Fx_change_window_property): Doc fix.
8962
ddadbc0e
AS
8963 * w32fns.c (Fx_window_property): Accept the same arguments as the
8964 X Windows version. Doc fix.
8965 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
8966
ed9265fc 89672012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
8968 Eli Zaretskii <eliz@gnu.org>
8969
8970 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
8971 Windows-specific code from nt/config.nt moved here.
8972 Obsolete settings removed.
8973
216ee680
PE
89742012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8975
8976 * process.c: Avoid unnecessary calls to gettime.
8977 (wait_reading_process_output): Don't get the time of day
8978 when gobbling data immediately and not waiting, as there's no need
8979 for it in that case. This removes a FIXME.
8980
bdd091e4
JD
89812012-07-06 Jan Djärv <jan.h.d@swipnet.se>
8982
8983 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
8984 is defined (Bug#11768).
8985
9d44f8ce
DA
89862012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8987
8988 Fix marker debugging code.
8989 * marker.c (byte_char_debug_check): Do not perform the check
8990 if buffer is not multibyte.
090bd7cb
JB
8991 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8992 Call byte_char_debug_check with correct arguments.
9d44f8ce 8993
90fc4786
DA
89942012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8995
8996 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
8997 * marker.c (byte_char_debug_check, count_markers):
8998 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
8999 (byte_debug_flag): Remove.
9000 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9001 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9002
7b7ae965
DA
90032012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9004
4e57b342
DA
9005 Avoid code repetition in marker-related functions.
9006 * marker.c (attach_marker): New function.
9007 (Fset_marker, set_marker_restricted, set_marker_both)
9008 (set_marker_restricted_both): Use it.
9009 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9010 Consistently rename charno to charpos.
9011 (marker_position): Add eassert.
9012 (marker_byte_position): Convert to eassert.
9013
90142012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9015
9016 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 9017 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 9018 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 9019
657924ff
DA
90202012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9021
9022 Introduce fast path for the widely used marker operation.
9023 * alloc.c (build_marker): New function.
9024 * lisp.h (build_marker): New prototype.
9025 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
9026 * composite.c (autocmp_chars): Likewise.
9027 * editfns.c (buildmark): Remove.
9028 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
9029 (save_restriction_save): Use build_marker.
9030 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
9031 * window.c (save_window_save): Likewise.
9032
041a49a6
DA
90332012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9034
9035 Do not use Fdelete_overlay in delete_all_overlays
9036 to avoid redundant calls to unchain_overlay.
9037 * buffer.c (drop_overlay): New function.
9038 (delete_all_overlays, Fdelete_overlay): Use it.
9039 * minibuf.c (get_minibuffer): Fix comment.
9040
7dca65a4
PE
90412012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9042
9043 Port to OpenBSD 5.1 amd64.
9044 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
9045 This is needed for OpenBSD, and should be harmless on all BSD systems.
9046 Also, include <sys/sysctl.h>, as it should be available on all
9047 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
9048 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9049 use p_pid member, not kp_proc.pid.
9050
8eb876e2
GM
90512012-07-06 Glenn Morris <rgm@gnu.org>
9052
9053 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
9054
38182d90
PE
90552012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9056
9057 More xmalloc and related cleanup.
9058 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
9059 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
9060 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
9061 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
9062 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
9063 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
9064 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
9065 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
9066 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
9067 * xterm.c:
9068 Omit needless casts involving void * pointers and allocation.
9069 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
9070 as the former is more robust if P's type is changed.
9071 Prefer xzalloc to xmalloc + memset 0.
9072 Simplify malloc-or-realloc to realloc.
9073 Don't worry about xmalloc returning a null pointer.
9074 Prefer xstrdup to xmalloc + strcpy.
9075 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
9076 growing it.
9077 * keyboard.c (apply_modifiers_uncached): Prefer local array to
9078 alloca of a constant.
9079
6dd5a677
EZ
90802012-07-05 Eli Zaretskii <eliz@gnu.org>
9081
9082 * xdisp.c (display_line): Fix horizontal pixel coordinates when
9083 hscroll is larger than the line width. Fixes long and futile
9084 looping inside extend_face_to_end_of_line (on a TTY) producing
9085 glyphs that are not needed and thrown away.
9086
6b312f0f
DA
90872012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9088
9089 * marker.c (set_marker_restricted_both): Simplify by using
9090 clip_to_bounds.
9091
f520ef9b
PE
90922012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9093
9094 * editfns.c (region_limit): Simplify by using clip_to_bounds.
9095
383b7c95
JD
90962012-07-05 Jan Djärv <jan.h.d@swipnet.se>
9097
9098 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
9099 not defined (Bug#11768).
9100 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
9101 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
9102 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
9103 followed by gtk_box_set_homogeneous (Bug#11768).
9104 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
9105 (update_theme_scrollbar_width, xg_create_scroll_bar):
9106 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
9107 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
9108 (is_box_type): New function (Bug#11768).
9109 (xg_tool_item_stale_p): Call is_box_type.
5293d758 9110 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
9111 with default display (Bug#11768).
9112
d6e7bf45
EZ
91132012-07-05 Eli Zaretskii <eliz@gnu.org>
9114
9115 * xdisp.c (window_hscroll_limited): New function.
9116 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
9117 coordinates when window's hscroll is set to insanely large
9118 values. (Bug#11857)
9119
431391ec
JB
91202012-07-05 Juanma Barranquero <lekktu@gmail.com>
9121
9122 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
9123 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
9124
23f86fce
DA
91252012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9126
9127 Cleanup xmalloc.
9128 * lisp.h (xzalloc): New prototype. Omit needless casts.
9129 * alloc.c (xzalloc): New function. Omit needless casts.
9130 * charset.c: Omit needless casts. Convert all calls to
9131 xmalloc with following memset to xzalloc.
9132 * dispnew.c: Likewise.
9133 * fringe.c: Likewise.
9134 * image.c: Likewise.
9135 * sound.c: Likewise.
9136 * term.c: Likewise.
9137 * w32fns.c: Likewise.
9138 * w32font.c: Likewise.
9139 * w32term.c: Likewise.
9140 * xfaces.c: Likewise.
9141 * xfns.c: Likewise.
9142 * xterm.c: Likewise.
9143 * atimer.c: Omit needless casts.
9144 * buffer.c: Likewise.
9145 * callproc.c: Likewise.
9146 * ccl.c: Likewise.
9147 * coding.c: Likewise.
9148 * composite.c: Likewise.
9149 * doc.c: Likewise.
9150 * doprnt.c: Likewise.
9151 * editfns.c: Likewise.
9152 * emacs.c: Likewise.
9153 * eval.c: Likewise.
9154 * filelock.c: Likewise.
9155 * fns.c: Likewise.
9156 * gtkutil.c: Likewise.
9157 * keyboard.c: Likewise.
9158 * lisp.h: Likewise.
9159 * lread.c: Likewise.
9160 * minibuf.c: Likewise.
9161 * msdos.c: Likewise.
9162 * print.c: Likewise.
9163 * process.c: Likewise.
9164 * region-cache.c: Likewise.
9165 * search.c: Likewise.
9166 * sysdep.c: Likewise.
9167 * termcap.c: Likewise.
9168 * terminal.c: Likewise.
9169 * tparam.c: Likewise.
9170 * w16select.c: Likewise.
9171 * w32.c: Likewise.
9172 * w32reg.c: Likewise.
9173 * w32select.c: Likewise.
9174 * w32uniscribe.c: Likewise.
9175 * widget.c: Likewise.
9176 * xdisp.c: Likewise.
9177 * xmenu.c: Likewise.
9178 * xrdb.c: Likewise.
9179 * xselect.c: Likewise.
9180
0497dc44
PE
91812012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9182
9183 * fileio.c (time_error_value): Check the right error number.
9184 Problem reported by Troels Nielsen in
9185 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
9186
356e7178
PE
91872012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9188
4e71fd89
PE
9189 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
9190 This should be fixed in a better way; see Eli Zaretskii in
9191 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
9192 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
9193
f0941253
PE
9194 * fileio.c (time_error_value): Rename from special_mtime.
9195 The old name's problems were noted by Eli Zaretskii in
9196 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
9197
065c9eb4
PE
9198 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
9199 This variable's comment says Emacs needs at least one GDB-visible
9200 symbol of type enum pvec_type, to work around GDB problems.
9201 The symbol's value doesn't matter.
9202
356e7178
PE
9203 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
9204 that causes compilation to fail on pre-C99 compilers.
9205
ed9265fc 92062012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
9207
9208 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
9209 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
9210
3884d954
DA
92112012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9212
d209e2fb 9213 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
9214 headers for buffer_defaults and buffer_local_symbols.
9215 Reported by Juanma Barranquero <lekktu@gmail.com>.
9216
ee28be33
SM
92172012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9218
9219 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
9220 * lisp.h (enum pvec_type): Use fewer bits.
9221 (PSEUDOVECTOR_SIZE_BITS): New constant.
9222 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
9223 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
9224 change in pvec_type.
9225 (PSEUDOVECTOR_TYPEP): New macro.
9226 (TYPED_PSEUDOVECTORP): Use it.
9227 * fns.c (internal_equal): Adapt code to extract pvectype.
9228 * emacs.c (gdb_pvec_type): Update type.
9229 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
9230 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
9231 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
9232 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
9233 (sweep_vectors): Use it. Use local var `total_bytes' instead of
9234 abusing vector->header.next.nbytes.
9235 (live_vector_p): Use PVEC_TYPE.
9236 (mark_object): Adapt code to extract pvectype. Use switch.
9237
c7f2cd7f
PE
92382012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9239
9240 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
9241 Tighten new eassert a bit.
9242
8ce70ed2
DA
92432012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9244
9245 Fix compilation with --enable-gcc-warnings and -O1
9246 optimization level.
9247 * doprnt.c (doprnt): Change type of tem to int, initialize
9248 to avoid compiler warning. Add eassert.
9249 * search.c (simple_search): Initialize match_byte to avoid
9250 compiler warning. Add eassert.
9251
dea7f1e5
PE
92522012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9253
24a212eb
PE
9254 Avoid weird behavior with large horizontal scrolls.
9255 Without this change, for example, large hscroll values would
9256 mess up Emacs's display on Fedora 15 x86, presumably due to
9257 overflows in int calculations in the display code.
9258 Also, if buffers had long lines, Emacs would freeze.
9259 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
9260 (set_window_hscroll): New function, containing the old guts of
9261 Fset_window_hscroll. Return the clipped value.
9262 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
9263 This avoids the need to check against PTRDIFF_MAX.
9264
dea7f1e5
PE
9265 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
9266
76046526
DA
92672012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9268
9269 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
9270
39adff0d
PE
92712012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9272
63807d47
PE
9273 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
9274 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
9275 since GCC 4.4.6 issues a bogus warning for them.
9276
39adff0d
PE
9277 Fix bugs in file timestamp newness comparisons.
9278 * fileio.c (Ffile_newer_than_file_p):
9279 * lread.c (Fload): Use full timestamp resolution of files,
9280 not just the 1-second resolution, so that files that are only
9281 slightly newer still count as newer.
9282 * fileio.c (Ffile_newer_than_file_p): Don't assume file
9283 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
9284
dbeed9a6
PE
92852012-07-03 Paul Eggert <eggert@cs.ucla.edu>
9286
9287 * fileio.c: Improve handling of file time marker. (Bug#11852)
9288 (special_mtime): New function.
9289 (Finsert_file_contents, Fverify_visited_file_modtime):
9290 Use it to set special mtime values consistently.
9291
636334d6
AS
92922012-07-03 Andreas Schwab <schwab@linux-m68k.org>
9293
9294 * fileio.c (Finsert_file_contents): Properly handle st_mtime
9295 marker for non-existing file. (Bug#11852)
9296
e2017fe2
GM
92972012-07-03 Glenn Morris <rgm@gnu.org>
9298
9299 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
9300 and did not make it into globals.h).
9301
404dbd37
TT
93022012-07-03 Tom Tromey <tromey@redhat.com>
9303
9304 * window.c (Fset_window_margins, Fset_window_fringes)
9305 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
9306 * textprop.c (Fprevious_property_change): No longer static.
9307 * syntax.c (Fsyntax_table_p): No longer static.
9308 * process.c (Fget_process, Fprocess_datagram_address): No longer
9309 static.
9310 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
9311 * keyboard.c (Fcommand_execute): No longer static.
9312 Remove EXFUN.
9313 * insdel.c (Fcombine_after_change_execute): No longer static.
9314 * image.c (Finit_image_library): No longer static.
9315 * fileio.c (Fmake_symbolic_link): No longer static.
9316 * eval.c (Ffetch_bytecode): No longer static.
9317 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
9318 * doc.c (Fdocumentation_property, Fsnarf_documentation):
9319 No longer static.
404dbd37
TT
9320 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
9321 static.
9322 * dired.c (Ffile_attributes): No longer static.
9323 * composite.c (Fcomposition_get_gstring): No longer static.
9324 * callproc.c (Fgetenv_internal): No longer static.
9325
9326 * ccl.h: Remove EXFUNs.
9327 * buffer.h: Remove EXFUNs.
9328 * dispextern.h: Remove EXFUNs.
9329 * intervals.h: Remove EXFUNs.
9330 * fontset.h: Remove EXFUN.
9331 * font.h: Remove EXFUNs.
9332 * dosfns.c (system_process_attributes): Remove EXFUN.
9333 * keymap.h: Remove EXFUNs.
9334 * lisp.h: Remove EXFUNs.
9335 * w32term.h: Remove EXFUNs.
9336 * window.h: Remove EXFUNs.
9337 * xsettings.h: Remove EXFUN.
9338 * xterm.h: Remove EXFUN.
9339
8e4fd1e1
GM
93402012-07-03 Glenn Morris <rgm@gnu.org>
9341
9342 * lisp.h (Frandom): Make it visible to C.
9343 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
9344 buffer for invisible buffers. (Bug#1229)
9345
ca95b3eb
DA
93462012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9347
9348 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
9349 values which aren't power of 2.
14ae4239 9350 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 9351 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
9352 accordingly.
9353
7555c33f
SM
93542012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
9355
9356 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
9357
9358 * alloc.c (mark_object): Revert part of last patch to use `switch'.
9359
d12e8f5a
DA
93602012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9361
9362 * alloc.c (allocate_vector_block): Remove redundant
9363 calls to mallopt if DOUG_LEA_MALLOC is defined.
9364 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
9365 avoid calls to mallopt if zero_vector is returned.
9366
296094c3
DA
93672012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9368
9369 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
9370 is enabled, avoid dereferencing NULL current_sblock if
9371 running undumped.
9372
36429c89
DA
93732012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9374
9375 Cleanup basic buffer management.
9376 * buffer.h (struct buffer): Change layout to use generic vector
9377 marking code. Fix some comments. Change type of 'clip_changed'
9378 to bitfield. Remove unused #ifndef old.
9379 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
9380 (GET_OVERLAYS_AT): Fix indentation.
9381 (for_each_per_buffer_object_at): New macro.
9382 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
9383 (Fbuffer_local_variables): Use it.
9384 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
9385 * alloc.c (allocate_buffer): Adjust to match new layout of
9386 struct buffer. Fix comment.
9387 (mark_overlay): New function.
9388 (mark_buffer): Use it. Use mark_vectorlike to mark normal
9389 Lisp area of struct buffer.
9390 (mark_object): Use it. Adjust marking of misc objects
9391 and related comments.
9392
3b3e4cac
PE
93932012-07-02 Paul Eggert <eggert@cs.ucla.edu>
9394
9395 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
9396 wrapper that is not needed because the wrapped code is a no-op (zero
9397 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
9398 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
9399
cf5c0175
DA
94002012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
9401
9402 * alloc.c (mark_buffer): Simplify. Remove prototype.
9403 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 9404 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
9405 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
9406 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 9407
ca26824c
GM
94082012-06-30 Glenn Morris <rgm@gnu.org>
9409
2e4c5312
GM
9410 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
9411
ca26824c
GM
9412 * epaths.in (PATH_SITELOADSEARCH): New.
9413 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
9414 This is rather than relying on --enable-locallisppath elements
9415 having "site-lisp" in their names. (Bug#10208#25, 11658)
9416
0d23c240
EZ
94172012-06-30 Eli Zaretskii <eliz@gnu.org>
9418
c9240d7a
EZ
9419 * w32proc.c (sys_select): Accept and ignore one more argument.
9420
9421 * w32.c (emacs_gnutls_pull): Call select with one more argument.
9422
0d23c240 9423 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 9424 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
9425
9426 * sysdep.c: Don't include dos.h and dosfns.h.
9427
9428 * process.c (sys_select):
9429 * msdos.c (sys_select): Accept one more argument and ignore it.
9430
9431 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
9432 adapt data types and code to that.
9433
9434 * dosfns.c:
9435 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
9436 which clashes with the gnulib function of the same name.
9437
af5a5a98
AS
94382012-06-30 Andreas Schwab <schwab@linux-m68k.org>
9439
c5e4379c
AS
9440 * font.c (font_style_to_value, font_style_symbolic)
9441 (font_prop_validate_style): Add type checks for values in
9442 font_style_table.
9443
af5a5a98
AS
9444 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
9445 argument.
9446 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
9447 uses.
9448
8d38f461
EZ
94492012-06-29 Eli Zaretskii <eliz@gnu.org>
9450
2e5a6631
EZ
9451 * xdisp.c (try_window_id): Undo last change.
9452
8d38f461
EZ
9453 * w32.c (getwd): Adjust commentary about startup_dir.
9454 (init_environment): Always call sys_access, even in non-MSVC
9455 builds. Don't chdir to the directory of the Emacs executable.
9456 This undoes code from 1997 which was justified by the need to
9457 "avoid conflicts when removing and renaming directories". But its
9458 downside was that every relative file name was being interpreted
9459 relative to the directory of the Emacs executable, which can never
9460 be TRT. In particular, it broke sys_access when called with
9461 relative file names.
9462 (sys_access): Map GetLastError to errno.
9463
2af3565e
DA
94642012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9465
9466 * window.h (struct window): Change type of 'fringes_outside_margins'
9467 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 9468 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
9469 Adjust comment.
9470 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
9471 to ptrdiff_t.
9472
c8d3a25c 94732012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 9474
c8d3a25c
GM
9475 * gnutls.c (emacs_gnutls_handshake):
9476 Add QUIT to make the loop interruptible.
57570cd3 9477
c8d3a25c 94782012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 9479
c8d3a25c
GM
9480 * charset.c (init_charset): Make lack of etc/charsets fatal.
9481
3e984ee8
DA
94822012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9483
9484 * editfns.c (region_limit): Fix type mismatch.
9485
ef884f23
DA
94862012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9487
9488 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
9489 undefined. Convert from xassert to eassert.
9490 * nsmenu.m: Convert from xassert to eassert.
9491 * nsterm.m: Likewise.
9492
7d7e0027
SM
94932012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
9494
9495 * editfns.c (region_limit): Clip to narrowing (bug#11770).
9496
aa754e6a
PE
94972012-06-28 Paul Eggert <eggert@cs.ucla.edu>
9498
9499 Avoid integer overflow on scroll-left and scroll-right.
9500 * window.c (HSCROLL_MAX): New macro.
9501 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
9502 overflow when requested scroll falls outside ptrdiff_t range.
9503
80b00b08
DA
95042012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9505
9506 * window.h (struct window): Change type of 'hscroll',
9507 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
9508 'last_modified' and 'last_overlay_modified' to EMACS_INT.
9509 Adjust users accordingly.
9510 * xdisp.c (try_cursor_movement): Replace type check with eassert.
9511 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
9512 from EMACS_INT to ptrdiff_t.
9513 (make_window): Omit redundant initialization.
9514
62b2bcf6
JB
95152012-06-28 Juanma Barranquero <lekktu@gmail.com>
9516
9517 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
9518
45942c7d
DA
95192012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9520
9521 * window.h (struct window): Change type of 'use_time' and
9522 'sequence_number' from Lisp_Object to int.
9523 * frame.c (make_frame): Adjust users accordingly.
9524 * print.c (print_object): Likewise.
9525 * window.c (select_window, Fwindow_use_time, make_parent_window)
9526 (make_window): Likewise.
9527
e509cfa6
DA
95282012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9529
9530 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
9531 enabled with --enable-checking=[all,glyphs] configure option.
9532 Fix GLYPH_DEBUG usage assuming that it may be undefined,
9533 adjust comments accordingly.
9534 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
9535 undefined, adjust comments accordingly.
9536 * image.c: Likewise.
9537 * scroll.c: Likewise.
9538 * w32fns.c: Likewise.
9539 * w32term.c: Likewise.
9540 * xdisp.c: Likewise.
9541 * xfaces.c: Likewise.
9542 * xfns.c: Likewise.
9543 * xterm.c: Likewise.
9544
a54e2c05
DA
95452012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9546
9547 Generalize run-time debugging checks.
9548 * dispextern.h (XASSERTS): Remove.
9549 * fontset.c (xassert): Remove.
9550 Convert from xassert to eassert.
9551 * alloc.c: Convert from xassert to eassert.
9552 * bidi.c: Likewise.
9553 * dispnew.c: Likewise.
9554 * fns.c: Likewise.
9555 * fringe.c: Likewise.
9556 * ftfont.c: Likewise.
9557 * gtkutil.c: Likewise.
9558 * image.c: Likewise.
9559 * keyboard.c: Likewise.
9560 * menu.c: Likewise.
9561 * process.c: Likewise.
9562 * scroll.c: Likewise.
9563 * sound.c: Likewise.
9564 * term.c: Likewise.
9565 * w32console.c: Likewise.
9566 * w32fns.c: Likewise.
9567 * w32term.c: Likewise.
9568 * window.c: Likewise.
9569 * xdisp.c: Likewise.
9570 * xfaces.c: Likewise.
9571 * xfns.c: Likewise.
9572 * xselect.c: Likewise.
9573 * xterm.c: Likewise.
9574
1ec4b7b2
SM
95752012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
9576
9577 * fns.c (maybe_resize_hash_table): Output message when growing the
9578 purify-hashtable.
9579
2014308a
DA
95802012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9581
9582 * alloc.c (allocate_string_data): Remove dead code.
9583 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
9584 avoid GCC warning about unused macro.
9585
246155eb
DA
95862012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9587
9588 * alloc.c (allocate_string): Omit intervals initialization.
9589 * alloc.c (make_uninit_multibyte_string): Initialize intervals
9590 as in make_pure_string and make_pure_c_string.
9591
43184b7b
DA
95922012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9593
d209e2fb 9594 * alloc.c (allocate_string): Fix last change.
43184b7b 9595
3fe6dd74
DA
95962012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9597
d209e2fb 9598 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
9599 to memset, add explicit initialization where appropriate.
9600
1ba6038a
GM
96012012-06-27 Glenn Morris <rgm@gnu.org>
9602
9603 * lisp.mk (lisp): Remove paths.elc.
9604
c89926a5
CY
96052012-06-27 Chong Yidong <cyd@gnu.org>
9606
9607 * doc.c (Fsubstitute_command_keys): Fix punctuation.
9608
ed6b3510
JW
96092012-06-26 John Wiegley <johnw@newartisans.com>
9610
1ec4b7b2 9611 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
9612 on Mac OS X Lion: __mod_init_func and __mod_term_func.
9613
ed6b3510
JW
9614 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
9615 when building with Clang.
9616
8edd4a2b
SM
96172012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
9618
9619 * eval.c (Fapply): Allow calling it with a single argument.
9620
f6f62d1b
EZ
96212012-06-26 Eli Zaretskii <eliz@gnu.org>
9622
9623 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
9624 _stricmp and _strnicmp.
9625 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
9626
62efea5e
DA
96272012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9628
9629 * alloc.c (allocate_window): Zero out non-Lisp part of newly
9630 allocated window.
9631 (allocate_process): Likewise for new process.
8edd4a2b 9632 (allocate_terminal): Change to use offsetof.
62efea5e
DA
9633 (allocate_frame): Likewise.
9634 * frame.c (make_frame): Omit redundant initialization.
9635 * window.c (make_parent_window): Use memset.
9636 (make_window): Omit redundant initialization.
9637 * process.c (make_process): Omit redundant initialization.
9638 * terminal.c (create_terminal): Likewise.
9639
42997f4d
DA
96402012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9641
9642 * term.c (delete_tty): Remove redundant call to memset.
9643
1130ecfc
DA
96442012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9645
9646 * alloc.c: Remove build_string.
9647 * lisp.h: Define build_string as static inline. This provides
9648 a better opportunity to optimize away calls to strlen when the
9649 function is called with compile-time constant argument.
9650 * image.c (imagemagick_error): Convert to build_string.
9651 * w32proc.c (sys_spawnve): Likewise.
9652 * xterm.c (x_term_init): Likewise.
9653
cf38a720
PE
96542012-06-26 Paul Eggert <eggert@cs.ucla.edu>
9655
99027bdd
PE
9656 Use sprintf return value instead of invoking strlen on result.
9657 In the old days this wasn't portable, since some sprintf
9658 implementations returned char *. But they died out years ago and
9659 Emacs already assumes sprintf returns int.
9660 Similarly for float_to_string.
9661 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
9662 * ccl.c (ccl_driver):
9663 * character.c (string_escape_byte8):
9664 * data.c (Fnumber_to_string):
9665 * doprnt.c (doprnt):
9666 * print.c (print_object):
9667 * xdisp.c (message_dolog):
9668 * xfns.c (syms_of_xfns):
9669 Use sprintf or float_to_string result to avoid need to call strlen.
9670 * data.c (Fnumber_to_string):
9671 Use make_unibyte_string, since the string must be ASCII.
9672 * lisp.h, print.c (float_to_string): Now returns int length.
9673 * term.c (produce_glyphless_glyph):
9674 Use sprintf result rather than recomputing it.
9675
cf38a720
PE
9676 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
9677 * Makefile.in (ALL_CFLAGS):
9678 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
9679 * gmalloc.c, regex.c: Include <config.h> unconditionally.
9680
3511c784
DA
96812012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9682
0a08eb21 9683 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
9684 strcasecmp if available.
9685 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
9686
fb7da12e
AS
96872012-06-25 Andreas Schwab <schwab@linux-m68k.org>
9688
9689 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
9690 Avoid comma operator.
9691 * menu.c (push_submenu_start, push_submenu_end)
9692 (push_left_right_boundary, push_menu_pane): Likewise.
9693 * msdos.c (dos_rawgetc): Likewise.
9694
afa2ffd8
DA
96952012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9696
9697 * xfns.c (xic_create_fontsetname): Remove redundant calls
9698 to memset.
9699
b3b4476b
PE
97002012-06-25 Paul Eggert <eggert@cs.ucla.edu>
9701
4495ff38
PE
9702 * gtkutil.c (get_utf8_string): Remove redundant assignment.
9703 sprintf already null-terminates its output.
9704
b3b4476b
PE
9705 * xfns.c (x_window): Remove redundant cast.
9706
b00876c9
DA
97072012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9708
9709 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
9710 `const char *' to `char *' to avoid compiler warning.
9711
d188e26b
PE
97122012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9713
885d1d74
PE
9714 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
9715 instead of truncating it to 63 (admittedly a generous limit).
9716
d188e26b
PE
9717 * process.c: Fix spelling and caps in comments.
9718
e2f560b1
DN
97192012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
9720
e86db54b 9721 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
9722 * sysdep.c (setpgrp): Remove definition, not used in this file.
9723
7583a3a1
JB
97242012-06-24 Juanma Barranquero <lekktu@gmail.com>
9725
9726 * makefile.w32-in: Update dependencies.
9727
696056c2
EZ
97282012-06-24 Eli Zaretskii <eliz@gnu.org>
9729
9730 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
9731 (SYSTIME_H): Add nt/inc/sys/time.h.
9732
9733 * systime.h [WINDOWSNT]: Include sys/time.h.
9734
9735 * s/ms-w32.h (struct timespec): Definition moved from
9736 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
9737
845ca893
PE
97382012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9739
9740 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
9741 * buffer.h (buffer_slot_type_mismatch):
9742 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9743 * eval.c (unwind_to_catch):
9744 * image.c (my_png_error, my_error_exit):
9745 * keyboard.c (quit_throw_to_read_char, user_error)
9746 (Fexit_recursive_edit, Fabort_recursive_edit):
9747 * lisp.h (die, args_out_of_range, args_out_of_range_3)
9748 (wrong_type_argument, buffer_overflow, __executable_start)
9749 (memory_full, buffer_memory_full, string_overflow, Fthrow)
9750 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
9751 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
9752 (fatal):
9753 (child_setup) [!DOS_NT]:
9754 * lread.c (end_of_file_error, invalid_syntax):
9755 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9756 * puresize.h (pure_write_error):
9757 * search.c (matcher_overflow):
9758 * sound.c (sound_perror, alsa_sound_perror):
9759 * sysdep.c, syssignal.h (croak):
9760 * term.c (maybe_fatal, vfatal):
9761 * textprop.c (text_read_only):
9762 * undo.c (user_error):
9763 * unexmacosx.c (unexec_error):
9764 * xterm.c (x_ins_del_lines, x_delete_glyphs):
9765 Use _Noreturn rather than NO_RETURN.
9766 No need for separate decl merely because of _Noreturn.
9767 * sound.c (sound_warning, parse_sound):
9768 Remove unnecessary forward decls.
9769
f1dd8073
PE
97702012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9771
9772 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
9773 * lisp.h (WAIT_READING_MAX): New macro.
9774 * dispnew.c (Fsleep_for, sit_for):
9775 * keyboard.c (kbd_buffer_get_event):
9776 * process.c (Faccept_process_output):
9777 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
9778 This improves on the previous patch, which introduced a bug
9779 when time_t is unsigned and as wide as intmax_t.
9780 See <http://bugs.gnu.org/9000#51>.
9781
b82c1755
EZ
97822012-06-23 Eli Zaretskii <eliz@gnu.org>
9783
9784 * dispnew.c (sit_for, Fsleep_for):
9785 * keyboard.c (kbd_buffer_get_event):
9786 * process.c (Faccept_process_output): Avoid compiler warnings when
9787 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
9788
ca300656
JB
97892012-06-23 Juanma Barranquero <lekktu@gmail.com>
9790
049ec95b
JB
9791 * makefile.w32-in: Update dependencies.
9792
ca300656
JB
9793 * w32.c (ltime): Add return type and declare static.
9794 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
9795
db7b8d06
PE
97962012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9797
9798 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
9799 Privately reported by Herbert J. Skuhra.
9800 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
9801 All uses changed.
9802 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
9803 not make_lisp_timeval, when the argument is of type EMACS_TIME.
9804
0bd8297f
EZ
98052012-06-23 Eli Zaretskii <eliz@gnu.org>
9806
96512555
EZ
9807 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
9808 last argument of make_unibyte_string.
9809
0bd8297f
EZ
9810 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
9811 language ID in the event parameters.
9812
9813 * w32term.c (w32_read_socket): Put the new keyboard codepage into
9814 event.code, not the obscure "character set ID".
9815
63def6b6
CY
98162012-06-23 Chong Yidong <cyd@gnu.org>
9817
9818 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
9819
e8a02204
EZ
98202012-06-23 Eli Zaretskii <eliz@gnu.org>
9821
388cdec0
EZ
9822 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
9823 * w32.c (fdutimens): New function.
9824
9825 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
9826
9827 * s/ms-w32.h (pselect): Redirect to sys_select.
9828
9829 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
9830
e8a02204
EZ
9831 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
9832 in the logic of incrementing and decrementing the value of
9833 use_relocatable_buffers.
9834
d054f3fb
PE
98352012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9836
9837 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
9838 Privately reported by Herbert J. Skuhra.
9839 [__FreeBSD__]: Remove "*/" typo after "#include".
9840 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
9841 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
9842 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
9843 Don't assume EMACS_TIME and struct timeval are the same type.
9844
d35af63c
PE
98452012-06-22 Paul Eggert <eggert@cs.ucla.edu>
9846
9847 Support higher-resolution time stamps (Bug#9000).
9848 The time stamps are only nanosecond-resolution at the C level,
9849 since that's the best that any real-world system supports now.
9850 But they are picosecond-resolution at the Lisp level, as that's
9851 easy, and leaves room for future OS improvements.
9852
9853 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
9854 (LIBES): Use it.
9855
9856 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
9857 Don't get current time unless it's needed.
9858
9859 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
9860 now provides it if it's absent.
9861 (start_atimer): Port to higher-res time stamps.
9862 Check for time stamp overflow. Don't get current time more
9863 often than is needed.
9864
9865 * buffer.h (struct buffer): Buffer modtime now has high resolution.
9866 Include systime.h, not time.h.
9867 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
9868
9869 * dired.c: Include stat-time.h.
9870 (Ffile-attributes): File times now have higher resolution.
9871
9872 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
9873 (struct image): Timestamp now has higher resolution.
9874
9875 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
9876 has at least microseconds now. All uses removed.
9877 (update_frame, update_single_window, update_window, update_frame_1)
9878 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 9879 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
9880
9881 * editfns.c (time_overflow): Now extern.
9882 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
9883 (float-time, Fformat_time_string, Fcurrent_time_string)
9884 (Fcurrent_time_zone): Accept and generate higher-resolution
9885 time stamps.
9886 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
9887 (decode_time_components, lisp_seconds_argument): New functions.
9888 (make_time): Now static.
9889 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
9890 Report an error if the time is invalid, rather than having the caller
9891 do that.
9892
9893 * fileio.c: Include <stat-time.h>
9894 (Fcopy_file): Copy higher-resolution time stamps.
9895 Prefer to set the time stamp via a file descriptor if that works.
9896 (Fset_file_times, Finsert_file_contents, Fwrite_region)
9897 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
9898 (Fvisited_file_modtime, Fset_visited_file_modtime):
9899 Support higher-resolution time stamps.
9900
9901 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
9902
9903 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
9904
9905 * image.c (prepare_image_for_display, clear_image_cache)
9906 (lookup_image): Port to higer-resolution time stamps.
9907
9908 * keyboard.c (start_polling, bind_polling_period):
9909 Check for time stamp overflow.
9910 (read_char, kbd_buffer_get_event, timer_start_idle)
9911 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
9912 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
9913 Port to higher-resolution time stamps. Do not assume time_t is signed.
9914 (decode_timer): New function. Timers are now vectors of length 9,
9915 not 8, to accommodate the picosecond component.
9916 (timer_check_2): Use it.
9917
9918 * nsterm.m (select_timeout, timeval_subtract): Remove.
9919 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
9920 as they're a bit more accurate and handle overflow better.
9921 (ns_select): Change prototype to be compatible with pselect.
9922 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
9923 * nsterm.h (ns_select): Adjust prototype.
9924
9925 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
9926 us-resolution time stamps.
9927 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
9928
9929 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
9930
9931 * lisp.h (time_overflow): New decl.
9932 (wait_reading_process_output): First arg is now intmax_t, not int,
9933 to accommodate larger waits.
9934
9935 * process.h (struct Lisp_Process.read_output_delay):
9936 Now counts nanoseconds, not microseconds.
9937 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
9938 EMACS_HAS_USECS.
9939 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
9940 (wait_reading_process_output):
9941 Port to ns-resolution time stamps.
9942 (Faccept_process_output, wait_reading_process_output):
9943 Check for time stamp overflow. Do not assume time_t is signed.
9944 (select_wrapper): Remove; we now use pselect.
9945 (Fprocess_attributes): Now generates ns-resolution time stamps.
9946
9947 * sysdep.c: Include utimens.h. Don't include utime.h
9948 or worry about struct utimbuf; gnulib does that for us now.
9949 (gettimeofday): Remove; gnulib provides a substitute.
9950 (make_timeval): New function.
9951 (set_file_times): Now sets ns-resolution time stamps.
9952 New arg FD; all uses changed.
9953 (time_from_jiffies, ltime_from_jiffies, get_up_time)
9954 (system_process_attributes):
9955 Now returns ns-resolution time stamp. All uses changed.
9956 Check for time stamp overflow.
9957
9958 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
9959 provides a substitute now.
9960
9961 * systime.h: Include timespec.h rather than sys/time.h and time.h,
9962 since it guarantees struct timespec.
9963 (EMACS_TIME): Now struct timespec, so that we can support
9964 ns-resolution time stamps.
9965 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
9966 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
9967 (EMACS_USECS): Remove.
9968 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
9969 so multiply the arg by 1000 before storing it.
9970 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
9971 New macros.
9972 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
9973 Port to ns-resolution time stamps.
9974 (EMACS_TIME_NEG_P): Remove; replaced by....
9975 (EMACS_TIME_SIGN): New macro.
9976 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
9977 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
9978 (set_file_times, make_time, lisp_time_argument): Adjust signature.
9979 (make_timeval, make_lisp_time, decode_time_components): New decls.
9980 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
9981 that it mishandled time_t overflow. You can't compare by subtracting!
9982 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
9983 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
9984
9985 * term.c: Include <sys/time.h>.
9986 (timeval_to_Time): New function, for proper overflow wraparound.
9987 (term_mouse_position, term_mouse_click): Use it.
9988
9989 * undo.c (record_first_change): Support higher-resolution time stamps
9990 in the undo buffer.
9991 (Fprimitive_undo): Use them when restoring time stamps.
9992
9993 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
9994 (w32_get_internal_run_time):
9995 Port to higher-resolution Emacs time stamps.
9996 (ltime): Now accepts single 64-bit integer, as that's more convenient
9997 for callers.
9998
9999 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10000
10001 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10002 for compatibility with pselect. Support ns-resolution time stamps.
10003
10004 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10005
10006 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10007 Check for time stamp overflow, and support ns-resolution time stamps.
10008
10009 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10010 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
10011 (timeval_subtract): Remove; no longer needed.
10012 (XTflash, XTring_bell, x_wait_for_event):
10013 Port to ns-resolution time stamps. Don't assume time_t is signed.
10014
b6a92dfe
CY
100152012-06-22 Chong Yidong <cyd@gnu.org>
10016
10017 * xdisp.c (x_consider_frame_title): Revert last change.
10018
d251c37c
EZ
100192012-06-22 Eli Zaretskii <eliz@gnu.org>
10020
10021 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
10022 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
10023 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
10024 staticidx goes up to 1597 out of 1600 = 0x640.)
10025
f10deafb
PE
100262012-06-20 Paul Eggert <eggert@cs.ucla.edu>
10027
10028 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
10029 Otherwise, the umask might be mistakenly 0 while handling input signals.
10030
ec6de1e2
SM
100312012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
10032
10033 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
10034
28be1ada
DA
100352012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
10036
10037 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
10038 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
10039 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
10040 access to `contents' member of Lisp_Vector objects with AREF and ASET
10041 where appropriate.
10042
c6bf3022
CY
100432012-06-19 Chong Yidong <cyd@gnu.org>
10044
10045 * frame.c (delete_frame): When selecting a frame on a different
10046 text terminal, do not alter the terminal's top-frame.
10047
10048 * xdisp.c (format_mode_line_unwind_data): Record the target
10049 frame's selected window and its terminal's top-frame.
10050 (unwind_format_mode_line): Restore them.
10051 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
10052 Callers changed.
10053 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
10054 since tty frames can be explicitly named.
10055 (prepare_menu_bars): Likewise.
10056
10057 * term.c (Ftty_top_frame): New function.
10058
defd4196
PE
100592012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10060
10061 Port byte-code-meter to modern targets.
10062 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
10063 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 10064 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
10065 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
10066 (METER_1, METER_2): Simplify.
10067
1053a871
SM
100682012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
10069
10070 * data.c (Fdefalias): Return `symbol' (bug#11686).
10071
b7e8d081
MR
100722012-06-18 Martin Rudalics <rudalics@gmx.at>
10073
10074 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
10075 gets killed during executing of this function (Bug#11665).
10076 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
10077 (Vkill_buffer_query_functions): In doc-string say that functions
10078 run by this hook should not change the current buffer.
10079
7ea2b339
PE
100802012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10081
10082 Fix recently-introduced process.c problems found by static checking.
10083 * process.c (write_queue_push, write_queue_pop, send_process):
10084 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
10085 (write_queue_pop): Fix pointer signedness problem.
10086 (send_process): Remove unused local.
10087
96a313a1
CY
100882012-06-17 Chong Yidong <cyd@gnu.org>
10089
10090 * xdisp.c (redisplay_internal): No need to redisplay terminal
10091 frames that are not on top.
10092
20ca2e94
TN
100932012-06-17 Troels Nielsen <bn.troels@gmail.com>
10094
10095 * process.c (make_process): Initialize write_queue.
10096 (write_queue_push, write_queue_pop): New functions.
10097 (send_process): Use them to maintain correct ordering of process
10098 writes (Bug#10815).
10099
9a900ca9
PE
101002012-06-17 Paul Eggert <eggert@cs.ucla.edu>
10101
310fbfa8
PE
10102 * lisp.h (eassert): Assume C89 or later.
10103 This removes the need for CHECK.
10104 (CHECK): Remove. Its comments about always evaluating its
10105 argument were confusing, as 'eassert' typically does not evaluate
10106 its argument.
10107
27bb1ca4
PE
10108 * coding.c (produce_chars): Use ptrdiff_t, not int.
10109
9a900ca9
PE
10110 * xterm.c (x_draw_underwave): Check for integer overflow.
10111 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
10112
41b7f8bc 101132012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
10114
10115 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
10116 referenced (Bug#11583).
10117
9b0e3eba
AA
101182012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
10119
10120 Implement wave-style variant of underlining.
10121 * dispextern.h (face_underline_type): New enum.
10122 (face): Add field for underline type.
10123 * nsterm.m (ns_draw_underwave): New function.
10124 (ns_draw_text_decoration): Use it.
10125 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
10126 New functions.
10127 (x_draw_glyph_string): Use them.
10128 * xfaces.c (Qline, Qwave): New Lisp objects.
10129 (check_lface_attrs, merge_face_ref)
1053a871
SM
10130 (Finternal_set_lisp_face_attribute, realize_x_face):
10131 Handle wave-style underline face attributes.
9b0e3eba
AA
10132 * xterm.c (x_draw_underwave): New function.
10133 (x_draw_glyph_string): Use it.
10134
0fb52f11
JB
101352012-06-16 Juanma Barranquero <lekktu@gmail.com>
10136
10137 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
10138 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
10139 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
10140 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
10141 ($(BLD)/w32select.$(O)): Update dependencies.
10142
e5560ff7
AS
101432012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10144
10145 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
10146 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
10147 * character.c (_fetch_multibyte_char_p): Remove.
10148 * alloc.c: Include "character.h" before "buffer.h".
10149 * bidi.c: Likewise.
10150 * buffer.c: Likewise.
10151 * bytecode.c: Likewise.
10152 * callint.c: Likewise.
10153 * callproc.c: Likewise.
10154 * casefiddle.c: Likewise.
10155 * casetab.c: Likewise.
10156 * category.c: Likewise.
10157 * cmds.c: Likewise.
10158 * coding.c: Likewise.
10159 * composite.c: Likewise.
10160 * dired.c: Likewise.
10161 * dispnew.c: Likewise.
10162 * doc.c: Likewise.
10163 * dosfns.c: Likewise.
10164 * editfns.c: Likewise.
10165 * emacs.c: Likewise.
10166 * fileio.c: Likewise.
10167 * filelock.c: Likewise.
10168 * font.c: Likewise.
10169 * fontset.c: Likewise.
10170 * fringe.c: Likewise.
10171 * indent.c: Likewise.
10172 * insdel.c: Likewise.
10173 * intervals.c: Likewise.
10174 * keyboard.c: Likewise.
10175 * keymap.c: Likewise.
10176 * lread.c: Likewise.
10177 * macros.c: Likewise.
10178 * marker.c: Likewise.
10179 * minibuf.c: Likewise.
10180 * nsfns.m: Likewise.
10181 * nsmenu.m: Likewise.
10182 * print.c: Likewise.
10183 * process.c: Likewise.
10184 * regex.c: Likewise.
10185 * region-cache.c: Likewise.
10186 * search.c: Likewise.
10187 * syntax.c: Likewise.
10188 * term.c: Likewise.
10189 * textprop.c: Likewise.
10190 * undo.c: Likewise.
10191 * unexsol.c: Likewise.
10192 * w16select.c: Likewise.
10193 * w32fns.c: Likewise.
10194 * w32menu.c: Likewise.
10195 * window.c: Likewise.
10196 * xdisp.c: Likewise.
10197 * xfns.c: Likewise.
10198 * xmenu.c: Likewise.
10199 * xml.c: Likewise.
10200 * xselect.c: Likewise.
10201
2f07e6af
EZ
102022012-06-16 Eli Zaretskii <eliz@gnu.org>
10203
1053a871
SM
10204 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
10205 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 10206 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
10207 row.
10208 (handle_face_prop): Use chunk-relative overlay string index when
10209 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
10210 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
10211 the rightmost. (Bug#11720)
2f07e6af 10212
29b83cec
AS
102132012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10214
10215 * category.h (CHAR_HAS_CATEGORY): Define as inline.
10216 (CATEGORY_MEMBER): Enforce 1/0 value.
10217 * category.c (_temp_category_set): Remove.
10218
4c5501e9
EZ
102192012-06-16 Eli Zaretskii <eliz@gnu.org>
10220
10221 * window.c (Fdelete_other_windows_internal)
10222 (Fdelete_window_internal): Don't access frame's mouse highlight
10223 info of the initial frame. (Bug#11677)
10224
2b570124
PE
102252012-06-14 Paul Eggert <eggert@cs.ucla.edu>
10226
e93864f9
PE
10227 * .gdbinit (xgetint): Fix recently-introduced paren typo.
10228 Assume USE_2_TAGS_FOR_INTS.
10229 (xreload): Adjust $tagmask width to match recent lisp.h change.
10230
2b570124
PE
10231 Simplify lisp.h in minor ways that should not affect code.
10232 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
10233 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
10234 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
10235 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
10236 (INTTYPEBITS): New macro, for clarity.
10237 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
10238 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
10239 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
10240 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
10241 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
10242
81755f69
JB
102432012-06-13 Juanma Barranquero <lekktu@gmail.com>
10244
10245 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
10246
16192a57
GM
102472012-06-13 Glenn Morris <rgm@gnu.org>
10248
10249 * s/bsd-common.h (BSD4_3):
10250 * s/usg5-4-common.h (USG5_4): No longer define; unused.
10251
646b5f55
AS
102522012-06-13 Andreas Schwab <schwab@linux-m68k.org>
10253
10254 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
10255 instead of union.
10256 (XLI, XIL): Define.
1053a871
SM
10257 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
10258 Use them.
10259 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 10260 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 10261 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
10262 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
10263 * frame.c (delete_frame): Remove outdated comment.
10264 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
10265 USE_LISP_UNION_TYPE.
10266 (Fw32_unregister_hot_key): Likewise.
10267 (Fw32_toggle_lock_key): Likewise.
10268 * w32menu.c (add_menu_item): Likewise.
10269 (w32_menu_display_help): Use XIL instead of checking
10270 USE_LISP_UNION_TYPE.
10271 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
10272 (init_heap): Likewise.
10273 * w32term.c (w32_read_socket): Update comment.
10274
1d3823c9
GM
102752012-06-13 Glenn Morris <rgm@gnu.org>
10276
c62ff706
GM
10277 * s/usg5-4-common.h, src/s/unixware.h:
10278 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
10279
1d3823c9
GM
10280 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
10281
bfe3e0a2
PE
102822012-06-13 Paul Eggert <eggert@cs.ucla.edu>
10283
10284 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
10285 * alloc.c (make_number) [!defined make_number]:
10286 Remove, as lisp.h always defines this now.
10287 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
10288 (roundup_size): Verify that it is a power of 2.
10289 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
10290 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
10291 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
10292 -DUSE_LSB_TAG=0, to override the automatically-selected default.
10293 USE_LSB_TAG now is always defined to be either 0 or 1.
10294 All uses changed.
10295 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
10296 code works fine either way, and efficiency is not a concern here,
10297 as the union type is for debugging, not for production.
10298 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
10299 Use an inline function on all platforms when using the union type,
10300 since this is simpler and 'static inline' can be used portably
10301 within Emacs now.
10302 (LISP_INITIALLY_ZERO): New macro.
10303 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
10304 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
10305
45fa9c0f
GM
103062012-06-12 Glenn Morris <rgm@gnu.org>
10307
b4492cba
GM
10308 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
10309
10310 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 10311
45fa9c0f
GM
10312 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
10313 Move BROKEN_SIGIO to configure.
10314
10315 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
10316 Move NO_TERMIO to configure.
10317
0e25d334
CY
103182012-06-12 Chong Yidong <cyd@gnu.org>
10319
10320 * image.c (imagemagick_load_image): Use MagickFlattenImage if
10321 MagickMergeImageLayers is undefined. Use pixel pusher loop if
10322 MagickExportImagePixels is undefined.
10323
43682bb6
PE
103242012-06-12 Paul Eggert <eggert@cs.ucla.edu>
10325
10326 * image.c (imagemagick_load_image): Remove unused label.
10327
a9be7d2b
GM
103282012-06-11 Glenn Morris <rgm@gnu.org>
10329
10330 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10331 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
10332 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
10333 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
10334
3017f87f
SM
103352012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
10336
10337 * alloc.c (make_byte_code): New function.
10338 (Fmake_byte_code): Use it. Don't purify here.
10339 * lread.c (read1): Use it as well to avoid extra allocation.
10340
1b9b4cf4
CY
103412012-06-11 Chong Yidong <cyd@gnu.org>
10342
10343 * image.c (imagemagick_load_image): Implement transparency.
10344
95988fcf
AS
103452012-06-10 Andreas Schwab <schwab@linux-m68k.org>
10346
10347 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
10348 account for preceding backslashes. (Bug#11663)
10349
cd4eb164
CY
103502012-06-09 Chong Yidong <cyd@gnu.org>
10351
10352 * term.c: Support italics in capable terminals (Bug#9652).
10353 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
10354 (turn_on_face): Output using TS_enter_italic_mode if available.
10355 Don't handle unused blinking and alt-charset cases.
10356 (turn_off_face): Handle italic case; discard unused tty_blinking_p
10357 and tty_alt_charset_p cases.
10358 (tty_capable_p, init_tty): Support italics.
10359
10360 * termchar.h (struct tty_display_info): Add field for italics.
10361 Remove unused blink field.
10362
10363 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
10364 Handle slant.
10365
10366 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
10367 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
10368 tty_alt_charset_p. Add tty_italic_p.
10369
ff88beb8
MA
103702012-06-09 Michael Albinus <michael.albinus@gmx.de>
10371
10372 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
10373 dbus_type_is_basic if available.
10374 (xd_extract_signed, xd_extract_unsigned): Rename from
10375 extract_signed and extract_unsigned, respectively. Adapt callers.
10376
44286096
CY
103772012-06-09 Chong Yidong <cyd@gnu.org>
10378
1682701f
CY
10379 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
10380
44286096
CY
10381 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
10382 case (Bug#9752).
10383
d86feb17
PE
103842012-06-08 Paul Eggert <eggert@cs.ucla.edu>
10385
10386 * xdisp.c (vmessage): Treat frame message as multibyte.
10387 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
10388 would generate the diagnostic "Making \302\247 buffer-local while
10389 let-bound!".
10390
d5c20fe8
EZ
103912012-06-08 Eli Zaretskii <eliz@gnu.org>
10392
10393 * dispnew.c (showing_window_margins_p): Undo last change, which
10394 was done due to an inadvertent commit.
10395 (adjust_frame_glyphs_for_frame_redisplay): Do call
10396 showing_window_margins_p.
10397
513749ee
SM
103982012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10399
10400 * eval.c (Fmake_var_non_special): New primitive.
10401 (syms_of_eval): Defsubr it.
10402 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
10403
d4a8f5c1
JB
104042012-06-08 Juanma Barranquero <lekktu@gmail.com>
10405
10406 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
10407 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
10408
8bbbc977
EZ
104092012-06-08 Eli Zaretskii <eliz@gnu.org>
10410
10411 * alloc.c (allocate_vectorlike): Fix last change.
10412
f3372c87
DA
104132012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
10414
10415 Block-based vector allocation of small vectors.
10416 * lisp.h (struct vectorlike_header): New field `nbytes',
10417 adjust comment accordingly.
10418 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 10419 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
10420 mark_maybe_pointer, valid_lisp_object_p) accordingly.
10421 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
10422 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
10423 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
10424 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
10425 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
10426 (roundup_size): New constant.
10427 (struct vector_block): New data type.
10428 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 10429 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
10430 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
10431 (sweep_vectors): New functions.
10432 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 10433 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
10434 or equal to VBLOCK_BYTES_MAX.
10435 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
10436 (init_alloc_once): Add call to init_vectors.
10437
4f18a4ed
SM
104382012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10439
10440 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
10441
86f158bc
PE
104422012-06-07 Paul Eggert <eggert@cs.ucla.edu>
10443
10444 * doprnt.c (doprnt): Truncate multibyte char correctly.
10445 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
10446 would mishandle a string argument "Xc" if X was a multibyte
10447 character of length 2: it would truncate after X's first byte
10448 rather than including all of X.
10449
c5cfcbe0
CY
104502012-06-06 Chong Yidong <cyd@gnu.org>
10451
10452 * buffer.c (word_wrap): Doc fix.
10453
c05cf390
PE
104542012-06-04 Paul Eggert <eggert@cs.ucla.edu>
10455
10456 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
10457
0c3461de
GM
104582012-06-03 Glenn Morris <rgm@gnu.org>
10459
10460 * xdisp.c (tool-bar-style): Doc fix.
10461
c71232db
UM
104622012-06-03 Ulrich Müller <ulm@gentoo.org>
10463
10464 * Makefile.in (PAXCTL): Define.
10465 (temacs$(EXEEXT)): Disable memory randomization for the temacs
10466 binary via PaX flags if the paxctl utility is available.
10467 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
10468 Restore PaX flags to their default. (Bug#11398)
10469
383f7350
CY
104702012-06-03 Chong Yidong <cyd@gnu.org>
10471
10472 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
10473 buffer (Bug#11226).
10474
5f2c76c6
CY
104752012-06-03 Chong Yidong <cyd@gnu.org>
10476
10477 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
10478 (note_mode_line_or_margin_highlight): If there is no help echo,
10479 use mode-line-default-help-echo. Handle the case where the mouse
10480 position is past the end of the mode line string.
10481
10482 * buffer.c (buffer_local_value_1): New function, split from
10483 Fbuffer_local_value; can return Qunbound.
10484 (Fbuffer_local_value): Use it.
10485 (Vmode_line_format): Docstring tweaks.
10486
773d47f6
PE
104872012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10488
10489 * sysdep.c (system_process_attributes): Improve comment.
10490
f2d6a3df
SM
104912012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
10492
10493 * keyboard.c: Export real-this-command to Elisp.
10494 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
10495 and DEFVAR it. Update all users.
10496
63810350
PE
104972012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10498
7bd5c1f4
PE
10499 * minibuf.c (Fassoc_string): Remove duplicate declaration.
10500
63810350
PE
10501 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
10502 Convert pctcpu and pctmem to Lisp float properly.
10503 Let the compiler fold better, as 100.0/0x8000 is exact.
10504
a2821611
AS
105052012-06-02 Andreas Schwab <schwab@linux-m68k.org>
10506
10507 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
10508 cons_block.
10509
5fceba1d
PE
105102012-06-01 Paul Eggert <eggert@cs.ucla.edu>
10511
10512 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
10513
c98ff5dd
DA
105142012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
10515
10516 For a 'struct window', replace some Lisp_Object fields to
10517 bitfields where appropriate, remove unused fields.
10518 * window.h (struct window): Remove unused 'last_mark_x' and
10519 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 10520 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
10521 Change type of 'force_start', 'optional_new_start',
10522 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 10523 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 10524
ca34e0be
PE
105252012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10526
10527 Pacify gcc -Wdouble-precision when using Xaw.
10528 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
10529 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
10530 Use 'float' consistently, rather than 'float' in most places
10531 and 'double' in a couple of places.
10532
efc00ab1 105332012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
10534
10535 * xdisp.c (handle_stop): Detect whether we have overlay strings
10536 loaded by testing it->current.overlay_string_index to be
10537 non-negative, instead of checking whether n_overlay_strings is
10538 positive. (Bug#11587)
10539
efc00ab1 105402012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
10541
10542 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
10543
10544 * doc.c (Fsubstitute_command_keys): Doc fix.
10545
efc00ab1 105462012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
10547
10548 * search.c (search_buffer): Remove calls to
10549 r_alloc_inhibit_buffer_relocation, as it is now called by
10550 maybe_unify_char, which was the cause of relocation of buffer text
10551 in bug#11519.
10552
efc00ab1 105532012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
10554
10555 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
10556 for the duration of call to load_charset, to avoid problems with
10557 callers of maybe_unify_char that access buffer text through C
10558 pointers.
10559
10560 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
10561 decrement the inhibition flag, instead of just setting or
10562 resetting it.
10563
ba93a187
PE
105642012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10565
10566 Remove obsolete '#define static' cruft.
10567 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
10568 This #undef was "temporary" in 2000; it is no longer needed
10569 now that '#define static' has gone away.
10570 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
10571 (gray_bitmap_bits): Remove; no longer needed.
10572 All uses replaced with definiens.
10573 * xterm.c: Include "bitmaps/gray.xbm".
10574
9e4bf381
PE
105752012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10576
10577 Clean up __executable_start, monstartup when --enable-profiling.
10578 The following changes affect the code only when profiling.
10579 * dispnew.c (__executable_start): Rename from safe_bcopy.
10580 Define only on platforms that need it.
10581 * emacs.c: Include <sys/gmon.h> when profiling.
10582 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
10583 (__executable_start): Remove decl, since lisp.h does it now.
10584 (safe_bcopy): Remove decl; no longer has that name.
10585 (main): Coalesce #if into single bit of code, for simplicity.
10586 Cast pointers to uintptr_t, since standard libraries want integers
10587 and not pointers.
10588 * lisp.h (__executable_start): New decl.
10589
32d72c2f
GM
105902012-05-31 Glenn Morris <rgm@gnu.org>
10591
10592 * image.c (Fimagemagick_types): Doc fix.
10593
baac5bc7
JM
105942012-05-30 Jim Meyering <meyering@redhat.com>
10595
10596 * callproc.c (Fcall_process_region): Include directory component
10597 in mkstemp error message (Bug#11586).
10598
72cb32cf
PE
105992012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10600
10601 * alloc.c, lisp.h (make_pure_vector): Now static.
10602
61b108cc
SM
106032012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
10604
10605 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
10606 Move to byte-run.el.
10607 (Fautoload): Do the hash-doc more carefully.
10608 * data.c (Fdefalias): Purify definition, except for keymaps.
10609 (Qdefun): Move from eval.c.
10610 * lisp.h (Qdefun): Remove.
10611 * lread.c (read1): Tiny simplification.
10612
471fe23d
TN
106132012-05-29 Troels Nielsen <bn.troels@gmail.com>
10614
934f3f58 10615 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
10616 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
10617 Bug#9642, but explicitly check that the buffer the overlay would
10618 be moved to is live and rearrange lines to make sure that errors
10619 will not put the overlay in an inconsistent state.
10620 (Fdelete_overlay): Cosmetics.
10621
85d0efd1
EZ
106222012-05-28 Eli Zaretskii <eliz@gnu.org>
10623
10624 * w32term.c (my_bring_window_to_top): New function.
10625 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
10626 could be different from the original one.
10627 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
10628 (Bug#11513)
10629
10630 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
10631 by calling BringWindowToTop.
10632
10633 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
10634 (WM_EMACS_END): Increase by one.
10635
da92a98c
PE
106362012-05-28 Paul Eggert <eggert@cs.ucla.edu>
10637
10638 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
10639 This avoids undefined behavior that might cause the eassert
10640 to not catch an out-of-range value.
10641
74d1f848
JB
106422012-05-28 Juanma Barranquero <lekktu@gmail.com>
10643
10644 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
10645 Update dependencies.
10646
9e1a06fc
EZ
106472012-05-27 Eli Zaretskii <eliz@gnu.org>
10648
10649 * bidi.c (bidi_mirror_char): Fix last change.
10650
f3dd7312
AS
106512012-05-27 Andreas Schwab <schwab@linux-m68k.org>
10652
10653 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
10654 when referring to sectname field in printf format.
10655
81899c91
PE
106562012-05-27 Paul Eggert <eggert@cs.ucla.edu>
10657
57b81a9f
PE
10658 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
10659 Only r_alloc_inhibit_buffer_relocation needed to be added;
10660 the others were already declared.
10661
81899c91
PE
10662 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
10663 before checking whether it's out of range. Put the check inside
10664 eassert. See
10665 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
10666
33017faf 106672012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
10668
10669 * callproc.c (Fcall_process): Restore a line that was accidentally
10670 commented out in the 2011-02-13 change (bug#11547).
10671
33017faf 106722012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
10673
10674 * lisp.h [REL_ALLOC]: Add prototypes for external functions
10675 defined on ralloc.c.
10676
10677 * buffer.c [REL_ALLOC]: Remove prototypes of
10678 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
10679 they are now on lisp.h.
10680
10681 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
10682
10683 * search.c (search_buffer): Use it to inhibit relocation of buffer
10684 text while re_search_2 is doing its job, because re_search_2 is
10685 passed C pointers to buffer text. (Bug#11519)
10686
23415acf
EZ
10687 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
10688 Update value to 24.
10689
44e27368
EZ
10690 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
10691 state after an additional call to move_it_in_display_line_to, keep
10692 the values of it->max_ascent and it->max_descent found for the
10693 entire line.
10694 (pos_visible_p): Revert the comparison against bottom_y to what it
10695 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
10696 (Bug#11464)
10697
c1892f11
PE
106982012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10699
10700 Fix coding-related core dumps with gcc -ftrapv.
10701 The code was computing A - B, where A and B are pointers, and B is
10702 random garbage. This can lead to core dumps on platforms that
10703 have special pointer registers, and it also leads to core dumps on
10704 x86-64 when compiled with gcc -ftrapv. The fix is to compute
10705 A - B only when B is initialized properly.
10706 * coding.c (coding_set_source, coding_set_destination): Return void.
10707 (coding_change_source, coding_change_destinations): New functions,
10708 with the old behaviors of coding_set_source and coding_set_destination.
10709 All callers that need an offset changed to use these new functions.
10710
eb7afdad
GM
107112012-05-26 Glenn Morris <rgm@gnu.org>
10712
10713 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
10714
f12fdf02
EZ
107152012-05-26 Eli Zaretskii <eliz@gnu.org>
10716
53a63be6 10717 Extend mouse support on W32 text-mode console.
61b108cc
SM
10718 * xdisp.c (draw_row_with_mouse_face):
10719 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 10720
eb3f6f01 10721 * w32console.c: Include window.h.
61b108cc
SM
10722 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
10723 New functions.
eb3f6f01
EZ
10724 (initialize_w32_display): Initialize mouse-highlight data.
10725
53a63be6
EZ
10726 * w32inevt.c: Include termchar.h and window.h.
10727 (do_mouse_event): Support mouse-autoselect-window. When the mouse
10728 moves, call note_mouse_highlight. If help_echo changed, call
10729 gen_help_event to produce help-echo message in the echo area.
10730 Call clear_mouse_face if mouse_face_hidden is set in the mouse
10731 highlight info.
10732
4cfd81f6
PE
107332012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10734
10735 * lread.c (read1): Simplify slightly to avoid an overflow warning
10736 with GCC 4.7.0 on x86-64.
10737
4446092a
EZ
107382012-05-26 Eli Zaretskii <eliz@gnu.org>
10739
10740 * bidi.c (bidi_mirror_char): Revert last change: an int is
10741 definitely wide enough here.
10742
42b2a986 107432012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 10744
42b2a986 10745 Fix integer width and related bugs (Bug#9874).
eb106a49 10746 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
10747 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
10748 (string_bytes, check_sblock, allocate_string_data):
10749 (compact_small_strings, Fmake_bool_vector, make_string)
10750 (make_unibyte_string, make_multibyte_string)
10751 (make_string_from_bytes, make_specified_string)
10752 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
10753 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
10754 (mark_vectorlike):
10755 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10756 (allocate_pseudovector):
10757 Use int, not EMACS_INT, where int is wide enough.
10758 (inhibit_garbage_collection, Fgarbage_collect):
10759 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10760 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
10761 int might not be wide enough.
10762 (bidi_cache_search, bidi_cache_find, bidi_init_it)
10763 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
10764 (bidi_at_paragraph_end, bidi_find_paragraph_start)
10765 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
10766 (bidi_level_of_next_char, bidi_move_to_visually_next):
10767 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10768 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
10769 (Fkill_buffer, Fset_buffer_major_mode)
10770 (advance_to_char_boundary, Fbuffer_swap_text)
10771 (Fset_buffer_multibyte, overlays_at, overlays_in)
10772 (overlay_touches_p, struct sortvec, record_overlay_string)
10773 (overlay_strings, recenter_overlay_lists)
10774 (adjust_overlays_for_insert, adjust_overlays_for_delete)
10775 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
10776 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
10777 (Foverlay_recenter, last_overlay_modification_hooks_used)
10778 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
10779 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
10780 (validate_region): Omit unnecessary test for b <= e,
10781 since that's guaranteed by the previous test.
d311d28c
PE
10782 (adjust_overlays_for_delete): Avoid pos + length overflow.
10783 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
10784 (report_overlay_modification):
10785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10786 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
10787 Omit pointer cast, which isn't needed anyway, and doesn't work
10788 after the EMACS_INT -> ptrdiff_t change.
02481186 10789 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
10790 * buffer.h: Adjust decls to match defn changes elsewhere.
10791 (struct buffer_text, struct buffer):
10792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10793 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
10794 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
10795 not int, to avoid needless 32-bit limit on 64-bit hosts.
10796 (exec_byte_code): Use tighter memory-full test, one that checks
10797 for alloca overflow. Don't compute the address of the object just
10798 before an array, as that's not portable. Use EMACS_INT, not
10799 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
10800 * callint.c (Fcall_interactively):
10801 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10802 * callproc.c (call_process_kill, Fcall_process):
10803 Don't assume pid_t fits into an Emacs fixnum.
10804 (call_process_cleanup, Fcall_process, child_setup):
10805 Don't assume pid_t fits into int.
10806 (call_process_cleanup, Fcall_process, delete_temp_file)
10807 (Fcall_process_region):
10808 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10809 (Fcall_process): Simplify handling of volatile integers.
10810 Use int, not EMACS_INT, where int will do.
10811 * casefiddle.c (casify_object, casify_region, operate_on_word)
10812 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
10813 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10814 (casify_object): Avoid integer overflow when overallocating buffer.
10815 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 10816 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
10817 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
10818 * category.h (CATEGORYP): Don't assume arg is nonnegative.
10819 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
10820 integers are now checked earlier. All uses replaced with XINT.
10821 (ccl_driver):
10822 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10823 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
10824 (ccl_driver, Fregister_code_conversion_map):
10825 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
10826 (resolve_symbol_ccl_program): Check that vector header is in range.
10827 Always copy the vector, so that we can check its contents reliably
10828 now rather than having to recheck each instruction as it's being
10829 executed. Check that vector words fit in 'int'.
10830 (ccl_get_compiled_code, Fregister_ccl_program)
10831 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
10832 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
10833 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
10834 contents are in range.
10835 (Fccl_execute_on_string): Check that status is in range.
10836 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
10837 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
10838 Accept and return EMACS_INT, not int, because callers can pass values
10839 out of 'int' range.
10840 (c_string_width, strwidth, lisp_string_width, chars_in_text)
10841 (multibyte_chars_in_text, parse_str_as_multibyte)
10842 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
10843 (str_as_unibyte, str_to_unibyte, string_count_byte8)
10844 (string_escape_byte8, Fget_byte):
10845 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 10846 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
10847 avoid mishandling large integers.
10848 * character.h: Adjust decls to match defn changes elsewhere.
10849 * charset.c (load_charset_map_from_file, find_charsets_in_text)
10850 (Ffind_charset_region):
10851 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10852 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
10853 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 10854 Don't assume fixnum fits in int.
d311d28c
PE
10855 (load_charset_map_from_vector, Fmap_charset_chars):
10856 Remove now-unnecessary CHECK_NATNUMs.
10857 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
10858 Don't rely on undefined behavior with signed left shift overflow.
10859 Don't assume unsigned int fits into fixnum, or that fixnum fits
10860 into unsigned int. Don't require max_code to be a valid fixnum;
10861 that's not true for gb10830 4-byte on a 32-bit host. Allow
10862 invalid_code to be a cons, for the same reason. Require code_offset
10863 to be a character. Avoid int overflow if max_char is close
10864 to INT_MAX.
10865 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
10866 this is intended anyway and avoids some undefined behavior.
10867 (load_charset_map): Pass unsigned, not int, as 2nd arg of
10868 INDEX_TO_CODE_POINT, as that's what it expects.
10869 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
10870 * charset.h (DECODE_CHAR): Return int, not unsigned;
10871 this is what was intended anyway, and it avoids undefined behavior.
10872 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
10873 integer-overflow issues.
10874 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
10875 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
10876 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
10877 * chartab.c (Fmake_char_table, Fset_char_table_range)
10878 (uniprop_get_decoder, uniprop_get_encoder):
10879 Don't assume fixnum fits in int.
10880 * cmds.c (move_point): New function, that does the gist of
10881 Fforward_char and Fbackward_char, but does so while checking
10882 for integer overflow more accurately.
c96e5d6a 10883 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
10884 (Fforward_line, Fend_of_line, internal_self_insert)
10885 (internal_self_insert):
10886 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10887 Fix a FIXME, by checking for integer overflow when calculating
10888 target_clm and actual_clm.
10889 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 10890 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
10891 (ASSURE_DESTINATION, coding_alloc_by_realloc)
10892 (coding_alloc_by_making_gap, alloc_destination)
10893 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
10894 (encode_coding_utf_16, detect_coding_emacs_mule)
10895 (decode_coding_emacs_mule, encode_coding_emacs_mule)
10896 (detect_coding_iso_2022, decode_coding_iso_2022)
10897 (encode_invocation_designation, encode_designation_at_bol)
10898 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
10899 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
10900 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
10901 (encode_coding_ccl, encode_coding_raw_text)
10902 (detect_coding_charset, decode_coding_charset)
10903 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
10904 (produce_composition, produce_charset, produce_annotation)
10905 (decode_coding, handle_composition_annotation)
10906 (handle_charset_annotation, consume_chars, decode_coding_gap)
10907 (decode_coding_object, encode_coding_object, detect_coding_system)
10908 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
10909 (code_convert_region, code_convert_string)
8f50130c
PE
10910 (Fdefine_coding_system_internal)
10911 (coding_set_source, coding_set_destination):
d311d28c
PE
10912 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10913 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
10914 (Fdefine_coding_system_internal):
10915 Don't assume fixnums fit in int.
10916 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 10917 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
10918 (Funencodable_char_position, Fcheck_coding_systems_region)
10919 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 10920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 10921 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 10922 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 10923 Don't access memory outside of the args array.
d311d28c 10924 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
10925 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
10926 result of ENCODE_CHAR.
d311d28c
PE
10927 * coding.h: Adjust decls to match defn changes elsewhere.
10928 (struct coding_system):
10929 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10930 * composite.c (get_composition_id, find_composition)
10931 (run_composition_function, update_compositions)
10932 (compose_text, composition_gstring_put_cache)
10933 (composition_gstring_p, composition_gstring_width)
10934 (fill_gstring_header, fill_gstring_body, autocmp_chars)
10935 (composition_compute_stop_pos, composition_reseat_it)
10936 (composition_update_it, struct position_record)
10937 (find_automatic_composition, composition_adjust_point)
10938 (Fcomposition_get_gstring, Ffind_composition_internal):
10939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10940 (update_compositions):
10941 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10942 * composite.h: Adjust decls to match defn changes elsewhere.
10943 (struct composition):
10944 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10945 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
10946 Do not attempt to compute the address of the object just before a
10947 buffer; this is not portable.
10948 (Faref, Faset):
10949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10950 (Faset): Use int, not EMACS_INT, where int is wide enough.
10951 (Fstring_to_number): Don't assume fixnums fit in int.
10952 (Frem): Don't assume arg is nonnegative.
10953 * dbusbind.c (xd_append_arg): Check for integers out of range.
10954 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 10955 (extract_signed, extract_unsigned): New functions.
243e0530
PE
10956 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
10957 (xd_get_connection_references): Return ptrdiff_t, not int.
10958 All uses changed.
10959 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
10960 (xd_read_message_1):
10961 Use int, not unsigned, where the dbus API uses int.
10962 (Fdbus_message_internal): Don't overflow mtype.
10963 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
10964 * dired.c (directory_files_internal, file_name_completion, scmp)
10965 (file_name_completion_stat):
10966 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10967 (file_name_completion): Don't overflow matchcount.
10968 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
10969 * dispextern.h: Adjust decls to match defn changes elsewhere.
10970 (struct text_pos, struct glyph, struct bidi_saved_info)
10971 (struct bidi_string_data, struct bidi_it, struct composition_it)
10972 (struct it):
10973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10974 (struct display_pos, struct composition_it, struct it):
10975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10976 * dispnew.c (increment_matrix_positions)
10977 (increment_row_positions, mode_line_string)
10978 (marginal_area_string):
10979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 10980 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
10981 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10982 (duration_to_sec_usec): New function, to check for overflow better.
10983 (Fsleep_for, sit_for): Use it.
10984 * doc.c (get_doc_string, store_function_docstring):
10985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10986 (get_doc_string, Fsnarf_documentation):
10987 Use int, not EMACS_INT, where int is wide enough.
10988 (get_doc_string):
10989 Use SAFE_ALLOCA, not alloca.
10990 Check for overflow when converting EMACS_INT to off_t.
10991 * doprnt.c (doprnt):
10992 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10993 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
10994 Don't assume uid_t fits into fixnum.
10995 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
10996 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
10997 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
10998 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
10999 (general_insert_function)
11000 (Finsert_char, make_buffer_string, make_buffer_string_both)
11001 (update_buffer_properties, Fbuffer_substring)
11002 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11003 (Fsubst_char_in_region, check_translation)
11004 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11005 (transpose_markers, Ftranspose_regions):
11006 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11007 (clip_to_bounds): Move to lisp.h as an inline function).
11008 (Fconstrain_to_field): Don't assume integers are nonnegative.
11009 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11010 (Fsubst_char_in_region, Fsave_restriction):
11011 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11012 (Femacs_pid): Don't assume pid_t fits into fixnum.
11013 (lo_time): Use int, not EMACS_INT, when int suffices.
11014 (lisp_time_argument): Check for usec out of range.
11015 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
11016 (Fuser_login_name, Fuser_full_name): Signal an error
11017 if a uid argument is out of range, rather than relying on
11018 undefined behavior.
c8d5c857
PE
11019 (Fformat_time_string): Remove now-unnecessary check.
11020 lisp_time_argument checks for out-of-range usec now.
243e0530 11021 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
11022 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
11023 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
11024 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
11025 (init_cmdargs, Fdump_emacs):
11026 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11027 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
11028 the bottom (typically) 32 bits of the fixnum.
11029 * eval.c (specpdl_size, call_debugger):
11030 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11031 (when_entered_debugger, Fbacktrace_debug):
11032 Don't assume fixnum can fit in int.
11033 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
11034 the object just before a buffer; this is not portable.
11035 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
11036 (grow_specpdl, unbind_to):
11037 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11038 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
11039 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 11040 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
11041 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
11042 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
11043 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11044 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
11045 (a_write, e_write):
11046 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11047 (Fcopy_file, non_regular_nbytes, read_non_regular)
11048 (Finsert_file_contents):
11049 Use int, not EMACS_INT, where int is wide enough.
11050 (READ_BUF_SIZE): Verify that it fits in int.
11051 (Finsert_file_contents): Check that counts are in proper range,
11052 rather than assuming fixnums fit into ptrdiff_t etc.
11053 Don't assume fixnums fit into int.
125b3835 11054 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
11055 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
11056 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
11057 (string_char_to_byte, string_byte_to_char)
11058 (string_make_multibyte, string_to_multibyte)
11059 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
11060 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
11061 (substring_both, Fdelete, internal_equal, Ffillarray)
11062 (Fclear_string, mapcar1)
11063 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
11064 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
11065 (larger_vector, make_hash_table, maybe_resize_hash_table)
11066 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
11067 (Fmaphash, secure_hash):
11068 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11069 (concat): Check for string index and length overflow.
11070 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
11071 (Frequire):
11072 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11073 (larger_vector): New API (vec, incr_min, size_max) replaces old
11074 one (vec, new_size, init). This catches size overflow.
11075 INIT was removed because it was always Qnil.
11076 All callers changed.
11077 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
11078 the upper bound on a hash table index size.
11079 (make_hash_table, maybe_resize_hash_table): Use it.
11080 (secure_hash): Computer start_byte and end_byte only after
11081 they're known to be in ptrdiff_t range.
11082 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
11083 (Ffont_get_glyphs, Ffont_at):
11084 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11085 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
11086 (Flist_fonts, Fopen_font):
11087 Don't assume fixnum can fit in int.
11088 (check_gstring): Don't assume index can fit in int.
11089 (font_match_p): Check that fixnum is a character, not a nonnegative
11090 fixnum, since the later code needs to stuff it into an int.
11091 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
11092 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
11093 conversion overflow issues.
11094 (Fopen_font): Check for integer out of range.
11095 (Ffont_get_glyphs): Don't assume index can fit in int.
11096 * font.h: Adjust decls to match defn changes elsewhere.
11097 * fontset.c (reorder_font_vector): Redo score calculation to avoid
11098 integer overflow.
11099 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
11100 printmax_t, where ptrdiff_t is wide enough.
11101 (Finternal_char_font):
11102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11103 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
11104 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
11105 (Fset_frame_position, x_set_frame_parameters)
11106 (x_set_line_spacing, x_set_border_width)
11107 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
11108 Check that fixnums are in proper range for system types.
11109 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
11110 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11111 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
11112 Use SAFE_ALLOCA_LISP, not alloca.
11113 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
11114 intptr_t is wide enough.
11115 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
11116 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
11117 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
11118 Check for fixnum out of range.
11119 * ftfont.c (ftfont_list): Don't assume index fits in int.
11120 Check that fixnums are in proper range for system types.
11121 (ftfont_shape_by_flt):
11122 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
11123 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11124 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11125 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
11126 Check that fixnums are in proper range for system types.
11127 * gnutls.h: Adjust decls to match defn changes elsewhere.
11128 * gtkutil.c (xg_dialog_run):
11129 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11130 (update_frame_tool_bar):
11131 Check that fixnums are in proper range for system types.
11132 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 11133 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
11134 * indent.c (last_known_column, last_known_column_point):
11135 (current_column_bol_cache):
11136 (skip_invisible, current_column, check_display_width):
11137 (check_display_width, scan_for_column, current_column_1)
11138 (Findent_to, Fcurrent_indentation, position_indentation)
11139 (indented_beyond_p, Fmove_to_column, compute_motion):
11140 (Fcompute_motion, Fvertical_motion):
11141 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11142 (last_known_column_modified): Use EMACS_INT, not int.
11143 (check_display_width):
11144 (Fcompute_motion):
11145 Check that fixnums and floats are in proper range for system types.
11146 (compute_motion): Don't assume index or fixnum fits in int.
11147 (compute_motion, Fcompute_motion):
11148 Use int, not EMACS_INT, when it is wide enough.
11149 (vmotion): Omit local var start_hpos that is always 0; that way
11150 we don't need to worry about overflow in expressions involving it.
11151 * indent.h: Adjust decls to match defn changes elsewhere.
11152 (struct position):
11153 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11154 Use int, not EMACS_INT, where int is wide enough.
11155 Remove unused members ovstring_chars_done and tab_offset;
11156 all uses removed.
11157 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
11158 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
11159 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
11160 (make_gap, copy_text, insert, insert_and_inherit)
11161 (insert_before_markers, insert_before_markers_and_inherit)
11162 (insert_1, count_combining_before, count_combining_after)
11163 (insert_1_both, insert_from_string)
11164 (insert_from_string_before_markers, insert_from_string_1)
11165 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
11166 (adjust_after_replace, adjust_after_insert, replace_range)
11167 (replace_range_2, del_range, del_range_1, del_range_byte)
11168 (del_range_both, del_range_2, modify_region)
11169 (prepare_to_modify_buffer, signal_before_change)
11170 (signal_after_change, Fcombine_after_change_execute):
11171 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11172 * intervals.c (traverse_intervals, rotate_right, rotate_left)
11173 (balance_an_interval, split_interval_right, split_interval_left)
11174 (find_interval, next_interval, update_interval)
11175 (adjust_intervals_for_insertion, delete_node, delete_interval)
11176 (interval_deletion_adjustment, adjust_intervals_for_deletion)
11177 (static_offset_intervals, offset_intervals)
11178 (merge_interval_right, merge_interval_left, make_new_interval)
11179 (graft_intervals_into_buffer, temp_set_point_both)
11180 (temp_set_point, set_point, adjust_for_invis_intang)
11181 (set_point_both, move_if_not_intangible, get_property_and_range)
11182 (get_local_map, copy_intervals, copy_intervals_to_string)
11183 (compare_string_intervals, set_intervals_multibyte_1):
11184 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11185 * intervals.h: Adjust decls to match defn changes elsewhere.
11186 (struct interval):
11187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11188 * keyboard.c (this_command_key_count, this_single_command_key_start)
11189 (before_command_key_count, before_command_echo_length, echo_now)
11190 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
11191 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
11192 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
11193 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
11194 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11195 (last_non_minibuf_size, last_point_position, echo_truncate)
11196 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
11197 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
11198 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
11199 (stuff_buffered_input):
11200 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11201 (last_auto_save, command_loop_1, read_char):
11202 Use EMACS_INT, not int, to avoid integer overflow.
11203 (record_char): Avoid overflow in total_keys computation.
11204 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
11205 * keyboard.h: Adjust decls to match defn changes elsewhere.
11206 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
11207 (Fkey_description, Fdescribe_vector, Flookup_key):
11208 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11209 (click_position): New function, to check that positions are in range.
11210 (Fcurrent_active_maps):
11211 (describe_command):
11212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11213 (Faccessible_keymaps, Fkey_description):
11214 (preferred_sequence_p):
11215 Don't assume fixnum can fit into int.
11216 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
11217 Check for integer overflow in size calculations.
11218 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
11219 avoid mishandling large integers.
11220 * lisp.h: Adjust decls to match defn changes elsewhere.
11221 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
11222 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
11223 (struct Lisp_Marker):
11224 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11225 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
11226 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
11227 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
11228 All callers changed.
11229 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
11230 Assume the arg has valid form, since it always does.
11231 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
11232 unsigned integer system type.
11233 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
11234 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
11235 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11236 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
11237 (duration_to_sec_usec): New decl.
11238 * lread.c (read_from_string_index, read_from_string_index_byte)
11239 (read_from_string_limit, readchar, unreadchar, openp)
11240 (read_internal_start, read1, oblookup):
11241 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11242 (Fload, readevalloop, Feval_buffer, Feval_region):
11243 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11244 (openp): Check for out-of-range argument to 'access'.
11245 (read1): Use int, not EMACS_INT, where int is wide enough.
11246 Don't assume fixnum fits into int.
6efdadfd 11247 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
11248 (read_filtered_event): Use duration_to_sec_usec
11249 to do proper overflow checking on durations.
d311d28c
PE
11250 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
11251 in size calculation.
11252 (Fexecute_kbd_macro):
11253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11254 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
11255 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
11256 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
11257 (set_marker_both, set_marker_restricted_both, marker_position)
11258 (marker_byte_position, Fbuffer_has_markers_at):
11259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11260 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 11261 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
11262 It now merely ensures that the menu is large enough, without
11263 necessarily growing it, as this avoids some integer overflow issues.
11264 All callers changed.
11265 (keymap_panes, parse_single_submenu, Fx_popup_menu):
11266 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11267 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
11268 Use SAFE_ALLOCA_LISP, not alloca.
11269 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
11270 to EMACS_INT. Check that fixnums are in proper range for system types.
11271 * minibuf.c (minibuf_prompt_width, string_to_object)
11272 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
11273 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
11274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11275 (get_minibuffer, read_minibuf_unwind):
11276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11277 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
11278 this simplifies overflow checking. All callers changed.
11279 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
11280 (Ftest_completion):
11281 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11282 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
11283 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
11284 Check that fixnums are in proper range for system types.
11285 (Fx_create_frame, Fx_show_tip):
11286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11287 * nsfont.m (ns_findfonts, nsfont_list_family):
11288 Don't assume fixnum fits in long.
11289 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
11290 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11291 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
11292 wide enough.
17fdb222 11293 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
11294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11295 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
11296 (PRINTDECLARE, PRINTPREPARE):
11297 (strout, print_string):
11298 (print, print_preprocess, print_check_string_charset_prop)
11299 (print_object):
11300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11301 (PRINTDECLARE):
11302 (temp_output_buffer_setup, Fprin1_to_string, print_object):
11303 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11304 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 11305 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 11306 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
11307 (print_error_message): Use SAFE_ALLOCA, not alloca.
11308 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
11309 (print_depth, new_backquote_output, print_number_index):
11310 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
11311 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
11312 (Fset_process_window_size, Fformat_network_address)
11313 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 11314 (sigchld_handler):
d311d28c 11315 Check that fixnums are in proper range for system types.
d44287d4 11316 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
11317 Check for process-ids out of pid_t range rather than relying on
11318 undefined behavior.
e4d81efc 11319 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
11320 (Fformat_network_address, read_process_output, send_process)
11321 (Fprocess_send_region, status_notify):
11322 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11323 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
11324 (wait_reading_process_output, read_process_output, exec_sentinel):
11325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11326 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
11327 (Faccept_process_output): Use duration_to_sec_usec to do proper
11328 overflow checking on durations.
dde14581
PE
11329 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
11330 Don't assume pid_t fits in int.
02481186
PE
11331 * process.h (struct Lisp_Process): Members tick and update_tick
11332 are now of type EMACS_INT, not int.
b62b53e8
PE
11333 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
11334 configured --with-wide-int.
d311d28c
PE
11335 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
11336 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
11337 * search.c (looking_at_1, string_match_1):
11338 (fast_string_match, fast_c_string_match_ignore_case)
11339 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
11340 (scan_newline, find_before_next_newline, search_command)
11341 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
11342 (set_search_regs, wordify):
11343 (Freplace_match):
11344 (Fmatch_data):
11345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11346 (string_match_1, search_buffer, set_search_regs):
11347 (Fmatch_data):
11348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11349 (wordify): Check for overflow in size calculation.
11350 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
11351 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
11352 Check that fixnums are in proper range for system types.
11353 * sound.c (struct sound_device)
11354 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
11355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11356 (Fplay_sound_internal):
11357 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 11358 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
11359 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
11360 (Fparse_partial_sexp):
11361 Don't assume fixnums can fit in int.
11362 (struct lisp_parse_state, find_start_pos, find_start_value)
11363 (find_start_value_byte, find_start_begv)
11364 (update_syntax_table, char_quoted, dec_bytepos)
11365 (find_defun_start, prev_char_comend_first, back_comment):
11366 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
11367 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
11368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11369 (Finternal_describe_syntax_value): Check that match_lisp is a
11370 character, not an integer, since the code stuffs it into int.
11371 (scan_words, scan_sexps_forward):
11372 Check that fixnums are in proper range for system types.
11373 (Fforward_word):
11374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11375 (scan_sexps_forward):
11376 Use CHARACTERP, not INTEGERP, since the value must fit into int.
11377 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
11378 * syntax.h: Adjust decls to match defn changes elsewhere.
11379 (struct gl_state_s):
11380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
11381 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
11382 MOST_POSITIVE_FIXNUM.
d311d28c
PE
11383 * sysdep.c (wait_for_termination_1, wait_for_termination)
11384 (interruptible_wait_for_termination, mkdir):
11385 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
11386 (emacs_read, emacs_write):
11387 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
11388 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
11389 and double all fit in int.
d311d28c
PE
11390 * term.c (set_tty_color_mode):
11391 Check that fixnums are in proper range for system types.
11392 * termhooks.h (struct input_event):
11393 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11394 * textprop.c (validate_interval_range, interval_of)
11395 (Fadd_text_properties, set_text_properties_1)
11396 (Fremove_text_properties, Fremove_list_of_text_properties)
11397 (Ftext_property_any, Ftext_property_not_all)
11398 (copy_text_properties, text_property_list, extend_property_ranges)
11399 (verify_interval_modification):
11400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11401 (Fnext_single_char_property_change)
11402 (Fprevious_single_char_property_change):
11403 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
11404 (copy_text_properties):
11405 Check for integer overflow in index calculation.
d311d28c
PE
11406 * undo.c (last_boundary_position, record_point, record_insert)
11407 (record_delete, record_marker_adjustment, record_change)
11408 (record_property_change):
11409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11410 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
11411 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11412 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11413 (Fx_hide_tip, Fx_file_dialog):
11414 * w32menu.c (set_frame_menubar):
11415 Use ptrdiff_t, not int, for consistency with rest of code.
11416 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
11417 (select_window, Fdelete_other_windows_internal)
11418 (window_scroll_pixel_based, window_scroll_line_based)
11419 (Frecenter, Fset_window_configuration):
11420 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11421 (Fset_window_hscroll, run_window_configuration_change_hook)
11422 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 11423 (Fscroll_other_window, Frecenter):
d311d28c
PE
11424 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11425 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
11426 Don't assume fixnum fits in int.
11427 (Fset_window_scroll_bars):
11428 Check that fixnums are in proper range for system types.
11429 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
11430 (string_pos, c_string_pos, number_of_chars, init_iterator)
11431 (in_ellipses_for_invisible_text_p, init_from_display_pos)
11432 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
11433 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
11434 (face_before_or_after_it_pos, handle_invisible_prop)
11435 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
11436 (display_prop_intangible_p, string_buffer_position_lim)
11437 (string_buffer_position, handle_composition_prop, load_overlay_strings)
11438 (get_overlay_strings_1, get_overlay_strings)
11439 (iterate_out_of_display_property, forward_to_next_line_start)
11440 (back_to_previous_visible_line_start, reseat, reseat_to_string)
11441 (get_next_display_element, set_iterator_to_next)
11442 (get_visually_first_element, compute_stop_pos_backwards)
11443 (handle_stop_backwards, next_element_from_buffer)
11444 (move_it_in_display_line_to, move_it_in_display_line)
11445 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11446 (add_to_log, message_dolog, message_log_check_duplicate)
11447 (message2, message2_nolog, message3, message3_nolog
11448 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
11449 (current_message_1, truncate_echo_area, truncate_message_1)
11450 (set_message, set_message_1, store_mode_line_noprop)
11451 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
11452 (text_outside_line_unchanged_p, check_point_in_composition)
11453 (reconsider_clip_changes)
11454 (redisplay_internal, set_cursor_from_row, try_scrolling)
11455 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
11456 (redisplay_window, find_last_unchanged_at_beg_row)
11457 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
11458 (trailing_whitespace_p, find_row_edges, display_line)
11459 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
11460 (display_mode_element, store_mode_line_string)
11461 (pint2str, pint2hrstr, decode_mode_spec)
11462 (display_count_lines, display_string, draw_glyphs)
11463 (x_produce_glyphs, x_insert_glyphs)
11464 (rows_from_pos_range, mouse_face_from_buffer_pos)
11465 (fast_find_string_pos, mouse_face_from_string_pos)
11466 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11468 (safe_call, init_from_display_pos, handle_fontified_prop)
11469 (handle_single_display_spec, load_overlay_strings)
11470 (with_echo_area_buffer, setup_echo_area_for_printing)
11471 (display_echo_area, echo_area_display)
11472 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
11473 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
11474 (redisplay_window, dump_glyph_row, display_mode_line)
11475 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 11476 (handle_display_spec, display_prop_string_p):
d311d28c
PE
11477 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11478 (handle_single_display_spec, build_desired_tool_bar_string)
11479 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
11480 (get_specified_cursor_type):
11481 Check that fixnums are in proper range for system types.
11482 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
11483 (Flookup_image_map):
11484 Don't assume fixnums fit in int.
11485 (compare_overlay_entries):
11486 Avoid mishandling comparisons due to subtraction overflow.
11487 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
11488 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
11489 (handle_tool_bar_click):
11490 Use int, not unsigned, since we prefer signed and the signedness
11491 doesn't matter here.
11492 (get_next_display_element, next_element_from_display_vector):
11493 Use int, not EMACS_INT, when int is wide enough.
11494 (start_hourglass): Use duration_to_sec_usec to do proper
11495 overflow checking on durations.
11496 * xfaces.c (Fbitmap_spec_p):
11497 Check that fixnums are in proper range for system types.
11498 (compare_fonts_by_sort_order):
11499 Avoid mishandling comparisons due to subtraction overflow.
11500 (Fx_family_fonts, realize_basic_faces):
11501 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11502 (Fx_family_fonts):
11503 Don't assume fixnum fits in int.
11504 Use SAFE_ALLOCA_LISP, not alloca.
11505 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
11506 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
11507 (face_at_buffer_position, face_for_overlay_string)
11508 (face_at_string_position):
11509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11510 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
11511 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
11512 (Fx_show_tip):
11513 Check that fixnums are in proper range for system types.
11514 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11515 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
11516 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11517 (Fx_change_window_property): Don't assume fixnums fit in int.
11518 * xfont.c (xfont_chars_supported):
11519 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11520 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
11521 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
11522 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11523 * xml.c (parse_region):
11524 * xrdb.c (magic_file_p):
11525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11526 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
11527 (x_get_local_selection, x_reply_selection_request)
11528 (x_handle_selection_request, wait_for_property_change):
11529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11530 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
11531 short is wide enough.
11532 (x_send_client_event): Don't assume fixnum fits in int.
11533 * xterm.c (x_x_to_emacs_modifiers):
11534 Don't assume EMACS_INT overflows nicely into int.
11535 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
11536 may come from Lisp.
11537 (handle_one_xevent): NATNUMP can eval its arg twice.
11538 (x_connection_closed):
11539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11540 * xterm.h: Adjust decls to match defn changes elsewhere.
11541 (struct scroll_bar): Use struct vectorlike_header
11542 rather than rolling our own approximation.
11543 (SCROLL_BAR_VEC_SIZE): Remove; not used.
11544
c6574eb5
GM
115452012-05-25 Glenn Morris <rgm@gnu.org>
11546
11547 * lisp.mk (lisp): Update for more files being compiled now.
11548
e8d32c7e
SM
115492012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
11550
48def666
SM
11551 * lread.c: Remove `read_pure' which makes no difference.
11552 (read_pure): Remove var.
11553 (unreadpure): Remove function.
11554 (readevalloop): Don't call read_list with -1 flag.
11555 (read1, read_vector): Don't test read_pure any more.
11556 (read_list): Simplify.
11557
e8d32c7e
SM
11558 * fileio.c, character.h: Minor style tweaks.
11559
4b2addb7
DA
115602012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
11561
11562 * window.h (clip_changed): Remove useless declaration.
11563
584461b2
JB
115642012-05-22 Juanma Barranquero <lekktu@gmail.com>
11565
11566 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
11567 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
11568
34374650
PE
115692012-05-22 Paul Eggert <eggert@cs.ucla.edu>
11570
11571 Remove src/m/*.
11572 This directory predates autoconf and is no longer needed nowadays.
11573 Move its few remaining bits of functionality to where they're needed.
11574 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
11575 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
11576 * m/template.h: Remove.
11577 * Makefile.in (M_FILE): Remove. All uses removed.
11578 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
11579 * lisp.h (USE_LSB_TAG):
11580 * mem-limits.h (EXCEEDS_LISP_PTR):
11581 Use VAL_MAX, not VALBITS, in #if.
11582 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
11583 (EMACS_UINT): Define unconditionally now.
11584 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
11585 (BITS_PER_EMACS_INT): New constants, replacing
11586 what used to be in config.h, but not useful in #if.
11587 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
11588 define them any more.
11589 (VAL_MAX): New macro.
11590 (VALMASK): Use it.
11591 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
11592 BITS_PER_EMACS_INT, in #if.
11593 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11594 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
11595 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
11596 * s/ms-w32.h (DATA_START):
11597 Move here from removed file m/intel386.h.
11598 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
11599 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
11600
261cb4bb
PE
116012012-05-21 Paul Eggert <eggert@cs.ucla.edu>
11602
11603 Assume C89 or later.
11604 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
11605 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
11606 (xrealloc):
11607 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
11608 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
11609 * textprop.c, tparam.c (NULL): Remove.
11610 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
11611 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
11612 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
11613 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
11614 * xterm.c (input_signal_count): Assume volatile works.
11615
ff23cd9f
KB
116162012-05-21 Ken Brown <kbrown@cornell.edu>
11617
11618 * xgselect.c (xg_select): Fix first argument in call to 'select'
11619 (bug#11508).
11620
1b170bc6
KB
116212012-05-20 Ken Brown <kbrown@cornell.edu>
11622
11623 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 11624 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 11625
b2f4d39f
KB
116262012-05-19 Ken Brown <kbrown@cornell.edu>
11627
11628 * xfns.c (x_in_use): Remove `static' qualifier.
11629 * xterm.h (x_in_use): Declare.
11630 * xgselect.c: Include xterm.h.
11631 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
11632 and `display_arg' (bug#9754).
11633
003fdae2
PE
116342012-05-19 Paul Eggert <eggert@cs.ucla.edu>
11635
9232a6d9
PE
11636 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
11637
003fdae2
PE
11638 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
11639 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
11640
784b56e2
EZ
116412012-05-18 Eli Zaretskii <eliz@gnu.org>
11642
11643 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
11644
11645 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 11646 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
11647
11648 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
11649 reference to image_cache->refcount.
11650 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
11651
a0a79cde
JL
116522012-05-17 Juri Linkov <juri@jurta.org>
11653
11654 * search.c (Fword_search_regexp, Fword_search_backward)
11655 (Fword_search_forward, Fword_search_backward_lax)
11656 (Fword_search_forward_lax): Move functions to isearch.el
11657 (bug#10145, bug#11381).
11658
b0572523
PE
116592012-05-16 Paul Eggert <eggert@cs.ucla.edu>
11660
11661 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
11662
9660f5fc
SM
116632012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
11664
11665 * lread.c (init_obarray): Declare Qt and Qnil as special.
11666
4374de83
GM
116672012-05-14 Glenn Morris <rgm@gnu.org>
11668
11669 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 11670 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 11671
dc44c39a
PE
116722012-05-14 Paul Eggert <eggert@cs.ucla.edu>
11673
078c97cb
PE
11674 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
11675
dc44c39a
PE
11676 * unexaix.c: Port to more-recent AIX compilers.
11677 (report_error, report_error_1, make_hdr, copy_sym)
11678 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
11679 Make arguments const char *, not char *, to avoid violations of C
11680 standard and to fix some AIX warnings reported by Gilles Pion.
11681
e18afed7 116822012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
11683
11684 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
11685 already have overlays loaded.
11686 (handle_single_display_spec): Before returning without displaying
11687 fringe bitmap, synchronize the bidi iterator with the main display
11688 iterator, by calling iterate_out_of_display_property.
11689 (iterate_out_of_display_property): Detect buffer iteration by
11690 testing that it->string is a Lisp string.
11691 (get_next_display_element): When the current object is exhausted,
11692 and there's something on it->stack, call set_iterator_to_next to
11693 proceed with what's on the stack, instead of returning zero.
11694 (set_iterator_to_next): If called at the end of a Lisp string,
11695 proceed to consider_string_end without incrementing string
11696 position. Don't increment display vector index past the end of
11697 the display vector. (Bug#11417)
c8fb9dc6
EZ
11698 (pos_visible_p): Don't report a position visible when move_it_to
11699 stopped at the last line of window, which happens to be scanned
11700 backwards by the bidi iteration. (Bug#11464)
ac268e67 11701
e18afed7 117022012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
11703
11704 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
11705 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
11706 are on a TTY, and thus unable to display on the fringes.
11707 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
11708 so we need to signal to the caller that this is a "replacing"
11709 display spec. This fixes display when the spec is invalid or we
11710 are on a TTY.
11711
e18afed7 117122012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
11713
11714 * unexaix.c (make_hdr): Fix typo in prototype.
11715 This bug broke the build on AIX. Problem reported by Gilles Pion.
11716
9d0a235a
MA
117172012-05-14 Michael Albinus <michael.albinus@gmx.de>
11718
11719 * keyboard.c (kbd_buffer_get_event): Read special events also in
11720 batch mode. (Bug#11415)
11721
9e6b06ed
GM
117222012-05-12 Glenn Morris <rgm@gnu.org>
11723
11724 * ns.mk: Update for ns_appbindir no longer having trailing "/".
11725
c1a1d7a3
EZ
117262012-05-12 Eli Zaretskii <eliz@gnu.org>
11727
11728 * lisp.mk (lisp): Add newcomment.elc.
11729
3fe7cdc8
GM
117302012-05-12 Glenn Morris <rgm@gnu.org>
11731
11732 * Makefile.in (MKDIR_P): New, set by configure.
11733 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
11734
53f7d2c0
PE
117352012-05-11 Paul Eggert <eggert@cs.ucla.edu>
11736
11737 Remove unused function hourglass_started.
11738 * dispextern.h (hourglass_started):
11739 * w32fns.c (hourglass_started):
11740 * xdisp.c (hourglass_started): Remove.
11741
75aafb17
JB
117422012-05-10 Juanma Barranquero <lekktu@gmail.com>
11743
11744 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
11745 Update dependencies.
11746
12959e8e
PE
117472012-05-10 Paul Eggert <eggert@cs.ucla.edu>
11748
97107e2e
PE
11749 * xgselect.c (xg_select): Put maxfds+1 into a var.
11750 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
11751
12959e8e
PE
11752 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
11753
836d29b3
DA
117542012-05-10 Dave Abrahams <dave@boostpro.com>
11755
11756 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
11757 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
11758
5cb67954
MA
117592012-05-09 Michael Albinus <michael.albinus@gmx.de>
11760
11761 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 11762 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
11763 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
11764 Initialize xd_registered_buses.
11765
3478ec45
PE
117662012-05-09 Paul Eggert <eggert@cs.ucla.edu>
11767
b263a6b0
PE
11768 Untag more efficiently if USE_LSB_TAG.
11769 This is based on a proposal by YAMAMOTO Mitsuharu in
11770 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
11771 For an admittedly artificial (nth 8000 longlist) benchmark on
11772 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
11773 Emacs's overall text size by 1%.
11774 * lisp.h (XUNTAG): New macro.
11775 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
11776 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
11777 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
11778 * eval.c (Fautoload):
11779 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
11780 * frame.h (XFRAME): Use XUNTAG.
11781
3478ec45
PE
11782 Port recent dbusbind.c changes to 32-bit --with-wide-int.
11783 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
11784 Remove unportable assumptions about print widths of types like
11785 dbus_uint32_t.
11786 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
11787 intptr_t when converting between pointer and integer, to avoid GCC
11788 warnings about wrong width.
11789
666b903b 117902012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
11791
11792 * w32proc.c (new_child): Force Windows to reserve only 64KB of
11793 stack for each reader_thread, instead of defaulting to 8MB
11794 determined by the linker. This avoids failures in creating
11795 subprocesses on Windows 7, see the discussion in this thread:
11796 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
11797
b120cc17
JC
117982012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
11799
11800 Fix up display of the *Minibuf-0* buffer in the mini window.
11801 * keyboard.c (read_char): Don't clear the echo area if there's no
11802 message to clear.
11803 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 11804 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 11805
9a4b36f8
MA
118062012-05-07 Michael Albinus <michael.albinus@gmx.de>
11807
11808 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
11809 batch mode.
11810
e5f9458f
CY
118112012-05-06 Chong Yidong <cyd@gnu.org>
11812
11813 * lisp.mk (lisp): Update.
11814
eceeb5fc 118152012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
11816
11817 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
11818
71873e2b
SM
118192012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
11820
11821 * data.c (PUT_ERROR): New macro.
11822 (syms_of_data): Use it. Add new error type `user-error'.
11823 * undo.c (user_error): New function.
11824 (Fprimitive_undo): Use it.
11825 * print.c (print_error_message): Adjust print style for `user-error'.
11826 * keyboard.c (user_error): New function.
11827 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
11828
ab0fa4e4
PE
118292012-05-03 Paul Eggert <eggert@cs.ucla.edu>
11830
11831 Do not limit current-time-string to years 1000..9999.
11832 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
11833 (Fcurrent_time_string): Support any year that is supported by the
11834 underlying localtime representation. Don't use asctime, as it
11835 has undefined behavior for years outside the range -999..9999.
11836
7ed806a7
PE
118372012-05-02 Paul Eggert <eggert@cs.ucla.edu>
11838
11839 Fix race conditions involving setenv, gmtime, localtime, asctime.
11840 Without this fix, interrupts could mess up code that uses these
11841 nonreentrant functions, since setting TZ invalidates existing
11842 tm_zone or tzname values, and since most of these functions return
11843 pointers to static storage.
11844 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
11845 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
11846 Grow the critical sections to include not just invoking
11847 localtime/gmtime, but also accessing these functions' results
11848 including their tm_zone values if any, and any related TZ setting.
11849 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
11850 so that the struct tm is saved in the critical section.
11851 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
11852 motivated by the fact that memory allocation needs to be outside
11853 the critical section.
11854
0c16dfed
DA
118552012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
11856
11857 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
11858 with RESET_INTERVAL.
11859
11860 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
11861 Remove duplicated buffer name initialization.
11862
3f83ace8
JM
118632012-05-02 Jim Meyering <jim@meyering.net>
11864
11865 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
11866
c7b8541e
JM
11867 * xfns.c (x_window): Use xstrdup (Bug#11375).
11868
90207a15 118692012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
11870
11871 * xdisp.c (pos_visible_p): If already at a newline from the
11872 display string before the 'while' loop, don't walk back the glyphs
11873 from it3.glyph_row. Solves assertion violation when the display
11874 string begins with a newline (egg.el). (Bug#11367)
11875
b593d6a9
AH
118762012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
11877
11878 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
11879 Move to simple.el.
11880
4737362e
GM
118812012-05-01 Glenn Morris <rgm@gnu.org>
11882
99cf43f9
GM
11883 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
11884 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
11885 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
11886 All were removed before 23.1.
11887
9311dcff
GM
11888 * dispnew.c: Remove HAVE_LIBNCURSES test;
11889 it is always true on relevant platforms.
11890
4d5c6349
GM
11891 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
11892 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
11893
4737362e
GM
11894 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
11895
74dd3a6b
AS
118962012-04-30 Andreas Schwab <schwab@linux-m68k.org>
11897
11898 * .gdbinit (xpr): Remove checks for no longer existing misc types.
11899 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
11900 Remove.
11901
13c379ee
PE
119022012-04-28 Paul Eggert <eggert@cs.ucla.edu>
11903
11904 Do not avoid creating empty evaporating overlays (Bug#9642).
11905 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
11906 That is, do not delete an evaporating overlay if it becomes
11907 empty after its bounds are adjusted to fit within its buffer.
11908 This fix caused other problems, and I'm reverting it until we get
11909 to the bottom of them.
11910
a8e7d6d7 119112012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
11912
11913 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
11914
a8e7d6d7 119152012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
11916
11917 * xdisp.c (pos_visible_p): If the window start position is beyond
11918 ZV, start the display from buffer beginning. Prevents assertion
11919 violation in init_iterator when the minibuffer window is scrolled
11920 via the scroll bar.
11921
11922 * window.c (window_scroll_pixel_based): Likewise.
11923
a8e7d6d7 119242012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
11925
11926 * keymap.c (where_is_internal): Doc fix (Bug#10872).
11927
a8e7d6d7 119282012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
11929
11930 * fileio.c (Fcopy_file, Fset_file_selinux_context):
11931 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
11932
a8e7d6d7 119332012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 11934
b593d6a9
AH
11935 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
11936 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 11937
1c6900d9
EZ
119382012-04-26 Eli Zaretskii <eliz@gnu.org>
11939
4c3fa1d9
EZ
11940 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
11941 display element, check also the underlying string or buffer
11942 character. (Bug#11341)
11943
1c6900d9
EZ
11944 * w32menu.c: Include w32heap.h.
11945 (add_menu_item): If the call to AppendMenuW (via
11946 unicode_append_menu) fails, disable Unicode menus only if we are
11947 running on Windows 9X/Me.
11948
42bf8205
AS
119492012-04-24 Andreas Schwab <schwab@linux-m68k.org>
11950
11951 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
11952 (xgetint): Add missing shift for LSB tags.
11953
b1bac16e
MR
119542012-04-24 Martin Rudalics <rudalics@gmx.at>
11955
11956 * keyboard.c (read_char): Don't wipe echo area for select window
11957 events: These might get delayed via `mouse-autoselect-window'
11958 (Bug#11304).
11959
d69621cc
JB
119602012-04-24 Juanma Barranquero <lekktu@gmail.com>
11961
11962 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
11963 manipulation of :loaded-from data.
11964
02fd101b
JB
119652012-04-23 Juanma Barranquero <lekktu@gmail.com>
11966
11967 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
11968 now a cons (bug#11311).
11969
888bec30
PE
119702012-04-23 Paul Eggert <eggert@cs.ucla.edu>
11971
89a438bd
PE
11972 Do not create empty overlays with the evaporate property (Bug#9642).
11973 * buffer.c (Fmove_overlay): Delete an evaporating overlay
11974 if it becomes empty after its bounds are adjusted to fit within
11975 its buffer. Without this fix, in a nonempty buffer (let ((o
11976 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
11977 yields an empty overlay that has the evaporate property, which is
11978 not supposed to happen.
11979
1068fe4d
PE
11980 Fix minor GTK3 problems found by static checking.
11981 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11982 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11983 (struct _EmacsFixedClass, emacs_fixed_get_type):
11984 Move decls here from emacsgtkfixed.h, since they needn't be public.
11985 (emacs_fixed_get_type): Now static.
11986 (emacs_fixed_class_init): Omit unused local.
11987 (emacs_fixed_child_type): Remove; unused.
11988 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11989 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11990 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
11991 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
11992 (EMACS_FIXED_GET_CLASS): Remove; unused.
11993 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
11994
888bec30
PE
11995 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
11996 Problem reported by Juanma Barranquero for Windows -Wunused-function.
11997
de85e130
PE
119982012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11999
d0baac98 12000 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 12001 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
12002 (__malloc_size_t, __malloc_ptrdiff_t):
12003 Remove. All uses removed, replaced by the definiens if needed,
12004 since we can assume C89 or better now.
12005 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12006 (protect_malloc_state, align, get_contiguous_space)
12007 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12008 (malloc_atfork_handler_child, malloc_enable_thread)
12009 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12010 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
12011 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
12012 (special_realloc, _realloc_internal_nolock, _realloc_internal)
12013 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
12014 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
12015 Define using prototypes, not old style.
12016 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
12017 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
12018 (align): Don't assume that signed integer overflow wraps around.
12019 Omit unused local var.
12020 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
12021 (_free_internal_nolock, memalign, mallochook, reallochook):
12022 Omit no-longer-needed casts.
12023 (valloc): Use getpagesize, not __getpagesize.
12024 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
12025 (struct hdr): The 'magic' member is now size_t, not unsigned long.
12026
de85e130
PE
12027 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
12028
dcbf5805
MA
120292012-04-22 Michael Albinus <michael.albinus@gmx.de>
12030
12031 Move functions from C to Lisp. Make non-blocking method calls
12032 the default. Implement further D-Bus standard interfaces.
12033
12034 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
12035 (QCdbus_request_name_allow_replacement)
12036 (QCdbus_request_name_replace_existing)
12037 (QCdbus_request_name_do_not_queue)
12038 (QCdbus_request_name_reply_primary_owner)
12039 (QCdbus_request_name_reply_in_queue)
12040 (QCdbus_request_name_reply_exists)
12041 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
12042 (QCdbus_registered_serial, QCdbus_registered_method)
12043 (QCdbus_registered_signal): New Lisp objects.
12044 (XD_DEBUG_MESSAGE): Use sizeof.
12045 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
12046 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
12047 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
12048 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
12049 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
12050 (xd_signature, xd_append_arg): Allow float for integer types.
12051 (xd_get_connection_references): New function.
b593d6a9
AH
12052 (xd_get_connection_address): Rename from xd_initialize.
12053 Return cached address.
dcbf5805
MA
12054 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
12055 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
12056 level.
12057 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 12058 Return number of refcounts.
dcbf5805
MA
12059 (Fdbus_get_unique_name): Make stronger parameter check.
12060 (Fdbus_message_internal): New defun.
12061 (Fdbus_call_method, Fdbus_call_method_asynchronously)
12062 (Fdbus_method_return_internal, Fdbus_method_error_internal)
12063 (Fdbus_send_signal, Fdbus_register_service)
12064 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
12065 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
12066 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
12067 (Vdbus_compiled_version, Vdbus_runtime_version)
12068 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
12069 (Vdbus_message_type_method_return, Vdbus_message_type_error)
12070 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
12071 (Vdbus_registered_buses, Vdbus_registered_objects_table):
12072 Adapt docstring.
dcbf5805 12073
52828e02
PE
120742012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12075
da05bc4c
PE
12076 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
12077 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
12078 Do not assume ptrdiff_t is the same width as 'int'.
12079
52828e02
PE
12080 * alloc.c: Handle unusual debugging option combinations.
12081 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
12082 since the two debugging options are incompatible.
12083 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
12084 is defined.
12085 (mem_init, mem_insert, mem_insert_fixup):
12086 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
12087 (NEED_MEM_INSERT): Remove; no longer needed.
12088
f01769f9
LL
120892012-04-22 Leo Liu <sdl.web@gmail.com>
12090
12091 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
12092
5790543d
PE
120932012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12094
12095 * sysdep.c [__FreeBSD__]: Minor cleanups.
12096 (list_system_processes, system_process_attributes) [__FreeBSD__]:
12097 Use Emacs indenting style more consistently. Avoid some casts.
12098 Use 'double' consistently rather than mixing 'float' and 'double'.
12099
b91b7e4d
EW
121002012-04-21 Eduard Wiebe <usenet@pusto.de>
12101
b593d6a9
AH
12102 * sysdep.c (list_system_processes, system_process_attributes):
12103 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 12104
6114eb15
AS
121052012-04-21 Andreas Schwab <schwab@linux-m68k.org>
12106
12107 * lisp.mk (lisp): Update.
12108
2f38dff7
PE
121092012-04-20 Paul Eggert <eggert@cs.ucla.edu>
12110
12111 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
12112 It is never used otherwise.
12113
4ae29f89
SM
121142012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
12115
12116 * print.c (print_preprocess): Only check print_depth if print-circle
12117 is nil.
12118 (print_object): Check for cycles even when print-circle is nil and
12119 print-gensym is t, but only check print_depth if print-circle is nil.
12120
f30d612a
CY
121212012-04-20 Chong Yidong <cyd@gnu.org>
12122
12123 * process.c (wait_reading_process_output): If EIO occurs on a pty,
12124 set the status to "failed" and ensure that sentinel is run.
12125
c07a4c0b 121262012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
12127
12128 * process.c (Fset_process_inherit_coding_system_flag)
12129 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 12130 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 12131
c07a4c0b 121322012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
12133
12134 * xdisp.c (string_buffer_position_lim): Limit starting position to
12135 BEGV.
12136 (set_cursor_from_row): If called for a mode-line or header-line
12137 row, return zero immediately.
12138 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
12139 farther than the first row after the header line, if any.
12140 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
12141 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
12142
c07a4c0b 121432012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 12144
4ae29f89
SM
12145 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
12146 (bug#11238).
ad3a2b41 12147
c07a4c0b 121482012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 121492012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
12150
12151 configure: new option --enable-gcc-warnings (Bug#11207)
12152 * Makefile.in (C_WARNINGS_SWITCH): Remove.
12153 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
12154 (ALL_CFLAGS): Use new macros rather than old.
12155 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
12156 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
12157 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
12158 -Wunused-result, -Wunused-variable. This should go away once
12159 the Emacs and Gnulib regex code is merged.
12160 (xmalloc, xrealloc): Now static.
12161
aba027e8
PE
121622012-04-17 Paul Eggert <eggert@cs.ucla.edu>
12163
12164 * dired.c (Fsystem_groups): Remove unused local.
12165
e5a36063
GM
121662012-04-17 Glenn Morris <rgm@gnu.org>
12167
12168 * dired.c (Fsystem_users): Doc fix.
12169
316411f0
DA
121702012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
12171
12172 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
12173 (syms_of_dired): Add them.
12174
9426aba4
PE
121752012-04-16 Paul Eggert <eggert@cs.ucla.edu>
12176
b62a57be
PE
12177 Fix minor alloc.c problems found by static checking.
12178 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
12179 New extern decls, to avoid calling undeclared functions.
12180 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
12181 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
12182 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
12183 (NEED_MEM_INSERT): New macro.
12184 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 12185 Remove one incorrect comment and fix another.
b62a57be 12186
3539f31f
PE
12187 Fix minor ralloc.c problems found by static checking.
12188 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12189 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
12190 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
12191 (r_alloc_sbrk): Now static.
12192
a041960a
PE
12193 Improve ralloc.c interface checking.
12194 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12195 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
12196 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
12197 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
12198 [REL_ALLOC]: ... to here, to check interface.
12199 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
12200 Remove decls. This fixes an "It stinks!".
12201
9426aba4
PE
12202 * alloc.c (which_symbols): Fix alignment issue / type clash.
12203
d55c12ed
AS
122042012-04-15 Andreas Schwab <schwab@linux-m68k.org>
12205
12206 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
12207 (struct Lisp_Misc_Any): Likewise.
12208 (struct Lisp_Free): Likewise.
12209 * alloc.c (union aligned_Lisp_Symbol): Define.
12210 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
12211 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
12212 (union aligned_Lisp_Misc): Define.
12213 (MARKER_BLOCK_SIZE, struct marker_block): Use union
12214 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 12215 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 12216
b948ce8b
PE
122172012-04-14 Paul Eggert <eggert@cs.ucla.edu>
12218
12219 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
12220 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
12221 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
12222 * s/netbsd.h, s/sol2-6.h:
12223 Remove definition of GC_MARK_STACK, since the default now works.
12224 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
12225 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
12226 no longer the default.
12227 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
12228
35dc09a1 122292012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 12230
35dc09a1
GM
12231 * lread.c (lisp_file_lexically_bound_p):
12232 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 12233
35dc09a1
GM
122342012-04-14 Eli Zaretskii <eliz@gnu.org>
12235
12236 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
12237 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
12238
122392012-04-14 Jan Djärv <jan.h.d@swipnet.se>
12240
12241 * nsterm.m (constrainFrameRect): Always constrain when there is only
12242 one screen (Bug#10962).
12243
bcd86815
KB
122442012-04-13 Ken Brown <kbrown@cornell.edu>
12245
12246 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
12247
c25df26e
RT
122482012-04-13 Reuben Thomas <rrt@sc3d.org>
12249
12250 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
12251
0fc59f1e
DC
122522012-04-11 Daniel Colascione <dancol@dancol.org>
12253
12254 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
12255 against is gone. It's better to use vfork now so that when Cygwin
12256 gains a new, working vfork, we use it automatically (bug#10398).
12257
de8c03dc
SM
122582012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12259
12260 * window.c (save_window_save): Obey window-point-insertion-type.
12261
2f097256
GM
122622012-04-11 Glenn Morris <rgm@gnu.org>
12263
12264 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
12265
453b951e
SM
122662012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12267
12268 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
12269
75f1671a 122702012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
12271
12272 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
12273 (force_quit_count): New var.
12274 (handle_interrupt): Use it.
12275
2a8ce227
JB
122762012-04-10 Juanma Barranquero <lekktu@gmail.com>
12277
12278 * w32.c (w32_delayed_load): Record the full path of the library
12279 being loaded (bug#10424).
12280
935396c0
GM
122812012-04-09 Glenn Morris <rgm@gnu.org>
12282
05920a43
GM
12283 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
12284 not just in the obarray, before snarfing them. (Bug#11036)
12285
935396c0
GM
12286 * Makefile.in ($(leimdir)/leim-list.el):
12287 Pass EMACS rather than BUILT_EMACS.
12288
a18ecafa
TZ
122892012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
12290
12291 * process.c (make_process):
12292 * process.h: Add integer `gnutls_handshakes_tried' member to
12293 process struct.
12294
6bbef4e5
JC
12295 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
12296 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
12297
12298 * gnutls.c (gnutls_log_function2i): Convenience log function.
12299 (emacs_gnutls_read): Use new log functions,
12300 `gnutls_handshakes_tried' process member, and
12301 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
12302 attempts per process (connection).
12303
b4d3bc10
CY
123042012-04-09 Chong Yidong <cyd@gnu.org>
12305
12306 * eval.c (Fuser_variable_p, user_variable_p_eh)
12307 (lisp_indirect_variable): Functions deleted.
12308 (Fdefvar): Caller changed.
12309
12310 * callint.c (Finteractive, Fcall_interactively):
12311 * minibuf.c (Fread_variable): Callers changed.
12312
70f4d973
EZ
123132012-04-09 Eli Zaretskii <eliz@gnu.org>
12314
12315 * xdisp.c (set_cursor_from_row): If the display string appears in
12316 the buffer at position that is closer to point than the position
12317 after the display string, display the cursor on the first glyph of
12318 the display string. Fixes cursor display when a 'display' text
12319 property immediately follows invisible text. (Bug#11094)
12320
cb3c2e3e
PE
123212012-04-09 Paul Eggert <eggert@cs.ucla.edu>
12322
12323 composite.c: use 'double' consistently
12324 * composite.c (get_composition_id): Use 'double' consistently
12325 instead of converting 'float' to 'double' and vice versa; this is
12326 easier to understand and avoids a GCC warning.
12327
fd06db5d
GM
123282012-04-09 Glenn Morris <rgm@gnu.org>
12329
50fe702a
GM
12330 * Makefile.in: Generate leim-list with bootstrap-emacs, in
12331 preparation for dumping it with emacs. (Bug#4789)
12332 (leimdir): New variable.
12333 ($(leimdir)/leim-list.el): New rule.
12334 (emacs$(EXEEXT)): Depend on leim-list.el.
12335
fd06db5d
GM
12336 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
12337 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
12338 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
12339
55c131ee
AS
123402012-04-08 Andreas Schwab <schwab@linux-m68k.org>
12341
12342 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
12343 proper alignment.
12344
9209588f
JB
123452012-04-07 Juanma Barranquero <lekktu@gmail.com>
12346
12347 * xml.c (init_libxml2_functions) [WINDOWSNT]:
12348 Remove unused local variable.
12349
e3fb2efb
PE
123502012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12351
12352 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
12353 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
12354 (mark_memory): Mark Lisp_Objects only if pointers might hide in
12355 objects, as mark_maybe_pointer will catch them otherwise.
12356 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
12357 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
12358
b5385551
PE
123592012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12360
12361 Fix typo that broke non-Windows builds.
12362 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
12363
9078ead6
EZ
123642012-04-07 Eli Zaretskii <eliz@gnu.org>
12365
12366 Support building on MS-Windows with libxml2.
12367
12368 * makefile.w32-in (OBJ2): Add xml.$(O).
12369 (GLOBAL_SOURCES): Add xml.c.
12370 ($(BLD)/xml.$(O)): New dependency list.
12371
12372 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
12373 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
12374 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
12375 [!WINDOWSNT]: New macros.
12376 (init_libxml2_functions, libxml2_loaded_p): New functions.
12377 (parse_region): Call fn_xmlCheckVersion instead of using the macro
12378 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
12379 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
12380 Calls xmlCleanupParser only if libxml2 was loaded (or statically
12381 linked in).
6bbef4e5
JC
12382 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
12383 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
12384 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
12385
12386 * emacs.c: Don't include libxml/parser.h.
12387 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
12388 xmlCleanupParser directly.
12389
12390 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
12391
3811fdf3
EZ
123922012-04-07 Eli Zaretskii <eliz@gnu.org>
12393
12394 * indent.c (Fvertical_motion): If there is a display string at
12395 point, use it.vpos to compute how many lines to backtrack after
12396 move_it_to point. (Bug#11133)
12397
2f8e16b2
EZ
123982012-04-06 Eli Zaretskii <eliz@gnu.org>
12399
12400 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
12401 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
12402 about subtle differences between FETCH_CHAR* and STRING_CHAR*
12403 macros related to unification of CJK characters. For the details,
12404 see the discussion following the message here:
12405 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
12406
3d439cd1
CY
124072012-04-04 Chong Yidong <cyd@gnu.org>
12408
12409 * keyboard.c (Vdelayed_warnings_list): Doc fix.
12410
8bc53d00
EZ
124112012-04-01 Eli Zaretskii <eliz@gnu.org>
12412
12413 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
12414 instead of alloca. (Bug#11138)
12415
3b0512a3
AS
124162012-04-01 Andreas Schwab <schwab@linux-m68k.org>
12417
12418 * w32menu.c (is_simple_dialog): Properly check lisp types.
12419 (Bug#11141)
12420
8427ddd2
EZ
124212012-03-31 Eli Zaretskii <eliz@gnu.org>
12422
979022ef
EZ
12423 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
12424 position we get to after a call to move_it_to fails the
12425 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
12426 only if we wind up in a string from display property. (Bug#11063)
12427
a6b1c7cc
EZ
12428 * window.c (Fdelete_other_windows_internal): Invalidate the row
12429 and column information about mouse highlight, so that redisplay
12430 restores it after reallocating the glyph matrices. (Bug#7464)
12431
8427ddd2
EZ
12432 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
12433 string comes from a `display' text property, use the buffer
12434 position of that property as if we actually saw that position in
12435 the row's glyphs.
697ba24b
EZ
12436 (move_it_by_lines): Remove the assertion that
12437 "it->current_x == 0 && it->hpos == 0" which can be legitimately
12438 violated when there's a before-string at the beginning of a line.
12439 (Bug#11063)
8427ddd2 12440
65a0a738
EZ
124412012-03-30 Eli Zaretskii <eliz@gnu.org>
12442
12443 * xdisp.c (append_space_for_newline): If the default face was
12444 remapped, use the remapped face for the appended newline.
12445 (extend_face_to_end_of_line): Use the remapped default face for
12446 extending the face to the end of the line.
12447 (display_line): Call extend_face_to_end_of_line when the default
12448 face was remapped. (Bug#11068)
12449
581355cc
EZ
124502012-03-29 Eli Zaretskii <eliz@gnu.org>
12451
12452 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
12453
e8fc049f
SM
124542012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12455
12456 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
12457
4fb9a543
GM
124582012-03-27 Glenn Morris <rgm@gnu.org>
12459
12460 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
12461 Doc fixes.
12462
679910f1
KH
124632012-03-26 Kenichi Handa <handa@m17n.org>
12464
12465 * dispextern.h (struct glyph): Fix previous change. Change the
12466 bit length of glyphless.ch to 25 (Bug#11082).
12467
90d49b7f
CY
124682012-03-26 Chong Yidong <cyd@gnu.org>
12469
12470 * keyboard.c (Vselection_inhibit_update_commands): New variable.
12471 (command_loop_1): Use it; inhibit selection update for
12472 handle-select-window too (Bug#8996).
12473
f514f6f0
FP
124742012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
12475
e8fc049f 12476 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 12477
bf43fa51
KH
124782012-03-25 Kenichi Handa <handa@m17n.org>
12479
12480 * dispextern.h (struct glyph): Change the bit length of
12481 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
12482
8a0c01dd
EZ
124832012-03-24 Eli Zaretskii <eliz@gnu.org>
12484
12485 * s/ms-w32.h (tzname): Include time.h before redirecting to
12486 _tzname. Fixes the MSVC build. (Bug#9960)
12487
7d1c3a76
AS
124882012-03-24 Andreas Schwab <schwab@linux-m68k.org>
12489
8ed79523
AS
12490 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
12491 characters.
12492
7d1c3a76
AS
12493 * xterm.c (XTread_socket): Only modify handling_signal if
12494 !SYNC_INPUT. (Bug#11080)
12495
e99a9b8b
EZ
124962012-03-23 Eli Zaretskii <eliz@gnu.org>
12497
12498 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
12499 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
12500 when fetching a multibyte character consumes more bytes than
12501 CHAR_BYTES returns, due to unification of CJK characters in
12502 string_char. (Bug#11073)
12503
5063c0e1
TN
125042012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
12505
12506 * process.c (wait_reading_process_output): Handle pty disconnect
12507 by refraining from sending oneself a SIGCHLD (bug#10933).
12508
9f851fbd
CY
125092012-03-22 Chong Yidong <cyd@gnu.org>
12510
12511 * dispextern.h (struct it): New member string_from_prefix_prop_p.
12512
5063c0e1 12513 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
12514 Mark string as coming from a prefix property.
12515 (handle_face_prop): Use default face for prefix strings (Bug#4281).
12516 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
12517
fb5b8aca
CY
125182012-03-21 Chong Yidong <cyd@gnu.org>
12519
12520 * xfaces.c (Vface_remapping_alist): Doc fix.
12521
62356a1b
EZ
125222012-03-20 Eli Zaretskii <eliz@gnu.org>
12523
12524 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
12525 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
12526 Doc fixes.
62356a1b 12527
025de85b
CY
125282012-03-20 Chong Yidong <cyd@gnu.org>
12529
12530 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
12531 to reflect default non-nil value of redisplay-dont-pause.
12532
4827f94e
KH
125332012-03-19 Kenichi Handa <handa@m17n.org>
12534
12535 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
12536 it fit in a valid range (Bug#11003).
12537
e50a24a2
EZ
125382012-03-18 Eli Zaretskii <eliz@gnu.org>
12539
12540 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
12541 that is not from display property, accept the row as a "cursor
12542 row" if one of the string's character has a non-nil `cursor'
12543 property. Fixes cursor positioning when there are newlines in
12544 overlay strings, e.g. in icomplete.el. (Bug#11035)
12545
9af5ed87
PE
125462012-03-12 Paul Eggert <eggert@cs.ucla.edu>
12547
12548 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
12549
d1f55f16
CY
125502012-03-12 Chong Yidong <cyd@gnu.org>
12551
12552 * eval.c (inhibit_lisp_code): Rename from
12553 inhibit_window_configuration_change_hook; move from window.c.
12554
12555 * xfns.c (unwind_create_frame_1, Fx_create_frame):
12556 * window.c (run_window_configuration_change_hook)
12557 (syms_of_window): Callers changed.
12558
66c5eebd
CY
125592012-03-11 Chong Yidong <cyd@gnu.org>
12560
413df973
CY
12561 * keymap.c (Fkey_description): Doc fix (Bug#9700).
12562
66c5eebd
CY
12563 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
12564
1de11f56
CY
125652012-03-10 Chong Yidong <cyd@gnu.org>
12566
12567 * frame.c (other_visible_frames): Don't assume the selected frame
12568 is visible (Bug#10955).
12569
cae07000
SM
125702012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
12571
12572 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
12573
89c94350
JD
125742012-03-08 Jan Djärv <jan.h.d@swipnet.se>
12575
12576 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
12577 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
12578 zero (Bug#10954).
12579
999dd333
GM
125802012-03-03 Glenn Morris <rgm@gnu.org>
12581
01a6dcc8 12582 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 12583
de0100f2
EZ
125842012-03-02 Eli Zaretskii <eliz@gnu.org>
12585
12586 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
12587 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
12588 (redisplay_window, next_element_from_string): Fix typos in
12589 comments.
3e441275
EZ
12590 (redisplay_window): Pass to move_it_vertically the margin in
12591 pixels, not in screen lines.
de0100f2 12592
96a72ee9
GM
125932012-03-02 Glenn Morris <rgm@gnu.org>
12594
12595 * buffer.c (buffer-list-update-hook): Doc fix.
12596
312508d7
EZ
125972012-02-29 Eli Zaretskii <eliz@gnu.org>
12598
12599 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
12600 push_it before setting up the iterator for the first overlay
12601 string, even if we have an empty string loaded.
12602 (next_overlay_string): If there's an empty string on the iterator
12603 stack, pop the stack. (Bug#10903)
12604
27f3c637
PE
126052012-02-25 Paul Eggert <eggert@cs.ucla.edu>
12606
12607 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
12608 Suggested by Stefan Monnier in
12609 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
12610 * alloc.c (widen_to_Lisp_Object): New static function.
12611 (mark_memory): Also mark Lisp_Objects by fetching pointer words
12612 and widening them to Lisp_Objects. This would work even if
12613 USE_LSB_TAG is defined and wide integers are used, which might
12614 happen in a future version of Emacs.
12615
3c9dfce6
CY
126162012-02-25 Chong Yidong <cyd@gnu.org>
12617
fa74b241
CY
12618 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
12619 Doc fix.
12620
3c9dfce6
CY
12621 * xselect.c (Fx_selection_exists_p): Doc fix.
12622 (x_clipboard_manager_save_all): Print an informative message
12623 before saving to clipboard manager.
12624
9486df08
CY
126252012-02-24 Chong Yidong <cyd@gnu.org>
12626
12627 * keyboard.c (process_special_events): Handle all X selection
12628 requests in kbd_buffer, not just the next one (Bug#8869).
12629
f01d3321
CY
126302012-02-23 Chong Yidong <cyd@gnu.org>
12631
12632 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
12633 call when setting menu-bar-lines and tool-bar-lines parameters.
12634 (unwind_create_frame_1): New helper function.
12635
12636 * window.c (inhibit_window_configuration_change_hook): New var.
12637 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 12638 (syms_of_window): Initialize it.
f01d3321 12639
86b847b6
CY
126402012-02-22 Chong Yidong <cyd@gnu.org>
12641
12642 * xterm.c (x_draw_image_relief): Add missing type check for
12643 Vtool_bar_button_margin (Bug#10743).
12644
a59225b1
CY
126452012-02-21 Chong Yidong <cyd@gnu.org>
12646
12647 * fileio.c (Vfile_name_handler_alist): Doc fix.
12648
12649 * buffer.c (Fget_file_buffer): Protect against invalid file
12650 handler return value.
12651
310f5bd4
PE
126522012-02-20 Paul Eggert <eggert@cs.ucla.edu>
12653
cb3a28cc
PE
12654 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
12655 when computing $valmask.
12656
310f5bd4
PE
12657 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
12658 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
12659 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
12660 It's useless in that case, and it can cause problems on hosts
12661 that allocate halves of EMACS_INT values separately.
12662 Reported by Dan Horák. Diagnosed by Andreas Schwab in
12663 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
12664 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
12665 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
12666 it avoids undefined behavior on hosts where shifting right by more
12667 than the word width has undefined behavior.
12668
2375c96a
CY
126692012-02-19 Chong Yidong <cyd@gnu.org>
12670
12671 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
12672 (Funhandled_file_name_directory, Ffile_name_as_directory)
12673 (Fdirectory_file_name, Fexpand_file_name)
12674 (Fsubstitute_in_file_name): Protect against invalid file handler
12675 return values (Bug#10845).
12676
3eb49e71
EZ
126772012-02-18 Eli Zaretskii <eliz@gnu.org>
12678
12679 * .gdbinit (pitx): Fix incorrect references to fields of the
12680 iterator stack.
12681
7b926f3f
CY
126822012-02-17 Chong Yidong <cyd@gnu.org>
12683
12684 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
12685
11273115
PE
126862012-02-15 Paul Eggert <eggert@cs.ucla.edu>
12687
12688 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
12689 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
12690
c3a70e2b
CY
126912012-02-15 Chong Yidong <cyd@gnu.org>
12692
12693 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
12694 marked as special. Also, starting docstrings with * is obsolete.
12695
0ca43699
AS
126962012-02-13 Andreas Schwab <schwab@linux-m68k.org>
12697
12698 * gnutls.c (emacs_gnutls_write): Fix last change.
12699
2e8f3c56
LI
127002012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
12701
12702 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
12703 send_process.
12704
af70074f
SM
127052012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
12706
12707 * keymap.c (Fsingle_key_description): Handle char ranges.
12708
95986d52
CY
127092012-02-12 Chong Yidong <cyd@gnu.org>
12710
afd83bd1
CY
12711 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
12712 as that creates a dangerous corner case.
12713
95986d52
CY
12714 * window.c (Fdelete_window_internal): Invalidate the mouse
12715 highlight (Bug#9904).
12716
bd7da63e
GM
127172012-02-12 Glenn Morris <rgm@gnu.org>
12718
12719 * xselect.c (Fx_own_selection_internal)
12720 (Fx_get_selection_internal, Fx_disown_selection_internal)
12721 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
12722 * nsselect.m (Fx_own_selection_internal)
12723 (Fx_disown_selection_internal, Fx_selection_exists_p)
12724 (Fx_selection_owner_p, Fx_get_selection_internal):
12725 Sync docs and argument specs with the xselect.c versions.
12726
77abcbc2
LI
127272012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
12728
12729 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
12730
90b671e2
EZ
127312012-02-11 Eli Zaretskii <eliz@gnu.org>
12732
1c0ca0b7
EZ
12733 * w32select.c (Fx_selection_exists_p): Sync doc string and
12734 argument list with xselect.c. (Bug#10783)
12735
12736 * w16select.c (Fx_selection_exists_p): Sync doc string and
12737 argument list with xselect.c. (Bug#10783)
90b671e2 12738
49241268
GM
127392012-02-10 Glenn Morris <rgm@gnu.org>
12740
12741 * fns.c (Fsecure_hash): Doc fix.
12742
f998bbe7 127432012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
12744
12745 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
12746
0992bd9c
CY
127472012-02-07 Chong Yidong <cyd@gnu.org>
12748
12749 * buffer.c (Fbuffer_local_variables)
12750 (buffer_lisp_local_variables): Handle unbound vars correctly;
12751 don't let Qunbound leak into Lisp.
12752
af008560
GM
127532012-02-07 Glenn Morris <rgm@gnu.org>
12754
dd605cc4
GM
12755 * image.c (Fimagemagick_types): Doc fix.
12756
af008560
GM
12757 * image.c (imagemagick-render-type): Change it from a lisp object
12758 to an integer. Move the doc here from the lisp manual.
12759 Treat all values not equal to 0 the same.
12760
1449fa1d
CY
127612012-02-06 Chong Yidong <cyd@gnu.org>
12762
12763 * doc.c (store_function_docstring): Avoid applying docstring of
12764 alias to base function (Bug#2603).
12765
3723ec07
AS
127662012-02-04 Andreas Schwab <schwab@linux-m68k.org>
12767
12768 * .gdbinit (pp1, pv1): Remove redundant defines.
12769 (pr): Use pp.
12770
79c1cc1e
CY
127712012-02-04 Chong Yidong <cyd@gnu.org>
12772
12773 * nsterm.m: Declare a global (Bug#10694).
12774
d7f29f8e
EZ
127752012-02-04 Eli Zaretskii <eliz@gnu.org>
12776
cae07000
SM
12777 * w32.c (get_emacs_configuration_options):
12778 Include --enable-checking, if specified, in the return value.
d7f29f8e 12779
3b95a6f9
MR
127802012-02-04 Martin Rudalics <rudalics@gmx.at>
12781
12782 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
12783 after rounding frame sizes. (Bug#9723)
12784
d6fa96a6
EZ
127852012-02-04 Eli Zaretskii <eliz@gnu.org>
12786
12787 * keyboard.c (adjust_point_for_property): Don't position point
12788 before BEGV. (Bug#10696)
12789
df0b2940
PE
127902012-02-03 Paul Eggert <eggert@cs.ucla.edu>
12791
12792 Handle overflow when computing char display width (Bug#9496).
12793 * character.c (char_width): Return EMACS_INT, not int.
12794 (char_width, c_string_width): Check for overflow when
12795 computing the width; this is possible now that individual
12796 characters can have unbounded width. Problem introduced
12797 by merge from Emacs 23 on 2012-01-19.
12798
6bee44d6
MA
127992012-02-02 Michael Albinus <michael.albinus@gmx.de>
12800
12801 * dbusbind.c (Fdbus_register_method): Mention the return value
12802 :ignore in the docstring.
12803
44f92739
GM
128042012-02-02 Glenn Morris <rgm@gnu.org>
12805
1b9f60cc
GM
12806 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
12807
44f92739
GM
12808 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12809 Unconditionally set to t. (Bug#10673)
12810 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12811 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
12812 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
12813
c5d3843c
KH
128142012-02-02 Kenichi Handa <handa@m17n.org>
12815
12816 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
12817 0, do not call append_composite_glyph.
12818
159462d4 128192012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
12820
12821 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
12822 NULL (Bug#6988).
12823 (x_produce_glyphs): If the component of a composition is a null
12824 string, set it->pixel_width to 1 to avoid zero-width glyph.
12825
78cef877
EZ
128262012-02-01 Eli Zaretskii <eliz@gnu.org>
12827
12828 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
12829 first 2 arguments are identical. This makes inserting large
12830 output from a subprocess an order of magnitude faster on
12831 MS-Windows, where all sbrk'ed memory is always contiguous.
12832
97897668
GM
128332012-01-31 Glenn Morris <rgm@gnu.org>
12834
12835 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 12836 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
12837 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
12838
31fd3586
GM
128392012-01-29 Glenn Morris <rgm@gnu.org>
12840
12841 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
12842
0e24a8b2
CY
128432012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
12844
12845 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
12846
cc0adcb0
CY
128472012-01-28 Chong Yidong <cyd@gnu.org>
12848
12849 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
12850
acc28cb9
CY
128512012-01-26 Chong Yidong <cyd@gnu.org>
12852
9c69cfb7
CY
12853 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
12854
acc28cb9
CY
12855 * search.c (Fsearch_forward, Fsearch_backward): Document negative
12856 repeat counts (Bug#10507).
12857
48da7392
GM
128582012-01-26 Glenn Morris <rgm@gnu.org>
12859
12860 * lread.c (syms_of_lread): Doc fix.
12861
14af5f7f
CY
128622012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
12863
12864 * coding.c (encode_designation_at_bol): Change return value to
12865 EMACS_INT.
12866
0b21c100
CY
128672012-01-25 Chong Yidong <cyd@gnu.org>
12868
12869 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
12870
3c2907f7
CY
128712012-01-21 Chong Yidong <cyd@gnu.org>
12872
12873 * floatfns.c (Fcopysign): Make the second argument non-optional,
12874 since nil is not allowed anyway.
12875
959ad23f
AS
128762012-01-21 Andreas Schwab <schwab@linux-m68k.org>
12877
12878 * process.c (read_process_output): Use p instead of XPROCESS (proc).
12879 (send_process): Likewise.
12880
34a02f46
MR
128812012-01-19 Martin Rudalics <rudalics@gmx.at>
12882
12883 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
12884 (Vwindow_persistent_parameters): Do not use Qstate.
12885 Rewrite doc-strings.
34a02f46 12886
1259009a 128872012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
12888
12889 * character.c (char_width): New function.
70d4fdf6
GM
12890 (Fchar_width, c_string_width, lisp_string_width):
12891 Use char_width (Bug#9496).
25ed9e61 12892
6a6ee00d
MR
128932012-01-16 Martin Rudalics <rudalics@gmx.at>
12894
12895 * window.c (Vwindow_persistent_parameters): New variable.
12896 (Fset_window_configuration, save_window_save): Handle persistent
12897 window parameters.
12898
c85efaf7
EZ
128992012-01-14 Eli Zaretskii <eliz@gnu.org>
12900
12901 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
12902 thrashing the stack of the thread. (Bug#9087)
12903
5944709e
PE
129042012-01-12 Paul Eggert <eggert@cs.ucla.edu>
12905
12906 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
12907
e71f5d99
EZ
129082012-01-11 Eli Zaretskii <eliz@gnu.org>
12909
12910 * xdisp.c (rows_from_pos_range): Handle the case where the
12911 highlight ends on a newline. (Bug#10464)
12912 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
12913 he end column for display of highlight that ends on a newline
12914 before a R2L line.
12915
ce316182
GM
129162012-01-11 Glenn Morris <rgm@gnu.org>
12917
12918 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
12919 from load-path also when installation-directory is nil. (Bug#10208)
12920
5b43da69
GM
129212012-01-10 Glenn Morris <rgm@gnu.org>
12922
74cc8ff9
GM
12923 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
12924
7d8d6e4e
GM
12925 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
12926 Update template values to be closer to their typical values these days.
5b43da69 12927
a0db8d43
EZ
129282012-01-09 Eli Zaretskii <eliz@gnu.org>
12929
12930 * xdisp.c (rows_from_pos_range): Accept additional argument
12931 DISP_STRING, and accept any glyph in a row whose object is that
12932 string as eligible for mouse highlight. Fixes mouse highlight of
12933 display strings from overlays. (Bug#10464)
12934
9a0115ab 129352012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 12936
b9110d6a 12937 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
12938 * fileio.c (auto_saving_dir_umask): New static var.
12939 (Fmake_directory_internal): Use it.
12940 (do_auto_save_make_dir): Set it, instead of invoking chmod after
12941 creating the directory. The old code temporarily assigns
12942 too-generous permissions to the directory.
12943 (do_auto_save_eh): Clear it.
b9110d6a 12944 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
12945 that the var is always cleared.
12946
6c1bd3f3
EZ
129472012-01-07 Eli Zaretskii <eliz@gnu.org>
12948
12949 * search.c (scan_buffer): Pass character positions to
12950 know_region_cache, not byte positions. (Bug#6540)
12951
069d2b50
L
129522012-01-07 LynX <_LynX@bk.ru> (tiny change)
12953
12954 * w32.c (sys_rename): Report EXDEV when rename of a directory
12955 fails because the target is on another logical disk. (Bug#10284)
12956
75bf0d33
DB
129572012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
12958
12959 * xterm.c (x_embed_request_focus): New function.
12960
12961 * xterm.h: Add prototype.
12962
12963 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
12964
1c6e5a32
GM
129652012-01-05 Glenn Morris <rgm@gnu.org>
12966
12967 * emacs.c (emacs_copyright): Update short copyright year to 2012.
12968
651e947e
EZ
129692012-01-01 Eli Zaretskii <eliz@gnu.org>
12970
12971 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
12972 Load gnutls_transport_set_lowat only if GnuTLS version is below
12973 2.11.1.
12974 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
12975 GnuTLS versions below 2.11.1.
12976
3778cdd8
AL
129772011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
12978
12979 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
12980 to the doc string advising against its use for altering the way
12981 windows are scrolled.
12982
0e5317f7
KH
129832011-12-28 Kenichi Handa <handa@m17n.org>
12984
12985 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
12986 coding-system ASCII compatible only when it does not produce BOM
12987 on encoding (Bug#10383).
12988
93d5ca1f
JD
129892011-12-26 Jan Djärv <jan.h.d@swipnet.se>
12990
12991 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
12992 can scroll.
12993 (create_and_show_popup_menu): Always use menu_position_func for
12994 Gtk3 (Bug#10361).
12995
ca22b785
AS
129962011-12-24 Andreas Schwab <schwab@linux-m68k.org>
12997
12998 * callint.c (Fcall_interactively): Don't truncate prompt string.
12999
d048e1e6
EZ
130002011-12-23 Eli Zaretskii <eliz@gnu.org>
13001
13002 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13003 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 13004 resumed from there (after widening). (Bug#10360)
d048e1e6 13005
5ccaba1f
JD
130062011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13007
13008 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13009
204ee57f
JD
130102011-12-21 Jan Djärv <jan.h.d@swipnet.se>
13011
b81d40f0
JB
13012 * nsterm.m (x_free_frame_resources):
13013 Release f->output_data.ns->miniimage.
204ee57f
JD
13014 (ns_index_color): Fix indentation. Do not retain
13015 color_table->colors[i].
13016
13017 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
13018 before returning.
13019
13020 * nsfns.m (x_set_background_color): Assign return value from
13021 ns_index_color to face-background instead of NSColor*.
13022 (ns_implicitly_set_icon_type): Fix indentation.
13023 Change assignment in for loop to comparison.
13024
13025 * emacs.c (ns_pool): New variable.
13026 (main): Assign ns_pool.
13027 (Fkill_emacs): Call ns_release_autorelease_pool.
13028
13029 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
13030 autorelease fdesc, release fdAttrs and tdict.
13031 (ns_get_covering_families): Release charset.
13032 (ns_findfonts): Release NSFontDescriptor created with new.
13033 (ns_uni_to_glyphs): Fix indentation.
13034 (setString): Release attrStr before assigning new value.
13035
c803b2b7
JD
130362011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13037
678f4426
JD
13038 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
13039 and NS_IMPL_COCOA.
13040 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
13041 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
13042
cd394be1 130432011-12-18 David Reitter <reitter@cmu.edu>
678f4426 13044
5fecd5fc
JD
13045 * nsterm.m (ns_term_init): Subscribe for notifications
13046 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
13047 to method trackingNotification in EmacsMenu.
13048
13049 * nsmenu.m (trackingMenu): New variable.
3771cb17 13050 (trackingNotification): New method (from Aquamacs).
5fecd5fc 13051 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 13052 from Aquamacs (Bug#7030).
678f4426
JD
13053
130542011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 13055
c803b2b7
JD
13056 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
13057 (symbol_to_nsstring): Fix indentation.
13058 (ns_symbol_to_pb): New function.
cae07000
SM
13059 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
13060 (Fns_rotate_cut_buffers_internal): Remove.
13061 (Fns_store_selection_internal): Rename from
c803b2b7
JD
13062 Fns_store_cut_buffer_internal.
13063 (ns_get_foreign_selection, Fx_own_selection_internal)
13064 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
13065 (Fns_get_selection_internal, Fns_store_selection_internal):
13066 Use ns_symbol_to_pb and check if return value is nil.
13067 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
13068 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
13069 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
13070 renamed to Sns_store_selection_internal.
13071 (ns_handle_selection_request): Move code to Fx_own_selection_internal
13072 and remove this function.
13073 (ns_handle_selection_clear): Remove, never used.
13074 (Fx_own_selection_internal): Move code from ns_handle_selection_request
13075 here.
13076
e1b01a3a
KB
130772011-12-17 Ken Brown <kbrown@cornell.edu>
13078
13079 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
13080 GID is unknown (Bug#10257).
13081
2adb6e85
PE
130822011-12-17 Paul Eggert <eggert@cs.ucla.edu>
13083
13084 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
13085 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
13086 which caused a build failure on GNU/Linux IA-64. This problem was
13087 introduced by my 2011-10-07 patch.
13088
d1d7b339
JL
130892011-12-15 Juri Linkov <juri@jurta.org>
13090
13091 * image.c (imagemagick_error): New function. (Bug#10112)
13092 (imagemagick_load_image): Comment out `MagickSetResolution' call.
13093 Use `imagemagick_error' where ImageMagick functions return
13094 `MagickFalse'.
13095 (Fimagemagick_types): Add `Fnreverse' to return the list in the
13096 proper order.
13097
100d5755
KH
130982011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13099
13100 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
13101 fill background (Bug#8992).
13102
454592a6
MR
131032011-12-13 Martin Rudalics <rudalics@gmx.at>
13104
13105 * window.c (Vwindow_combination_resize)
13106 (Vwindow_combination_limit): Use t instead of non-nil in
13107 doc-strings.
61d4b438
MR
13108 (Vrecenter_redisplay): Add first sentence of doc-string on
13109 separate line.
53524d93 13110 (Frecenter): Fix doc-string typo.
454592a6 13111
3633e3aa
KH
131122011-12-11 Kenichi Handa <handa@m17n.org>
13113
13114 * coding.c (Funencodable_char_position): Pay attention to the
13115 buffer text relocation (Bug#9389).
13116
7b9d523a 131172011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 13118
7b9d523a
JD
13119 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
13120 gtk_init (Bug#10100).
13121
b73189c6
EZ
131222011-12-10 Eli Zaretskii <eliz@gnu.org>
13123
13124 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
13125 IT->string is nil. (Bug#10263)
13126
f7dfe5d6
JD
131272011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13128
83faebb4
JD
13129 * nsterm.h (x_free_frame_resources): Declare.
13130
f7dfe5d6
JD
13131 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
13132 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
13133
13134 * nsterm.h (ns_get_defaults_value): Declare.
13135
13136 * nsterm.m (ns_default): Call ns_get_defaults_value.
13137
7cd4e72c
EZ
131382011-12-09 Eli Zaretskii <eliz@gnu.org>
13139
13140 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
13141 (Bug#10170)
13142
b34d7317
YM
131432011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13144
13145 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
13146 that where the value of an _OBJC_* symbol points to is in the .bss
13147 section (Bug#10240).
13148
76470ad1
KH
131492011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13150
13151 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 13152 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 13153
745fff94
KH
131542011-12-08 Kenichi Handa <handa@m17n.org>
13155
13156 * ftfont.c (get_adstyle_property): Fix previous change
13157 (Bug#10233).
13158
6e44397c
JB
131592011-12-07 Juanma Barranquero <lekktu@gmail.com>
13160
13161 * w32.c (init_environment): If no_site_lisp, remove site-lisp
13162 dirs from the default value of EMACSLOADPATH (bug#10208).
13163
7efa6272
GM
131642011-12-07 Glenn Morris <rgm@gnu.org>
13165
13166 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
13167 installation and source directories as well. (Bug#10208)
13168
f6fc4d87
CY
131692011-12-06 Chong Yidong <cyd@gnu.org>
13170
13171 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
13172
2bf26180
GM
131732011-12-06 Glenn Morris <rgm@gnu.org>
13174
13175 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
13176 as an error, not just -1. (Bug#10217)
13177
3a6ad4f0
CY
131782011-12-05 Chong Yidong <cyd@gnu.org>
13179
13180 * keyboard.c (process_special_events): New function.
13181 (swallow_events, Finput_pending_p): Use it (Bug#10195).
13182
75a3b399
PE
131832011-12-05 Paul Eggert <eggert@cs.ucla.edu>
13184
13185 * coding.c (encode_designation_at_bol): Don't use uninitialized
13186 local variable (Bug#9318).
13187
c3c9e25e
KH
131882011-12-05 Kenichi Handa <handa@m17n.org>
13189
13190 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
13191 return Qnil (Bug#8046, Bug#10193).
13192
5eb05ea3
KH
131932011-12-05 Kenichi Handa <handa@m17n.org>
13194
13195 * coding.c (encode_designation_at_bol): New args charbuf_end and
13196 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
13197 (coding_set_source): Return how many bytes coding->source was
13198 relocated.
13199 (coding_set_destination): Return how many bytes
13200 coding->destination was relocated.
13201 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 13202 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
13203
132042011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13205
13206 * coding.c (CODING_CHAR_CHARSET_P): New macro.
13207 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
13208 macro (Bug#9318).
13209
132102011-12-05 Andreas Schwab <schwab@linux-m68k.org>
13211
13212 The following changes are to fix Bug#9318.
13213
a79703f5 13214 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
13215 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
13216 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 13217 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 13218
7dbda6df
JB
132192011-12-05 Juanma Barranquero <lekktu@gmail.com>
13220
13221 * lisp.h (process_quit_flag): Fix external declaration.
13222
6d5eb5b0
SM
132232011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
13224
13225 Don't macro-inline non-performance-critical code.
13226 * eval.c (process_quit_flag): New function.
13227 * lisp.h (QUIT): Use it.
13228
a0c3fad0
JD
132292011-12-04 Jan Djärv <jan.h.d@swipnet.se>
13230
13231 * nsfns.m (get_geometry_from_preferences): New function.
13232 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
13233
6c07aac2
AS
132342011-12-04 Andreas Schwab <schwab@linux-m68k.org>
13235
13236 * emacs.c (Qkill_emacs): Define.
13237 (syms_of_emacs): Initialize it.
13238 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
13239 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
13240 (quit_throw_to_read_char): Add parameter `from_signal'.
13241 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
13242 * lisp.h (QUIT): Call Fkill_emacs if requested.
13243
c052ead4
JD
132442011-12-03 Jan Djärv <jan.h.d@swipnet.se>
13245
13246 * widget.c (update_wm_hints): Return if wmshell is null.
13247 (widget_update_wm_size_hints): New function.
13248
13249 * widget.h (widget_update_wm_size_hints): Declare.
13250
13251 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
13252 widget_update_wm_size_hints (Bug#10104).
13253
9e49252b
EZ
132542011-12-03 Eli Zaretskii <eliz@gnu.org>
13255
13256 * xdisp.c (handle_invisible_prop): If the invisible text ends just
13257 before a newline, prepare the bidi iterator for consuming the
13258 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 13259 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 13260
02b16839
JL
132612011-12-02 Juri Linkov <juri@jurta.org>
13262
13263 * search.c (Fword_search_regexp): New Lisp function created from
13264 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
13265 (Fword_search_backward, Fword_search_forward)
13266 (Fword_search_backward_lax, Fword_search_forward_lax):
13267 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
13268 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
13269
0068070e
SM
132702011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
13271
13272 * fileio.c (Finsert_file_contents): Move after-change-function call
13273 to before the "handled:" label, since all "goto handled" appear in
13274 cases where the *-change-functions have already been properly called
13275 (bug#10117).
13276
3360a3fc
AS
132772011-12-01 Andreas Schwab <schwab@linux-m68k.org>
13278
13279 * keyboard.c (interrupt_signal): Don't call kill-emacs when
13280 waiting for input. (Bug#10169)
13281
73d6c093
EZ
132822011-11-30 Eli Zaretskii <eliz@gnu.org>
13283
13284 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
13285 verifies glyph row's hash code--we have just reallocated the
13286 glyphs, so their contents can be complete garbage. (Bug#10164)
13287
febe6bea
JB
132882011-11-30 Juanma Barranquero <lekktu@gmail.com>
13289
13290 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
13291
801a4313
EZ
132922011-11-30 Eli Zaretskii <eliz@gnu.org>
13293
13294 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
13295 attributes are tested _before_ calling verify_row_hash, to protect
13296 against GCC re-ordering of the tests. (Bug#10164)
13297
2b56b87e
JD
132982011-11-29 Jan Djärv <jan.h.d@swipnet.se>
13299
13300 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
13301
13302 * xterm.c (handle_one_xevent): Only set async_visible and friends
13303 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 13304 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
13305 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
13306
dbf31225
PE
133072011-11-28 Paul Eggert <eggert@cs.ucla.edu>
13308
13309 Remove GCPRO-related macros that exist only to avoid shadowing locals.
13310 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
13311 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
13312 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13313 All uses changed to use GCPRO1 etc.
13314 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
13315 Revert to old implementation (i.e., before 2011-03-11).
13316
1305621b
YM
133172011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13318
13319 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
13320 of scroll runs so as to avoid assigning disabled bogus rows and
13321 unnecessary graphics copy operations.
13322
8c9afb46
EZ
133232011-11-27 Eli Zaretskii <eliz@gnu.org>
13324
13325 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
13326 (snprintf) [_MSC_VER]: Redirect to _snprintf.
13327 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
13328 (malloc, free, realloc, calloc): Redirect to e_* only when
13329 compiling Emacs.
13330
13331 * lisp.h (GCTYPEBITS): Move before first use.
13332 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
13333 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
13334 this macro definition.
13335
13336 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
13337 _MSC_VER.
13338
54e9e3bf
JD
133392011-11-27 Jan Djärv <jan.h.d@swipnet.se>
13340
6d5eb5b0
SM
13341 * gtkutil.c (xg_create_frame_widgets):
13342 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
13343 present with Gtk+ 2.0.
13344
83aca1cb
PE
133452011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13346
13347 * fileio.c (Finsert_file_contents): Undo previous change; see
13348 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13349
5b76caa4
PE
133502011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13351
13352 Rename locals to avoid shadowing.
13353 * fileio.c (Finsert_file_contents):
13354 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
13355 * process.c (wait_reading_process_output):
13356 Rename inner 'proc' to 'p' to avoid shadowing.
13357 Indent for consistency with usual Emacs style.
13358
8c535114
EZ
133592011-11-25 Eli Zaretskii <eliz@gnu.org>
13360
13361 * xdisp.c (redisplay_window): If cursor row is not fully visible
13362 after recentering, and scroll-conservatively is set to a large
13363 number, scroll window by a few more lines to make the cursor fully
13364 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
13365 (start_display): Don't move to the next line if the display should
13366 start at a newline that is part of a display vector or an overlay
13367 string. (Bug#10119)
8c535114 13368
fa4fdb5c
JL
133692011-11-24 Juri Linkov <juri@jurta.org>
13370
13371 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
13372 after the `MagickPingImage' call. (Bug#10112)
13373
90ec88df
CY
133742011-11-23 Chong Yidong <cyd@gnu.org>
13375
13376 * window.c (Fcoordinates_in_window_p): Accept only live windows.
13377
56e2e794
MR
133782011-11-23 Martin Rudalics <rudalics@gmx.at>
13379
13380 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
13381 making another buffer current. (Bug#10114)
13382
b6e64c41
GM
133832011-11-23 Glenn Morris <rgm@gnu.org>
13384
13385 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
13386
6b21de18
CY
133872011-11-23 Chong Yidong <cyd@gnu.org>
13388
13389 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
13390 using it (Bug#5984).
13391
b12cd789
EZ
133922011-11-22 Eli Zaretskii <eliz@gnu.org>
13393
13394 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
13395 and header-lines, as they don't have one computed for them.
13396 (Bug#10098)
13397
13398 * .gdbinit (prow): Make displayed values more self-explaining.
13399 Add row's hash code.
13400
261b6fd4
LMI
134012011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
13402
13403 * process.c (wait_reading_process_output): Fix asynchrounous
13404 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 13405 (wait_reading_process_output): Add comment and URL.
261b6fd4 13406
e7cfd277
JD
134072011-11-21 Jan Djärv <jan.h.d@swipnet.se>
13408
13409 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
13410
a9b9b7f5
CY
134112011-11-21 Chong Yidong <cyd@gnu.org>
13412
13413 * window.c (Fnext_window, Fprevious_window): Doc fix.
13414
b0d15b4f
SM
134152011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13416
13417 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
13418
fe7a3057
JB
134192011-11-20 Juanma Barranquero <lekktu@gmail.com>
13420
13421 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
13422
d2999b1a
MR
134232011-11-20 Martin Rudalics <rudalics@gmx.at>
13424
13425 * window.c (Fset_window_combination_limit): Rename argument
13426 STATUS to LIMIT.
13427 (Vwindow_combination_limit): Remove "status" from doc-string.
13428
d5ff9cd0
AS
134292011-11-20 Andreas Schwab <schwab@linux-m68k.org>
13430
13431 * m/ibms390.h: Remove.
13432 * m/ibms390x.h: Don't include "ibms390.h".
13433
a5bb9bd3
SM
134342011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13435
13436 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
13437 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
13438
cd1181db
JB
134392011-11-20 Juanma Barranquero <lekktu@gmail.com>
13440
13441 * casetab.c (Fset_case_table):
13442 * charset.c (Fcharset_after): Fix typos.
13443
615a3b8d 134442011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 13445
17e845af
PE
13446 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
13447 Otherwise, valgrind does not work on some platforms.
13448 Problem reported by Andreas Schwab in
6a0bf43d
PE
13449 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
13450 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
13451 is set, removing the need for VIRT_ADDRESS_VARIES.
13452 (PURE_P): Use a more-efficient implementation that needs just one
13453 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
13454 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
13455 to 4 (xorl, subq, cmpq, setbe).
13456 * alloc.c (pure): Always extern now, since that's the
13457 VIRT_ADDR_VARIES behavior.
13458 (PURE_POINTER_P): Use a single comparison, not two, for
13459 consistency with the new puresize.h.
13460 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
13461 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
13462 Remove VIRT_ADDR_VARIES no longer needed.
13463
f8fe6f96
EZ
134642011-11-19 Eli Zaretskii <eliz@gnu.org>
13465
13466 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
13467 (erase_phys_cursor, update_window_cursor, show_mouse_face)
13468 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
13469 behave as if the cursor position were at the window margin.
13470
13471 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
13472 and the cursor position is out of bounds, behave as if the cursor
13473 position were at the window margin. (Bug#10075)
13474
df05a53c
CY
134752011-11-18 Chong Yidong <cyd@gnu.org>
13476
13477 * window.c (Fwindow_combination_limit): Make first argument
13478 non-optional, since it is meaningless for live windows like the
13479 selected window.
61ccba97 13480
2071918e
DA
134812011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
13482
13483 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
13484
b50a28de
SM
134852011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
13486
13487 * intervals.c: Fix grafting over the whole buffer (bug#10071).
13488 (graft_intervals_into_buffer): Simplify.
13489
015137db
EZ
134902011-11-18 Eli Zaretskii <eliz@gnu.org>
13491
13492 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
13493 hash values of the two rows.
13494 (copy_row_except_pointers): Preserve the used[] arrays and the
13495 hash values of the two rows. (Bug#10035)
68c95424 13496 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
13497
13498 * xdisp.c (row_hash): New function, body extracted from
13499 compute_line_metrics.
13500 (compute_line_metrics): Call row_hash, instead of computing the
13501 hash code inline.
13502
13503 * dispnew.c (verify_row_hash): Call row_hash for computing the
13504 hash code of a row, instead of duplicating code from xdisp.c.
13505
13506 * dispextern.h (row_hash): Add prototype.
13507
a2addb04
TH
135082011-11-18 Tassilo Horn <tassilo@member.fsf.org>
13509
13510 * frame.c (delete_frame): Don't delete the terminal when the last
13511 X frame is closed if emacs is built with GTK toolkit.
13512
df85d315
JB
135132011-11-17 Juanma Barranquero <lekktu@gmail.com>
13514
13515 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
13516
a0c2d0ae
MR
135172011-11-17 Martin Rudalics <rudalics@gmx.at>
13518
13519 * window.c (Vwindow_splits): Rename to
13520 Vwindow_combination_resize. Suggested by Juri Linkov.
13521 (Fsplit_window_internal): Use Vwindow_combination_resize instead
13522 of Vwindow_splits.
13523
58179cce
JB
135242011-11-16 Juanma Barranquero <lekktu@gmail.com>
13525
7877f373
JB
13526 * nsfns.m (Fns_font_name):
13527 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 13528
b6f67890
MR
135292011-11-16 Martin Rudalics <rudalics@gmx.at>
13530
13531 * window.h (window): Rename slot "nest" to "combination_limit".
13532 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
13533 (Fset_window_nest): Rename to Fset_window_combination_limit.
13534 (Vwindow_nest): Rename to Vwindow_combination_limit.
13535 (recombine_windows, make_parent_window, make_window)
13536 (Fsplit_window_internal, saved_window)
13537 (Fset_window_configuration, save_window_save): Rename all
13538 occurrences of window_nest to window_combination_limit.
13539
c7015153
JB
135402011-11-15 Juanma Barranquero <lekktu@gmail.com>
13541
13542 * image.c (imagemagick_load_image): Fix typo.
13543
322ad6ec
EZ
135442011-11-14 Eli Zaretskii <eliz@gnu.org>
13545
13546 * xdisp.c (display_line): Move the call to
13547 highlight_trailing_whitespace before the call to
13548 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
13549 faces of all the glyphs to compute ROW's hash value.
13550 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 13551
f067b8ec
JB
135522011-11-14 Juanma Barranquero <lekktu@gmail.com>
13553
13554 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
13555 just return (bug#10044).
13556
1e5b2111
EZ
135572011-11-12 Eli Zaretskii <eliz@gnu.org>
13558
7ef3cbd5
EZ
13559 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
13560 with user-defined heap size. Bump the default size of the temacs
13561 heap to 27MB, to avoid memory warning when running temacs.
13562 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
13563
1e5b2111
EZ
13564 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
13565 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
13566 (verify_row_hash) [XASSERTS]: New function.
13567 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
13568 that the hash value of glyph rows is correct.
1e5b2111 13569
89d61221
MR
135702011-11-12 Martin Rudalics <rudalics@gmx.at>
13571
13572 * window.h (window): Remove splits slot.
13573 * window.c (Fwindow_splits, Fset_window_splits): Remove.
13574 (Fdelete_other_windows_internal, make_parent_window)
13575 (make_window, Fsplit_window_internal, Fdelete_window_internal)
13576 (Fset_window_configuration, save_window_save): Don't deal with
13577 split status of windows.
13578 (saved_window): Remove splits slot.
13579 (Vwindow_splits): Rewrite doc-string.
13580
97f18cc8
JD
135812011-11-11 Jan Djärv <jan.h.d@swipnet.se>
13582
13583 * xfns.c (unwind_create_frame):
13584 * nsfns.m (unwind_create_frame):
13585 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
13586 Vframe_list (Bug#9999).
13587
22a648b4
DA
135882011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
13589
0b381c7e 13590 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 13591
659afede
KH
135922011-11-11 Kenichi Handa <handa@m17n.org>
13593
13594 * callproc.c (Fcall_process): Set the member dst_multibyte of
13595 process_coding.
13596
9ac0394b
KH
135972011-11-11 Johan Bockgård <bojohan@gnu.org>
13598
13599 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
13600 avoid a crash (bug#9496).
13601
2fbdc249
CY
136022011-11-09 Chong Yidong <cyd@gnu.org>
13603
13604 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
13605 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
13606
ac6b1f81
PE
136072011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13608
13609 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
13610
09db192c
PE
136112011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13612
13613 Avoid some portability problems by eschewing 'extern inline' functions.
13614 The trivial performance wins aren't worth the portability hassles; see
13615 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
13616 et seq.
13617 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13618 (window_box_width, window_box_left, window_box_left_offset)
13619 (window_box_right, window_box_right_offset): Undo previous change,
13620 by removing the "extern"s.
13621 * intervals.c (adjust_intervals_for_insertion)
13622 (adjust_intervals_for_deletion): Undo previous change,
13623 making these static again.
13624 (offset_intervals, temp_set_point_both, temp_set_point)
13625 (copy_intervals_to_string): No longer inline.
13626 * xdisp.c (window_text_bottom_y, window_box_width)
13627 (window_box_height, window_box_left_offset)
13628 (window_box_right_offset, window_box_left, window_box_right)
13629 (window_box): No longer inline.
13630
105216ed
CY
136312011-11-08 Chong Yidong <cyd@gnu.org>
13632
13633 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
13634 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
13635 Signal an error if not a live window.
105216ed
CY
13636 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
13637 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
13638
ae9e237f
JB
136392011-11-07 Juanma Barranquero <lekktu@gmail.com>
13640
13641 * lisp.h (syms_of_abbrev): Remove declaration.
13642 Reported by CHENG Gao <chenggao@royau.me>.
13643
c7aa8333
EZ
136442011-11-07 Eli Zaretskii <eliz@gnu.org>
13645
13646 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
13647 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
13648 of temacs in GUI mode.
13649
be7f5545
MR
136502011-11-07 Martin Rudalics <rudalics@gmx.at>
13651
13652 * window.h: Declare delete_all_child_windows instead of
13653 delete_all_subwindows.
13654 * window.c (Fwindow_nest, Fset_window_nest)
13655 (Fset_window_new_total, Fset_window_new_normal)
13656 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
13657 (delete_all_subwindows): Rename to delete_all_child_windows.
13658 (Fdelete_other_windows_internal, Fset_window_configuration):
13659 Call delete_all_child_windows instead of delete_all_subwindows.
13660 * frame.c (delete_frame): Call delete_all_child_windows instead
13661 of delete_all_subwindows.
13662
ca78dc43
PE
136632011-11-07 Paul Eggert <eggert@cs.ucla.edu>
13664
13665 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
13666 This is also needed for porting to any host where GC_MARK_STACK is
13667 not GC_MAKE_GCPROS_NOOPS.
13668 (which_symbols): Use it.
13669
a0241d01
KH
136702011-11-07 Kenichi Handa <handa@m17n.org>
13671
13672 * coding.c (coding_set_destination): Check coding->src_pos only
13673 when coding->src_object is a buffer (bug#9910).
13674
13675 * process.c (send_process): Set the member src_multibyte of coding
13676 to 0 (bug#9911) when sending a unibyte text.
13677
13678 * callproc.c (Fcall_process): Set the member src_multibyte of
13679 process_coding to 0 (bug#9912).
13680
a64bfdfa 136812011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
13682
13683 * xmenu.c (cleanup_widget_value_tree): New function.
13684 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
13685 calling free_menubar_widget_value_tree directly (Bug#9830).
13686
cb41b32a
PE
136872011-11-06 Paul Eggert <eggert@cs.ucla.edu>
13688
13689 Fix some portability problems with 'inline'.
13690 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13691 (window_box_width, window_box_left, window_box_left_offset)
13692 (window_box_right, window_box_right_offset): Declare extern.
13693 Otherwise, these inline functions do not conform to C99 and
13694 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
13695 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
13696 * intervals.c (adjust_intervals_for_insertion)
13697 (adjust_intervals_for_deletion): Now extern, because otherwise the
13698 extern inline functions 'offset_intervals' couldn't refer to it.
13699 (static_offset_intervals): Remove.
13700 (offset_intervals): Rewrite using the old contents of
13701 static_offset_intervals. The old version didn't conform to C99
13702 because an extern inline function contained a reference to an
13703 identifier with static linkage.
13704
b7041366
AS
137052011-11-06 Andreas Schwab <schwab@linux-m68k.org>
13706
13707 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
13708 GC.
13709
88a37c4d
EZ
137102011-11-06 Eli Zaretskii <eliz@gnu.org>
13711
13712 * xdisp.c (init_iterator, reseat_to_string): Don't set the
13713 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
13714 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
13715 return Qleft_to_right.
13716
49745b39
CY
137172011-11-06 Chong Yidong <cyd@gnu.org>
13718
13719 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
13720 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
13721 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
13722 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
13723 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
13724 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
13725 (Fwindow_vscroll): Doc fix.
13726 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
13727 argument, since it makes no sense to pass a live window and for
13728 consistency with window-child.
13729
1f05cd82
CS
137302011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
13731
13732 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
13733 support MSVC.
13734
22610910
JR
137352011-11-05 Jason Rumney <jasonr@gnu.org>
13736
13737 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
13738 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
13739 fonts (Bug#6029).
13740 (add_font_entity_to_list): Fix logic errors in mixed boolean and
13741 bitwise arithmetic preventing use of unicode-sip and non-truetype
13742 opentype fonts.
13743
a06776b2
EZ
137442011-11-05 Eli Zaretskii <eliz@gnu.org>
13745
3ad924ba
EZ
13746 * s/ms-w32.h (fstat, stat, utime): Move redirections to
13747 "emacs"-only part.
13748
a06776b2
EZ
13749 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
13750 initialization code to keep similarity to xfns.c after changes
13751 from 2011-11-05.
13752
c9e7db78
JD
137532011-11-05 Jan Djärv <jan.h.d@swipnet.se>
13754
a97f8f3f
JD
13755 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
13756 (unwind_create_frame): New function (Bug#9943).
13757 (Fx_create_frame): Restructure code to be more similar to the one in
13758 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
13759 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
13760 Move terminal->reference_count++ just before making the frame official
13761 (Bug#9943).
13762
13763 * nsterm.m (x_free_frame_resources): New function.
13764 (x_destroy_window): Move code to x_free_frame_resources.
13765
c9e7db78 13766 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
13767 (Fx_create_frame, x_create_tip_frame):
13768 Move terminal->reference_count++ just before making the frame
75f1671a 13769 official. Move initialization of image_cache_refcount and
c9e7db78
JD
13770 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
13771
a6fc3b5c
EZ
137722011-11-05 Eli Zaretskii <eliz@gnu.org>
13773
13774 Support MSVC build with newer versions of Visual Studio.
13775 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
13776 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
13777 nt/gmake.defs.
13778
13779 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
13780 which are not supported by MSVC.
13781 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
13782 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
13783 bitfields.
13784 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
13785 types in bitfields.
13786 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
13787
13788 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
13789
58179cce 137902011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
13791
13792 Support MSVC build with newer versions of Visual Studio.
13793 * w32.c: Don't include w32api.h for MSVC.
13794 (init_environment) [_MSC_VER]: Call sys_access, not _access.
13795
13796 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
13797 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
13798 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
13799 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
13800 e_* cousins.
13801 (alloca) [_MSC_VER]: Define to _alloca.
13802
13803 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
13804
13805 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
13806
a58c13ed
EZ
138072011-11-04 Eli Zaretskii <eliz@gnu.org>
13808
13809 * xdisp.c (note_mouse_highlight): If either of
13810 previous/next-single-property-change returns nil, treat that as
13811 the beginning or the end of the buffer. (Bug#9955)
13812
fe0b6370
JD
138132011-11-04 Jan Djärv <jan.h.d@swipnet.se>
13814
a58c13ed 13815 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
13816 label is not null (Bug#9951).
13817 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
13818 may be NULL.
13819
89bd5ee1
EZ
138202011-11-04 Eli Zaretskii <eliz@gnu.org>
13821
13822 * window.c (Fwindow_body_size): Mention in the doc string that the
13823 return value is in frame's canonical units. (Bug#9949)
13824
84c3edb9
EZ
138252011-11-03 Eli Zaretskii <eliz@gnu.org>
13826
4e2fb5c7
EZ
13827 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
13828
84c3edb9 13829 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 13830 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 13831 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 13832
bc17a887
EZ
138332011-11-01 Eli Zaretskii <eliz@gnu.org>
13834
13835 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
13836 Don't stop backward scan on the continuation glyph, even though
13837 its CHARPOS is positive.
6d5eb5b0
SM
13838 (mouse_face_from_buffer_pos, note_mouse_highlight):
13839 Rename cover_string to disp_string.
bc17a887 13840
4ee88440
MR
138412011-11-01 Martin Rudalics <rudalics@gmx.at>
13842
13843 * window.c (temp_output_buffer_show): Don't use
13844 Vtemp_buffer_show_specifiers.
13845 (Vtemp_buffer_show_specifiers): Remove unused variable.
13846
c2ff3c02
EZ
138472011-10-30 Eli Zaretskii <eliz@gnu.org>
13848
13849 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
13850 past the beginning of the current glyph matrix.
13851
58179cce 138522011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
13853
13854 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
13855 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
13856 HAVE_GTK3 (Bug#9869).
b77a6a7f 13857
3b574623
JD
13858 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
13859 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
13860
b77a6a7f
JD
13861 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
13862
13863 * xterm.c: Declare x_handle_net_wm_state to return int.
13864 (handle_one_xevent): Check if we are iconified but don't have
13865 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
13866 (get_current_wm_state): Return non-zero if not hidden,
13867 check for _NET_WM_STATE_HIDDEN (Bug#9893).
13868 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
13869 (x_handle_net_wm_state): Return what get_current_wm_state returns.
13870 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
13871
196e41e4
PE
138722011-10-29 Paul Eggert <eggert@cs.ucla.edu>
13873
13874 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
13875 so that this new function doesn't get optimized away by a
13876 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
13877
021f2e1a
AS
138782011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13879
13880 * frame.h (MOUSE_HL_INFO): Remove excess parens.
13881
8b058d44
EZ
138822011-10-29 Eli Zaretskii <eliz@gnu.org>
13883
13884 Fix the `xbytecode' command.
13885 * .gdbinit (xprintbytestr): New command.
b50a28de 13886 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
13887 (xbytecode): Print the byte-code string as well.
13888
4452fb80
EZ
138892011-10-29 Kim Storm <storm@cua.dk>
13890
8b058d44
EZ
13891 * alloc.c (which_symbols): New function.
13892
21b72067
AS
138932011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13894
13895 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
13896 line. (Bug#9903)
13897
83ed7b5c
GM
138982011-10-29 Glenn Morris <rgm@gnu.org>
13899
13900 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
13901 Not clear what it was for, and it causes various bugs. (Bug#9839)
13902
5a7a728b
EZ
139032011-10-28 Eli Zaretskii <eliz@gnu.org>
13904
13905 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
13906 possible random value that matches one of those tested as
13907 condition to clear the mouse face.
13908
d3d0842f
CY
139092011-10-28 Chong Yidong <cyd@gnu.org>
13910
13911 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
13912
31b39d13
DN
139132011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
13914
13915 * window.c (make_window): Initialize phys_cursor_on_p.
13916
9aba6043
SM
139172011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
13918
13919 * lisp.h (struct Lisp_Symbol): Update comments.
13920
c20992f4
JB
139212011-10-28 Juanma Barranquero <lekktu@gmail.com>
13922
13923 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
13924
db4f02f2
EZ
139252011-10-28 Eli Zaretskii <eliz@gnu.org>
13926
13927 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
13928 <oslsachem@gmail.com> for helping to debug this.
13929
13930 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
13931 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
13932 (g_b_init_get_glyph_outline_w): New static variables.
13933 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
13934 (GetGlyphOutlineW_Proc): New typedefs.
13935 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
13936 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
13937 New functions.
13938 (w32font_open_internal, compute_metrics):
13939 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
13940 instead of calling the "wide" APIs directly.
13941
13942 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
13943
13944 * w32.h (syms_of_w32font): Add prototype.
13945
87e68db4
JB
139462011-10-27 Juanma Barranquero <lekktu@gmail.com>
13947
13948 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
13949 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
13950 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
13951 (Fmove_to_window_line): Doc fix.
13952
435c1d67
CY
139532011-10-27 Chong Yidong <cyd@gnu.org>
13954
13955 * process.c (make_process): Set gnutls_state to NULL.
13956
13957 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
13958 non-NULL, regardless of GNUTLS_INITSTAGE.
13959 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
13960 an error. Set process slots as soon as we allocate them.
13961
13962 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
13963
9c6c6f49
CY
139642011-10-27 Chong Yidong <cyd@gnu.org>
13965
9aba6043
SM
13966 * gnutls.c (emacs_gnutls_deinit): New function.
13967 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
13968 (Fgnutls_deinit, Fgnutls_boot): Use it.
13969
13970 * process.c (make_process): Initialize GnuTLS credentials to NULL.
13971 (deactivate_process): Call emacs_gnutls_deinit.
13972
657d08d3
JB
139732011-10-27 Juanma Barranquero <lekktu@gmail.com>
13974
13975 * image.c (x_create_x_image_and_pixmap):
13976 * w32.c (sys_rename, w32_delayed_load):
13977 * w32font.c (fill_in_logfont):
13978 * w32reg.c (x_get_string_resource): Silence compiler warnings.
13979
5430d399
JB
139802011-10-26 Juanma Barranquero <lekktu@gmail.com>
13981
13982 * w32fns.c (w32_default_color_map): New function,
13983 extracted from Fw32_default_color_map.
a7ef684b 13984 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 13985
fe0055fa
PE
139862011-10-25 Paul Eggert <eggert@cs.ucla.edu>
13987
13988 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
13989
e6346438
SM
139902011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
13991
13992 * keyboard.c (test_undefined): New function (bug#9751).
13993 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
13994
e112cc37
ET
139952011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
13996
13997 * sysdep.c (init_sys_modes): Fix the check for the controlling
13998 terminal (Bug#6649).
13999
7b5d6677
EZ
140002011-10-20 Eli Zaretskii <eliz@gnu.org>
14001
14002 * dispextern.h (struct bidi_it): New member next_en_type.
14003
14004 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14005 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14006 current character, check also for next_en_type being WEAK_EN.
14007 (bidi_resolve_weak): Don't enter the expensive loop if the current
14008 position is before next_en_pos. Record the bidi type of the first
14009 non-ET, non-BN character we find, in addition to its position.
14010 (bidi_level_of_next_char): Invalidate next_en_type when
14011 next_en_pos is over-stepped.
14012
7da0b018
PE
140132011-10-20 Paul Eggert <eggert@cs.ucla.edu>
14014
14015 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
14016 * editfns.c: Rewrite current-time-zone so that it invokes
14017 the equivalent of (format-time-string "%Z") to get the time zone name.
14018 This fixes a bug when the time zone name contains characters that
14019 need converting from the system time locale to Emacs internal format.
14020 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
14021 that patch fixed format-time-string to do the conversion, but
14022 I forgot to fix current-time-zone.
14023 (format_time_string): New function, containing most of
14024 what Fformat_time_string used to contain.
14025 (Fformat_time_string): Rewrite in terms of format_time_string.
14026 This doesn't change this function's behavior.
14027 (current-time-zone): Rewrite to use format_time_string.
14028 This fixes the bug reported by Michael Schierl in
14029 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
14030 Jason Rumney's 2007-06-07 change worked around this bug, but
14031 didn't fix it.
14032 * systime.h (tzname, timezone): Remove no-longer-used declarations.
14033
8547b010
EZ
140342011-10-19 Eli Zaretskii <eliz@gnu.org>
14035
14036 * xdisp.c (start_display): If the character at POS is displayed
14037 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
14038 (try_window_reusing_current_matrix): If a line ends in a display
14039 vector or the next line starts in a display vector, continue
14040 redrawing the window even though the character position of
14041 start_row was reached.
8547b010
EZ
14042 (Bug#9771, part 2)
14043
4e948d15
CY
140442011-10-18 Chong Yidong <cyd@gnu.org>
14045
14046 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
14047 with nobreak-char-display too.
14048
4787455f
EZ
140492011-10-18 Eli Zaretskii <eliz@gnu.org>
14050
14051 Fix part 3 of bug#9771.
14052 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
14053 (bidi_resolve_neutral): Don't enter the expensive loop looking for
14054 non-neutral characters if the current character is a paragraph
14055 separator (a.k.a. Newline). This avoids running the same
14056 expensive loop twice, once when we consume the preceding newline
14057 and the other time when the line actually needs to be displayed.
14058 Avoid the loop when we see neutrals on the base embedding level
14059 following a character whose directionality is the same as the
14060 paragraph's. This avoids running the expensive loop when a line
14061 ends in a long sequence of neutrals, like control characters.
14062 Add assertion against STRONG_AL type. Slightly rearrange code
14063 that determines the type of a neutral given the first non-neutral
14064 that follows it.
14065 (bidi_level_of_next_char): Set next_en_pos to zero when
14066 invalidating its info.
14067
2c91f553
EZ
140682011-10-17 Eli Zaretskii <eliz@gnu.org>
14069
14070 * xdisp.c (push_display_prop): Determine whether to record string
14071 or buffer position by IT->string, not by IT->method. Allow
14072 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
14073 (move_it_vertically_backward): Don't look for character position
14074 immediately after the newline when in a continuation line.
14075 (Bug#9771, part 1)
2c91f553 14076
c7b08b0d
MR
140772011-10-15 Martin Rudalics <rudalics@gmx.at>
14078
14079 * window.c (coordinates_in_window): Rewrite and delabelize
14080 vertical border check. (Bug#5357) (Bug#9618)
14081
6b02f655
SM
140822011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
14083
14084 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
14085 errors in XSetWindowBorder (bug#9310).
14086
81d40c92
DA
140872011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
14088
14089 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
14090 avoid crash when xmalloc overrun checking is enabled.
14091
d4172c3b
EZ
140922011-10-13 Eli Zaretskii <eliz@gnu.org>
14093
14094 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
14095 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
14096 cursor motion with <left> and <right> arrow keys.
14097
14098 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
14099 some callers set that themselves.
14100
b00eea75
EZ
141012011-10-12 Eli Zaretskii <eliz@gnu.org>
14102
14103 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
14104 display string and the previous row comes from the same string and
14105 is empty. (Bug#9739) (Bug#9738)
14106
8fe012c4
SM
141072011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
14108
14109 * doc.c (get_doc_string): Encode file name (bug#9735).
14110
0074aef2
EZ
141112011-10-12 Eli Zaretskii <eliz@gnu.org>
14112
79beb178
EZ
14113 * bidi.c (bidi_level_of_next_char):
14114 * xdisp.c (get_visually_first_element): Remove old incorrect
14115 comments regarding the Unicode Line Separator character.
14116
0074aef2
EZ
14117 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
14118
6e4b3fbe
DA
141192011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
14120
14121 * alloc.c (Fgc_status): Do not access beyond zombies array
14122 boundary if nzombies > MAX_ZOMBIES.
14123 * alloc.c (dump_zombies): Add missing format specifier.
14124
0324f3af
PE
141252011-10-12 Paul Eggert <eggert@cs.ucla.edu>
14126
b5525cac
PE
14127 * xdisp.c (set_cursor_from_row): Simplify conditionals,
14128 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
14129
0324f3af
PE
14130 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
14131 Some packages use them to denote characters with modifiers.
14132
e9b5f888
AS
141332011-10-11 Andreas Schwab <schwab@linux-m68k.org>
14134
14135 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
14136 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
14137 matching a pp-number. Rename parameter var to var1.
14138
127827c0
SM
141392011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
14140
14141 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
14142
c8fd3bd0
GM
141432011-10-08 Glenn Morris <rgm@gnu.org>
14144
14145 * callint.c (Fcall_interactively): Give a more explicit error for the
14146 'c' case with a non-character input. (Bug#8479)
14147
352ec8ff
EZ
141482011-10-08 Eli Zaretskii <eliz@gnu.org>
14149
03669ccb
EZ
14150 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
14151 lines.
7061c986
EZ
14152 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
14153 lines that are hscrolled on the left.
03669ccb 14154
352ec8ff
EZ
14155 * dispnew.c (buffer_posn_from_coords): Account for a possible
14156 presence of header-line. (Bug#4426)
14157
a66cfb1c
SM
141582011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
14159
6b02f655
SM
14160 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
14161 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 14162
7c5ee88e
PE
141632011-10-07 Paul Eggert <eggert@cs.ucla.edu>
14164
14165 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
14166 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
14167 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
14168 this makes Emacs dump core during garbage collection on rare
14169 occasions. sizeof is obviously inferior to offsetof here, so
14170 stick with offsetof.
14171 (GC_POINTER_ALIGNMENT): New macro.
14172 (mark_memory): Omit 3rd (offset) arg; caller changed.
14173 Don't assume EMACS_INT alignment is the same as pointer alignment.
14174
df1bbe5b
SM
141752011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
14176
14177 * keyboard.c (read_key_sequence_remapped): New var.
14178 (read_key_sequence): Compute remapping in the right buffer.
14179 (command_loop_1): Use read_key_sequence's remapping directly.
14180
51553db6
SM
141812011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
14182
32c1fffd
SM
14183 * dired.c (file_name_completion): Don't expand file name.
14184 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
14185 before checking file name handler.
14186
51553db6
SM
14187 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
14188 they've been requested explicitly (bug#9591).
14189
b6bd1599 141902011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
14191
14192 * keymap.c (Fsingle_key_description): Use make_specified_string
14193 instead of build_string to build string from push_key_description.
14194 (Bug#5193)
14195
f701dc2a
PE
141962011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14197
4222c55d
PE
14198 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
14199 This fixes a Y2038 bug on 64-bit hosts.
14200 * buffer.c (reset_buffer):
14201 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
14202 (Fclear_buffer_auto_save_failure):
14203 Use 0, not -1, to represent an unset failure time, since time_t
14204 might not be signed.
14205
f701dc2a
PE
14206 Remove dependency on glibc malloc internals.
14207 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14208 Move back here from lisp.h, but with their new implementations.
14209 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14210 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
14211 * charset.c (charset_table_init): New static var.
14212 (syms_of_charset): Use it instead of xmalloc. This removes a
14213 dependency on glibc malloc internals. See Eli Zaretskii's comment in
14214 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
14215 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14216 Move back to alloc.c.
14217 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14218 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
14219
9ceebf39
JD
142202011-09-30 Jan Djärv <jan.h.d@swipnet.se>
14221
14222 * nsterm.m (windowDidResize): Call x_set_window_size only when
14223 ns_in_resize is true. Otherwise set pixelwidth/height and
14224 call change_frame_size (Bug#9628).
14225
cb993c58
PE
142262011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14227
3930c88b
PE
14228 Port --enable-checking=all to Fedora 14 x86-64.
14229 * charset.c (syms_of_charset): Also account for glibc malloc's
14230 internal overhead when calculating the initial malloc maximum.
14231
cb993c58
PE
14232 Port --enable-checking=all to Fedora 14 x86.
14233 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14234 Move to lisp.h.
14235 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
14236 (overrun_check_realloc, overrun_check_free):
14237 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
14238 That way, xmalloc returns a properly-aligned pointer even if
14239 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
14240 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
14241 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
14242 into account when calculating the initial malloc maximum.
14243 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14244 Move here from alloc.c, so that charset.c can use it too.
14245 Properly align; the old code wasn't right for common 32-bit hosts
14246 when configured with --enable-checking=all.
14247 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14248 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
14249
31bed486
EZ
142502011-09-29 Eli Zaretskii <eliz@gnu.org>
14251
04c70788 14252 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
14253 use EDOM.
14254
fbcaa2f3
EZ
142552011-09-28 Eli Zaretskii <eliz@gnu.org>
14256
14257 * xdisp.c (compute_display_string_end): If there's no display
14258 string at CHARPOS, return -1.
14259
14260 * bidi.c (bidi_fetch_char): When compute_display_string_end
14261 returns a negative value, treat the character as a normal
14262 character not covered by a display string. (Bug#9624)
14263
a239d4e9
JB
142642011-09-28 Juanma Barranquero <lekktu@gmail.com>
14265
14266 * lread.c (Fread_from_string): Fix typo in docstring.
14267
88652fd5
EZ
142682011-09-27 Eli Zaretskii <eliz@gnu.org>
14269
14270 * xdisp.c (handle_invisible_prop): If invisible text ends on a
14271 newline, reseat the iterator instead of bidi-iterating there one
14272 character at a time. (Bug#9610)
32c1fffd
SM
14273 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
14274 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 14275
ed497dd4
AS
142762011-09-27 Andreas Schwab <schwab@linux-m68k.org>
14277
14278 * lread.c (readevalloop): Use correct code for NBSP.
14279 (read1): Likewise. (Bug#9608)
14280
b2bf61aa
MA
142812011-09-25 Michael Albinus <michael.albinus@gmx.de>
14282
14283 * dbusbind.c (Fdbus_register_signal): When service is not
14284 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
14285
32bbb17c
GM
142862011-09-25 Glenn Morris <rgm@gnu.org>
14287
14288 * buffer.c (truncate-lines): Doc fix.
14289
94e0933e
CY
142902011-09-24 Chong Yidong <cyd@stupidchicken.com>
14291
14292 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
14293 (Fset_window_next_buffers): Doc fix.
14294
cddde921
GM
142952011-09-24 Glenn Morris <rgm@gnu.org>
14296
14297 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
14298
1260aef1
PE
142992011-09-24 Paul Eggert <eggert@cs.ucla.edu>
14300
25b4bfa0
PE
14301 Fix minor problems found by static checking.
14302 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
14303 * indent.c (Fvertical_motion): Fix == vs = typo.
14304
e3cbd34b
EZ
143052011-09-24 Eli Zaretskii <eliz@gnu.org>
14306
a66cfb1c
SM
14307 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
14308 Default value is now t. Doc fix.
6bf7006f 14309
e3cbd34b 14310 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 14311 logic when moving up, not only when moving down. Fix the
e3cbd34b 14312 confusing name and values of the it_overshoot_expected variable;
32c1fffd 14313 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
14314
14315 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
14316 CHARPOS is covered by a display string which includes newlines.
14317 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
14318 is covered by a display string with embedded newlines.
14319
a3de0cbd
MA
143202011-09-24 Michael Albinus <michael.albinus@gmx.de>
14321
14322 * dbusbind.c (Fdbus_register_signal): Add match rule to
14323 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
14324 (Fdbus_register_method, Vdbus_registered_objects_table):
14325 Fix docstring.
a3de0cbd 14326
b260039d
JM
143272011-09-24 Jim Meyering <meyering@redhat.com>
14328
32c1fffd 14329 do not ignore write error for any output size
b260039d
JM
14330 The previous change was incomplete.
14331 While it makes emacs --batch detect the vast majority of stdout
14332 write failures, errors were still ignored whenever the output size is
14333 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
14334 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
14335 && echo FAIL: ignored write error
14336 FAIL: ignored write error
14337 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
14338 && echo FAIL: ignored write error
14339 FAIL: ignored write error
14340 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
14341
8eca8a7c
AS
143422011-09-23 Andreas Schwab <schwab@linux-m68k.org>
14343
14344 * emacs.c (Fkill_emacs): In noninteractive mode exit
14345 non-successfully if a write error occurred on stdout. (Bug#9574)
14346
3341db62
EZ
143472011-09-21 Eli Zaretskii <eliz@gnu.org>
14348
14349 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
14350 the xassert test.
14351
14352 * dispextern.h (struct it): Update the comment documenting what
14353 can it->OBJECT be.
14354
8c203dbf
EZ
143552011-09-20 Eli Zaretskii <eliz@gnu.org>
14356
14357 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
14358 a display string, extend search for cursor position to end of row.
14359 (find_row_edges): If the row ends in a newline from a display
14360 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
14361 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
14362 (Fcurrent_bidi_paragraph_direction): Fix search for previous
14363 non-empty line. Fixes confusing cursor motion with arrow keys at
14364 the beginning of a line that starts with whitespace.
8c203dbf 14365
a4824228
LMI
143662011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14367
14368 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
14369 (bug#9493).
14370
33ed493b
CY
143712011-09-18 Chong Yidong <cyd@stupidchicken.com>
14372
14373 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
14374 boolean (Bug#9154).
14375
56cd55c8
EZ
143762011-09-18 Eli Zaretskii <eliz@gnu.org>
14377
14378 * xdisp.c (display_line): Record maximum and minimum buffer
14379 positions even if no glyphs were produced (e.g., by a zero-width
14380 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
14381 buffer positions that will be removed from the glyph row because
14382 they don't fit.
c02dcedf
EZ
14383 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
14384 column is beyond frame width: don't subtract 1 "pixel" when
14385 computing width of the stretch.
3e62b7e0
EZ
14386 (reseat_at_next_visible_line_start): Undo the change made on
14387 2011-09-17 that saved paragraph information and restored it after
14388 the call to `reseat'. (Bug#9545)
56cd55c8 14389
5ed99d36 143902011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
14391
14392 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
14393 and turn window cursor on if cleared (Bug#9415).
14394
5ed99d36 143952011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
14396
14397 * search.c (boyer_moore): Take unibyte characters from pattern
14398 literally. (Bug#9458)
14399
9bade7b2
EZ
144002011-09-18 Eli Zaretskii <eliz@gnu.org>
14401
14402 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
14403
e5e9d610
PE
144042011-09-18 Paul Eggert <eggert@cs.ucla.edu>
14405
87e4427a
PE
14406 Fix minor problem found by static checking.
14407 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
14408 initialized, to pacify gcc -Wuninitialized.
14409
e5e9d610
PE
14410 * fileio.c: Report proper errno when syscall falls.
14411 (Finsert_file_contents): Save and restore errno,
14412 so that report_file_error outputs the correct diagnostic.
14413 (Fwrite_region) [CLASH_DETECTION]: Likewise.
14414
a1674f0b
EZ
144152011-09-18 Eli Zaretskii <eliz@gnu.org>
14416
14417 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
14418
fbfb6dd4
EZ
144192011-09-17 Eli Zaretskii <eliz@gnu.org>
14420
14421 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
14422 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
14423
bb187662
EZ
144242011-09-17 Eli Zaretskii <eliz@gnu.org>
14425
1137e8b8 14426 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 14427 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
14428
14429 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
14430 (bidi_find_paragraph_start): Search back for paragraph beginning
14431 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
14432 (bidi_move_to_visually_next): Only trigger paragraph-related
14433 computations when the last character is a newline or at EOB, not
14434 just any NEUTRAL_B. (Bug#9470)
14435
bb187662
EZ
14436 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
14437 truncated lines if point is covered by a display string. (Bug#9524)
14438
2e621251
PE
144392011-09-16 Paul Eggert <eggert@cs.ucla.edu>
14440
14441 * xselect.c: Relax test for outgoing X longs (Bug#9498).
14442 (cons_to_x_long): New function.
14443 (lisp_data_to_selection_data): Use it. Correct the test for
14444 short-versus-long data; it was negated. Break out of vector
14445 loop, for efficiency, when a long datum is discovered.
14446
91a15bc6
SM
144472011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
14448
14449 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
14450
b41c3a35
EZ
144512011-09-16 Eli Zaretskii <eliz@gnu.org>
14452
14453 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
14454 GCC PR/17406) by declaring this function with external scope.
14455
7812ba2d
PE
144562011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14457
14458 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
14459 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
14460
cf7edc2a
AS
144612011-09-15 Andreas Schwab <schwab@linux-m68k.org>
14462
14463 * editfns.c (Fformat): Correctly handle text properties on "%%".
14464
bd01620e
EZ
144652011-09-15 Eli Zaretskii <eliz@gnu.org>
14466
14467 * xterm.c (x_draw_composite_glyph_string_foreground):
14468 * w32term.c (x_draw_composite_glyph_string_foreground):
14469 * term.c (encode_terminal_code):
14470 * composite.c (composition_update_it, get_composition_id):
14471 * xdisp.c (get_next_display_element)
14472 (fill_composite_glyph_string): Add comments about special meaning
14473 of TAB characters in a composition.
14474
a02719a3
PE
144752011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14476
14477 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
14478 This occurs when processing a multibyte format.
14479 Problem reported by Wolfgang Jenker.
a02719a3 14480
72589a3c
JB
144812011-09-15 Johan Bockgård <bojohan@gnu.org>
14482
14483 * xdisp.c (try_cursor_movement): Only check for exact match if
14484 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
14485
1c14176c
PE
144862011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14487
14488 Remove unused external symbols.
14489 * dispextern.h (calc_pixel_width_or_height): Remove decl.
14490 * xdisp.c (calc_pixel_width_or_height): Now static.
14491 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
14492 * indent.c (check_display_width):
14493 * w32term.c: Fix comment to match code.
14494 * xterm.c, xterm.h (x_catching_errors): Remove.
14495
d2eea5b5
PE
144962011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14497
14498 * xselect.c: Use signed conversions more consistently (Bug#9498).
14499 (selection_data_to_lisp_data): Assume incoming selection data are
14500 signed integers, not unsigned. This is to be consistent with
14501 outgoing selection data, which was modified to use signed integers
14502 in as part of the fix to Bug#9196 in response to Jan D.'s comment
14503 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
14504 expects long, not unsigned long.
14505
46888499
EZ
145062011-09-14 Eli Zaretskii <eliz@gnu.org>
14507
14508 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
14509 computation of loop end. Reported by Johan Bockgård
14510 <bojohan@gnu.org>.
14511
ef8ef9fb
CY
145122011-09-13 Chong Yidong <cyd@stupidchicken.com>
14513
14514 * frame.c (Fother_visible_frames_p): Function deleted.
14515
fa819fed
EZ
145162011-09-12 Eli Zaretskii <eliz@gnu.org>
14517
14518 * indent.c (compute_motion): Process display vector front to back
14519 rather than the other way around. (Bug#2496)
14520
2ba8e008
SM
145212011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
14522
14523 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
14524
20f53c69
CY
145252011-09-11 Chong Yidong <cyd@stupidchicken.com>
14526
14527 * minibuf.c (Fread_from_minibuffer): Doc fix.
14528
d562d7a4
EZ
145292011-09-11 Eli Zaretskii <eliz@gnu.org>
14530
14531 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
14532 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
14533
1c4d7f3d
LMI
145342011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14535
14536 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
14537 value for non-existent files.
14538
b885bf36
EZ
145392011-09-11 Eli Zaretskii <eliz@gnu.org>
14540
14541 * fileio.c (Finsert_file_contents): If the file cannot be opened,
14542 set its "size" to -1. This will set the modtime_size field of
14543 the corresponding buffer to -1, which is what
14544 verify-visited-file-modtime expects for files that do not exist.
14545 (Bug#9139)
14546
6612f0bf
PE
145472011-09-11 Paul Eggert <eggert@cs.ucla.edu>
14548
14549 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
14550 here ...
14551 * lisp.h: ... from here. push_key_description is no longer
14552 defined in keyboard.c, so its declaration should not be in
14553 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
14554 logically belongs with push_key_description.
14555
dfb3f755
PE
145562011-09-10 Paul Eggert <eggert@cs.ucla.edu>
14557
14558 * buffer.h: Include <sys/types.h> instead of <time.h>.
14559 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
14560 Problem reported by Herbert J. Skuhra.
14561
3134906c
LMI
145622011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
14563
14564 * xml.c (parse_region): Make the parsing work for
14565 non-comment-starting XML files again (bug#9144).
14566
8d903f4e
AS
145672011-09-10 Andreas Schwab <schwab@linux-m68k.org>
14568
14569 * image.c (gif_load): Fix calculation of bottom and right corner.
14570 (Bug#9468)
14571
80ad64f4
EZ
145722011-09-10 Eli Zaretskii <eliz@gnu.org>
14573
14574 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
14575 redisplay in small windows.
14576
208a048d
EZ
145772011-09-09 Eli Zaretskii <eliz@gnu.org>
14578
14579 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
14580
9b1c252e
MR
145812011-09-08 Martin Rudalics <rudalics@gmx.at>
14582
14583 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
14584 Operate on live windows only.
14585
2949f33b
JB
145862011-09-08 Juanma Barranquero <lekktu@gmail.com>
14587
14588 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
14589
e08dcafd
EZ
145902011-09-07 Eli Zaretskii <eliz@gnu.org>
14591
14592 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
14593 only under bidi iteration.
14594
115b96bd
JD
145952011-09-07 Jan Djärv <jan.h.d@swipnet.se>
14596
14597 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
14598
c8199d0f
PE
145992011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14600
14601 isnan: Fix porting problem to Solaris 10 with bundled gcc.
14602 Without this fix, the command to link temacs failed due to an
14603 undefined symbol __builtin_isnan. This is because
14604 /usr/include/iso/math_c99.h #defines isnan(x) to
14605 __builtin_isnan(x), but the bundled gcc, which identifies itself
14606 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
14607 a __builtin_isnan.
14608 * floatfns.c (isnan): #undef, and then #define to a clone of
14609 what's in data.c.
14610 (Fisnan): Always define, since it's always available now.
14611 (syms_of_floatfns): Always define isnan at the Lisp level.
14612
e39b275c 146132011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
14614
14615 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
14616
b2db44d9 146172011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 14618
f4af5137 14619 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
14620 The previous code assumed that file offsets (off_t values) fit in
14621 EMACS_INT variables, which is not true on typical 32-bit hosts.
14622 The code messed up by falsely reporting buffer overflow in cases
14623 such as (insert-file-contents "big" nil 1 2) into an empty buffer
14624 when "big" contains more than 2**29 bytes, even though this
14625 inserts just one byte and does not overflow the buffer.
14626 (Finsert_file_contents): Store file offsets as off_t
14627 values, not as EMACS_INT values. Check for overflow when
14628 converting between EMACS_INT and off_t. When checking for
14629 buffer overflow or for overlap, take the offsets into account.
14630 Don't use EMACS_INT for small values where int suffices.
14631 When checking for overlap, fix a typo: ZV was used where
14632 ZV_BYTE was intended.
14633 (Fwrite_region): Don't assume off_t fits into 'long'.
14634 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
14635
ecfc0a49
MA
146362011-09-05 Michael Albinus <michael.albinus@gmx.de>
14637
14638 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
14639
6511acf2 146402011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 14641
0999621a 14642 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
14643
14644 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 14645 (esprintf, exprintf, evxprintf): New functions.
62f19c19 14646 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 14647 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
14648 (modify_event_symbol): Do not assume that the length of
14649 name_alist_or_stem is safe to alloca and fits in int.
14650 (Fexecute_extended_command): Likewise for function name and binding.
14651 (Frecursion_depth): Wrap around reliably on integer overflow.
14652 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
14653 since some callers pass EMACS_INT values.
14654 (Fsingle_key_description): Don't crash if symbol name contains more
14655 than MAX_ALLOCA bytes.
14656 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
14657 (get_minibuffer): Arg is now EMACS_INT, not int.
14658 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 14659 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
14660 * window.h (command_loop_level, minibuf_level): Reflect API changes.
14661
2be7d702
PE
14662 * dbusbind.c (signature_cat): New function.
14663 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
14664 Do not overrun buffer; instead, report string overflow.
14665
9d1df220
PE
14666 * dispnew.c (add_window_display_history): Don't overrun buffer.
14667 Truncate instead; this is OK since it's just a log.
14668
33ef5c64
PE
14669 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
14670 even if the time zone offset is outlandishly large.
14671 Don't mishandle offset == INT_MIN.
14672
66c6fdd5
PE
14673 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
14674 when creating daemon; the previous buffer-overflow check was incorrect.
14675
d749b01b
PE
14676 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
14677 which has the guts of the old verror function.
14678
b5cd1905
PE
14679 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
14680 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
14681
6e1a67fb
PE
14682 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
14683 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 14684 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 14685 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
14686 length of string rather than counting it via multiple sprintfs;
14687 that's simpler and more reliable.
c21721cc
PE
14688 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
14689 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
14690 sprintf, in case result does not fit in int.
14691
c57b67fc
PE
14692 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
14693 (fontset_from_font): Print it.
14694
8a401434
PE
14695 * frame.c (tty_frame_count): Now printmax_t, not int.
14696 (make_terminal_frame, set_term_frame_name): Print it.
14697 (x_report_frame_params): In X, window IDs are unsigned long,
14698 not signed long, so print them as unsigned.
14699 (validate_x_resource_name): Check for implausibly long names,
14700 and don't assume name length fits in 'int'.
14701 (x_get_resource_string): Don't blindly alloca invocation name;
14702 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
14703 not fit in int.
14704
6e1a67fb
PE
14705 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
14706 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
14707 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
14708
0df02bf3
PE
14709 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
14710 Use esprintf, not sprintf, in case result does not fit in int.
14711
48e30793
PE
14712 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14713 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
14714 it as a large positive number.
14715 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
14716 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14717
a66ff6d8
PE
14718 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
14719 in case result does not fit in int.
14720
aca216ff
PE
14721 * print.c (float_to_string): Detect width overflow more reliably.
14722 (print_object): Make sprintf buffer a bit bigger, to avoid potential
14723 buffer overrun. Don't assume list length fits in 'int'. Treat
14724 print length of 0 as 0, not as infinity; to be consistent with other
14725 uses of print length in this function. Don't overflow print length
14726 index. Don't assume hash table size fits in 'long', or that
14727 vectorlike size fits in 'unsigned long'.
14728
31c286f7
PE
14729 * process.c (make_process): Use printmax_t, not int, to format
14730 process-name gensyms.
14731
55e5faa1
PE
14732 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
14733
80f2e268
PE
14734 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
14735 to avoid potential buffer overrun.
14736
670741ab
PE
14737 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
14738 if X resource line is longer than 512 bytes.
14739
b7163a50
PE
14740 * xfns.c (x_window): Make sprintf buffer a bit bigger
14741 to avoid potential buffer overrun.
14742
ae58ff1f
PE
14743 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
14744
c43c8a6a
PE
14745 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
14746
3f8236f4
PE
147472011-09-04 Paul Eggert <eggert@cs.ucla.edu>
14748
53e9fe90 14749 Integer overflow fixes for scrolling, etc.
6511acf2
PE
14750 Without these, Emacs silently mishandles large integers sometimes.
14751 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
14752 it were "C-u 1 M-x recenter" on a typical 64-bit host.
14753
6511acf2
PE
14754 * xdisp.c (try_window_id): Check Emacs fixnum range before
14755 converting to 'int'.
806add1d 14756
6511acf2 14757 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
14758 Check that an Emacs fixnum is in range before assigning it to 'int'.
14759 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
14760 values converted from Emacs fixnums.
14761 (Frecenter): Don't wrap around a line count if it is out of 'int'
14762 range; instead, treat it as an extreme value.
14763 (Fset_window_configuration, compare_window_configurations):
14764 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
14765
6511acf2
PE
14766 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
14767 that can exceed INT_MAX. Check that EMACS_INT value is in range
14768 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
14769 (match_limit): Don't assume that a fixnum can fit in 'int'.
14770
6511acf2 14771 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
14772 exceed INT_MAX.
14773
6511acf2 14774 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
14775 (Fvertical_motion): Don't wrap around LINES values that don't fit
14776 in 'int'. Instead, treat them as extreme values. This is good
14777 enough for windows, which can't have more than INT_MAX lines anyway.
14778
fcb901a7
LMI
147792011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14780
0f2f6b6d
LMI
14781 * Require libxml/parser.h to avoid compilation warning.
14782
fcb901a7
LMI
14783 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
14784
14785 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
14786 since this reportedly can destroy thread storage.
14787
6e20a0d4
CY
147882011-08-30 Chong Yidong <cyd@stupidchicken.com>
14789
14790 * syntax.c (find_defun_start): Update all cache variables if
14791 exiting early (Bug#9401).
14792
148ae00e
EZ
147932011-08-30 Eli Zaretskii <eliz@gnu.org>
14794
f6cfbd8f
EZ
14795 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
14796
148ae00e
EZ
14797 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
14798 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
14799 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
14800
14801 * term.c (tty_append_glyph): New function.
14802 (produce_stretch_glyph): Static function and its prototype deleted.
14803
a66cfb1c
SM
14804 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
14805 Add prototypes.
148ae00e 14806
c4a07a4c
PE
148072011-08-29 Paul Eggert <eggert@cs.ucla.edu>
14808
14809 * image.c (parse_image_spec): Check for nonnegative, not for positive,
14810 when checking :margin (Bug#9390).
14811 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 14812 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
14813 so that the name doesn't mislead. All uses changed.
14814
6bc8cd65
JB
148152011-08-28 Johan Bockgård <bojohan@gnu.org>
14816
14817 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
14818 set_tty_hooks.
14819
dca4927e
EZ
148202011-08-27 Eli Zaretskii <eliz@gnu.org>
14821
14822 * xdisp.c (move_it_to): Don't bail out early when reaching
14823 position beyond to_charpos, if we are scanning backwards.
14824 (move_it_vertically_backward): When DY == 0, make sure we get to
14825 the first character in the line after the newline.
14826
f2cad773
PE
148272011-08-27 Paul Eggert <eggert@cs.ucla.edu>
14828
14829 * ccl.c: Improve and simplify overflow checking (Bug#9196).
14830 (ccl_driver): Do not generate an out-of-range pointer.
14831 (Fccl_execute_on_string): Remove unnecessary check for
14832 integer overflow, noted by Stefan Monnier in
14833 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
14834 Remove a FIXME that didn't need fixing.
14835 Simplify the newly-introduced buffer reallocation code.
14836
0cae2cdb
JB
148372011-08-27 Juanma Barranquero <lekktu@gmail.com>
14838
14839 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
14840
5fc295a4 148412011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 14842
70c60eb2 14843 Integer and memory overflow issues (Bug#9196).
726e0ab1 14844
d31850da
PE
14845 * doc.c (get_doc_string): Rework so that
14846 get_doc_string_buffer_size is the actual buffer size, rather than
14847 being 1 less than the actual buffer size; this makes xpalloc more
14848 convenient.
14849
a69fbedb
PE
14850 * image.c (x_allocate_bitmap_record, cache_image):
14851 * xselect.c (Fx_register_dnd_atom):
14852 Simplify previous changes by using xpalloc.
14853
fe5c5d37
PE
14854 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
14855 since either will do and ptrdiff_t is convenient with xpalloc.
14856
0065d054
PE
14857 * charset.c (charset_table_size)
14858 (struct charset_sort_data.priority): Now ptrdiff_t.
14859 (charset_compare): Don't overflow if priorities differ greatly.
14860 (Fsort_charsets): Don't assume list length fits in int.
14861 Check for size-calculation overflow when allocating sort data.
14862 (syms_of_charset): Allocate an initial charset table that is
14863 just under 64 KiB, to avoid problems with glibc malloc and mmap.
14864
14865 * cmds.c (internal_self_insert): Check for size-calculation overflow.
14866
14867 * composite.h (struct composition.glyph_len): Now int, not unsigned.
14868 The actual value is always <= INT_MAX, and leaving it unsigned made
14869 overflow checking harder.
14870
14871 * dispextern.h (struct glyph_matrix.rows_allocated)
14872 (struct face_cache.size): Now ptrdiff_t, for convenience in use
14873 with xpalloc. The values are still always <= INT_MAX.
14874
14875 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
14876
14877 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
14878 (SAFE_NALLOCA): New macro.
14879
14880 * region-cache.c (struct boundary.pos, find_cache_boundary)
14881 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
14882 (set_cache_region, invalidate_region_cache)
14883 (revalidate_region_cache, know_region_cache, region_cache_forward)
14884 (region_cache_backward, pp_cache):
14885 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
14886 so that ptrdiff_t * can be passed to xpalloc.
14887 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
14888 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
14889 (pp_cache): Don't assume cache_len fits in int.
14890 * region-cache.h: Adjust extern decls to match.
14891
14892 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
14893 EMACS_INT, since either will do, for xpalloc.
14894
14895 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
14896 (xnmalloc, xnrealloc, xpalloc): New functions.
14897
726e0ab1
PE
14898 * bidi.c (bidi_shelve_header_size): New constant.
14899 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
14900 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
14901
51f30bc5 14902 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
14903 * buffer.c (overlays_at, overlays_in, record_overlay_string)
14904 (overlay_strings):
14905 Don't update size of array until after memory allocation succeeds,
14906 because xmalloc/xrealloc may not return.
0065d054
PE
14907 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
14908 now that we have proper integer overflow checking.
14909 (record_overlay_string, overlay_strings): Catch overflows when
14910 calculating size of overlay_str_buf.
726e0ab1 14911
0065d054
PE
14912 * callproc.c (Fcall_process): Check for size overflow when
14913 calculating size of args2.
14914 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
14915 Normally we prefer signed values, but sticking with ptrdiff_t would
14916 require adding more-complicated checks.
726e0ab1
PE
14917
14918 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
14919 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
14920 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 14921 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
14922
14923 * character.c (Fstring): Check for size-calculation overflow.
14924
14925 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
14926 unnecessary integer overflow. Check for size overflow.
14927 (encode_coding_object): Don't update size until xmalloc succeeds.
14928
14929 * composite.c (get_composition_id): Check for overflow in glyph
14930 length calculations.
14931
14932 Integer and memory overflow fixes for display code.
14933 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
14934 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
14935 (scrolling_window): Check for overflow in size calculations.
14936 (line_draw_cost, realloc_glyph_pool, add_row_entry):
14937 Don't assume glyph table len fits in int.
14938 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
14939 (row_table_size): Now ptrdiff_t, not int.
14940 (scrolling_window): Avoid overflow in size calculations.
14941 Don't update size until allocation succeeds.
14942 * fns.c (concat): Check for overflow in size calculations.
14943 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
14944 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14945 (NEXT_ALMOST_PRIME_LIMIT): New constant.
14946
14947 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
14948 (get_doc_string): Check for size calculation overflow.
14949 Don't update size until allocation succeeds.
14950 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
14951 EMACS_INT, where ptrdiff_t will do.
14952 (Fsubstitute_command_keys): Check for string overflow.
14953
14954 * editfns.c (set_time_zone_rule): Don't assume environment length
14955 fits in int.
14956 (message_length): Now ptrdiff_t, not int.
14957 (Fmessage_box): Don't update size until allocation succeeds.
14958 Don't assume message length fits in int.
14959 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
14960
0065d054
PE
14961 * emacs.c (main): Do not reallocate argv, since there is a null at
14962 the end that can be overwritten, and this way there's no need to
14963 worry about size-calculation overflow.
14964 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
14965
14966 * eval.c (init_eval_once, grow_specpdl): Don't update size until
14967 alloc succeeds.
14968 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
14969
14970 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
14971 (x_set_scroll_bar_width, x_figure_window_size):
14972 Check for integer overflow.
14973 (x_set_alpha): Do not assume XINT fits in int.
14974
14975 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
14976 This is for the members text_lines, text_cols, total_lines, total_cols,
14977 where the system imposes an 'int' limit.
14978
14979 * fringe.c (Fdefine_fringe_bitmap):
14980 Don't update size until alloc works.
14981
14982 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
14983 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
14984
14985 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
14986 Check for size-calculation overflow.
14987 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
14988 do, as we prefer signed integers.
14989 (id_to_widget.max_size, id_to_widget.used)
14990 (xg_store_widget_in_map, xg_remove_widget_from_map)
14991 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
14992 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
14993 Use and return ptrdiff_t, not int.
14994 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
14995 * gtkutil.h: Change prototypes to match the above.
14996
14997 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
14998 are duplicate now that they've been promoted to lisp.h.
14999 (x_allocate_bitmap_record, x_alloc_image_color)
15000 (make_image_cache, cache_image, xpm_load):
15001 Don't update size until alloc is done.
15002 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15003 (x_detect_edges):
3256efce 15004 Check for size calculation overflow.
726e0ab1
PE
15005 (ct_colors_allocated_max): New constant.
15006 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15007 overflow.
3256efce 15008
726e0ab1
PE
15009 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15010 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
15011 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
15012 Use ptrdiff_t, not int, to count maps.
15013 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
15014 calculations. Don't update size until allocation succeeds.
15015 Redo calculations to avoid overflow.
726e0ab1
PE
15016 * keyboard.h: Change prototypes to match the above.
15017
15018 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
15019 to count maps.
15020 (current_minor_maps): Check for size calculation overflow.
15021 * keymap.h: Change prototypes to match the above.
15022
15023 * lread.c (read1, init_obarray): Don't update size until alloc done.
15024
15025 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
15026 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
15027
726e0ab1
PE
15028 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
15029 Now ptrdiff_t, not int.
15030 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
15031 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
15032
15033 * process.c (Fnetwork_interface_list): Check for overflow
15034 in size calculation.
15035
15036 * region-cache.c (move_cache_gap): Check for size calculation overflow.
15037
15038 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
15039 overflow. Don't bother calling xmalloc when xrealloc will do.
15040
15041 * search.c (Freplace_match): Check for size calculation overflow.
15042 (Fset_match_data): Don't assume list lengths fit in 'int'.
15043
15044 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
15045 for command line length. Do not attempt to address one before the
15046 beginning of an array, as that's not portable.
15047
15048 * term.c (max_frame_lines): Remove; unused.
15049 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
15050 not int.
15051 (encode_terminal_code, calculate_costs): Check for size
15052 calculation overflow.
15053 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
15054 table lengths and related sizes. Don't update size until alloc
15055 done. Redo calculations to avoid overflow.
15056 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
15057
15058 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
15059 subtracting pointers.
15060 (gobble_line): Check for overflow more carefully. Don't update size
15061 until alloc done.
15062
15063 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
15064 Don't update size until alloc done.
15065 Redo size calculations to avoid overflow.
15066 Check for size calculation overflow.
0065d054 15067 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
15068
15069 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
15070 Use ptrdiff_t, not int, for sizes.
15071 (store_mode_line_noprop_char): Don't update size until alloc done.
15072
0065d054
PE
15073 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
15074 Use ptrdiff_t, not int, for sizes.
15075 (Finternal_make_lisp_face, cache_face):
15076 Check for size calculation overflow.
15077 (cache_face): Treat size calculation overflows as if they were
15078 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
15079
15080 * xfns.c (x_encode_text, x_set_name_internal)
15081 (Fx_change_window_property): Use ptrdiff_t, not int, to count
15082 sizes, since they can exceed INT_MAX in size. Check for size
15083 calculation overflow.
15084
0065d054
PE
15085 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
15086 (xg_select): Check for size calculation overflow.
726e0ab1
PE
15087 Don't update size until alloc done.
15088
0065d054 15089 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 15090 as sprintf is limited to int lengths.
1d526e2f 15091
252c5ee1
PE
15092 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
15093 (X_LONG_MIN): New macros.
864d7ce7
PE
15094 Use them to make the following changes clearer.
15095 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
15096 This change doesn't affect the value now, but it may help remind
15097 future maintainers not to raise the value too much later.
15098 (SELECTION_QUANTUM): Remove, replacing with ...
15099 (selection_quantum): ... new function, which avoids overflow.
15100 All uses changed.
15101 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
15102 assumption that selection length fits in 'int'.
15103 (x_reply_selection_request, x_handle_selection_request)
15104 (x_get_window_property, receive_incremental_selection)
15105 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
15106 (lisp_data_to_selection_data, clean_local_selection_data):
15107 Use ptrdiff_t, not int, to record length of selection.
15108 (x_reply_selection_request, x_get_window_property)
15109 (receive_incremental_selection, x_property_data_to_lisp):
15110 Redo calculations to avoid overflow.
15111 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 15112 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
15113 something.
15114 (x_get_window_property, receive_incremental_selection)
15115 (lisp_data_to_selection_data, x_property_data_to_lisp):
15116 Check for size-calculation overflow.
15117 (x_get_window_property, receive_incremental_selection)
15118 (lisp_data_to_selection_data, Fx_register_dnd_atom):
15119 Don't store size until memory allocation succeeds.
15120 (x_get_window_property): Plug memory leak on memory exhaustion.
15121 Don't double-block input; malloc is safe here. Don't assume 2**34
15122 - 4 fits in unsigned long. Add an xassert to check
15123 XGetWindowProperty overflow. Be more careful about overflow
15124 calculations, and distinguish size from memory overflow better.
15125 (receive_incremental_selection): When tracing, don't assume
15126 unsigned int is less than INT_MAX.
15127 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
15128 harmful) conversions of unsigned short to int.
15129 (lisp_data_to_selection_data): Don't assume that integers
15130 in the range -65535 through -1 fit in an X unsigned short.
15131 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
15132 result parameters unless successful. Rely on cons_to_unsigned
15133 to report problems with elements; the old code wasn't right anyway.
15134 (x_check_property_data): Check for int overflow; we cannot use
15135 a wider type due to X limits.
15136 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
15137
726e0ab1 15138 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 15139
0065d054
PE
15140 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
15141 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
15142 (x_color_cells): Don't store size until memory allocation succeeds.
15143 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 15144 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
15145 (x_term_init): Don't assume length fits in int (sprintf is limited
15146 to int size).
bc18e09d 15147
ebfa62c0
PE
15148 Use ptrdiff_t for composition IDs.
15149 * character.c (lisp_string_width):
15150 * composite.c (composition_table_size, n_compositions)
15151 (get_composition_id, composition_gstring_from_id):
15152 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
15153 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
15154 * window.c (Frecenter):
15155 Use ptrdiff_t, not int, for composition IDs.
15156 * composite.c (get_composition_id): Check for integer overflow.
15157 * composite.h: Adjust prototypes to match the above changes.
15158
d3411f89
PE
15159 Use ptrdiff_t for hash table indexes.
15160 * category.c (hash_get_category_set):
15161 * ccl.c (ccl_driver):
15162 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
15163 * coding.c (coding_system_charset_list, detect_coding_system):
15164 * coding.h (struct coding_system.id):
15165 * composite.c (get_composition_id, gstring_lookup_cache):
15166 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
15167 * image.c (xpm_get_color_table_h):
15168 * lisp.h (hash_lookup, hash_put):
15169 * minibuf.c (Ftest_completion):
15170 Use ptrdiff_t for hash table indexes, not int (which is too
15171 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
15172 32-bit --with-wide-int hosts).
15173
e097a6fa
PE
15174 * charset.c (Fdefine_charset_internal): Check for integer overflow.
15175 Add a FIXME comment about memory leaks.
15176 (syms_of_charset): Don't assume xmalloc returns.
15177
5637687f
PE
15178 Don't assume that stated character widths fit in int.
15179 * character.c (Fchar_width, c_string_width, lisp_string_width):
15180 * character.h (CHAR_WIDTH):
15181 * indent.c (MULTIBYTE_BYTES_WIDTH):
15182 Use sanitize_char_width to avoid undefined and/or bad behavior
15183 with outlandish widths.
a66cfb1c 15184 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
15185 now that we have two such functions. All uses changed.
15186 (sanitize_char_width): New inline function.
15187
a2271ba2
PE
15188 Don't assume that tab-width fits in int.
15189 * character.h (sanitize_width): New inline function.
15190 (SANE_TAB_WIDTH): New macro.
15191 (ASCII_CHAR_WIDTH): Use it.
15192 * indent.c (sane_tab_width): Remove. All uses replaced by
15193 SANE_TAB_WIDTH (current_buffer).
15194 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
15195
18c52557
PE
15196 * fileio.c: Integer overflow issues with file modes.
15197 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
15198
caeeedc1
PE
15199 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
15200 Remove unreachable code.
15201 (read_hex, load_charset_map_from_file): Check for integer overflow.
15202
6df6ae42 15203 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
15204 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
15205 (x_send_scroll_bar_event): Likewise. Check that the size does not
15206 exceed limits imposed by XClientMessageEvent, as well as the usual
15207 ptrdiff_t and size_t limits.
15208
b13995db
PE
15209 * keyboard.c: Overflow, signedness and related fixes.
15210 (make_lispy_movement): Use same integer type in forward decl
15211 that is used in the definition.
15212 (read_key_sequence, keyremap_step):
15213 Change bufsize argument back to int, undoing my 2011-03-30 change.
15214 We prefer signed types, and int is wide enough here.
15215 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
15216 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
15217 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
15218 length, not size_t. Use ptrdiff_t for index, not int.
15219 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
15220 possibility of integer overflow.
15221
13464394
PE
15222 Overflow, signedness and related fixes for images.
15223
15224 * dispextern.h (struct it.stack[0].u.image.image_id)
15225 (struct_it.image_id, struct image.id, struct image_cache.size)
15226 (struct image_cache.used, struct image_cache.ref_count):
15227 * gtkutil.c (update_frame_tool_bar):
15228 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
15229 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
15230 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
15231 * nsmenu.m (update_frame_tool_bar):
15232 * xdisp.c (calc_pixel_width_or_height):
15233 * xfns.c (image_cache_refcount):
15234 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
15235 on typical 64-bit hosts.
15236
15237 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15238 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
15239 Omit unnecessary casts to int.
15240 (parse_image_spec): Check that integers fall into 'int' range
15241 when the callers expect that.
15242 (image_ascent): Redo ascent calculation to avoid int overflow.
15243 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
15244 (lookup_image): Remove unnecessary tests.
15245 (xbm_image_p): Locals are now of int, not EMACS_INT,
15246 since parse_image_check makes sure they fit into int.
15247 (png_load, gif_load, svg_load_image):
15248 Prefer int to unsigned where either will do.
15249 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
15250 old tiff_error_handler and tiff_warning_handler.
15251 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
15252 stack buffer overflows. It uses only the features of vsnprintf
15253 that are common to both POSIX and native Microsoft.
15254 (tiff_error_handler, tiff_warning_handler): Use it.
15255 (tiff_load, gif_load, imagemagick_load_image):
15256 Don't assume :index value fits in 'int'.
15257 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
15258 (imagemagick_load_image): Check that crop parameters fit into
15259 the integer types that MagickCropImage accepts. Don't assume
15260 Vimagemagick_render_type has a nonnegative value. Don't assume
15261 size_t fits in 'long'.
15262 (gs_load): Use printmax_t to print the widest integers possible.
15263 Check for integer overflow when computing image height and width.
15264
c11821d4
EZ
152652011-08-26 Eli Zaretskii <eliz@gnu.org>
15266
15267 * xdisp.c (redisplay_window): Don't force window start if point
15268 will be invisible in the resulting window. (Bug#9324)
15269
0c95fcf7
EZ
152702011-08-25 Eli Zaretskii <eliz@gnu.org>
15271
15272 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
15273 the display spec is of the form `(space ...)'.
15274 (handle_display_spec): Return the value returned by
15275 handle_single_display_spec, not just 1 or zero.
15276 (handle_single_display_spec): If the display spec is of the form
15277 `(space ...)', and specifies display in the text area, return 2
15278 rather than 1.
fee65a97 15279 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
15280 accurately, and prefer exact match for point under bidi.
15281 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
15282
15283 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
15284 into disp_prop; all users changed.
15285
15286 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
15287 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
15288 for the text covered by the display property.
15289
e4ed06f1
CY
152902011-08-25 Chong Yidong <cyd@stupidchicken.com>
15291
15292 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
15293 Change return value to nil.
15294 (Frecord_buffer): Delete unused function.
15295
f67cdd7f
EZ
152962011-08-24 Eli Zaretskii <eliz@gnu.org>
15297
5980d4c6
EZ
15298 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
15299 buffers, return left-to-right.
8610fe8b
EZ
15300 (set_cursor_from_row): Consider candidate row a win if its glyph
15301 represents a newline and point is on that newline. Fixes cursor
15302 positioning on the newline at EOL of R2L text within L2R
15303 paragraph, and vice versa.
15304 (try_cursor_movement): Check continued rows, in addition to
15305 continuation rows. Fixes unwarranted scroll when point enters a
15306 continued line of R2L text within an L2R paragraph, or vice versa.
15307 (cursor_row_p): Consider the case of point being equal to
15308 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
15309 from the end of a short line to the beginning of a continued line
15310 of R2L text within L2R paragraph.
15311 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
15312 composed characters.
5980d4c6 15313
f67cdd7f
EZ
15314 * bidi.c (bidi_check_type): Use xassert.
15315 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
15316 members.
15317
bca633fb
EZ
153182011-08-23 Eli Zaretskii <eliz@gnu.org>
15319
15320 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
15321 a character.
15322
4a5885a7
CY
153232011-08-23 Chong Yidong <cyd@stupidchicken.com>
15324
15325 * nsfont.m (ns_otf_to_script): Fix typo.
15326
0902a04e
KH
153272011-08-22 Kenichi Handa <handa@m17n.org>
15328
15329 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
15330 extra slot even if the purpose is char-code-property-table.
15331
1a2e6670
EZ
153322011-08-23 Eli Zaretskii <eliz@gnu.org>
15333
8ddde651
EZ
15334 * xdisp.c (redisplay_window): When computing centering_position,
15335 account for the height of the header line. (Bug#8874)
15336
425cc014
EZ
15337 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
15338 instead of CHAR_TO_BYTE. Fixes a crash when a completion
15339 candidate is selected by the mouse, and that candidate has a
15340 composed character under the mouse.
15341
1a2e6670
EZ
15342 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
15343 coordinates reported by pos-visible-in-window-p for a composed
15344 character in column zero.
15345
8b76d6f8
SM
153462011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
15347
15348 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
15349
dac347dd
EZ
153502011-08-22 Eli Zaretskii <eliz@gnu.org>
15351
15352 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
15353 consider it a hit if to_charpos is anywhere in the range of the
15354 composed buffer positions.
15355
e013fb34
CY
153562011-08-22 Chong Yidong <cyd@stupidchicken.com>
15357
15358 * image.c (gif_load): Don't assume that each subimage has the same
15359 dimensions as the base image. Handle disposal method that is
15360 "undefined" by the gif spec (Bug#9335).
15361
bd1ba3e8
CY
153622011-08-20 Chong Yidong <cyd@stupidchicken.com>
15363
15364 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 15365 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 15366
54a1215b
EZ
153672011-08-19 Eli Zaretskii <eliz@gnu.org>
15368
823564e5
EZ
15369 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
15370 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
15371 from an Org mode buffer to a Speedbar frame.
15372
54a1215b
EZ
15373 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
15374 a composition, take its buffer position from IT->cmp_it.charpos.
15375 Fixes cursor positioning at the beginning of a line that begins
15376 with a composed character.
15377
9778ebcc
EZ
153782011-08-18 Eli Zaretskii <eliz@gnu.org>
15379
0be6ee06
EZ
15380 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
15381 character bidirectional type, use STRONG_L instead. Fixes crashes
15382 in a buffer produced by `describe-categories'.
15383
9778ebcc
EZ
15384 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
15385 members before the level stack, so they would be saved and
15386 restored when copying iterator state. Fixes incorrect reordering
15387 around TABs covered by display properties.
15388
156bffbe
AS
153892011-08-18 Andreas Schwab <schwab@linux-m68k.org>
15390
6b02f655 15391 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 15392
72ad093b
CY
153932011-08-17 Chong Yidong <cyd@stupidchicken.com>
15394
15395 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
15396 (internal_condition_case_2, internal_condition_case_n):
15397 Remove unnecessary aborts (Bug#9081).
72ad093b 15398
35774242
EZ
153992011-08-17 Eli Zaretskii <eliz@gnu.org>
15400
15401 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
15402 has no `load' handler, try opening the file locally. (Bug#9311)
15403
db76dd85
KB
154042011-08-16 Ken Brown <kbrown@cornell.edu>
15405
15406 * gmalloc.c: Expand comment.
15407
b215eee5
EZ
154082011-08-16 Eli Zaretskii <eliz@gnu.org>
15409
15410 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
15411 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
15412
a4579d33
KB
154132011-08-16 Ken Brown <kbrown@cornell.edu>
15414
15415 Fix memory allocation problems in Cygwin build (Bug#9273).
15416
15417 * unexcw.c ( __malloc_initialized): Declare external variable.
15418 (fixup_executable): Force the dumped emacs to reinitialize malloc.
15419
8b76d6f8
SM
15420 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
15421 New variables.
a4579d33
KB
15422 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
15423 dumped emacs.
15424 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
15425 in the static heap.
15426 [CYGWIN] (special_realloc): New function.
15427 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
15428 requests to realloc storage in the static heap.
15429
3ebec551
PE
154302011-08-15 Paul Eggert <eggert@cs.ucla.edu>
15431
15432 * bidi.c (bidi_initialize): Remove unused local.
15433
9fd8be00
EZ
154342011-08-15 Eli Zaretskii <eliz@gnu.org>
15435
6b02f655
SM
15436 * bidimirror.h:
15437 * biditype.h: Remove file.
15438 * makefile.w32-in ($(BLD)/bidi.$(O)):
15439 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
15440
15441 * dispextern.h: Fix a typo in the comment to bidi_type_t.
15442
15443 * chartab.c: Improve commentary for the uniprop_table API.
15444
32413314
EZ
15445 * bidi.c (bidi_paragraph_init): Support zero value of
15446 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
15447 (bidi_initialize): Use uniprop_table instead of including
15448 biditype.h and bidimirror.h.
32413314 15449
9fd8be00
EZ
15450 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
15451 coordinates of the iterator when restoring from ppos_it.
15452 (Bug#9296)
15453
5cf2b69b
KH
154542011-08-14 Kenichi Handa <handa@m17n.org>
15455
15456 * process.c (create_process): Call setup_process_coding_systems
72ad093b 15457 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 15458
daf17d00
EZ
154592011-08-14 Eli Zaretskii <eliz@gnu.org>
15460
15461 * xdisp.c (move_it_in_display_line_to): Don't invoke
15462 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
15463 ppos_it. Fixes vertical cursor motion when line beginning is
15464 covered by an image. (Bug#9296)
15465
08e3161a
JD
154662011-08-14 Jan Djärv <jan.h.d@swipnet.se>
15467
15468 * nsterm.h (ns_run_ascript): Declare.
15469 (NSAPP_DATA2_RUNASSCRIPT): Define.
15470
15471 * nsfns.m (as_script, as_result, as_status): New static variables.
15472 (ns_run_ascript): New function.
5e617bc2 15473 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
15474 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
15475 the event loop. Get status from as_status (Bug#7276).
15476
15477 * nsterm.m (sendEvent): If event is NSApplicationDefined and
15478 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
15479 the event loop (Bug#7276).
15480
a3720aa2
AS
154812011-08-14 Andreas Schwab <schwab@linux-m68k.org>
15482
15483 * gnutls.c (QCgnutls_bootprop_priority)
15484 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
15485 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
15486 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
15487 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
15488 (QCgnutls_bootprop_verify_hostname_error)
15489 (QCgnutls_bootprop_callbacks_verify): Rename from
15490 Qgnutls_bootprop_..., all uses changed.
15491
15492 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
15493 uses changed.
15494
0a0d27fb
PE
154952011-08-14 Paul Eggert <eggert@cs.ucla.edu>
15496
19d5c50c
PE
15497 * xfaces.c (Qframe_set_background_mode): Now static.
15498 * dispextern.h (Qframe_set_background_mode): Remove decl.
15499
0a0d27fb
PE
15500 * process.c (Fnetwork_interface_info): Declare local only if needed.
15501
377538cb
JD
155022011-08-13 Jan Djärv <jan.h.d@swipnet.se>
15503
15504 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
15505 (Fnetwork_interface_list): Allocate in increments of bytes instead
15506 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
15507 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
15508 sockaddr.
15509 (struct ifflag_def): notrailers is smart on OSX.
15510 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
15511 Get hardware address with getifaddrs if available.
15512
08fff70c
EZ
155132011-08-12 Eli Zaretskii <eliz@gnu.org>
15514
15515 * xdisp.c (iterate_out_of_display_property): xassert that
15516 IT->position is set to within IT->object's boundaries. Break from
15517 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
15518 when IT->position is set up wrongly due to some bug.
15519 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
15520 (push_display_prop): Allow GET_FROM_STRING as IT->method on
15521 entry. Force push_it to save on the stack the current
15522 buffer/string position, to be restored by pop_it. Fix flags in
15523 the iterator structure wrt the object coming from a display
15524 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
15525 properties. (Bug#9284)
15526
7be1c708 155272011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 15528
7be1c708
CY
15529 * fontset.c (fontset_get_font_group): Add proper type checks.
15530 (Bug#9172)
aac0c6e3 15531
7be1c708 155322011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 15533
7be1c708
CY
15534 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
15535 and LC_VERSION_MIN_MACOSX.
15536 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
15537 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 15538
97bb72a6
EZ
155392011-08-08 Eli Zaretskii <eliz@gnu.org>
15540
15541 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
15542 no-display-properties-and-no-overlays under bidi display.
15543 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 15544 properties and overlays.
97bb72a6 15545
d5617611
CY
155462011-08-08 Chong Yidong <cyd@stupidchicken.com>
15547
37e11a63
CY
15548 * editfns.c (Fset_time_zone_rule): Document relationship with the
15549 setenv function.
15550
d5617611
CY
15551 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
15552 the font entity extracted from the cache (Bug#8109).
15553
58872834
CY
155542011-08-07 Chong Yidong <cyd@stupidchicken.com>
15555
15556 * composite.c (autocmp_chars): Don't reset point. That is done by
15557 restore_point_unwind (Bug#5984).
15558
75bfc667
JL
155592011-08-07 Juri Linkov <juri@jurta.org>
15560
15561 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
15562 to show the arg `TIME' instead of `TIMEVAL'.
15563
d1410150
EZ
155642011-08-06 Eli Zaretskii <eliz@gnu.org>
15565
15566 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
15567 display property strides EOL and includes a newline, as in
15568 longlines-mode. (Bug#9254)
75b771e4
EZ
15569 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
15570 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
15571
15572 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
15573 is non-zero, even if the data buffer is NULL. Fixes a crash in
15574 vertical-motion with longlines-mode. (Bug#9254)
15575
35928349
EZ
155762011-08-05 Eli Zaretskii <eliz@gnu.org>
15577
ec7cc85b
EZ
15578 * bidi.c <bidi_cache_total_alloc>: Now static.
15579 (bidi_initialize): Initialize bidi_cache_total_alloc.
15580
8b76d6f8 15581 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
15582 cache. (Bug#9221)
15583
15584 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
15585 amount allocated this far in `bidi_cache_total_alloc'.
15586 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
15587 non-zero, only free the data buffer without restoring the cache
15588 contents. All callers changed.
15589
15590 * dispextern.h (bidi_unshelve_cache): Update prototype.
15591
15592 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
15593 (move_it_in_display_line, move_it_to)
15594 (move_it_vertically_backward, move_it_by_lines): Replace the call
15595 to xfree to an equivalent call to bidi_unshelve_cache.
15596 (move_it_in_display_line_to): Fix logic of returning
412b6358 15597 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 15598
e2e2423b
EZ
155992011-08-05 Eli Zaretskii <eliz@gnu.org>
15600
15601 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
15602 came from a string character with a `cursor' property. (Bug#9229)
15603
ae9e757a
JD
156042011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15605
15606 * Makefile.in (LIB_PTHREAD): New variable.
15607 (LIBES): Add LIB_PTHREAD (Bug#9216).
15608
15609 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
15610 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
15611
213bd7f2
AS
156122011-08-04 Andreas Schwab <schwab@linux-m68k.org>
15613
6b02f655 15614 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 15615
99aaf75f
JD
156162011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15617
15618 * xterm.c (x_find_topmost_parent): New function.
15619 (x_set_frame_alpha): Find topmost parent window with
15620 x_find_topmost_parent and set the property there also (bug#9181).
15621 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
15622
c74e9d86
PE
156232011-08-04 Paul Eggert <eggert@cs.ucla.edu>
15624
15625 * callproc.c (Fcall_process): Avoid vfork clobbering
15626 the local vars buffer, coding_systems, current_dir.
15627
640c8776
SM
156282011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
15629
15630 * keymap.c (Fmake_composed_keymap): Move to subr.el.
15631
f26d0e4c
PE
156322011-08-03 Paul Eggert <eggert@cs.ucla.edu>
15633
8a10d76c
PE
15634 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
15635 so that it is not optimized away.
15636
f26d0e4c
PE
15637 * xdisp.c (compute_display_string_pos): Remove unused local.
15638
55439c61
EZ
156392011-08-02 Eli Zaretskii <eliz@gnu.org>
15640
15641 Fix slow cursor motion and scrolling in large buffers with
15642 selective display, like Org Mode buffers. (Bug#9218)
15643
15644 * dispextern.h (struct bidi_it): New member disp_prop_p.
15645
15646 * xdisp.c: Remove one-slot cache of display string positions.
15647 (compute_display_string_pos): Accept an additional argument
5e617bc2 15648 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
15649 for a display string or property. If found, set DISP_PROP_P
15650 non-zero.
15651
15652 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
15653 DISP_PROP_P, and pass it to compute_display_string_pos.
15654 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
15655 non-zero. All callers of bidi_fetch_char changed.
15656
fb33fa43
SM
156572011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
15658
15659 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
15660
b099e063
DM
156612010-12-03 Don March <don@ohspite.net>
15662
15663 * keymap.c (Fdefine_key): Fix non-prefix key error message when
15664 last character M-[char] is translated to ESC [char] (bug#7541).
15665
5cc7f7af
KH
156662011-08-02 Kenichi Handa <handa@m17n.org>
15667
d0fffa3f 15668 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
15669
15670 * chartab.c (uniprop_table): Make it non-static.
15671
525d5e6e
EZ
156722011-08-01 Eli Zaretskii <eliz@gnu.org>
15673
15674 * xdisp.c (forward_to_next_line_start): Accept additional argument
15675 BIDI_IT_PREV, and store into it the state of the bidi iterator had
15676 on the newline.
15677 (reseat_at_next_visible_line_start): Use the bidi iterator state
15678 returned by forward_to_next_line_start to restore the state of
15679 it->bidi_it after backing up to previous newline. (Bug#9212)
15680
31011111
AS
156812011-07-30 Andreas Schwab <schwab@linux-m68k.org>
15682
15683 * regex.c (re_comp): Protoize.
15684 (re_exec): Fix return type.
15685 (regexec): Fix type of `ret'. (Bug#9203)
15686
476371c4
PE
156872011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15688
e5d76069
PE
15689 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
15690 This is needed if max-image-size is a floating-point number.
15691
9a79b20c
AS
156922011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15693
15694 * print.c (print_object): Print empty symbol as ##.
15695
15696 * lread.c (read1): Read ## as empty symbol.
15697
d8c2fa78
AA
156982011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
15699
15700 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
15701 setting frame foreground color (Bug#9175).
15702 (x_set_background_color): Likewise.
15703
ffe57a7a
AA
15704 * nsmenu.m (-setText): Size tooltip dimensions precisely to
15705 contents (Bug#9176).
15706 (EmacsTooltip -init): Remove bezels and add shadows to
15707 tooltip windows.
15708
bf3492a5
AA
15709 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
15710 or scroll bar (Bug#8470).
15711
d55e9c53
AA
15712 * nsfont.m (nsfont_open): Remove assignment to voffset and
15713 unnecessary vars hshink, expand, hd, full_height, min_height.
15714 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
15715
15716 * nsterm.h (nsfont_info): Remove voffset field.
15717
d8c2fa78 157182011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
15719
15720 Implement strike-through and overline on NextStep (Bug#8863).
15721
15722 * nsfont.m (nsfont_open): Use underline position provided by font,
15723 instead of hard-coded value of 2.
15724 (nsfont_draw): Call ns_draw_text_decoration instead.
15725
15726 * nsterm.h: Add declaration for ns_draw_text_decoration.
15727
15728 * nsterm.m (ns_draw_text_decoration): New function for drawing
15729 underline, overline, and strike-through.
15730 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
15731 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 15732 accommodate underlining, etc.
4843aac3 15733
4cc60b9b
EZ
157342011-07-28 Eli Zaretskii <eliz@gnu.org>
15735
bc7ece87
EZ
15736 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
15737 default.
4cc60b9b 15738
476371c4
PE
157392011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15740
66606eea
PE
15741 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
15742 Without this fix, if a signal arrives just after memory fills up,
15743 'malloc' might be invoked reentrantly.
15744
476371c4
PE
15745 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
15746 In other words, assume that every image size is allowed, on non-X
15747 hosts. This assumption is probably wrong, but it lets Emacs compile.
15748
f3fcc40d
AS
157492011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15750
15751 * regex.c (re_iswctype): Convert return values to boolean.
15752
350c992f
EZ
157532011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
15754
15755 * xdisp.c (compute_display_string_pos): Don't use cached display
15756 string position if the buffer had its restriction changed.
15757 (Bug#9184)
15758
5266b4bb
PE
157592011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15760
15761 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15762
2573a837 157632011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 15764
41f55ccd 15765 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 15766
39e378da
PE
15767 * bidi.c: Integer size and overflow fixes.
15768 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
15769 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
15770 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15771 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
15772 (bidi_find_other_level_edge):
15773 Use ptrdiff_t instead of EMACS_INT where either will do.
15774 This works better on 32-bit hosts configured --with-wide-int.
15775 (bidi_cache_ensure_space): Check for size-calculation overflow.
15776 Use % rather than repeated addition, for better worst-case speed.
15777 Don't set bidi_cache_size until after xrealloc returns, because it
15778 might not return.
15779 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
15780 (bidi_cache_ensure_space): Also check that the bidi cache size
15781 does not exceed that of the largest Lisp string or buffer. See Eli
15782 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 15783
5e927815
PE
15784 * alloc.c (__malloc_size_t): Remove.
15785 All uses replaced by size_t. See Andreas Schwab's note
15786 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
15787
ca4aa935
PE
15788 * image.c: Improve checking for integer overflow.
15789 (check_image_size): Assume that f is nonnull, since
15790 it is always nonnull in practice. This is one less thing to
15791 worry about when checking for integer overflow later.
15792 (x_check_image_size): New function, which checks for integer
15793 overflow issues inside X.
15794 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
15795 This removes the need for a memory_full check.
15796 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
15797 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
15798 (xbm_read_bitmap_data): Change locals back to 'int', since
15799 their values must fit in 'int'.
15800 (xpm_load_image, png_load, tiff_load):
15801 Invoke x_create_x_image_and_pixmap earlier,
15802 to avoid much needless work if the image is too large.
15803 (tiff_load): Treat overly large images as if
15804 x_create_x_image_and_pixmap failed, not as malloc failures.
15805 (gs_load): Use x_check_image_size.
15806
5f8f9cc2
PE
15807 * gtkutil.c: Omit integer casts.
15808 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
15809 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
15810
5adf60bc
PE
15811 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
15812
c8907a93
PE
15813 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
15814 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
15815 would wrongly return t on a 64-bit host.
15816
e3c25c68
PE
15817 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
15818 The plain *_OVERFLOW macros run afoul of GCC bug 49705
15819 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
15820 and therefore cause GCC to emit a bogus diagnostic in some cases.
15821
3f791afe
PE
15822 * image.c: Integer signedness and overflow and related fixes.
15823 This is not an exhaustive set of fixes, but it's time to
15824 record what I've got.
15825 (lookup_pixel_color, check_image_size): Remove redundant decls.
15826 (check_image_size): Don't assume that arbitrary EMACS_INT values
15827 fit in 'int', or that arbitrary 'double' values fit in 'int'.
15828 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
15829 (tiff_load, imagemagick_load_image):
15830 Check for overflow in size calculations.
15831 (x_create_x_image_and_pixmap): Remove unnecessary test for
15832 xmalloc returning NULL; that can't happen.
15833 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
15834 (xpm_color_bucket): Use better integer hashing function.
15835 (xpm_cache_color): Don't possibly over-allocate memory.
15836 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
15837 (gif_memory_source):
15838 Use ptrdiff_t, not int or size_t, to record sizes.
15839 (png_load): Don't assume values greater than 2**31 fit in 'int'.
15840 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
15841 either works, as we prefer signed integers.
15842 (tiff_read_from_memory, tiff_write_from_memory):
15843 Return tsize_t, not size_t, since that's what the TIFF API wants.
15844 (tiff_read_from_memory): Don't fail simply because the read would
15845 go past EOF; instead, return a short read.
15846 (tiff_load): Omit no-longer-needed casts.
15847 (Fimagemagick_types): Don't assume size fits into 'int'.
15848
3cc5a532
PE
15849 Improve hashing quality when configured --with-wide-int.
15850 * fns.c (hash_string): New function, taken from sxhash_string.
15851 Do not discard information about ASCII character case; this
15852 discarding is no longer needed.
15853 (sxhash-string): Use it. Change sig to match it. Caller changed.
15854 * lisp.h: Declare it.
15855 * lread.c (hash_string): Remove, since we now use fns.c's version.
15856 The fns.c version returns a wider integer if --with-wide-int is
15857 specified, so this should help the quality of the hashing a bit.
15858
b312a492
PE
15859 * emacs.c: Integer overflow minor fix.
15860 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
15861 Define only if GNU_LINUX.
15862 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
15863
dfd153ae
PE
15864 * dispnew.c: Integer signedness and overflow fixes.
15865 Remove unnecessary forward decls, that were a maintenance hassle.
15866 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
15867 All uses changed.
15868 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
15869 (scrolling_window): Use ptrdiff_t, not int, for byte count.
15870 (prepare_desired_row, line_draw_cost):
15871 Use int, not unsigned, where either works.
15872 (save_current_matrix, restore_current_matrix):
15873 Use ptrdiff_t, not size_t, where either works.
15874 (init_display): Check for overflow more accurately, and without
15875 relying on undefined behavior.
15876
a81d11a3
PE
15877 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
15878 Remove, replacing with the new symbols in lisp.h. All uses changed.
15879 * fileio.c (make_temp_name):
15880 * filelock.c (lock_file_1, lock_file):
15881 * xdisp.c (message_dolog):
15882 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
15883 Use pMd etc. instead.
15884 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
15885 replacing the pWIDE etc. symbols removed from editfns.c.
15886
3300e6fd
PE
15887 * keyboard.h (num_input_events): Now uintmax_t.
15888 This is (very slightly) less likely to mess up due to wraparound.
15889 All uses changed.
15890
fd05c7e9
PE
15891 * buffer.c: Integer signedness fixes.
15892 (alloc_buffer_text, enlarge_buffer_text):
15893 Use ptrdiff_t rather than size_t when either will do, as we prefer
15894 signed integers.
15895
903fe15d
PE
15896 * alloc.c: Integer signedness and overflow fixes.
15897 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
15898 (__malloc_size_t): Default to size_t, not to int.
15899 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
15900 (Fgarbage_collect, mark_object_loop_halt, mark_object):
15901 Prefer ptrdiff_t to size_t when either would do, as we prefer
15902 signed integers.
15903 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
15904 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
15905 Now const. Initialize with values that are in range even if char
15906 is signed.
15907 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
15908 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
15909 These functions do the right thing with sizes > 2**32.
15910 (check_depth): Now ptrdiff_t, not int.
15911 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
15912 Adjust to new way of storing sizes. Check for size overflow bugs
15913 in rest of code.
15914 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
15915 slightly wrong anyway, as it missed one instance of
15916 XMALLOC_OVERRUN_CHECK_OVERHEAD.
15917 (refill_memory_reserve): Omit needless cast to size_t.
15918 (mark_object_loop_halt): Mark as externally visible.
15919
ac82cc6a
PE
15920 * xselect.c: Integer signedness and overflow fixes.
15921 (Fx_register_dnd_atom, x_handle_dnd_message):
15922 Use ptrdiff_t, not size_t, since we prefer signed.
15923 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
15924 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
15925 x_dnd_atoms_size and x_dnd_atoms_length.
15926
c2d1e36d
PE
15927 * doprnt.c: Prefer signed to unsigned when either works.
15928 * eval.c (verror):
15929 * doprnt.c (doprnt):
15930 * lisp.h (doprnt):
15931 * xdisp.c (vmessage):
15932 Use ptrdiff_t, not size_t, when using or implementing doprnt,
15933 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
15934 prefer signed arithmetic to avoid comparison confusion.
15935 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
15936 but is a bit tricky.
15937
0e926e56
PE
15938 Assume freestanding C89 headers, string.h, stdlib.h.
15939 * data.c, doprnt.c, floatfns.c, print.c:
15940 Include float.h unconditionally.
15941 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
15942 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
15943 * regex.c: Likewise for stddef.h, string.h.
15944 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
15945 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
15946 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
15947 (STDC_HEADERS): Remove obsolete defines.
15948 * sysdep.c: Include limits.h unconditionally.
15949
9cfdb3ec
PE
15950 Assume support for memcmp, memcpy, memmove, memset.
15951 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
15952 * regex.c (memcmp, memcpy):
15953 Remove; we assume C89 now.
15954
15955 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
15956 (__malloc_safe_bcopy): Remove; no longer needed.
15957
cf950e6b 15958 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
15959 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
15960 well either way, and we prefer signed to unsigned.
15961
dbf38e02
LMI
159622011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
15963
15964 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
15965 closes the connection while we're reading (bug#9182).
15966
d6f0886c 159672011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 15968
d6f0886c
JD
15969 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
15970 are specified (Bug#9168).
24e0f6b1 15971
2eb1f9e6
PE
159722011-07-25 Paul Eggert <eggert@cs.ucla.edu>
15973
15974 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
15975 Found by GCC static checking and --with-wide-int on a 32-bit host.
15976
22381272 159772011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
15978
15979 * xdisp.c (compute_display_string_pos): Fix logic of caching
15980 previous display string position. Initialize cached_prev_pos to
15981 -1. Fixes slow-down at the beginning of a buffer.
15982
f25e39b4
EZ
159832011-07-24 Eli Zaretskii <eliz@gnu.org>
15984
15985 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
15986 for attrs[LFACE_FONTSET_INDEX].
15987
04c4b52e
PE
159882011-07-23 Paul Eggert <eggert@cs.ucla.edu>
15989
15990 * xml.c (parse_region): Remove unused local
15991 that was recently introduced.
15992
c1734fbd
EZ
159932011-07-23 Eli Zaretskii <eliz@gnu.org>
15994
be18c5a5
EZ
15995 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
15996 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
15997
c1734fbd
EZ
15998 * xdisp.c (move_it_in_display_line_to): Record the best matching
15999 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
16000 exit if none of the characters scanned was an exact match.
16001 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
16002 when exact match is impossible due to invisible text, and the
16003 lines are truncated.
16004
a258d627
JD
160052011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16006
16007 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16008 for OSX >= 10.7.
16009
b6d5a689
EZ
160102011-07-22 Eli Zaretskii <eliz@gnu.org>
16011
0f74f785
EZ
16012 Fix a significant slow-down of cursor motion with C-n, C-p,
16013 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
16014 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 16015 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
16016 (next_element_from_buffer): Call compute_stop_pos_backwards to
16017 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
16018 base_level_stop.
16019 (reseat): Don't look for prev_stop, as that could mean a very long
16020 run.
16021 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
16022 <cached_disp_overlay_modiff>: Cache for last found display string
16023 position.
551918c1 16024 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
16025 about the same buffer in the same area of character positions, and
16026 the buffer wasn't changed since the time the display string
16027 position was cached.
551918c1 16028
b2d0c91a
EZ
160292011-07-22 Eli Zaretskii <eliz@gnu.org>
16030
16031 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
16032 is an integer, which is important for empty lines. (Bug#9149)
16033
043604ee
CY
160342011-07-22 Chong Yidong <cyd@stupidchicken.com>
16035
16036 * frame.c (Fmodify_frame_parameters): In tty case, update the
16037 default face if necessary (Bug#4238).
16038
da4adb04
CY
160392011-07-21 Chong Yidong <cyd@stupidchicken.com>
16040
16041 * editfns.c (Fstring_to_char): No need to explain what a character
16042 is in the docstring (Bug#6576).
16043
9abd0532
LMI
160442011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16045
16046 * xml.c (parse_region): Make sure we always return a tree.
16047
36881d16
HK
160482011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
16049
16050 * xml.c (parse_region): If a document contains only comments,
16051 return that, too.
16052
1e98674d
LMI
160532011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16054
16055 * xml.c (make_dom): Return comments, too.
16056
590bd467
PE
160572011-07-19 Paul Eggert <eggert@cs.ucla.edu>
16058
16059 Port to OpenBSD.
16060 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
16061 and the surrounding thread.
16062 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
16063 rather than fgets, and retry after EINTR. Otherwise, 'emacs
16064 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
16065 timer goes off.
16066 * s/openbsd.h (BROKEN_SIGIO): Define.
16067 * unexelf.c (unexec) [__OpenBSD__]:
16068 Don't update the .mdebug section of the Alpha COFF symbol table.
16069
f41628b2
LMI
160702011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16071
16072 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
16073 (bug#8460).
16074
b59b67c5
PE
160752011-07-18 Paul Eggert <eggert@cs.ucla.edu>
16076
15e3a074
PE
16077 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
16078 This fixes some race conditions on the permissions of any newly
16079 created file.
16080
41bed37d
PE
16081 * alloc.c (valid_pointer_p): Use pipe, not open.
16082 This fixes some permissions issues when debugging.
16083
b59b67c5
PE
16084 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
16085 If fchown fails to set both uid and gid, try to set just gid,
16086 as that is sometimes allowed. Adjust the file's mode to eliminate
16087 setuid or setgid bits that are inappropriate if fchown fails.
16088
925a6be7
SM
160892011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
16090
16091 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
16092 to compare Lisp_Objects.
16093 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
16094 global_gnutls_log_level, don't mistake it for a Lisp_Object.
16095 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
16096
52968808
AS
160972011-07-17 Andreas Schwab <schwab@linux-m68k.org>
16098
0a6a104b
AS
16099 * lread.c (read_integer): Unread even EOF character.
16100 (read1): Likewise. Properly record start position of symbol.
16101
52968808
AS
16102 * lread.c (read1): Read `#:' as empty uninterned symbol if no
16103 symbol character follows.
16104
9e381cdd
PE
161052011-07-17 Paul Eggert <eggert@cs.ucla.edu>
16106
16107 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
16108 This works around a problem with the previous change to Fcopy_file.
16109 Recent glibc declares fchown with __attribute__((warn_unused_result)),
16110 and without this change, GCC might complain about discarding
16111 fchown's return value.
16112
b5641435
JB
161132011-07-16 Juanma Barranquero <lekktu@gmail.com>
16114
16115 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
16116
a8031457
PE
161172011-07-16 Paul Eggert <eggert@cs.ucla.edu>
16118
16119 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
16120
dd889327
LMI
161212011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
16122
750c33f7
LMI
16123 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
16124 it's used from the C level.
16125
dd889327
LMI
16126 * process.c: Use the same condition for POLL_FOR_INPUT in both
16127 keyboard.c and process.c (bug#1858).
16128
87e86684
LM
161292011-07-09 Lawrence Mitchell <wence@gmx.li>
16130
16131 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
16132 (Fgnutls_boot): Use it.
16133
64348f40
AS
161342011-07-15 Andreas Schwab <schwab@linux-m68k.org>
16135
16136 * doc.c (Fsubstitute_command_keys): Revert last change.
16137
1d698799
LMI
161382011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
16139
f863868c
LMI
16140 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
16141 quotes the next character, and doesn't affect other longer
16142 sequences (bug#8935).
16143
1d698799
LMI
16144 * lread.c (syms_of_lread): Clarify that is isn't only
16145 `eval-buffer' and `eval-defun' that's affected by
16146 `lexical-binding' (bug#8460).
16147
aa4b6df6
EZ
161482011-07-15 Eli Zaretskii <eliz@gnu.org>
16149
16150 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 16151 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 16152
5d856da6
PE
161532011-07-14 Paul Eggert <eggert@cs.ucla.edu>
16154
ad6042bb
PE
16155 Fix minor problems found by static checking.
16156 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
16157 (elsz): Now a signed constant, not a size_t var. We prefer signed
16158 types to unsigned, to avoid integer comparison confusion. Without
16159 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
16160 "cannot optimize loop, the loop counter may overflow", a symptom
16161 of the confusion.
f00bbb22 16162 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
16163 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
16164
6468f31c
LMI
161652011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16166
49080b10
LMI
16167 * search.c (Fre_search_backward): Mention `case-fold-search' in
16168 all the re_search_* functions (bug#8138).
16169
6468f31c
LMI
16170 * keyboard.c (Fopen_dribble_file): Document when the file is
16171 closed (bug#8056).
16172
c965adc5
EZ
161732011-07-14 Eli Zaretskii <eliz@gnu.org>
16174
df9733bf
EZ
16175 * bidi.c (bidi_dump_cached_states): Fix format of displaying
16176 bidi_cache_idx.
16177
0bb23927
EZ
16178 Support bidi reordering of display and overlay strings.
16179 * xdisp.c (compute_display_string_pos)
16180 (compute_display_string_end): Accept additional argument STRING.
16181 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
16182 (reseat_to_string): Initialize bidi_it->string.s and
16183 bidi_it->string.schars.
16184 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
16185 NULL (avoids a crash in bidi_paragraph_init).
16186 Initialize itb.string.lstring.
0bb23927
EZ
16187 (init_iterator): Call bidi_init_it only of a valid
16188 buffer position was specified. Initialize paragraph_embedding to
16189 L2R.
16190 (reseat_to_string): Initialize the bidi iterator.
16191 (display_string): If we need to ignore text properties of
16192 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
16193 original value of -1 will not work with bidi.)
16194 (compute_display_string_pos): First arg is now struct
16195 `text_pos *'; all callers changed. Support display properties on
16196 Lisp strings.
16197 (compute_display_string_end): Support display properties on Lisp
16198 strings.
16199 (init_iterator, reseat_1, reseat_to_string): Initialize the
16200 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
16201 when iterating on a string not from display properties).
640c8776
SM
16202 (compute_display_string_pos, compute_display_string_end):
16203 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
16204 arrow keys.
16205 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
16206 base_level_stop; instead, set base_level_stop to BEGV.
16207 Fixes crashes in vertical-motion.
0bb23927
EZ
16208 (next_element_from_buffer): Improve commentary for when
16209 the iterator is before prev_stop.
16210 (init_iterator): Initialize bidi_p from the default value of
16211 bidi-display-reordering, not from buffer-local value. Use the
16212 buffer-local value only if initializing for buffer iteration.
16213 (handle_invisible_prop): Support invisible properties on strings
16214 that are being bidi-reordered.
16215 (set_iterator_to_next): Support bidi reordering of C strings and
16216 Lisp strings.
16217 (next_element_from_string): Support bidi reordering of Lisp
16218 strings.
16219 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
16220 (display_string): Support display of R2L glyph rows.
16221 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
16222 (init_iterator): Don't initialize it->bidi_p for strings
16223 here.
16224 (reseat_to_string): Initialize it->bidi_p for strings here.
16225 (next_element_from_string, next_element_from_c_string)
16226 (next_element_from_buffer): Add xassert's for correspondence
16227 between IT's object being iterated and it->bidi_it.string
16228 structure.
16229 (face_before_or_after_it_pos): Support bidi iteration.
16230 (next_element_from_c_string): Handle the case of the first string
16231 character that is not the first one in the visual order.
16232 (get_visually_first_element): New function, refactored from common
16233 parts of next_element_from_buffer, next_element_from_string, and
16234 next_element_from_c_string.
16235 (tool_bar_lines_needed, redisplay_tool_bar)
16236 (display_menu_bar): Force left-to-right direction. Add a FIXME
16237 comment for making that be controlled by a user option.
16238 (push_it, pop_it): Save and restore the state of the
16239 bidi iterator. Save and restore the bidi_p flag.
16240 (pop_it): Iterate out of display property for string iteration as
16241 well.
16242 (iterate_out_of_display_property): Support iteration over strings.
16243 (handle_single_display_spec): Set up it->bidi_it for iteration
16244 over a display string, and call bidi_init_it.
16245 (handle_single_display_spec, next_overlay_string)
16246 (get_overlay_strings_1, push_display_prop): Set up the bidi
16247 iterator for displaying display or overlay strings.
16248 (forward_to_next_line_start): Don't use the shortcut if
16249 bidi-iterating.
16250 (back_to_previous_visible_line_start): If handle_display_prop
16251 pushed the iterator stack, restore the internal state of the bidi
16252 iterator by calling bidi_pop_it same number of times.
16253 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
16254 and we are bidi-iterating, don't decrement the iterator position;
16255 instead, set the first_elt flag in the bidi iterator, to produce
16256 the same effect.
16257 (reseat_1): Remove redundant setting of string_from_display_prop_p.
16258 (push_display_prop): xassert that we are iterating a buffer.
16259 (push_it, pop_it): Save and restore paragraph_embedding member.
16260 (handle_single_display_spec, next_overlay_string)
16261 (get_overlay_strings_1, reseat_1, reseat_to_string)
16262 (push_display_prop): Set up the `unibyte' member of bidi_it.string
16263 correctly. Don't assume unibyte strings are not bidi-reordered.
16264 (compute_display_string_pos)
16265 (compute_display_string_end): Fix handling the case of C string.
16266 (push_it, pop_it): Save and restore from_disp_prop_p.
16267 (handle_single_display_spec, push_display_prop): Set the
16268 from_disp_prop_p flag.
16269 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
16270 (pop_it): Call iterate_out_of_display_property only if we are
16271 popping after iteration over a string that came from a display
16272 property. Fix a typo in popping stretch info. Add an assertion
16273 for verifying that the iterator position is in sync with the bidi
16274 iterator.
16275 (handle_single_display_spec, get_overlay_strings_1)
16276 (push_display_prop): Fix initialization of paragraph direction for
16277 string when that of the parent object is not yet determined.
16278 (reseat_1): Call bidi_init_it to resync the bidi
16279 iterator with IT's position. (Bug#7616)
16280 (find_row_edges): If ROW->start.pos gives position
16281 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
16282 (handle_stop, back_to_previous_visible_line_start, reseat_1):
16283 Reset the from_disp_prop_p flag.
16284 (SAVE_IT, RESTORE_IT): New macros.
16285 (pos_visible_p, face_before_or_after_it_pos)
16286 (back_to_previous_visible_line_start)
16287 (move_it_in_display_line_to, move_it_in_display_line)
16288 (move_it_to, move_it_vertically_backward, move_it_by_lines)
16289 (try_scrolling, redisplay_window, display_line): Use them when
16290 saving a temporary copy of the iterator and restoring it back.
16291 (back_to_previous_visible_line_start, reseat_1)
16292 (init_iterator): Empty the bidi cache "stack".
16293 (move_it_in_display_line_to): If iterator ended up at
16294 EOL, but we never saw any buffer positions smaller than
16295 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
16296 motion in bidi-reordered lines.
16297 (move_it_in_display_line_to): Record prev_method and prev_pos
16298 immediately before the call to set_iterator_to_next. Fixes cursor
16299 motion in bidi-reordered lines with stretch glyphs and strings
16300 displayed in margins. (Bug#8133) (Bug#8867)
16301 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
16302 TO_CHARPOS.
640c8776
SM
16303 (pos_visible_p): Support positions in bidi-reordered lines.
16304 Save and restore bidi cache.
0bb23927
EZ
16305
16306 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
16307 (bidi_paragraph_info): Delete unused struct.
16308 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
16309 (bidi_cache_start): New variable.
16310 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
16311 to zero.
16312 (bidi_cache_fetch_state, bidi_cache_search)
16313 (bidi_cache_find_level_change, bidi_cache_iterator_state)
16314 (bidi_cache_find, bidi_peek_at_next_level)
16315 (bidi_level_of_next_char, bidi_find_other_level_edge)
16316 (bidi_move_to_visually_next): Compare cache index with
16317 bidi_cache_start rather than with zero.
16318 (bidi_fetch_char): Accept new argument STRING; all callers
16319 changed. Support iteration over a string. Support strings with
16320 display properties. Support unibyte strings. Fix the type of
16321 `len' according to what STRING_CHAR_AND_LENGTH expects.
16322 (bidi_paragraph_init, bidi_resolve_explicit_1)
16323 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
16324 (bidi_level_of_next_char, bidi_move_to_visually_next):
16325 Support iteration over a string.
0bb23927
EZ
16326 (bidi_set_sor_type, bidi_resolve_explicit_1)
16327 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
16328 can now be zero (for strings); special values 0 and -1 were
16329 changed to -1 and -2, respectively.
16330 (bidi_char_at_pos): New function.
16331 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
16332 Call it instead of FETCH_MULTIBYTE_CHAR.
16333 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
16334 initialized to valid values.
16335 (bidi_init_it): Don't initialize charpos and bytepos with invalid
16336 values.
16337 (bidi_level_of_next_char): Allow the sentinel "position" to pass
16338 the test for valid cached positions. Fix the logic for looking up
16339 the sentinel state in the cache. GCPRO the Lisp string we are
16340 iterating.
16341 (bidi_push_it, bidi_pop_it): New functions.
16342 (bidi_initialize): Initialize the bidi cache start stack pointer.
16343 (bidi_cache_ensure_space): New function, refactored from part of
16344 bidi_cache_iterator_state. Don't assume the required size is just
16345 one BIDI_CACHE_CHUNK away.
16346 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
16347 (bidi_count_bytes, bidi_char_at_pos): New functions.
16348 (bidi_cache_search): Don't assume bidi_cache_last_idx is
16349 always valid if bidi_cache_idx is valid.
16350 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
16351 is valid if it's going to be used.
16352 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
16353 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
16354 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16355 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
16356 (bidi_find_other_level_edge, bidi_cache_start_stack):
16357 All variables related to cache indices are now EMACS_INT.
c965adc5 16358
0bb23927
EZ
16359 * dispextern.h (struct bidi_string_data): New structure.
16360 (struct bidi_it): New member `string'. Make flag members be 1-bit
16361 fields, and put them last in the struct.
640c8776
SM
16362 (compute_display_string_pos, compute_display_string_end):
16363 Update prototypes.
0bb23927
EZ
16364 (bidi_push_it, bidi_pop_it): Add prototypes.
16365 (struct iterator_stack_entry): New members bidi_p,
16366 paragraph_embedding, and from_disp_prop_p.
16367 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
16368 (bidi_shelve_cache, bidi_unshelve_cache):
16369 Declare prototypes.
0bb23927
EZ
16370
16371 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
16372 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
16373 and vector-like objects.
16374
16375 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
16376 cache around display iteration.
16377
16378 * window.c (Fwindow_end, window_scroll_pixel_based)
16379 (displayed_window_lines, Frecenter): Save and restore the bidi
16380 cache around display iteration.
16381
3bbd2265
LMI
163822011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16383
16384 * editfns.c (Fdelete_region): Clarify the use of the named
16385 parameters (bug#6788).
16386
adc47434
MR
163872011-07-14 Martin Rudalics <rudalics@gmx.at>
16388
16389 * indent.c (Fvertical_motion): Set and restore w->pointm when
16390 saving and restoring the window's buffer (Bug#9006).
16391
837c31f8
LMI
163922011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
16393
16394 * editfns.c (Fstring_to_char): Clarify just what is returned
16395 (bug#6576). Text by Eli Zaretskii.
16396
ac389d0c
JB
163972011-07-13 Juanma Barranquero <lekktu@gmail.com>
16398
16399 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
16400
0be0ce47
EZ
164012011-07-13 Eli Zaretskii <eliz@gnu.org>
16402
16403 * buffer.c (mmap_find): Fix a typo.
16404
cd18e7e3
JB
164052011-07-13 Johan Bockgård <bojohan@gnu.org>
16406
16407 Fix execution of x selection hooks.
16408 * xselect.c (Qx_lost_selection_functions)
16409 (Qx_sent_selection_functions): New vars.
16410 (syms_of_xselect): DEFSYM them.
16411 (x_handle_selection_request): Pass Qx_sent_selection_functions
16412 rather than Vx_sent_selection_functions to Frun_hook_with_args.
16413 (x_handle_selection_clear,x_clear_frame_selections):
16414 Pass Qx_lost_selection_functions rather than
16415 Vx_lost_selection_functions to Frun_hook_with_args.
16416
47ea7f44
PE
164172011-07-13 Paul Eggert <eggert@cs.ucla.edu>
16418
ac389d0c 16419 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
16420 The old code sometimes used this field without initializing it.
16421
47ea7f44
PE
16422 * alloc.c (gc_sweep): Don't read past end of array.
16423 In theory, the old code could also have corrupted Emacs internals,
16424 though it'd be very unlikely.
16425
bc985c87
AS
164262011-07-12 Andreas Schwab <schwab@linux-m68k.org>
16427
16428 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 16429 argument. (Bug#4026)
bc985c87 16430
0cf34688
LMI
164312011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
16432
b3dadd76
LMI
16433 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
16434 key" (bug#4257).
16435
0cf34688
LMI
16436 * window.c (Fset_window_start): Doc fix (bug#4199).
16437 (Fset_window_hscroll): Ditto.
16438
270768cd
PE
164392011-07-12 Paul Eggert <eggert@cs.ucla.edu>
16440
077e3dda 16441 Fix minor new problems caught by GCC 4.6.1.
270768cd 16442 * term.c (init_tty): Remove unused local.
490011a6 16443 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 16444 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 16445 not used otherwise.
270768cd 16446
b1f58454
CY
164472011-07-12 Chong Yidong <cyd@stupidchicken.com>
16448
16449 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
16450
22b9578d
LMI
164512011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16452
6e70ab07
LMI
16453 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
16454 are the mini-buffer and the echo area (bug#3320).
16455
22b9578d
LMI
16456 * term.c (init_tty): Remove support for supdup, c10 and perq
16457 terminals, which are no longer supported (bug#1482).
16458
8974cc9f
JB
164592011-07-10 Johan Bockgård <bojohan@gnu.org>
16460
16461 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
16462
a560d974
JD
164632011-07-10 Jan Djärv <jan.h.d@swipnet.se>
16464
16465 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
16466 for non-popups (Bug#3642).
16467
1dae0f0a
AS
164682011-07-10 Andreas Schwab <schwab@linux-m68k.org>
16469
268c2c36 16470 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 16471 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
16472 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
16473 * cm.c (losecursor): Likewise.
1dae0f0a
AS
16474 * data.c (fmod): Likewise.
16475 * dispnew.c (swap_glyphs_in_rows): Likewise.
16476 * emacs.c (memory_warning_signal): Likewise.
16477 * floatfns.c (float_error): Likewise.
16478 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
16479 (otf_open, font_otf_capability, generate_otf_features)
16480 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
16481 Likewise.
16482 * image.c (pbm_read_file): Likewise.
16483 * indent.c (string_display_width): Likewise.
16484 * intervals.c (check_for_interval, search_for_interval)
16485 (inc_interval_count, count_intervals, root_interval)
16486 (adjust_intervals_for_insertion, make_new_interval): Likewise.
16487 * lread.c (defalias): Likewise.
268c2c36 16488 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
16489 * regex.c (set_image_of_range_1, set_image_of_range)
16490 (regex_grow_registers): Likewise.
16491 * sysdep.c (strerror): Likewise.
16492 * termcap.c (valid_filename_p, tprint, main): Likewise.
16493 * tparam.c (main): Likewise.
16494 * unexhp9k800.c (run_time_remap, save_data_space)
16495 (update_file_ptrs, read_header, write_header, calculate_checksum)
16496 (copy_file, copy_rest, display_header): Likewise.
16497 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
16498 Likewise.
16499 * xdisp.c (check_it): Likewise.
16500 * xfaces.c (register_color, unregister_color, unregister_colors):
16501 Likewise.
16502 * xfns.c (print_fontset_result): Likewise.
16503 * xrdb.c (member, fatal, main): Likewise.
16504
99033785
PE
165052011-07-10 Paul Eggert <eggert@cs.ucla.edu>
16506
16507 Fix minor problems found by static checking (Bug#9031).
16508 * chartab.c (char_table_set_range, map_sub_char_table):
16509 Remove unused locals.
16510 (uniprop_table): Now static.
16511 * composite.c (_work_char): Remove unused static var.
16512
9cb2ac56
JB
165132011-07-09 Juanma Barranquero <lekktu@gmail.com>
16514
16515 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
16516
f25661f0
JD
165172011-07-09 Jan Djärv <jan.h.d@swipnet.se>
16518
16519 * gtkutil.c (qttip_cb): Remove code without function.
16520
8278c4fe
EZ
165212011-07-09 Eli Zaretskii <eliz@gnu.org>
16522
16523 * w32.c (pthread_sigmask): New stub.
16524
1692ae2d 165252011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 16526
8a6ebd58 16527 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
16528 sigprocmask is portable only for single-threaded applications, and
16529 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
16530 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
16531 (LIBES): Use it.
16532 * callproc.c (Fcall_process):
16533 * process.c (create_process):
16534 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
16535 Use pthread_sigmask, not sigprocmask.
123403e4 16536
1b854618
JD
165372011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16538
16539 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
16540 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
16541 wrong (Bug#8591).
16542
3fe4b549
JD
165432011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16544
0ce7e563
JD
16545 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
16546 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
16547 (xg_hide_tooltip): Fix comment.
16548
3fe4b549
JD
16549 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
16550 in registerServicesMenuSendTypes.
16551 (validRequestorForSendType): Don't check ns_return_types.
16552
16553 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
16554 ns_return_type.
16555
5df75e47
JR
165562011-07-08 Jason Rumney <jasonr@gnu.org>
16557
22610910
JR
16558 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
16559 SH_SHOW for hidden windows (Bug#5482).
16560
5df75e47
JR
16561 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
16562 frame struct members of non-existent frames (Bug#6284).
16563
699c10bd
JD
165642011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16565
4393663b
JD
16566 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
16567 variable firstTime not needed on OSX >= 10.6.
16568 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
16569 >= 10.5. Use setKnobProportion, setDoubleValue.
16570
16571 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
16572 (MAC_OS_X_VERSION_10_5): Define if not defined.
16573 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
16574 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
16575 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
16576
16577 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 16578 cString and lossyCString on OSX >= 10.4.
4393663b 16579
58179cce 16580 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
16581 sizeToFit on OSX >= 10.2.
16582
16583 * nsimage.m (allocInitFromFile): Don't use deprecated method
16584 bestRepresentationForDevice on OSX >= 10.6.
16585
16586 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
16587 to avoid warning.
16588
16589 * emacs.c: Declare unexec_init_emacs_zone.
16590
a63e0781
JD
16591 * nsgui.h: Fix compiler warning about gnulib redefining verify.
16592
699c10bd
JD
16593 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
16594
16595 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
16596 on svcsMenu (Bug#8842).
16597
16598 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
16599 ns_return_types.
16600 (Fns_list_services): Just return Qnil on 10.6, code not working there.
16601
16602 * nsterm.m (QUTF8_STRING): Declare.
16603 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
16604 (validRequestorForSendType): Return type is (id).
16605 Change indexOfObjectIdenticalTo to indexOfObject.
16606 Check if we have local selection before returning self (Bug#8842).
16607 (writeSelectionToPasteboard): Put local selection into paste board
16608 if we have a local selection (Bug#8842).
16609 (syms_of_nsterm): DEFSYM QUTF8_STRING.
16610
16611 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
16612 (ns_get_local_selection): Declare.
16613
54e10184
LMI
166142011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
16615
9888ff71
LMI
16616 * keymap.c (describe_map_tree): Don't insert a double newline at
16617 the end of the buffer (bug#1169) and return whether we inserted
16618 something.
16619
54e10184
LMI
16620 * callint.c (Fcall_interactively): Change "reading args" to
16621 "providing args" to try to clarify what it does (bug#1010).
16622
15fa4783
KH
166232011-07-07 Kenichi Handa <handa@m17n.org>
16624
16625 * composite.c (composition_compute_stop_pos): Ignore a static
16626 composition starting before CHARPOS (Bug#8915).
16627
16628 * xdisp.c (handle_composition_prop): Likewise.
16629
a8815b00
EZ
166302011-07-07 Eli Zaretskii <eliz@gnu.org>
16631
16632 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
16633 (Bug#9015)
16634
ef7b981d 166352011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
16636
16637 * character.h (unicode_category_t): New enum type.
16638
16639 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
16640 (Qchar_code_property_table): New variable.
16641 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
16642 (UNIPROP_COMPRESSED_FORM_P): New macros.
16643 (char_table_ascii): Uncompress the compressed values.
16644 (sub_char_table_ref): New arg is_uniprop. Callers changed.
16645 Uncompress the compressed values.
ac389d0c 16646 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
16647 (char_table_ref_and_range): Uncompress the compressed values.
16648 (sub_char_table_set): New arg is_uniprop. Callers changed.
16649 Uncompress the compressed values.
16650 (sub_char_table_set_range): Args changed. Callers changed.
16651 (char_table_set_range): Adjuted for the above change.
16652 (map_sub_char_table): Delete args default_val and parent. Add arg
16653 top. Give decoded values to a Lisp function.
640c8776 16654 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
16655 values to a Lisp function. Gcpro more variables.
16656 (uniprop_table_uncompress)
16657 (uniprop_decode_value_run_length): New functions.
16658 (uniprop_decoder, uniprop_decoder_count): New variables.
16659 (uniprop_get_decoder, uniprop_encode_value_character)
16660 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
16661 New functions.
16662 (uniprop_encoder, uniprop_encoder_count): New variables.
16663 (uniprop_get_encoder, uniprop_table)
16664 (Funicode_property_table_internal, Fget_unicode_property_internal)
16665 (Fput_unicode_property_internal): New functions.
16666 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
16667 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 16668 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
16669 char-code-property-alist.
16670
640c8776 16671 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
16672 Vunicode_category_table.
16673
640c8776 16674 * font.c (font_range): Adjust for the change of
c805dec0
KH
16675 Vunicode_category_table.
16676
76b397fb
DN
166772011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
16678
16679 * m/iris4d.h: Remove file, move contents ...
16680 * s/irix6-5.h: ... here.
16681
22b4128e
PE
166822011-07-06 Paul Eggert <eggert@cs.ucla.edu>
16683
16684 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
16685 * alloc.c (mark_buffer):
16686 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
16687 (clone_per_buffer_values): Don't assume that
22b4128e
PE
16688 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
16689 This isn't true in general, and it's particularly not true
16690 if Emacs is configured with --with-wide-int.
16691 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
16692 New macros, used in the buffer.c change.
16693
869795d6
JD
166942011-07-05 Jan Djärv <jan.h.d@swipnet.se>
16695
16696 * xsettings.c: Use both GConf and GSettings if both are available.
16697 (store_config_changed_event): Add comment.
16698 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
16699 (store_tool_bar_style_changed): New functions.
5e617bc2 16700 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
16701 (struct xsettings): Move font inside HAVE_XFT.
16702 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 16703 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 16704 Move inside HAVE_XFT.
640c8776 16705 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
16706 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
16707 also.
16708 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 16709 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 16710 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
16711 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
16712 (parse_settings): Move check for font inside HAVE_XFT.
16713 (read_settings, apply_xft_settings): Add comment.
16714 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
16715 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
16716 call store_font_name_changed.
16717 (xft_settings_event): Add comment.
16718 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
16719 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
16720 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
16721 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
16722 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
16723 (xsettings_get_system_font, xsettings_get_system_normal_font):
16724 Add comment.
869795d6 16725
d8ed26bd
PE
167262011-07-05 Paul Eggert <eggert@cs.ucla.edu>
16727
16728 Random fixes. E.g., (random) never returned negative values.
16729 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
16730 subseconds part to the entropy, as that's a bit more random.
16731 Prefer signed to unsigned, since the signedness doesn't matter and
16732 in general we prefer signed. When given a limit, use a
16733 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
16734 latter isn't right if USE_2_TAGS_FOR_INTS.
16735 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
16736 not 0..VALMASK. Don't discard "excess" bits that random () returns.
16737
cabf1cac
SM
167382011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
16739
16740 * textprop.c (text_property_stickiness):
16741 Obey Vtext_property_default_nonsticky.
16742 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
16743 * w32fns.c (syms_of_w32fns):
16744 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
16745
6e9b2be9
PE
167462011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16747
16748 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
16749 This is more efficient than Ffile_directory_p and avoids a minor race.
16750
90186c68
LMI
167512011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
16752
7c301272
LMI
16753 * buffer.c (Foverlay_put): Say what the return value is
16754 (bug#7835).
16755
c4f2d8d4
LMI
16756 * fileio.c (barf_or_query_if_file_exists): Check first if the file
16757 is a directory before asking whether to use the file name
16758 (bug#7564).
ad637907
LMI
16759 (barf_or_query_if_file_exists): Make the "File is a directory"
16760 error be more correct.
c4f2d8d4 16761
90186c68
LMI
16762 * fns.c (Frequire): Remove the mention of the .gz files, since
16763 that's installation-specific, but keep the mention of
16764 `get-load-suffixes'.
16765
da64016e
PE
167662011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16767
16768 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
16769 Report string overflow if the output is too long.
16770
7d47b580
JB
167712011-07-04 Juanma Barranquero <lekktu@gmail.com>
16772
a555cb87
JB
16773 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
16774 (syms_of_gnutls): Remove duplicate DEFSYM for
16775 Qgnutls_bootprop_verify_hostname_error, an error for
16776 Qgnutls_bootprop_verify_error (which is no longer used).
16777
7d47b580
JB
16778 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
16779 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
16780 Also (re)move comments that are misplaced or no longer relevant.
16781
1e49bfab
LMI
167822011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16783
16784 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
16785
1485f4c0
CY
167862011-07-03 Chong Yidong <cyd@stupidchicken.com>
16787
16788 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
16789 and background color parameters if they have been changed.
16790
a9ab721e
LMI
167912011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16792
16793 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
16794
cf7cff57
PE
167952011-07-03 Paul Eggert <eggert@cs.ucla.edu>
16796
2e13213d
PE
16797 * xsettings.c (SYSTEM_FONT): Define only when used.
16798 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
16799
cf7cff57
PE
16800 * keymap.c (access_keymap_1): Now static.
16801
7a8e04f7
CY
168022011-07-02 Chong Yidong <cyd@stupidchicken.com>
16803
16804 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
16805 leave any prefix arg for the up event (Bug#1586).
16806
61352f62
LMI
168072011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
16808
69bb1ef7
LMI
16809 * lread.c (syms_of_lread): Mention single symbols defined by
16810 `defvar' or `defconst' (bug#7154).
16811
61352f62 16812 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 16813 (Frequire): Mention get-load-suffixes.
61352f62 16814
28545e04
MR
168152011-07-02 Martin Rudalics <rudalics@gmx.at>
16816
16817 * window.h (window): Remove clone_number slot.
16818 * window.c (Fwindow_clone_number, Fset_window_clone_number):
16819 Remove.
16820 (make_parent_window, make_window, saved_window)
16821 (Fset_window_configuration, save_window_save): Don't deal with
16822 clone numbers.
16823 * buffer.c (Qclone_number): Remove declaration.
16824 (sort_overlays, overlay_strings): Don't deal with clone numbers.
16825
3349e122
SM
168262011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
16827
16828 Add multiple inheritance to keymaps.
16829 * keymap.c (Fmake_composed_keymap): New function.
16830 (Fset_keymap_parent): Simplify.
16831 (fix_submap_inheritance): Remove.
16832 (access_keymap_1): New function extracted from access_keymap to handle
16833 embedded parents and handle lists of maps.
16834 (access_keymap): Use it.
16835 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
16836 (Fcopy_keymap): Handle embedded parents.
16837 (Fcommand_remapping, define_as_prefix): Simplify.
16838 (Fkey_binding): Simplify.
16839 (syms_of_keymap): Move minibuffer-local-completion-map,
16840 minibuffer-local-filename-completion-map,
16841 minibuffer-local-must-match-map, and
16842 minibuffer-local-filename-must-match-map to Elisp.
16843 (syms_of_keymap): Defsubr make-composed-keymap.
16844 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
16845 (parse_menu_item): Trivial simplification.
16846
3279eb87
GM
168472011-07-01 Glenn Morris <rgm@gnu.org>
16848
16849 * Makefile.in (SETTINGS_LIBS): Fix typo.
16850
39cb9e56 168512011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
16852
16853 * coding.c (Fencode_coding_string): Record the last coding system
16854 used, as the function doc string says (bug#8738).
16855
0949d2b6
JD
168562011-07-01 Jan Djärv <jan.h.d@swipnet.se>
16857
16858 * xsettings.c (store_monospaced_changed): Take new font as arg and
16859 check for change against current_mono_font.
16860 (EMACS_TYPE_SETTINGS): Remove this and related defines.
16861 (emacs_settings_constructor, emacs_settings_get_property)
16862 (emacs_settings_set_property, emacs_settings_class_init)
16863 (emacs_settings_init, gsettings_obj): Remove.
16864 (something_changedCB): New function for HAVE_GSETTINGS.
16865 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
16866 with value as argument.
16867 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
16868 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 16869 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
16870 "changed".
16871
16872 * xgselect.c: Add defined (HAVE_GSETTINGS).
16873 (xgselect_initialize): Ditto.
16874
16875 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
16876 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
16877 xg_select.
16878
bbc6b304
PE
168792011-07-01 Paul Eggert <eggert@cs.ucla.edu>
16880
16881 * eval.c (struct backtrace): Simplify and port the data structure.
16882 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
16883 signed bit field, as this assumption is not portable and it makes
16884 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
16885 "char debug_on_exit : 1" as this is not portable either; instead,
16886 use the portable "unsigned int debug_on_exit : 1". Remove unused
16887 member evalargs. Remove obsolete comments about cc bombing out.
16888
9851bfc5
JD
168892011-06-30 Jan Djärv <jan.h.d@swipnet.se>
16890
51bb811f 16891 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
16892 Let HAVE_GSETTINGS override HAVE_GCONF.
16893 (store_monospaced_changed): New function.
16894 (EMACS_SETTINGS): A new type derived from GObject to handle
16895 GSettings notifications.
16896 (emacs_settings_constructor, emacs_settings_get_property)
16897 (emacs_settings_set_property, emacs_settings_class_init):
16898 New functions.
16899 (gsettings_client, gsettings_obj): New variables.
16900 (GSETTINGS_SCHEMA): New define.
16901 (something_changedCB): Call store_monospaced_changed.
16902 (init_gsettings): New function.
16903 (xsettings_initialize): Call init_gsettings.
16904 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
16905 to NULL.
16906
640c8776 16907 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
16908 GCONF_CFLAGS/LIBS.
16909
5386012d
MR
169102011-06-29 Martin Rudalics <rudalics@gmx.at>
16911
16912 * window.c (resize_root_window, grow_mini_window)
16913 (shrink_mini_window): Rename Qresize_root_window to
16914 Qwindow_resize_root_window and Qresize_root_window_vertically to
16915 Qwindow_resize_root_window_vertically.
16916
f13e0b08
PE
169172011-06-28 Paul Eggert <eggert@cs.ucla.edu>
16918
16919 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
16920
94515237
JB
169212011-06-27 Juanma Barranquero <lekktu@gmail.com>
16922
16923 * makefile.w32-in: Redesign dependencies so they reflect more
16924 clearly which files are directly included by each source file,
16925 and not through other includes.
16926
e43b6e43
MR
169272011-06-27 Martin Rudalics <rudalics@gmx.at>
16928
16929 * buffer.c (Qclone_number): Declare static and DEFSYM it.
16930 (sort_overlays, overlay_strings): When an overlay's clone number
16931 matches the window's clone number process the overlay even if
16932 the overlay's window property doesn't match the current window.
16933
d68443dc
MR
16934 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
16935 (Fwindow_hchild): Rename to Fwindow_left_child.
16936 (Fwindow_next): Rename to Fwindow_next_sibling.
16937 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
16938 (resize_window_check): Rename to window_resize_check.
16939 (resize_window_apply): Rename to window_resize_apply.
16940 (Fresize_window_apply): Rename to Fwindow_resize_apply.
16941 (Fdelete_other_windows_internal, resize_frame_windows)
16942 (Fsplit_window_internal, Fdelete_window_internal)
16943 (grow_mini_window, shrink_mini_window)
16944 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 16945
c7e73be5
JD
169462011-06-26 Jan Djärv <jan.h.d@swipnet.se>
16947
16948 * emacsgtkfixed.h: State that this is only used with Gtk+3.
16949 (emacs_fixed_set_min_size): Remove.
16950 (emacs_fixed_new): Take frame as argument.
16951
16952 * emacsgtkfixed.c: State that this is only used with Gtk+3.
16953 (_EmacsFixedPrivate): Remove minwidth/height.
16954 Add struct frame *f.
16955 (emacs_fixed_init): Initialize priv->f.
16956 (get_parent_class, emacs_fixed_set_min_size): Remove.
16957 (emacs_fixed_new): Set priv->f to argument.
16958 (emacs_fixed_get_preferred_width)
16959 (emacs_fixed_get_preferred_height): Use min_width/height from
16960 frames size_hint to set minimum and natural (Bug#8919).
16961 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
16962 and use min_width/height from frames size_hint to set
16963 min_width/height (Bug#8919).
16964
16965 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
16966 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
16967 Fix indentation.
c7e73be5 16968
cf99dcf8
EZ
169692011-06-26 Eli Zaretskii <eliz@gnu.org>
16970
16971 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
16972 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
16973 called at ZV.
16974
029529ac
CY
169752011-06-26 Chong Yidong <cyd@stupidchicken.com>
16976
16977 * process.c (wait_reading_process_output): Bypass select if
16978 waiting for a cell while ignoring keyboard input, and input is
16979 pending. Suggested by Jan Djärv (Bug#8869).
16980
7a7ef429
PE
169812011-06-25 Paul Eggert <eggert@cs.ucla.edu>
16982
16983 Use gnulib's dup2 module instead of rolling our own.
16984 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
16985
11fdef7d 169862011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
16987
16988 * dispnew.c (scrolling_window): Before scrolling, turn off a
16989 mouse-highlight in the window being scrolled.
16990
cd3520a4
JB
169912011-06-24 Juanma Barranquero <lekktu@gmail.com>
16992
16993 Move DEFSYM to lisp.h and use everywhere.
16994
16995 * character.h (DEFSYM): Move declaration...
16996 * lisp.h (DEFSYM): ...here.
16997
16998 * gnutls.c:
16999 * minibuf.c:
17000 * w32menu.c:
17001 * w32proc.c:
17002 * w32select.c: Don't include character.h.
17003
17004 * alloc.c (syms_of_alloc):
17005 * buffer.c (syms_of_buffer):
17006 * bytecode.c (syms_of_bytecode):
17007 * callint.c (syms_of_callint):
17008 * casefiddle.c (syms_of_casefiddle):
17009 * casetab.c (init_casetab_once):
17010 * category.c (init_category_once, syms_of_category):
17011 * ccl.c (syms_of_ccl):
17012 * cmds.c (syms_of_cmds):
17013 * composite.c (syms_of_composite):
17014 * dbusbind.c (syms_of_dbusbind):
17015 * dired.c (syms_of_dired):
17016 * dispnew.c (syms_of_display):
17017 * doc.c (syms_of_doc):
17018 * editfns.c (syms_of_editfns):
17019 * emacs.c (syms_of_emacs):
17020 * eval.c (syms_of_eval):
17021 * fileio.c (syms_of_fileio):
17022 * fns.c (syms_of_fns):
17023 * frame.c (syms_of_frame):
17024 * fringe.c (syms_of_fringe):
17025 * insdel.c (syms_of_insdel):
17026 * keymap.c (syms_of_keymap):
17027 * lread.c (init_obarray, syms_of_lread):
17028 * macros.c (syms_of_macros):
17029 * msdos.c (syms_of_msdos):
17030 * print.c (syms_of_print):
17031 * process.c (syms_of_process):
17032 * search.c (syms_of_search):
17033 * sound.c (syms_of_sound):
17034 * syntax.c (init_syntax_once, syms_of_syntax):
17035 * terminal.c (syms_of_terminal):
17036 * textprop.c (syms_of_textprop):
17037 * undo.c (syms_of_undo):
17038 * w32.c (globals_of_w32):
17039 * window.c (syms_of_window):
17040 * xdisp.c (syms_of_xdisp):
17041 * xfaces.c (syms_of_xfaces):
17042 * xfns.c (syms_of_xfns):
17043 * xmenu.c (syms_of_xmenu):
17044 * xsettings.c (syms_of_xsettings):
17045 * xterm.c (syms_of_xterm): Use DEFSYM.
17046
4228cf16
TZ
170472011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
17048
cd3520a4 17049 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 17050
7fcccf1e
PE
170512011-06-23 Paul Eggert <eggert@cs.ucla.edu>
17052
7efb4e0e
PE
17053 Integer and buffer overflow fixes (Bug#8873).
17054
ff5844ad
PE
17055 * print.c (printchar, strout): Check for string overflow.
17056 (PRINTPREPARE, printchar, strout):
17057 Don't set size unless allocation succeeds.
17058
90532f02
PE
17059 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
17060 for sizes. Check for string overflow more accurately.
17061 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
17062
6d84508d
PE
17063 * macros.c: Integer and buffer overflow fixes.
17064 * keyboard.h (struct keyboard.kbd_macro_bufsize):
17065 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
17066 Use ptrdiff_t, not int, for sizes.
17067 Don't increment bufsize until after realloc succeeds.
17068 Check for size-calculation overflow.
17069 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
17070
437b2cb4
PE
17071 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
17072
8b9ac8b4
PE
17073 * lread.c: Integer overflow fixes.
17074 (read_integer): Radix is now EMACS_INT, not int,
17075 to improve quality of diagnostics for out-of-range radices.
17076 Calculate buffer size correctly for out-of-range radices.
17077 (read1): Check for integer overflow in radices, and in
17078 read-circle numbers.
82cb60d3
PE
17079 (read_escape): Avoid int overflow.
17080 (Fload, openp, read_buffer_size, read1)
17081 (substitute_object_recurse, read_vector, read_list, map_obarray):
17082 Use ptrdiff_t, not int, for sizes.
17083 (read1): Use EMACS_INT, not int, for sizes.
20270765 17084 Check for size overflow.
8b9ac8b4 17085
7fcccf1e
PE
17086 * image.c (cache_image): Check for size arithmetic overflow.
17087
bfbbd7e7
PE
17088 * lread.c: Integer overflow issues.
17089 (saved_doc_string_size, saved_doc_string_length)
17090 (prev_saved_doc_string_size, prev_saved_doc_string_length):
17091 Now ptrdiff_t, not int.
17092 (read1): Don't assume doc string length fits in int. Check for
17093 out-of-range doc string lengths.
17094 (read_list): Don't assume file position fits in int.
39019e54 17095 (read_escape): Check for hex character overflow.
bfbbd7e7 17096
4e323265
LL
170972011-06-22 Leo Liu <sdl.web@gmail.com>
17098
17099 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
17100 Move to minibuffer.el.
17101
85fece3e
PE
171022011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17103
20b84ce9 17104 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
17105 The following patches are for when GLYPH_DEBUG && !XASSERT.
17106 * dispextern.h (trace_redisplay_p, dump_glyph_string):
17107 * dispnew.c (flush_stdout):
17108 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
17109 Mark as externally visible.
17110 * dispnew.c (check_window_matrix_pointers): Now static.
17111 * dispnew.c (window_to_frame_vpos):
17112 * xfns.c (unwind_create_frame):
17113 * xterm.c (x_check_font): Remove unused local.
17114 * scroll.c (CHECK_BOUNDS):
17115 * xfaces.c (cache_fache): Rename local to avoid shadowing.
17116 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
17117 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
17118 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
17119 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
17120 Now static.
17121 (debug_method_add): Use va_list and vsprintf rather than relying
17122 on undefined behavior with wrong number of arguments.
17123 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
17124 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
17125 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
17126 since we're not interested in debugging glyphs with old libraries.
17127 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
17128 GCC 4.6.0's static checking.
17129
0766b489
PE
171302011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17131
31fd4b32
PE
17132 Integer overflow and signedness fixes (Bug#8873).
17133 A few related buffer overrun fixes, too.
17134
b79e8648
PE
17135 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
17136
0766b489
PE
17137 * dispextern.h (struct face.stipple):
17138 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
17139 (x_bitmap_mask, x_allocate_bitmap_record)
17140 (x_create_bitmap_from_data, x_create_bitmap_from_file)
17141 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
17142 (x_create_bitmap_from_xpm_data):
17143 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
17144 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
17145 (.bitmaps_last):
17146 * xfaces.c (load_pixmap):
17147 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
17148 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
17149 (.bitmaps_last, struct x_output.icon_bitmap):
17150 Use ptrdiff_t, not int, for bitmap indexes.
17151 (x_allocate_bitmap_record): Check for size overflow.
17152 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
17153
b081724f
PE
17154 Use ptrdiff_t, not int, for overlay counts.
17155 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
17156 * editfns.c (overlays_around, get_pos_property):
17157 * textprop.c (get_char_property_and_overlay):
17158 * xdisp.c (next_overlay_change, note_mouse_highlight):
17159 * xfaces.c (face_at_buffer_position):
21514da7
PE
17160 * buffer.c (OVERLAY_COUNT_MAX): New macro.
17161 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
17162 (Fnext_overlay_change, Fprevious_overlay_change)
17163 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 17164 Use ptrdiff_t, not int, for sizes.
21514da7 17165 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 17166
3de73e5e
PE
17167 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
17168
2606c57b
PE
17169 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
17170 (x_session_initialize): Do not assume string length fits in int.
17171
aaafe47a
PE
17172 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
17173 This is unlikely, but can occur if DPI is outlandish.
17174
2674ddc8 17175 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
17176 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
17177
28154962
PE
17178 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
17179 * xrdb.c (magic_file_p, search_magic_path):
17180 Omit last arg SUFFIX; it was always 0. All callers changed.
17181 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
17182
7de51af5
PE
17183 * xfont.c (xfont_match): Avoid need for strlen.
17184
25ed6cc3
PE
17185 * xfns.c: Don't assume strlen fits in int.
17186 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
17187
4eab31dd
PE
17188 * xdisp.c (message_log_check_duplicate): Return intmax_t,
17189 not unsigned long, as we prefer signed integers. All callers changed.
17190 Detect integer overflow in repeat count.
17191 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 17192 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 17193
171e2a58
PE
17194 * termcap.c: Don't assume sizes fit in int and never overflow.
17195 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
17196 (gobble_line): Check for size-calculation overflow.
17197
ad39faca 17198 * minibuf.c (Fread_buffer):
6e5bb2dc 17199 * lread.c (intern, intern_c_string):
74ca2eb3
PE
17200 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
17201 Don't assume string length fits in int.
17202
52c61c22 17203 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
17204 * gtkutil.c (style_changed_cb): Avoid need for strlen.
17205
b5b8c9e5
PE
17206 * font.c: Don't assume string length fits in int.
17207 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
17208 Use ptrdiff_t, not int.
ccd6111c
PE
17209 (font_intern_prop): Don't assume string length fits in int.
17210 Don't assume integer property fits in fixnum.
17211 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 17212
882f0d81 17213 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 17214 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
17215 Reformulate so as not to need the command string.
17216 Invoke gzip -cd rather than gunzip, as it's more portable.
17217 (lock_info_type, lock_file_1, lock_file):
17218 Don't assume pid_t and time_t fit in unsigned long.
17219 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
17220 (current_lock_owner): Prefer signed type for sizes.
17221 Use memcpy, not strncpy, where memcpy is what is really wanted.
17222 Don't assume (via atoi) that time_t and pid_t fit in int.
17223 Check for time_t and/or pid_t out of range, e.g., via a network share.
17224 Don't alloca where an auto var works fine.
17225
93f4cf88
PE
17226 * fileio.c: Fix some integer overflow issues.
17227 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
17228 Don't assume string length fits in int.
17229 (directory_file_name): Don't assume string length fits in long.
17230 (make_temp_name): Don't assume pid fits in int, or that its print
17231 length is less than 20.
17232
f3e92b69
PE
17233 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
17234
1bfdaf10
PE
17235 * coding.c (make_subsidiaries): Don't assume string length fits in int.
17236
35016e9a
PE
17237 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
17238
3d1e65a1
PE
17239 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
17240 We prefer signed integers, even for size calculations.
17241
0b963a93
PE
17242 * emacs.c: Don't assume string length fits in 'int'.
17243 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
17244 (main): Don't invoke strlen when not needed.
17245
573f4b54
PE
17246 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
17247 (XD_DEBUG_MESSAGE): Don't waste a byte.
17248
989f33ba
PE
17249 * callproc.c (getenv_internal_1, getenv_internal)
17250 (Fgetenv_internal):
965d34eb
PE
17251 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
17252
e4d29b33
PE
17253 * lread.c (invalid_syntax): Omit length argument.
17254 All uses changed. This doesn't fix a bug, but it simplifies the
17255 code away from its former Hollerith-constant appearance, and it's
17256 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 17257 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 17258
eb49b136
PE
17259 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
17260 This didn't break anything, but it didn't help either.
17261 It's confusing to put a bogus integer in a place where the actual
17262 value does not matter.
9f62aeb1 17263 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 17264 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 17265
15375a22
PE
17266 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
17267 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
17268 implementation.
b61cc01c
PE
17269 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
17270 We prefer signed types, and the value cannot exceed the EMACS_INT
17271 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
17272 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
17273 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
17274 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 17275
53b2623d
PE
17276 * indent.c (sane_tab_width): New function.
17277 (current_column, scan_for_column, Findent_to, position_indentation)
17278 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 17279 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 17280
51cab52b 17281 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 17282
f2ed8a70
PE
17283 * lisp.h (lint_assume): New macro.
17284 * composite.c (composition_gstring_put_cache):
17285 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
17286
abe80cc6
PE
17287 * editfns.c, insdel.c:
17288 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 17289
b02c740e
PE
17290 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
17291
ebc96716
PE
17292 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
17293
b4e50fa0 17294 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 17295 Use much-faster test for byte-length change.
311d5d7c 17296 Don't assume string byte-length fits in 'int'.
a4cf38e4 17297 Check that character arg fits in 'int'.
85461888 17298 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 17299
c0c1ee9f
PE
17300 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
17301
a498d7f4
PE
17302 * fns.c (concat): Catch string overflow earlier.
17303 Do not rely on integer wraparound.
17304
51cab52b
PE
17305 * dispextern.h (struct it.overlay_strings_charpos)
17306 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
17307 * xdisp.c (forward_to_next_line_start)
17308 (back_to_previous_visible_line_start)
17309 (reseat_at_next_visible_line_start, next_element_from_buffer):
17310 Don't arbitrarily truncate the value of 'selective' to int.
17311
76031fad
PE
17312 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
17313
5eb55db9
PE
17314 * composite.c: Don't truncate sizes to 'int'.
17315 (composition_gstring_p, composition_reseat_it)
17316 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
17317 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
17318 not EMACS_UINT, for indexes.
5eb55db9 17319
0703a717
PE
17320 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
17321
d6202519
PE
17322 * buffer.c: Include <verify.h>.
17323 (struct sortvec.priority, struct sortstr.priority):
8961a454 17324 Now EMACS_INT, not int.
c20998a7 17325 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
17326 (struct sortstr.size, record_overlay_string)
17327 (struct sortstrlist.size, struct sortlist.used):
17328 Don't truncate size to int.
17329 (record_overlay_string): Check for size-calculation overflow.
d6202519 17330 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 17331
d5a19415
JM
173322011-06-22 Jim Meyering <meyering@redhat.com>
17333
029529ac 17334 Don't leak an XBM-image-sized buffer
d5a19415
JM
17335 * image.c (xbm_load): Free the image buffer after using it.
17336
a9041e6c
PE
173372011-06-21 Paul Eggert <eggert@cs.ucla.edu>
17338
17339 Port to Sun C.
17340 * composite.c (find_automatic_composition): Omit needless 'return 0;'
17341 that Sun C diagnosed.
17342 * fns.c (secure_hash): Fix pointer signedness issue.
17343 * intervals.c (static_offset_intervals): New function.
17344 (offset_intervals): Use it.
17345
7f3f739f
LL
173462011-06-21 Leo Liu <sdl.web@gmail.com>
17347
17348 * deps.mk (fns.o):
17349 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
17350 sha512.h.
17351
17352 * fns.c (secure_hash): Rename from crypto_hash_function and change
17353 the first arg to accept symbols.
5b66d427 17354 (Fsecure_hash): New primitive.
7f3f739f
LL
17355 (syms_of_fns): New symbols.
17356
76147d94
DD
173572011-06-20 Deniz Dogan <deniz@dogan.se>
17358
17359 * process.c (Fset_process_buffer): Clarify return value in
17360 docstring.
17361
7d7d0045
CY
173622011-06-18 Chong Yidong <cyd@stupidchicken.com>
17363
17364 * dispnew.c (add_window_display_history): Use BVAR.
17365
17366 * xdisp.c (debug_method_add): Use BVAR.
17367 (check_window_end, dump_glyph_matrix, dump_glyph)
17368 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
17369
17370 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
17371 Likewise.
17372
17373 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
17374 check till after the cache is created in init_frame_faces.
17375
ff2bc410
SM
173762011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
17377
17378 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
17379
28177add
PE
173802011-06-16 Paul Eggert <eggert@cs.ucla.edu>
17381
dd3482fe
PE
17382 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
17383 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
17384 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
17385
393d71f3 17386 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
17387 * fileio.c (Finsert_file_contents):
17388 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
17389 Remove the old (too-loose) buffer overflow checks.
17390 They weren't needed, since make_gap checks for buffer overflow.
17391 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
17392 The old code merely checked for Emacs fixnum overflow, and relied
17393 on undefined (wraparound) behavior. The new code avoids undefined
17394 behavior, and also checks for ptrdiff_t and/or size_t overflow.
17395
2e6813b0 17396 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
17397 Tune. Don't use wider integers than needed. Don't use alloca.
17398 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 17399
599a9e4f
PE
17400 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
17401
99561444
PE
17402 * insdel.c, lisp.h (buffer_overflow): New function.
17403 (insert_from_buffer_1, replace_range, replace_range_2):
17404 * insdel.c (make_gap_larger):
17405 * editfns.c (Finsert_char):
17406 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
17407
28177add
PE
17408 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
17409
e69dafad
PE
174102011-06-15 Paul Eggert <eggert@cs.ucla.edu>
17411
4baa020d 17412 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 17413
b1c46f02
PE
17414 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
17415 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
17416
e69dafad
PE
17417 * fileio.c: Don't assume EMACS_INT fits in off_t.
17418 (emacs_lseek): New static function.
17419 (Finsert_file_contents, Fwrite_region): Use it.
17420 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
17421
566684ea
PE
17422 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
17423
e6966cd6
PE
17424 * fns.c: Don't overflow int when computing a list length.
17425 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
17426 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
17427 truncation on 64-bit hosts. Check for QUIT every
17428 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
17429 faster and is responsive enough.
17430 (Flength): Report an error instead of overflowing an integer.
17431 (Fsafe_length): Return a float if the value is not representable
17432 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 17433 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 17434 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 17435
dd0b0efb
PE
17436 * alloc.c: Check that resized vectors' lengths fit in fixnums.
17437 (header_size, word_size): New constants.
17438 (allocate_vectorlike): Don't check size overflow here.
17439 (allocate_vector): Check it here instead, since this is the only
17440 caller of allocate_vectorlike that could cause overflow.
17441 Check that the new vector's length is representable as a fixnum.
17442
86fe5cfe
PE
17443 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
17444 The previous code was bogus. For example, next_almost_prime (32)
17445 returned 39, which is undesirable as it is a multiple of 3; and
17446 next_almost_prime (24) returned 25, which is a multiple of 5 so
17447 why was the code bothering to check for multiples of 7?
17448
80e88859
PE
17449 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
17450
4a2f0ad6
PE
17451 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
17452
f66c7cf8
PE
17453 Variadic C functions now count arguments with ptrdiff_t.
17454 This partly undoes my 2011-03-30 change, which replaced int with size_t.
17455 Back then I didn't know that the Emacs coding style prefers signed int.
17456 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
17457 were being counted with int, which may truncate counts on 64-bit
17458 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
17459 * lisp.h (struct Lisp_Subr.function.aMANY)
17460 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
17461 Arg counts are now ptrdiff_t, not size_t.
17462 All variadic functions and their callers changed accordingly.
17463 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
17464 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
17465 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
17466 * callint.c (Fcall_interactively): Check arg count for overflow,
17467 to avoid potential buffer overrun. Use signed char, not 'int',
17468 for 'varies' array, so that we needn't bother to check its size
17469 calculation for overflow.
17470 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
17471 * eval.c (apply_lambda):
17472 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
17473 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
17474 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
17475
a1759b76
PE
17476 * callint.c (Fcall_interactively): Don't use index var as event count.
17477
d96be9fc
PE
17478 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
17479 * mem-limits.h (SIZE): Remove; no longer used.
17480
a690a978 17481 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 17482
578c21e6
PE
17483 Remove unnecessary casts.
17484 * xterm.c (x_term_init):
17485 * xfns.c (x_set_border_pixel):
17486 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
17487 These aren't needed now that we assume ANSI C.
17488
96f53c6c
PE
17489 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
17490 It's more likely to cause problems (due to unsigned overflow)
17491 than to cure them.
17492
83c77d31
PE
17493 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
17494
ee2079f1
PE
17495 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
17496
6da65536
PE
17497 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
17498
7147c4a4
PE
17499 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
17500
193e32d9
PE
17501 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
17502
e5533da6
PE
17503 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
17504
9910e595
PE
17505 GLYPH_CODE_FACE returns EMACS_INT, not int.
17506 * dispextern.h (merge_faces):
17507 * xfaces.c (merge_faces):
01103c44
PE
17508 * xdisp.c (get_next_display_element, next_element_from_display_vector):
17509 Don't assume EMACS_INT fits in int.
9910e595 17510
2638320e
PE
17511 * character.h (CHAR_VALID_P): Remove unused parameter.
17512 * fontset.c, lisp.h, xdisp.c: All uses changed.
17513
045eb8d9
PE
17514 * editfns.c (Ftranslate_region_internal): Omit redundant test.
17515
c1f134b5
PE
17516 * fns.c (concat): Minor tuning based on overflow analysis.
17517 This doesn't fix any bugs. Use int to hold character, instead
17518 of constantly refetching from Emacs object. Use XFASTINT, not
17519 XINT, for value known to be a character. Don't bother comparing
17520 a single byte to 0400, as it's always less.
17521
395fcb93 17522 * floatfns.c (Fexpt):
327eeec8
PE
17523 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
17524
abbd3d23
PE
17525 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
17526 for characters.
17527
684a03ef
PE
17528 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
17529
0fed43f3
PE
17530 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
17531 Without this fix, on a 64-bit host (aset S 0 4294967386) would
17532 incorrectly succeed when S was a string, because 4294967386 was
17533 truncated before it was used.
17534
8fd02eb7
PE
17535 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
17536 Otherwise, an out-of-range integer could cause undefined behavior
17537 on a 64-bit host.
17538
f8c86b69
PE
17539 * composite.c: Use int, not EMACS_INT, for characters.
17540 (fill_gstring_body, composition_compute_stop_pos): Use int, not
17541 EMACS_INT, for values that are known to be in character range.
17542 This doesn't fix any bugs but is the usual style inside Emacs and
17543 may generate better code on 32-bit machines.
17544
34206dd2
PE
17545 Make sure a 64-bit char is never passed to ENCODE_CHAR.
17546 This is for reasons similar to the recent CHAR_STRING fix.
17547 * charset.c (Fencode_char): Check that character arg is actually
17548 a character. Pass an int to ENCODE_CHAR.
17549 * charset.h (ENCODE_CHAR): Verify that the character argument is no
17550 wider than 'int', as a compile-time check to prevent future regressions
17551 in this area.
17552
c5958d4c 17553 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
17554
17555 Make sure a 64-bit char is never passed to CHAR_STRING.
17556 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
17557 by silently ignoring the top 32 bits, allowing some values
17558 that were far too large to be valid characters.
17559 * character.h: Include <verify.h>.
17560 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
17561 arguments are no wider than unsigned, as a compile-time check
17562 to prevent future regressions in this area.
17563 * data.c (Faset):
01103c44 17564 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
17565 (Fsubst_char_in_region):
17566 * fns.c (concat):
17567 * xdisp.c (decode_mode_spec_coding):
17568 Adjust to CHAR_STRING's new requirement.
17569 * editfns.c (Finsert_char, Fsubst_char_in_region):
17570 * fns.c (concat): Check that character args are actually
17571 characters. Without this test, these functions did the wrong
17572 thing with wildly out-of-range values on 64-bit hosts.
17573
d37ca623
PE
17574 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
17575 These casts should not be needed on 32-bit hosts, either.
17576 * keyboard.c (read_char):
17577 * lread.c (Fload): Remove casts to unsigned.
17578
ea204efb
PE
17579 * lisp.h (UNSIGNED_CMP): New macro.
17580 This fixes comparison bugs on 64-bit hosts.
17581 (ASCII_CHAR_P): Use it.
17582 * casefiddle.c (casify_object):
01103c44 17583 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
17584 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
17585 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
17586 * dispextern.h (FACE_FROM_ID):
17587 * keyboard.c (read_char): Use UNSIGNED_CMP.
17588
41cb286c
PE
17589 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
17590 not to EMACS_INT, to avoid GCC warning.
17591
4a1b9832
PE
17592 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
17593
55daad71
PE
17594 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
17595 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
17596 isn't needed on 32-bit machines.
8f95c75c 17597
01103c44
PE
17598 * buffer.c (Fgenerate_new_buffer_name):
17599 Use EMACS_INT for count, not int.
0ceccced 17600 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
17601
17602 * data.c (Qcompiled_function): Now static.
17603
c6f072e7
PE
17604 * window.c (window_body_lines): Now static.
17605
20ce5912
PE
17606 * image.c (gif_load): Rename local to avoid shadowing.
17607
9c4c5f81
PE
17608 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
17609 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
17610 * alloc.c (make_save_value): Integer argument is now of type
17611 ptrdiff_t, not int.
17612 (mark_object): Use ptrdiff_t, not int.
17613 * lisp.h (pD): New macro.
17614 * print.c (print_object): Use it.
17615
c0c5c8ae
PE
17616 * alloc.c: Use EMACS_INT, not int, to count objects.
17617 (total_conses, total_markers, total_symbols, total_vector_size)
17618 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
17619 (total_free_floats, total_floats, total_free_intervals)
17620 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
17621 Now EMACS_INT, not int. All uses changed.
17622 (Fgarbage_collect): Compute overall total using a double, so that
17623 integer overflow is less likely to be a problem. Check for overflow
17624 when converting back to an integer.
5a25e253
PE
17625 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
17626 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
17627 These were 'int' variables that could overflow on 64-bit hosts;
17628 they were never used, so remove them instead of repairing them.
211a0b2a 17629 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
17630 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
17631 Previously, this ceilinged at INT_MAX, but that doesn't work on
17632 64-bit machines.
e46bb31a 17633 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 17634
c78baabf 17635 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 17636 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
17637 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
17638 when a (possibly-narrower) signed value would do just as well.
17639 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 17640
c9d624c6
PE
17641 * alloc.c: Catch some string size overflows that we were missing.
17642 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
17643 for convenience in STRING_BYTES_MAX.
17644 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
17645 The definition here is exact; the one in lisp.h was approximate.
17646 (allocate_string_data): Check for string overflow. This catches
17647 some instances we weren't catching before. Also, it catches
17648 size_t overflow on (unusual) hosts where SIZE_MAX <= min
17649 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
17650 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 17651
c9d624c6
PE
17652 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
17653 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 17654 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 17655
353032ce
PE
17656 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
17657
2bccce07
PE
17658 * alloc.c (Fmake_string): Check for out-of-range init.
17659
0ac30604
SM
176602011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
17661
17662 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
17663
c195f2de
JD
176642011-06-14 Jan Djärv <jan.h.d@swipnet.se>
17665
17666 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
17667 xg_get_default_scrollbar_width.
17668
17669 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
17670 (int_gtk_range_get_value): Move to the scroll bar part of the file.
17671 (style_changed_cb): Call update_theme_scrollbar_width and call
17672 x_set_scroll_bar_default_width and xg_frame_set_char_size for
17673 all frames (Bug#8505).
17674 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
17675 Call gtk_window_set_resizable if HAVE_GTK3.
17676 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
17677 and height if HAVE_GTK3 (Bug#8505).
17678 (scroll_bar_width_for_theme): New variable.
17679 (update_theme_scrollbar_width): New function.
17680 (xg_get_default_scrollbar_width): Move code to
17681 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
17682 (xg_initialize): Call update_theme_scrollbar_width.
17683
17684 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
17685
17686 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
17687
e10ac9f1
MR
176882011-06-12 Martin Rudalics <rudalics@gmx.at>
17689
17690 * frame.c (make_frame): Call other_buffer_safely instead of
17691 other_buffer.
17692
17693 * window.c (temp_output_buffer_show): Call display_buffer with
17694 second argument Vtemp_buffer_show_specifiers and reset latter
17695 immediately after the call.
17696 (Vtemp_buffer_show_specifiers): New variable.
17697 (auto_window_vscroll_p, next_screen_context_lines)
17698 (Vscroll_preserve_screen_position): Remove leading asterisks from
17699 doc-strings.
17700
2d3c217e 177012011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 17702
7b7f97e8 17703 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
17704 * buffer.c (Qclone_number): Remove for now, as it's unused.
17705 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
17706 (record_buffer): Remove unused local.
17707 * frame.c (other_visible_frames, frame_buffer_list): Now static.
17708 (set_frame_buffer_list): Remove; unused.
17709 * frame.h (other_visible_frames): Remove decl.
17710 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
17711 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
17712 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
17713 if HAVE_GPM.
17714 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
17715 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
17716 Define only if HAVE_GPM.
17717 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
17718 (update_hints_inhibit): Remove; never set. All uses removed.
17719 * widgetprv.h (emacsFrameClassRec): Remove decl.
17720 * window.c (delete_deletable_window): Now returns void, since it
17721 wasn't returning anything.
17722 (compare_window_configurations): Remove unused locals.
17723 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
17724 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
17725 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
17726 the same widths as pointers. This follows up on the 2011-05-06 patch.
17727 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
17728 * xterm.h: Likewise.
17729 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
17730
1384b89e
JB
177312011-06-12 Juanma Barranquero <lekktu@gmail.com>
17732
17733 * makefile.w32-in: Update dependencies.
17734 (LISP_H): Add lib/intprops.h.
17735
1100a63c
CY
177362011-06-11 Chong Yidong <cyd@stupidchicken.com>
17737
17738 * image.c (gif_load): Add animation frame delay to the metadata.
17739 (syms_of_image): Use DEFSYM. New symbol `delay'.
17740
6198ccd0
MR
177412011-06-11 Martin Rudalics <rudalics@gmx.at>
17742
17743 * window.c (delete_deletable_window): Re-add.
17744 (Fset_window_configuration): Rewrite to handle dead buffers and
17745 consequently deletable windows.
17746 (window_tree, Fwindow_tree): Remove. Supply functionality in
17747 window.el.
17748 (compare_window_configurations): Simplify code.
17749
b6e3633c
AS
177502011-06-11 Andreas Schwab <schwab@linux-m68k.org>
17751
1ab0dee5
AS
17752 * image.c (imagemagick_load_image): Fix type mismatch.
17753 (Fimagemagick_types): Likewise.
17754
b6e3633c
AS
17755 * window.h (replace_buffer_in_windows): Declare.
17756
9397e56f
MR
177572011-06-11 Martin Rudalics <rudalics@gmx.at>
17758
17759 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
17760 Qclone_number. Remove external declaration of Qdelete_window.
17761 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
17762 code.
640c8776
SM
17763 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
17764 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
17765 (Fother_buffer): Rewrite doc-string. Major rewrite for new
17766 buffer list implementation.
17767 (other_buffer_safely): New function.
17768 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
17769 calls to replace_buffer_in_windows and
17770 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
17771 if allowed.
17772 (record_buffer): Inhibit quitting and rewrite using quittable
17773 functions. Run Qbuffer_list_update_hook if allowed.
17774 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
17775 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
17776 Move switch-to-buffer to window.el.
9397e56f
MR
17777 (bury-buffer): Move to window.el.
17778 (Vbuffer_list_update_hook): New variable.
17779
17780 * lisp.h (other_buffer_safely): Add prototype in buffer.c
17781 section.
17782
17783 * window.h (resize_frame_windows): Move up in code.
17784 (Fwindow_frame): Remove EXFUN.
17785 (replace_buffer_in_all_windows): Remove prototype.
17786 (replace_buffer_in_windows_safely): Add prototype.
17787
17788 * window.c: Declare Qdelete_window static again. Move down
17789 declaration of select_count.
17790 (Fnext_window, Fprevious_window): Rewrite doc-strings.
17791 (Fother_window): Move to window.el.
17792 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
17793 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
17794 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
17795 window.el.
17796 (replace_buffer_in_windows): Implement by calling
17797 Qreplace_buffer_in_windows.
17798 (replace_buffer_in_all_windows): Remove with some functionality
17799 moved into replace_buffer_in_windows_safely.
17800 (replace_buffer_in_windows_safely): New function.
17801 (select_window_norecord, select_frame_norecord): Move in front
17802 of run_window_configuration_change_hook. Remove now obsolete
17803 declarations.
640c8776
SM
17804 (Fset_window_buffer): Rewrite doc-string.
17805 Call Qrecord_window_buffer.
9397e56f
MR
17806 (keys_of_window): Move binding for other-window to window.el.
17807
b50691aa
CY
178082011-06-11 Chong Yidong <cyd@stupidchicken.com>
17809
17810 * dispextern.h (struct image): Replace data member, whose int_val
17811 and ptr_val fields were not used by anything, with a single
17812 lisp_val object.
17813
17814 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
17815 (gif_clear_image, gif_load, imagemagick_load_image)
17816 (gs_clear_image, gs_load): Callers changed.
17817
3f754b86
PE
178182011-06-10 Paul Eggert <eggert@cs.ucla.edu>
17819
cca69397
PE
17820 * buffer.h: Include <time.h>, for time_t.
17821 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
17822
109e28d0
PE
17823 Fix minor problems found by static checking.
17824
60737f02
PE
17825 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
17826
4b66faf3
PE
17827 Make identifiers static if they are not used in other modules.
17828 * data.c (Qcompiled_function, Qframe, Qvector):
17829 * image.c (QimageMagick, Qsvg):
17830 * minibuf.c (Qmetadata):
17831 * window.c (resize_window_check, resize_root_window): Now static.
17832 * window.h (resize_window_check, resize_root_window): Remove decls.
17833
109e28d0
PE
17834 * window.c (window_deletion_count, delete_deletable_window):
17835 Remove; unused.
46a4ce9e
PE
17836 (window_body_lines): Now static.
17837 (Fdelete_other_windows_internal): Mark vars as initialized.
17838 Make sure 'resize_failed' is initialized.
17839 (run_window_configuration_change_hook): Rename local to avoid shadowing.
17840 (resize_window_apply): Remove unused local.
17841 * window.h (delete_deletable_window): Remove decl.
17842
109e28d0 17843 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
17844 (imagemagick_load_image): Fix pointer signedness problem by changing
17845 last arg from unsigned char * to char *. All uses changed.
17846 Also, fix a local for similar reasons.
17847 Remove unused locals. Remove locals to avoid shadowing.
17848 (fn_rsvg_handle_free): Remove; unused.
17849 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 17850 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 17851
3f754b86
PE
17852 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
17853
2547adb1
CY
178542011-06-10 Chong Yidong <cyd@stupidchicken.com>
17855
17856 * image.c (gif_load): Fix omitted cast error introduced by
17857 2011-06-06 change.
17858
2c8e37d4
MR
178592011-06-10 Martin Rudalics <rudalics@gmx.at>
17860
17861 * window.h (resize_proportionally, orig_total_lines)
17862 (orig_top_line): Remove from window structure.
17863 (set_window_height, set_window_width, change_window_heights)
17864 (Fdelete_window): Remove prototypes.
17865 (resize_frame_windows): Remove duplicate declaration.
17866
440a42e3
EZ
178672011-06-10 Eli Zaretskii <eliz@gnu.org>
17868
17869 * window.h (resize_frame_windows, resize_window_check)
17870 (delete_deletable_window, resize_root_window)
17871 (resize_frame_windows): Declare prototypes.
17872
17873 * window.c (resize_window_apply): Make definition be "static" to
17874 match the prototype.
17875
562dd5e9
MR
178762011-06-10 Martin Rudalics <rudalics@gmx.at>
17877
17878 * window.c: Remove declarations of Qwindow_size_fixed,
17879 window_min_size_1, window_min_size_2, window_min_size,
17880 size_window, window_fixed_size_p, enlarge_window, delete_window.
17881 Remove static from declaration of Qdelete_window, it's
17882 temporarily needed by Fbury_buffer.
17883 (replace_window): Don't assign orig_top_line and
17884 orig_total_lines.
17885 (Fdelete_window, delete_window): Remove. Window deletion is
17886 handled by window.el.
640c8776
SM
17887 (window_loop): Remove DELETE_OTHER_WINDOWS case.
17888 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
17889 (Fdelete_other_windows): Remove. Deleting other windows is
17890 handled by window.el.
17891 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
17892 handled in window.el.
17893 (window_min_size_2, window_min_size_1, window_min_size): Remove.
17894 Window minimum sizes are handled in window.el.
17895 (shrink_windows, size_window, set_window_height)
17896 (set_window_width, change_window_heights, window_height)
17897 (window_width, CURBEG, CURSIZE, enlarge_window)
17898 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
17899 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
17900 handled in window.el.
17901 (make_dummy_parent): Rename to make_parent_window and give it a
17902 second argument horflag.
17903 (make_window): Don't set resize_proportionally any more.
17904 (Fsplit_window): Remove. Windows are split in window.el.
17905 (save_restore_action, save_restore_orig_size)
17906 (shrink_window_lowest_first, save_restore_orig_size): Remove.
17907 Resize mini windows in window.el.
17908 (grow_mini_window, shrink_mini_window): Implement by calling
17909 Qresize_root_window_vertically, resize_window_check and
17910 resize_window_apply.
640c8776
SM
17911 (saved_window, Fset_window_configuration, save_window_save):
17912 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
17913 resize_proportionally.
17914 (window_min_height, window_min_width): Move to window.el.
17915 (keys_of_window): Move bindings for delete-other-windows,
17916 split-window, delete-window and enlarge-window to window.el.
17917
17918 * buffer.c: Temporarily extern Qdelete_window.
17919 (Fbury_buffer): Temporarily call Qdelete_window instead of
17920 Fdelete_window (Fbury_buffer will move to window.el soon).
17921
17922 * frame.c (set_menu_bar_lines_1): Remove code handling
17923 orig_top_line and orig_total_lines.
17924
17925 * dispnew.c (adjust_frame_glyphs_initially): Don't use
17926 set_window_height but set heights directly.
17927 (change_frame_size_1): Use resize_frame_windows.
17928
17929 * xdisp.c (init_xdisp): Don't use set_window_height but set
17930 heights directly.
17931
640c8776
SM
17932 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
17933 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
17934 run_window_configuration_change_hook.
17935
17936 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
17937 instead of change_window_heights and run
17938 run_window_configuration_change_hook.
17939
1a13852e
MR
179402011-06-09 Martin Rudalics <rudalics@gmx.at>
17941
17942 * window.c (replace_window): Rename second argument REPLACEMENT to
17943 NEW. New third argument SETFLAG. Rewrite.
17944 (delete_window, make_dummy_parent): Call replace_window with
17945 third argument 1.
17946 (window_list_1): Move down in code.
17947 (run_window_configuration_change_hook): Move set_buffer part
17948 before select_frame_norecord part in order to unwind correctly.
17949 Rename count1 to count.
17950 (recombine_windows, delete_deletable_window, resize_root_window)
17951 (Fdelete_other_windows_internal)
17952 (Frun_window_configuration_change_hook, make_parent_window)
17953 (resize_window_check, resize_window_apply, Fresize_window_apply)
17954 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
17955 (Fdelete_window_internal, Fresize_mini_window_internal):
17956 New functions.
1a13852e
MR
17957 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
17958
f3d1777e
MR
179592011-06-08 Martin Rudalics <rudalics@gmx.at>
17960
496e208e
MR
17961 * window.h (window): Add some new members to window structure -
17962 normal_lines, normal_cols, new_total, new_normal, clone_number,
17963 splits, nest, prev_buffers, next_buffers.
17964 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 17965 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 17966
f3d1777e
MR
17967 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
17968 Remove.
496e208e
MR
17969 (make_dummy_parent): Set new members of windows structure.
17970 (make_window): Move down in code. Handle new members of window
17971 structure.
17972 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
17973 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
17974 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
17975 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
17976 (Fset_window_next_buffers, Fset_window_clone_number):
17977 New functions.
496e208e
MR
17978 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
17979 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
17980 Doc-string fixes.
17981 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
17982 Argument WINDOW can be now internal window too.
17983 (Fwindow_use_time): Move up in code.
17984 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
17985 Rewrite doc-string.
17986 (Fset_window_configuration, saved_window)
17987 (Fcurrent_window_configuration, save_window_save): Handle new
17988 members of window structure.
b9e809c2
MR
17989 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
17990 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
17991 (syms_of_window): New Lisp objects Qrecord_window_buffer,
17992 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
17993 Qget_mru_window, Qresize_root_window,
17994 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
17995 Qauto_buffer_name; staticpro them.
f3d1777e 17996
abde8f8c
MR
179972011-06-07 Martin Rudalics <rudalics@gmx.at>
17998
17999 * window.c (Fwindow_total_size, Fwindow_left_column)
18000 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18001 (Fwindow_list_1): New functions.
18002 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
18003 (Fwindow_width, Fscroll_left, Fscroll_right):
18004 Use window_body_cols instead of window_box_text_cols.
18005 (delete_window, Fset_window_configuration):
18006 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
18007 (delete_all_subwindows): Take a window as argument and not a
18008 structure. Rewrite.
190b47e6
MR
18009 (window_loop): Remove handling of GET_LRU_WINDOW and
18010 GET_LARGEST_WINDOW.
18011 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
18012
18013 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
18014 window_box_text_cols. delete_all_subwindows now takes a
18015 Lisp_Object as argument.
abde8f8c 18016
640c8776
SM
18017 * indent.c (compute_motion, Fcompute_motion):
18018 Use window_body_cols instead of window_box_text_cols.
abde8f8c 18019
fa8a67e6
MR
18020 * frame.c (delete_frame): Call delete_all_subwindows with root
18021 window as argument.
18022
a54e3482
DC
180232011-06-07 Daniel Colascione <dan.colascione@gmail.com>
18024
18025 * fns.c (Fputhash): Document return value.
18026
60002bf5
CY
180272011-06-06 Chong Yidong <cyd@stupidchicken.com>
18028
18029 * image.c (gif_load): Implement gif89a spec "no disposal" method.
18030
0c671da6 180312011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 18032
b862a52a 18033 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 18034
be44ca6c
PE
18035 Check for overflow when converting integer to cons and back.
18036 * charset.c (Fdefine_charset_internal, Fdecode_char):
18037 Use cons_to_unsigned to catch overflow.
18038 (Fencode_char): Use INTEGER_TO_CONS.
18039 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
18040 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
18041 * data.c (long_to_cons, cons_to_long): Remove.
18042 (cons_to_unsigned, cons_to_signed): New functions.
18043 These signal an error for invalid or out-of-range values.
18044 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
18045 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
18046 * font.c (Ffont_variation_glyphs):
18047 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
18048 * lisp.h: Include <intprops.h>.
18049 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
18050 (cons_to_signed, cons_to_unsigned): New decls.
18051 (long_to_cons, cons_to_long): Remove decls.
18052 * undo.c (record_first_change): Use INTEGER_TO_CONS.
18053 (Fprimitive_undo): Use CONS_TO_INTEGER.
18054 * xfns.c (Fx_window_property): Likewise.
18055 * xselect.c: Include <limits.h>.
18056 (x_own_selection, selection_data_to_lisp_data):
18057 Use INTEGER_TO_CONS.
18058 (x_handle_selection_request, x_handle_selection_clear)
18059 (x_get_foreign_selection, Fx_disown_selection_internal)
18060 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
18061 (lisp_data_to_selection_data): Use cons_to_unsigned.
18062 (x_fill_property_data): Use cons_to_signed.
18063 Report values out of range.
18064
d1f3d2af
PE
18065 Check for buffer and string overflow more precisely.
18066 * buffer.h (BUF_BYTES_MAX): New macro.
18067 * lisp.h (STRING_BYTES_MAX): New macro.
18068 * alloc.c (Fmake_string):
18069 * character.c (string_escape_byte8):
18070 * coding.c (coding_alloc_by_realloc):
18071 * doprnt.c (doprnt):
18072 * editfns.c (Fformat):
18073 * eval.c (verror):
18074 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
18075 since they may not be the same number.
18076 * editfns.c (Finsert_char):
18077 * fileio.c (Finsert_file_contents):
18078 Likewise for BUF_BYTES_MAX.
18079
dd52fcea
PE
18080 * image.c: Use ptrdiff_t, not int, for sizes.
18081 (slurp_file): Switch from int to ptrdiff_t.
18082 All uses changed.
18083 (slurp_file): Check that file size fits in both size_t (for
18084 malloc) and ptrdiff_t (for sanity and safety).
18085
7f9bbdbb
PE
18086 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
18087 if b->modtime has its maximal value.
18088
dfe18f82
PE
18089 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
18090
84acfcf0
PE
18091 Don't assume time_t can fit into int.
18092 * buffer.h (struct buffer.modtime): Now time_t, not int.
18093 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
18094 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
18095
ccd9a01a
PE
18096 Minor fixes for signed vs unsigned integers.
18097 * character.h (MAYBE_UNIFY_CHAR):
18098 * charset.c (maybe_unify_char):
18099 * keyboard.c (read_char, reorder_modifiers):
18100 XINT -> XFASTINT, since the integer must be nonnegative.
18101 * ftfont.c (ftfont_spec_pattern):
18102 * keymap.c (access_keymap, silly_event_symbol_error):
18103 XUINT -> XFASTINT, since the integer must be nonnegative.
18104 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
18105 since it makes no difference and we prefer signed.
18106 * keyboard.c (record_char): Use XUINT when all the neighbors do.
18107 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
18108 nonnegative.
18109
d6d100dd
SM
181102011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
18111
18112 * window.h (Fwindow_frame): Declare.
18113
2b6148e4
PE
181142011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18115
18116 * alloc.c: Simplify handling of large-request failures (Bug#8800).
18117 (SPARE_MEMORY): Always define.
18118 (LARGE_REQUEST): Remove.
18119 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
18120
f230ecc9
MR
181212011-06-06 Martin Rudalics <rudalics@gmx.at>
18122
727e958e
MR
18123 * lisp.h: Move EXFUNS for Fframe_root_window,
18124 Fframe_first_window and Fset_frame_selected_window to window.h.
18125
18126 * window.h: Move EXFUNS for Fframe_root_window,
18127 Fframe_first_window and Fset_frame_selected_window here from
18128 lisp.h.
18129
18130 * frame.c (Fwindow_frame, Fframe_first_window)
18131 (Fframe_root_window, Fframe_selected_window)
18132 (Fset_frame_selected_window): Move to window.c.
18133 (Factive_minibuffer_window): Move to minibuf.c.
18134 (Fother_visible_frames_p): New function.
18135
18136 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
18137
f230ecc9
MR
18138 * window.c (decode_window, decode_any_window): Move up in code.
18139 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
18140 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
18141 (Fwindow_buffer): Move up and rewrite doc-string.
18142 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
18143 (Fwindow_prev): New functions.
727e958e
MR
18144 (Fwindow_frame): Move here from frame.c. Accept any window as
18145 argument.
18146 (Fframe_root_window, Fframe_first_window)
18147 (Fframe_selected_window): Move here from frame.c. Accept frame
18148 or arbitrary window as argument. Update doc-strings.
18149 (Fminibuffer_window): Move up in code.
18150 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
18151 (Fset_frame_selected_window): Move here from frame.c.
18152 Marginal rewrite.
727e958e
MR
18153 (Fselected_window, select_window, Fselect_window): Move up in
18154 code. Minor doc-string fixes.
f230ecc9 18155
4d09bcf6
PE
181562011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18157
18158 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
18159 Do not assume that spare memory exists; that assumption is valid
18160 only if SYSTEM_MALLOC.
18161 (LARGE_REQUEST): New macro, so that the issue of large requests
18162 is separated from the issue of spare memory.
18163
810928a2
AS
181642011-06-05 Andreas Schwab <schwab@linux-m68k.org>
18165
172418ad
AS
18166 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
18167 format. (Bug#8806)
18168
43f862f7
AS
18169 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
18170
810928a2
AS
18171 * xfns.c (x_set_scroll_bar_default_width): Move declarations
18172 before statements.
18173
a059fe24
JD
181742011-06-05 Jan Djärv <jan.h.d@swipnet.se>
18175
18176 * gtkutil.c (xg_get_default_scrollbar_width): New function.
18177
18178 * gtkutil.h: Declare xg_get_default_scrollbar_width.
18179
18180 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
18181 min width by calling x_set_scroll_bar_default_width (Bug#8505).
18182
989bf368
JB
181832011-06-05 Juanma Barranquero <lekktu@gmail.com>
18184
18185 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
18186
4b80f674
CY
181872011-06-04 Chong Yidong <cyd@stupidchicken.com>
18188
18189 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
18190 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
18191 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
18192 New error handlers.
4b80f674
CY
18193 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
18194 Obey Vx_select_enable_clipboard_manager. Catch errors in
18195 x_clipboard_manager_save (Bug#8779).
18196 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 18197 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 18198
99a33b77 181992011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
18200
18201 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
18202
99a33b77 182032011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
18204
18205 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
18206 in the current matrix if keep_current_p is non-zero.
18207
8264569d
EZ
182082011-06-04 Eli Zaretskii <eliz@gnu.org>
18209
18210 * bidi.c (bidi_level_of_next_char): Fix last change.
18211
57f97249
EZ
182122011-06-03 Eli Zaretskii <eliz@gnu.org>
18213
fec2107c 18214 Support bidi reordering of text covered by display properties.
57f97249 18215
fec2107c
EZ
18216 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
18217 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
18218 (bidi_cache_search, bidi_cache_iterator_state)
18219 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
18220 (bidi_level_of_next_char, bidi_move_to_visually_next):
18221 Support character positions inside a run of characters covered by a
fec2107c
EZ
18222 display string.
18223 (bidi_paragraph_init, bidi_resolve_explicit_1)
18224 (bidi_level_of_next_char): Call bidi_fetch_char and
18225 bidi_fetch_char_advance instead of FETCH_CHAR and
18226 FETCH_CHAR_ADVANCE.
18227 (bidi_init_it): Initialize new members.
18228 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
18229 definitions.
18230 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
18231 instead of using explicit *_CHAR codes.
d6d100dd
SM
18232 (bidi_resolve_explicit, bidi_resolve_weak):
18233 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
18234 bidirectional text is supported only in multibyte buffers.
18235 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
18236 it to initialize the frame_window_p member of struct bidi_it.
18237 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
18238 (bidi_resolve_explicit, bidi_resolve_weak)
18239 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
18240 bidi_it->nchars is non-positive.
18241 (bidi_level_of_next_char): Don't try to lookup the cache for the
18242 next/previous character if nothing is cached there yet, or if we
18243 were just reseat()'ed to a new position.
c40e2fb2 18244
0e14fe90
EZ
18245 * xdisp.c (set_cursor_from_row): Set start and stop points
18246 according to the row's direction when priming the loop that looks
18247 for the glyph on which to display cursor.
18248 (single_display_spec_intangible_p): Function deleted.
18249 (display_prop_intangible_p): Reimplement to call
18250 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
18251 Accept 3 additional arguments needed by handle_display_spec.
18252 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
18253 values: lists, `(when COND...)' forms, etc.
18254 (single_display_spec_string_p): Support property values that are
18255 lists with the argument STRING its top-level element.
18256 (display_prop_string_p): Fix the condition for processing a
18257 property that is a list to be consistent with handle_display_spec.
fec2107c 18258 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
18259 last portion of handle_display_prop.
18260 (compute_display_string_pos): Accept additional argument
18261 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
18262 value of a `display' property is a "replacing spec".
18263 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
18264 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
18265 the display property, but just return a value indicating whether
18266 the display property will replace the characters it covers.
18267 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
18268 frame_window_p members of struct bidi_it.
d6d100dd
SM
18269 (compute_display_string_pos, compute_display_string_end):
18270 New functions.
fec2107c
EZ
18271 (push_it): Accept second argument POSITION, where pop_it should
18272 jump to continue iteration.
18273 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 18274
fec2107c
EZ
18275 * keyboard.c (adjust_point_for_property): Adjust the call to
18276 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
18277
18278 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
18279 (bidi_init_it): Update prototypes.
18280 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
18281 (compute_display_string_pos, compute_display_string_end):
18282 Declare prototypes.
fec2107c
EZ
18283 (struct bidi_it): New members nchars and disp_pos. ch_len is now
18284 EMACS_INT.
fc6f18ce 18285
40087514 182862011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 18287
57f53182
PE
18288 Malloc failure behavior now depends on size of allocation.
18289 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
18290 * lisp.h: Change signatures accordingly.
18291 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
18292 All callers changed. (Bug#8762)
18293
18294 * gnutls.c: Use Emacs's memory allocators.
18295 Without this change, the gnutls library would invoke malloc etc.
18296 directly, which causes problems on non-SYNC_INPUT hosts, and which
18297 runs afoul of improving memory_full behavior. (Bug#8761)
18298 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
18299 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
18300 xfree instead of the default malloc, realloc, free.
18301 (Fgnutls_boot): No need to check for memory allocation failure,
18302 since xmalloc does that for us.
18303
ac32cd99 18304 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
18305 * category.c (hash_get_category_set):
18306 * ccl.c (ccl_driver):
18307 * charset.c (Fdefine_charset_internal):
18308 * charset.h (struct charset.hash_index):
18309 * composite.c (get_composition_id, gstring_lookup_cache)
18310 (composition_gstring_put_cache):
18311 * composite.h (struct composition.hash_index):
18312 * dispextern.h (struct image.hash):
18313 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
18314 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
18315 (hashfn_equal, hashfn_user_defined, make_hash_table)
18316 (maybe_resize_hash_table, hash_lookup, hash_put)
18317 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
18318 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
18319 (Fsxhash, Fgethash, Fputhash, Fmaphash):
18320 * image.c (make_image, search_image_cache, lookup_image)
18321 (xpm_put_color_table_h):
18322 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 18323 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 18324 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 18325 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
18326 * alloc.c (allocate_vectorlike):
18327 Check for overflow in vector size calculations.
18328 * ccl.c (ccl_driver):
18329 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
18330 * fns.c, image.c: Remove unnecessary static decls that would otherwise
18331 need to be updated by these changes.
40087514
PE
18332 * fns.c (make_hash_table, maybe_resize_hash_table):
18333 Check for integer overflow with large hash tables.
0de4bb68
PE
18334 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
18335 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
18336 (SXHASH_REDUCE): New macro.
18337 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
18338 Use it instead of discarding useful hash info with large hash values.
18339 (sxhash_float): New function.
18340 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
18341 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
18342 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
18343 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
18344 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
18345 Adjust signatures to match updated version of code.
18346 (consing_since_gc): Now EMACS_INT, since a single hash table can
18347 use more than INT_MAX bytes.
18348
698d32e2
DN
183492011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
18350
18351 Make it possible to build with GCC-4.6+ -O2 -flto.
18352
18353 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
18354
fd6fa53f
SM
183552011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
18356
18357 * minibuf.c (get_minibuffer, read_minibuf_unwind):
18358 Call minibuffer-inactive-mode.
18359
864db017
JB
183602011-05-31 Juanma Barranquero <lekktu@gmail.com>
18361
18362 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
18363 Update dependencies.
18364
2ad0baf4
DN
183652011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18366
18367 * data.c (init_data): Remove code for UTS, this system is not
18368 supported anymore.
18369
4fcc2638
DN
183702011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18371
18372 Don't force ./temacs to start in terminal mode.
18373
18374 * frame.c (make_initial_frame): Initialize faces in all cases, not
18375 only when CANNOT_DUMP is defined.
18376 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
18377
c56e0fd5
DN
183782011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18379
18380 * dispnew.c (add_window_display_history): Use const for the string
18381 pointer. Remove declaration, not needed.
18382
333d54da 183832011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 18384
55d4c1b2 18385 Use 'inline', not 'INLINE'.
333d54da 18386 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
18387 * alloc.c, fontset.c (INLINE): Remove.
18388 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
18389 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
18390 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
18391 * gmalloc.c (register_heapinfo): Use inline unconditionally.
18392 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
18393
738db178
DN
183942011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18395
18396 Make it possible to run ./temacs.
18397
18398 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
18399 syms_of_callproc does the same thing. Remove test for
18400 "initialized", do it in the caller.
18401 * emacs.c (main): Avoid calling set_initial_environment when dumping.
18402
620c53a6
SM
184032011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
18404
18405 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
18406 (read_minibuf): Use get_minibuffer.
18407 (syms_of_minibuf): Use DEFSYM.
18408 (Qmetadata): New var.
18409 * data.c (Qbuffer): Don't make it static.
18410 (syms_of_data): Use DEFSYM.
18411
e003a292
PE
184122011-05-31 Paul Eggert <eggert@cs.ucla.edu>
18413
18414 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
18415 (CCL_CODE_MIN): New macro.
18416
ed008a6d
PE
184172011-05-30 Paul Eggert <eggert@cs.ucla.edu>
18418
3687c2ef
PE
18419 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
18420
ed008a6d
PE
18421 * eval.c (Qdebug): Now static.
18422 * lisp.h (Qdebug): Remove decl. This reverts a part of the
18423 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
18424 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
18425
d66c4c7c
CY
184262011-05-29 Chong Yidong <cyd@stupidchicken.com>
18427
18428 * image.c: Various fixes to ImageMagick code comments.
18429 (Fimagemagick_types): Doc fix.
18430
5fbc2025
PE
184312011-05-29 Paul Eggert <eggert@cs.ucla.edu>
18432
0196f88a
PE
18433 Minor fixes prompted by GCC 4.6.0 warnings.
18434
18435 * xselect.c (converted_selections, conversion_fail_tag): Now static.
18436
5fbc2025
PE
18437 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
18438 (x_clipboard_manager_save_all): Move extern decl to ...
18439 * xterm.h: ... here, so that it can be checked for consistency.
18440
1dd3c2d9
CY
184412011-05-29 Chong Yidong <cyd@stupidchicken.com>
18442
18443 * xselect.c (x_clipboard_manager_save_frame)
18444 (x_clipboard_manager_save_all): New functions.
18445 (Fx_clipboard_manager_save): Lisp function deleted.
18446
18447 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
18448 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
18449
18450 * xterm.h: Update prototype.
18451
5ba6571d
WX
184522011-05-28 William Xu <william.xwl@gmail.com>
18453
18454 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
18455 exiting (Bug#8239).
18456
3eaff834
JM
184572011-05-28 Jim Meyering <meyering@redhat.com>
18458
e1900994 18459 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
18460 * fns.c (to_uchar): Define.
18461 (crypto_hash_function): Use it to convert some newly-signed
18462 variables to unsigned, to avoid sign-extension bugs. For example,
18463 without this change, (md5 "truc") would evaluate to
18464 45723a2aff78ff4fff7fff1114760e62 rather than the expected
18465 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 18466 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 18467
0f6990a7
PE
184682011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18469
18470 Integer overflow fixes.
c8a9ca5a 18471
08686060
PE
18472 * dbusbind.c: Serial number integer overflow fixes.
18473 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
18474 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
18475 to hold a serial number that is too large for a fixnum.
18476 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18477 Check for serial numbers out of range. Decode any serial number
59568bf0 18478 that was so large that it became a float. (Bug#8722)
08686060 18479
2d1fc3c7
PE
18480 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
18481 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18482 Use XFASTINT rather than XUINT when numbers are nonnegative.
18483 (xd_append_arg, Fdbus_method_return_internal):
18484 (Fdbus_method_error_internal): Likewise. Also, for unsigned
18485 arguments, check that Lisp number is nonnegative, rather than
59568bf0 18486 silently wrapping negative numbers around. (Bug#8722)
30217ff0 18487 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 18488 (Bug#8722)
2d1fc3c7 18489
c8a9ca5a
PE
18490 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
18491
519e1d69
PE
18492 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
18493
6df6ae42 18494 ccl: Add integer overflow checks.
30569699
PE
18495 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
18496 (IN_INT_RANGE): New macros.
18497 (ccl_driver): Use them to check for integer overflow when
18498 decoding a CCL program. Many of the new checks are whether XINT (x)
18499 fits in int; it doesn't always, on 64-bit hosts. The new version
18500 doesn't catch all possible integer overflows, but it's an
847044ea 18501 improvement. (Bug#8719)
30569699 18502
c11285dc
PE
18503 * alloc.c (make_event_array): Use XINT, not XUINT.
18504 There's no need for unsigned here.
18505
fdccd48e
PE
18506 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
18507 This follows up to the 2011-05-06 change that substituted uintptr_t
18508 for EMACS_INT. This case wasn't caught back then.
18509
37910ab2
PE
18510 Rework Fformat to avoid integer overflow issues.
18511 * editfns.c: Include <float.h> unconditionally, as it's everywhere
18512 now (part of C89). Include <verify.h>.
18513 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
18514 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
18515 (Fformat): Avoid the prepass trying to compute sizes; it was only
18516 approximate and thus did not catch overflow reliably. Instead, walk
18517 through the format just once, formatting and computing sizes as we go,
18518 checking for integer overflow at every step, and allocating a larger
18519 buffer as needed. Keep track separately whether the format is
18520 multibyte. Keep only the most-recently calculated precision, rather
18521 than them all. Record whether each argument has been converted to
18522 string. Use EMACS_INT, not int, for byte and char and arg counts.
18523 Support field widths and precisions larger than INT_MAX. Avoid
18524 sprintf's undefined behavior with conversion specifications such as %#d
18525 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
18526 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
18527 formatting out-of-range floating point numbers with int
9173deec 18528 formats. (Bug#8668)
37910ab2 18529
2e6578fb
PE
18530 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
18531
0ae6bdee
PE
18532 * data.c: Avoid integer truncation in expressions involving floats.
18533 * data.c: Include <intprops.h>.
18534 (arith_driver): When there's an integer overflow in an expression
18535 involving floating point, convert the integers to floating point
18536 so that the resulting value does not suffer from catastrophic
18537 integer truncation. For example, on a 64-bit host (* 4
18538 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
18539 Do not rely on undefined behavior after integer overflow.
18540
de883a70
PE
18541 merge count_size_as_multibyte, parse_str_to_multibyte
18542 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 18543 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
18544 Check for integer overflow.
18545 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
18546 since it's now a duplicate of the other. This is more of
18547 a character than a buffer op, so better that it's in character.c.
18548 * fns.c, print.c: Adjust to above changes.
18549
2ff916cb
PE
185502011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
18551
18552 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
18553
f1b54466
PE
185542011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18555
fb1ac845
PE
18556 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18557 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
18558 (x_clipboard_manager_save): Now static.
18559 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
18560
f1b54466
PE
18561 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18562 (crypto_hash_function): Now static.
18563 Fix pointer signedness problems. Avoid unnecessary initializations.
18564
a9f737ee
CY
185652011-05-27 Chong Yidong <cyd@stupidchicken.com>
18566
18567 * termhooks.h (Vselection_alist): Make it terminal-local.
18568
18569 * terminal.c (create_terminal): Initialize it.
18570
18571 * xselect.c: Support for clipboard managers.
18572 (Vselection_alist): Move to termhooks.h as terminal-local var.
18573 (LOCAL_SELECTION): New macro.
18574 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
18575 (symbol_to_x_atom): Remove gratuitous arg.
18576 (x_handle_selection_request, lisp_data_to_selection_data)
18577 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
18578 (x_own_selection, x_get_local_selection, x_convert_selection):
18579 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
18580 (some_frame_on_display): Delete unused function.
18581 (Fx_own_selection_internal, Fx_get_selection_internal)
18582 (Fx_disown_selection_internal, Fx_selection_owner_p)
18583 (Fx_selection_exists_p): New optional frame arg.
18584 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
18585 (x_handle_selection_clear): Don't treat other terminals with the
18586 same keyboard specially. Use the terminal-local Vselection_alist.
18587 (x_clear_frame_selections): Use Frun_hook_with_args.
18588
18589 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
18590
18591 * xterm.h: Add support for those atoms.
18592
e067f0c1
CY
185932011-05-26 Chong Yidong <cyd@stupidchicken.com>
18594
18595 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
18596 (converted_selections, conversion_fail_tag): New global variables.
18597 (x_selection_request_lisp_error): Free the above.
18598 (x_get_local_selection): Remove unnecessary code.
18599 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
18600 of converted selections stored in converted_selections.
18601 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
18602 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
18603 (x_convert_selection): New function.
18604 (x_handle_selection_event): Simplify.
18605 (x_get_foreign_selection): Don't ignore incoming requests while
18606 waiting for an answer; this will fail when we implement
18607 SAVE_TARGETS, and seems unnecessary anyway.
18608 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
18609 (Vx_sent_selection_functions): Doc fix.
18610
0f4aebc0
LL
186112011-05-26 Leo Liu <sdl.web@gmail.com>
18612
18613 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
18614
e61124cd
YM
186152011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18616
18617 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
18618
18619 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
18620 for fringe update if it has periodic bitmap.
ac389d0c 18621 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
18622 and fringe_bitmap_periodic_p.
18623
18624 * fringe.c (get_fringe_bitmap_data): New function.
18625 (draw_fringe_bitmap_1, update_window_fringes): Use it.
18626 (update_window_fringes): Record periodicity of fringe bitmap in glyph
18627 row. Mark glyph row for fringe update if periodicity changed.
18628
18629 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
18630 for fringe update unless it has periodic bitmap.
18631
f16d9837
KH
186322011-05-25 Kenichi Handa <handa@m17n.org>
18633
18634 * xdisp.c (get_next_display_element): Set correct it->face_id for
18635 a static composition.
18636
e1b90ef6
LL
186372011-05-24 Leo Liu <sdl.web@gmail.com>
18638
18639 * deps.mk (fns.o):
18640 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
18641
18642 * fns.c (crypto_hash_function, Fsha1): New function.
18643 (Fmd5): Use crypto_hash_function.
18644 (syms_of_fns): Add Ssha1.
18645
7400048f
PE
186462011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18647
18648 * gnutls.c: Remove unused macros.
18649 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
18650 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
18651 Remove macros that are defined and never used.
18652 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
18653
abb71cf4
CY
186542011-05-22 Chong Yidong <cyd@stupidchicken.com>
18655
18656 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
18657 (Fx_get_selection_internal): Minor cleanup.
18658 (Fx_own_selection_internal): Rename arguments for consistency with
18659 select.el.
18660
6307db39
PE
186612011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18662
18663 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
18664
f3d4e0a4
CY
186652011-05-22 Chong Yidong <cyd@stupidchicken.com>
18666
18667 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
18668
4d8ade89
YM
186692011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18670
18671 * dispnew.c (scrolling_window): Don't exclude the case that the
18672 last enabled row in the desired matrix touches the bottom boundary.
18673
32078c8d
GM
186742011-05-21 Glenn Morris <rgm@gnu.org>
18675
18676 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
18677 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
18678 and add some more files.
32078c8d 18679
7285dc67
EZ
186802011-05-20 Eli Zaretskii <eliz@gnu.org>
18681
18682 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
18683 report_file_error introduced by the change from 2011-05-07.
18684
89d1bd22
PE
186852011-05-20 Paul Eggert <eggert@cs.ucla.edu>
18686
18687 * systime.h (Time): Define only if emacs is defined.
18688 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
18689 where the include path doesn't have X11/X.h by default. See
18690 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
18691
cd394be1 186922011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
18693
18694 * composite.c (find_automatic_composition): Fix previous change.
18695
b9704ad9
GM
186962011-05-20 Glenn Morris <rgm@gnu.org>
18697
18698 * lisp.mk: New file, split from Makefile.in.
18699 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
18700 (shortlisp): Remove.
18701 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
18702
4a720484
GM
187032011-05-19 Glenn Morris <rgm@gnu.org>
18704
18705 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
18706 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
18707 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
18708 (lisp): Set the order to that of loadup.el.
18709 (shortlisp): Make it a copy of $lisp.
18710 (SOME_MACHINE_LISP): Remove.
18711 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
18712 Use just $shortlisp, not $SOME_MACHINE_LISP too.
18713
a28d4396
KH
187142011-05-18 Kenichi Handa <handa@m17n.org>
18715
18716 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
18717 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
18718 (find_automatic_composition): Mostly rewrite for efficiency.
18719
a2b1fa8e
JB
187202011-05-18 Juanma Barranquero <lekktu@gmail.com>
18721
18722 * makefile.w32-in: Update dependencies.
18723
8e1f5610
CS
187242011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
18725
18726 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 18727 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 18728
7025ee00 187292011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 18730
cdfa6eab
PE
18731 Fix some integer overflow issues, such as string length overflow.
18732
06d6db33
PE
18733 * insdel.c (count_size_as_multibyte): Check for string overflow.
18734
2b4560a8
PE
18735 * character.c (lisp_string_width): Check for string overflow.
18736 Use EMACS_INT, not int, for string indexes and lengths; in
18737 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
18738 the resulting string length overflows an EMACS_INT; instead,
18739 report a string overflow if no precision given. When checking for
18740 precision exhaustion, use a check that cannot possibly have
18741 integer overflow. (Bug#8675)
18742 * character.h (lisp_string_width): Adjust to new signature.
18743
cb93f9be
PE
18744 * alloc.c (string_overflow): New function.
18745 (Fmake_string): Use it. This doesn't change behavior, but saves
18746 a few bytes and will simplify future changes.
18747 * character.c (string_escape_byte8): Likewise.
18748 * lisp.h (string_overflow): New decl.
18749
1a1f3366
PE
18750 Fixups, following up to the user-interface timestamp change.
18751 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
18752 for UI timestamps, instead of unsigned long.
9fbd6841
PE
18753 * msdos.c (mouse_get_pos): Likewise.
18754 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
18755 * w32gui.h (Time): Define by including "systime.h" rather than by
18756 declaring it ourselves. (Bug#8664)
18757
d4e3e4d3
PE
18758 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
18759 * image.c (clear_image_cache): Likewise.
18760
f6a24d19
PE
18761 * term.c (term_mouse_position): Don't assume time_t wraparound.
18762
08dc5ae6
PE
18763 Be more systematic about user-interface timestamps.
18764 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
18765 and sometimes 'EMACS_UINT', to represent these timestamps.
18766 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
18767 This makes the code easier to follow, and makes it easier to catch
18768 integer overflow bugs such as Bug#8664.
18769 * frame.c (Fmouse_position, Fmouse_pixel_position):
18770 Use Time, not unsigned long, for user-interface timestamps.
18771 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
18772 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
18773 * keyboard.h (last_event_timestamp): Likewise.
18774 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
18775 * menu.h (xmenu_show): Likewise.
18776 * term.c (term_mouse_position): Likewise.
18777 * termhooks.h (struct input_event.timestamp): Likewise.
18778 (struct terminal.mouse_position_hook): Likewise.
18779 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
18780 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
18781 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
18782 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
18783 what it was before.
18784 * menu.h, termhooks.h: Include "systime.h", for Time.
18785
8e55734a
PE
18786 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
18787 Don't assume that the difference between two unsigned long values
18788 can fit into an integer. At this point, we know button_down_time
18789 <= event->timestamp, so the difference must be nonnegative, so
18790 there's no need to cast the result if double-click-time is
18791 nonnegative, as it should be; check that it's nonnegative, just in
18792 case. This bug is triggered when events are more than 2**31 ms
86db42d2 18793 apart (about 25 days). (Bug#8664)
8e55734a 18794
841f1b75 18795 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 18796 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 18797
3e26f69c
PE
18798 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
18799 that always fit in int. Use a sentinel instead of a counter, to
18800 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
18801 * frame.h (struct frame): Use int for menu_bar_items_used
18802 instead of EMACS_INT, since it always fits in int.
3e26f69c 18803
5cc152c0
PE
18804 * menu.c (grow_menu_items): Check for int overflow.
18805
d89eb65e
PE
18806 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
18807
5235bd3e
PE
18808 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
18809 Before, the code was not consistent. These values cannot exceed
18810 2**31 - 1 so there's no need to make them unsigned.
18811 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
18812 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
18813 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
18814 as modifiers.
18815 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
18816
bc827e23
PE
18817 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
18818 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
18819 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
18820 presumably because the widths might not match.
18821
78eb494e
PE
18822 * window.c (size_window): Avoid needless test at loop start.
18823
04f2d78b
CB
188242011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
18825
18826 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
18827
d2fc7e3d 188282011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
18829
18830 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
18831
d2fc7e3d 188322011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
18833
18834 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
18835 `width' to `bar_area_x' and `bar_area_width', respectively.
18836 (x_scroll_run): Take account of fringe background extension.
18837
04f2d78b
CB
18838 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
18839 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
18840 `bar_area_width', respectively.
18841 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
18842 background extension.
18843
79b70037
GM
188442011-05-10 Jim Meyering <meyering@redhat.com>
18845
18846 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
18847
2f142cc5
JB
188482011-05-10 Juanma Barranquero <lekktu@gmail.com>
18849
18850 * image.c (Finit_image_library): Return t for built-in image types,
18851 like pbm and xbm. (Bug#8640)
18852
57679c86
AS
188532011-05-09 Andreas Schwab <schwab@linux-m68k.org>
18854
18855 * w32menu.c (set_frame_menubar): Fix submenu allocation.
18856
888c9e86
EZ
188572011-05-07 Eli Zaretskii <eliz@gnu.org>
18858
b0512a1d
EZ
18859 * w32console.c (Fset_screen_color): Doc fix.
18860 (Fget_screen_color): New function.
18861 (syms_of_ntterm): Defsubr it.
18862
7285dc67
EZ
18863 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
18864 unlink the temporary file if Fcall_process didn't create it in the
18865 first place.
18866 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
18867 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
18868 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
18869 cue to call_process_cleanup not to close that handle.
18870
4d3fcc8e
BK
188712011-05-07 Ben Key <bkey76@gmail.com>
18872
18873 * makefile.w32-in: The bootstrap-temacs rule now makes use of
18874 one of two shell specific rules, either bootstrap-temacs-CMD or
18875 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
18876 to the previous implementation of the bootstrap-temacs rule.
18877 The bootstrap-temacs-CMD rule is similar to the previous
18878 implementation of the bootstrap-temacs rule except that it
18879 makes use of the ESC_CFLAGS variable instead of the CFLAGS
18880 variable.
18881
18882 These changes, along with some changes to nt/configure.bat,
18883 nt/gmake.defs, and nt/nmake.defs, are required to extend my
18884 earlier fix to add support for --cflags and --ldflags options
18885 that include quotes so that it works whether make uses cmd or
18886 sh as the shell.
18887
b4289b64
MA
188882011-05-06 Michael Albinus <michael.albinus@gmx.de>
18889
18890 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
18891 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
18892 is a constant.
18893 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
18894 a string. Handle both cases.
18895 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
18896 (Fdbus_register_method): Use Qinvalid_function.
18897
af4c0e28
JB
188982011-05-06 Juanma Barranquero <lekktu@gmail.com>
18899
18900 * makefile.w32-in: Update dependencies.
18901 (LISP_H): Add inttypes.h and stdin.h.
18902 (PROCESS_H): Add unistd.h.
18903
c51453d9
EZ
189042011-05-06 Eli Zaretskii <eliz@gnu.org>
18905
18906 * lread.c: Include limits.h (fixes the MS-Windows build broken by
18907 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
18908
8ff0ac3c 189092011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 18910
4c4b566b
PE
18911 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
18912
aab2b9b5
PE
18913 * term.c (vfatal): Remove stray call to va_end.
18914 It's not needed and the C Standard doesn't allow it here anyway.
18915
c378da0b
PE
18916 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
18917 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
18918
288b08c7
PE
18919 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
18920 bytes.
18921
e3601888
PE
18922 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
18923
db6c0e74
PE
18924 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18925
dd5963ea
PE
18926 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
18927
88c9450f
PE
18928 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
18929
2f9442b8
PE
18930 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
18931
c032b5f8
PE
18932 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
18933 * charset.c (Fdefine_charset_internal): Don't initialize
18934 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 18935 32-bit int (Bug#8600).
a108c10b
PE
18936
18937 * lread.c (read_integer): Be more consistent with string-to-number.
18938 Use string_to_number to do the actual conversion; this avoids
18939 rounding errors and fixes some other screwups. Without this fix,
18940 for example, #x1fffffffffffffff was misread as -2305843009213693952.
18941 (digit_to_number): Move earlier, for benefit of read_integer.
18942 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 18943 not a digit in any supported base. (Bug#8602)
a108c10b 18944
ad5f9eea
PE
18945 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
18946
aec1708a
PE
18947 * dispnew.c (scrolling_window): Return 1 if we scrolled,
18948 to match comment at start of function. This also removes a
18949 GCC warning about overflow in a 32+64-bit port.
18950
47be4ab5
PE
18951 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
18952
371cac43
PE
18953 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
18954 Reported by Stefan Monnier in
18955 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
18956 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18957 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 18958
d01a7826
PE
18959 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
18960 (EMACS_UINTPTR): Likewise, with uintptr_t.
18961
7fd47d5c
PE
18962 * lisp.h: Prefer 64-bit EMACS_INT if available.
18963 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
18964 on 32-bit hosts that have 64-bit int, so that they can access
18965 large files.
122b0c86
PE
18966 However, temporarily disable this change unless the temporary
18967 symbol WIDE_EMACS_INT is defined.
7fd47d5c 18968
8727937b
PE
18969 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
18970
8ac068ac
PE
18971 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
18972 This removes an assumption that EMACS_INT and long are the same
18973 width as pointers. The assumption is true for Emacs porting targets
18974 now, but we want to make other targets possible.
18975 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
18976 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
18977 In the rest of the code, change types of integers that hold casted
18978 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
18979 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
18980 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
18981 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
18982 No need to cast type when ORing.
18983 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
18984 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
18985 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
18986 assume EMACS_INT is the same width as char *.
18987 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
18988 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
18989 Remove no-longer-needed casts.
18990 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
18991 (xg_tool_bar_help_callback, xg_make_tool_item):
18992 Use EMACS_INTPTR to hold an integer
18993 that will be cast to void *; this can avoid a GCC warning
18994 if EMACS_INT is not the same width as void *.
18995 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
18996 * xdisp.c (display_echo_area_1, resize_mini_window_1):
18997 (current_message_1, set_message_1):
18998 Use a local to convert to proper width without a cast.
18999 * xmenu.c (dialog_selection_callback): Likewise.
19000
ede49d71
PE
19001 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19002 Also, don't assume VALBITS / RAND_BITS is less than 5,
19003 and don't rely on undefined behavior when shifting a 1 left into
19004 the sign bit.
19005 * lisp.h (get_random): Change signature to match.
19006
2f30ecd0
PE
19007 * lread.c (hash_string): Use size_t, not int, for hash computation.
19008 Normally we prefer signed values; but hashing is special, because
19009 it's better to use unsigned division on hash table sizes so that
19010 the remainder is nonnegative. Also, size_t is the natural width
19011 for hashing into memory. The previous code used 'int', which doesn't
19012 retain enough info to hash well into very large tables.
19013 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
19014
2a866e7b
PE
19015 * dbusbind.c: Don't possibly lose pointer info when converting.
19016 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19017 Use XPNTR rather than XHASH, so that the high-order bits of
19018 the pointer aren't lost when converting through void *.
19019
51639eac
PE
19020 * eval.c (Fautoload): Don't double-shift a pointer.
19021
92394119
PE
19022 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
19023
dbdb9a7c
JB
190242011-05-06 Juanma Barranquero <lekktu@gmail.com>
19025
19026 * gnutls.c (DEF_GNUTLS_FN):
19027 * image.c (DEF_IMGLIB_FN): Make function pointers static.
19028
db7a0b4f
AS
190292011-05-05 Andreas Schwab <schwab@linux-m68k.org>
19030
19031 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
19032 marker. (Bug#8610)
19033
cd394be1 190342011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
19035
19036 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
19037 New version that can reserve upto 2GB of heap space.
19038
f7ff1b0f 190392011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
19040
19041 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
19042
639c109b
TZ
190432011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
19044
19045 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
19046 `gnutls_certificate_set_x509_key_file'.
19047
d2127135
JB
190482011-05-05 Juanma Barranquero <lekktu@gmail.com>
19049
19050 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
19051 Update dependencies.
19052
e968f4f3
JB
190532011-05-04 Juanma Barranquero <lekktu@gmail.com>
19054
19055 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
19056 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
19057 Remove unused parameter `fildes'.
19058 * process.c (read_process_output, send_process): Don't pass it.
19059
84d358f0
JB
190602011-05-04 Juanma Barranquero <lekktu@gmail.com>
19061
19062 Fix previous change: the library cache is defined in w32.c.
19063 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
19064 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
19065
0898ca10
JB
190662011-05-04 Juanma Barranquero <lekktu@gmail.com>
19067
19068 Implement dynamic loading of GnuTLS on Windows.
19069
19070 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
19071 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
19072 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19073 Declare.
19074
19075 * gnutls.c (Qgnutls_dll): Define.
19076 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
19077 (gnutls_*): Declare function pointers.
19078 (init_gnutls_functions): New function to initialize function pointers.
19079 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
19080 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
19081 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19082 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
19083 (emacs_gnutls_write, emacs_gnutls_read)
19084 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
19085 (Fgnutls_available_p): New function.
19086 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
19087 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
19088 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
19089
19090 * image.c: Include w32.h.
19091 (Vimage_type_cache): Delete.
19092 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
19093 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
19094 (w32_delayed_load): Move to w32.c.
19095
19096 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
19097
19098 * w32.c (QCloaded_from, Vlibrary_cache): Define.
19099 (w32_delayed_load): Move from image.c. When loading a library, record
19100 its filename in the :loaded-from property of the library id.
19101 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
19102 Initialize and staticpro them.
19103 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
19104
19105 * process.c: Include lisp.h before w32.h, not after.
19106 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
19107 instead of gnutls_record_check_pending.
19108
19109 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
19110
ff4de4aa
TZ
191112011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
19112
19113 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
19114 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
19115 as passed in.
19116
abe95abb
JD
191172011-05-03 Jan Djärv <jan.h.d@swipnet.se>
19118
19119 * xterm.c (x_set_frame_alpha): Do not set property on anything
19120 else than FRAME_X_OUTER_WINDOW (Bug#8608).
19121
e16e55d4
JB
191222011-05-02 Juanma Barranquero <lekktu@gmail.com>
19123
19124 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
19125
bafcf6a5
JB
191262011-05-02 Juanma Barranquero <lekktu@gmail.com>
19127
19128 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
19129 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
19130 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
19131 (gnutls_global_initialized, Qgnutls_bootprop_priority)
19132 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
19133 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
19134 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
19135 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
19136 (Qgnutls_bootprop_callbacks_verify): Make static.
19137
e7a6747f
AS
191382011-05-01 Andreas Schwab <schwab@linux-m68k.org>
19139
19ed11ba
AS
19140 * callproc.c: Indentation fixup.
19141
e7a6747f 19142 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
19143 (wait_for_termination, interruptible_wait_for_termination):
19144 Move after wait_for_termination_1.
e7a6747f 19145
1ef14cb4
LMI
191462011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
19147
19148 * sysdep.c (interruptible_wait_for_termination): New function
19149 which is like wait_for_termination, but allows keyboard
19150 interruptions.
19151
19152 * callproc.c (Fcall_process): Add (:file "file") as an option for
19153 the STDOUT buffer.
19154 (Fcall_process_region): Ditto.
19155
330d880c
EZ
191562011-04-30 Eli Zaretskii <eliz@gnu.org>
19157
8db90b73
EZ
19158 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
19159 rather than `XVECTOR (FOO)->size'.
19160
330d880c
EZ
19161 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
19162 inttypes.h, as a gnulib replacement is used if it not available in
19163 system headers.
19164
15cbd324
EZ
191652011-04-21 Eli Zaretskii <eliz@gnu.org>
19166
19167 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
19168 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
19169 of MOST_POSITIVE_FIXNUM. (Bug#8528)
19170
19171 * coding.c (coding_alloc_by_realloc): Error out if destination
19172 will grow beyond MOST_POSITIVE_FIXNUM.
19173 (decode_coding_emacs_mule): Abort if there isn't enough place in
19174 charbuf for the composition carryover bytes. Reserve an extra
19175 space for up to 2 characters produced in a loop.
19176 (decode_coding_iso_2022): Abort if there isn't enough place in
19177 charbuf for the composition carryover bytes.
19178
191792011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 19180
ae940cca
EZ
19181 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
19182 aborting when %lld or %lll format is passed.
19183 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
19184 %llo or %llx format is passed. (Bug#8545)
19185
03ab8921
EZ
19186 * window.c (window_scroll_line_based): Use a marker instead of
19187 simple variables to record original value of point. (Bug#7952)
19188
afda1437
EZ
19189 * doprnt.c (doprnt): Fix the case where a multibyte sequence
19190 produced by %s or %c overflows available buffer space. (Bug#8545)
19191
f76dee0c
PE
191922011-04-28 Paul Eggert <eggert@cs.ucla.edu>
19193
19194 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 19195 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 19196
fdc5744d
JB
191972011-04-28 Juanma Barranquero <lekktu@gmail.com>
19198
19199 * w32.c (init_environment): Warn about defaulting HOME to C:\.
19200
638f053a
JB
192012011-04-28 Juanma Barranquero <lekktu@gmail.com>
19202
19203 * keyboard.c (Qdelayed_warnings_hook): Define.
19204 (command_loop_1): Run `delayed-warnings-hook'
19205 if Vdelayed_warnings_list is non-nil.
19206 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
19207 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
19208
d178f871
EZ
192092011-04-28 Eli Zaretskii <eliz@gnu.org>
19210
19211 * doprnt.c (doprnt): Don't return value smaller than the buffer
19212 size if the message was truncated. (Bug#8545).
19213
b124fd93
JB
192142011-04-28 Juanma Barranquero <lekktu@gmail.com>
19215
19216 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
19217 (Fx_window_property): #if-0 the whole functions, not just the bodies.
19218
e810457d
PE
192192011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19220
19221 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
19222
ea51cceb
JB
192232011-04-27 Juanma Barranquero <lekktu@gmail.com>
19224
19225 * makefile.w32-in: Update dependencies.
19226
94dcfacf
EZ
192272011-04-27 Eli Zaretskii <eliz@gnu.org>
19228
19229 Improve `doprnt' and its usage. (Bug#8545)
19230 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
19231 `format_end'. Remove support for %l as a conversion specifier.
19232 Don't use xrealloc. Improve diagnostics when the %l size modifier
19233 is used. Update the commentary.
19234
19235 * eval.c (verror): Simplify calculation of size_t.
19236
19237 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
19238 messages.
19239
f61f41d7
PE
192402011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
19241
19242 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
19243 change.
19244
96fb4434
PE
192452011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19246
19247 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
19248 This makes this file independent of the recent pseudovector change.
19249
671875da 192502011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 19251
69e9b5a3
PE
19252 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
19253
b5f869a7 19254 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 19255 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 19256 Remove unused local.
c8926152 19257 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 19258
841a1577 19259 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
19260 GCC 4.6.0 optimizes based on type-based alias analysis.
19261 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
19262 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
19263 != &v->size, and therefore "v->size = 1; b->size = 2; return
19264 v->size;" must therefore return 1. This assumption is incorrect
19265 for Emacs, since it type-puns struct Lisp_Vector * with many other
19266 types. To fix this problem, this patch adds a new type struct
f904488f 19267 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
19268 and pseudovectors, and helps optimizing compilers not get fooled
19269 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
19270 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
19271 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
19272 the size member.
eab3844f
PE
19273 (XSETPVECTYPE): Rewrite in terms of new macro.
19274 (XSETPVECTYPESIZE): New macro, specifying both type and size.
19275 This is a bit clearer, and further avoids the possibility of
19276 undesirable aliasing.
19277 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 19278 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
19279 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
19280 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
19281 (ASIZE): Now uses header.size rather than size.
19282 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
19283 to avoid the hassle of writing XVECTOR (foo)->header.size.
19284 (struct vectorlike_header): New type.
eab3844f
PE
19285 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
19286 object, to help avoid aliasing.
19287 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
19288 (SUBRP): Likewise, since Lisp_Subr is a special case.
19289 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
19290 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
19291 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 19292 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
19293 changed to be "header.size" and "header.next".
19294 * buffer.h (struct buffer): Likewise.
19295 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
19296 * frame.h (struct frame): Likewise.
19297 * process.h (struct Lisp_Process): Likewise.
19298 * termhooks.h (struct terminal): Likewise.
19299 * window.c (struct save_window_data, struct saved_window): Likewise.
19300 * window.h (struct window): Likewise.
19301 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
19302 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
19303 * buffer.c (init_buffer_once): Likewise.
19304 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
19305 special case.
19306 * process.c (Fformat_network_address): Use local var for size,
19307 for brevity.
19308
0df1eac5
PE
19309 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
19310
847ab9d1 19311 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
19312 * data.c (atof): Remove decl; no longer used or needed.
19313 (digit_to_number): Move to lread.c.
19314 (Fstring_to_number): Use new string_to_number function, to be
19315 consistent with how the Lisp reader treats infinities and NaNs.
19316 Do not assume that floating-point numbers represent EMACS_INT
19317 without losing information; this is not true on most 64-bit hosts.
19318 Avoid double-rounding errors, by insisting on integers when
19319 parsing non-base-10 numbers, as the documentation specifies.
19320 * lisp.h (string_to_number): New decl, replacing ...
19321 (isfloat_string): Remove.
bc0a5c13 19322 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 19323 (read1): Do not accept +. and -. as integers; this
452f4150
PE
19324 appears to have been a coding error. Similarly, do not accept
19325 strings like +-1e0 as floating point numbers. Do not report
19326 overflow for integer overflows unless the base is not 10 which
19327 means we have no simple and reliable way to continue.
19328 Break out the floating-point parsing into a new
19329 function string_to_number, so that Fstring_to_number parses
19330 floating point numbers consistently with the Lisp reader.
04f2d78b 19331 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
19332 (E_CHAR, EXP_INT): Remove, replacing with ...
19333 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
19334 (string_to_number): New function, replacing isfloat_string.
19335 This function checks for valid syntax and produces the resulting
19336 Lisp float number too. Rework it so that string-to-number
bc0a5c13 19337 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
19338 so that overflow for non-base-10 numbers is reported only when
19339 there's no portable and simple way to convert to floating point.
452f4150 19340
67769ffc
PE
19341 * textprop.c (set_text_properties_1): Rewrite for clarity,
19342 and to avoid GCC warning about integer overflow.
19343
c20db43f
PE
19344 * intervals.h (struct interval): Use EMACS_INT for members
19345 where EMACS_UINT might cause problems. See
19346 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
19347 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
19348 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
19349 All uses changed.
37aa2f85
PE
19350 (offset_intervals): Tell GCC not to worry about length overflow
19351 when negating a negative length.
c20db43f 19352
2538aa2f
PE
19353 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
19354 (overrun_check_free): Likewise.
19355
f2d3008d
PE
19356 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
19357 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
19358 word size.
19359
ec8df744
PE
19360 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19361 (gnutls_make_error): Rename local to avoid shadowing.
19362 (gnutls_emacs_global_deinit): ifdef out; not used.
19363 (Fgnutls_boot): Use const for pointer to readonly storage.
19364 Comment out unused local. Fix pointer signedness problems.
19365
640ee02d
PE
19366 * lread.c (openp): Don't stuff size_t into an 'int'.
19367 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
19368 about possible signed overflow.
19369
6048fb2a
PE
19370 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19371 (GDK_KEY_g): Don't define if already defined.
19372 (xg_prepare_tooltip): Avoid pointer signedness problem.
19373 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
19374
fa3c87e1
PE
19375 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
19376 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
19377
2172544b
PE
19378 * xfns.c (Fx_window_property): Simplify a bit,
19379 to make a bit faster and to avoid GCC 4.6.0 warning.
19380 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
19381
9b821a21
PE
19382 * fns.c (internal_equal): Don't assume size_t fits in int.
19383
3c616cfa
PE
19384 * alloc.c (compact_small_strings): Tighten assertion a little.
19385
c2982e87
PE
19386 Replace pEd with more-general pI, and fix some printf arg casts.
19387 * lisp.h (pI): New macro, generalizing old pEd macro to other
19388 conversion specifiers. For example, use "...%"pI"d..." rather
19389 than "...%"pEd"...".
19390 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 19391 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
19392 * alloc.c (check_pure_size): Don't overflow by converting size to int.
19393 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
19394 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
19395 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
19396 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
19397 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
19398 64-bit hosts.
19399 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
19400 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
19401 * print.c (safe_debug_print, print_object): Likewise.
19402 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
19403 to int.
6f04d126
PE
19404 Use pI instead of if-then-else-abort. Use %p to avoid casts,
19405 avoiding the 0 flag, which is not portable.
c2982e87
PE
19406 * process.c (Fmake_network_process): Use pI to avoid cast.
19407 * region-cache.c (pp_cache): Likewise.
19408 * xdisp.c (decode_mode_spec): Likewise.
19409 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
19410 behavior on 64-bit hosts with printf arg.
6f04d126 19411 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
19412 (x_stop_queuing_selection_requests): Likewise.
19413 (x_get_window_property): Don't truncate byte count to an 'int'
19414 when tracing.
0b432f21 19415
5e073ec7
PE
19416 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
19417 here, since it parses constructs like leading '-' and spaces,
19418 which are not wanted; and it overflows with large numbers.
19419 Instead, simply match F[0-9]+, which is what is wanted anyway.
19420
36372bf9
PE
19421 * alloc.c: Remove unportable assumptions about struct layout.
19422 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
19423 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
19424 (allocate_vectorlike, make_pure_vector): Use the new macros,
19425 plus offsetof, to remove unportable assumptions about struct layout.
19426 These assumptions hold on all porting targets that I know of, but
19427 they are not guaranteed, they're easy to remove, and removing them
19428 makes further changes easier.
19429
0b432f21
PE
19430 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
19431 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
19432 (string_overrun_cookie): Now const. Use initializers that
19433 don't formally overflow signed char, to avoid warnings.
000098c1
PE
19434 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
19435 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
19436 (allocate_buffer): Don't assume sizeof (struct buffer) is a
19437 multiple of sizeof (EMACS_INT); it need not be, if
19438 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 19439 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 19440
895009e1
JB
194412011-04-26 Juanma Barranquero <lekktu@gmail.com>
19442
19443 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
19444
6a7a1b0b
TZ
194452011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
19446
19447 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 19448 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
19449 Reported by Paul Eggert <eggert@cs.ucla.edu>.
19450
841a1577 194512011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
19452
19453 * lisp.h (Qdebug): List symbol.
895009e1 19454 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
19455 * keyboard.c (debug-on-event): New variable.
19456 (handle_user_signal): Break into debugger when debug-on-event
19457 matches the current signal symbol.
19458
f2d3ba6f
DN
194592011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
19460
19461 * alloc.c (check_sblock, check_string_bytes)
19462 (check_string_free_list): Convert to standard C.
19463
42ce4c63
TZ
194642011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
19465
19466 * w32.c (emacs_gnutls_push): Fix typo.
19467
825cd63c
EZ
194682011-04-25 Eli Zaretskii <eliz@gnu.org>
19469
fb11d64d
EZ
19470 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
19471 "cast to pointer from integer of different size".
19472
825cd63c
EZ
19473 Improve doprnt and its use in verror. (Bug#8545)
19474 * doprnt.c (doprnt): Document the set of format control sequences
19475 supported by the function. Use SAFE_ALLOCA instead of always
19476 using `alloca'.
19477
19478 * eval.c (verror): Don't limit the buffer size at size_max-1, that
19479 is one byte too soon. Don't use xrealloc; instead xfree and
19480 xmalloc anew.
19481
e061a11b
TZ
194822011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
19483
19484 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
19485 callbacks stage.
19486
19487 * gnutls.c: Renamed global_initialized to
19488 gnutls_global_initialized. Added internals for the
19489 :verify-hostname-error, :verify-error, and :verify-flags
19490 parameters of `gnutls-boot' and documented those parameters in the
19491 docstring. Start callback support.
9173deec
JB
19492 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
19493 unless a fatal error occurred. Call gnutls_alert_send_appropriate
19494 on error. Return error code.
e061a11b
TZ
19495 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
19496 (emacs_gnutls_read): Likewise.
19497 (Fgnutls_boot): Return handshake error code.
19498 (emacs_gnutls_handle_error): New function.
19499 (wsaerror_to_errno): Likewise.
19500
19501 * w32.h (emacs_gnutls_pull): Add prototype.
19502 (emacs_gnutls_push): Likewise.
19503
19504 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
19505 (emacs_gnutls_push): Likewise.
19506
195072011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
19508
19509 * process.c (wait_reading_process_output): Check if GnuTLS
19510 buffered some data internally if no FDs are set for TLS
19511 connections.
19512
19513 * makefile.w32-in (OBJ2): Add gnutls.$(O).
19514 (LIBS): Link to USER_LIBS.
19515 ($(BLD)/gnutls.$(0)): New target.
19516
fa6996bc
EZ
195172011-04-24 Eli Zaretskii <eliz@gnu.org>
19518
eb35682e
EZ
19519 * xdisp.c (handle_single_display_spec): Rename the
19520 display_replaced_before_p argument into display_replaced_p, to
19521 make it consistent with the commentary. Fix typos in the
19522 commentary.
19523
e2ad650c
EZ
19524 * textprop.c (syms_of_textprop): Remove dead code.
19525 (copy_text_properties): Delete obsolete commentary about an
19526 interface that was deleted long ago. Fix typos in the description
19527 of arguments.
19528
1b2de274
EZ
19529 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
19530 to changes in oldXMenu/XMenu.h from 2011-04-16.
19531 <menu_help_message, prev_menu_help_message>: Constify.
19532 (IT_menu_make_room): menu->help_text is now `const char **';
19533 adjust.
19534
19535 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
19536 to changes in oldXMenu/XMenu.h from 2011-04-16.
19537 (struct XMenu): Declare `help_text' `const char **'.
19538
19539 * xfaces.c <Qunspecified>: Make extern again.
19540
19541 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 19542 required by POSIX.
1b2de274 19543
762b15be
EZ
19544 * doc.c (get_doc_string): Improve the format passed to `error'.
19545
19546 * doprnt.c (doprnt): Improve commentary.
19547
19548 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
19549
19550 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
19551 them with etags.
19552
f1052e5d
EZ
19553 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
19554 changes in globals.h immediately force recompilation.
762b15be
EZ
19555 (TAGS): Depend on $(CURDIR)/m/intel386.h and
19556 $(CURDIR)/s/ms-w32.h.
19557 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 19558
fa6996bc
EZ
19559 * character.c (Fchar_direction): Function deleted.
19560 (syms_of_character): Don't defsubr it.
19561 <char-direction-table>: Deleted.
19562
e6c3da20
EZ
195632011-04-23 Eli Zaretskii <eliz@gnu.org>
19564
19565 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
19566 * doprnt.c: Include limits.h.
19567 (SIZE_MAX): New macro.
04f2d78b
CB
19568 (doprnt): Return a size_t value. 2nd arg is now size_t.
19569 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
19570 Improve overflow protection. Support `l' modifier for integer
19571 conversions. Support %l conversion. Don't assume an EMACS_INT
19572 argument for integer conversions and for %c.
19573
19574 * lisp.h (doprnt): Restore prototype.
19575
19576 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
19577 $(SRC)/character.h.
19578
19579 * Makefile.in (base_obj): Add back doprnt.o.
19580
19581 * deps.mk (doprnt.o): Add back prerequisites.
19582 (callint.o): Depend on character.h.
19583
19584 * eval.c (internal_lisp_condition_case): Include the handler
19585 representation in the error message.
19586 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
19587 when breaking from the loop.
19588
19589 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
19590
19591 * callint.c (Fcall_interactively): When displaying error message
19592 about invalid control letter, pass the character's codepoint, not
19593 a pointer to its multibyte form. Improve display of the character
19594 in octal and display also its hex code.
19595
19596 * character.c (char_string): Use %x to display the (unsigned)
19597 codepoint of an invalid character, to avoid displaying a bogus
19598 negative value.
19599
19600 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
19601 `error', not SYMBOL_NAME itself.
19602
19603 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
19604 character arguments to `error'.
19605
19606 * charset.c (check_iso_charset_parameter): Fix incorrect argument
19607 to `error' in error message about FINAL_CHAR argument. Make sure
19608 FINAL_CHAR is a character, and use %c when it is passed as
19609 argument to `error'.
19610
4ffd0d6b 196112011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
19612
19613 * s/ms-w32.h (localtime): Redirect to sys_localtime.
19614
19615 * w32.c: Include <time.h>.
19616 (sys_localtime): New function.
19617
4ffd0d6b 196182011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
19619
19620 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
19621
4ffd0d6b 19622 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 19623
4ffd0d6b 196242011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 19625
4ffd0d6b
GM
19626 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
19627 zombies (Bug#8467).
aac0c6e3 19628
04c56954
EZ
196292011-04-19 Eli Zaretskii <eliz@gnu.org>
19630
19631 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
19632 gl_state.e_property when gl_state.object is Qt.
19633
19634 * insdel.c (make_gap_larger): Remove limitation of buffer size
19635 to <= INT_MAX.
19636
16a43933
CY
196372011-04-18 Chong Yidong <cyd@stupidchicken.com>
19638
19639 * xdisp.c (lookup_glyphless_char_display)
19640 (produce_glyphless_glyph): Handle cons cell entry in
19641 glyphless-char-display.
19642 (Vglyphless_char_display): Document it.
19643
19644 * term.c (produce_glyphless_glyph): Handle cons cell entry in
19645 glyphless-char-display.
19646
4581706e
CY
196472011-04-17 Chong Yidong <cyd@stupidchicken.com>
19648
19649 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
19650
19651 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
19652
19653 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
19654 definition for no-X builds.
19655
4887c6e2 196562011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 19657
fd35b6f9
PE
19658 Static checks with GCC 4.6.0 and non-default toolkits.
19659
5c1ccb01
PE
19660 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
19661
006c5daa
PE
19662 * process.c (keyboard_bit_set): Define only if SIGIO.
19663 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
19664 (send_process): Repair possible setjmp clobbering.
19665
efc736d3
PE
19666 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
19667
4e2fe2e6
PE
19668 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
19669
f97334a2
PE
19670 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
19671
4e75f29d
PE
19672 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
19673 Define only if needed.
19674
90efadd1
PE
19675 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
19676 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 19677 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 19678
3c647824
PE
19679 * dispextern.h (struct redisplay_interface): Rename param
19680 to avoid shadowing.
e264f262 19681 * termhooks.h (struct terminal): Likewise.
761383f4 19682 * xterm.c (xembed_send_message): Likewise.
3c647824 19683
b58c5c4a
PE
19684 * insdel.c (make_gap_smaller): Define only if
19685 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
19686
cad59032
PE
19687 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
19688 it.
19689
c339dc2e
PE
19690 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
19691 so that we aren't warned about unused symbols.
19692
91a3e27b
PE
19693 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
19694
399c71d3 19695 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 19696
8ffc96f5
PE
19697 * xfns.c (x_real_positions): Mark locals as initialized.
19698
eef9bc79
PE
19699 * xmenu.c (xmenu_show): Don't use uninitialized vars.
19700
098db9dd
PE
19701 * xterm.c: Fix problems found by static analysis with other toolkits.
19702 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
19703 (x_dispatch_event): Declare static if USE_GTK, and
19704 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 19705 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 19706 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
19707 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
19708 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 19709
eb18f6cc
PE
19710 * xmenu.c (menu_help_callback): Pointer type fixes.
19711 Use const pointers when pointing at readonly data. Avoid pointer
19712 signedness clashes.
19713 (FALSE): Remove unused macro.
19714 (update_frame_menubar): Remove unused decl.
19715
1fe72bf8
PE
19716 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
19717
60d9e1db
PE
19718 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
19719 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
19720 (single_menu_item): Rename local to avoid shadowing.
19721
39261c26
PE
19722 * keyboard.c (make_lispy_event): Remove unused local var.
19723
018c5e19
PE
19724 * frame.c, frame.h (x_get_resource_string): Bring this back, but
19725 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
19726
63d2b86e
PE
19727 * bitmaps: Change bitmaps from unsigned char back to the X11
19728 compatible char. Avoid the old compiler warnings about
19729 out-of-range initializers by using, for example, '\xab' rather
19730 than 0xab.
19731
aefd87e1
PE
19732 * xgselect.c (xgselect_initialize): Check vs interface
19733 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
19734
bf501fb9
PE
19735 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
19736
e9829fdf
PE
19737 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
19738 to read-only memory.
19739
1086c095
PE
19740 * fns.c (vector): Remove; this old hack is no longer needed.
19741
2baccd04 19742 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 19743 Remove unused var.
dde42981 19744 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 19745
72391843 19746 * xrdb.c (x_load_resources): Omit unused local.
3565b346 19747
436c16df 19748 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 19749 (x_window): Rename locals to avoid shadowing.
dc5ddd85 19750 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 19751
92bb796d 19752 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 19753 (x_term_init): Remove local to avoid shadowing.
92bb796d 19754
764430a3 19755 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
19756
19757 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
19758 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
19759
d1dfb56c
EZ
197602011-04-16 Eli Zaretskii <eliz@gnu.org>
19761
c4354cb4
EZ
19762 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
19763
d1dfb56c
EZ
19764 Fix regex.c, syntax.c and friends for buffers > 2GB.
19765 * syntax.h (struct gl_state_s): Declare character position members
19766 EMACS_INT.
19767
19768 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
19769
04f2d78b
CB
19770 * textprop.c (verify_interval_modification, interval_of):
19771 Declare arguments EMACS_INT.
d1dfb56c
EZ
19772
19773 * intervals.c (adjust_intervals_for_insertion): Declare arguments
19774 EMACS_INT.
19775
19776 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
19777
19778 * indent.c (Fvertical_motion): Local variable it_start is now
19779 EMACS_INT.
19780
19781 * regex.c (re_match, re_match_2, re_match_2_internal)
19782 (bcmp_translate, regcomp, regexec, print_double_string)
19783 (group_in_compile_stack, re_search, re_search_2, regex_compile)
19784 (re_compile_pattern, re_exec): Declare arguments and local
19785 variables `size_t' and `ssize_t' and return values `regoff_t', as
19786 appropriate.
19787 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
19788 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
19789 <compile_stack_type>: `size' and `avail' are now `size_t'.
19790
19791 * regex.h <regoff_t>: Use ssize_t, not int.
19792 (re_search, re_search_2, re_match, re_match_2): Arguments that
19793 specify buffer/string position and length are now ssize_t and
19794 size_t. Return type is regoff_t.
19795
613052cd
BK
197962011-04-16 Ben Key <bkey76@gmail.com>
19797
19798 * nsfont.m: Fixed bugs in ns_get_family and
19799 ns_descriptor_to_entity that were caused by using free to
19800 deallocate memory blocks that were allocated by xmalloc (via
19801 xstrdup). This caused Emacs to crash when compiled with
19802 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
19803 --enable-checking=xmallocoverrun). xfree is now used to
19804 deallocate these memory blocks.
19805
4170f62f 198062011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 19807
71b41406
PE
19808 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
19809
9587a89d
PE
19810 emacs_write: Accept and return EMACS_INT for sizes.
19811 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
19812 et seq.
19813 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
19814 Accept and return EMACS_INT.
19815 (emacs_gnutls_write): Return the number of bytes written on
19816 partial writes.
19817 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
19818 (emacs_read, emacs_write): Remove check for negative size, as the
19819 Emacs source code has been audited now.
9587a89d
PE
19820 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
19821 (emacs_read, emacs_write): Use it.
273a5f82
PE
19822 * process.c (send_process): Adjust to the new signatures of
19823 emacs_write and emacs_gnutls_write. Do not attempt to store
19824 a byte offset into an 'int'; it might overflow.
9587a89d 19825 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 19826
3e047f51
PE
19827 * sound.c: Don't assume sizes fit in 'int'.
19828 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 19829 Return EMACS_INT, not int.
3e047f51 19830 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
19831 Accept EMACS_INT, not int.
19832 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
19833 record read return values.
19834
cc39a9db
BK
198352011-04-15 Ben Key <bkey76@gmail.com>
19836
c9d0ec6d
JB
19837 * keyboard.c (Qundefined): Don't declare static since it is used
19838 in nsfns.m.
19839 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
19840 static since they are used in nsfont.m.
cc39a9db 19841
6c60eb9f
SM
198422011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
19843
19844 * process.c (Qprocessp): Don't declare static.
19845 * lisp.h (Qprocessp): Declare again.
19846
7990b61a
JB
198472011-04-15 Juanma Barranquero <lekktu@gmail.com>
19848
19849 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
19850
5d4cb038
PE
198512011-04-14 Paul Eggert <eggert@cs.ucla.edu>
19852
8bd7b830 19853 Improve C-level modularity by making more things 'static'.
cd64ea1d 19854
e3b27b31
PE
19855 Don't publish debugger-only interfaces to other modules.
19856 * lisp.h (safe_debug_print, debug_output_compilation_hack):
19857 (verify_bytepos, count_markers): Move decls to the only modules
19858 that need them.
19859 * region-cache.h (pp_cache): Likewise.
19860 * window.h (check_all_windows): Likewise.
19861 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
19862
5d4cb038
PE
19863 * sysdep.c (croak): Now static, if
19864 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
19865 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
19866
19867 * alloc.c (refill_memory_reserve): Now static if
19868 !defined REL_ALLOC || defined SYSTEM_MALLOC.
19869 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 19870
e87b6180
PE
19871 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
19872 Define only if USE_LUCID.
19873
ac64929e
PE
19874 * xrdb.c (x_customization_string, x_rm_string): Now static.
19875
6f37259d
PE
19876 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
19877 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
19878
1683e3ab
PE
19879 * xdisp.c (draw_row_with_mouse_face): Now static.
19880 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
19881
de9c2632
PE
19882 * window.h (check_all_windows): Mark externally visible.
19883
2b96acb7
PE
19884 * window.c (window_deletion_count): Now static.
19885
19886 * undo.c: Make symbols static if they're not exported.
19887 (last_undo_buffer, last_boundary_position, pending_boundary):
19888 Now static.
19889
50436f33
PE
19890 * textprop.c (interval_insert_behind_hooks): Now static.
19891 (interval_insert_in_front_hooks): Likewise.
19892
64520e5c
PE
19893 * term.c: Make symbols static if they're not exported.
19894 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
19895 (max_frame_lines, tty_set_terminal_modes):
19896 (tty_reset_terminal_modes, tty_turn_off_highlight):
19897 (get_tty_terminal): Now static.
19898 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
19899 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 19900 HAVE_WINDOW_SYSTEM.
64520e5c
PE
19901 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
19902 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
19903
1fa53021
PE
19904 * sysdep.c: Make symbols static if they're not exported.
19905 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
19906 Now static.
19907 (sigprocmask_set, full_mask): Remove; unused.
19908 (wait_debugging): Mark as visible.
19909 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
19910 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
19911
d4b43b22
PE
19912 * syntax.c (syntax_temp): Define only if !__GNUC__.
19913
b7c513d0
PE
19914 * sound.c (current_sound_device, current_sound): Now static.
19915
989b29ad
PE
19916 * search.c (searchbufs, searchbuf_head): Now static.
19917
13a55a78
PE
19918 * scroll.c (scroll_cost): Remove; unused.
19919 * dispextern.h (scroll_cost): Remove decl.
19920
de68a1fc
PE
19921 * region-cache.h (pp_cache): Mark as externally visible.
19922
40ccffa6
PE
19923 * process.c: Make symbols static if they're not exported.
19924 (process_tick, update_tick, create_process, chan_process):
19925 (Vprocess_alist, proc_buffered_char, datagram_access):
19926 (fd_callback_data, send_process_frame, process_sent_to): Now static.
19927 (deactivate_process): Mark defn as static, as well as decl.
19928 * lisp.h (create_process): Remove decl.
19929 * process.h (chan_process, Vprocess_alist): Remove decls.
19930
ad64fc97
PE
19931 * print.c: Make symbols static if they're not exported.
19932 (print_depth, new_backquote_output, being_printed, print_buffer):
19933 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
19934 (print_interval, print_number_index, initial_stderr_stream):
19935 Now static.
19936 * lisp.h (Fprinc): Remove decl.
19937 (debug_output_compilation_hack): Mark as externally visible.
19938
adddb265
PE
19939 * sysdep.c (croak): Move decl from here to syssignal.h.
19940 * syssignal.h (croak): Put it here, so the API can be checked when
19941 'croak' is called from dissociate_if_controlling_tty.
19942
1717ede2
PE
19943 * minibuf.c: Make symbols static if they're not exported.
19944 (minibuf_save_list, choose_minibuf_frame): Now static.
19945 * lisp.h (choose_minibuf_frame): Remove decl.
19946
fa5fb2bc
PE
19947 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
19948
1e3890d1
PE
19949 * lread.c: Make symbols static if they're not exported.
19950 (read_objects, initial_obarray, oblookup_last_bucket_number):
19951 Now static.
19952 (make_symbol): Remove; unused.
19953 * lisp.h (initial_obarray, make_symbol): Remove decls.
19954
8a1414fa
PE
19955 * keyboard.c: Make symbols static if they're not exported.
19956 (single_kboard, recent_keys_index, total_keys, recent_keys):
19957 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
19958 (this_single_command_key_start, echoing, last_auto_save):
19959 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
19960 (command_loop, echo_now, keyboard_init_hook, help_char_p):
19961 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
19962 (Vlispy_mouse_stem, double_click_count):
19963 Now static.
19964 (force_auto_save_soon): Define only if SIGDANGER.
19965 (ignore_mouse_drag_p): Now static if
19966 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
19967 (print_help): Remove; unused.
19968 (stop_character, last_timer_event): Mark as externally visible.
19969 * keyboard.h (ignore_mouse_drag_p): Declare only if
19970 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
19971 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
19972 * lisp.h (echoing): Remove decl.
19973 (force_auto_save_soon): Declare only if SIGDANGER.
19974 * xdisp.c (redisplay_window): Simplify code, to make it more
19975 obvious that ignore_mouse_drag_p is not accessed if !defined
19976 USE_GTK && !defined HAVE_NS.
19977
93ea6e8f
PE
19978 * intervals.c: Make symbols static if they're not exported.
19979 (merge_properties_sticky, merge_interval_right, delete_interval):
19980 Now static.
19981 * intervals.h (merge_interval_right, delete_interval): Remove decls.
19982
77382fcc
PE
19983 * insdel.c: Make symbols static if they're not exported.
19984 However, leave prepare_to_modify_buffer alone. It's never
19985 called from outside this function, but that appears to be a bug.
19986 (combine_after_change_list, combine_after_change_buffer):
4889fc82 19987 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
19988 (adjust_after_replace_noundo): Remove; unused.
19989 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 19990 (signal_before_change): Remove decls.
77382fcc 19991
9306c32e
PE
19992 * indent.c (val_compute_motion, val_vmotion): Now static.
19993
cd44d2eb
PE
19994 * image.c: Make symbols static if they're not exported.
19995 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
19996 if USE_GTK.
19997 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
19998 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
19999
ad9a7a06
PE
20000 * fringe.c (standard_bitmaps): Now static.
20001 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20002
81626931
PE
20003 * frame.c: Make symbols static if they're not exported.
20004 (x_report_frame_params, make_terminal_frame): Now static.
20005 (get_frame_param): Now static, unless HAVE_NS.
20006 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20007 (x_get_resource_string): Remove; not used.
20008 * frame.h (make_terminal_frame, x_report_frame_params):
20009 (x_get_resource_string); Remove decls.
20010 (x_fullscreen_adjust): Declare only if WINDOWSNT.
20011 * lisp.h (get_frame_param): Declare only if HAVE_NS.
20012
239f9db9
PE
20013 * font.c, fontset.c: Make symbols static if they're not exported.
20014 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
20015 (FACE_SUITABLE_FOR_CHAR_P): Use it.
20016 * font.c (font_close_object): Now static.
20017 * font.h (font_close_object): Remove.
20018 * fontset.c (FONTSET_OBJLIST): Remove.
20019 (free_realized_fontset) #if-0 the body, which does nothing.
20020 (face_suitable_for_char_p): #if-0, as it's never called.
20021 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
20022 * xfaces.c (face_at_string_position):
20023 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
20024 since 0 is always ASCII.
20025
dfcf3579
PE
20026 * fns.c (weak_hash_tables): Now static.
20027
5045092b
PE
20028 * fileio.c: Make symbols static if they're not exported.
20029 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
20030 (Vwrite_region_annotation_buffers): Now static.
20031
57a96f5c
PE
20032 * eval.c: Make symbols static if they're not exported.
20033 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
20034 * lisp.h (backtrace_list): Remove decl.
20035
35f08c38
PE
20036 * emacs.c: Make symbols static if they're not exported.
20037 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
20038 (fatal_error_code, fatal_error_signal_hook, standard_args):
20039 Now static.
20040 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
20041 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
20042 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
20043 * lisp.h (fatal_error_signal_hook): Remove decl.
20044 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
20045
f44bd759
PE
20046 * editfns.c: Move a (normally-unused) function to its only use.
20047 * editfns.c, lisp.h (get_operating_system_release): Remove.
20048 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
20049 worth the hassle of breaking this out.
20050
b532497d
PE
20051 * xterm.c: Make symbols static if they're not exported.
20052 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
20053 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
20054 (x_destroy_window, x_delete_display):
20055 Now static.
20056 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
20057 (x_mouse_leave): Remove; unused.
20058 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
20059 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
20060 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
20061 Remove decls.
20062 (x_mouse_leave): Declare only if WINDOWSNT.
20063 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
20064 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
20065 USE_X_TOOLKIT.
20066
1675728f
PE
20067 * ftxfont.c: Make symbols static if they're not exported.
20068 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
20069 HAVE_FREETYPE.
20070 * font.h (ftxfont_driver): Likewise.
20071
e4cebfca
PE
20072 * xfns.c: Make symbols static if they're not exported.
20073 (x_last_font_name, x_display_info_for_name):
20074 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
20075 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
20076 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
20077 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
20078 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
20079 (last_show_tip_args): Now static.
20080 (xic_defaut_fontset, xic_create_fontsetname): Define only if
20081 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
20082 (x_screen_planes): Remove; unused.
20083 * dispextern.h (x_screen_planes): Remove decl.
20084
5bf46f05
PE
20085 * dispnew.c: Make symbols static if they're not exported.
20086 * dispextern.h (redraw_garbaged_frames, scrolling):
20087 (increment_row_positions): Remove.
20088 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
20089 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
20090 Now static.
20091 (redraw_garbaged_frames): Remove; unused.
20092
435f4c28
PE
20093 * xfaces.c: Make symbols static if they're not exported.
20094 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
20095 Remove decls.
20096 * xterm.h (defined_color): Remove decls.
20097 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
20098 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
20099 (menu_face_changed_default, defined_color, free_realized_face):
20100 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
20101 (ascii_face_of_lisp_face): Remove; unused.
20102
8524aef3
PE
20103 * xdisp.c: Make symbols static if they're not exported.
20104 * dispextern.h (scratch_glyph_row, window_box_edges):
20105 (glyph_to_pixel_coords, set_cursor_from_row):
20106 (get_next_display_element, set_iterator_to_next):
20107 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
20108 (show_mouse_face): Remove decls
20109 * frame.h (message_buf_print): Likewise.
20110 * lisp.h (pop_message, set_message, check_point_in_composition):
20111 Likewise.
20112 * xterm.h (set_vertical_scroll_bar): Likewise.
20113 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
20114 (message_buf_print, scratch_glyph_row, displayed_buffer):
20115 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
20116 (get_next_display_element, show_mouse_face, window_box_edges):
20117 (frame_to_window_pixel_xy, check_point_in_composition):
20118 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
20119 (glyph_to_pixel_coords): Remove; unused.
20120
16390cd2
PE
20121 * dired.c (file_name_completion): Now static.
20122
20123 * dbusbind.c (xd_in_read_queued_messages): Now static.
20124
a25f4dfa
PE
20125 * lisp.h (circular_list_error, FOREACH): Remove; unused.
20126 * data.c (circular_list_error): Remove.
20127
14a9c8df
PE
20128 * commands.h (last_point_position, last_point_position_buffer):
20129 (last_point_position_window): Remove decls.
20130 * keyboard.c: Make these variables static.
20131
04f2d78b
CB
20132 * coding.h (coding, code_convert_region, encode_coding_gap):
20133 Remove decls.
74ab6df5
PE
20134 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
20135 (iso_code_class, detect_coding, code_convert_region): Now static.
20136 (encode_coding_gap): Remove; unused.
20137
38dfbee1
PE
20138 * chartab.c (chartab_chars, chartab_bits): Now static.
20139
a2cb4e63
PE
20140 * charset.h (charset_iso_8859_1): Remove decl.
20141 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
20142 Now static.
20143
127198fd
PE
20144 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
20145 * ccl.c (Vccl_program_table): Now static.
20146 (check_ccl_update): Remove; unused.
20147
d85b608f
PE
20148 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
20149 * category.h: ... from here.
20150 * category.c (check_category_table, set_category_set): Now static.
20151
31cd66f3
PE
20152 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
20153 * lisp.h: Remove these decls.
20154
c358e587
PE
20155 * buffer.c (buffer_count): Remove unused var.
20156
e78aecca
PE
20157 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
20158 so that it's not optimized away.
20159 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
20160 * dispextern.h (bidi_dump_cached_states): Remove, since it's
20161 exported only to the debugger.
20162
e192d7d3 20163 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 20164 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 20165
92470028
PE
20166 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
20167 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
20168 was inaccessible from Lisp.
20169 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
20170 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
20171
244ed907
PE
20172 alloc.c: Import and export fewer symbols, and remove unused items.
20173 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
20174 is defined.
20175 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
20176 it's not optimized away by whole-program optimization.
20177 (message_enable_multibyte, free_misc): Remove.
20178 (catchlist, handlerlist, mark_backtrace):
20179 Declare only if BYTE_MARK_STACK.
20180 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
20181 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
20182 (message_enable_multibyte): Remove decl.
20183 (free_misc, interval_free_list, float_block, float_block_index):
20184 (n_float_blocks, float_free_list, cons_block, cons_block_index):
20185 (cons_free_list, last_marked_index):
20186 Now static.
20187 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
20188 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20189 (mark_backtrace): Define only if BYTE_MARK_STACK.
20190 * xdisp.c (message_enable_multibyte): Now static.
20191
61c2b50e 20192 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
20193 This makes it easier for human readers (and static analyzers)
20194 to see whether these variables are used from other modules.
20195 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
20196 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
20197 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
20198 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
20199 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
20200 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
20201 * xmenu.c, xselect.c:
20202 Declare Q* vars static if they are not used in other modules.
20203 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
20204 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
20205 Remove decls of unexported vars.
20206 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
20207
95c82688
PE
20208 * lisp.h (DEFINE_FUNC): Make sname 'static'.
20209
16a97296
PE
20210 Make Emacs functions such as Fatom 'static' by default.
20211 This makes it easier for human readers (and static analyzers)
20212 to see whether these functions can be called from other modules.
20213 DEFUN now defines a static function. To make the function external
20214 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
20215 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
20216 (Finit_image_library):
16a97296
PE
20217 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
20218 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
20219 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
20220 Remove decls, since these functions are now static.
20221 (Funintern, Fget_internal_run_time): New decls, since these functions
20222 were already external.
95c82688 20223
16a97296
PE
20224 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
20225 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
20226 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
20227 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
20228 * keyboard.c, keymap.c, lread.c:
20229 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
20230 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
20231 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
20232 Mark functions with DEFUE instead of DEFUN,
20233 if they are used in other modules.
20234 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
20235 decls for now-static functions.
20236 * buffer.h (Fdelete_overlay): Remove decl.
20237 * callproc.c (Fgetenv_internal): Mark as internal.
20238 * composite.c (Fremove_list_of_text_properties): Remove decl.
20239 (Fcomposition_get_gstring): New forward static decl.
20240 * composite.h (Fcomposite_get_gstring): Remove decl.
20241 * dired.c (Ffile_attributes): New forward static decl.
20242 * doc.c (Fdocumntation_property): New forward static decl.
20243 * eval.c (Ffetch_bytecode): New forward static decl.
20244 (Funintern): Remove extern decl; now in .h file where it belongs.
20245 * fileio.c (Fmake_symbolic_link): New forward static decl.
20246 * image.c (Finit_image_library): New forward static decl.
20247 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
20248 * intervals.h (Fprevious_property_change):
20249 (Fremove_list_of_text_properties): Remove decls.
20250 * keyboard.c (Fthis_command_keys): Remove decl.
20251 (Fcommand_execute): New forward static decl.
20252 * keymap.c (Flookup_key): New forward static decl.
20253 (Fcopy_keymap): Now static.
20254 * keymap.h (Flookup_key): Remove decl.
20255 * process.c (Fget_process): New forward static decl.
20256 (Fprocess_datagram_address): Mark as internal.
20257 * syntax.c (Fsyntax_table_p): New forward static decl.
20258 (skip_chars): Remove duplicate decl.
20259 * textprop.c (Fprevious_property_change): New forward static decl.
20260 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
20261 Now internal.
20262 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
20263 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
20264
785bbd42
PE
20265 * editfns.c (Fformat): Remove unreachable code.
20266
8b913b57
AS
202672011-04-14 Andreas Schwab <schwab@linux-m68k.org>
20268
20269 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
20270 change. (Bug#8496)
20271
a6744a35
EZ
202722011-04-13 Eli Zaretskii <eliz@gnu.org>
20273
20274 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
20275 when at ZV. (Bug#8487)
20276
e7974947
AS
202772011-04-12 Andreas Schwab <schwab@linux-m68k.org>
20278
baad03f0
AS
20279 * charset.c (Fclear_charset_maps): Use xfree instead of free.
20280 (Bug#8437)
20281 * keyboard.c (parse_tool_bar_item): Likewise.
20282 * sound.c (sound_cleanup, alsa_close): Likewise.
20283 * termcap.c (tgetent): Likewise.
20284 * xfns.c (x_default_font_parameter): Likewise.
20285 * xsettings.c (read_and_apply_settings): Likewise.
20286
e7974947
AS
20287 * alloc.c (overrun_check_malloc, overrun_check_realloc)
20288 (overrun_check_free): Protoize.
20289
28272684
PE
202902011-04-12 Paul Eggert <eggert@cs.ucla.edu>
20291
20292 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
20293 since callers should never pass a negative size.
20294 Change the signature to match that of plain 'read' and 'write'; see
20295 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
20296 * lisp.h: Update prototypes of emacs_write and emacs_read.
20297
11997c76
EZ
202982011-04-11 Eli Zaretskii <eliz@gnu.org>
20299
20300 * xdisp.c (redisplay_window): Don't try to determine the character
20301 position of the scroll margin if the window start point w->startp
e896f03c 20302 is outside the buffer's accessible region. (Bug#8468)
11997c76 20303
8a2cbd72
EZ
203042011-04-10 Eli Zaretskii <eliz@gnu.org>
20305
20306 Fix write-region and its subroutines for buffers > 2GB.
20307 * fileio.c (a_write, e_write): Modify declaration of arguments and
20308 local variables to support buffers larger than 2GB.
20309 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
20310
20311 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
20312 argument, local variables, and return value.
20313
20314 * lisp.h: Update prototypes of emacs_write and emacs_read.
20315
20316 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
20317
4073e537 203182011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 20319
1ebfdcb6
PE
20320 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
20321
b2ded58d
PE
20322 Fix more problems found by GCC 4.6.0's static checks.
20323
7d66342c
PE
20324 * xdisp.c (vmessage): Use a better test for character truncation.
20325
bbf47d44
PE
20326 * charset.c (load_charset_map): <, not <=, for optimization,
20327 and to avoid potential problems with integer overflow.
9248994d 20328 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 20329 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 20330 * editfns.c (Fformat): Likewise.
1e69125e 20331 * syntax.c (skip_chars): Likewise.
3befa583 20332
e3019616
PE
20333 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
20334 This also lets GCC 4.6.0 generate slightly better loop code.
20335
becfa255
PE
20336 * callint.c (Fcall_interactively): <, not <=, for optimization.
20337 (Fcall_interactively): Count the number of arguments produced,
20338 not the number of arguments given. This is simpler and lets GCC
20339 4.6.0 generate slightly better code.
20340
dae0cd48
PE
20341 * ftfont.c: Distingish more carefully between FcChar8 and char.
20342 The previous code passed unsigned char * to a functions like
20343 strlen and xstrcasecmp that expect char *, which does not
20344 conform to the C standard.
20345 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
20346 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
20347 char * when the C standard requires it.
20348
76032d70
PE
20349 * keyboard.c (read_char): Remove unused var.
20350
eb3f1cc8
PE
20351 * eval.c: Port to Windows vsnprintf (Bug#8435).
20352 Include <limits.h>.
20353 (SIZE_MAX): Define if the headers do not.
20354 (verror): Do not give up if vsnprintf returns a negative count.
20355 Instead, grow the buffer. This ports to Windows vsnprintf, which
20356 does not conform to C99. Problem reported by Eli Zaretskii.
20357 Also, simplify the allocation scheme, by avoiding the need for
20358 calling realloc, and removing the ALLOCATED variable.
20359
70476b54
PE
20360 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
20361
12020a9e
PE
20362 Remove invocations of doprnt, as Emacs now uses vsnprintf.
20363 But keep the doprint source code for now, as we might revamp it
20364 and use it again (Bug#8435).
ea6c7ae6
PE
20365 * lisp.h (doprnt): Remove.
20366 * Makefile.in (base_obj): Remove doprnt.o.
20367 * deps.mk (doprnt.o): Remove.
20368
5fdb398c
PE
20369 error: Print 32- and 64-bit integers portably (Bug#8435).
20370 Without this change, on typical 64-bit hosts error ("...%d...", N)
20371 was used to print both 32- and 64-bit integers N, which relied on
20372 undefined behavior.
61bdb816 20373 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
20374 * lisp.h (error, verror): Mark as printf-like functions.
20375 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
20376 Report overflow in size calculations when allocating printf buffer.
20377 Do not truncate output string at its first null byte.
20378 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
20379 Truncate the output at a character boundary, since vsnprintf does not
20380 do that.
20381 * charset.c (check_iso_charset_parameter): Convert internal
20382 character to string before calling 'error', since %c now has the
20383 printf meaning.
20384 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
20385 overflow when computing char to be passed to 'error'. Do not
20386 pass Lisp_Object to 'error'; pass the integer instead.
20387 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
20388 formatted with plain %d.
20389
b189fa66
PE
20390 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
20391
bff87ef0
PE
20392 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
20393
7e2cac20
PE
20394 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
20395
ce4d90b5
PE
20396 * xterm.c (x_catch_errors): Remove duplicate declaration.
20397
266c9547
PE
20398 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
20399
79c49ad2
PE
20400 * xdisp.c, lisp.h (message_nolog): Remove; unused.
20401
368f4090
JM
204022011-04-10 Jim Meyering <meyering@redhat.com>
20403
20404 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
20405 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
20406 return ssize_t not "int", and use size_t as the buffer length.
20407 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
20408 * gnutls.h: Update declarations.
20409 * process.c (read_process_output): Use ssize_t, to match.
20410 (send_process): Likewise.
20411
a32d4040
CY
204122011-04-09 Chong Yidong <cyd@stupidchicken.com>
20413
20414 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
20415
8546720e 204162011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 20417
04f2d78b
CB
20418 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
20419 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 20420
8546720e
GM
20421 * xterm.c (handle_one_xevent):
20422 * xmenu.c (create_and_show_popup_menu):
20423 * xselect.c (x_decline_selection_request)
20424 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 20425
0a2f5c1a 204262011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
20427
20428 Fix some uses of `int' instead of EMACS_INT.
20429 * search.c (string_match_1, fast_string_match)
20430 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
20431 (scan_buffer, find_next_newline_no_quit)
20432 (find_before_next_newline, search_command, Freplace_match)
20433 (Fmatch_data): Make some `int' variables be EMACS_INT.
20434
20435 * xdisp.c (display_count_lines): 3rd argument and return value now
20436 EMACS_INT. All callers changed.
20437 (pint2hrstr): Last argument is now EMACS_INT.
20438
20439 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
20440 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
20441 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
20442 (decode_coding_utf_16, decode_coding_emacs_mule)
20443 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
20444 (decode_coding_ccl, decode_coding_charset)
20445 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
20446 (decode_coding_iso_2022, decode_coding_emacs_mule)
20447 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
20448 <char_offset, last_offset>: Declare EMACS_INT.
20449 (encode_coding_utf_8, encode_coding_utf_16)
20450 (encode_coding_emacs_mule, encode_invocation_designation)
20451 (encode_designation_at_bol, encode_coding_iso_2022)
20452 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
20453 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
20454 Declare EMACS_INT.
20455 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
20456 (encode_invocation_designation): Last argument P_NCHARS is now
20457 EMACS_INT.
20458 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
20459 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
20460
20461 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
20462 All users changed.
20463
20464 * ccl.c (Fccl_execute_on_string): Declare some variables
20465 EMACS_INT.
20466
8546720e 204672011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
20468
20469 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
20470
4e19a977
CS
204712011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
20472
20473 * process.c (Fformat_network_address): Doc fix.
20474
87302331
R
204752011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
20476
ee7683eb 20477 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 20478
cbb59342
CY
204792011-04-08 Chong Yidong <cyd@stupidchicken.com>
20480
20481 * keyboard.c (read_char): Call Lisp function help-form-show,
20482 instead of using internal_with_output_to_temp_buffer.
20483 (Qhelp_form_show): New var.
e0d38eeb 20484 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
20485
20486 * print.c (internal_with_output_to_temp_buffer): Function deleted.
20487
20488 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
20489
e67a13ab
CY
204902011-04-06 Chong Yidong <cyd@stupidchicken.com>
20491
04f2d78b
CB
20492 * process.c (Flist_processes): Remove to Lisp.
20493 (list_processes_1): Delete.
e67a13ab 20494
973f782d
EZ
204952011-04-06 Eli Zaretskii <eliz@gnu.org>
20496
7c106b1e
EZ
20497 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
20498
973f782d
EZ
20499 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
20500
41cf7d1a 205012011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 20502
ca23cc88
PE
20503 Fix more problems found by GCC 4.6.0's static checks.
20504
f390e2d5
PE
20505 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
20506
42eea0d0
PE
20507 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
20508
b69769da 20509 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 20510
f9541e84
PE
20511 * xdisp.c (vmessage): Mark as a printf-like function.
20512
13841b55
PE
20513 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
20514
c136c10f
PE
20515 * sound.c (sound_warning): Don't crash if arg contains a printf format.
20516
5e2d4a30
PE
20517 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
20518 printf-like functions.
20519 (tiff_load): Add casts to remove these marks before passing them
20520 to system-supplied API.
20521
583f48b9
PE
20522 * eval.c (Fsignal): Remove excess argument to 'fatal'.
20523
b25d760e
PE
20524 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
20525 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
20526 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
20527 directly, rather than having caller test rule sign. This avoids
20528 some unnecessary tests.
20529 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
20530 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
20531 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 20532
bc7b6697 20533 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 20534 (xfont_open): Avoid unnecessary tests.
bc7b6697 20535
27ccc379
PE
20536 * composite.c (composition_gstring_put_cache): Use unsigned integer.
20537
dcd5c89a
PE
20538 * composite.h, composite.c (composition_gstring_put_cache):
20539 Use EMACS_INT, not int, for length.
20540
b13a45c6
PE
20541 * composite.h (COMPOSITION_DECODE_REFS): New macro,
20542 breaking out part of COMPOSITION_DECODE_RULE.
20543 (COMPOSITION_DECODE_RULE): Use it.
20544 * composite.c (get_composition_id): Remove unused local vars,
20545 by using the new macro.
20546
1e792e4d
PE
20547 * textprop.c (set_text_properties_1): Change while to do-while,
20548 since the condition is always true at first.
20549
dc6c6455 20550 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
20551 (interval_deletion_adjustment): Return unsigned value.
20552 All uses changed.
dc6c6455 20553
aba7731a
PE
20554 * process.c (list_processes_1, create_pty, read_process_output):
20555 (exec_sentinel): Remove vars that were set but not used.
afd4052b 20556 (create_pty): Remove unnecessary "volatile"s.
bc57d757 20557 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 20558 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 20559 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 20560
fdfc4bf3
PE
20561 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
20562
fca8fe46 20563 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 20564 (update_syntax_table): Use unsigned instead of int.
fca8fe46 20565
06a0259a 20566 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 20567 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 20568 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 20569
e7b9e80f
PE
20570 * print.c (print_error_message): Avoid int overflow.
20571
56201685
PE
20572 * font.c (font_list_entities): Redo for clarity,
20573 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
20574
78834453 20575 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 20576 (font_score): Avoid potential overflow in diff calculation.
78834453 20577
0bc0b309 20578 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 20579 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 20580
e610eaca
PE
20581 * eval.c (funcall_lambda): Rename local to avoid shadowing.
20582
b895abce
PE
20583 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
20584 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
20585 can always succeed if overflow has undefined behavior.
20586
1f1d9321 20587 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 20588 (wordify): Omit three unnecessary tests.
1f1d9321 20589
c59478bc
PE
20590 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
20591 All callers changed. This avoids the need for an unused var.
20592
79b73827
PE
20593 * casefiddle.c (casify_region): Remove var that is set but not used.
20594
a4db5dfe
PE
20595 * dired.c (file_name_completion): Remove var that is set but not used.
20596
43aae36e
PE
20597 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
20598
2a47c44d 20599 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 20600 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 20601
a37c69bf
PE
20602 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
20603 Check for integer overflow on size calculations.
20604
328ab8e7
PE
20605 * buffer.c (Fprevious_overlay_change): Remove var that is set
20606 but not used.
20607
e5a2a5cb
PE
20608 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
20609 Remove vars that are set but not used.
8d84a6eb 20610 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 20611 (timer_check_2): Mark vars as initialized.
e5a2a5cb 20612
a60e5f68
PE
20613 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
20614
f661cb61 20615 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 20616 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 20617
f0397f5a
PE
20618 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
20619 that are set but not used.
20620
8664db06 20621 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 20622 if XCreateBitmapFromData fails (Bug#8410).
8664db06 20623
6abdaa4a
PE
20624 * xselect.c (x_get_local_selection, x_handle_property_notify):
20625 Remove vars that are set but not used.
20626
0ce7538d 20627 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 20628 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 20629
9ae848fc
PE
20630 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
20631 Remove var that is set but not used.
0b918413
PE
20632 (scroll_bar_windows_size): Now size_t, not int.
20633 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
20634 Check for overflow.
9ae848fc 20635
a5a62657
PE
20636 * xfaces.c (realize_named_face): Remove vars that are set but not used.
20637 (map_tty_color) [!defined MSDOS]: Likewise.
20638
5c5cdd39
PE
20639 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
20640
66ebf983
PE
20641 * coding.c: Remove vars that are set but not used.
20642 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
20643 All callers changed.
20644 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
20645 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
20646 (decode_coding_charset): Remove vars that are set but not used.
20647
1be4d761
PE
20648 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
20649 that is set but not used.
20650
47553fa8
PE
20651 * print.c (print_object): Remove var that is set but not used.
20652
1f7196bf 20653 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
20654 The gnulib version avoids calling malloc in the usual case,
20655 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
20656 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
20657 * filelock.c (current_lock_owner): Likewise.
20658 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
20659 * sysdep.c: Include allocator.h, careadlinkat.h.
20660 (emacs_no_realloc_allocator): New static constant.
20661 (emacs_readlink): New function.
fdb61804
PE
20662 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
20663 ../lib/careadlinkat.h.
d1fdcab7 20664
f84c17c7
SM
206652011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
20666
20667 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
20668 first non-nil return value).
20669
ef3862ad
JD
206702011-04-03 Jan Djärv <jan.h.d@swipnet.se>
20671
20672 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
20673 if not defined (Bug#8403).
20674
376a7006
JB
206752011-04-02 Juanma Barranquero <lekktu@gmail.com>
20676
20677 * xdisp.c (display_count_lines): Remove parameter `start',
20678 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20679 (get_char_face_and_encoding): Remove parameter `multibyte_p',
20680 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20681 (fill_stretch_glyph_string): Remove parameters `row' and `area',
20682 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
20683 and thereabouts. All callers changed.
20684 (get_per_char_metric): Remove parameter `f', unused since
20685 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20686
6ca3801d
JM
206872011-04-02 Jim Meyering <meyering@redhat.com>
20688
20689 do not dereference NULL upon failed strdup
20690 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
20691 (ns_get_family): Likewise.
20692
d8e2b5ba
JB
206932011-04-02 Juanma Barranquero <lekktu@gmail.com>
20694
20695 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
20696
8c74fcbd
JD
206972011-04-02 Jan Djärv <jan.h.d@swipnet.se>
20698
20699 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
20700 later (Bug#8403).
20701
7200d79c
SM
207022011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
20703
03408648 20704 Add lexical binding.
7200d79c 20705
03408648
SM
20706 * window.c (Ftemp_output_buffer_show): New fun.
20707 (Fsave_window_excursion):
20708 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
20709
20710 * lread.c (lisp_file_lexically_bound_p): New function.
20711 (Fload): Bind Qlexical_binding.
20712 (readevalloop): Remove `evalfun' arg.
20713 Bind Qinternal_interpreter_environment.
20714 (Feval_buffer): Bind Qlexical_binding.
20715 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
20716 Mark as dynamic.
20717 (syms_of_lread): Declare `lexical-binding'.
20718
20719 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
20720
20721 * keyboard.c (eval_dyn): New fun.
20722 (menu_item_eval_property): Use it.
ca105506
SM
20723
20724 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 20725
03408648
SM
20726 * fns.c (concat, mapcar1): Accept byte-code-functions.
20727
20728 * eval.c (Fsetq): Handle lexical vars.
20729 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
20730 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
20731 (FletX, Flet): Obey lexical binding.
20732 (Fcommandp): Handle closures.
20733 (Feval): New `lexical' arg.
20734 (eval_sub): New function extracted from Feval. Use it almost
20735 everywhere where Feval was used. Look up vars in lexical env.
20736 Handle closures.
20737 (Ffunctionp): Move from subr.el.
20738 (Ffuncall): Handle closures.
20739 (apply_lambda): Remove `eval_flags'.
20740 (funcall_lambda): Handle closures and new byte-code-functions.
20741 (Fspecial_variable_p): New function.
20742 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
20743 but without exporting it to Lisp.
23aba0ea 20744
23aba0ea 20745 * doc.c (Fdocumentation, store_function_docstring):
03408648 20746 * data.c (Finteractive_form): Handle closures.
23aba0ea 20747
03408648
SM
20748 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
20749 interactive spec.
ba83908c 20750
04f2d78b
CB
20751 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
20752 New byte-codes.
03408648
SM
20753 (exec_byte_code): New function extracted from Fbyte_code to handle new
20754 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 20755
03408648 20756 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 20757
03408648 20758 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 20759
e2abce01
JB
207602011-03-31 Juanma Barranquero <lekktu@gmail.com>
20761
20762 * xdisp.c (redisplay_internal): Fix prototype.
20763
63696a73 207642011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 20765
63696a73 20766 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
20767 (try_scrolling): Use it when setting scroll_limit.
20768 Limit scrolling to 100 screen lines.
63696a73
EZ
20769 (redisplay_window): Even when falling back on "recentering",
20770 position point in the window according to scroll-conservatively,
20771 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
20772
20773 (try_scrolling): When point is above the window, allow searching
20774 as far as scroll_max, or one screenful, to compute vertical
20775 distance from PT to the scroll margin position. This prevents
20776 try_scrolling from unnecessarily failing when
20777 scroll-conservatively is set to a value slightly larger than the
20778 window height. Clean up the case of PT below the margin at bottom
20779 of window: scroll_max can no longer be INT_MAX. When aggressive
20780 scrolling is in use, don't let point enter the opposite scroll
20781 margin as result of the scroll.
20782 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
20783 threshold of 100 lines for never-recentering scrolling.
20784
e4cc2dfc
JB
207852011-03-31 Juanma Barranquero <lekktu@gmail.com>
20786
20787 * dispextern.h (move_it_by_lines):
20788 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
20789 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
20790 (message_log_check_duplicate): Remove parameters `prev_bol' and
20791 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20792 (redisplay_internal): Remove parameter `preserve_echo_area',
20793 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
20794
20795 * indent.c (Fvertical_motion):
20796 * window.c (window_scroll_pixel_based, Frecenter):
20797 Don't pass `need_y_p' to `move_it_by_lines'.
20798
1c470562
SM
207992011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
20800
44f230aa
SM
20801 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
20802 steal a few bits to be more compact.
20803 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
20804 Remove unneeded casts.
20805
1c470562
SM
20806 * bytecode.c (Fbyte_code): CAR and CDR can GC.
20807
888adce9
ZK
208082011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
20809
20810 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
20811 binding" message (bug#7967).
20812
f838ed7b
PE
208132011-03-30 Paul Eggert <eggert@cs.ucla.edu>
20814
77861b95
PE
20815 Fix more problems found by GCC 4.6.0's static checks.
20816
de6dbc14
PE
20817 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
20818 Remove unused local var.
20819
f838ed7b
PE
20820 * editfns.c (Fmessage_box): Remove unused local var.
20821
792c7b2b
PE
20822 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
20823 (note_mode_line_or_margin_highlight, note_mouse_highlight):
20824 Omit unused local vars.
c499e557 20825 * window.c (shrink_windows): Omit unused local var.
b01a1c29 20826 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
20827 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
20828 Omit unused local var.
20829
ba0165e1
PE
20830 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
20831 Don't assume string length fits in int.
32ad8845 20832 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 20833 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 20834
3c59b4c9
PE
20835 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
20836 instead of alloca (Bug#8344).
20837
a3eed478 20838 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 20839 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 20840
eb4d412d
PE
20841 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
20842
1658b401
PE
20843 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
20844 concerns.
20845
20846 * term.c (produce_glyphless_glyph): Remove unnecessary test.
20847
20848 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 20849
9a2c6e05
PE
20850 * keyboard.c (syms_of_keyboard): Use the same style as later
20851 in this function when indexing through an array. This also
20852 works around GCC bug 48267.
20853
03d0a109
PE
20854 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
20855
44f730c8
PE
20856 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
20857
fe75f926
PE
20858 * chartab.c (sub_char_table_ref_and_range): Redo for slight
20859 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
20860
ffa8c828
PE
20861 * keyboard.c, keyboard.h (num_input_events): Now size_t.
20862 This avoids undefined behavior on integer overflow, and is a bit
20863 more convenient anyway since it is compared to a size_t variable.
20864
c5101a77
PE
20865 Variadic C functions now count arguments with size_t, not int.
20866 This avoids an unnecessary limitation on 64-bit machines, which
20867 caused (substring ...) to crash on large vectors (Bug#8344).
20868 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
20869 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 20870 All variadic functions and their callers changed accordingly.
c5101a77
PE
20871 (struct gcpro.nvars): Now size_t, not int. All uses changed.
20872 * data.c (arith_driver, float_arith_driver): Likewise.
20873 * editfns.c (general_insert_function): Likewise.
20874 * eval.c (struct backtrace.nargs, interactive_p)
20875 (internal_condition_case_n, run_hook_with_args, apply_lambda)
20876 (funcall_lambda, mark_backtrace): Likewise.
20877 * fns.c (concat): Likewise.
20878 * frame.c (x_set_frame_parameters): Likewise.
20879 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
20880 0 if not found, not -1. All callers changed.
20881
dd3f25f7
PE
20882 * alloc.c (garbage_collect): Don't assume stack size fits in int.
20883 (stack_copy_size): Now size_t, not int.
20884 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
20885
461c2ab9
JB
208862011-03-28 Juanma Barranquero <lekktu@gmail.com>
20887
20888 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
20889 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20890 All callers changed.
20891
20892 * lisp.h (multibyte_char_to_unibyte):
20893 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
20894 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20895 * character.h (CHAR_TO_BYTE8):
20896 * cmds.c (internal_self_insert):
20897 * editfns.c (general_insert_function):
20898 * keymap.c (push_key_description):
20899 * search.c (Freplace_match):
20900 * xdisp.c (message_dolog, set_message_1): All callers changed.
20901
f6d62986
SM
209022011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
20903
20904 * keyboard.c (safe_run_hook_funcall): New function.
20905 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
20906 don't set the hook to nil, but remove the offending function instead.
20907 (Qcommand_hook_internal): Remove, unused.
20908 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
20909 Vcommand_hook_internal.
20910
20911 * eval.c (enum run_hooks_condition): Remove.
20912 (funcall_nil, funcall_not): New functions.
20913 (run_hook_with_args): Call each function through a `funcall' argument.
20914 Remove `cond' argument, now redundant.
20915 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
20916 (Frun_hook_with_args_until_failure): Adjust accordingly.
20917 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
20918
1db5b1ad
JB
209192011-03-28 Juanma Barranquero <lekktu@gmail.com>
20920
20921 * dispextern.h (string_buffer_position): Remove declaration.
20922
20923 * print.c (strout): Remove parameter `multibyte', unused since
20924 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
20925
20926 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
20927 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
20928 All callers changed.
20929
20930 * w32.c (_wsa_errlist): Use braces for struct initializers.
20931
20932 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
20933 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
20934 All callers changed.
20935 (string_buffer_position): Likewise. Also, make static (it's never
20936 used outside xdisp.c).
20937 (cursor_row_p): Remove parameter `w', unused since
20938 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
20939 (decode_mode_spec): Remove parameter `precision', introduced during
20940 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
20941 All callers changed.
20942
5ffb62aa
JD
209432011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20944
20945 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
20946
461c2ab9 209472011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
20948
20949 * nsterm.m (ns_menu_bar_is_hidden): New variable.
20950 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
20951 (ns_update_auto_hide_menu_bar): New functions.
20952 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
20953 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
20954 ns_constrain_all_frames.
20955 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
20956 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
20957
5c380ffb
JD
209582011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20959
20960 * nsmenu.m (runDialogAt): Remove argument to timer_check.
20961
9af30bdf
GM
209622011-03-27 Glenn Morris <rgm@gnu.org>
20963
20964 * syssignal.h: Replace RETSIGTYPE with void.
20965 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
20966 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
20967 Replace SIGTYPE with void everywhere.
20968 * s/usg5-4-common.h (SIGTYPE): Remove definition.
20969 * s/template.h (SIGTYPE): Remove commented out definition.
20970
e2abce01
JB
209712011-03-26 Eli Zaretskii <eliz@gnu.org>
20972
20973 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
20974 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
20975
f868cd8a
JB
209762011-03-26 Juanma Barranquero <lekktu@gmail.com>
20977
59eb0929
JB
20978 * w32.c (read_unc_volume): Use parameter `henum', instead of
20979 global variable `wget_enum_handle'.
20980
20981 * keymap.c (describe_vector): Remove parameters `indices' and
20982 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
20983 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
20984
f868cd8a
JB
20985 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
20986
20987 * keyboard.c (timer_check): Remove parameter `do_it_now',
20988 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
20989 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
20990 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
20991
20992 * keyboard.c (read_char):
20993 * w32menu.c (w32_menu_display_help):
20994 * xmenu.c (show_help_event, menu_help_callback):
20995 Adjust calls to `show_help_echo'.
20996
20997 * gtkutil.c (xg_maybe_add_timer):
20998 * keyboard.c (readable_events):
20999 * process.c (wait_reading_process_output):
21000 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21001
21002 * insdel.c (adjust_markers_gap_motion):
21003 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21004 (gap_left, gap_right): Don't call it.
21005
2ecf6fdb
CY
210062011-03-25 Chong Yidong <cyd@stupidchicken.com>
21007
21008 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21009 incurred during fontification.
21010
6b1f9ba4
JB
210112011-03-25 Juanma Barranquero <lekktu@gmail.com>
21012
21013 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
21014 (DEFVAR_PER_BUFFER): Don't pass it.
21015
21016 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
21017 (scrolling_window): Don't pass it.
21018
0f4a96b5
JB
210192011-03-25 Juanma Barranquero <lekktu@gmail.com>
21020
21021 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
21022
21023 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
21024 and `suffix'.
21025 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
21026 of variables specific to SELinux and computation of `encoded_absname'.
21027
21028 * image.c (XPutPixel): Remove unused variable `height'.
21029
21030 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
21031
21032 * unexw32.c (get_section_info): Remove unused variable `section'.
21033
21034 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
21035 (system_process_attributes): Remove unused variable `sess'.
21036 (sys_read): Remove unused variable `err'.
21037
21038 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
21039 (w32_wnd_proc): Remove unused variable `isdead'.
21040 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
21041 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
21042 (x_create_tip_frame): Remove unused variable `tem'.
21043
21044 * w32inevt.c (w32_console_read_socket):
21045 Remove unused variable `no_events'.
21046
21047 * w32term.c (x_draw_composite_glyph_string_foreground):
21048 Remove unused variable `width'.
21049
1149507c
JB
210502011-03-24 Juanma Barranquero <lekktu@gmail.com>
21051
21052 * w32term.c (x_set_glyph_string_clipping):
21053 Don't pass uninitialized region to CombineRgn.
21054
9c88f339
JB
210552011-03-23 Juanma Barranquero <lekktu@gmail.com>
21056
21057 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
21058 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
21059 (Fx_close_connection): Remove unused variable `i'.
21060
21061 * w32font.c (w32font_draw): Return number of glyphs.
21062 (w32font_open_internal): Remove unused variable `i'.
21063 (w32font_driver): Add missing initializer.
21064
21065 * w32menu.c (utf8to16): Remove unused variable `utf16'.
21066 (fill_in_menu): Remove unused variable `items_added'.
21067
21068 * w32term.c (last_mouse_press_frame): Remove static global variable.
21069 (w32_clip_to_row): Remove unused variable `f'.
21070 (x_delete_terminal): Remove unused variable `i'.
21071
21072 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
21073 (NOTHING): Remove unused static global variable.
21074 (uniscribe_check_otf): Remove unused variable `table'.
21075 (uniscribe_font_driver): Add missing initializers.
21076
dee091a3
JD
210772011-03-23 Julien Danjou <julien@danjou.info>
21078
21079 * term.c (Fsuspend_tty, Fresume_tty):
21080 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
21081 * window.c (temp_output_buffer_show):
21082 * insdel.c (signal_before_change):
21083 * frame.c (Fhandle_switch_frame):
21084 * fileio.c (Fdo_auto_save):
21085 * emacs.c (Fkill_emacs):
21086 * editfns.c (save_excursion_restore):
21087 * cmds.c (internal_self_insert):
21088 * callint.c (Fcall_interactively):
21089 * buffer.c (Fkill_all_local_variables):
21090 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
21091 Use Frun_hooks.
0f4a96b5 21092 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 21093 unconditionally since it does the check itself.
dee091a3 21094
2c520ab5 210952011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 21096
c9c49752
PE
21097 Fix more problems found by GCC 4.5.2's static checks.
21098
8abc3f12
PE
21099 * coding.c (encode_coding_raw_text): Avoid unnecessary test
21100 the first time through the loop, since we know p0 < p1 then.
21101 This also avoids a gcc -Wstrict-overflow warning.
21102
a2d26660
PE
21103 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
21104 leading to a memory leak, possible in functions like
21105 load_charset_map_from_file that can allocate an unbounded number
b12ef411 21106 of objects (Bug#8318).
a2d26660 21107
916c72e9
PE
21108 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
21109 that could (at least in theory) be that large.
21110
19ab8a18
PE
21111 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
21112 This is less likely to overflow, and avoids undefined behavior if
21113 overflow does occur. All callers changed. Use strtoul to scan
21114 for the unsigned long integer.
b7cbbd6f
PE
21115 (pint2hrstr): Simplify and tune code slightly.
21116 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 21117
f0641eff
PE
21118 * scroll.c (do_scrolling): Work around GCC bug 48228.
21119 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
21120
7f650bb9
PE
21121 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
21122 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
21123 (validate_x_resource_name): Simplify count usage.
21124 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 21125
37dd57d1
PE
21126 * fileio.c (Fcopy_file): Report error if fchown or fchmod
21127 fail (Bug#8306).
81e56e61 21128
699979fc 21129 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 21130
401bf9b4
PE
21131 * process.c (Fmake_network_process): Use socklen_t, not int,
21132 where POSIX says socklen_t is required in portable programs.
21133 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 21134 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
21135 (Fmake_network_process, server_accept_connection):
21136 (wait_reading_process_output, read_process_output):
21137 Likewise.
21138
b93aacde
PE
21139 * process.c: Rename or move locals to avoid shadowing.
21140 (list_processes_1, Fmake_network_process):
21141 (read_process_output_error_handler, exec_sentinel_error_handler):
21142 Rename or move locals.
4dc343ee 21143 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 21144 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 21145 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 21146 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 21147 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 21148
af8a867c 21149 Make tparam.h and terminfo.c consistent.
44f230aa
SM
21150 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
21151 Include tparam.h instead, since it declares them.
af8a867c
PE
21152 * cm.h (PC): Remove extern decl; tparam.h now does this.
21153 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
21154 * terminfo.c: Include tparam.h, to check interfaces.
21155 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
21156 (tparam): Adjust signature to match interface in tparam.h;
21157 this removes some undefined behavior. Check that outstring and len
21158 are zero, which they always are with Emacs.
21159 * tparam.h (PC, BC, UP): New extern decls.
21160
0248044d 21161 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 21162 (xftfont_open): Rename locals to avoid shadowing.
0248044d 21163
8ff096c1 21164 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
21165 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
21166 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 21167 (ftfont_list): Remove unused local.
49eaafba
PE
21168 (get_adstyle_property, ftfont_pattern_entity):
21169 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
21170 Rename locals to avoid shadowing.
8ff096c1 21171
e2be39f6
PE
21172 * xfont.c (xfont_list_family): Mark var as initialized.
21173
c9735e30
PE
21174 * xml.c (make_dom): Now static.
21175
8f5201ae
PE
21176 * composite.c (composition_compute_stop_pos): Rename local to
21177 avoid shadowing.
b246f932
PE
21178 (composition_reseat_it): Remove unused locals.
21179 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 21180 (composition_update_it): Mark var as initialized.
11b61122
PE
21181 (find_automatic_composition): Mark vars as initialized,
21182 with a FIXME (Bug#8290).
8f5201ae 21183
760fbc2c
PE
21184 character.h: Rename locals to avoid shadowing.
21185 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
21186 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
21187 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
21188 (BUF_DEC_POS): Be more systematic about renaming local temporaries
21189 to avoid shadowing.
21190
ff08eb85
PE
21191 * textprop.c (property_change_between_p): Remove; unused.
21192
fc7bf025
PE
21193 * intervals.c (interval_start_pos): Now static.
21194
235d7abc
PE
21195 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
21196
44f230aa
SM
21197 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
21198 Rename locals to avoid shadowing.
3e7d6594 21199
50060332
PE
21200 * sound.c (wav_play, au_play, Fplay_sound_internal):
21201 Fix pointer signedness.
d01f234b 21202 (alsa_choose_format): Remove unused local var.
c83b8872
PE
21203 (wav_play): Initialize a variable to 0, to prevent undefined
21204 behavior (Bug#8278).
50060332 21205
c4fc4e30
PE
21206 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
21207
918436ed
PE
21208 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
21209
c939f91b
PE
21210 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
21211 clobbering (Bug#8298).
b9c7f648
PE
21212 * sysdep.c (sys_subshell): Likewise.
21213 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 21214
6bd8c144
PE
21215 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
21216 This should get cleaned up, so that child_setup has the
21217 same signature on all platforms.
21218
7710357c 21219 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 21220 (relocate_fd): Rename locals to avoid shadowing.
7710357c 21221
c59da222
CY
212222011-03-22 Chong Yidong <cyd@stupidchicken.com>
21223
21224 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
21225 not to be necessary, and produces flickering.
21226
66b87493
GM
212272011-03-20 Glenn Morris <rgm@gnu.org>
21228
21229 * config.in: Remove file.
21230
45b6f6d5
JB
212312011-03-20 Juanma Barranquero <lekktu@gmail.com>
21232
21233 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
21234 are now in src/globals.h.
21235 (syms_of_minibuf): Remove spurious & from previous change.
21236
cd394be1 212372011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
21238
21239 * minibuf.c (completing-read-function): New variable.
21240 (completing-read-default): Rename from completing-read.
21241 (completing-read): Call completing-read-function.
21242
b14e3e21
CY
212432011-03-19 Juanma Barranquero <lekktu@gmail.com>
21244
21245 * xfaces.c (Fx_load_color_file):
21246 Read color file from absolute filename (bug#8250).
21247
f2b726e6
JB
212482011-03-19 Juanma Barranquero <lekktu@gmail.com>
21249
21250 * makefile.w32-in: Update dependencies.
21251
09f6ff02
EZ
212522011-03-17 Eli Zaretskii <eliz@gnu.org>
21253
21254 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
21255
29a6015a
PE
212562011-03-17 Paul Eggert <eggert@cs.ucla.edu>
21257
a3a6c54e
PE
21258 Fix more problems found by GCC 4.5.2's static checks.
21259
b766f867
PE
21260 * process.c (make_serial_process_unwind, send_process_trap):
21261 (sigchld_handler): Now static.
21262
be02381c
PE
21263 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
21264 That way, the code declares only the vars that it needs.
21265 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
21266 * s/cygwin.h (PTY_ITERATION): Likewise.
21267 * s/darwin.h (PTY_ITERATION): Likewise.
21268 * s/gnu-linux.h (PTY_ITERATION): Likewise.
21269
57048744
PE
21270 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
21271 * process.c (allocate_pty): Don't declare stb unless it's needed.
21272
7914961c 21273 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
21274 (CONSTANTLIM): Remove; unused.
21275 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
21276 Define only if needed.
7914961c 21277
b3967b18
PE
21278 * unexelf.c (unexec): Name an expression,
21279 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
21280 Use a different way to cause a compilation error if anyone uses
21281 n rather than nn, a way that does not involve shadowing.
73366a00 21282 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 21283
29a6015a
PE
21284 * deps.mk (unexalpha.o): Remove; unused.
21285
43cfc33e 21286 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 21287 * unexec.h: New file.
ce701a33
PE
21288 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
21289 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
21290 Depend on unexec.h.
21291 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
21292 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
21293 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 21294 Change as necessary to match prototype in unexec.h.
ce701a33 21295
01f44d5a
PE
21296 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
21297 shadowing.
4f63c6bb 21298 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 21299
a6670b0b
PE
21300 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
21301 Rename locals to avoid shadowing.
21302
cef2010d 21303 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 21304 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 21305
d4d7173a
PE
21306 * print.c (Fredirect_debugging_output): Fix pointer signedess.
21307
f08b802a
PE
21308 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
21309 warning when compiling print.c.
21310
3ddb0639
PE
21311 * font.c (font_unparse_fcname): Abort in an "impossible" situation
21312 instead of using an uninitialized var.
5ad03b97 21313 (font_sort_entities): Mark var as initialized.
3ddb0639 21314
170a2692
PE
21315 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
21316
e663c700
PE
21317 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
21318 pointers to constants.
89bc529a 21319 (font_parse_fcname): Remove unused vars.
7b81e2d0 21320 (font_delete_unmatched): Now static.
ea838e10 21321 (font_get_spec): Remove; unused.
13a547c6
PE
21322 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
21323 (font_update_drivers, Ffont_get_glyphs, font_add_log):
21324 Rename or move locals to avoid shadowing.
e663c700 21325
2a80c887 21326 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 21327 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 21328
1384fa33 21329 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 21330 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 21331
8b2c52e9
PE
21332 * alloc.c (mark_backtrace): Move decl from here ...
21333 * lisp.h: ... to here, so that it can be checked.
21334
475545b5 21335 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 21336 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
21337 (lisp_indirect_variable): Name an expression,
21338 to avoid gcc -Wbad-function-cast warning.
1faed8ae 21339 (Fdefvar): Rename locals to avoid shadowing.
475545b5 21340
b1349114 21341 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 21342 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 21343 Use const pointer when appropriate.
b1349114 21344
a2928364
PE
21345 * lisp.h (get_system_name, get_operating_system_release):
21346 Move decls here, to check interfaces.
21347 * process.c (get_operating_system_release): Move decl to lisp.h.
21348 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
21349 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
21350 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
21351 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
21352 (Fformat_time_string, Fencode_time, Finsert_char):
21353 (Ftranslate_region_internal, Fformat):
21354 Rename or remove local vars to avoid shadowing.
9710023e 21355 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 21356
a415e694
PE
21357 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
21358 avoid shadowing.
21359
8ef4622d
PE
21360 * lisp.h (eassert): Check that the argument compiles, even if
21361 ENABLE_CHECKING is not defined.
21362
946f9a5b
PE
21363 * data.c (Findirect_variable): Name an expression, to avoid
21364 gcc -Wbad-function-cast warning.
112396d6 21365 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 21366 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
21367 (Fmake_variable_buffer_local, Fmake_local_variable):
21368 Mark variables as initialized.
52746918 21369 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 21370
e5aab7e7 21371 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
21372 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
21373 Rename locals to avoid shadowing.
dff45157
PE
21374 (mark_stack): Move local variables into the #ifdef region where
21375 they're used.
7bc26fdb
PE
21376 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
21377 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
21378 needed otherwise.
21379 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
21380 (GC_STRING_CHARS): Remove; not used.
d40d4be1 21381 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 21382
e5aab7e7
PE
21383 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
21384 avoids undefined behavior in theory.
21385
4da60324
PE
21386 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
21387
88043301
PE
21388 Use functions, not macros, for up- and down-casing (Bug#8254).
21389 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21390 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
21391 to use the following functions instead of these macros.
21392 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
21393 EMACS_INT, since callers assume the returned value fits in int.
21394 (upcase1): Likewise, for UPCASE_TABLE.
21395 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 21396 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 21397 the race-condition problem in the old DOWNCASE.
88043301 21398
19ed5445
PE
21399 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
21400 Rename locals to avoid shadowing.
21401 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
21402 (regex_compile, re_search_2, re_match_2_internal):
21403 Remove unused local vars.
952db0d7
PE
21404 (FREE_VAR): Rewrite so as not to use empty "else",
21405 which gcc can warn about.
da053e48 21406 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
21407 (RETALLOC_IF): Define only if needed.
21408 (WORDCHAR_P): Likewise. This one is never needed, but is used
21409 only in a comment talking about a compiler bug, so put inside
21410 the #if 0 of that comment.
21411 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
21412 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
21413 Remove; unused.
19ed5445 21414
1f3561e4 21415 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
21416 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
21417 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 21418
ded6f8f7
PE
21419 * search.c (simple_search): Remove unused var.
21420
dbd37a95
PE
21421 * dired.c (compile_pattern): Move decl from here ...
21422 * lisp.h: ... to here, so that it can be checked.
21423 (struct re_registers): New forward decl.
21424
7e47afad
PE
21425 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
21426
85f24f61
PE
21427 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
21428 All uses changed.
21429 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
21430 Rename locals to avoid shadowing.
5671df8f 21431 (Fvertical_motion): Mark locals as initialized.
85f24f61 21432
181aa2be 21433 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 21434 (casify_region): Mark local as initialized.
181aa2be 21435
930d429c
PE
21436 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
21437
7082eac6
PE
21438 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
21439 New macros, so that the caller can use some names other than
21440 gcpro1, gcpro2, etc.
21441 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
21442 of the new macros.
21443 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
21444 argument, for consistency with GCPRO2_VAR, etc: it is now the
21445 prefix of the variable, not the variable itself. All uses
21446 changed.
38b2c076
PE
21447 * dired.c (directory_files_internal, file_name_completion):
21448 Rename locals to avoid shadowing.
21449
15206ed9
PE
21450 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
21451 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
21452 dired.c's scmp function, had undefined behavior.
21453 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21454 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
21455 * buffer.h: ... to here, because these macros use current_buffer,
21456 and the new implementation with inline functions needs to have
21457 current_buffer in scope now, rather than later when the macros
21458 are used.
21459 (downcase, upcase1): New static inline functions.
21460 (DOWNCASE, UPCASE1): Reimplement using these functions.
21461 This avoids undefined behavior in expressions like
21462 DOWNCASE (x) == DOWNCASE (y), which previously suffered
21463 from race conditions in accessing the global variables
21464 case_temp1 and case_temp2.
21465 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
21466 * lisp.h (case_temp1, case_temp2): Remove their decls.
21467 * character.h (ASCII_CHAR_P): Move from here ...
21468 * lisp.h: ... to here, so that the inline functions mentioned
21469 above can use them.
21470
4a6bea26
PE
21471 * dired.c (directory_files_internal_unwind): Now static.
21472
f14b7e14
PE
21473 * fileio.c (file_name_as_directory, directory_file_name):
21474 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
21475 Now static.
2893f146
PE
21476 (file_name_as_directory): Use const pointers when appropriate.
21477 (Fexpand_file_name): Likewise. In particular, newdir might
21478 point at constant storage, so make it a const pointer.
fd4ead52 21479 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
21480 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
21481 signedness issues.
f839df0c
PE
21482 (Fset_file_times, Finsert_file_contents, auto_save_error):
21483 Rename locals to avoid shadowing.
f14b7e14 21484
5716756e 21485 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
21486 (Ftry_completion, Fall_completions): Rename or remove locals
21487 to avoid shadowing.
5716756e 21488
b4c3046a
PE
21489 * marker.c (bytepos_to_charpos): Remove; unused.
21490
b45db522
PE
21491 * lisp.h (verify_bytepos, count_markers): New decls,
21492 so that gcc does not warn that these functions aren't declared.
21493
85876d07
PE
21494 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
21495 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 21496 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 21497 (copy_text): Remove unused local var.
85876d07 21498
03d78a21 21499 * filelock.c (within_one_second): Now static.
b3dd38ab 21500 (lock_file_1): Rename local to avoid shadowing.
03d78a21 21501
5df8f01b
PE
21502 * buffer.c (fix_overlays_before): Mark locals as initialized.
21503 (fix_start_end_in_overlays): Likewise. This function should be
21504 simplified by using pointers-to-pointers, but that's a different
21505 matter.
b1d876f1 21506 (switch_to_buffer_1): Now static.
8f54f30a
PE
21507 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
21508 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 21509
a70072c9 21510 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 21511 Fix pointer signedness issue.
edced198
PE
21512 (sys_subshell): Mark local as volatile if checking for lint,
21513 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 21514 (MAXPATHLEN): Define only if needed.
a70072c9 21515
a0977c44
PE
21516 * process.c (serial_open, serial_configure): Move decls from here ...
21517 * systty.h: ... to here, so that they can be checked.
21518
a884fdcc
PE
21519 * fns.c (get_random, seed_random): Move extern decls from here ...
21520 * lisp.h: ... to here, so that they can be checked.
21521
604efe86 21522 * sysdep.c (reset_io): Now static.
b8950c94 21523 (wait_for_termination_signal): Remove; unused.
604efe86 21524
38fc62d9
PE
21525 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
21526 (copy_keymap_item, append_key, push_text_char_description):
21527 Now static.
1004a21a 21528 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 21529 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
21530 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
21531 (describe_map_tree):
21532 Rename locals to avoid shadowing.
38fc62d9 21533
2f2650da
PE
21534 * keyboard.c: Declare functions static if they are not used elsewhere.
21535 (echo_char, echo_dash, cmd_error, top_level_2):
21536 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
21537 (read_char, kbd_buffer_get_event, make_lispy_position):
21538 (make_lispy_event, make_lispy_movement, apply_modifiers):
21539 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
21540 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
21541 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 21542 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 21543 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 21544
a053e86c 21545 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
21546 (mark_kboards): Move decl here ...
21547 * alloc.c (mark_kboards): ... from here.
a053e86c 21548
4752793e
PE
21549 * lisp.h (force_auto_save_soon): New decl.
21550
74f10ca7 21551 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
21552 (DEFINE_DUMMY_FUNCTION): New macro.
21553 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
21554 Use it.
c03cd23f
PE
21555 (main): Add casts to avoid warnings
21556 if GCC considers string literals to be constants.
74f10ca7 21557
022e70d4
PE
21558 * lisp.h (fatal_error_signal): Add decl, since it's exported.
21559
59d6fe83
PE
21560 * dbusbind.c: Pointer signedness fixes.
21561 (xd_signature, xd_append_arg, xd_initialize):
21562 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21563 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21564 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
21565 (Fdbus_register_signal): Use SSDATA when the context wants char *.
21566
78320123
PE
21567 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
21568 if GCC considers string literals to be constants.
49cebcca 21569 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 21570
35ac2a97
SM
215712011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
21572
fb103ca9
SM
21573 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
21574 (print_preprocess, print_object): New macro to fix last change.
21575
35ac2a97
SM
21576 * print.c (print_preprocess): Don't forget font objects.
21577
62973b41
JB
215782011-03-16 Juanma Barranquero <lekktu@gmail.com>
21579
21580 * emacs.c (USAGE3): Doc fixes.
21581
0e48bb22
AS
215822011-03-15 Andreas Schwab <schwab@linux-m68k.org>
21583
21584 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
21585 structure.
21586
7684e57b
JB
215872011-03-14 Juanma Barranquero <lekktu@gmail.com>
21588
21589 * lisp.h (VWindow_system, Qfile_name_history):
21590 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
21591 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
21592 (w32_system_caret_x, w32_system_caret_y): Declare extern.
21593
21594 * w32select.c: Don't #include "keyboard.h".
c96bbc66 21595 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
21596
21597 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
21598 * w32console.c (detect_input_pending, read_input_pending)
21599 (encode_terminal_code):
21600 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
21601 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
21602 (w32_system_caret_y, Qfile_name_history):
21603 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
21604 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
21605 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
21606 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
21607 * w32proc.c (Qlocal, report_file_error):
21608 * w32term.c (Vwindow_system, updating_frame):
21609 * w32uniscribe.c (initialized, uniscribe_font_driver):
21610 Remove unneeded extern declarations.
21611
2aa46d6c
CY
216122011-03-14 Chong Yidong <cyd@stupidchicken.com>
21613
c96bbc66 21614 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 21615
cffc6f3b
CY
216162011-03-13 Chong Yidong <cyd@stupidchicken.com>
21617
21618 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
21619 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
21620 These macros can no longer be used for assignment.
21621
44f230aa
SM
21622 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
21623 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
21624 (record_buffer_markers, fetch_buffer_markers): New functions for
21625 recording and fetching special buffer markers.
21626 (set_buffer_internal_1, set_buffer_temp): Use them.
21627
21628 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
21629
21630 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
21631
21632 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
21633 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
21634
21635 * xdisp.c (hscroll_window_tree):
21636 (reconsider_clip_changes): Use PT instead of BUF_PT.
21637
d251f04b
EZ
216382011-03-13 Eli Zaretskii <eliz@gnu.org>
21639
21640 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
21641 $(EMACS_ROOT)/lib/intprops.h.
21642
f0c77cd1
PE
216432011-03-13 Paul Eggert <eggert@cs.ucla.edu>
21644
3eca4629
PE
21645 Fix more problems found by GCC 4.5.2's static checks.
21646
7c86ee98
PE
21647 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
21648 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
21649 (xg_free_frame_widgets): Make it clear that a local variable is
21650 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
21651 (gdk_window_get_screen): Make it clear that this macro is needed
21652 only if USE_GTK_TOOLTIP.
1e5524e7
PE
21653 (int_gtk_range_get_value): New function, which avoids a diagnostic
21654 from gcc -Wbad-function-cast.
21655 (xg_set_toolkit_scroll_bar_thumb): Use it.
21656 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
21657 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
21658 (get_utf8_string, xg_get_file_with_chooser):
21659 Rename locals to avoid shadowing.
21660 (create_dialog): Move locals to avoid shadowing.
7c86ee98 21661
41729b81
PE
21662 * xgselect.c (xg_select): Remove unused var.
21663
f0c77cd1
PE
21664 * image.c (four_corners_best): Mark locals as initialized.
21665 (gif_load): Initialize transparent_p to zero (Bug#8238).
21666 Mark another local as initialized.
ec6cf4c6 21667 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 21668
ce0ad53d 21669 * image.c (clear_image_cache): Now static.
d5d5a617 21670 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 21671 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
21672 (x_edge_detection): Remove unnecessary cast that
21673 gcc -Wbad-function-cast diagnoses.
2037898d 21674 (gif_load): Fix pointer signedness.
6ae141d6
PE
21675 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
21676 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 21677
33383987 216782011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 21679
d32df629
PE
21680 Improve quality of tests for time stamp overflow.
21681 For example, without this patch (encode-time 0 0 0 1 1
21682 1152921504606846976) returns the obviously-bogus value (-948597
21683 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
21684 reports time overflow. See
21685 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
21686 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
21687 * editfns.c: Include limits.h and intprops.h.
21688 (TIME_T_MIN, TIME_T_MAX): New macros.
21689 (time_overflow): Move earlier, to before first use.
21690 (hi_time, lo_time): New functions, for an accurate test for
21691 out-of-range times.
21692 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
21693 (Fget_internal_run_time): Don't assume time_t fits in int.
21694 (make_time): Use list2 instead of Fcons twice.
21695 (Fdecode_time): More accurate test for out-of-range times.
21696 (check_tm_member): New function.
21697 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
21698 (lisp_time_argument): Don't rely on undefined left-shift and
21699 right-shift behavior when checking for time stamp overflow.
8be6f318 21700
fe31d94c
PE
21701 * editfns.c (time_overflow): New function, refactoring common code.
21702 (Fformat_time_string, Fdecode_time, Fencode_time):
21703 (Fcurrent_time_string): Use it.
21704
8be6f318
PE
21705 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
21706 * dired.c (make_time): Move to ...
21707 * editfns.c (make_time): ... here.
21708 * systime.h: Note the move.
21709
09d9db2c 217102011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 21711
126bc0dc
YM
21712 * fringe.c (update_window_fringes): Remove unused variables.
21713
c47cbdfd
YM
21714 * unexmacosx.c (copy_data_segment): Also copy __got section.
21715 (Bug#8223)
21716
7ac80be9
EZ
217172011-03-12 Eli Zaretskii <eliz@gnu.org>
21718
c96bbc66 21719 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
21720 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
21721 Constify `char *' arguments and their references according to
21722 prototypes in tparam.h.
21723
ecb0f94d 21724 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 21725
7ac80be9
EZ
21726 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
21727 Adapt all references accordingly.
21728
21729 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
21730
ef1fd07e
TT
217312011-03-11 Tom Tromey <tromey@redhat.com>
21732
21733 * buffer.c (syms_of_buffer): Remove obsolete comment.
21734
7ef4b50c
EZ
217352011-03-11 Eli Zaretskii <eliz@gnu.org>
21736
21737 * termhooks.h (encode_terminal_code): Declare prototype.
21738
21739 * msdos.c (encode_terminal_code): Don't declare prototype.
21740
21741 * term.c (encode_terminal_code): Now external again, used by
21742 w32console.c and msdos.c.
21743
44f230aa
SM
21744 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
21745 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 21746
4b1ec863 217472011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 21748
1714f52b 21749 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 21750
4b1ec863
PE
21751 * fringe.c (update_window_fringes): Mark locals as initialized
21752 (Bug#8227).
21753 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 21754
524c7aa6
PE
21755 * alloc.c (mark_fringe_data): Move decl from here ...
21756 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
21757 to check its interface.
21758 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
21759
a5c0af81 21760 * fontset.c (free_realized_fontset): Now static.
7519b8cd 21761 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 21762 (fontset_font): Mark local as initialized.
a9a06e0b 21763 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 21764
b4716021
PE
21765 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
21766
811e9bac 21767 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 21768 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
21769 (x_own_selection, Fx_disown_selection_internal): Rename locals
21770 to avoid shadowing.
21771 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 21772
7e3ab302
PE
21773 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
21774 so that the caller can use some name other than gcpro1.
21775 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
21776 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21777 (Fx_backspace_delete_keys_p):
21778 Use them to avoid shadowing, and rename vars to avoid shadowing.
21779 (x_decode_color, x_set_name, x_window): Now static.
6b437900 21780 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 21781 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
21782 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
21783 Remove unused locals.
7e3ab302
PE
21784 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21785 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
21786 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
21787 macros.
f78faa98 21788
e2b13473
PE
21789 * xterm.h (x_mouse_leave): New decl.
21790
77f23912
PE
21791 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
21792 Remove unused functions.
cdf4ba58
PE
21793 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
21794 (x_calc_absolute_position): Now static.
7411c686 21795 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 21796 Don't declare local "event" unless it's used.
ed7bf3a5
PE
21797 (x_iconify_frame, x_free_frame_resources): Don't declare locals
21798 unless they are used.
38d0b34a
PE
21799 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
21800 (x_fatal_error_signal): Remove; not used.
a6067996
PE
21801 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
21802 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
21803 (x_error_catcher, x_connection_closed, x_error_handler):
21804 (x_error_quitter, xembed_send_message, x_iconify_frame):
21805 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 21806 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 21807 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 21808
44f230aa
SM
21809 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
21810 Rename or move locals to avoid shadowing.
6b463e58 21811 (tty_defined_color, merge_face_heights): Now static.
5967d051 21812 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
21813 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
21814 does not deduce is never used uninitialized.
73719eba
PE
21815 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
21816 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 21817
426994c3 21818 * terminal.c (store_terminal_param): Now static.
5489860b 21819
032f1620 21820 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 21821 (set_frame_menubar): Remove unused local.
d4323972 21822 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
21823 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
21824 since they might point to immutable storage.
281585b0
PE
21825 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
21826 since it's unused otherwise.
032f1620 21827
367c19e5 21828 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 21829 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
21830 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
21831 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 21832 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
21833 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
21834 does not deduce are never used uninitialized.
70739cbe 21835
07b48fa9
PE
21836 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
21837
8868a238 21838 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
21839 * window.c (window_loop, size_window):
21840 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 21841
7e5cf297 21842 * window.c (display_buffer): Now static.
d6550a9f
PE
21843 (size_window): Mark variables that gcc -Wuninitialized
21844 does not deduce are never used uninitialized.
a586633d
PE
21845 * window.h (check_all_windows): New decl, to forestall
21846 gcc -Wmissing-prototypes diagnostic.
5b555da1 21847 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 21848
f6095868
PE
21849 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
21850 shadowing.
21851 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
21852 Include <limits.h>.
21853 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
21854 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
21855 (load_charset_map): Mark variables that gcc -Wuninitialized
21856 does not deduce are never used uninitialized.
53df7c11 21857 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 21858
f38b440c
PE
21859 * coding.c (coding_set_source, coding_set_destination):
21860 Use "else { /* comment */ }" rather than "else /* comment */;"
21861 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
21862 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
21863 a block, when the outer 'i' will do.
21864 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
21865 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
21866 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
21867 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
21868 (Fdecode_sjis_char, Fdefine_coding_system_internal):
21869 Rename locals to avoid shadowing.
21870 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
21871 * coding.c (emacs_mule_char, encode_invocation_designation):
21872 Now static, since they're not used elsewhere.
413bb2db 21873 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 21874 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
21875 (decode_coding_emacs_mule): Mark variables that gcc
21876 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
21877 (detect_coding_iso_2022): Initialize a local variable that might
21878 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 21879 this initialization is needed. (Bug#8211)
5f58e762
PE
21880 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
21881 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
21882 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
21883 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
21884 Remove unused macros.
f38b440c 21885
232b38b9 21886 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 21887 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 21888 * character.c (string_count_byte8): Likewise.
232b38b9 21889
fb90da1b
PE
21890 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
21891 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
21892
fb93dbc2
PE
21893 * chartab.c (copy_sub_char_table): Now static, since it's not used
21894 elsewhere.
5c156ace
PE
21895 (sub_char_table_ref_and_range, char_table_ref_and_range):
21896 Rename locals to avoid shadowing.
bbcd0949 21897 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 21898
7d3b3862 21899 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 21900 (BIDI_BOB): Remove unused macro.
7d3b3862 21901
6be7d3da
PE
21902 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
21903 deduce are never used uninitialized.
c2ed9c8b 21904 * term.c (encode_terminal_code): Likewise.
6be7d3da 21905
75f8807f 21906 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 21907
50938595
PE
21908 * tparam.h: New file.
21909 * term.c, tparam.h: Include it.
21910 * deps.mk (term.o, tparam.o): Depend on tparam.h.
21911 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
21912 Move these decls to tparam.h, and make them agree with what
21913 is actually in tparam.c. The previous trick of using incompatible
21914 decls in different modules does not conform to the C standard.
21915 All callers of tparam changed to use tparam's actual API.
21916 * tparam.c (tparam1, tparam, tgoto):
21917 Use const pointers where appropriate.
21918
fbceeba2
PE
21919 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
21920 * cm.h (struct cm): Likewise.
21921 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
21922 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
21923 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
21924 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
21925 (turn_on_face, init_tty): Likewise.
21926 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 21927
7f3f1250
PE
21928 * term.c (term_mouse_position): Rename local to avoid shadowing.
21929
e6ca6543
PE
21930 * alloc.c (mark_ttys): Move decl from here ...
21931 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
21932
c40f8d15
AS
219332011-03-11 Andreas Schwab <schwab@linux-m68k.org>
21934
21935 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
21936
cfe0661d
JB
219372011-03-09 Juanma Barranquero <lekktu@gmail.com>
21938
21939 * search.c (compile_pattern_1): Remove argument regp, unused since
21940 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
21941 (compile_pattern): Don't pass it.
21942
0afb4571
J
219432011-03-08 Jan Djärv <jan.h.d@swipnet.se>
21944
21945 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
21946 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
21947 for ! HAVE_GTK3.
21948 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
21949
21950 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
21951
21952 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
21953 gdk_window_get_screen, gdk_window_get_geometry,
21954 gdk_x11_window_lookup_for_display and GDK_KEY_g.
21955 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
21956 (xg_get_pixbuf_from_pixmap): New function.
21957 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
21958 to Pixmap, take frame as parameter, remove GdkColormap parameter.
21959 Call xg_get_pixbuf_from_pixmap instead of
21960 gdk_pixbuf_get_from_drawable.
21961 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
21962 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
21963 (xg_check_special_colors): Use GtkStyleContext and its functions
21964 for HAVE_GTK3.
21965 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
21966 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
21967 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
21968 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
21969 Call gtk_widget_get_preferred_size.
0afb4571
J
21970 (xg_frame_resized): gdk_window_get_geometry only takes 5
21971 parameters.
44f230aa
SM
21972 (xg_win_to_widget, xg_event_is_for_menubar):
21973 Call gdk_x11_window_lookup_for_display.
0afb4571
J
21974 (xg_set_widget_bg): New function.
21975 (delete_cb): New function.
895009e1 21976 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 21977 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
21978 (xg_set_background_color): Call xg_set_widget_bg.
21979 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
21980 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
21981 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
21982 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
21983 if ! HAVE_GTK3.
21984 (update_frame_tool_bar): Call gtk_widget_hide.
21985 (xg_initialize): Use GDK_KEY_g.
21986
21987 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
21988 if ! HAVE_GTK3
21989 (x_session_initialize): Call gdk_x11_set_sm_client_id.
21990
21991 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
21992 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
21993 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
21994
1c2cc4ef
JB
219952011-03-08 Juanma Barranquero <lekktu@gmail.com>
21996
21997 * w32xfns.c (select_palette): Check success of RealizePalette against
21998 GDI_ERROR, not zero.
21999
33383987 22000See ChangeLog.11 for earlier changes.
aac0c6e3
MR
22001
22002;; Local Variables:
22003;; coding: utf-8
aac0c6e3
MR
22004;; End:
22005
ab422c4d 22006 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
22007
22008 This file is part of GNU Emacs.
22009
22010 GNU Emacs is free software: you can redistribute it and/or modify
22011 it under the terms of the GNU General Public License as published by
22012 the Free Software Foundation, either version 3 of the License, or
22013 (at your option) any later version.
22014
22015 GNU Emacs is distributed in the hope that it will be useful,
22016 but WITHOUT ANY WARRANTY; without even the implied warranty of
22017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22018 GNU General Public License for more details.
22019
22020 You should have received a copy of the GNU General Public License
22021 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.