]> code.delx.au - gnu-emacs/blob - src/ChangeLog
* lisp/erc/erc-match.el (erc-match-message): Fix last commit.
[gnu-emacs] / src / ChangeLog
1 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2
3 Minor getenv-related fixes.
4 * callproc.c (Fcall_process_region) [!DOS_NT]:
5 Avoid unnecessary duplicate call to getenv.
6 * callproc.c (init_callproc):
7 * dispnew.c (init_display):
8 * sysdep.c (sys_subshell):
9 Omit unnecessary cast of getenv or egetenv.
10
11 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
12
13 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
14 Update dependencies.
15
16 2013-02-12 Eli Zaretskii <eliz@gnu.org>
17
18 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
19 marker's position.
20 (display_line): Set w->region_showing to the value of
21 it->region_beg_charpos, not to -1. This fixes redisplay
22 optimization when cursor is moved up after M->. (Bug#13623)
23 (Bug#13626)
24 (try_scrolling): Scroll text up more if point is too close to ZV
25 and inside the scroll margin. This makes sure point is moved
26 outside the scroll margin in these cases.
27
28 * window.h (struct window): region_showing can no longer be
29 negative.
30
31 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
32
33 Tune by using memchr and memrchr.
34 * doc.c (Fsnarf_documentation):
35 * fileio.c (Fsubstitute_in_file_name):
36 * search.c (find_newline, scan_newline):
37 * xdisp.c (pos_visible_p, display_count_lines):
38 Use memchr and memrchr rather than scanning byte-by-byte.
39 * search.c (find_newline): Rename from scan_buffer.
40 Omit first arg TARGET, as it's always '\n'. All callers changed.
41
42 Clean up read_key_sequence a tiny bit more.
43 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
44 (read_key_sequence): Remove unused locals.
45
46 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
47
48 Clean up read_key_sequence a bit; reread active keymaps after first event.
49 * keyboard.c (read_char, read_char_x_menu_prompt)
50 (read_char_minibuf_menu_prompt):
51 Replace nmaps+maps with a single `map' arg.
52 (follow_key): Operate on a single map.
53 (active_maps): New function.
54 (test_undefined): Also return true for nil bindings.
55 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
56 a single (composed) keymap. Remember `first_event' to choose the right
57 set of active keymaps. Recompute the set of keymaps after receiving
58 the first event. Remove GOBBLE_FIRST_EVENT.
59 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
60 * keyboard.h (read_char): Update declaration.
61 * lread.c (read_filtered_event): Adjust call to read_char.
62
63 2013-02-11 Eli Zaretskii <eliz@gnu.org>
64
65 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
66 Don't use the limitation on backwards movement when lines are truncated
67 in the window. (Bug#13675)
68
69 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
70
71 * marker.c (set_marker_internal): If desired position is passed
72 as a marker, avoid call to buf_charpos_to_bytepos.
73 * window.c (Fset_window_point): Omit redundant type checking.
74 (Fset_window_start): Likewise. Format comment.
75 (window_scroll_pixel_based): Use set_marker_restricted_both
76 with character and byte positions obtained from an iterator.
77 (Fset_window_configuration): Use set_marker_restricted_both.
78 * xdisp.c (message_dolog): Likewise.
79
80 2013-02-10 Eli Zaretskii <eliz@gnu.org>
81
82 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
83 When text lines are longer than window's screen lines, don't move back
84 too far. This speeds up some redisplay operations. (Bug#13675)
85
86 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
87
88 * syntax.c (scan_sexps_forward): Fix byte position calculation
89 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
90
91 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
92
93 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
94 that was not needed.
95
96 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
97
98 Minor hashing refactoring.
99 * fns.c (SXHASH_REDUCE): Move to lisp.h.
100 (sxhash_float): Return EMACS_UINT, for consistency with the other
101 hash functions.
102 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
103 non-static inline function and therefore can't use static vars.
104 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
105 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
106 with the other hash functions.
107
108 2013-02-09 Eli Zaretskii <eliz@gnu.org>
109
110 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
111 XXXXXX part of the temporary file pattern is not downcased even
112 when w32-downcase-file-names is non-nil. (Bug#13661)
113
114 * xdisp.c (decode_mode_spec): Remove handling of %t.
115
116 * msdos.c (careadlinkatcwd): Remove.
117
118 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
119
120 * lread.c (skip_dyn_bytes): New function (bug#12598).
121 (read1): Use it. Use getc instead of READCHAR to read bytes.
122 (load_each_byte): Remove. Update users.
123
124 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
125
126 * search.c (scan_buffer): Calculate end byte position just once.
127 (scan_newline): Do not recalculate start_byte.
128 (search_command): Use eassert.
129 * syntax.c (struct lisp_parse_state): New member location_byte.
130 (scan_sexps_forward): Record from_byte and avoid redundant
131 character to byte position calculation ...
132 (Fparse_partial_sexp): ... here. Break too long line.
133
134 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
135
136 * lisp.h (make_uninit_vector): New function.
137 * alloc.c (Fvector, Fmake_byte_code):
138 * ccl.c (Fregister_ccl_program):
139 * charset.c (Fdefine_charset_internal, define_charset_internal):
140 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
141 * composite.c (syms_of_composite):
142 * font.c (Fquery_font, Ffont_info, syms_of_font):
143 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
144 * ftfont.c (ftfont_shape_by_flt):
145 * indent.c (recompute_width_table):
146 * nsselect.m (clean_local_selection_data):
147 * syntax.c (init_syntax_once):
148 * w32unsubscribe.c (uniscribe_shape):
149 * window.c (Fcurrent_window_configuration):
150 * xfaces.c (Fx_family_fonts):
151 * xselect.c (selection_data_to_lisp_data): Use it.
152
153 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
154
155 * coding.c (Fdefine_coding_system_internal): Use AREF where
156 argument is known to be a vector.
157 * fns.c (Flocale_info): Likewise for ASET.
158 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
159 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
160
161 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
162
163 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
164 height.
165
166 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
167 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
168 updateCollectionBehaviour.
169
170 * nsterm.m (NEW_STYLE_FS): Remove.
171 (ns_last_use_native_fullscreen): New variable.
172 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
173 (x_set_window_size): Do not take title bar and tool bar into account
174 if isFullscreen returns YES.
175 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
176 (check_native_fs): New function.
177 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
178 (ns_term_init): Remove NEW_STYLE_FS.
179 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
180 and tool bar if isFullscreen returns NO.
181 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
182 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
183 with HAVE_NATIVE_FS.
184 (window:willUseFullScreenPresentationOptions:): New method.
185 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
186 Hide toolbar if not enabled (Bug#13444).
187 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
188 Restore tool bar if enabled, hide it otherwise (Bug#13444).
189 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
190 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
191 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
192 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
193 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
194 (syms_of_nsterm): Add ns-use-native-fullscreen.
195
196 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
197
198 * fileio.c (Qchoose_write_coding_system): Now static.
199
200 2013-02-04 Eli Zaretskii <eliz@gnu.org>
201
202 * xdisp.c (window_buffer_changed): region_showing can be negative,
203 which still means region is being displayed.
204 (redisplay_internal): Resurrect code that forced redisplay of the
205 whole window when showing region and the mark has changed.
206 Record the new mark position to allow redisplay optimizations.
207 (display_line): If it->region_beg_charpos is non-zero, set the
208 window's region_showing member to -1. (Bug#13623) (Bug#13626)
209
210 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
211 not bitfield of 1 bit.
212
213 2013-02-03 Daniel Colascione <dancol@dancol.org>
214
215 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
216 daemon mode works on cygw32 when Emacs is installed and not just
217 during development.
218
219 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
220
221 Avoid file time stamp bug on MS-Windows (Bug#13149).
222 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
223 as FAT32 doesn't update time stamps when truncating them.
224 Also, check that a file time stamp is not a multiple of 100 ns;
225 this should catch all instances of the problem on MS-Windows,
226 as its native file system resolution is 100 ns or worse, and
227 checking for a non-multiple of 100 ns should impose only a small
228 overhead on systems with ns resolution.
229
230 2013-02-02 Eli Zaretskii <eliz@gnu.org>
231
232 Avoid encoding file names on MS-Windows when they need to be run
233 through dostounix_filename.
234 * w32.c (normalize_filename): Accept an additional argument
235 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
236 downcase it even if w32-downcase-file-names is non-nil.
237 (dostounix_filename): Accept an additional argument MULTIBYTE and
238 pass it to normalize_filename.
239 (emacs_root_dir): Adjust.
240
241 * msdos.h (dostounix_filename): Adjust prototype.
242
243 * w32.h (dostounix_filename): Adjust prototype.
244
245 * msdos.c (dostounix_filename): Accept an additional argument and
246 ignore it.
247 (init_environment): Adjust callers of dostounix_filename.
248
249 * fileio.c (Ffile_name_directory, file_name_as_directory)
250 (directory_file_name, Fexpand_file_name)
251 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
252 dostounix_filename.
253 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
254 non-nil.
255 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
256 variables, as egetenv is case-insensitive for DOS_NT.
257
258 * dired.c (file_name_completion): Don't call Fdirectory_file_name
259 with an encoded file name.
260
261 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
262 Adjust calls to dostounix_filename.
263
264 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
265
266 * unexw32.c (unexec): Adjust call to dostounix_filename.
267
268 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
269
270 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
271 dostounix_filename.
272
273 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
274 dostounix_filename.
275
276 * callproc.c (Fcall_process): Make sure program name in PATH and
277 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
278 is passed to exec/spawnve, which fails unless the file-name
279 encoding is UTF-8.
280
281 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
282 even if w32-quote-process-args is nil.
283
284 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
285
286 Fix timestamp bug when write-region appends nothing (Bug#13149).
287 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
288 the file's time stamp doesn't change if Emacs happens to write nothing
289 to the file, and on a buggy file system this could cause Emacs to
290 incorrectly infer that the file system doesn't have the bug.
291 Avoid this problem by inhibiting the inference in this case.
292
293 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
294
295 * window.h (struct window): Convert base_line_number, base_line_pos
296 and column_number_displayed members from Lisp_Object to ptrdiff_t.
297 Convert region_showing member from Lisp_Object to bitfield.
298 Remove sequence_number member. Adjust comments.
299 * window.c (sequence_number): Remove.
300 (make_window): Initialize column_number_displayed.
301 * print.c (print_object): Follow the printed representation of
302 frames and print window pointer to distinguish between windows.
303 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
304 * xdisp.c (wset_base_line_number, wset_base_line_pos)
305 (wset_column_number_displayed, wset_region_showing): Remove.
306 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
307 (try_scrolling, try_cursor_movement, redisplay_window)
308 (try_window_reusing_current_matrix, try_window_id, display_line)
309 (display_mode_lines, decode_mode_spec): Adjust users.
310 * .gdbinit (pwinx): Do not print sequence_number.
311
312 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
313
314 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
315 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
316 * dired.c: Include <fcntl.h>.
317 (open_directory): New function, which uses open and fdopendir
318 rather than opendir. DOS_NT platforms still use opendir, though.
319 (directory_files_internal, file_name_completion): Use it.
320 (file_attributes): New function, with most of the old Ffile_attributes.
321 (directory_files_internal, Ffile_attributes): Use it.
322 (file_attributes, file_name_completion_stat): First arg is now fd,
323 not dir name. All uses changed. Use fstatat rather than lstat +
324 stat.
325 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
326 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
327 (emacs_readlinkat): New function, with much of the old
328 Ffile_symlink_p, but with an fd argument for speed.
329 It uses readlinkat rather than careadlinkatcwd, so that it
330 need not assume the working directory.
331 (Ffile_symlink_p): Use it.
332 * filelock.c (current_lock_owner): Use emacs_readlinkat
333 rather than emacs_readlink.
334 * lisp.h (emacs_readlinkat): New decl.
335 (READLINK_BUFSIZE, emacs_readlink): Remove.
336 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
337 (emacs_norealloc_allocator, emacs_readlink): Remove.
338 This stuff is moved to fileio.c.
339 * w32.c (fstatat, readlinkat): New functions.
340 (careadlinkat): Don't check that fd == AT_FDCWD.
341 (careadlinkatcwd): Remove; no longer needed.
342
343 2013-01-31 Glenn Morris <rgm@gnu.org>
344
345 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
346 (Fwrite_region): Update for new choose_write_coding_system args.
347 Move the last piece of choose_write_coding_system here. (Bug#13522)
348 (syms_of_fileio): Add choose-write-coding-system.
349
350 2013-01-30 Eli Zaretskii <eliz@gnu.org>
351
352 * w32.c (sys_open): Zero out the flags for the new file descriptor.
353 (sys_close): Zero out the flags for the file descriptor before
354 closing it. (Bug#13546)
355
356 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
357 (logon_network_drive, stat_worker, symlink, chase_symlinks):
358 Use CharNextExA and CharPrevExA to iterate over file names encoded in
359 DBCS. (Bug#13553)
360
361 * w32.c (w32_get_long_filename, init_environment, readlink):
362 Support file names encoded in DBCS codepages.
363 (readlink): Use the current file-name-coding-system, not the ANSI
364 codepage, to decode and handle targets of symlinks.
365
366 2013-01-28 Eli Zaretskii <eliz@gnu.org>
367
368 * w32.c (opendir): Now accepts a 'const char *'.
369
370 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
371
372 Remove obsolete redisplay code. See the discussion at
373 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
374 * dispnew.c (preemption_period, preemption_next_check): Remove.
375 (Vredisplay_preemption_period): Likewise.
376 (update_frame, update_single_window, update_window, update_frame_1):
377 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
378 used, following the 2012-06-22 change.
379
380 2013-01-25 Eli Zaretskii <eliz@gnu.org>
381
382 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
383
384 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
385
386 * font.c (num_fonts): Remove the leftover from old
387 debugging code. Adjust comment style here and there.
388 * insdel.c (insert_1): Remove.
389 * lisp.h (insert_1): Remove prototype.
390 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
391
392 2013-01-25 Eli Zaretskii <eliz@gnu.org>
393
394 * w32.c (max_filename_mbslen): New function.
395 (normalize_filename, readdir): Use it to detect locales where ANSI
396 encoding of file names uses a double-byte character set (DBCS).
397 If a DBCS encoding is used, advance by characters using
398 CharNextExA, instead of incrementing a 'char *' pointer.
399 Use _mbslwr instead of _strlwr. (Bug#13515)
400
401 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
402 request of memory reservation to 1.7GB. (Bug#13065)
403
404 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
405
406 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
407 at check_extra_latin label. (Bug#13505)
408
409 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
410
411 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
412 Avoid redundant calls to strlen.
413
414 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
415
416 Drop async_visible and async_iconified fields of struct frame.
417 This is possible because async input is gone; for details, see
418 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
419 * frame.h (struct frame): Remove async_visible and async_iconified
420 members, convert garbaged to unsigned bitfield. Adjust comments.
421 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
422 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
423 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
424 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
425 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
426 * w32term.c: Ditto.
427 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
428 properly. Likewise for obscured.
429 * xterm.c: Ditto.
430 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
431 properly.
432 * nsterm.m: Ditto.
433 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
434
435 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
436
437 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
438 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
439
440 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
441
442 * xdisp.c (message2, message2_nolog): Remove functions.
443 (message3, message3_nolog): Extract nbytes and multibyteness directly
444 from the string. Change all callers.
445 (message3_nolog): Don't set message_enable_multibyte since set_message
446 will reset it anyway.
447 (message1, message1_nolog): Use message3.
448 (vmessage): Use a stack allocated buffer rather than f->message_buf.
449 (with_echo_area_buffer): Remove last two arguments. Update all callers.
450 (set_message): Drop all but the second arg, which has to be a string.
451 (set_message_1): Simplify now that we know that a1 is NULL and the
452 second arg is a string.
453 * frame.h (struct frame): Remove `message_buf' field.
454 Use glyphs_initialized_p instead.
455 (FRAME_MESSAGE_BUF): Remove macro.
456 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
457 * lisp.h (message2, message2_nolog): Remove declarations.
458 (message3, message3_nolog): Update declarations.
459 * keyboard.c (read_char_minibuf_menu_text)
460 (read_char_minibuf_menu_width): Remove vars.
461 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
462 to correctly handle multibyte strings.
463 * frame.c (delete_frame): Don't free message_buf any more.
464 * editfns.c (message_text, message_length): Remove vars.
465 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
466 * fileio.c (auto_save_error): Use message3 instead of message2.
467 * dispnew.c (adjust_frame_message_buffer): Remove function.
468
469 2013-01-23 Eli Zaretskii <eliz@gnu.org>
470
471 * w32term.c (w32fullscreen_hook): Account correctly for the screen
472 real estate used for the tool bar and the menu bar.
473
474 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
475
476 * insdel.c (prepare_to_modify_buffer): Force redisplay if
477 hidden buffer is prepared to modification (Bug#13164).
478
479 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
480
481 * window.h (struct window): Change window_end_valid member from
482 Lisp_Object to a bitfield. Adjust comments.
483 (wset_window_end_valid): Remove.
484 * window.c (adjust_window_count): Clear window_end_valid.
485 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
486 (Fwindow_line_height, set_window_buffer, Frecenter)
487 (Fsplit_window_internal, Fdelete_other_windows_internal)
488 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
489 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
490 * xdisp.c (check_window_end, reconsider_clip_changes)
491 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
492 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
493 (find_first_unchanged_at_end_row, try_window_id): Likewise.
494
495 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
496
497 * xdisp.c (mark_window_display_accurate): Simplify the loop
498 assuming that the only one of vchild, hchild or buffer window
499 slots is non-nil. Call mark_window_display_accurate_1 for
500 the leaf windows only.
501 (mark_window_display_accurate_1): Always assume leaf window.
502 Adjust comment.
503
504 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
505
506 * emacs.c (Qkill_emacs_hook): Now static.
507
508 * fileio.c (Finsert_file_contents): Simplify.
509 Remove unnecessary assignments and tests.
510
511 2013-01-21 Eli Zaretskii <eliz@gnu.org>
512
513 * w32.c (acl_set_file): Don't test for errors unless
514 set_file_security returns FALSE. Avoids spurious errors when
515 saving files.
516
517 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
518
519 * fileio.c (Finsert_file_contents): Revert code introduced at
520 2013-01-18 in favor of the simpler and generally better fix.
521 Save stack space by removing 'buffer' and reusing 'read_buf'
522 where appropriate.
523
524 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
525
526 * lisp.h (eabs): Define unconditionally (Bug#13419).
527 The old "#if !defined (eabs)" was an unnecessary revenant of back
528 when this macro was called "abs". Document 'eabs' better.
529
530 2013-01-19 Glenn Morris <rgm@gnu.org>
531
532 * fns.c (Frandom): Doc fix.
533
534 2013-01-19 Eli Zaretskii <eliz@gnu.org>
535
536 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
537 segfault when there are lots of overlays.
538
539 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
540 when there are lots of overlays.
541 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
542 for the details and a way to reproduce.
543
544 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
545
546 * fileio.c: Use O_APPEND to append.
547 This corresponds better to the natural interpretation of "append",
548 and avoids the need to open the output file twice, or to invoke
549 lseek when APPEND is neither nil nor a number.
550 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
551 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
552 file possibly twice, and lseeking to its end; this avoids the
553 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
554 at the same time: the combination is never needed and apparently
555 it doesn't work with DOS_NT.
556
557 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
558 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
559
560 Allow floating-point file offsets.
561 Problem reported by Vitalie Spinu in
562 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
563 * fileio.c (emacs_lseek): Remove.
564 (file_offset): New function.
565 (Finsert_file_contents, Fwrite_region): Use it.
566
567 2013-01-19 Chong Yidong <cyd@gnu.org>
568
569 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
570 aborting on Fsignal (Bug#13289).
571
572 2013-01-19 Eli Zaretskii <eliz@gnu.org>
573
574 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
575 set_file_security as failure due to insufficient privileges.
576 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
577 (fstat): Return owner and group like 'stat' and 'lstat' do.
578
579 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
580
581 Work around bug in CIFS and vboxsf file systems (Bug#13149).
582 The bug was observed on Ubuntu operating inside a virtual machine,
583 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
584 The workaround introduces a race condition on non-buggy hosts,
585 but it's an unlikely race and anyway there's a nearly identical
586 nearby race that can't be fixed.
587 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
588 New static vars.
589 (Fwrite_region): Test for file system time stamp bug.
590 (init_fileio): New function.
591 * lisp.h (init_fileio): Declare it.
592 * emacs.c (main): Call it.
593
594 * fileio.c (Finsert_file_contents): Simplify new diagnostic
595 and make it more consistent with other stat-failure diagnostics.
596
597 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
598
599 Fix crash when inserting data from non-regular files.
600 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
601 for the error description produced by valgrind.
602 * fileio.c (read_non_regular): Rename to read_contents.
603 Free Lisp_Save_Value object used to pass parameters.
604 (read_non_regular_quit): Rename to read_contents_quit.
605 (Finsert_file_contents): Redesign internal file reading loop to adjust
606 gap and end positions after each read and so help make_gap to work
607 properly. Do not signal an I/O error too early and so do not leave
608 not yet decoded characters in a buffer, which was the reason of
609 redisplay crash. Use list2 to build return value. Adjust comments.
610
611 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
612
613 Close a race when statting and reading files (Bug#13149).
614 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
615 This avoids a race if the file is renamed between stat and open.
616 This race is not the problem originally noted in Bug#13149;
617 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
618
619 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
620
621 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
622 objects, related functions and macros.
623 (make_save_value): Adjust prototype.
624 (make_save_pointer): New prototype.
625 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
626 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
627 * alloc.c (format_save_value): Rename to make_save_value.
628 (make_save_pointer): New function.
629 (record_xmalloc): Use make_save_pointer.
630 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
631 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
632 Change users of make_save_value to make_save_pointer.
633 Likewise for format_save_value and make_save_value.
634
635 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
636
637 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
638 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
639 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
640 debugging stubs.
641
642 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
643
644 * alloc.c (free_save_value): Now static.
645
646 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
647
648 * keymap.c (map_keymap_internal): Use format_save_value.
649 (map_keymap_char_table_item): Adjust accordingly.
650 * fileio.c (non_regular_fd, non_regular_inserted)
651 (non_regular_nbytes): Remove.
652 (Finsert_file_contents): Convert trytry to ptrdiff_t.
653 Use format_save_value to pass parameters to read_non_regular.
654 (read_non_regular): Use XSAVE_ macros to extract parameters.
655 Adjust comment.
656 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
657 format_save_value.
658 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
659
660 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
661
662 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
663 extraction from any Lisp_Save_Value slot. Add type checking.
664 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
665 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
666 * xselect.c: All users changed.
667
668 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
669
670 Some convenient bits to deal with Lisp_Save_Values.
671 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
672 (allocate_misc): Remove prototype.
673 (format_save_value): New prototype.
674 * alloc.c (allocate_misc): Revert back to static.
675 (format_save_value): New function to build Lisp_Save_Value
676 object with the specified internal structure.
677 (make_save_value): Reimplement using format_save_value.
678 * editfns.c (save_excursion_save): Use format_save_value.
679 (save_excursion_restore): Use XSAVE_OBJECT.
680
681 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
682
683 Avoid needless casts with XSAVE_POINTER.
684 * alloc.c (mark_object) [GC_MARK_STACK]:
685 * dired.c (directory_files_internal_unwind):
686 * fileio.c (do_auto_save_unwind):
687 * gtkutil.c (pop_down_dialog):
688 * keymap.c (map_keymap_char_table_item):
689 * lread.c (load_unwind):
690 * nsmenu.m (pop_down_menu):
691 * print.c (print_object) [GC_MARK_STACK]:
692 * xfns.c (clean_up_file_dialog):
693 * xmenu.c (cleanup_widget_value_tree):
694 Omit casts between XSAVE_POINTER and a pointer type.
695
696 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
697
698 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
699 * eval.c (eval_sub): Protect `form' from being GCed before its
700 car and cdr becomes protected with the backtrace entry.
701
702 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
703
704 Make Lisp_Save_Value more versatile storage for up to four objects.
705 * lisp.h (toplevel): Enumeration to describe types of saved objects.
706 (struct Lisp_Save_Value): New layout. Adjust comments.
707 (XSAVE_POINTER): New macro.
708 (XSAVE_INTEGER): Likewise.
709 (allocate_misc): Add prototype.
710 (free_misc): Likewise.
711 * alloc.c (allocate_misc): Now global.
712 (free_misc): Likewise. Adjust comment.
713 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
714 (free_save_value): Likewise.
715 (mark_object): Likewise.
716 * editfns.c (save_excursion_save): Pack everything within
717 Lisp_Save_Value and so avoid xmalloc.
718 (save_excursion_restore): Adjust to match new layout. Use free_misc
719 because we do not allocate extra memory any more. Add eassert.
720 * print.c (print_object): New code to print Lisp_Save_Value. Do not
721 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
722 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
723 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
724 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
725
726 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
727
728 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
729 (nsfont_draw): Remove disabling of LCD smoothing.
730 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
731 Bug#11484 with LCD smoothing on.
732
733 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
734
735 Fix SIGDANGER handlers, for AIX (Bug#13408).
736 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
737 Move handlers here from emacs.c; they were out of place.
738
739 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
740
741 * xterm.c (syms_of_xterm): Adjust documentation for
742 scroll-bar-adjust-thumb-portion.
743
744 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
745
746 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
747 determine whether scroll bar thumb size should be adjusted or
748 not. Use variable for MOTIF.
749
750 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
751 GTK.
752
753 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
754
755 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
756 event is generated.
757 (doCommandBySelector:): Set processingCompose to NO.
758
759 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
760 Remove check for fkeys count > zero, block/unblock fixes the real bug.
761 (nsfont_list_family): Add block/unblock_input calls.
762 (nsfont_open): Move block_input earlier. Add unblock_input before early
763 return.
764 (nsfont_draw): Add block/unblock_input calls.
765
766 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
767
768 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
769 for old_charpos and old_bytepos.
770
771 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
772
773 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
774 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
775 Clear tzvalbuf_in_environ if this workaround is in effect.
776 Problem and fix reported by Kazuhiro Ito.
777
778 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
779
780 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
781 Fix ambiguous doc string cross-reference(s).
782
783 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
784 doc string cross-reference(s).
785
786 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
787 string cross-reference(s).
788
789 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
790
791 Avoid unnecessary byte position calculation for the gap movement.
792 Since all users of move_gap do CHAR_TO_BYTE for other purposes
793 anyway, all of them should use move_gap_both instead.
794 * lisp.h (move_gap): Remove prototype.
795 * insdel.c (move_gap): Remove.
796 (move_gap_both): Add eassert.
797 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
798 * xml.c (parse_region): Likewise.
799
800 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
801
802 emacsclient -t should not suspend Emacs server (Bug#13387)
803 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
804 New functions.
805 * term.c (init_tty): Use them instead of rolling our own code.
806 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
807 switches from 'signal' to 'pthread_sigmask', which is safer in
808 multithreaded applications.
809 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
810 which has already arranged for that.
811 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
812 This is the main part of the bug fix.
813
814 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
815
816 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
817 x_last_font_name (Bug#13403).
818
819 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
820
821 Omit buffer_slot_type_mismatch and use generic predicates to enforce
822 the type of per-buffer values where appropriate.
823 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
824 predicate, which is how it's really used now. Adjust comment.
825 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
826 * buffer.c (buffer_slot_type_mismatch): Remove.
827 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
828 predicate. Adjust comment.
829 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
830 fill-column, left-margin, tab-width, buffer-saved-size,
831 left-margin-width, right-margin-width, left-fringe-width,
832 right-fringe-width, scroll-bar-width and buffer-display-count.
833 Use Qstringp for default-directory, buffer-file-name,
834 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
835 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
836 line-spacing.
837 * data.c (store_symval_forwarding): Adjust to call the predicate.
838
839 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
840
841 * w32.c (get_name_and_id, acl_set_file):
842 * w32term.c (w32fullscreen_hook): Remove unused local variables.
843
844 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
845
846 * lisp.h (make_gap_1): New prototype.
847 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
848 gap size values.
849 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
850 naming convention.
851 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
852 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
853 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
854 (make_gap_1): New function to adjust the gap of any buffer.
855 * coding.c (coding_alloc_by_making_gap): Use it.
856 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
857 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
858
859 2013-01-08 Juri Linkov <juri@jurta.org>
860
861 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
862 of (supports :underline (:style wave)). (Bug#13000)
863
864 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
865
866 * undo.c (Fprimitive_undo): Move to simple.el.
867 (syms_of_undo): Remove declarations for Sprimitive_undo.
868
869 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
870
871 * keyboard.c (echo_add_key): Rename from echo_add_char.
872
873 2013-01-06 Chong Yidong <cyd@gnu.org>
874
875 * keyboard.c (echo_add_char): New function, factored out from
876 echo_char. Don't add a space if the previous echo string was
877 empty (Bug#13255).
878 (echo_char): Use it.
879 (read_key_sequence): When echoing mock input, ensure that the
880 trailing dash is properly added.
881
882 2013-01-05 Eli Zaretskii <eliz@gnu.org>
883
884 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
885 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
886 digits for buffer positions, before misalignment starts.
887 Display "0" for integer "object" field.
888 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
889 Display the newline glyph more unambiguously.
890
891 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
892
893 * nsterm.m (ns_draw_underwave):
894 * w32term.c (w32_draw_underwave):
895 * xterm.c (x_draw_underwave): Make underwave look more triangular
896 and also degrade gracefully for small fonts. (Bug#13000)
897
898 * nsterm.m (ns_draw_text_decoration):
899 * w32term.c (x_draw_glyph_string):
900 * xterm.c (x_draw_glyph_string): Don't use previous underline
901 thickness and position if previous underline type is underwave.
902
903 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
904
905 * fileio.c (Ffile_acl): Undocument return format.
906
907 2013-01-02 Glenn Morris <rgm@gnu.org>
908
909 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
910
911 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
912
913 Simplify via eabs.
914 * dired.c (file_name_completion):
915 * doc.c (get_doc_string):
916 * floatfns.c (round2):
917 * font.c (font_score, font_delete_unmatched):
918 * fringe.c (compute_fringe_widths):
919 * lread.c (read_list):
920 * minibuf.c (Ftry_completion):
921 * term.c (tty_ins_del_lines):
922 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
923 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
924
925 2012-12-31 Eli Zaretskii <eliz@gnu.org>
926
927 * w32.c (unsetenv): Set up the string passed to _putenv
928 correctly.
929 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
930 for the bug this caused.
931
932 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
933
934 * coding.c (Qmac): Now static.
935
936 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
937
938 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
939 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
940 handlebox_widget. Set toolbar_in_hbox to false/true, set
941 toolbar_is_packed to true.
942 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
943 (update_frame_tool_bar): Check toolbar_is_packed for packing.
944 Show all on TOOLBAR_TOP_WIDGET.
945 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
946 by TOOLBAR_TOP_WIDGET.
947 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
948 Check toolbar_is_packed.
949 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
950 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
951 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
952 false.
953 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
954 (xg_update_menubar): Update title only if
955 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
956 (xg_update_submenu): Skip tearoff only if
957 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
958 (xg_initialize): Initialize xg_detached_menus only if
959 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
960
961 * xterm.h (struct x_output): Surround handlebox_widget with
962 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
963 toolbar_in_hbox is bool.
964
965 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
966
967 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
968 (LIBS_GNUSTEP): Define.
969 (LIBES): Add $(LIBS_GNUSTEP).
970 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
971
972 2012-12-30 Eli Zaretskii <eliz@gnu.org>
973
974 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
975 continuation glyph on a TTY with an indication of an empty line.
976 (Bug#13277)
977
978 2012-12-29 Eli Zaretskii <eliz@gnu.org>
979
980 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
981 file's SELinux context or ACLs successfully set, nil otherwise.
982 (Bug#13298)
983 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
984
985 * w32proc.c (reader_thread): Avoid passing NULL handles to
986 SetEvent and WaitForSingleObject.
987
988 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
989
990 Port EXTERNALLY_VISIBLE to Clang 3.2.
991 * conf_post.h (__has_attribute): New macro.
992 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
993
994 2012-12-27 Glenn Morris <rgm@gnu.org>
995
996 * cygw32.c (Fcygwin_convert_file_name_to_windows)
997 (Fcygwin_convert_file_name_from_windows): Doc fixes.
998
999 2012-12-27 Eli Zaretskii <eliz@gnu.org>
1000
1001 * fileio.c (file_name_as_directory, directory_file_name):
1002 Accept an additional argument MULTIBYTE to indicate whether the input C
1003 came from a multibyte or a unibyte Lisp string; all callers
1004 adjusted. Don't assume the input string is always multibyte.
1005 (Bug#13262)
1006 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1007 don't ENCODE_FILE them, and return a unibyte string if the input
1008 was unibyte.
1009 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1010 don't assume the input strings will always be multibyte. If the
1011 input strings are multibyte, decode strings obtained from C
1012 library functions.
1013
1014 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1015
1016 * lisp.h (toplevel): Add two notices to the comment about
1017 defining a new Lisp data type.
1018 * print.c (print_object): If Lisp_Save_Value object's pointer
1019 is the address of a memory area containing Lisp_Objects, try
1020 to print them.
1021 * alloc.c (valid_lisp_object_p): Adjust comment.
1022
1023 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1024
1025 * keyboard.c (record_asynch_buffer_change): Initialize an event
1026 only if it's really needed.
1027 * frame.h (enum output_method): Remove output_mac member since
1028 it's a leftover from the deleted code.
1029 * frame.c (Fframep): Adjust user here ...
1030 * terminal.c (Fterminal_live_p): ... and here.
1031 * coding.c (Qmac): Now here because it's only used to denote
1032 end-of-line encoding type.
1033 (syms_of_coding): DEFSYM it.
1034 * frame.h (Qmac): Remove duplicated declaration.
1035
1036 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1037
1038 * window.c (select_window_1): Now static, since it's used only here.
1039
1040 2012-12-25 Eli Zaretskii <eliz@gnu.org>
1041
1042 * window.c (window_body_cols): Subtract display margins from the
1043 window body width on TTYs as well. See
1044 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1045 for the original report.
1046
1047 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1048
1049 * xdisp.c (redisplay_window): Remove inner local variable
1050 because the outer shadowed one has the same meaning.
1051 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1052 set but never used.
1053 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1054 (xg_create_tool_bar): Adjust users.
1055
1056 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1057
1058 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1059 * buffer.c (Fget_buffer_create): Use it to set compact field of
1060 struct buffer_text to avoid accessing an uninitialized value
1061 when compact_buffer is called for the first time.
1062 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
1063 (Fset_buffer_modified_p): Use buffer_window_count to check
1064 whether the buffer is displayed in some window.
1065 * xdisp.c (message_dolog): Likewise.
1066
1067 2012-12-23 Eli Zaretskii <eliz@gnu.org>
1068
1069 * w32.c (acl_set_file): If setting the file security descriptor
1070 fails, and the new DACL is identical to the existing one, silently
1071 return success. This fixes problems for users backing up their
1072 own files without having the necessary privileges for setting
1073 security descriptors.
1074
1075 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1076 values.
1077 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1078 after WaitForSingleObject returns normally. This expedites reader
1079 thread shutdown when delete_child triggers it.
1080 (reap_subprocess): More accurate commentary for why we call
1081 delete_child only when cp->fd is negative.
1082
1083 * w32.c (sys_close): Do not call delete_child on a subprocess
1084 whose handle is not yet closed. Instead, set its file descriptor
1085 to a negative value, so that reap_subprocess will call
1086 delete_child on that subprocess when its SIGCHLD arrives.
1087 This avoids closing handles used for communications between sys_select
1088 and reader_thread, which doesn't give sys_select a chance to
1089 notice that the process exited and invoke the SIGCHLD handler for
1090 it.
1091
1092 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1093
1094 * nsfns.m (Fns_do_applescript): Run event loop until script has
1095 been executed (Bug#12969).
1096 (ns_run_ascript): Chech as_script for nil, set to nil after
1097 executing script.
1098
1099 2012-12-22 Martin Rudalics <rudalics@gmx.at>
1100
1101 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1102
1103 2012-12-22 Eli Zaretskii <eliz@gnu.org>
1104
1105 * w32term.c (w32fullscreen_hook): New function.
1106 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1107
1108 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1109
1110 * fileio.c (Finsert_file_contents): Doc fix.
1111
1112 * w32proc.c (new_child, delete_child, find_child_pid): For a
1113 subprocess, consider its slot being in use as long as its process
1114 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1115 slot when a new process is started immediately after killing
1116 another one, without waiting enough time for the first process to
1117 be reaped and resources allocated for it be orderly freed.
1118 (Bug#13086)
1119 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1120
1121 2012-12-21 Chong Yidong <cyd@gnu.org>
1122
1123 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1124
1125 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1126
1127 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1128
1129 * w32.c (get_name_and_id): Always pass NULL as the first argument
1130 of lookup_account_sid. Avoids crashes with UNC file names that
1131 refer to DFS domains, not to specific machine names. (Bug#12621)
1132 Remove now unused argument FNAME; all callers changed.
1133 (get_file_owner_and_group): Remove now unused argument FNAME; all
1134 callers changed.
1135
1136 2012-12-21 Chong Yidong <cyd@gnu.org>
1137
1138 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1139 error for invalid chars, don't check for a nil return value.
1140
1141 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1142
1143 Avoid calls to CHAR_TO_BYTE if byte position is known.
1144 * editfns.c (make_buffer_string_both): Use move_gap_both.
1145 (Fbuffer_string): Use make_buffer_string_both.
1146 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1147 Adjust comment.
1148 (buf_bytepos_to_charpos): Likewise.
1149 (charpos_to_bytepos): Remove.
1150 * fileio.c (Finsert_file_contents): Use move_gap_both.
1151 * search.c (Freplace_match): Likewise.
1152 * process.c (process_send_region): Likewise. Use convenient
1153 names for byte positions.
1154 * lisp.h (charpos_to_bytepos): Remove prototype.
1155 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1156 * insdel.c (move_gap): Likewise.
1157
1158 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1159
1160 * xdisp.c (redisplay_internal): Remove now-unused local.
1161
1162 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1163
1164 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1165 (redisplay_internal): Don't bother selecting the frame to get the
1166 proper value of frame-local variables (bug#13225).
1167
1168 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1169
1170 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1171 Rename 4th argument since it may be buffer or string. Adjust comment.
1172 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1173
1174 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1175
1176 * coding.c (Fdetect_coding_region): Do not check start and end with
1177 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1178 (code_convert_region): Likewise.
1179
1180 2012-12-18 Eli Zaretskii <eliz@gnu.org>
1181
1182 * w32.c (acl_get_file, acl_set_file): Run the file name through
1183 map_w32_filename, and resolve any symlinks in the file name, like
1184 Posix platforms do.
1185 (acl_set_file): Call revert_to_self, if any privileges were
1186 enabled.
1187
1188 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
1189
1190 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1191 ($(BLD)/w32.$(O)): Update dependencies.
1192
1193 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1194
1195 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1196 propagate redisplay's scrolling (if any) to the right window.
1197 (redisplay_internal): Use ensure_selected_frame.
1198 (display_mode_lines): Complete last fix.
1199 * window.c (select_window_1): New func, extracted from select_window.
1200 (select_window): Use it.
1201 * window.h (select_window_1): Declare.
1202
1203 2012-12-17 Eli Zaretskii <eliz@gnu.org>
1204
1205 Emulate Posix ACL APIs on MS-Windows.
1206 * w32.c: Include sddl.h and sys/acl.h.
1207 (SDDL_REVISION_1): Define if not already defined.
1208 (g_b_init_get_security_descriptor_dacl)
1209 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1210 (g_b_init_is_valid_security_descriptor)
1211 (g_b_init_set_file_security): New static flags.
1212 (globals_of_w32): Initialize them to zero.
1213 (SetFileSecurity_Name): New string constant.
1214 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1215 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1216 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1217 (IsValidSecurityDescriptor_Proc): New typedefs.
1218 (get_file_security, get_security_descriptor_owner)
1219 (get_security_descriptor_group): Set errno to ENOTSUP.
1220 (set_file_security, get_security_descriptor_dacl)
1221 (is_valid_security_descriptor, convert_sd_to_sddl)
1222 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
1223 (acl_free, acl_get_file, acl_set_file): New functions.
1224
1225 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
1226
1227 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
1228
1229 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
1230 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
1231 for some of that bug's symptoms can now cause Emacs to abort.
1232 Remove the workaround.
1233 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
1234 The bug that caused SIGCHLD to get lost has been fixed, and the
1235 workaround for it can now cause Emacs to abort.
1236
1237 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
1238
1239 * sysdep.c (emacs_abort): Bump backtrace size to 40.
1240 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
1241 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1242
1243 2012-12-16 Romain Francoise <romain@orebokech.com>
1244
1245 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
1246 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1247 and copy ACL entries of file in addition to SELinux context if set.
1248 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
1249
1250 * Makefile.in (LIBACL_LIBS): New macro.
1251 (LIBES): Use it.
1252
1253 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
1254
1255 * fileio.c (internal_delete_file): Use bool for boolean.
1256
1257 2012-12-15 Eli Zaretskii <eliz@gnu.org>
1258
1259 Fix bug #13079 on MS-Windows with temp files not being deleted.
1260 * w32.h (_child_process): New members input_file and
1261 pending_deletion.
1262 (register_child): First argument is now pid_t.
1263 (record_infile, record_pending_deletion): New prototypes.
1264
1265 * w32proc.c (new_child): Initialize input_file and
1266 pending_deletion members of the child.
1267 (delete_child): Delete the child's temporary input file, if any,
1268 that is pending deletion.
1269 (register_child): First argument is now pid_t.
1270 (record_infile, record_pending_deletion): New functions.
1271 (reap_subprocess): Fix a typo in DebPrint string.
1272 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
1273
1274 * fileio.c (internal_delete_file): Return an int again: non-zero
1275 if delete-file succeeds, zero otherwise.
1276
1277 * lisp.h (internal_delete_file): Adjust prototype.
1278
1279 * callproc.c (Fcall_process): Don't overwrite infile with result
1280 of DECODE_FILE.
1281 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
1282 asynchronous subprocess, record the name of the input file name,
1283 if any.
1284 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
1285 delete the file, record it as pending deletion when the subprocess
1286 exits.
1287
1288 2012-12-14 Eli Zaretskii <eliz@gnu.org>
1289
1290 * editfns.c [HAVE_PWD_H]: Include grp.h.
1291
1292 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
1293
1294 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
1295
1296 Fix permissions bugs with setgid directories etc. (Bug#13125)
1297 * dired.c (Ffile_attributes): Return t as the 9th attribute,
1298 to mark it as a placeholder. The old value was often wrong.
1299 The only user of this attribute has been changed to use
1300 file-ownership-preserved-p instead, with its new group arg.
1301 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
1302
1303 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
1304
1305 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
1306 Keep selected_window and selected_frame in sync.
1307
1308 2012-12-14 Eli Zaretskii <eliz@gnu.org>
1309
1310 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
1311 try to get accurate owner and group information from NT file
1312 security APIs. This is to make most callers of 'stat' and
1313 'lstat', which don't need that information, much faster.
1314
1315 * dired.c (Ffile_attributes) [WINDOWSNT]:
1316 Set w32_stat_get_owner_group to a non-zero value, to request accurate
1317 owner and group information from 'lstat'.
1318
1319 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1320
1321 * fileio.c (Finsert_file_contents): Don't put tail into head area,
1322 as that confuses set-auto-coding, so insist on the head-read
1323 returning the full 1024 bytes. Let lseek compute the tail offset;
1324 less work for us. Do not ignore I/O errors when reading the tail.
1325
1326 * xdisp.c: Minor style fixes.
1327 (init_iterator): Hoist assignment out of if-expression.
1328 (markpos_of_region): Callers now test for sign, not for -1.
1329
1330 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
1331
1332 Minor redisplay optimization when the region length is zero.
1333 * xdisp.c (markpos_of_region): New function.
1334 (init_iterator): Do not highlight the region of zero length.
1335 (redisplay_window): Check whether the region is of non-zero length.
1336 (try_cursor_movement): Allow if the region length is zero.
1337 (try_window_reusing_current_matrix, try_window_id): Likewise.
1338
1339 2012-12-13 Eli Zaretskii <eliz@gnu.org>
1340
1341 * search.c (search_buffer): Check the inverse translations of each
1342 character in pattern when the buffer being searched is unibyte.
1343 (Bug#13084)
1344
1345 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1346
1347 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
1348 files, fixing a regression from 24.2.
1349 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
1350
1351 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1352
1353 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
1354 fstat shouldn't fail, and if it does fail copy-file should not proceed.
1355 Remove unnecessary S_ISLNK test, as (contra the comments) this
1356 function can't copy symlinks. Improve quality of error message
1357 when attempting to copy files that are neither regular files nor
1358 directories.
1359
1360 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
1361
1362 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
1363 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
1364 * window.c (Frecenter):
1365 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
1366 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
1367
1368 2012-12-12 Daniel Colascione <dancol@dancol.org>
1369
1370 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
1371 the dumped Emacs is not a sparse file, greatly improving Cygwin
1372 "make bootstrap" performance.
1373
1374 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
1375
1376 * inotify.c (inotify_callback): Generate an Emacs event for every
1377 incoming inotify event.
1378
1379 2012-12-11 Eli Zaretskii <eliz@gnu.org>
1380
1381 * xdisp.c (handle_face_prop): Fix logic of computing
1382 it->start_of_box_run_p.
1383 (append_space_for_newline): If the glyph row is R2L, reset the
1384 iterator's end_of_box_run_p flag before prepending the space glyph.
1385 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
1386 iterator's start_of_box_run_p flag before prepending the stretch.
1387 (append_glyph, produce_image_glyph, append_composite_glyph)
1388 (append_stretch_glyph, append_glyphless_glyph): Reverse the
1389 left_box_line_p and right_box_line_p flags of the glyph for R2L
1390 glyph rows. (Bug#13011)
1391
1392 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1393
1394 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
1395 if changed buffer is not shown in a window.
1396 * insdel.c (prepare_to_modify_buffer): Likewise.
1397 * window.c (replace_buffer_in_windows_safely): Do nothing
1398 if buffer is not shown in a window.
1399 (Fforce_window_update): Likewise if string or buffer argument
1400 is passed.
1401
1402 2012-12-11 Eli Zaretskii <eliz@gnu.org>
1403
1404 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
1405 encoded_file_name, which is what it is.
1406
1407 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1408
1409 Consistently use marker_position and marker_byte_position.
1410 * fringe.c (Ffringe_bitmaps_at_pos):
1411 * indent.c (Fvertical_motion):
1412 * insdel.c (prepare_to_modify_buffer):
1413 * keyboard.c (make_lispy_position):
1414 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
1415 (window_scroll_pixel_based, displayed_window_lines)
1416 (Fset_window_configuration):
1417 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
1418 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
1419 Replace direct access to marker fields with calls
1420 to marker_position and/or marker_byte_position.
1421
1422 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
1423
1424 * makefile.w32-in (SIG2STR_H): New macro.
1425 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
1426 ($(BLD)/w32notify.$(O)): Update dependencies.
1427
1428 2012-12-10 Daniel Colascione <dancol@dancol.org>
1429
1430 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
1431 Windows file notification functionality unless WINDOWSNT.
1432
1433 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
1434 declarations.
1435
1436 * w32fns.c (cache_system_info): Initialize the global hinst
1437 variable here so various initialization calls DTRT.
1438
1439 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1440 (hinst): Remove unneeded extern declaration.
1441 (_start): Remove initialization of above variables; remove
1442 initialization of hinst, as cache_system_info now does that.
1443
1444 * emacs.c (main): Call cache_system_info early in startup; we
1445 previously weren't calling it in Cygwin builds.
1446
1447 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
1448 Teach the autoconf build system how to compile a Windows resource file
1449 and link it to Emacs.
1450
1451 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
1452
1453 Per-buffer window counters.
1454 * buffer.h (struct buffer): New member window_count.
1455 (buffer_window_count): New function.
1456 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1457 Initialize window_count.
1458 (Fkill_buffer): Verify window_count for the buffer being killed.
1459 (modify_overlay): Do not force redisplay if buffer is not shown
1460 in any window.
1461 (init_buffer_once): Initialize window_count for buffer_defaults
1462 and buffer_local_symbols.
1463 * window.h (buffer_shared): Remove declaration.
1464 (wset_buffer): Convert from inline ...
1465 * window.c (wset_buffer): ... to an ordinary function.
1466 (adjust_window_count): New function.
1467 (make_parent_window): Use it.
1468 * xdisp.c (buffer_shared): Remove.
1469 (redisplay_internal, redisplay_window): Adjust users.
1470 (buffer_shared_and_changed): Use per-buffer window counter.
1471
1472 2012-12-10 Eli Zaretskii <eliz@gnu.org>
1473
1474 Support for filesystem notifications on MS-Windows.
1475 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
1476 and this is a TTY frame, signal the caller that keyboard input is
1477 available.
1478
1479 * w32xfns.c (drain_message_queue): Now returns an int: an
1480 indication whether any WM_EMACS_FILENOTIFY messages were found in
1481 the queue.
1482
1483 * w32inevt.c (handle_file_notifications): New function.
1484 (w32_console_read_socket): Call it to process file notifications.
1485
1486 * w32console.c (initialize_w32_display): Record the main thread ID
1487 in dwMainThreadId.
1488
1489 * deps.mk (inotify.o): New dependency list.
1490
1491 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
1492
1493 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
1494 (WM_EMACS_END): Bump value by 1.
1495 (notification_buffer_in_use, file_notifications)
1496 (notifications_size, notifications_desc): Declare.
1497 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
1498 Add prototypes.
1499
1500 * w32term.c (lispy_file_action, queue_notifications): New functions.
1501 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
1502 <Qrenamed_to>: New symbols.
1503 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
1504
1505 * w32notify.c: New file, implements file event notifications for
1506 MS-Windows.
1507
1508 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
1509 by posting it to the w32_read_socket queue.
1510
1511 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
1512
1513 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
1514 (GLOBAL_SOURCES): Add w32notify.c
1515 ($(BLD)/w32notify.$(O)): New set of dependencies.
1516
1517 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
1518
1519 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
1520 Handle FILE_NOTIFY_EVENT.
1521 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
1522 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
1523 w32notify-handle-event by default.
1524
1525 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
1526 syms_of_w32notify.
1527
1528 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
1529
1530 Support for filesystem notifications on GNU/Linux via inotify.
1531 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
1532
1533 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
1534
1535 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
1536 (syms_of_keyboard): DEFSYM it.
1537 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
1538 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
1539 Qfile_inotify events.
1540 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
1541 special-event-map to inotify-handle-event.
1542
1543 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
1544
1545 * Makefile.in (base_obj): Add inotify.o.
1546
1547 * inotify.c: New file.
1548
1549 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
1550
1551 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
1552
1553 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
1554
1555 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
1556 DWORD_PTR, for compatibility with 64-bit builds.
1557
1558 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
1559 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
1560 (system_process_attributes): Use SIZE_T rather than DWORD, for
1561 compatibility with 64-bit builds.
1562
1563 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
1564
1565 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
1566
1567 2012-12-10 Eli Zaretskii <eliz@gnu.org>
1568
1569 * indent.c (Fvertical_motion): If a display string will be
1570 displayed on the left or the right margin, don't consider it as a
1571 factor in cursor positioning. (Bug#13108)
1572
1573 2012-12-10 Martin Rudalics <rudalics@gmx.at>
1574
1575 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
1576
1577 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
1578
1579 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
1580 for string length.
1581
1582 2012-12-08 Eli Zaretskii <eliz@gnu.org>
1583
1584 * w32.c (unsetenv): Return 0 if the input string is too long.
1585
1586 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1587
1588 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
1589 * alloc.c (xputenv): New function.
1590 * dbusbind.c (Fdbus_init_bus):
1591 * emacs.c (main):
1592 * xterm.c (x_term_init):
1593 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
1594 * editfns.c (initial_tz): Move static var decl up.
1595 (tzvalbuf_in_environ): New static var.
1596 (init_editfns): Initialize these two static vars.
1597 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
1598 Save old TZ value on stack, if it's small.
1599 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
1600 instead, use xputenv+unsetenv to set and restore TZ.
1601 (environbuf): Remove static var. All uses removed.
1602 (Fset_time_zone_rule): Do not save TZ and environ;
1603 no longer needed here.
1604 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
1605 Move to inside set_time_zone_rule; they don't need file scope any more.
1606 (set_time_zone_rule): Maintain the TZ=value string separately.
1607 (syms_of_editfns): Don't initialize initial_tz;
1608 init_editfns now does it.
1609 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
1610 * lisp.h (xputenv): New decl.
1611
1612 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
1613
1614 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
1615
1616 2012-12-08 Eli Zaretskii <eliz@gnu.org>
1617
1618 * w32.c (unsetenv, sys_putenv): New functions.
1619
1620 2012-12-08 Chong Yidong <cyd@gnu.org>
1621
1622 * editfns.c (Finsert_char): Make the error message more
1623 informative (Bug#12992).
1624
1625 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1626
1627 Simplify get_lim_data.
1628 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
1629 Remove USG and vlimit methods; no longer used these days.
1630 Add #error catchall just in case.
1631
1632 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
1633 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
1634 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
1635 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
1636 (deleted_pid_list, Fdelete_process, create_process)
1637 (record_child_status_change, handle_child_signal, deliver_child_signal)
1638 (init_process_emacs, syms_of_process):
1639 Assume SIGCHLD is defined.
1640 (parse_signal): Remove. All uses removed.
1641 (abbr_to_signal): New static function.
1642 (Fsignal_process): Use it to convert signal names to ints.
1643 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
1644 kill (getpgrp (), ...).
1645 (emacs_sigaction_init): Assume SIGCHLD is defined.
1646 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
1647 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
1648 * syssignal.h (EMACS_KILLPG): Remove.
1649 All uses replaced by 'kill' with a negative pid.
1650 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
1651 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
1652
1653 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
1654
1655 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
1656 This will cause a production Emacs to dump core instead of
1657 infinite-looping.
1658
1659 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1660
1661 * frame.c (make_frame): Do not set window's buffer to t.
1662 * window.c (Fsplit_window_internal): Likewise. Previously it was
1663 used to indicate that the window is being set up. Now we use
1664 set_window_buffer for all new windows, so the condition in ...
1665 (Fset_window_buffer): ... is always true and can be removed.
1666
1667 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1668
1669 Convenient macro to check whether the buffer is hidden.
1670 * buffer.h (BUFFER_HIDDEN_P): New macro.
1671 * frame.c (make_frame): Use it. Adjust comment.
1672 * buffer.c (candidate_buffer): New function.
1673 (Fother_buffer, other_buffer_safely): Use it.
1674
1675 2012-12-06 Eli Zaretskii <eliz@gnu.org>
1676
1677 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
1678 if the child process is still running. Instead, exit the wait
1679 loop and return zero. (Bug#13086)
1680
1681 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1682
1683 * frame.h (x_char_width, x_char_height): Remove prototypes.
1684 * w32term.h (x_char_width, x_char_height): Likewise.
1685 * xfns.c (x_char_width, x_char_height): Remove.
1686 * w32fns.c (x_char_width, x_char_height): Likewise.
1687 * nsfns.c (x_char_width, x_char_height): Likewise.
1688 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
1689 all window frames.
1690 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
1691 * keyboard.c (command_loop_1): Remove prototype.
1692 (command_loop_2, top_level_1): Add static to match prototype.
1693
1694 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
1695
1696 Fix a recently-introduced delete-process race condition.
1697 * callproc.c, process.h (record_kill_process):
1698 New function, containing part of the old call_process_kill.
1699 (call_process_kill): Use it.
1700 This does not change call_process_kill's behavior.
1701 * process.c (Fdelete_process): Use record_kill_process to fix a
1702 race condition that could cause Emacs to lose track of a child.
1703
1704 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1705
1706 Avoid code duplication between prev_frame and next_frame.
1707 * frame.c (candidate_frame): New function. Add comment.
1708 (prev_frame, next_frame): Use it. Adjust comment.
1709
1710 2012-12-06 Eli Zaretskii <eliz@gnu.org>
1711
1712 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
1713 fails, signal an error instead of continuing with an empty
1714 string. (Bug#13079)
1715 Encode expanded temp file pattern before passing it to mkstemp or
1716 mktemp.
1717
1718 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
1719 Encode the file name before passing it to dostounix_filename, in
1720 case it will downcase it (under w32-downcase-file-names).
1721 (Bug#12933)
1722
1723 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
1724
1725 Minor call-process cleanups.
1726 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
1727 at the same time as other platforms, to simplify analysis.
1728 No need for fd0_volatile since we have synch_process_fd.
1729 Avoid needless emacs_close; arg is always negative.
1730
1731 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
1732
1733 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
1734 processes.
1735
1736 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
1737
1738 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
1739 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
1740 and mouse_face_hidden members to a bitfields.
1741 * frame.h (struct frame): Remove set-but-not-used space_width member.
1742 (FRAME_SPACE_WIDTH): Remove.
1743 * nsterm.m, w32term.c, xterm.c: Adjust users.
1744 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
1745 member. Adjust users. Convert term_initted, delete_in_insert_mode,
1746 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
1747 members to a bitfields.
1748
1749 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
1750
1751 Don't let call-process be a zombie factory (Bug#12980).
1752 Fixing this bug required some cleanup of the signal-handling code.
1753 As a side effect, this change also fixes a longstanding rare race
1754 condition whereby Emacs could mistakenly kill unrelated processes,
1755 and it fixes a bug where a second C-g does not kill a recalcitrant
1756 synchronous process in GNU/Linux and similar platforms.
1757 The patch should also fix the last vestiges of Bug#9488,
1758 a bug which has mostly been fixed on the trunk by other changes.
1759 * callproc.c, process.h (synch_process_alive, synch_process_death)
1760 (synch_process_termsig, sync_process_retcode):
1761 Remove. All uses removed, to simplify analysis and so that
1762 less consing is done inside critical sections.
1763 * callproc.c (call_process_exited): Remove. All uses replaced
1764 with !synch_process_pid.
1765 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
1766 These take the role of what used to be in unwind-protect arg.
1767 All uses changed.
1768 (block_child_signal, unblock_child_signal):
1769 New functions, to avoid races that could kill innocent-victim processes.
1770 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
1771 (call_process_kill): Record killed processes as deleted, so that
1772 zombies do not clutter up the system. Do this inside a critical
1773 section, to avoid a race that would allow the clutter.
1774 (call_process_cleanup): Fix code so that the second C-g works again
1775 on common platforms such as GNU/Linux.
1776 (Fcall_process): Create the child process in a critical section,
1777 to fix a race condition. If creating an asynchronous process,
1778 record it as deleted so that zombies do not clutter up the system.
1779 Do unwind-protect for WINDOWSNT too, as that's simpler in the
1780 light of these changes. Omit unnecessary call to emacs_close
1781 before failure, as the unwind-protect code does that.
1782 * callproc.c (call_process_cleanup):
1783 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
1784 * process.c (record_deleted_pid): New function, containing
1785 code refactored out of Fdelete_process.
1786 (Fdelete_process): Use it.
1787 (process_status_retrieved): Remove. All callers changed to use
1788 child_status_change.
1789 (record_child_status_change): Remove, folding its contents into ...
1790 (handle_child_signal): ... this signal handler. Now, this
1791 function is purely a handler for SIGCHLD, and is not called after
1792 a synchronous waitpid returns; the synchronous code is moved to
1793 wait_for_termination. There is no need to worry about reaping
1794 more than one child now.
1795 * sysdep.c (get_child_status, child_status_changed): New functions.
1796 (wait_for_termination): Now takes int * status and bool
1797 interruptible arguments, too. Do not record child status change;
1798 that's now the caller's responsibility. All callers changed.
1799 Reimplement in terms of get_child_status.
1800 (wait_for_termination_1, interruptible_wait_for_termination):
1801 Remove. All callers changed to use wait_for_termination.
1802 * syswait.h: Include <stdbool.h>, for bool.
1803 (record_child_status_change, interruptible_wait_for_termination):
1804 Remove decls.
1805 (record_deleted_pid, child_status_changed): New decls.
1806 (wait_for_termination): Adjust to API changes noted above.
1807
1808 * bytecode.c, lisp.h (Qbytecode): Remove.
1809 No longer needed after 2012-11-20 interactive-p changes.
1810
1811 2012-12-03 Eli Zaretskii <eliz@gnu.org>
1812
1813 * xdisp.c (redisplay_window): If the cursor is visible, but inside
1814 the scroll margin, move point outside the margin. (Bug#13055)
1815
1816 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
1817
1818 * gtkutil.c (my_log_handler): New function.
1819 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
1820
1821 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1822
1823 * lisp.h (modify_region): Rename to...
1824 (modify_region_1): ...new prototype.
1825 * textprop.c (modify_region): Now static. Adjust users.
1826 * insdel.c (modify_region): Rename to...
1827 (modify_region_1): ...new function to work with current buffer.
1828 Adjust comment and users. Use true and false for booleans.
1829
1830 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1831
1832 * alloc.c (free_save_value): New function.
1833 (safe_alloca_unwind): Use it.
1834 * lisp.h (free_save_value): New prototype.
1835 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
1836 Add comment.
1837 (save_excursion_restore): Adjust to match saved data structure.
1838 Use free_save_value to offload some work from GC. Drop obsolete
1839 #if 0 code.
1840
1841 2012-12-03 Chong Yidong <cyd@gnu.org>
1842
1843 * fileio.c (Vauto_save_list_file_name): Doc fix.
1844
1845 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
1846
1847 * w32fns.c: Remove prototype of atof.
1848 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
1849 builds.
1850 (file_dialog_callback): Make it UINT_PTR.
1851
1852 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
1853 with 64-bit builds.
1854
1855 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1856 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
1857 defined.
1858
1859 2012-12-03 Glenn Morris <rgm@gnu.org>
1860
1861 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
1862
1863 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
1864
1865 Fix xpalloc confusion after memory is exhausted.
1866 * alloc.c (xpalloc): Comment fix.
1867 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
1868 and signals an error, do not clear charset_table_size, as
1869 charset_table is still valid.
1870 * doprnt.c (evxprintf): Clear *BUF after freeing it.
1871
1872 Use execve to avoid need to munge environ (Bug#13054).
1873 * callproc.c (Fcall_process):
1874 * process.c (create_process):
1875 Don't save and restore environ; no longer needed.
1876 * callproc.c (child_setup):
1877 Use execve, not execvp, to preserve environ.
1878
1879 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
1880
1881 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
1882
1883 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1884
1885 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
1886 display for sliced images (Bug#10500).
1887
1888 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
1889
1890 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
1891
1892 * doc.c (Fdocumentation): Re-add handling of function-documentation,
1893 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
1894
1895 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
1896
1897 * xdisp.c (window_outdated): Remove eassert since it hits
1898 some suspicious corner cases (see Bug#13007 and Bug#13012).
1899 (mode_line_update_needed): New function.
1900 (redisplay_internal, redisplay_window): Use it.
1901 (ensure_selected_frame): New function.
1902 (redisplay_internal, unwind_redisplay): Use it.
1903 (redisplay_internal): Move comment about buffer_shared...
1904 (buffer_shared_and_changed): ...near to its real use.
1905
1906 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
1907
1908 * callproc.c (Fcall_process): Don't misreport vfork failure.
1909
1910 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
1911
1912 * callproc.c (Fcall_process): Fix vfork portability problems.
1913 Do not assume that fd[0], count, filefd, and save_environ survive
1914 vfork. Fix bug whereby wrong errno value could be reported for
1915 pipe failure. Some minor cleanups, too, as follows. Move buf and
1916 bufsize to the context where they're needed. Change new_argv to
1917 be of type char **, as this is more convenient and avoids casts.
1918 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
1919 Now local constants, not macros.
1920
1921 2012-11-18 Kenichi Handa <handa@gnu.org>
1922
1923 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
1924 for the variable "f".
1925
1926 2012-11-13 Kenichi Handa <handa@gnu.org>
1927
1928 * font.c (font_unparse_xlfd): Exclude special characters from the
1929 generating XLFD name.
1930
1931 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
1932
1933 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
1934 * dired.c (stat_uname, stat_gname):
1935 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
1936
1937 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
1938 * dired.c (directory_files_internal, file_name_completion):
1939 Assume EAGAIN and EINTR are defined.
1940
1941 * fileio.c (Fcopy_file): Assume EISDIR is defined.
1942 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
1943 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
1944 * lread.c (readbyte_from_file): Assume EINTR is defined.
1945 * process.c (wait_reading_process_output, send_process) [subprocesses]:
1946 Assume EIO and EAGAIN are defined.
1947 * unexcoff.c (write_segment): Assume EFAULT is defined.
1948
1949 2012-11-27 Eli Zaretskii <eliz@gnu.org>
1950
1951 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
1952 (Bug#11964)
1953
1954 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
1955 highlighting on the frame was cleared. Prevents assertion
1956 violations when repeatedly clicking on the "Top" link of the
1957 "bread-crumbs" in Info buffers.
1958
1959 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
1960
1961 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
1962
1963 2012-11-24 Ken Brown <kbrown@cornell.edu>
1964
1965 * keyboard.c (HAVE_MOUSE):
1966 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
1967 were always defined.
1968
1969 2012-11-24 Eli Zaretskii <eliz@gnu.org>
1970
1971 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
1972 between bpos_covered and bpos_max. This fixes cursor display when
1973 several display strings follow each other.
1974
1975 * .gdbinit (pgx): If the glyph's object is a string, display the
1976 pointer to string data, rather than the value of the string object
1977 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
1978
1979 * indent.c (Fvertical_motion): If the starting position is covered
1980 by a display string, return to one position before that, to avoid
1981 overshooting it inside move_it_to. (Bug#12930)
1982
1983 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
1984
1985 * frame.h (struct frame): Remove display_preempted member
1986 since all users are dead long ago.
1987 * nsterm.h (struct x_output): Use the only dummy member.
1988 * w32menu.c (pending_menu_activation): Remove since not
1989 really used.
1990 (set_frame_menubar): Adjust user.
1991 * w32term.h (struct x_output): Drop outdated #if 0 code.
1992 (struct w32_output): Use bitfields for explicit_parent,
1993 asked_for_visible and menubar_active members.
1994 Drop unused pending_menu_activation member.
1995 * xterm.h (struct x_output): Drop outdated #if 0 code.
1996 Use bitfields for explicit_parent, asked_for_visible,
1997 has_been_visible and net_wm_state_hidden_seen members.
1998
1999 2012-11-23 Eli Zaretskii <eliz@gnu.org>
2000
2001 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2002 of a literal "/". (Bug#12955)
2003 (gl-stamp): Invoke fc.exe directly, not through cmd.
2004
2005 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2006
2007 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2008 * dired.c: Assume HAVE_DIRENT_H.
2009 (NAMLEN): Remove, replacing with ...
2010 (dirent_namelen): New function. All uses changed. Use the GNU macro
2011 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2012 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2013 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2014 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2015 $(NT_INC)/dirent.h.
2016 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2017 * ndir.h: Rename to ../nt/inc/dirent.h.
2018 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2019 Do not include <dirent.h>; no longer needed.
2020 * w32.c: Include <dirent.h> rather than "ndir.h".
2021
2022 2012-11-23 Chong Yidong <cyd@gnu.org>
2023
2024 * xftfont.c (xftfont_open): Remove duplicate assignment.
2025
2026 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2027
2028 * alloc.c (Fgarbage_collect): Unblock input after clearing
2029 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2030 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2031 * msdos.c (IT_frame_up_to_date): Use it here...
2032 * w32term.c (w32_frame_up_to_date): ...here...
2033 * xterm.c (XTframe_up_to_date): ...and here...
2034 * nsterm.m (ns_frame_up_to_date): ...but not here.
2035 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2036 Adjust users.
2037 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2038 Do not check whether GC is in progress.
2039
2040 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2041
2042 * xdisp.c (window_buffer_changed): New function.
2043 (update_menu_bar, update_tool_bar): Use it to
2044 simplify large 'if' statements.
2045 (redisplay_internal): Generalize commonly used
2046 'tail' and 'frame' local variables.
2047
2048 2012-11-22 Eli Zaretskii <eliz@gnu.org>
2049
2050 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2051 with Windows system header.
2052
2053 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2054
2055 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2056 * alloc.c: Assume unistd.h exists.
2057 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2058 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2059 (getwd) [USG]: Remove; no longer needed.
2060 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2061 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2062 * w32.h (getcwd): Remove decl.
2063
2064 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2065
2066 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2067 Make it set selected_window as well.
2068 (update_tool_bar): Use it.
2069
2070 2012-11-21 Ken Brown <kbrown@cornell.edu>
2071
2072 * emacs.c (main): Set the G_SLICE environment variable for all
2073 Cygwin builds, not just GTK builds. See
2074 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2075
2076 2012-11-21 Eli Zaretskii <eliz@gnu.org>
2077
2078 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2079 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2080 Define for the MSVC compiler.
2081
2082 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
2083
2084 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2085 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2086 dostounix_filename. Prevents crashes down the road, because
2087 dostounix_filename assumes it gets a unibyte string.
2088 Reported by Michel de Ruiter <michel@sentient.nl>, see
2089 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2090
2091 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2092
2093 Conflate Qnil and Qunbound for `symbol-function'.
2094 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2095 * lread.c (init_obarray): Set `function' fields to Qnil.
2096 * eval.c (Fcommandp): Ignore Qunbound.
2097 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2098 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2099 Test NILP rather than Qunbound.
2100 (Ffmakunbound): Set to Qnil.
2101 (Fsymbol_function): Never signal an error.
2102 (Finteractive_form): Ignore Qunbound.
2103
2104 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2105
2106 * eval.c (interactive_p): Remove no-longer-used decl.
2107
2108 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2109
2110 * xdisp.c (buffer_shared): Adjust comment.
2111 (buffer_shared_and_changed): New function.
2112 (prepare_menu_bars, redisplay_internal): Use it to
2113 decide whether all windows or frames should be updated.
2114 (window_outdated): New function.
2115 (text_outside_line_unchanged_p, redisplay_window): Use it.
2116 (redisplay_internal): Likewise. Fix indentation.
2117
2118 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2119
2120 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2121 (syms_of_eval): Remove corresponding defsubr.
2122 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2123
2124 2012-11-19 Daniel Colascione <dancol@dancol.org>
2125
2126 * w32fns.c (Fx_file_dialog):
2127 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2128 cygwin_convert_file_name*.
2129
2130 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2131 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2132
2133 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2134
2135 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2136
2137 2012-11-18 Eli Zaretskii <eliz@gnu.org>
2138
2139 * w32select.c: Include w32common.h before w32term.h, so that
2140 windows.h gets included before w32term.h uses some of its
2141 features, see below.
2142
2143 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2144 New typedefs.
2145 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2146 New prototypes.
2147 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2148
2149 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
2150
2151 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2152 (ns_select): Return at once if events are held (Bug#12834).
2153
2154 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
2155
2156 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2157 Needed following 2012-10-20 change. (Bug#12902)
2158
2159 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
2160
2161 * w32proc.c (waitpid): Remove unused label get_result.
2162
2163 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
2164
2165 * makefile.w32-in (SYSWAIT_H): New macro.
2166 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2167 ($(BLD)/sysdep.$(O)): Update dependencies.
2168
2169 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2170
2171 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2172 * callproc.c (relocate_fd): Assume F_DUPFD.
2173 * emacs.c, term.c (O_RDWR): Remove.
2174 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2175 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2176 * nsterm.m: Assume <fcntl.h> exists.
2177 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2178 (create_pty, Fmake_network_process, server_accept_connection)
2179 (wait_reading_process_output, init_process_emacs):
2180 Assume O_NONBLOCK.
2181 (wait_reading_process_output): Put in a special case for WINDOWSNT
2182 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2183 It's not clear this is needed, but it's a more-conservative change.
2184 (create_process): Assume FD_CLOEXEC.
2185 (create_process, create_pty): Assume O_NOCTTY.
2186 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2187 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2188 Omit if not DOS_NT, since F_GETFL is not defined there.
2189 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2190 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2191 (O_NOCTTY): Remove.
2192 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2193 lack it, since gnulib guarantees this.
2194 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2195
2196 2012-11-17 Eli Zaretskii <eliz@gnu.org>
2197
2198 * w32.c (faccessat): Pretend that directories have the execute bit
2199 set. Emacs expects that, e.g., in files.el:cd-absolute.
2200
2201 * w32proc.c (create_child): Don't clip the PID of the child
2202 process to fit into an Emacs integer, as this is no longer a
2203 restriction.
2204 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2205 reaping only the process specified by PID argument, if that is
2206 positive. Use PID instead of dead_child to know which process to
2207 reap. Wait for the child to die only if WNOHANG is not in
2208 OPTIONS.
2209 (sys_select): Don't set dead_child.
2210
2211 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2212 as it is no longer needed.
2213
2214 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2215 no longer needed.
2216 (record_child_status_change): Remove the setting of
2217 record_at_most_one_child for the !WNOHANG case.
2218
2219 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2220
2221 Fix problems in ns port found by static checking.
2222 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
2223 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
2224 not to process group.
2225 (ns_select): Use emacs_write, not write, as that's more robust
2226 in the presence of signals.
2227 (fd_handler:): Check for read errors.
2228
2229 2012-11-16 Glenn Morris <rgm@gnu.org>
2230
2231 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
2232
2233 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
2234
2235 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
2236
2237 2012-11-16 Eli Zaretskii <eliz@gnu.org>
2238
2239 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
2240 use the same value of thread handle.
2241 (start_timer_thread): If the timer thread exited (due to error),
2242 clean up by closing the two handles it used. Duplicate the caller
2243 thread's handle here, so it gets duplicated only once, when
2244 launching the timer thread. Set priority of the timer thread, not
2245 the caller thread.
2246 (getitimer): Don't duplicate the caller thread's handle here.
2247 (Bug#12832)
2248
2249 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
2250
2251 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
2252 called (Bug#12834).
2253
2254 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
2255
2256 Remove no-longer-used pty_max_bytes variable.
2257 * process.c (pty_max_bytes): Remove; unused.
2258 (send_process): Do not set it.
2259
2260 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
2261
2262 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
2263 Update dependencies.
2264
2265 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
2266
2267 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
2268 This follows up on the 2012-09-29 patch that removed indirection
2269 for the 'function' field. Reported by Sergey Vinokurov in
2270 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
2271
2272 2012-11-14 Eli Zaretskii <eliz@gnu.org>
2273
2274 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
2275 different name, as the MS runtime does not have such a function,
2276 and probably never will.) All callers changed. Ignore DIRFD
2277 value if PATH is an absolute file name, to match Posix spec
2278 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
2279 symlinks.
2280
2281 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
2282
2283 * xdisp.c (echo_area_display, redisplay_internal):
2284 Omit redundant check whether frame_garbaged is set.
2285
2286 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
2287
2288 Use faccessat, not access, when checking file permissions (Bug#12632).
2289 This fixes a bug that has been present in Emacs since its creation.
2290 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
2291 which must set some sort of record. (Torek's bug report was against
2292 a predecessor of GNU Emacs, but GNU Emacs happened to have the
2293 same common flaw.) See Torek's Usenet posting
2294 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
2295 Posted: Fri Apr 8 14:18:56 1983.
2296 * Makefile.in (LIB_EACCESS): New macro.
2297 (LIBES): Use it.
2298 * callproc.c (init_callproc):
2299 * charset.c (init_charset):
2300 * fileio.c (check_existing, check_executable, check_writable)
2301 (Ffile_readable_p):
2302 * lread.c (openp, load_path_check):
2303 * process.c (allocate_pty):
2304 * xrdb.c (file_p):
2305 Use effective UID when checking permissions, not real UID.
2306 * callproc.c (init_callproc):
2307 * charset.c (init_charset):
2308 * lread.c (load_path_check, init_lread):
2309 Test whether directories are accessible, not merely whether they exist.
2310 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
2311 * fileio.c (check_existing, check_executable, check_writable)
2312 (Ffile_readable_p):
2313 Use symbolic names instead of integers for the flags, as they're
2314 portable now.
2315 (check_writable): New arg AMODE. All uses changed.
2316 Set errno on failure.
2317 (Ffile_readable_p): Use faccessat, not stat + open + close.
2318 (Ffile_writable_p): No need to call check_existing + check_writable.
2319 Just call check_writable and then look at errno. This saves a syscall.
2320 dir should never be nil; replace an unnecessary runtime check
2321 with an eassert. When checking the parent directory of a nonexistent
2322 file, check that the directory is searchable as well as writable, as
2323 we can't create files in unsearchable directories.
2324 (file_directory_p): New function, which uses 'stat' on most platforms
2325 but faccessat with D_OK (for efficiency) if WINDOWSNT.
2326 (Ffile_directory_p, Fset_file_times): Use it.
2327 (file_accessible_directory_p): New function, which uses a single
2328 syscall for efficiency.
2329 (Ffile_accessible_directory_p): Use it.
2330 * xrdb.c (file_p): Use file_directory_p.
2331 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
2332 * lread.c (openp): When opening a file, use fstat rather than
2333 stat, as that avoids a permissions race. When not opening a file,
2334 use file_directory_p rather than stat.
2335 (dir_warning): First arg is now a usage string, not a format.
2336 Use errno. All uses changed.
2337 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
2338 that merely introduced a race.
2339 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
2340 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
2341 and similarly for the other O_* flags.
2342 * w32.c (sys_faccessat): Rename from sys_access and switch to
2343 faccessat's API. All uses changed.
2344 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
2345 (magic_db): Rename from magic_file_p.
2346 (magic_db, search_magic_path): Return an XrmDatabase rather than a
2347 char *, so that we don't have to test for file existence
2348 separately from opening the file for reading. This removes a race
2349 fixes a permission-checking problem, and simplifies the code.
2350 All uses changed.
2351 (file_p): Remove; no longer needed.
2352
2353 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
2354
2355 Omit glyphs initialization at startup.
2356 * dispnew.c (glyphs_initialized_initially_p): Remove.
2357 (adjust_frame_glyphs_initially): Likewise. Adjust users.
2358 (Fredraw_frame): Move actual code from here...
2359 (redraw_frame): ...to here. Add eassert. Adjust comment.
2360 (Fredraw_display): Use redraw_frame.
2361 * xdisp.c (clear_garbaged_frames): Likewise.
2362
2363 2012-11-13 Eli Zaretskii <eliz@gnu.org>
2364
2365 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
2366 passed to pint2str and pint2hrstr to be at most the size of the
2367 frame's decode_mode_spec_buffer. This avoids crashes with very
2368 large values of FIELD_WIDTH argument to decode_mode_spec.
2369 (Bug#12867)
2370
2371 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
2372
2373 Fix a race with verify-visited-file-modtime (Bug#12863).
2374 Since at least 1991 Emacs has ignored an mtime difference of no
2375 more than one second, but my guess is that this was to work around
2376 file system bugs that were fixed long ago. Since the race is
2377 causing problems now, let's remove that code.
2378 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
2379 whose time stamp is off by no more than a second. Insist that the
2380 file time stamps match exactly.
2381
2382 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2383
2384 * frame.h (struct frame): Convert external_tool_bar member to
2385 1-bit unsigned bitfield.
2386 * termhooks.h (struct terminal): Remove mouse_moved member since
2387 all users are long dead. Adjust comment on mouse_position_hook.
2388
2389 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2390
2391 Simplify by using FOR_EACH_FRAME here and there.
2392 * frame.c (next_frame, prev_frame, other_visible_frames)
2393 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
2394 * w32term.c (x_window_to_scroll_bar): Likewise.
2395 * window.c (window_list): Likewise.
2396 * xdisp.c (x_consider_frame_title): Likewise.
2397 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
2398 * xfns.c (x_window_to_frame, x_any_window_to_frame)
2399 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
2400 * xmenu.c (menubar_id_to_frame): Likewise.
2401 * xselect.c (frame_for_x_selection): Likewise.
2402 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
2403 (x_window_to_menu_bar): Likewise.
2404 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
2405
2406 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
2407
2408 * data.c (Qdefalias_fset_function): Now static.
2409
2410 Another tweak to vectorlike_header change.
2411 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
2412 Remove, and replace all uses with ...
2413 (next_in_free_list, set_next_in_free_list):
2414 New functions, which respect C's aliasing rules better.
2415
2416 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
2417
2418 * window.c (list4i): Rename from 'quad'. All uses changed.
2419 Needed because <sys/types.h> defines 'quad' on Solaris 10.
2420
2421 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
2422
2423 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
2424 warning about mixing declarations and code in ISO C90.
2425
2426 2012-11-10 Martin Rudalics <rudalics@gmx.at>
2427
2428 * window.c (Fsplit_window_internal): Set combination limit of
2429 new parent window to t iff Vwindow_combination_limit is t;
2430 fixing a regression introduced with the change from 2012-09-22.
2431 (Fset_window_combination_limit): Fix doc-string.
2432
2433 2012-11-10 Eli Zaretskii <eliz@gnu.org>
2434
2435 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
2436 amount when the scroll margins are too large. When scrolling
2437 backwards in the buffer, give up if cannot reach point or the
2438 scroll margin within a reasonable number of screen lines.
2439 Fixes point position in window under scroll-up/down-aggressively when
2440 point is positioned many lines beyond the window top/bottom.
2441 (Bug#12811)
2442
2443 * ralloc.c (relinquish): If real_morecore fails to return memory
2444 to the system, don't crash; instead, leave the last heap
2445 unchanged and return. (Bug#12774)
2446
2447 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2448
2449 * lisp.h (AUTOLOADP): New macro.
2450 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
2451 * data.c (Ffset): Remove special ad-advice-info handling.
2452 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
2453 (Fsubr_arity): CSE.
2454 (Finteractive_form): Simplify.
2455 (Fquo): Don't insist on having at least 2 arguments.
2456 (Qdefalias_fset_function): New var.
2457
2458 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2459
2460 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
2461
2462 * nsfont.m (Qcondensed, Qexpanded): New variables.
2463 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
2464 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
2465
2466 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2467
2468 Fix recently introduced crash on MS-Windows (Bug#12839).
2469 * w32term.h (struct scroll_bar): Use convenient header.
2470 (SCROLL_BAR_VEC_SIZE): Remove.
2471 * w32term.c (x_scroll_bar_create): Use VECSIZE.
2472
2473 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2474
2475 Tweak last vectorlike_header change.
2476 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
2477 vectorlike object on the free list. This is introduced to avoid
2478 some (but not all) pointer casting and aliasing problems, see
2479 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
2480 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
2481 objects.
2482 (xvectype, xvecsize): Use them to examine Lisp_Object values.
2483
2484 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2485
2486 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
2487 been removed, so remove them here also.
2488
2489 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2490
2491 * doc.c (Fdocumentation): Handle new property
2492 dynamic-docstring-function to replace the old ad-advice-info.
2493
2494 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
2495
2496 * fns.c (Qeql, hashtest_eq): Now static.
2497
2498 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2499
2500 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
2501 * fns.c (hashfn_eq, hashfn_eql, sxhash):
2502 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
2503 * buffer.c (compare_overlays): Use XLI rather than XHASH.
2504
2505 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
2506
2507 Use same hash function for hashfn_profiler as for hash_string etc.
2508 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
2509 * lisp.h (sxhash_combine): New inline function, with the contents
2510 of the old SXHASH_COMBINE.
2511 * profiler.c (hashfn_profiler): Use it, instead of having a
2512 special hash function containing a comparison that always yields 1.
2513
2514 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2515
2516 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
2517 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
2518 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
2519 Remove unused vars.
2520
2521 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
2522
2523 * image.c (xpm_make_color_table_h): Fix compiler error because
2524 make_hash_table changed.
2525
2526 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
2527
2528 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
2529
2530 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2531
2532 Use ad-hoc comparison function for the profiler's hash-tables.
2533 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
2534 (make_log): Use them.
2535 (handle_profiler_signal): Don't inhibit quit any longer since we don't
2536 call Fequal any more.
2537 (Ffunction_equal): New function.
2538 (cmpfn_profiler, hashfn_profiler): New functions.
2539 (syms_of_profiler): Initialize them.
2540 * lisp.h (struct hash_table_test): New struct.
2541 (struct Lisp_Hash_Table): Use it.
2542 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
2543 * fns.c (make_hash_table): Take a struct to describe the test.
2544 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
2545 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
2546 (hash_lookup, hash_remove_from_table): Move assertion checking of
2547 hashfn result here. Check hash-equality before calling cmpfn.
2548 (Fmake_hash_table): Adjust call to make_hash_table.
2549 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
2550 (syms_of_fns): Initialize them.
2551 * emacs.c (main): Move syms_of_fns earlier.
2552 * xterm.c (syms_of_xterm):
2553 * category.c (hash_get_category_set): Adjust call to make_hash_table.
2554 * print.c (print_object): Adjust to new hash-table struct.
2555 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
2556
2557 2012-11-08 Eli Zaretskii <eliz@gnu.org>
2558
2559 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
2560 value of w32-scroll-lock-modifier is neither nil nor one of the
2561 known key modifiers. (Bug#12806)
2562
2563 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2564
2565 Shrink struct vectorlike_header to the only size field.
2566 * lisp.h (enum pvec_type): Avoid explicit enum member values.
2567 Adjust comment.
2568 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
2569 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
2570 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
2571 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
2572 information from the vector header. Adjust comment.
2573 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
2574 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
2575 layout.
2576 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
2577 (struct vectorlike_header): Remove next member. Adjust comment.
2578 (struct Lisp_Subr): Add convenient header. Adjust comment.
2579 (allocate_pseudovector): Adjust prototype.
2580 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
2581 (sweep_string, lisp_malloc): Remove useless prototypes.
2582 (enum mem_type): Adjust comment.
2583 (NEXT_IN_FREE_LIST): New macro.
2584 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
2585 (Fmake_bool_vector): Likewise.
2586 (struct large_vector): New type to represent allocation unit for
2587 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
2588 (large_vectors): Change type to struct large_vector.
2589 (allocate_vector_from_block): Simplify.
2590 (PSEUDOVECTOR_NBYTES): Replace with...
2591 (vector_nbytes): ...new function. Adjust users.
2592 (sweep_vectors): Adjust processing of large vectors.
2593 (allocate_vectorlike): Likewise.
2594 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
2595 Add easserts. Adjust XSETPVECTYPESIZE usage.
2596 (allocate_buffer): Use BUFFER_PVEC_INIT.
2597 (live_vector_p): Adjust to match large vector.
2598 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
2599 * buffer.h (struct buffer): Add next member.
2600 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
2601 New macros.
2602 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
2603 * fns.c (internal_equal): Adjust to match enum pvec_type change.
2604 (copy_hash_table): Adjust to match vector header change.
2605 * lread.c (defsubr): Use XSETPVECTYPE.
2606 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
2607 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
2608 (xvecsize): New command.
2609
2610 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2611
2612 * keyboard.c (event_to_kboard): Do not dereference
2613 frame_or_window field of SELECTION_REQUEST_EVENT
2614 and SELECTION_CLEAR_EVENT events (Bug#12814).
2615 * xterm.h (struct selection_input_event): Adjust comment.
2616
2617 2012-11-07 Eli Zaretskii <eliz@gnu.org>
2618
2619 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
2620 such as Scroll Lock, if the respective keys are treated as
2621 function keys, not as modifiers. This avoids destroying non-ASCII
2622 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
2623
2624 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
2625
2626 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
2627
2628 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2629
2630 Restore some duplicate definitions (Bug#12814).
2631 This undoes part of the 2012-11-03 changes. Some people build
2632 with plain -g rather than with -g3, and they need the duplicate
2633 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
2634 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
2635 Define as macros, as well as as enums or as constants.
2636
2637 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
2638
2639 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
2640 to keypad keys (Bug#12816).
2641
2642 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2643
2644 Minor adjustments of recently-changed frame functions.
2645 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
2646 known to be a frame (we're in the FRAMEP branch).
2647 * lisp.h (Qframep): Remove decl. frame.h declares this.
2648 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
2649 since they're meant for Lisp fixnum values.
2650
2651 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2652
2653 * window.c (Fwindow_combination_limit): Revert to the only
2654 required argument and adjust docstring as suggested in
2655 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
2656 by Martin Rudalics <rudalics@gmx.at>.
2657
2658 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2659
2660 Widely used frame validity and checking functions.
2661 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
2662 * frame.c (decode_live_frame, decode_any_frame): New functions.
2663 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
2664 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
2665 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
2666 (Fframe_pointer_visible_p): Use decode_any_frame.
2667 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
2668 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
2669 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
2670 (Fframe_focus): Likewise. Allow zero number of arguments.
2671 Adjust docstring.
2672 (frame_buffer_list, frame_buffer_predicate): Remove.
2673 * lisp.h (frame_buffer_predicate): Remove prototype.
2674 * buffer.c (Fother_buffer): Use decode_any_frame.
2675 * xdisp.c (Ftool_bar_lines_needed): Likewise.
2676 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
2677 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
2678 (Fclose_font, Ffont_info): Use decode_live_frame.
2679 * fontset.c (check_fontset_name): Likewise.
2680 * terminal.c (Fframe_terminal): Likewise.
2681 * w32fns.c (check_x_frame): Likewise.
2682 * window.c (Fminibuffer_window, Fwindow_at)
2683 (Fcurrent_window_configuration): Likewise.
2684 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
2685 Likewise. Allow zero number of arguments. Adjust docstring.
2686 * dispnew.c (Fredraw_frame): Likewise.
2687 * xfaces.c (frame_or_selected_frame): Remove.
2688 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
2689 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
2690 (Fframe_face_alist): Use decode_live_frame.
2691 * xfns.c (check_x_frame): Likewise.
2692
2693 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2694
2695 * window.c (quad): New function.
2696 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
2697 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
2698 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
2699 (Fwindow_line_height): Use it.
2700 (Fwindow_fringes): Use list3.
2701 (Fwindow_scroll_bars): Use list4.
2702 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
2703 (Fwindow_combination_limit): Allow zero number of arguments.
2704
2705 2012-11-05 Eli Zaretskii <eliz@gnu.org>
2706
2707 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
2708
2709 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
2710 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
2711 file descriptor 2 for standard error. (Bug#12805)
2712
2713 2012-11-05 Chong Yidong <cyd@gnu.org>
2714
2715 * process.c (wait_reading_process_output): Revert previous change.
2716
2717 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
2718
2719 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
2720 This removes code that has been obsolete since around 1990.
2721 * callproc.c (Fcall_process):
2722 * emacs.c (main):
2723 * process.c (create_process):
2724 * term.c (dissociate_if_controlling_tty):
2725 Assume setsid exists.
2726 * callproc.c (child_setup): Assume setpgid exists and behaves as
2727 per POSIX.1-1988 or later.
2728 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
2729 * emacs.c (shut_down_emacs):
2730 * sysdep.c (sys_suspend, init_foreground_group):
2731 Assume getpgrp behaves as per POSIX.1-1998 or later.
2732 * msdos.c (setpgrp): Remove.
2733 (tcgetpgrp, setpgid, setsid): New functions.
2734 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
2735 * term.c (no_controlling_tty): Remove; unused.
2736 * w32proc.c (setpgrp): Remove.
2737 (setsid, tcgetpgrp): New functions.
2738
2739 Simplify by assuming __fpending.
2740 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
2741 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
2742 Do not assume that __fpending's result fits in int.
2743
2744 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
2745
2746 Remove EMACS_OUTQSIZE+sleep hack.
2747 * dispnew.c (update_frame_1): Remove hack for terminals slower
2748 than 2400 bps, which throttled Emacs by having it sleep.
2749 This code hasn't worked since at least 2007, when the multi-tty stuff
2750 was added, and anyway those old terminals are long dead.
2751 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
2752 without the dispnew.c change, as dispnew.c doesn't include systty.h.
2753
2754 Fix data-loss with --version (Bug#9574).
2755 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
2756 as we can't assume that emacs_strerror is initialized, and strerror
2757 is good enough here.
2758 (main): Invoke atexit earlier, to catch earlier instances of
2759 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
2760
2761 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
2762
2763 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
2764 (keyDown): Remap keypad keys to X11 virtual key codes.
2765
2766 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
2767
2768 Fix data-loss with --batch (Bug#9574).
2769 * emacs.c: Include <close-stream.h>.
2770 (close_output_streams): New function.
2771 (main): Pass it to atexit, so that Emacs closes stdout and stderr
2772 and handles errors appropriately.
2773 (Fkill_emacs): Don't worry about flushing, as close_output_stream
2774 does that now.
2775
2776 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
2777 The symptom is a diagnostic "GLib-WARNING **: In call to
2778 g_spawn_sync(), exit status of a child process was requested but
2779 SIGCHLD action was set to SIG_IGN and ECHILD was received by
2780 waitpid(), so exit status can't be returned." The diagnostic
2781 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
2782 The real bug is a race condition between Emacs and glib: Emacs
2783 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
2784 so that glib can't find it. Work around the bug by invoking
2785 waitpid only on subprocesses that Emacs itself creates.
2786 * process.c (create_process, record_child_status_change):
2787 Don't use special value -1 in pid field, as the caller now must
2788 know the pid rather than having the callee infer it.
2789 The inference was sometimes incorrect anyway, due to another race.
2790 (create_process): Set new 'alive' member if child is created.
2791 (process_status_retrieved): New function.
2792 (record_child_status_change): Use it.
2793 Accept negative 1st argument, which means to wait for the
2794 processes that Emacs already knows about. Move special-case code
2795 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
2796 processes that have already been waited for, by testing and
2797 clearing new 'alive' member.
2798 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
2799 now does this internally.
2800 (handle_child_signal): Let record_child_status_change do all
2801 the work, since we do not want to reap all exited child processes,
2802 only the child processes that Emacs itself created.
2803 * process.h (Lisp_Process): New boolean member 'alive'.
2804
2805 Omit duplicate definitions no longer needed with gcc -g3.
2806 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
2807 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
2808 Define only as macros. There's no longer any need to also define
2809 these symbols as enums or as constants, since we now assume
2810 gcc -g3 when debugging.
2811
2812 2012-11-03 Eli Zaretskii <eliz@gnu.org>
2813
2814 * lisp.mk: Adjust comments to the fact that term/internal is now
2815 loaded from loadup.el.
2816
2817 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
2818 (msdos_fatal_signal): New function.
2819 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
2820 its argument list.
2821
2822 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
2823 for GCC versions before 4.
2824 (emacs_raise): Define to call msdos_fatal_signal.
2825
2826 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
2827 iterator when starting in the middle of a display or overlay
2828 string. (Bug#12745)
2829
2830 2012-11-03 Chong Yidong <cyd@gnu.org>
2831
2832 * process.c (wait_reading_process_output): Clean up the last
2833 change.
2834
2835 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
2836
2837 * process.c (wait_reading_process_output): Avoid a race condition
2838 with SIGIO delivery (Bug#11536).
2839
2840 2012-11-03 Chong Yidong <cyd@gnu.org>
2841
2842 * buffer.c (cursor_type): Untabify docstring.
2843
2844 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2845
2846 * frame.h (struct frame): Drop can_have_scroll_bars member
2847 which is meaningless for a long time. Adjust comments.
2848 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
2849 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
2850
2851 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2852
2853 * window.c (decode_next_window_args): Update window arg after
2854 calling decode_live_window and so fix crash reported at
2855 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
2856 by Juanma Barranquero <lekktu@gmail.com>.
2857 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
2858 * font.c (Ffont_at): Likewise.
2859
2860 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
2861
2862 * widget.c (resize_cb): New function.
2863 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
2864 (EmacsFrameResize): Check if all is up to date before changing frame
2865 size.
2866
2867 2012-11-02 Eli Zaretskii <eliz@gnu.org>
2868
2869 Implement backtrace output for fatal errors on MS-Windows.
2870 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
2871 (BACKTRACE_LIMIT_MAX): New macro.
2872 (w32_backtrace): New function.
2873 (emacs_abort): Use w32_backtrace when the user chooses not to
2874 attach a debugger. Update the text of the abort dialog.
2875
2876 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2877
2878 Window-related stuff cleanup here and there.
2879 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
2880 Use decode_any_window.
2881 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
2882 * xdisp.c (Fformat_mode_line): Likewise.
2883 * font.c (Ffont_at): Use decode_live_window.
2884 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
2885 * window.c (decode_next_window_args): Likewise.
2886 (decode_any_window): Remove static.
2887 * window.h (decode_any_window): Add prototype.
2888 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
2889 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
2890 respectively.
2891
2892 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2893
2894 Remove pad from struct input_event.
2895 * termhooks.h (struct input_event): Remove padding field.
2896 Adjust comment.
2897 * keyboard.c (event_to_kboard): Simplify because frame_or_window
2898 member is never cons for a long time. Adjust comment.
2899 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
2900 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
2901 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
2902 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
2903
2904 2012-11-01 Eli Zaretskii <eliz@gnu.org>
2905
2906 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
2907
2908 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
2909
2910 Fix crash when using Emacs as commit editor for git (Bug#12697).
2911 * callproc.c (setpgrp): Remove macro, as we now use setpgid
2912 and it is configured in conf_post.h.
2913 (Fcall_process): Don't invoke both setsid and setpgid; the former
2914 is enough, if it exists.
2915 * callproc.c (Fcall_process, child_setup):
2916 * process.c (create_process): Use setpgid.
2917 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
2918 for the real thing.
2919 * dispnew.c (init_display): Initialize the foreground group
2920 if we are running a tty display.
2921 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
2922 * lisp.h (init_foreground_group): New decl.
2923 * sysdep.c (inherited_pgroup): New static var.
2924 (init_foreground_group, tcsetpgrp_without_stopping)
2925 (narrow_foreground_group, widen_foreground_group): New functions.
2926 (init_sys_modes): Narrow foreground group.
2927 (reset_sys_modes): Widen foreground group.
2928
2929 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
2930
2931 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
2932
2933 2012-10-31 Martin Rudalics <rudalics@gmx.at>
2934
2935 * minibuf.c (read_minibuf): Restore current buffer since
2936 choose_minibuf_frame calling Fset_frame_selected_window may
2937 change it (Bug#12766).
2938
2939 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
2940
2941 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
2942
2943 2012-10-30 Kenichi Handa <handa@gnu.org>
2944
2945 * font.c (Ffont_at): If WINDOW is specified and it is not
2946 displaying the current buffer, signal an error.
2947
2948 2012-10-29 Daniel Colascione <dancol@dancol.org>
2949
2950 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
2951 In preparation for fixing bug#12739, move these functions from
2952 here...
2953
2954 * coding.h, coding.c: ... to here, and compile them only when
2955 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
2956 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
2957
2958 2012-10-28 Eli Zaretskii <eliz@gnu.org>
2959
2960 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
2961 (timer_loop, getitimer, setitimer): Use it instead of
2962 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
2963 'clock'.
2964 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
2965 literal 10000.
2966
2967 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
2968
2969 * nsterm.m (NO_APPDEFINED_DATA): New define.
2970 (last_appdefined_event_data): New variable
2971 (last_appdefined_event): Remove.
2972 (ns_select): Initialize t from last_appdefined_event_data instead
2973 of [last_appdefined_event data1].
2974 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
2975 remove last_appdefined_event (Bug#12698).
2976
2977 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2978
2979 * frame.c (x_set_font): Catch internal error.
2980
2981 2012-10-27 Eli Zaretskii <eliz@gnu.org>
2982
2983 Avoid overflow in w32 implementation of interval timers.
2984 When possible, for ITIMER_PROF count only times the main thread
2985 actually executes.
2986 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2987 'volatile ULONGLONG' types. All the other data which was
2988 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
2989 (GetThreadTimes_Proc): New typedef.
2990 (w32_get_timer_time): New function, returns a suitable time value
2991 for the timer.
2992 (timer_loop): Enter critical section when accessing ULONGLONG
2993 values of the itimer_data struct, as these accesses are no longer
2994 atomic. Call 'w32_get_timer_time' instead of 'clock'.
2995 Remove unused variable.
2996 (init_timers): Initialize s_pfn_Get_Thread_Times.
2997 (start_timer_thread): Don't assign itimer->caller_thread here.
2998 (getitimer): Assign itimer->caller_thread here.
2999 (setitimer): Always call getitimer to get the value of ticks_now.
3000 (sys_spawnve): Avoid compiler warning about format mismatch.
3001
3002 2012-10-26 Eli Zaretskii <eliz@gnu.org>
3003
3004 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3005 mouse movement events if the menu bar is active. This avoids
3006 producing a busy "hour-glass" cursor by Windows if the mouse
3007 pointer is positioned over a tooltip shown for some menu item.
3008
3009 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3010
3011 Don't assume process IDs fit in int.
3012 * emacs.c (shut_down_emacs) [!DOS_NT]:
3013 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3014 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3015 Use pid_t, not int, to store process IDs, as 'int'
3016 is not wide enough on a few platforms (e.g., AIX and IRIX).
3017
3018 2012-10-23 Kenichi Handa <handa@gnu.org>
3019
3020 The following change is to make face-font-rescale-alist work
3021 correctly for non-ASCII fonts.
3022
3023 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3024 (font_open_for_lface): Handle Vface_font_rescale_alist.
3025
3026 2012-10-23 Chong Yidong <cyd@gnu.org>
3027
3028 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3029
3030 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3031
3032 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3033 for screen font.
3034 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3035
3036 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3037 event (Bug#12681).
3038
3039 2012-10-21 Glenn Morris <rgm@gnu.org>
3040
3041 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3042
3043 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3044
3045 Port to OpenBSD 5.1.
3046 * frame.c (Fmouse_position, Fmouse_pixel_position):
3047 * xdisp.c (produce_stretch_glyph):
3048 Declare local vars only when they're needed.
3049 This is clearer and avoids a warning on OpenBSD about unused vars.
3050 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3051 This is safer, and avoids OpenBSD warnings about unused vars.
3052 * keyboard.c (record_menu_key): Remove unnecessary decl.
3053 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3054 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3055 as our definition clashes with OpenBSD's.
3056 * xfaces.c (load_face_colors, check_lface_attrs)
3057 (get_lface_attributes_no_remap, get_lface_attributes)
3058 (lface_fully_specified_p, x_supports_face_attributes_p)
3059 (tty_supports_face_attributes_p, face_fontset, realize_face)
3060 (realize_x_face, realize_tty_face):
3061 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3062 merely Lisp_Object *. This is more informative and avoids
3063 a warning on OpenBSD about accessing beyond an object's size.
3064
3065 2012-10-20 Chong Yidong <cyd@gnu.org>
3066
3067 * lread.c (Fload): Doc fix (Bug#12592).
3068
3069 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3070
3071 * font.c (Ffont_at): Fix previous change.
3072
3073 2012-10-19 Eli Zaretskii <eliz@gnu.org>
3074
3075 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3076 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
3077 for the reasons.
3078
3079 * alloc.c (NSTATICS): Decrease to 0x800.
3080
3081 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3082
3083 * fns.c (Fnreverse): Include the problem element when signaling an
3084 error (bug#12677).
3085
3086 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3087
3088 * nsterm.m (ns_select): Check writefds before call to
3089 FD_ISSET (Bug#12668).
3090
3091 2012-10-18 Daniel Colascione <dancol@dancol.org>
3092
3093 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3094 (staticpro): If we run out of staticpro slots, die with an
3095 informative error instead of just calling emacs_abort.
3096
3097 2012-10-18 Martin Rudalics <rudalics@gmx.at>
3098
3099 Fix two flaws reported by Dmitry Antipov.
3100 * window.c (Ftemp_output_buffer_show): Remove.
3101 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3102 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3103
3104 2012-10-17 Eli Zaretskii <eliz@gnu.org>
3105
3106 * makefile.w32-in ($(BLD)/w32.$(O)):
3107 ($(BLD)/vm-limit.$(O)):
3108 ($(BLD)/term.$(O)):
3109 ($(BLD)/unexw32.$(O)):
3110 ($(BLD)/fileio.$(O)):
3111 ($(BLD)/dispnew.$(O)): Update dependencies.
3112
3113 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3114 Add prototypes.
3115
3116 * w32proc.c: Include ctype.h.
3117
3118 * w32.h (init_environment, check_windows_init_file)
3119 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3120 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3121 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3122 (sys_link): Add prototypes.
3123
3124 * w32.c: Include w32select.h.
3125 (sys_access, e_malloc, sys_select): Add prototypes.
3126 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3127
3128 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3129
3130 * unexw32.c: Include lisp.h and w32.h.
3131
3132 * term.c [WINDOWSNT]: Include w32term.h.
3133
3134 * process.c [WINDOWSNT]: Add prototype of sys_select.
3135
3136 * fileio.c [WINDOWSNT]: Include w32.h.
3137
3138 * dispnew.c [WINDOWSNT]: Include w32.h.
3139
3140 * cygw32.c (Fcygwin_convert_path_to_windows)
3141 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3142 Lisp_Object values. (Bug#12661)
3143
3144 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3145 to Lisp_Object. (Bug#12661)
3146
3147 2012-10-17 Kenichi Handa <handa@gnu.org>
3148
3149 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3150 invalidate.
3151
3152 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3153
3154 * buffer.c (Fkill_buffer): When unchaining the marker,
3155 reset its buffer pointer to NULL (Bug#12652).
3156
3157 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3158
3159 Do not verify indirection counters of killed buffers (Bug#12579).
3160 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3161 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3162
3163 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3164
3165 * alloc.c (Fmake_byte_code): Fix typo in comment.
3166 * print.c (print_interval): Define as static to match prototype.
3167 * indent.c (disptab_matches_widthtab, recompute_width_table):
3168 Convert to eassert.
3169
3170 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3171
3172 * editfns.c (get_system_name): Remove.
3173 * lisp.h (get_system_name): Remove prototype.
3174 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3175 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3176
3177 2012-10-15 Daniel Colascione <dancol@dancol.org>
3178
3179 * dbusbind.c: Add comment explaining reason for previous change.
3180
3181 2012-10-15 Martin Rudalics <rudalics@gmx.at>
3182
3183 * window.c (Fwindow_end): Rewrite check whether cached position
3184 can be used (Bug#12600).
3185 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3186 Set windows_or_buffers_changed.
3187
3188 2012-10-15 Daniel Colascione <dancol@dancol.org>
3189
3190 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3191 enabled by undefining the symbol "interface", which the platform
3192 headers define to something incompatible.
3193
3194 2012-10-14 Daniel Colascione <dancol@dancol.org>
3195
3196 * image.c (init_tiff_functions, init_imagemagick_functions)
3197 (init_svg_functions): Fix cygw32 build break by using these
3198 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3199
3200 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3201
3202 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3203
3204 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3205
3206 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3207
3208 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3209
3210 * coding.c (detect_coding): Set coding->id before calling
3211 this->detector.
3212
3213 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3214
3215 * fileio.c: Formatting fixes.
3216
3217 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3218
3219 Fix some stat-related races.
3220 * fileio.c (Fwrite_region): Avoid race condition if a file is
3221 removed or renamed by some other process immediately after Emacs
3222 writes it but before Emacs stats it. Do not assume that stat (or
3223 fstat) succeeds.
3224 * image.c (slurp_file): Resolve the file name with fopen + fstat
3225 rather than stat + fopen.
3226 (pbm_read_file) [0]: Remove unused code with stat race.
3227 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
3228 Remove ineffective code with stat race.
3229
3230 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3231
3232 * doc.c (get_doc_string): Don't signal an error if the file is missing.
3233
3234 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3235
3236 * nsterm.m (hold_event_q): New static variable.
3237 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
3238 ! q_event_ptr.
3239 (hold_event): New function.
3240 (ns_read_socket): If hold_event_q have events, store them and
3241 return (Bug#12384).
3242 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
3243 is zero (Bug#12384).
3244
3245 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
3246
3247 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
3248
3249 2012-10-12 Eli Zaretskii <eliz@gnu.org>
3250
3251 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
3252
3253 * fileio.c (check_existing): New function.
3254 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
3255 instead of calling 'stat', when what's needed is to check whether
3256 a file exists. This avoids expensive system calls on MS-Windows.
3257 (Bug#12587)
3258
3259 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
3260
3261 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
3262 determine whether a file exists and is not a directory.
3263
3264 * lisp.h (check_existing): Add prototype.
3265
3266 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3267
3268 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
3269
3270 2012-10-12 Glenn Morris <rgm@gnu.org>
3271
3272 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
3273
3274 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3275
3276 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
3277
3278 * eval.c (Fautoload): Remember previous autoload status in load-history.
3279
3280 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
3283 * lread.c (load_each_byte, new_backquote_flag, readchar)
3284 (read_filtered_event, lisp_file_lexically_bound_p)
3285 (safe_to_load_version, Fload, complete_filename_p, openp)
3286 (build_load_history, readevalloop, read_escape, read1)
3287 (string_to_number, read_vector, read_list):
3288 * macros.c (Fstart_kbd_macro):
3289 * marker.c (CONSIDER):
3290 * menu.c (parse_single_submenu, digest_single_submenu)
3291 (find_and_return_menu_selection, Fx_popup_menu):
3292 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
3293 (Ftry_completion):
3294 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
3295 (ns_menu_show):
3296 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
3297 (xmenu_show, xdialog_show):
3298 Use bool for booleans.
3299 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
3300 as it's not a predicate. All uses changed. Omit unnecessary
3301 buffer termination.
3302
3303 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
3304
3305 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
3306 (save_excursion_restore): Do not restore mark if it was not saved.
3307
3308 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3309
3310 * marker.c (cached_modiff): EMACS_INT, not int.
3311
3312 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
3313 instead of having a wrong decl.
3314 * nsmenu.m (waiting_for_input): Remove wrong decl.
3315
3316 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3317
3318 keyboard.c, keymap.c: Use bool for booleans.
3319 * dispnew.c (sit_for): Distinguish between 3-way display_option
3320 and boolean do_display.
3321 * keyboard.c (single_kboard, this_command_key_count_reset)
3322 (waiting_for_input, echoing, immediate_quit, input_pending)
3323 (interrupt_input, interrupts_deferred, pop_kboard)
3324 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
3325 (command_loop_1, adjust_point_for_property)
3326 (safe_run_hooks_error, input_polling_used, read_char):
3327 (help_char_p, readable_events, kbd_buffer_events_waiting)
3328 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
3329 (lucid_event_type_list_p, get_input_pending):
3330 (gobble_input, menu_separator_name_p, menu_bar_item)
3331 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
3332 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
3333 (keyremap_step, test_undefined, read_key_sequence)
3334 (detect_input_pending, detect_input_pending_ignore_squeezables)
3335 (detect_input_pending_run_timers, requeued_events_pending_p)
3336 (quit_throw_to_read_char, Fset_input_interrupt_mode):
3337 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
3338 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
3339 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
3340 (accessible_keymaps_1, Fkey_description, push_key_description):
3341 (shadow_lookup, struct where_is_internal_data)
3342 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
3343 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
3344 (describe_map, describe_vector):
3345 * menu.c (single_menu_item):
3346 * nsmenu.m (ns_update_menubar):
3347 * process.c (wait_reading_process_output):
3348 * search.c (scan_buffer, scan_newline):
3349 Use bool for boolean.
3350 * keyboard.c (timers_run, swallow_events)
3351 (detect_input_pending_run_timers):
3352 * process.c (wait_reading_process_output):
3353 Use unsigned for counter where wraparound-on-overflow is desired,
3354 since unsigned is guaranteed to have that behavior and signed is not.
3355 (read_char): Use ptrdiff_t for string length.
3356 (get_input_pending): Remove first argument, since it was always
3357 the same pointer-to-int (now pointer-to-boolean) &input_pending,
3358 and behave as if it had that value. Return new value of
3359 input_pending. All callers changed.
3360 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
3361 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
3362 a string length.
3363 * keymap.c (push_key_description): Omit last arg, which was always 1.
3364 All callers changed.
3365
3366 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
3367
3368 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
3369
3370 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
3371 ($(BLD)/term.$(O)): Update dependencies.
3372
3373 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3374
3375 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
3376 * lisp.h (enum pvec_type): Adjust comments and omit explicit
3377 initializer for PVEC_NORMAL_VECTOR.
3378
3379 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3380
3381 Clean out old termopts cruft.
3382 * termopts.h (flow_control, meta_key): Remove unused decls.
3383 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
3384 Don't include termopts.h.
3385
3386 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3387
3388 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
3389
3390 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3391
3392 * commands.h (immediate_quit): Remove duplicate decl.
3393
3394 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
3395
3396 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
3397 caching.
3398 (nsfont_open): Remove setting of Vfonts_in_cache.
3399 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
3400
3401 2012-10-09 Eli Zaretskii <eliz@gnu.org>
3402
3403 * w32fns.c (w32_last_error): Change the return value to DWORD, to
3404 match what GetLastError returns. Explain why the function is
3405 needed.
3406
3407 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
3408 'is_tooltip_frame', to avoid confusion with its global namesake.
3409
3410 2012-10-08 Daniel Colascione <dancol@dancol.org>
3411
3412 * xdisp.c (start_hourglass): Call w32_note_current_window when
3413 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
3414 build that caused Emacs to display the hourglass cursor forever.
3415
3416 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
3417 which is broken under remote desktop, calculate the number of
3418 colors available for a display based on the display's number of
3419 planes and number of bits per pixel per plane. (bug#10397).
3420
3421 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
3422
3423 * nsfont.m (Vfonts_in_cache): New variable.
3424 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
3425 are used. Add cached fonts to Vfonts_in_cache.
3426 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
3427
3428 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
3429
3430 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
3431 in nt/config.nt.
3432 (FONT_H): Define after FRAME_H.
3433 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
3434 Update dependencies.
3435
3436 * w32term.c: Remove leftover declaration of keyboard_codepage.
3437
3438 2012-10-08 Eli Zaretskii <eliz@gnu.org>
3439
3440 * makefile.w32-in (FONT_H): Add $(FRAME_H).
3441 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
3442 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
3443 (GLOBAL_SOURCES): Add cygw32.c.
3444 ($(BLD)/unexw32.$(O)):
3445 ($(BLD)/w32.$(O)):
3446 ($(BLD)/w32console.$(O)):
3447 ($(BLD)/w32fns.$(O)):
3448 ($(BLD)/w32heap.$(O)):
3449 ($(BLD)/w32menu.$(O)):
3450 ($(BLD)/w32proc.$(O)): Add w32common.h.
3451
3452 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
3453 'const char *'.
3454 (x_to_w32_color): Don't modify the argument, modify a copy instead.
3455
3456 2012-10-08 Daniel Colascione <dancol@dancol.org>
3457
3458 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
3459 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
3460 accidental message numbering hole. Change other messages to
3461 match.
3462
3463 * w32select.h (HAVE_W32SELECT): Remove.
3464
3465 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
3466 w32common.h instead of w32heap.h.
3467
3468 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
3469 (get_allocation_unit, get_processor_type, get_w32_major_version)
3470 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3471 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3472 (OS_NT, os_subtype, cache_system_info): Move declarations to
3473 w32common.
3474
3475 * w32heap.c: Include w32common.h.
3476 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
3477 (w32_minor_version, w32_build_number, w32_subtype):
3478 Remove duplicate definitions.
3479
3480 * w32fns.c: Include w32common.h; include w32heap.h only in
3481 WINDOWSNT.
3482
3483 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
3484 Use `report_file_error' instead of `error' in order to better
3485 inform users of what went wrong. Increase NTGUI_UNICODE file
3486 dialog box file name length to 32k, the maximum allowed by the NT
3487 kernel.
3488
3489 * w32common.h: New file.
3490 (ROUND_UP, ROUND_DOWN, get_page_size)
3491 (get_allocation_unit, get_processor_type, get_w32_major_version)
3492 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3493 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3494 (OS_NT, os_subtype, cache_system_info): Move here.
3495
3496 * unexw32.c, unexcw.c: Include w32common.h.
3497
3498 * emacs.c (main): Use (defined (WINDOWSNT) || defined
3499 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
3500 to call syms_of_w32select.
3501
3502 * cygw32.h: Remove obsolete EXFUN declarations.
3503
3504 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
3505
3506 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
3507 of w32inevt.o from SOME_MACHINE_OBJECTS.
3508
3509 2012-10-08 Daniel Colascione <dancol@dancol.org>
3510
3511 * image.c: Permanent fix for JPEG compilation issue --- limit
3512 jpeglib `boolean' redefinition to Cygwin builds.
3513
3514 2012-10-08 Eli Zaretskii <eliz@gnu.org>
3515
3516 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
3517
3518 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
3519 Cygwin.
3520
3521 2012-10-08 Daniel Colascione <dancol@dancol.org>
3522
3523 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
3524 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
3525 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
3526 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
3527 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
3528 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
3529 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
3530 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
3531 now a supported configuration.
3532
3533 * Makefile.in: consolidate image variables into LIBIMAGE; add
3534 W32_OBJ and W32_LIBS. Compile new files.
3535
3536 * conf_post.h:
3537 (_DebPrint) declare tracing facility for W32 debugging. We need
3538 to unify tracing later.
3539
3540 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
3541 unconditional use of W32 Unicode functions. Cygwin runs only on
3542 100% Unicode operating systems.
3543
3544 * cygw32.c: New file. Define Cygwin-specific facilities.
3545 (Fcygwin_convert_path_to_windows)
3546 (Fcygwin_convert_path_from_windows): New user functions for
3547 accessing Cygwin path-munging routines.
3548
3549 * cygw32.h: New file.
3550 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
3551 UTF-16LE strings temporarily inside non-Lisp-visible string
3552 objects.
3553
3554 (w32_strerror): Just what it says on the tin.
3555
3556 * emacs.c: Make the NS fork-then-exec code for daemon-launching
3557 also run for Cygwin; both systems have the same problem with using
3558 GUI facilities in a forked child. Also call syms_of_cygw32,
3559 syms_of_w32select in correct places.
3560
3561 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
3562 needs fork-then-exec for daemon launching.
3563
3564 * font.h: Include frame.h.
3565
3566 * image.c: Use the image library cache machinery only when we're
3567 compiling for native WINDOWSNT; Cygwin can use shared libraries
3568 like any other Unixlike system.
3569
3570 * keyboard.c: Clarify a comment regarding the input loop.
3571
3572 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
3573 functions directly instead of trying to detect at runtime that our
3574 host operating system supports them. We make this change for two
3575 reasons: Cygwin lacks support for the multibyte character
3576 conversion functions used by the legacy menu code, and Cygwin
3577 never needs to rely on non-Unicode APIs.
3578
3579 * unexw32.c (hinst): Declare extern.
3580
3581 * w32.c: Change header order;
3582 (w32_strerror): Move to w32fns.c because we need it for
3583 non-WINDOWSNT builds.
3584
3585 * w32.h: Add #error macro to make sure we don't include w32.h for
3586 Cygwin builds. Remove w32select declarations.
3587
3588 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
3589 w32fns.c. w32console.c is WINDOWSNT-only.
3590
3591 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
3592 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
3593 POSIXy alternative.
3594 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
3595 (w32_major_version, w32_minor_version, w32_build_number)
3596 (os_subtype, sound_type): Define here
3597 (w32_defined_color): Make color parameter const for consistency
3598 with other _defined_color functions.
3599 (w32_createwindow): Unconditionally call w32_init_class instead of
3600 doing so only when hprevinst is non-NULL. Plumbing hprevinst
3601 through the code is complex and unnecessary because class
3602 registration is practically free.
3603 (w32_name_of_message): New EMACSDEBUG-only function.
3604 (Fset_message_beep): Move here
3605 (Fx_open_connection): Require that the display name for Windows be
3606 "w32" for consistency, emacsclient disambiguation, and maybe, one
3607 day, multi-window-system support.
3608 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
3609 Cygwin files for W32 GUI facilities, since these clearly don't
3610 expect Cygwin names.
3611 (_DebPrint): Define.
3612 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
3613 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
3614 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
3615 (w32_last_error): Remove.
3616
3617 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
3618
3619 * w32heap.c (syspage_mask): Declare here.
3620 (cache_system_info): Remove.
3621
3622 * w32inevt.c (faked_key): Define globally, not statically.
3623 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
3624 (w32_console_toggle_lock_key): Move to w32fns.c.
3625
3626 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
3627
3628 * w32proc.c (_DebPrint): Move to w32fns.c.
3629 * w32select.c: Include string.h, stdio.h for Cygwin.
3630 * w32select.h: New File.
3631
3632 * w32term.c: Include io.h for non-CYGWIN builds; needed for
3633 get_osfhandle.
3634 (w32_message_fd): New variable. Under Cygwin, holds the file
3635 descriptor the system used to tell us about pending thread
3636 messages.
3637
3638 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
3639 that prevented compilation under non-WINDOWSNT systems.
3640
3641 (w32_initialize): Open /dev/windows and assign it to
3642 w32_message_fd. Provide w32 feature.
3643
3644 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
3645 (WM_EMACS_INPUT_READY): add.
3646 (prepend_msg, w32_message_fd): Declare globally.
3647
3648 * w32xfns.c:
3649 (keyboard_handle): Use only when WINDOWSNT.
3650 (notify_msg_ready): New function. Posts a message to the main
3651 thread's message queue under CYGWIN, which wakes up the main
3652 thread from select(2) by making the /dev/windows file descriptor
3653 ready. Under WINDOWSNT, it sets an event the same way the old
3654 code did.
3655
3656 (post, prepend_msg): Actually call notify_msg_ready instead of
3657 setting the input event directly.
3658
3659 2012-10-07 Eli Zaretskii <eliz@gnu.org>
3660
3661 * ralloc.c (relinquish): If a heap is ready to be relinquished,
3662 but it still has blocs in it, don't return it to the system,
3663 instead of aborting. (Bug#12402)
3664
3665 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
3666
3667 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
3668
3669 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
3670 MAC_OS_X_VERSION_10_6.
3671 (syms_of_nsterm): Remove comment about Panther and above for
3672 ns-antialias-text.
3673 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
3674 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
3675 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
3676
3677 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
3678 MAC_OS_X_VERSION_10_4.
3679
3680 * nsmenu.m (fillWithWidgetValue:): Remove code for <
3681 MAC_OS_X_VERSION_10_2.
3682
3683 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
3684
3685 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
3686 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
3687
3688 * nsterm.m (ns_in_resize): Remove (Bug#12479).
3689 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
3690 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
3691 Remove ns_in_resize check.
3692 (ns_clear_frame_area): Remove resize handle code.
3693
3694 * nsfns.m (ns_in_resize): Remove.
3695 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
3696 Remove ns_in_resize check.
3697
3698 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
3699
3700 Improve sys_siglist detection.
3701 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
3702 defined as a macro, as is done in Solaris.
3703 (sys_siglist_entries): New macro.
3704 (save_strsignal): Use it.
3705 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
3706 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
3707
3708 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
3709
3710 * nsfns.m (Fx_create_frame): Call x_default_parameter with
3711 fullscreen/Fullscreen.
3712
3713 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
3714 tobar_height is new.
3715
3716 * nsterm.m (x_make_frame_visible): Check for fullscreen.
3717 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
3718 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
3719 (windowDidResize:): Check for correct window if old style fullscreen.
3720 Capitalize word in comment. Remove incorrect comment.
3721 (initFrameFromEmacs:): tbar_height renamed tibar_height.
3722 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
3723 error in drawing background.
3724 (toggleFullScreen:): Remove comment. Rearrange calls.
3725 Set toolbar values to zero, save old height in tobar_height.
3726 Restore tool bar height when leaving fullscreen.
3727 (canBecomeMainWindow): New function.
3728
3729 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
3730
3731 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
3732
3733 2012-10-05 Eli Zaretskii <eliz@gnu.org>
3734
3735 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
3736
3737 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
3738 that time stamps of directories could also be changed.
3739 Don't request the too broad GENERIC_WRITE, only the more restrictive
3740 FILE_WRITE_ATTRIBUTES access rights.
3741
3742 * fileio.c (Fset_file_times): Special-case ignoring errors for
3743 directories only on MSDOS, not on MS-Windows.
3744
3745 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
3746
3747 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
3748
3749 2012-10-04 Eli Zaretskii <eliz@gnu.org>
3750
3751 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
3752 see whether CreateFile failed.
3753
3754 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
3755
3756 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
3757 to avoid similar races.
3758 * keyboard.c (pending_signals): Now bool, not int.
3759
3760 Port timers to OpenBSD, plus check for timer failures.
3761 OpenBSD problem reported by Han Boetes.
3762 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
3763 and/or setitimer.
3764 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
3765 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
3766 like OpenBSD, which has timer_settime but does not declare it.
3767 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
3768 whether to use itimerspec-related primitives. All uses of
3769 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
3770
3771 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3772
3773 * profiler.c (handle_profiler_signal): Fix a malloc race
3774 that caused Emacs to hang on Fedora 17 when profiling Lisp.
3775
3776 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
3777
3778 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
3779
3780 2012-10-02 Eli Zaretskii <eliz@gnu.org>
3781
3782 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
3783 consistent with the change in return value of 'safe_strsignal'.
3784
3785 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3786
3787 Prefer plain 'static' to 'static inline' (Bug#12541).
3788 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
3789 (bidi_set_sor_type, bidi_push_embedding_level)
3790 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
3791 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
3792 (bidi_cache_search, bidi_cache_ensure_space)
3793 (bidi_cache_iterator_state, bidi_cache_find)
3794 (bidi_peek_at_next_level, bidi_set_paragraph_end)
3795 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3796 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
3797 Now 'static', not 'static inline'.
3798
3799 Count overruns when profiling; change units to ns.
3800 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
3801 Give extra weight to samples after overruns, to attempt to count
3802 the time more accurately.
3803 (setup_cpu_timer): Change sampling interval units from ms to ns, since
3804 the underlying primitives nominally do ns.
3805 (Fprofiler_cpu_start): Document the change. Mention that
3806 the sampling intervals are only approximate.
3807
3808 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
3809
3810 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
3811
3812 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
3813 case for the special 0 coding-system.
3814
3815 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
3816 (Fmake_overlay): Remove redundant tests.
3817 (fix_start_end_in_overlays): Remove redundant recentering.
3818
3819 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
3820
3821 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
3822 Update dependencies.
3823
3824 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3825
3826 Fix a malloc race condition involving strsignal.
3827 A signal can arrive in the middle of a malloc, and Emacs's signal
3828 handler can invoke strsignal, which can invoke malloc, which is
3829 not portable. This race condition bug makes Emacs hang on GNU/Linux.
3830 Fix it by altering the signal handler so that it does not invoke
3831 strsignal.
3832 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
3833 * process.c (status_message): Use const pointer, in case strsignal
3834 is #defined to safe_strsignal.
3835 * sysdep.c (sys_siglist, init_signals): Always define and
3836 initialize a substitute sys_siglist if the system does not define
3837 one, even if HAVE_STRSIGNAL.
3838 (safe_strsignal): Rename from strsignal. Always define,
3839 using sys_siglist. Return a const pointer.
3840 * syssignal.h (safe_strsignal): New decl.
3841 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
3842
3843 2012-10-01 Eli Zaretskii <eliz@gnu.org>
3844
3845 * w32proc.c (timer_loop): Fix code that waits for timer
3846 expiration, to avoid high CPU usage.
3847
3848 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
3849
3850 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
3851 (sweep_weak_table): Remove redundant prototypes.
3852
3853 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
3854
3855 * emacs.c: Move the inclusion of TERM_HEADER after including
3856 windows.h on WINDOWSNT. This avoids compilation problems with
3857 MSVC.
3858
3859 2012-10-01 Eli Zaretskii <eliz@gnu.org>
3860
3861 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
3862 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
3863 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
3864 as the previous version used 'void *'.
3865
3866 * ralloc.c (ROUNDUP): Fix last change.
3867 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
3868 'size_t'.
3869
3870 * w32proc.c <disable_itimers>: New static flag.
3871 (init_timers): Initialize it to zero, after creating the critical
3872 sections used by the timer threads.
3873 (term_timers): Set to 1 before deleting the critical sections.
3874 (getitimer, setitimer): If disable_itimers is non-zero, return an
3875 error indication without doing anything. Reported by Fabrice
3876 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
3877 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
3878 return results.
3879 [!HAVE_SETITIMER]: Behave as the previous version that didn't
3880 support timers.
3881
3882 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
3883 term_ntproc after all the other bookkeeping, to get timers working
3884 as long as possible.
3885
3886 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3887
3888 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
3889 Suggested by Juri Linkov in
3890 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
3891
3892 Prefer plain 'static' to 'static inline' (Bug#12541).
3893 With static functions, modern compilers inline pretty well by
3894 themselves; advice from programmers often hurts as much as it helps.
3895 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
3896 this change shrinks the text size of the Emacs executable by 1.1%
3897 without affecting CPU significantly in my benchmark.
3898 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
3899 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
3900 (mark_maybe_object, mark_maybe_pointer, bounded_number):
3901 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3902 (bset_auto_fill_function, bset_auto_save_file_format)
3903 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3904 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3905 (bset_cache_long_line_scans, bset_case_fold_search)
3906 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3907 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3908 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3909 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3910 (bset_header_line_format, bset_indicate_buffer_boundaries)
3911 (bset_indicate_empty_lines, bset_invisibility_spec)
3912 (bset_left_fringe_width, bset_major_mode, bset_mark)
3913 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3914 (bset_name, bset_overwrite_mode, bset_pt_marker)
3915 (bset_right_fringe_width, bset_save_length)
3916 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3917 (bset_scroll_up_aggressively, bset_selective_display)
3918 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3919 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
3920 (set_buffer_overlays_after):
3921 * category.c (bset_category_table):
3922 * charset.c (read_hex):
3923 * coding.c (produce_composition, produce_charset)
3924 (handle_composition_annotation, handle_charset_annotation)
3925 (char_encodable_p):
3926 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
3927 (assign_row, set_frame_matrix_frame, make_current)
3928 (add_row_entry):
3929 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
3930 * fns.c (maybe_resize_hash_table):
3931 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
3932 * gmalloc.c (register_heapinfo):
3933 * image.c (lookup_image_type):
3934 * intervals.c (set_interval_object, set_interval_left)
3935 (set_interval_right, copy_interval_parent, rotate_right)
3936 (rotate_left, balance_possible_root_interval):
3937 * keyboard.c (kset_echo_string, kset_kbd_queue)
3938 (kset_keyboard_translate_table, kset_last_prefix_arg)
3939 (kset_last_repeatable_command, kset_local_function_key_map)
3940 (kset_overriding_terminal_local_map, kset_real_last_command)
3941 (kset_system_key_syms, clear_event, set_prop):
3942 * lread.c (digit_to_number):
3943 * marker.c (attach_marker, live_buffer, set_marker_internal):
3944 * nsterm.m (ns_compute_glyph_string_overhangs):
3945 * process.c (pset_buffer, pset_command)
3946 (pset_decode_coding_system, pset_decoding_buf)
3947 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
3948 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
3949 (pset_status, pset_tty_name, pset_type, pset_write_queue):
3950 * syntax.c (bset_syntax_table, dec_bytepos):
3951 * terminal.c (tset_param_alist):
3952 * textprop.c (interval_has_some_properties)
3953 (interval_has_some_properties_list):
3954 * window.c (wset_combination_limit, wset_dedicated)
3955 (wset_display_table, wset_hchild, wset_left_fringe_width)
3956 (wset_left_margin_cols, wset_new_normal, wset_new_total)
3957 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3958 (wset_right_fringe_width, wset_right_margin_cols)
3959 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
3960 (wset_vertical_scroll_bar_type, wset_window_parameters):
3961 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3962 (wset_column_number_displayed, wset_region_showing)
3963 (window_box_edges, run_window_scroll_functions)
3964 (append_glyph_string_lists, prepend_glyph_string_lists)
3965 (append_glyph_string, set_glyph_string_background_width)
3966 (append_glyph, append_composite_glyph)
3967 (take_vertical_position_into_account):
3968 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
3969 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
3970 (lface_hash, lface_same_font_attributes_p, lookup_face):
3971 * xml.c (libxml2_loaded_p):
3972 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
3973 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
3974 Now 'static', not 'static inline'.
3975
3976 * bidi.c: Tune.
3977 (bidi_copy_it): Do the whole copy with a single memcpy.
3978 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
3979
3980 Revert the FOLLOW-SYMLINKS change for file-attributes.
3981 Doing it right would require several changes to Tramp, and there's
3982 not enough time to get that tested before the freeze today.
3983 * dired.c (directory_files_internal, Ffile_attributes):
3984 Undo last change.
3985
3986 * frame.c (x_report_frame_params): Port better to wider ints.
3987 Do not assume that EMACS_UINT is the same width as uprintmax_t,
3988 or that pointers can be printed in 15 decimal digits.
3989 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
3990
3991 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
3992
3993 Support x64 build on MS-Windows.
3994 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
3995 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
3996 compatibility with x64.
3997 (x_get_focus_frame): Add prototype.
3998
3999 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4000 defining an XRectangle structure.
4001
4002 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4003 arithmetics for compatibility with x64.
4004
4005 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4006 compatibility with x64.
4007
4008 * w32heap.h: Adjust prototypes and declarations.
4009
4010 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4011 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4012 DWORD, long, and unsigned long, for compatibility with x64.
4013 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4014 (sbrk): Argument is now of type ptrdiff_t.
4015
4016 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4017 less than 0x0500.
4018 (w32_msg_pump): Use WPARAM type for 'result'.
4019
4020 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4021 architecture.
4022 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4023 compatibility with x64.
4024
4025 * vm-limit.c (lim_data): Now size_t.
4026 (check_memory_limits): Adjust prototypes of real_morecore and
4027 __morecore to receive argument of type ptrdiff_t. Use size_t for
4028 five_percent and data_size.
4029
4030 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4031 variables, for compatibility with x64.
4032 (rva_to_section, offset_to_section, relocate_offset)
4033 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4034 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4035 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4036 for compatibility with x64.
4037
4038 * sysdep.c (STDERR_FILENO): Define if not already defined.
4039
4040 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4041 (__morecore): Argument type is now ptrdiff_t.
4042 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4043 (relinquish): Use ptrdiff_t type for 'excess'.
4044 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4045
4046 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4047 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4048 instead of a literal number.
4049
4050 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4051 (min): Define only if not already defined.
4052
4053 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4054 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4055 hosts.
4056
4057 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4058 'bitmaps' is a pointer.
4059
4060 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4061
4062 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4063
4064 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4065
4066 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4067 * dired.c (directory_files_internal, Ffile_attributes):
4068 New arg follow_symlinks. All uses changed.
4069
4070 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4071
4072 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4073
4074 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4075
4076 Support atimers and CPU profiler via profile.c on MS-Windows.
4077 * w32proc.c (sig_mask, crit_sig): New static variables.
4078 (sys_signal): Support SIGALRM and SIGPROF.
4079 (sigemptyset, sigaddset, sigfillset, sigprocmask)
4080 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
4081 sigfillset, and sigprocmask are no longer no-ops.
4082 (sigismember): New function.
4083 (struct itimer_data): New definition.
4084 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4085 (crit_prof): New static variables.
4086 (MAX_SINGLE_SLEEP): New definition.
4087 (timer_loop, stop_timer_thread, term_timers, init_timers)
4088 (start_timer_thread, getitimer, setitimer): New functions.
4089 (alarm): No longer a no-op, calls setitimer.
4090
4091 * w32.c (term_ntproc): Call term_timers.
4092 (init_ntproc): Make sure all signals are unblocked at startup, to
4093 erase any traces of dumping. Call init_timers.
4094
4095 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4096 Windows-specific code to display the hourglass mouse pointer is no
4097 longer used.
4098 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4099 to hourglass timer expiration.
4100 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4101 Remove, no longer used.
4102 (w32_note_current_window, show_hourglass, hide_hourglass):
4103 New functions, in support of hourglass cursor display similar to other
4104 window systems.
4105 (syms_of_w32fns): Don't initialize hourglass_timer.
4106
4107 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4108 WINDOWSNT as well.
4109 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4110
4111 * w32.h (init_timers, term_timers): Add prototypes.
4112
4113 2012-09-30 Kenichi Handa <handa@gnu.org>
4114
4115 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4116 to the buffer relocation which may be caused by ccl_driver.
4117
4118 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4119
4120 * xfns.c (Fx_file_dialog): Update comment.
4121
4122 * w32fns.c (Fx_file_dialog): Update comment.
4123
4124 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4125 Initialize panel name field if OSX >= 10.6.
4126
4127 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4128
4129 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4130
4131 * nsterm.m (NEW_STYLE_FS): New define.
4132 (ns_fullscreen_hook, windowWillEnterFullScreen)
4133 (windowDidEnterFullScreen, windowWillExitFullScreen)
4134 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4135 (setFSValue): New functions.
4136 (EmacsFSWindow): New implementation.
4137 (canBecomeKeyWindow): New function for EmacsFSWindow.
4138 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4139 (dealloc): Release nonfs_window if in fullscreen.
4140 (updateFrameSize:): Call windowDidMove to update top/left.
4141 (windowWillResize:toSize:): Check if frame is still maximized.
4142 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4143 next_maximized, maximized_width, maximized_height and nonfs_window.
4144 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4145 tbar_height.
4146 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
4147 fullscreen. Set maximized_width/height. Act on next_maximized.
4148
4149 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4150 (EmacsView): Add variables for fullscreen.
4151 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4152 (EmacsFSWindow): New interface for fullscreen.
4153
4154 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
4155
4156 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4157
4158 2012-09-30 Chong Yidong <cyd@gnu.org>
4159
4160 * fns.c (Frandom): Doc fix.
4161
4162 2012-09-30 Martin Rudalics <rudalics@gmx.at>
4163
4164 * window.c (Vwindow_combination_limit): New default value.
4165 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4166
4167 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4168
4169 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4170 Suggested by Eli Zaretskii in
4171 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4172
4173 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4174
4175 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4176 HAVE_TIMER_SETTIME is defined.
4177
4178 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4179
4180 Profiler improvements: more-accurate timers, overflow checks.
4181 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4182 signal.h, setjmp.h. Include systime.h instead.
4183 (saturated_add): New function.
4184 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4185 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4186 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4187 New static vars.
4188 (enum profiler_cpu_running): New enum.
4189 (profiler_cpu_running): Now of that enum type, not bool.
4190 All uses changed to store the new value.
4191 (handle_profiler_signal): Rename from sigprof_handler_1,
4192 for consistency with other handlers. Do not check whether
4193 cpu_log is a hash-table if garbage collecting, since it
4194 doesn't matter in that case.
4195 (deliver_profiler_signal): Rename from sigprof_handler,
4196 for consistency with other handlers.
4197 (setup_cpu_timer): New function, with much of what used to be in
4198 Fprofiler_cpu_start. Check for out-of-range argument.
4199 Prefer timer_settime if available, and prefer
4200 thread cputime clocks, then process cputime clocks, then
4201 monotonic clocks, to the old realtime clock. Use make_timeval
4202 to round more-correctly when falling back to setitimer.
4203 (Fprofiler_cpu_start): Use it.
4204 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4205 Don't assume that passing NULL as the 2nd argument of setitimer
4206 is the same as passing a pointer to all-zero storage.
4207 Ignore SIGPROF afterwards.
4208 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4209 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4210 non-fatal signal handlers. Ignore SIGPROF on startup.
4211 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4212 in profiler.c, since sysdep.c now uses it.
4213
4214 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4215 Suggested by Eli Zaretskii in
4216 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4217
4218 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
4219
4220 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4221
4222 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
4223
4224 * lisp.h (struct backtrace): Remove indirection for `function' field.
4225 * xdisp.c (redisplay_internal):
4226 * profiler.c (record_backtrace, sigprof_handler_1):
4227 * alloc.c (Fgarbage_collect):
4228 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
4229 (Fbacktrace_frame): Adjust accordingly.
4230
4231 2012-09-28 Glenn Morris <rgm@gnu.org>
4232
4233 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
4234 (Frun_hook_with_args_until_failure): Doc fixes.
4235
4236 2012-09-28 Eli Zaretskii <eliz@gnu.org>
4237
4238 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
4239 Qautomatic_redisplay and change the symbol name. All users changed.
4240
4241 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
4242
4243 * profiler.c (sigprof_handler): Fix race condition.
4244
4245 2012-09-28 Glenn Morris <rgm@gnu.org>
4246
4247 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4248
4249 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
4250
4251 Check more robustly for timer_settime.
4252 * Makefile.in (LIB_TIMER_TIME): New macro.
4253 (LIBES): Add it.
4254 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
4255 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
4256 call timer_settime.
4257
4258 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4259
4260 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
4261
4262 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
4263
4264 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4265
4266 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
4267
4268 * character.h (MAYBE_UNIFY_CHAR): Remove.
4269 * charset.c, charset.h (maybe_unify_char): Now static.
4270 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
4271 Since this stuff is now private to charset.c, there's no need for
4272 a public macro and no need to inline by hand.
4273
4274 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4275 Stefan Monnier <monnier@iro.umontreal.ca>
4276 Juanma Barranquero <lekktu@gmail.com>
4277
4278 * profiler.c: New file.
4279 * Makefile.in (base_obj): Add profiler.o.
4280 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
4281 ($(BLD)/profiler.$(O)): New target.
4282 * emacs.c (main): Call syms_of_profiler.
4283 * alloc.c (Qautomatic_gc): New constant.
4284 (MALLOC_PROBE): New macro.
4285 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
4286 (total_bytes_of_live_objects): New function.
4287 (Fgarbage_collect): Use it. Record itself in backtrace_list.
4288 Call malloc_probe for the memory profiler.
4289 (syms_of_alloc): Define Qautomatic_gc.
4290 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
4291 race condition.
4292 (struct backtrace): Move definition...
4293 * lisp.h (struct backtrace): ..here.
4294 (Qautomatic_gc, profiler_memory_running): Declare vars.
4295 (malloc_probe, syms_of_profiler): Declare functions.
4296 * xdisp.c (Qautomatic_redisplay): New constant.
4297 (redisplay_internal): Record itself in backtrace_list.
4298 (syms_of_xdisp): Define Qautomatic_redisplay.
4299
4300 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4301 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
4302
4303 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
4304
4305 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
4306
4307 Prefer POSIX timers if available.
4308 They avoid a race if the timer is too close to the current time.
4309 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
4310 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
4311 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
4312
4313 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4314
4315 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
4316 CHAR_STRING_ADVANCE.
4317 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
4318 STRING_CHAR_ADVANCE.
4319
4320 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
4321
4322 Move Vlibrary_cache to emacs.c and reset before dumping.
4323
4324 * lisp.h (reset_image_types): Declare.
4325 [WINDOWSNT] (Vlibrary_cache): Declare.
4326
4327 * image.c (reset_image_types): New function.
4328
4329 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
4330 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
4331 (Fdump_emacs): Reset Vlibrary_cache and image_types.
4332
4333 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
4334 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
4335
4336 * w32.h (Vlibrary_cache): Do not declare.
4337
4338 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4339
4340 * w32proc.c (sys_signal): Handle all signals defined by the
4341 MS-Windows runtime, not just SIGCHLD. Actually install the signal
4342 handlers for signals supported by Windows. Don't override
4343 term_ntproc as the handler for SIGABRT.
4344 (sigaction): Rewrite to call sys_signal instead of duplicating its
4345 code.
4346 (sys_kill): Improve commentary.
4347
4348 * w32.c (term_ntproc): Accept (and ignore) one argument, for
4349 consistency with a signature of a signal handler. All callers
4350 changed.
4351 (init_ntproc): Accept an argument DUMPING. If dumping, don't
4352 install term_ntproc as a signal handler for SIGABRT, as that
4353 should be done by the dumped Emacs.
4354
4355 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
4356
4357 * w32select.c (term_w32select): Protect against repeated
4358 invocation by setting clipboard_owner to NULL after calling
4359 DestroyWindow.
4360
4361 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
4362 and term_ntproc to their modified signatures.
4363
4364 * character.c (char_string, string_char): Remove calls to
4365 MAYBE_UNIFY_CHAR. See the discussion starting at
4366 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
4367 for the details.
4368
4369 2012-09-25 Chong Yidong <cyd@gnu.org>
4370
4371 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
4372
4373 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
4374
4375 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
4376 when encountering an unknown bytecode.
4377
4378 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
4379
4380 image.c, indent.c: Use bool for booleans.
4381 * dispextern.h (struct image_type): Members valid_p, load, init
4382 now return bool, not int. All uses changed.
4383 * image.c: Omit unnecessary static decls.
4384 (x_create_bitmap_mask, x_build_heuristic_mask):
4385 Return void, not int, since callers don't care about the return value.
4386 (x_create_bitmap_mask, define_image_type, valid_image_p)
4387 (struct image_keyword, parse_image_spec, image_spec_value)
4388 (check_image_size, image_background)
4389 (image_background_transparent, x_clear_image_1)
4390 (postprocess_image, lookup_image, x_check_image_size)
4391 (x_create_x_image_and_pixmap, xbm_image_p)
4392 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
4393 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
4394 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
4395 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
4396 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
4397 (png_image_p, init_png_functions, png_load_body, png_load)
4398 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
4399 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
4400 (init_gif_functions, gif_load, imagemagick_image_p)
4401 (imagemagick_load_image, imagemagick_load, svg_image_p)
4402 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
4403 (gs_load):
4404 * nsimage.m (ns_load_image):
4405 * nsterm.m (ns_defined_color):
4406 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
4407 * xfns.c (x_defined_color):
4408 * xterm.c (x_alloc_lighter_color_for_widget)
4409 (x_alloc_nearest_color_1, x_alloc_nearest_color)
4410 (x_alloc_lighter_color):
4411 * indent.c (disptab_matches_widthtab, current_column)
4412 (scan_for_column, string_display_width, indented_beyond_p)
4413 (compute_motion, vmotion, Fvertical_motion):
4414 Use bool for booleans.
4415
4416 2012-09-24 Chong Yidong <cyd@gnu.org>
4417
4418 * chartab.c (Fset_char_table_default): Obsolete function removed.
4419
4420 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4421
4422 Move pid_t related decls out of lisp.h.
4423 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
4424 (interruptible_wait_for_termination):
4425 Move these decls from lisp.h to syswait.h, since they use pid_t.
4426 Needed on FreeBSD; see Herbert J. Skuhra in
4427 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
4428 * callproc.c: Include syswait.h.
4429
4430 gnutls.c, gtkutil.c: Use bool for boolean.
4431 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
4432 (emacs_gnutls_handle_error):
4433 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
4434 (xg_hide_tooltip, xg_create_frame_widgets)
4435 (create_dialog, xg_uses_old_file_dialog)
4436 (xg_get_file_with_chooser, xg_get_file_with_selection)
4437 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
4438 (xg_item_label_same_p, xg_update_menubar)
4439 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
4440 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
4441 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
4442 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
4443 (update_frame_tool_bar, free_frame_tool_bar):
4444 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
4445 * nsmenu.m (ns_update_menubar):
4446 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
4447 * xfns.c (Fx_show_tip) [USE_GTK]:
4448 Use bool for boolean.
4449 * gtkutil.c (xg_update_frame_menubar):
4450 * xmenu.c (update_frame_menubar):
4451 Return void, not int, since caller ignores return value.
4452 * gtkutil.c (xg_change_toolbar_position):
4453 Return void, not 1.
4454
4455 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
4456
4457 * makefile.w32-in (BLOCKINPUT_H): Remove.
4458 (SYSSIGNAL_H): New macro.
4459 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
4460 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
4461 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
4462 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
4463 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
4464 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
4465 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
4466 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
4467 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
4468 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
4469 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
4470 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
4471 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
4472 ($(BLD)/w32xfns.$(O)): Update dependencies.
4473
4474 2012-09-23 Eli Zaretskii <eliz@gnu.org>
4475
4476 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
4477 fatal_error_backtrace.
4478
4479 * w32proc.c (sys_kill): Undo last change: don't do anything when
4480 invoked to deliver SIGABRT to our own process. This is now
4481 handled by emacs_raise.
4482
4483 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
4484
4485 * w32term.c (w32_read_socket): Remove leftover reference to
4486 interrupt_input_pending.
4487
4488 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4489
4490 Do not use SA_NODEFER.
4491 Problem reported by Dani Moncayo in
4492 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
4493 * alloc.c (die):
4494 * sysdep.c (emacs_abort): Do not reset signal handler.
4495 * emacs.c (terminate_due_to_signal): Reset signal handler here.
4496 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
4497 wanted even on POSIXish hosts, and it doesn't work on Windows.
4498
4499 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4500
4501 * xterm.c (x_term_init): Call fixup_locale before and after calling
4502 gtk_init (Bug#12392).
4503
4504 2012-09-23 Chong Yidong <cyd@gnu.org>
4505
4506 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
4507 Vdynamic_library_alist.
4508
4509 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
4510 (Fgnutls_available_p): Caller changed.
4511
4512 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
4513 (Flibxml_parse_xml_region): Likewise.
4514
4515 * dispextern.h (struct image_type): Remove arg from init function.
4516
4517 * image.c (Finit_image_library, lookup_image_type)
4518 (define_image_type): Remove now-unneeded second arg.
4519 (init_xpm_functions, init_png_functions, init_jpeg_functions)
4520 (init_tiff_functions, init_gif_functions, init_svg_functions):
4521 Arglist and w32_delayed_load calling convention changed.
4522 (gs_type): Remove init_gs_functions; there is no such function.
4523 (valid_image_p, make_image): Fix caller to lookup_image_type.
4524
4525 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4526
4527 Simplify and avoid signal-handling races (Bug#12471).
4528 * alloc.c (die):
4529 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
4530 Avoid recursive loop if there's a fatal error in the function itself.
4531 * atimer.c (pending_atimers):
4532 * blockinput.h: Don't include "atimer.h"; no longer needed.
4533 (interrupt_input_pending): Remove. All uses removed.
4534 pending_signals now counts both atimers and ordinary interrupts.
4535 This is less racy than having three separate pending-signal flags.
4536 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
4537 (input_blocked_p):
4538 Rename from their upper-case counterparts BLOCK_INPUT,
4539 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
4540 INPUT_BLOCKED_P, and turn into functions. All uses changed.
4541 This makes it easier to access volatile variables more accurately.
4542 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
4543 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
4544 that's more reliable if the code is buggy and sets
4545 interrupt_input_blocked to a negative value. All uses changed.
4546 * atimer.c (deliver_alarm_signal):
4547 Remove. No need to deliver this to the parent; any thread can
4548 handle this signal now. All uses replaced by underlying handler.
4549 * atimer.c (turn_on_atimers):
4550 * dispnew.c (handle_window_change_signal):
4551 * emacs.c (handle_danger_signal):
4552 * keyboard.c (kbd_buffer_get_event):
4553 Don't reestablish signal handler; not needed with sigaction.
4554 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
4555 (UNBLOCK_INPUT_TO):
4556 Rework to avoid unnecessary accesses to volatile variables.
4557 (UNBLOCK_INPUT_TO): Now a function.
4558 (totally_unblock_input, unblock_input): New decls.
4559 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
4560 (init_data): Remove. Necessary stuff now done in init_signal.
4561 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
4562 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
4563 (fatal_error_code): Remove; no longer needed.
4564 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
4565 it doesn't always backtrace. All uses changed. No need to reset
4566 signal to default, since sigaction and/or die does that for us now.
4567 Use emacs_raise (FOO), not kill (getpid (), FOO).
4568 (main): Check more-accurately whether we're dumping.
4569 Move fatal-error setup to sysdep.c
4570 * floatfns.c: Do not include "syssignal.h"; no longer needed.
4571 * gtkutil.c (xg_get_file_name, xg_get_font):
4572 Remove no-longer-needed signal-mask manipulation.
4573 * keyboard.c, process.c (POLL_FOR_INPUT):
4574 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
4575 * keyboard.c (read_avail_input): Remove.
4576 All uses replaced by gobble_input.
4577 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
4578 (kbd_buffer_store_event_hold, gobble_input):
4579 (record_asynch_buffer_change) [USABLE_SIGIO]:
4580 (store_user_signal_events):
4581 No need to mess with signal mask.
4582 (gobble_input): If blocking input and there are terminals, simply
4583 set pending_signals to 1 and return. All hooks changed to not
4584 worry about whether input is blocked.
4585 (process_pending_signals): Clear pending_signals before processing
4586 them, in case a signal comes in while we're processing.
4587 By convention callers now test pending_signals before calling us.
4588 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
4589 New functions, to support changes to blockinput.h.
4590 (handle_input_available_signal): Now extern.
4591 (reinvoke_input_signal): Remove. All uses replaced by
4592 handle_async_input.
4593 (quit_count): Now volatile, since a signal handler uses it.
4594 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
4595 All callers changed. Block SIGINT only if not already blocked.
4596 Clear sigmask reliably, even if Fsignal returns, which it can.
4597 Omit unnecessary accesses to volatile var.
4598 (quit_throw_to_read_char): No need to restore sigmask.
4599 * keyboard.c (gobble_input, handle_user_signal):
4600 * process.c (wait_reading_process_output):
4601 Call signal-handling code rather than killing ourselves.
4602 * lisp.h: Include <float.h>, for...
4603 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
4604 (pending_signals): Now volatile.
4605 (syms_of_data): Now const if IEEE floating point.
4606 (handle_input_available_signal) [USABLE_SIGIO]:
4607 (terminate_due_to_signal, record_child_status_change): New decls.
4608 * process.c (create_process): Avoid disaster if memory is exhausted
4609 while we're processing a vfork, by tightening the critical section
4610 around the vfork.
4611 (send_process_frame, process_sent_to, handle_pipe_signal)
4612 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
4613 ignores SIGPIPE.
4614 (send_process): No need for setjmp/longjmp any more, since the
4615 SIGPIPE stuff is now gone. Instead, report an error if errno
4616 is EPIPE.
4617 (record_child_status_change): Now extern. PID and W are now args.
4618 Return void, not bool. All callers changed.
4619 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
4620 Remove. All uses removed. This bug should be fixed now in a
4621 different way.
4622 (wait_for_termination_1): Use waitpid rather than sigsuspend,
4623 and record the child status change directly. This avoids the
4624 need to futz with the signal mask.
4625 (process_fatal_action): Move here from emacs.c.
4626 (emacs_sigaction_flags): New function, containing
4627 much of what used to be in emacs_sigaction_init.
4628 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
4629 caught by emacs, to make races less likely.
4630 (deliver_process_signal): Rename from handle_on_main_thread.
4631 All uses changed.
4632 (BACKTRACE_LIMIT_MAX): Now at top level.
4633 (thread_backtrace_buffer, threadback_backtrace_pointers):
4634 New static vars.
4635 (deliver_thread_signal, deliver_fatal_thread_signal):
4636 New functions, for more-accurate delivery of thread-specific signals.
4637 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
4638 (deliver_arith_signal): Handle in this thread, not
4639 in the main thread, since it's triggered by this thread.
4640 (maybe_fatal_sig): New function.
4641 (init_signals): New arg DUMPING so that we can be more accurate
4642 about whether we're dumping. Caller changed.
4643 Treat thread-specific signals differently from process-general signals.
4644 Block all signals while handling fatal error; that's safer.
4645 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
4646 on IEEE hosts.
4647 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
4648 Ignore SIGPIPE unless batch.
4649 (emacs_backtrace): Output backtrace for the appropriate thread,
4650 which is not necessarily the main thread.
4651 * syssignal.h: Include <stdbool.h>.
4652 (emacs_raise): New macro.
4653 * xterm.c (x_connection_signal): Remove; no longer needed
4654 now that we use sigaction.
4655 (x_connection_closed): No need to mess with sigmask now.
4656 (x_initialize): No need to reset SIGPIPE handler here, since
4657 init_signals does this for us now.
4658
4659 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4660
4661 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
4662 background rect may be larger (Bug#12245).
4663
4664 2012-09-23 Chong Yidong <cyd@gnu.org>
4665
4666 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
4667
4668 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4669
4670 * .gdbinit: Just stop at fatal_error_backtrace.
4671 See Stefan Monnier's request in
4672 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
4673 Remove no-longer-used query of system type.
4674
4675 2012-09-22 Chong Yidong <cyd@gnu.org>
4676
4677 * search.c (Freplace_match): Doc fix (Bug#12325).
4678
4679 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
4680
4681 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
4682 (Fline_end_position): Doc fix.
4683
4684 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
4685
4686 2012-09-22 Chong Yidong <cyd@gnu.org>
4687
4688 * dispextern.h (struct image_type): Add new slot, storing a type
4689 initialization function.
4690
4691 * image.c (define_image_type): Call the image initializer function
4692 if it is defined. Arguments and return value changed.
4693 (valid_image_p, make_image): Callers changed.
4694 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
4695 (gif_type, imagemagick_type, svg_type, gs_type):
4696 Add initialization functions.
4697 (Finit_image_library): Call lookup_image_type.
4698 (CHECK_LIB_AVAILABLE): Macro deleted.
4699 (lookup_image_type): Call define_image_type here, rather than via
4700 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
4701 (syms_of_image): Move define_image_type calls for xbm_type and
4702 pbm_type to lookup_image_type.
4703
4704 2012-09-22 Eli Zaretskii <eliz@gnu.org>
4705
4706 * keyboard.c (timer_check_2): Move calculation of 'timers' and
4707 'idle_timers' from here ...
4708 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
4709 lists, to avoid infloops when the timer does something stupid,
4710 like reinvoke itself with the same or smaller time-out.
4711 (Bug#12447)
4712
4713 2012-09-22 Martin Rudalics <rudalics@gmx.at>
4714
4715 * window.c (Fsplit_window_internal): Handle only Qt value of
4716 Vwindow_combination_limit separately.
4717 (Qtemp_buffer_resize): New symbol.
4718 (Vwindow_combination_limit): New default value.
4719 Rewrite doc-string.
4720
4721 2012-09-22 Eli Zaretskii <eliz@gnu.org>
4722
4723 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
4724 the new overlay string. (Bug#10159)
4725
4726 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4727
4728 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
4729 or that fprintf is async-signal-safe. POSIX doesn't require
4730 either assumption.
4731
4732 2012-09-22 Chong Yidong <cyd@gnu.org>
4733
4734 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
4735 (Bug#8207).
4736
4737 2012-09-22 Kenichi Handa <handa@gnu.org>
4738
4739 * composite.c (composition_reseat_it): Handle the case that a
4740 grapheme cluster is not covered by a single font (Bug#12352).
4741
4742 2012-09-21 Chong Yidong <cyd@gnu.org>
4743
4744 * image.c (define_image_type): Avoid adding duplicate types to
4745 image_types (Bug#12463). Suggested by Jörg Walter.
4746
4747 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4748
4749 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
4750 (print_load_command_name): Add case LC_DATA_IN_CODE.
4751 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
4752
4753 2012-09-21 Glenn Morris <rgm@gnu.org>
4754
4755 * eval.c (Frun_hook_with_args_until_success)
4756 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
4757
4758 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
4759
4760 * fileio.c (Ffile_selinux_context): Only call freecon when
4761 lgetfilecon succeeded.
4762 (Fset_file_selinux_context): Likewise. (Bug#12444)
4763
4764 2012-09-21 Eli Zaretskii <eliz@gnu.org>
4765
4766 * xdisp.c (try_window_reusing_current_matrix): Under bidi
4767 reordering, locate the cursor by calling set_cursor_from_row; if
4768 that fails, clear the desired glyph matrix before returning a
4769 failure indication to the caller. Fixes leaving garbled display
4770 when fast scrolling with a down-key. (Bug#12403)
4771 (compute_stop_pos_backwards): Fix a typo that caused crashes while
4772 scrolling through multibyte text.
4773
4774 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
4775
4776 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
4777 calling mark_vectorlike since that's the one that marks the window.
4778 (mark_discard_killed_buffers): Mark the final cdr.
4779 * window.h (struct window): Move prev/next_buffers to the
4780 non-standard fields.
4781 * window.c (make_window): Initialize prev/next_buffers manually.
4782
4783 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
4784
4785 Omit unused arg EXPECTED from socket hooks.
4786 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
4787 * nsterm.m (ns_term_init):
4788 * termhooks.h (struct terminal.read_socket_hook):
4789 * w32inevt.c (w32_console_read_socket):
4790 * w32term.c (w32_read_socket):
4791 * xterm.c (XTread_socket):
4792 Omit unused arg EXPECTED. All callers changed.
4793 (store_user_signal_events): Return void, not int, since callers no
4794 longer care about the return value. All uses changed.
4795
4796 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
4797
4798 * w32gui.h (XParseGeometry): Do not declare.
4799
4800 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
4801
4802 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
4803 Ignore 'expected'. See Eli Zaretskii in
4804 <http://bugs.gnu.org/12471#8> (last line).
4805
4806 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
4807 (XParseGeometry): Now static. Substitute extremal values for
4808 values that are out of range.
4809
4810 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
4811
4812 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
4813
4814 * nsfns.m (XParseGeometry): Remove.
4815 (Fx_create_frame): Call x_set_offset to correctly interpret
4816 top_pos in geometry.
4817
4818 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
4819 (Fx_parse_geometry): If there is a space in string, call
4820 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
4821
4822 2012-09-17 Eli Zaretskii <eliz@gnu.org>
4823
4824 * search.c (scan_buffer): Use character positions in calls to
4825 region_cache_forward and region_cache_backward, not byte
4826 positions. (Bug#12196)
4827
4828 * w32term.c (w32_read_socket): Set pending_signals to 1, like
4829 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
4830
4831 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
4832 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
4833 emacs_blocked_malloc, now deleted.
4834
4835 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
4836
4837 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
4838 The workaround was for improving performance on Solaris 2.4, but
4839 is getting in the way now. Emacs will still work if someone is
4840 still running Solaris 2.4 in a museum somewhere; Sun dropped
4841 support for Solaris 2.4 in 2003.
4842 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
4843 * process.c (create_process) [HAVE_WORKING_VFORK]:
4844 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
4845 since Emacs no longer uses vfork on that platform.
4846
4847 2012-09-17 Glenn Morris <rgm@gnu.org>
4848
4849 * emacs.c: Use COPYRIGHT.
4850
4851 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
4852
4853 Remove configure's --without-sync-input option (Bug#12450).
4854 When auditing signal-handling in preparation for cleaning it up,
4855 I found that SYNC_INPUT has race conditions and would be a real
4856 pain to fix. Since it's an undocumented and deprecated
4857 configure-time option, now seems like a good time to remove it.
4858 Also see <http://bugs.gnu.org/11080#16>.
4859 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
4860 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
4861 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4862 (malloc_hysteresis):
4863 (check_depth) [XMALLOC_OVERRUN_CHECK]:
4864 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
4865 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
4866 (dont_register_blocks, bytes_used_when_reconsidered)
4867 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
4868 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
4869 [!SYSTEM_MALLOC && !SYNC_INPUT]:
4870 Remove. All uses removed.
4871 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
4872 implementation, one that depends on whether the new macro
4873 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
4874 is defined.
4875 * atimer.c (run_timers, handle_alarm_signal):
4876 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
4877 (handle_async_input, process_pending_signals)
4878 (handle_input_available_signal, init_keyboard):
4879 * nsterm.m (ns_read_socket):
4880 * process.c (wait_reading_process_output):
4881 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
4882 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
4883 (emacs_write):
4884 * xterm.c (XTread_socket):
4885 Assume SYNC_INPUT.
4886 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
4887 * eval.c (handling_signal): Remove. All uses removed.
4888 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
4889 All uses replaced with the SYNC_INPUT version.
4890 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
4891 Remove decls.
4892 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4893 Now static.
4894
4895 * font.c (Ffont_shape_gstring): Remove unused local.
4896
4897 2012-09-16 Glenn Morris <rgm@gnu.org>
4898
4899 * Makefile.in (clean): No longer run nextstep's clean.
4900
4901 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
4902 (ns_frag): Remove.
4903 (ns-app): Move here from ns.mk, and simplify.
4904 (clean): Simplify nextstep entry.
4905 * ns.mk: Remove file.
4906
4907 2012-09-17 Kenichi Handa <handa@gnu.org>
4908
4909 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
4910 not covert the last few charactes.
4911
4912 2012-09-16 Kenichi Handa <handa@gnu.org>
4913
4914 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
4915 here, but just check the validity of glyphs in the glyph-string.
4916
4917 2012-09-16 Martin Rudalics <rudalics@gmx.at>
4918
4919 * window.c (Fwindow_parameter, Fset_window_parameter):
4920 Accept any window as argument (Bug#12452).
4921
4922 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
4923
4924 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
4925 to ns_term_init to avoid memory leak.
4926
4927 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
4928 explicit retain/release.
4929 (ns_term_init): Only allow one display. Initialize outerpool and
4930 ns_*_types.
4931
4932 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4933
4934 Port _setjmp fix to POSIXish hosts as well as Microsoft.
4935 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
4936 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
4937 the Microsoft problem in a different way, by altering ../nt/config.nt.
4938
4939 2012-09-15 Eli Zaretskii <eliz@gnu.org>
4940
4941 * w32xfns.c:
4942 * w32uniscribe.c:
4943 * w32term.c:
4944 * w32select.c:
4945 * w32reg.c:
4946 * w32proc.c:
4947 * w32menu.c:
4948 * w32inevt.c:
4949 * w32heap.c:
4950 * w32font.c:
4951 * w32fns.c:
4952 * w32console.c:
4953 * w32.c:
4954 * w16select.c: Remove inclusion of setjmp.h, as it is now included
4955 by lisp.h. This completes removal of setjmp.h inclusion
4956 erroneously announced in the previous commit. (Bug#12446)
4957
4958 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
4959 more accurate.
4960
4961 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
4962 not defined as a macro. The latter happens on MS-Windows.
4963 (Bug#12446)
4964
4965 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4966
4967 Port better to POSIX hosts lacking _setjmp (Bug#12446).
4968 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
4969 Some instances of '#include <setjmp.h>' removed, if the
4970 only reason for the instance was because "lisp.h" was included.
4971 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
4972 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
4973 and _longjmp with the new symbols. Emacs already uses _setjmp if
4974 available, so this change affects only POSIXish hosts that have
4975 sigsetjmp but not _setjmp, such as some versions of Solaris and
4976 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
4977 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
4978 (png_load_body) [HAVE_PNG]:
4979 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
4980 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
4981 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
4982 since PNG requires jmp_buf. This is the only exception to the
4983 general rule that we now use sys_setjmp and sys_longjmp.
4984 This exception is OK since this code does not change the signal
4985 mask or longjmp out of a signal handler.
4986
4987 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
4988
4989 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4990 Include "syssignal.h", for 'main_thread'.
4991
4992 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
4993
4994 Avoid out-of-range marker position (Bug#12426).
4995 * insdel.c (replace_range, replace_range_2):
4996 Adjust markers before overlays, as suggested by comments.
4997 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
4998 Remove redundant check before calling offset_intervals.
4999
5000 2012-09-14 Martin Rudalics <rudalics@gmx.at>
5001
5002 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5003 current buffer (Bug#12387).
5004
5005 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
5006
5007 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5008
5009 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5010
5011 Use a more backwards-compatible timer format (Bug#12430).
5012 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5013 vector element, not from the 4th, since PSECS is now at the end.
5014 (Fcurrent_idle_time): Doc fix.
5015
5016 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5017
5018 Function to mark objects and remove killed buffers at once.
5019 * alloc.c (discard_killed_buffers): Rename to ...
5020 (mark_discard_killed buffers) ... new name. Add marking
5021 of remaining objects. Fix comment. Adjust users.
5022 (mark_object): Do not touch frame buffer lists here.
5023 * frame.c (delete_frame): Reset frame buffer lists here.
5024
5025 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5026
5027 Better workaround for GNOME bug when --enable-gcc-warnings.
5028 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5029 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5030 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5031
5032 Simplify SIGIO usage (Bug#12408).
5033 The code that dealt with SIGIO was crufty and confusing, e.g., it
5034 played tricks like "#undef SIGIO" but these tricks were not used
5035 consistently. Simplify mostly by not #undeffing standard symbols,
5036 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5037 or not as we please) rather than "defined SIGIO" (standard symbol
5038 that we probably shouldn't #undef).
5039 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5040 Modules that need it can include it.
5041 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5042 * dispextern.h (ignore_sigio): New decl.
5043 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5044 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5045 * emacs.c (shut_down_emacs):
5046 * keyboard.c (kbd_buffer_store_event_hold):
5047 Use ignore_sigio rather than invoking 'signal' directly.
5048 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5049 for FIONREAD.
5050 (FIONREAD, SIGIO): Do not #undef.
5051 (tty_read_avail_input): Use #error rather than a syntax error.
5052 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5053 for I_PIPE, used by SETUP_SLAVE_PTY.
5054 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5055 * sysdep.c (croak): Remove; no longer needed. This bit of
5056 temporary code, with Fred N. Fish's comment that it's temporary,
5057 has been in Emacs since at least 1992!
5058 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5059 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5060 * syssignal.h (croak): Remove decl.
5061 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5062 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5063 now that we're termios-only.
5064 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5065 * term.c (dissociate_if_controlling_tty): Use #error rather than
5066 a run-time error.
5067
5068 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5069 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5070 to work around GNOME bug 683906.
5071 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5072 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5073 This works around GCC bug 54561.
5074
5075 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5076
5077 More fixes for 'volatile' and setjmp/longjmp.
5078 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5079 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5080 (png_load_body) [HAVE_PNG]:
5081 (jpeg_load_body) [HAVE_JPEG]:
5082 New function, with most of the old parent function's body.
5083 (png_load) [HAVE_PNG]:
5084 (jpeg_load) [HAVE_JPEG]:
5085 Invoke the new function, to avoid longjmp munging our locals.
5086 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5087 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5088 longjmp is passed 2, as the C standard doesn't guarantee this.
5089 Instead, store the failure code into mgr->failure_code.
5090
5091 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5092
5093 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5094 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5095 (syms_of_keyboard): Remove support for unread-command-char.
5096
5097 2012-09-12 Eli Zaretskii <eliz@gnu.org>
5098
5099 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5100 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5101 violation. (Bug#12426)
5102
5103 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5104
5105 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5106
5107 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5108
5109 * eval.c: Add `inhibit-debugger'.
5110 (Qinhibit_debugger): New symbol.
5111 (call_debugger): Bind it instead of Qdebug_on_error.
5112 (maybe_call_debugger): Test Vinhibit_debugger.
5113 (syms_of_eval): Define inhibit-debugger.
5114 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5115 (syms_of_xdisp): Remove inhibit-debug-on-message.
5116
5117 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5118
5119 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5120 If a nonvolatile local variable is written before a _longjmp to
5121 the frame containing the variable, and is read after the _longjmp,
5122 the value read is indeterminate. Some local variables of type
5123 'struct handler' and 'struct catchtag' are used in this way, so
5124 mark each of their slots as volatile if the slot can be set before
5125 _longjmp and read afterwards.
5126 * lisp.h (struct handler): var and chosen_clause are now volatile.
5127 (struct catchtag): val, next, and pdlcount are now volatile.
5128
5129 * bidi.c (bidi_push_it, bidi_pop_it):
5130 * fns.c (copy_hash_table):
5131 * image.c (define_image_type):
5132 * keyboard.c (kbd_buffer_store_event_hold):
5133 * process.c (Fprocess_send_eof):
5134 * xfaces.c (x_create_gc) [HAVE_NS]:
5135 * xgselect.c (xg_select):
5136 Prefer assignment to memcpy when either will do.
5137
5138 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5139 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5140 time an item is removed. No need to mark this function 'inline';
5141 the compiler knows better than we do.
5142
5143 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5144
5145 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5146 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5147 to change_frame_size (Bug#12388).
5148 (windowDidResize:): Pass YES to updateFrameSize.
5149
5150 * nsterm.h: Add delay parameter to updateFrameSize.
5151
5152 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5153
5154 Discard killed buffers from deleted window and frame objects.
5155 This reduces an amount of references to killed buffers and
5156 helps GC to reclaim them faster.
5157 * alloc.c (discard_killed_buffers): New function.
5158 (mark_object): Use it for deleted windows and frames.
5159 (mark_object): If symbol's value is set up for a killed buffer
5160 or deleted frame, restore its global binding.
5161 * data.c (swap_in_global_binding): Add GC notice.
5162 (swap_in_symval_forwarding): Use convenient set_blv_where.
5163 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5164 * window.h: ... to here.
5165
5166 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5167
5168 Convenient macro to check whether the buffer is live.
5169 * buffer.h (BUFFER_LIVE_P): New macro.
5170 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5171 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5172
5173 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5174
5175 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5176 composition cases (Bug#12364).
5177
5178 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5179 overhang of succeeding glyphs overlapping box cursor.
5180
5181 * w32term.c (x_draw_glyph_string): Likewise.
5182
5183 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5184
5185 Simplify, document, and port floating-point (Bug#12381).
5186 The porting part of this patch fixes bugs on non-IEEE platforms
5187 with frexp, ldexp, logb.
5188 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5189 Now static.
5190 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5191 support, by removing commented-out code and briefly listing the
5192 C89 functions excluded. The commented-out stuff was confusing
5193 maintenance, e.g., we thought we needed cbrt but it was commented out.
5194 (logb): Remove decl; no longer needed.
5195 (isfinite): New macro, if not already supplied.
5196 (isnan): Don't replace any existing macro.
5197 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5198 are present on all C89 platforms.
5199 (Ffrexp): Do not special-case zero, as frexp does the right thing
5200 for that case.
5201 (Flogb): Do not use logb, as it doesn't have the desired meaning
5202 on hosts that use non-base-2 floating point. Instead, stick with
5203 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5204 frexp, to avoid getting an unspecified result.
5205
5206 * xdisp.c (Qinhibit_debug_on_message): Now static.
5207
5208 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5209
5210 * nsterm.m (ns_update_begin): Set clip path to whole view by using
5211 NSBezierPath (Bug#12131).
5212
5213 2012-09-10 Chong Yidong <cyd@gnu.org>
5214
5215 * fns.c (Fdelq, Fdelete): Doc fix.
5216
5217 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5218
5219 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5220 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5221
5222 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
5223
5224 * lisp.h (make_lisp_ptr): New macro to replace XSET.
5225 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
5226 Use it.
5227
5228 2012-09-09 Eli Zaretskii <eliz@gnu.org>
5229
5230 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
5231 left fringe if the window has a left margin. This avoids leaving
5232 traces of the cursor because its leftmost pixel is not drawn over.
5233
5234 * dispnew.c (update_window_line): When the left margin area of a
5235 screen line is updated, set the redraw_fringe_bitmaps_p flag of
5236 that screen line. (Bug#12277)
5237
5238 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
5239
5240 Assume C89 or later for math functions (Bug#12381).
5241 This simplifies the code, and makes it a bit smaller and faster,
5242 and (most important) makes it easier to clean up signal handling
5243 since we can stop worring about floating-point exceptions in
5244 library code. That was a problem before C89, but the problem
5245 went away many years ago on all practical Emacs targets.
5246 * data.c, image.c, lread.c, print.c:
5247 Don't include <math.h>; no longer needed.
5248 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
5249 might be autoconfigured, as that never happens.
5250 * data.c (fmod):
5251 * doprnt.c (DBL_MAX_10_EXP):
5252 * print.c (DBL_DIG):
5253 Remove. C89 or later always defines these.
5254 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
5255 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
5256 (arith_error, domain_error, domain_error2):
5257 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
5258 no longer needed -- we simply return what C returns. All uses removed.
5259 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
5260 the wrapped code.
5261 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
5262 Remove. All uses expanded, as these macros are no longer used
5263 more than once and are now more trouble than they're worth.
5264 (Ftan): Use tan, not sin / cos.
5265 (Flogb): Assume C89 frexp.
5266 (fmod_float): Assume C89 fmod.
5267 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
5268 (init_floatfns): Remove. All uses removed.
5269
5270 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5271
5272 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
5273 compositeToPoint for OSX < 10.6 (Bug#12390).
5274
5275 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
5276
5277 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
5278 This produces more-accurate results.
5279
5280 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5281
5282 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
5283 changes (Bug#12088).
5284
5285 2012-09-08 Chong Yidong <cyd@gnu.org>
5286
5287 * syntax.c (Fstring_to_syntax): Doc fix.
5288
5289 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5290
5291 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
5292 in the internal border.
5293 (x_set_window_size): Remove static variables and their usage.
5294 (ns_redraw_scroll_bars): Fix NSTRACE arg.
5295 (ns_after_update_window_line, ns_draw_fringe_bitmap):
5296 Remove fringe/internal border adjustment (Bug#11052).
5297 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
5298 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
5299 (ns_fix_rect_ibw): Remove.
5300 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
5301 (ns_dumpglyphs_box_or_relief): Ditto.
5302 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
5303 adjustment.
5304 (ns_dumpglyphs_image): Ditto.
5305 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
5306 border adjustment.
5307 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
5308 their usage. Add fringe_extended_p and its use as in other terms.
5309 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
5310 scroll bar was removed.
5311 (updateFrameSize): New function.
5312 (windowDidResize): Move code to updateFrameSize and call it.
5313
5314 * nsterm.h (EmacsView): Add updateFrameSize.
5315
5316 2012-09-07 Chong Yidong <cyd@gnu.org>
5317
5318 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
5319
5320 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
5321
5322 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5323
5324 More signal-handler cleanup (Bug#12327).
5325 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
5326 Problem introduced when merging patches. Noted by Eli Zaretskii in
5327 <http://bugs.gnu.org/12327#67>.
5328 * floatfns.c: Comment fix.
5329 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
5330 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
5331 and anyway the declaration is harmless even if SIGDANGER is not defined.
5332 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
5333 defined BROKEN_FIONREAD). systty.h formerly did this, but other
5334 source files not surprisingly expected syssignal.h to define, or
5335 not define, SIGIO, and it's cleaner to do it that way, for consistency.
5336 Include <sys/ioctl.h>, for FIONREAD.
5337 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
5338 This eliminates a problem whereby other files mysteriously had
5339 to include "syssignal.h" before including "systty.h" if they
5340 wanted to use "#ifdef SIGIO".
5341
5342 2012-09-07 Eli Zaretskii <eliz@gnu.org>
5343
5344 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
5345
5346 * w32.c (sigemptyset): Empty the set.
5347 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
5348
5349 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
5350
5351 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
5352
5353 * alloc.c (mark_buffer): Revert unsafe marking optimization.
5354 (mark_object): Likewise for frame objects.
5355
5356 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5357
5358 * syssignal.h (handle_on_main_thread): Always declare,
5359 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
5360 This ports to platforms without HAVE_PTHREAD.
5361
5362 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5363
5364 Signal-handler cleanup (Bug#12327).
5365 Emacs's signal handlers were written in the old 4.2BSD style with
5366 sigblock and sigmask and so forth, and this led to some
5367 inefficiencies and confusion. Rewrite these to use
5368 pthread_sigmask etc. without copying signal sets around. Also,
5369 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
5370 'signal', and instead use functions that do not attempt to take
5371 over the system name space. This patch causes Emacs's text
5372 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
5373 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
5374 Do not include <signal.h> or "syssignal.h", as these
5375 modules do not use signals.
5376 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
5377 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
5378 Do not include <signal.h>, as "syssignal.h" does that for us now.
5379 * atimer.c (sigmask_atimers): New function.
5380 (block_atimers, unblock_atimers): New functions,
5381 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
5382 All uses replaced.
5383 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
5384 no longer needed here.
5385 * emacs.c (main): Inspect existing signal handler with sigaction,
5386 so that there's no need to block and unblock SIGHUP.
5387 * sysdep.c (struct save_signal): New member 'action', replacing
5388 old member 'handler'.
5389 (save_signal_handlers, restore_signal_handlers):
5390 Use sigaction instead of 'signal' to save and restore.
5391 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
5392 New function. All users of 'signal' modified to use set_sighandler
5393 if they're writeonly, and to use sys_signal if they're read+write.
5394 (emacs_sigaction_init, forwarded_signal): New functions.
5395 (sys_signal): Remove. All uses replaced by calls to sigaction
5396 and emacs_sigaction_init, or by direct calls to 'signal'.
5397 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
5398 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
5399 all uses replaced by pthread_sigmask etc. calls.
5400 * syssignal.h: Include <signal.h>.
5401 (emacs_sigaction_init, forwarded_signal): New decls.
5402 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
5403 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
5404 (sigmask, sys_sigmask): Remove; no longer needed.
5405 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
5406 (sigblock, sigunblock, sigfree):
5407 (sigsetmask) [!defined sigsetmask]:
5408 Remove. All uses replaced by pthread_sigmask.
5409 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
5410 no longer need to be replaced, and its typical old uses
5411 are now done via emacs_sigaction_init and sigaction.
5412 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
5413 (sys_sigdel): Remove; unused.
5414 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
5415
5416 2012-09-06 Eli Zaretskii <eliz@gnu.org>
5417
5418 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
5419 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
5420
5421 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5422
5423 Explicitly mark buffer_defaults and buffer_local_symbols.
5424 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
5425 mark_local_symbols here.
5426 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
5427 since special buffers aren't marked here any more.
5428 (allocate_buffer): Chain new buffer with all_buffers here...
5429 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
5430 not here.
5431 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
5432 (syms_of_buffer): Remove staticpro of the above.
5433 (init_buffer_once): Set names for buffer_defaults and
5434 buffer_local_symbols.
5435
5436 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5437
5438 Use bool for booleans in font-related modules.
5439 * font.c (font_intern_prop, font_style_to_value)
5440 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
5441 (generate_otf_features, font_check_otf_features, font_check_otf)
5442 (font_match_p, font_list_entities, font_at):
5443 * fontset.c (fontset_id_valid_p, reorder_font_vector
5444 (fontset_find_font, Fset_fontset_font)
5445 (face_suitable_for_char_p) [0]:
5446 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
5447 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
5448 (m17n_flt_initialized, ftfont_shape_by_flt):
5449 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
5450 * nsfont.m (nsfont_draw):
5451 * w32font.c (w32font_draw):
5452 * w32term.c (x_draw_glyphless_glyph_string_foreground):
5453 Use bool for booleans.
5454 * font.h: Adjust to above API changes.
5455 (struct font, struct font_driver, struct font_driver_list):
5456 Use bool for booleans.
5457 (struct font): Remove useless member encoding_type.
5458 All users removed.
5459 * fontset.c, xftfont.c: Omit unnecessary static decls.
5460
5461 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5462
5463 * alloc.c (mark_object): Revert window marking code
5464 since it's unsafe for the Fset_window_configuration.
5465
5466 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5467
5468 Fix race conditions with signal handlers and errno (Bug#12327).
5469 Be more systematic about preserving errno whenever a signal
5470 handler returns, even if it's not in the main thread. Do this by
5471 renaming signal handlers to distinguish between signal delivery
5472 and signal handling. All uses changed.
5473 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
5474 * data.c (deliver_arith_signal): Rename from arith_error.
5475 * dispnew.c (deliver_window_change_signal): Rename from
5476 window_change_signal.
5477 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
5478 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
5479 * keyboard.c (deliver_input_available_signal): Rename from
5480 input_available_signal.
5481 (deliver_user_signal): Rename from handle_user_signal.
5482 (deliver_interrupt_signal): Rename from interrupt_signal.
5483 * process.c (deliver_pipe_signal): Rename from send_process_trap.
5484 (deliver_child_signal): Rename from sigchld_handler.
5485 * atimer.c (handle_alarm_signal):
5486 * data.c (handle_arith_signal):
5487 * dispnew.c (handle_window_change_signal):
5488 * emacs.c (handle_fatal_signal, handle_danger_signal):
5489 * keyboard.c (handle_input_available_signal):
5490 * keyboard.c (handle_user_signal, handle_interrupt_signal):
5491 * process.c (handle_pipe_signal, handle_child_signal):
5492 New functions, with the actual signal-handling code taken from the
5493 original respective signal handlers, sans the sporadic attempts to
5494 preserve errno, since that's now done by handle_on_main_thread.
5495 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
5496 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
5497 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5498 Move to sysdep.c.
5499 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5500 Move initialization of main_thread to sysdep.c's init_signals.
5501 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
5502 our usage, and simplifies the mainline code.
5503 (record_child_status_change): New static function, as a helper
5504 for handle_child_signal, and with most of the old child handler's
5505 contents.
5506 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
5507 (handle_child_signal): Use the above.
5508 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5509 Moved here from emacs.c.
5510 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
5511 code moved here from emacs.c's main function.
5512 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
5513 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
5514 This lets callers save and restore errno properly.
5515
5516 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5517
5518 Remove redundant or unused things here and there.
5519 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
5520 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
5521 * editfns.c (Fcompare_buffer_substrings): Likewise.
5522 * frame.h (struct terminal, struct font_driver_list):
5523 Remove redundant declarations.
5524 * window.h (Qleft, Qright): Likewise.
5525
5526 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5527
5528 Do not mark objects from deleted buffers, windows and frames.
5529 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
5530 (mark_object): Likewise for windows and frames.
5531
5532 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5533
5534 * alloc.c (valid_lisp_object_p): Treat killed buffers,
5535 buffer_defaults and buffer_local_symbols as valid objects.
5536 Return special value to denote them.
5537
5538 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5539
5540 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
5541 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
5542 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
5543 (file_name_absolute_p, Fsubstitute_in_file_name):
5544 (check_executable, check_writable, Ffile_accessible_directory_p)
5545 (Fset_file_selinux_context, Fdefault_file_modes)
5546 (Finsert_file_contents, choose_write_coding_system)
5547 (Fwrite_region, build_annotations, a_write, e_write)
5548 (Fdo_auto_save):
5549 * filelock.c (boot_time_initialized, get_boot_time)
5550 (get_boot_time_1, lock_file_1, within_one_second):
5551 * floatfns.c (in_float):
5552 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
5553 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
5554 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
5555 * lisp.h (struct Lisp_Hash_Table.cmpfn):
5556 * window.c (compare_window_configurations):
5557 Use bool for booleans.
5558 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
5559 (Fdefault_file_modes): Now mode_t, not int, for modes.
5560 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
5561 (internal_delete_file): Now returns void, not a (boolean) int,
5562 since nobody was looking at the return value.
5563 * lisp.h, window.h: Adjust to above API changes.
5564
5565 * xdisp.c (set_message): Simplify and reindent last change.
5566
5567 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
5568
5569 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
5570
5571 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
5572
5573 * eval.c (call_debugger): Make the function non-static so that we
5574 can call it from set_message.
5575
5576 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
5577 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
5578
5579 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5580
5581 Give more-useful info on a fatal error (Bug#12328).
5582 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
5583 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
5584 of doing the work ourselves.
5585 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
5586 do most of the work.
5587 (fatal_error_backtrace): New function, taken from the guts
5588 of the old fatal_error_signal, but with a new option to output
5589 a backtrace.
5590 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
5591 info about the signal than just its number.
5592 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
5593 * sysdep.c: Include <execinfo.h>
5594 (emacs_backtrace): New function, taken partly from the previous
5595 code of the 'die' function.
5596 (emacs_abort): Call fatal_error_backtrace rather than abort.
5597
5598 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
5599
5600 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
5601 eager (load-time) macro-expansion.
5602 * lisp.mk (lisp): Add macroexp.
5603
5604 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5605
5606 Simplify redefinition of 'abort' (Bug#12316).
5607 Do not try to redefine the 'abort' function. Instead, redo
5608 the code so that it calls 'emacs_abort' rather than 'abort'.
5609 This removes the need for the NO_ABORT configure-time macro
5610 and makes it easier to change the abort code to do a backtrace.
5611 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
5612 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
5613 Remove; sysdep.c's emacs_abort now takes its place.
5614 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
5615 'abort' changed to use 'emacs_abort'.
5616 * msdos.c (dos_abort) [defined abort]: Remove; not used.
5617 (abort) [!defined abort]: Rename to ...
5618 (emacs_abort): ... new name.
5619 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
5620 the place of the old 'abort' in emacs.c.
5621 * w32.c, w32fns.c (abort): Do not #undef.
5622 * w32.c (emacs_abort): Rename from w32_abort.
5623
5624 2012-09-04 Eli Zaretskii <eliz@gnu.org>
5625
5626 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
5627 offsets[j].dv, since the y axis of the screen coordinates points
5628 down, while the y axis of the font definition coordinates points
5629 up. This fixes display of Arabic diacritics such as KASRA and
5630 KASRATAN. (Bug#11860)
5631
5632 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5633
5634 Be more systematic about _setjmp vs setjmp.
5635 * alloc.c (test_setjmp, mark_stack):
5636 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
5637 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
5638 (png_load, my_error_exit, jpeg_load):
5639 * process.c (send_process_trap, send_process):
5640 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
5641 The underscored versions are up to 30x faster on some hosts.
5642 Formerly, the code used setjmp+longjmp sometimes and
5643 _setjmp+_longjmp at other times, with no particular reason to
5644 prefer setjmp+longjmp.
5645
5646 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
5647
5648 Fix minor problem found by static checking.
5649 * buffer.c (Fdelete_all_overlays): Return nil.
5650
5651 2012-09-03 Martin Rudalics <rudalics@gmx.at>
5652
5653 * buffer.c (Fdelete_all_overlays): New function.
5654
5655 2012-09-03 Chong Yidong <cyd@gnu.org>
5656
5657 * gtkutil.c: Add extern decl for Qxft.
5658
5659 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5660
5661 * emacs.c, eval.c: Use bool for boolean.
5662 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
5663 (malloc_using_checking) [DOUG_LEA_MALLOC]:
5664 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
5665 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
5666 (main, decode_env_path, Fdaemon_initialized):
5667 * eval.c (call_debugger, Finteractive_p, interactive_p):
5668 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
5669 (maybe_call_debugger, Fbacktrace):
5670 * process.c (read_process_output, exec_sentinel):
5671 Use bool for booleans.
5672 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
5673 All callers changed.
5674 * eval.c (interactive_p): Omit always-true boolean argument
5675 EXCLUDE_SUBRS_P. All callers changed.
5676 * dispextern.h, lisp.h: Reflect above API changes.
5677 * firstfile.c (dummy): Use the address of 'main', whose signature
5678 won't change, instead of the address of 'initialize', whose
5679 signature just changed from int to bool.
5680 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
5681 * msdos.c (fatal_error_in_progress): ... from here.
5682 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
5683 of incrementing it.
5684 (redisplay_internal, unwind_redisplay): Simply clear
5685 REDISPLAYING_P when unwinding, instead of saving its previous,
5686 always-false value and then restoring it.
5687
5688 Clean up some extern decls.
5689 Mostly, this hoists extern decls out of .c files and into .h files.
5690 That way, we're more likely to catch errors if the interfaces change.
5691 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
5692 declare xg_mark_data.
5693 * dispextern.h (x_frame_parm_handlers):
5694 * font.h (Qxft):
5695 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
5696 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
5697 (Qultra_bold, Qoblique, Qitalic):
5698 Move extern decl here from .c file.
5699 * alloc.c (xg_mark_data) [USE_GTK]:
5700 * doc.c (Qclosure):
5701 * eval.c (Qlexical_binding):
5702 * fns.c (time) [!HAVE_UNISTD_H]:
5703 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
5704 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
5705 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
5706 * lread.c (Qinternal_interpreter_environment):
5707 * minibuf.c (Qbuffer):
5708 * process.c (QCfamily, QCfilter):
5709 * widget.c (free_frame_faces):
5710 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
5711 * xfont.c (x_clear_errors):
5712 * xterm.c (x_frame_parm_handlers):
5713 Remove now-redundant extern decls.
5714 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
5715 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
5716 Now static.
5717 * xfaces.c: Remove unnecessary static decls.
5718 * xterm.c (updating_frame): Remove decl of nonexistent object.
5719
5720 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
5721 when building globals.h, as the objects that are not built on
5722 this host are not needed to compile C files on this host.
5723
5724 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
5725
5726 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
5727
5728 * frame.h: Add missing prototype for x_wm_set_size_hint.
5729
5730 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5731
5732 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
5733 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
5734 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
5735 (Fsubstitute_command_keys):
5736 * editfns.c (region_limit, find_field, Fconstrain_to_field)
5737 (save_excursion_save, save_excursion_restore)
5738 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
5739 (format_time_string, general_insert_function)
5740 (make_buffer_string, make_buffer_string_both)
5741 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
5742 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
5743 (copy_text, insert_1, insert_1_both, insert_from_string)
5744 (insert_from_string_before_markers, insert_from_string_1)
5745 (insert_from_buffer, insert_from_buffer_1, replace_range)
5746 (replace_range_2, del_range_1, del_range_byte, del_range_both)
5747 (del_range_2, modify_region):
5748 * intervals.c (intervals_equal, balance_possible_root_interval)
5749 (adjust_intervals_for_insertion, merge_properties_sticky)
5750 (graft_intervals_into_buffer, lookup_char_property)
5751 (adjust_for_invis_intang, set_point_both)
5752 (get_property_and_range, compare_string_intervals)
5753 (set_intervals_multibyte_1, set_intervals_multibyte):
5754 * keyboard.c (decode_timer):
5755 Use bool for boolean.
5756 * intervals.h, lisp.h, systime.h: Reflect above API changes.
5757 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
5758
5759 2012-09-02 Chong Yidong <cyd@gnu.org>
5760
5761 * keymap.c (push_key_description): Print M-TAB as C-M-i
5762 (Bug#11758).
5763
5764 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
5765
5766 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
5767 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
5768 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
5769 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
5770 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
5771 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
5772 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5773
5774 2012-09-01 Eli Zaretskii <eliz@gnu.org>
5775
5776 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
5777 more than one grapheme cluster passed to the shaper: compute the
5778 offset adjustment values separately for each cluster. (Bug#11860)
5779
5780 * image.c: Restore mistakenly removed inclusion of w32.h. Without
5781 it, GCC doesn't see prototypes of w32_delayed_load, and complains
5782 about implicit conversions from integer to pointer.
5783
5784 2012-09-01 Daniel Colascione <dancol@dancol.org>
5785
5786 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
5787 system used too early.
5788
5789 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
5790
5791 Better seed support for (random).
5792 * emacs.c (main): Call init_random.
5793 * fns.c (Frandom): Set the seed from a string argument, if given.
5794 Remove long-obsolete Gentzel cruft.
5795 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
5796 (init_random): New function.
5797
5798 2012-09-01 Daniel Colascione <dancol@dancol.org>
5799
5800 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
5801 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
5802 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
5803 x_wm_set_size_hint, x_query_colors, x_real_positions,
5804 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
5805 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
5806 all of which have been moved to common code.
5807
5808 * xfaces.c: Include TERM_HEADER instead of listing all possible
5809 window-system headers.
5810
5811 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
5812 to match header.
5813
5814 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
5815 directly accessing frame internals.
5816
5817 * w32font.h: Include font.h. Define syms_of_w32font and
5818 globals_of_w32font.
5819
5820 * process.c: Include TERM_HEADER instead of listing all possible
5821 window-system headers.
5822
5823 * nsterm.h: Remove declarations now in frame.h.
5824 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
5825
5826 * menu.c: Include TERM_HEADER instead of listing all possible
5827 window-system headers.
5828
5829 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
5830 window system.
5831
5832 * keyboard.c: Include TERM_HEADER instead of listing all possible
5833 window-system headers.
5834
5835 * image.c: Include TERM_HEADER instead of listing all possible
5836 window-system headers. Declare Vlibrary_cache when compiling for
5837 Windows.
5838
5839 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
5840 window system declarations.
5841
5842 * frame.h: Move common functions here: set_frame_menubar,
5843 x_set_window_size, x_sync, x_get_focus_frame,
5844 x_set_mouse_position, x_set_mouse_pixel_position,
5845 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
5846 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
5847 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
5848 x_activate_menubar, x_real_positions, x_bitmap_icon,
5849 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
5850 and x_query_colors.
5851
5852 * frame.c: Include TERM_HEADER instead of listing all possible
5853 window-system headers.
5854
5855 * font.c: Include TERM_HEADER instead of listing all possible
5856 window-system headers.
5857
5858 * emacs.c: Include TERM_HEADER.
5859
5860 * dispnew.c: Include TERM_HEADER instead of listing all possible
5861 window-system headers.
5862
5863 * ccl.h: Include character.h.
5864
5865 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
5866 the current window system; include in list of objects to link into
5867 Emacs.
5868
5869 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5870
5871 Remove mark_ttys function and fix tty_display_info initialization.
5872 * lisp.h (mark_ttys): Remove prototype.
5873 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
5874 to mark_ttys because all possible values of 'top_frame' slot are
5875 the frames which are reachable from Vframe_list.
5876 * term.c (mark_ttys): Remove.
5877 (init_tty): Safely initialize 'top_frame' slot with Qnil.
5878
5879 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5880
5881 Change struct frame bitfields from unsigned char to unsigned.
5882 * frame.h (struct frame): Change type of 'display_preempted',
5883 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
5884 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
5885 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
5886 bitfields from unsigned char to unsigned.
5887
5888 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5889
5890 Remove unused member of struct x_output and struct w32_output.
5891 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
5892 * w32term.h (struct w32_output): Likewise.
5893
5894 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
5895
5896 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
5897 does not become zero (Bug#12234).
5898
5899 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
5900
5901 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
5902 for GCC 4.7.1 x86-64.
5903
5904 2012-08-30 Glenn Morris <rgm@gnu.org>
5905
5906 * lread.c (init_lread): For out-of-tree builds, only add the
5907 source directory's site-lisp dir to the load-path if it exists,
5908 consistent with in-tree builds. (Bug#12302)
5909
5910 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
5911
5912 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
5913 button_values to NULL. Call setStykeMask so dialogs get a close button.
5914 (windowShouldClose:): Set window_closed.
5915 (dealloc): New member, free button_values.
5916 (process_dialog:): Make member function. Remove window argument,
5917 replace window with self. Count buttons and allocate and store values
5918 in button_values.
5919 (addButton:value:row:): value is int with the name tag. Call setTag
5920 with tag. Remove return self, declare return value as void.
5921 (addString:row:): Remove return self, declare return value as void.
5922 (addSplit): Remove return self, declare return value as void.
5923 (clicked:): Remove return self, declare return value as void.
5924 Set dialog_return to button_values[seltag]. Code formatting change.
5925 (initFromContents:isQuestion:): Adjust call to process_dialog.
5926 Code formatting change.
5927 (timeout_handler:): Set timer_fired to YES.
5928 (runDialogAt:): Set timer_fired to NO.
5929 Handle click on close button as quit.
5930
5931 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
5932 Add window_closed and button_values. Add void as return value for
5933 add(Button|String|Split). addButton takes int instead of Lisp_Object.
5934 Add process_dialog as new member.
5935
5936 2012-08-28 Eli Zaretskii <eliz@gnu.org>
5937
5938 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
5939 is not one of the heaps we manage. (Bug#12242)
5940
5941 2012-08-28 Glenn Morris <rgm@gnu.org>
5942
5943 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
5944
5945 2012-08-28 Martin Rudalics <rudalics@gmx.at>
5946
5947 * window.c (Fset_window_configuration): Remove handling of
5948 auto-buffer-name window parameter. Install revision of reverted
5949 fix.
5950
5951 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5952
5953 Do not allow to set major mode for a dead buffer.
5954 * buffer.c (Fset_buffer_major_mode): Signal an error
5955 if the buffer is dead.
5956 (Fother_buffer, other_buffer_safely): Remove redundant
5957 nested declaration.
5958
5959 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5960
5961 Always use set_buffer_if_live to restore original buffer at unwind.
5962 * buffer.h (record_unwind_current_buffer): New function.
5963 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
5964 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
5965 * undo.c, window.c: Adjust users.
5966 * buffer.c (set_buffer_if_live): Fix comment.
5967
5968 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5969
5970 Fix usage of set_buffer_internal.
5971 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
5972 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
5973 * coding.c (decode_coding): Omit redundant test.
5974 * fileio.c (decide_coding_unwind): Likewise.
5975 * fns.c (secure_hash): Likewise.
5976 * insdel.c (modify_region): Likewise.
5977 * keyboard.c (command_loop_1): Likewise.
5978 * print.c (PRINTFINISH): Likewise.
5979 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
5980
5981 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5982
5983 * dispnew.c: Use bool for boolean.
5984 (frame_garbaged, display_completed, delayed_size_change)
5985 (fonts_changed_p, add_window_display_history)
5986 (add_frame_display_history, verify_row_hash)
5987 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
5988 (row_equal_p, realloc_glyph_pool)
5989 (allocate_matrices_for_frame_redisplay)
5990 (showing_window_margins_p)
5991 (adjust_frame_glyphs_for_frame_redisplay)
5992 (build_frame_matrix_from_leaf_window, make_current)
5993 (mirrored_line_dance, mirror_line_dance, update_frame)
5994 (update_window_tree, update_single_window)
5995 (check_current_matrix_flags, update_window, update_text_area)
5996 (update_window_line, set_window_update_flags, scrolling_window)
5997 (update_frame_1, scrolling, buffer_posn_from_coords)
5998 (do_pending_window_change, change_frame_size)
5999 (change_frame_size_1, sit_for):
6000 Use bool for boolean.
6001 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6002 and remove last int (actually boolean) argument, which was always 0.
6003 All callers changed.
6004 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6005 * dispextern.h (struct composition_it): Use bool for boolean.
6006 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6007 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6008 * dired.c (file_name_completion):
6009 Use bool for boolean. (This was missed in an earlier change.)
6010
6011 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6012
6013 * window.c (Fset_window_configuration): Revert first part of
6014 last change.
6015
6016 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6017
6018 * nsterm.h (NSPanel): New class variable dialog_return.
6019
6020 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6021 Initialize dialog_return.
6022 (windowShouldClose:): Use stop instead of stopModalWithCode.
6023 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6024 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6025 event.
6026 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6027 modal loop returns.
6028
6029 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6030
6031 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6032 * composite.c (find_composition, composition_gstring_p)
6033 (composition_reseat_it, find_automatic_composition):
6034 * data.c (let_shadows_buffer_binding_p)
6035 (let_shadows_global_binding_p, set_internal, make_blv)
6036 (Fmake_variable_buffer_local, Fmake_local_variable)
6037 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6038 (cons_to_signed, arith_driver):
6039 * dbusbind.c (xd_in_read_queued_messages):
6040 * dired.c (directory_files_internal, file_name_completion):
6041 Use bool for booleans.
6042 * dired.c (file_name_completion):
6043 * process.h (fd_callback):
6044 Omit int (actually boolean) argument. It wasn't being used.
6045 All uses changed.
6046 * composite.h, lisp.h: Reflect above API changes.
6047
6048 * cmds.c, coding.c: Use bool for booleans.
6049 * cmds.c (move_point, Fself_insert_command):
6050 * coding.h (struct composition status, struct coding_system):
6051 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6052 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6053 (emacs_mule_char, decode_coding_emacs_mule)
6054 (encode_coding_emacs_mule, detect_coding_iso_2022)
6055 (decode_coding_iso_2022, encode_invocation_designation)
6056 (encode_designation_at_bol, encode_coding_iso_2022)
6057 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6058 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6059 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6060 (encode_coding_raw_text, detect_coding_charset)
6061 (decode_coding_charset, encode_coding_charset, detect_eol)
6062 (detect_coding, get_translation_table, produce_chars)
6063 (consume_chars, reused_workbuf_in_use)
6064 (make_conversion_work_buffer, code_conversion_save)
6065 (decode_coding_object, encode_coding_object)
6066 (detect_coding_system, char_encodable_p)
6067 (Funencodable_char_position, code_convert_region)
6068 (code_convert_string, code_convert_string_norecord)
6069 (Fset_coding_system_priority):
6070 * fileio.c (Finsert_file_contents):
6071 Use bool for booleans.
6072 * coding.h, lisp.h: Reflect above API changes.
6073 * coding.c: Remove unnecessary static function decls.
6074 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6075 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6076 not a boolean 'int', since callers never look at the return value.
6077 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6078 * coding.h (decoding_buffer_size, encoding_buffer_size)
6079 (emacs_mule_string_char): Remove unused extern decls.
6080 (struct iso_2022_spec, struct coding_system):
6081 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6082 (struct emacs_mule_spec): Remove unused field 'full_support'.
6083 All initializations removed.
6084 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6085
6086 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6087
6088 Fix spare memory change (Bug#12286).
6089 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6090 (valid_lisp_object_p): Likewise.
6091
6092 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6093
6094 * window.c (Fset_window_configuration): Record any window's old
6095 buffer if it's replaced (see Bug#8789). If the new current
6096 buffer doesn't appear in the selected window, go to its old
6097 point (Bug#12208).
6098
6099 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6100
6101 Special MEM_TYPE_SPARE to denote reserved memory.
6102 * alloc.c (enum mem_type): New memory type.
6103 (refill_memory_reserve): Use new type for spare memory.
6104 This prevents live_cons_p and live_string_p from incorrect
6105 detection of uninitialized objects from spare memory as live.
6106
6107 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6108
6109 Spelling fixes.
6110 * Makefile.in (.PHONY): versioclean -> versionclean.
6111
6112 Remove unused external symbols.
6113 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6114 * window.c (Qwindow_valid_p, decode_valid_window):
6115 Now static, not extern.
6116 * data.c (Qinterval): Remove; unused.
6117 (syms_of_data): Do not define 'interval'.
6118 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6119 * window.h (decode_valid_window):
6120 Remove decls.
6121
6122 * character.c, charset.c, chartab.c: Use bool for booleans.
6123 * character.c (lisp_string_width, string_count_byte8)
6124 (string_escape_byte8):
6125 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6126 (load_charset_map_from_file, map_charset_chars)
6127 (Fdefine_charset_internal, define_charset_internal)
6128 (Fdeclare_equiv_charset, find_charsets_in_text)
6129 (Ffind_charset_region, char_charset, Fiso_charset):
6130 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6131 (sub_char_table_set, sub_char_table_set_range)
6132 (char_table_set_range, optimize_sub_char_table)
6133 (map_sub_char_table):
6134 Use bool for boolean.
6135 * character.c (str_to_unibyte): Omit last boolean argument; it was
6136 always 0. All callers changed.
6137 * character.h, charset.h: Adjust to match previous changes.
6138 * character.h (char_printable_p): Remove decl of nonexistent function.
6139 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6140 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6141 are all boolean, so make them single-bit bitfields.
6142
6143 * lisp.h (ASET): Remove attempt to detect side effects.
6144 It was meant to be temporary and it often doesn't work,
6145 because when IDX has side effects the behavior of IDX==IDX
6146 is undefined. See Stefan Monnier in
6147 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6148
6149 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6150
6151 * lisp.h (functionp): New function (extracted from Ffunctionp).
6152 (FUNCTIONP): Use it.
6153 * eval.c (Ffunctionp): Use it.
6154
6155 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6156
6157 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6158 as that's faster and simpler than static storage. Don't bother
6159 with the g_main_context_query overhead if g_main_context_pending
6160 says no events are pending.
6161 (gfds, gfds_size): Remove these static vars.
6162 (xgselect_initialize): Remove; no longer needed.
6163 All uses and decls removed.
6164
6165 * emacs.c (fatal_error_signal_hook): Remove.
6166 All uses removed. This leftover from old code was always 0.
6167
6168 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6169 * casefiddle.c (casify_object, casify_region):
6170 * casetab.c (set_case_table):
6171 * category.c, category.h (word_boundary_p):
6172 * category.h (CHAR_HAS_CATEGORY):
6173 Use bool for booleans, instead of int.
6174
6175 2012-08-25 Eli Zaretskii <eliz@gnu.org>
6176
6177 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6178
6179 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6180
6181 On assertion failure, print backtrace if available.
6182 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6183 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6184 * Makefile.in (LIB_EXECINFO): New macro.
6185 (LIBES): Use it.
6186
6187 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6188 * bytecode.c (exec_byte_code):
6189 * callint.c (check_mark, Fcall_interactively):
6190 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6191 (getenv_internal, sync_process_alive, call_process_exited):
6192 * lisp.h (USE_SAFE_ALLOCA):
6193 Use bool for booleans, instead of int.
6194 * lisp.h, process.h: Adjust prototypes to match above changes.
6195 * callint.c (Fcall_interactively): Don't assume the mark's
6196 offset fits in 'int'.
6197
6198 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6199
6200 * buffer.c, buffer.h: Use bool for boolean.
6201 * buffer.c (reset_buffer_local_variables)
6202 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6203 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6204 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6205 (overlay_touches_p, overlay_strings, Foverlay_put)
6206 (report_overlay_modification, call_overlay_mod_hooks):
6207 (mmap_enlarge, mmap_set_vars):
6208 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6209 Use bool for booleans, instead of int.
6210 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
6211 since the 1-or-0 return value is always ignored anyway.
6212 (mmap_initialized_p):
6213 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6214 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6215
6216 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6217
6218 * bidi.c: Use bool for boolean.
6219 This is a bit more readable, and makes the text segment of bidi.o
6220 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6221 Presumably it's faster too.
6222 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
6223 Now bool.
6224 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6225 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
6226 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
6227 (bidi_explicit_dir_char, bidi_level_of_next_char)
6228 (bidi_find_other_level_edge, bidi_move_to_visually_next):
6229 Use bool for booleans, instead of int.
6230 * dispextern.h (bidi_init_it, bidi_paragraph_init)
6231 (bidi_unshelve_cache): Adjust decls to match code.
6232
6233 2012-08-23 Martin Rudalics <rudalics@gmx.at>
6234
6235 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
6236 argument.
6237
6238 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6239
6240 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
6241 * atimer.h: Include <stdbool.h>.
6242
6243 2012-08-22 Dan Nicolaescu <dann@gnu.org>
6244
6245 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
6246 compile time tests instead of run time tests on systems that do
6247 not use them.
6248 (FRAME_MAC_P): Remove leftover from deleted code.
6249 * frame.c (syms_of_frame): Remove leftover from deleted code.
6250
6251 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
6252
6253 * nsterm.m (insertText:): Don't clear modifiers if code is space.
6254
6255 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
6256
6257 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
6258 Otherwise, the compiler complains about (A?B:C) where B is void
6259 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
6260 (fontset_add): Return void, for FONTSET_ADD.
6261
6262 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6263
6264 * alloc.c: Use bool for booleans.
6265 (gc_in_progress, abort_on_gc)
6266 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6267 (dont_register_blocks) [GC_MALLOC_CHECK]:
6268 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
6269 (check_string_bytes, make_specified_string, memory_full)
6270 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
6271 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
6272 (mark_stack, valid_pointer_p, make_pure_string)
6273 (Fgarbage_collect, survives_gc_p, gc_sweep):
6274 Use bool for booleans, instead of int.
6275 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6276 Remove unused local.
6277 * alloc.c (PURE_POINTER_P):
6278 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
6279 * editfns.c (Fformat):
6280 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
6281 (Fdo_auto_save):
6282 * fns.c (sweep_weak_table):
6283 * lisp.h (suppress_checking, push_message, survives_gc_p)
6284 (make_pure_string, gc_in_progress, abort_on_gc):
6285 * lread.c (readchar, read1):
6286 * print.c (Fprin1_to_string):
6287 * xdisp.c (push_message):
6288 Use bool for booleans affected directly or indirectly by
6289 alloc.c's changes.
6290
6291 Make recently-introduced setters macros.
6292 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
6293 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
6294 (set_fontset_default, set_fontset_fallback): Rename from their
6295 upper-case counterparts, and make them functions rather than macros.
6296 This is more consistent with the other recently-introduced setters.
6297 These don't need to be inline, since they're local.
6298
6299 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
6300
6301 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
6302 the loop (Bug#12247).
6303
6304 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6305
6306 * lisp.h (vcopy): Use memcpy rather than our own loop.
6307 This fixes a performance regression introduced by the recent
6308 addition of vcopy. This means 'vcopy' will need to be modified
6309 for a copying collector, but that's OK. Also, tighten the
6310 checking in the assertion.
6311
6312 2012-08-21 Eli Zaretskii <eliz@gnu.org>
6313
6314 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
6315 components for RTL text (Bug#11860). Adjust X-OFFSET of each
6316 non-base glyph for the width of the base character, according to
6317 what x_draw_composite_glyph_string_foreground expects.
6318 Generate WADJUST value according to composition_gstring_width's
6319 expectations, to produce correct width of the composed character.
6320 Reverse the sign of the DU offset produced by ScriptPlace.
6321
6322 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6323
6324 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
6325
6326 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6327
6328 Avoid direct writes to contents member of struct Lisp_Vector.
6329 * lisp.h (vcopy): New function to copy data into vector.
6330 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
6331 * fns.c (Ffillarray): Use ASET.
6332 * keyboard.c (timer_check_2): Use AREF and ASET.
6333 (append_tool_bar_item, Frecent_keys): Use vcopy.
6334 * lread.c (read_vector): Use ASET.
6335 * msdos.c (Frecent_doskeys): Use vcopy.
6336 * xface.c (Finternal_copy_lisp_face): Use vcopy.
6337 (Finternal_merge_in_global_face): Use ASET and vcopy.
6338 * xfont.c (xfont_list_pattern): Likewise.
6339
6340 2012-08-21 Martin Rudalics <rudalics@gmx.at>
6341
6342 * window.c (Fwindow_point): For the selected window always return
6343 the position of its buffer's point.
6344 (Fset_window_point): For the selected window always go in its
6345 buffer to the specified position.
6346
6347 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6348
6349 Setter macros for fontsets.
6350 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
6351 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
6352 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
6353 Adjust users.
6354
6355 2012-08-20 Glenn Morris <rgm@gnu.org>
6356
6357 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6358 Don't assume that `ln -f' works.
6359
6360 2012-08-20 Eli Zaretskii <eliz@gnu.org>
6361
6362 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
6363 and later about non-assignments with no effect. See discussion at
6364 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
6365 details.
6366
6367 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6368
6369 Inline setter functions for Lisp_Objects slots of struct specbinding.
6370 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
6371 Adjust users.
6372
6373 2012-08-20 Martin Rudalics <rudalics@gmx.at>
6374
6375 * window.c (select_window): Always make selected window's buffer
6376 current.
6377
6378 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6379
6380 Use AREF and ASET for docstrings of category tables.
6381 * category.h (CATEGORY_DOCSTRING): Use AREF.
6382 (SET_CATEGORY_DOCSTRING): Use ASET.
6383 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
6384
6385 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6386
6387 Inline setter functions for hash table members.
6388 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
6389 (set_hash_hash, set_hash_index): Rename with _slot suffix.
6390 (set_hash_key_and_value, set_hash_index, set_hash_next)
6391 (set_hash_hash): New functions.
6392 * charset.c, fns.c: Adjust users.
6393
6394 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6395
6396 Inline getter and setter functions for per-buffer values.
6397 * buffer.h (per_buffer_default, set_per_buffer_default)
6398 (per_buffer_value, set_per_buffer_value): New functions.
6399 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
6400 * buffer.c, data.c: Adjust users.
6401
6402 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
6403
6404 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
6405
6406 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
6407
6408 Rely on <config.h> + <unistd.h> to declare 'environ',
6409 as gnulib does this if the system doesn't.
6410 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
6411 Remove declaration. MS-Windows declares it on stdlib.h which is
6412 included by conf_post.h.
6413 * emacs.c (environ) [DOUG_LEA_MALLOC]:
6414 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
6415 * vm-limit.c: Include <unistd.h>, for 'environ'.
6416
6417 * unexaix.c, unexcoff.c: Include "mem-limits.h".
6418 (start_of_data): Remove decl; mem-limits.h provides it.
6419
6420 * xdisp.c (handle_invisible_prop): Make it a bit faster
6421 and avoid a gcc -Wmaybe-uninitialized diagnostic.
6422
6423 2012-08-19 Chong Yidong <cyd@gnu.org>
6424
6425 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
6426 ends (Bug#3874).
6427
6428 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
6429
6430 * .gdbinit: Use call instead of set when calling a function in the
6431 inferior.
6432
6433 * data.c (set_internal): Don't use set_blv_found.
6434 (Fkill_local_variable): Likewise.
6435
6436 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
6437
6438 * nsfont.m (ns_ascii_average_width): Ensure the string
6439 ascii_printable is initialized with a null-terminated character
6440 array. Otherwise, it can contain undesired extra characters.
6441
6442 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6443
6444 port new setting code to Sun C 5.8 2005/10/13
6445 * chartab.c, lisp.h (char_table_set, char_table_set_range):
6446 Return void, not Lisp_Object. Otherwise, the compiler
6447 complains about (A?B:C) where B is void and C is Lisp_Object
6448 when compiling CHAR_TABLE_SET, due to the recent change to
6449 the API of sub_char_table_set_contents.
6450
6451 2012-08-18 Chong Yidong <cyd@gnu.org>
6452
6453 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
6454 for the string case (Bug#3874).
6455
6456 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6457
6458 * buffer.h (BSET): Remove (Bug#12215).
6459 Replace all uses with calls to new setter functions.
6460 (bset_bidi_paragraph_direction, bset_case_canon_table)
6461 (bset_case_eqv_table, bset_directory, bset_display_count)
6462 (bset_display_time, bset_downcase_table)
6463 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
6464 (bset_last_selected_window, bset_local_var_alist)
6465 (bset_mark_active, bset_point_before_scroll, bset_read_only)
6466 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
6467 (bset_width_table):
6468 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6469 (bset_auto_fill_function, bset_auto_save_file_format)
6470 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6471 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6472 (bset_cache_long_line_scans, bset_case_fold_search)
6473 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6474 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6475 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6476 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6477 (bset_header_line_format, bset_indicate_buffer_boundaries)
6478 (bset_indicate_empty_lines, bset_invisibility_spec)
6479 (bset_left_fringe_width, bset_major_mode, bset_mark)
6480 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6481 (bset_name, bset_overwrite_mode, bset_pt_marker)
6482 (bset_right_fringe_width, bset_save_length)
6483 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6484 (bset_scroll_up_aggressively, bset_selective_display)
6485 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6486 (bset_word_wrap, bset_zv_marker):
6487 * category.c (bset_category_table):
6488 * syntax.c (bset_syntax_table):
6489 New setter functions.
6490
6491 * process.h (PSET): Remove (Bug#12215).
6492 Replace all uses with calls to new setter functions.
6493 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6494 (PROCESS_INLINE): New macro.
6495 (pset_childp): New setter function.
6496 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
6497 * process.c (PROCESS_INLINE):
6498 Define to EXTERN_INLINE, so that the corresponding functions
6499 are compiled into code.
6500 (pset_buffer, pset_command, pset_decode_coding_system)
6501 (pset_decoding_buf, pset_encode_coding_system)
6502 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
6503 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
6504 (pset_type, pset_write_queue): New setter functions.
6505
6506 * window.h (WSET): Remove (Bug#12215).
6507 Replace all uses with calls to new setter functions.
6508 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6509 (WINDOW_INLINE): New macro.
6510 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
6511 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
6512 (wset_total_lines, wset_vertical_scroll_bar)
6513 (wset_window_end_pos, wset_window_end_valid)
6514 (wset_window_end_vpos): New setter functions.
6515 * window.c (WINDOW_INLINE):
6516 Define to EXTERN_INLINE, so that the corresponding functions
6517 are compiled into code.
6518 (wset_combination_limit, wset_dedicated, wset_display_table)
6519 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
6520 (wset_new_normal, wset_new_total, wset_next_buffers)
6521 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6522 (wset_prev_buffers, wset_right_fringe_width)
6523 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
6524 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
6525 (wset_window_parameters):
6526 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6527 (wset_column_number_displayed, wset_region_showing):
6528 New setter functions.
6529
6530 * termhooks.h (TSET): Remove (Bug#12215).
6531 Replace all uses with calls to new setter functions.
6532 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6533 (TERMHOOKS_INLINE): New macro.
6534 (tset_charset_list, tset_selection_alist): New setter functions.
6535 * terminal.c (TERMHOOKS_INLINE):
6536 Define to EXTERN_INLINE, so that the corresponding functions
6537 are compiled into code.
6538 (tset_param_alist): New setter function.
6539
6540 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6541
6542 * keyboard.h (KSET): Remove (Bug#12215).
6543 Replace all uses with calls to new setter functions.
6544 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6545 (KEYBOARD_INLINE): New macro.
6546 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
6547 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
6548 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
6549 New setter functions.
6550 * keyboard.c (KEYBOARD_INLINE):
6551 Define to EXTERN_INLINE, so that the corresponding functions
6552 are compiled into code.
6553 (kset_echo_string, kset_kbd_queue)
6554 (kset_keyboard_translate_table, kset_last_prefix_arg)
6555 (kset_last_repeatable_command, kset_local_function_key_map)
6556 (kset_overriding_terminal_local_map, kset_real_last_command)
6557 (kset_system_key_syms): New setter functions.
6558
6559 * frame.h (FSET): Remove (Bug#12215).
6560 Replace all uses with calls to new setter functions.
6561 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6562 (FRAME_INLINE): New macro.
6563 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
6564 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
6565 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
6566 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
6567 (fset_param_alist, fset_root_window, fset_scroll_bars)
6568 (fset_selected_window, fset_title, fset_tool_bar_items)
6569 (fset_tool_bar_position, fset_tool_bar_window): New functions.
6570 * frame.c (FRAME_INLINE):
6571 Define to EXTERN_INLINE, so that the corresponding functions
6572 are compiled into code.
6573 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
6574
6575 A few more naming-convention fixes for getters and setters.
6576 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
6577 and rename from buffer_overlays_set_before.
6578 (set_buffer_overlays_after): Move here from buffer.h, and rename
6579 from buffer_overlays_set_after.
6580 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
6581 All uses changed.
6582 (set_buffer_intervals): Rename from buffer_set_intervals.
6583 * intervals.c (set_interval_object): Move here from intervals.h,
6584 and rename from interval_set_object.
6585 (set_interval_left): Move here from intervals.h, and rename from
6586 interval_set_left.
6587 (set_interval_right): Move here from intervals.h, and rename from
6588 interval_set_right.
6589 (copy_interval_parent): Move here from intervals.h, and rename from
6590 interval_copy_parent.
6591 * intervals.h (set_interval_parent): Rename from interval_set_parent.
6592 (set_interval_plist): Rename from interval_set_plist.
6593 Return void, not Lisp_Object, since no caller uses the result.
6594 * lisp.h (string_intervals): Rename from string_get_intervals.
6595 (set_string_intervals): Rename from string_set_intervals.
6596
6597 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
6598 (set_char_table_contents): Rename from char_table_set_contents.
6599 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
6600 All uses changed. See the end of
6601 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
6602
6603 * lisp.h (CSET): Remove (Bug#12215).
6604 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
6605 (set_char_table_purpose): New functions,
6606 replacing CSET. All uses changed. For example, replace
6607 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
6608 "set_char_table_parent (char_table, parent);".
6609 The old version was confusing because it used the same name
6610 'parent' for two different things.
6611
6612 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6613
6614 Functions to get and set Lisp_Object fields of buffer-local variables.
6615 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
6616 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
6617 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
6618 * data.c, eval.c, frame.c: Adjust users.
6619
6620 2012-08-17 Chong Yidong <cyd@gnu.org>
6621
6622 * xfaces.c (merge_face_vectors): If the target font specfies a
6623 font spec, make the font's attributes take precedence over
6624 directly-specified attributes.
6625 (merge_face_ref): Recognize :font.
6626
6627 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6628
6629 Do not use memcpy for copying intervals.
6630 * intervals.c (reproduce_interval): New function.
6631 (reproduce_tree, reproduce_tree_obj): Use it.
6632 (reproduce_tree_obj): Remove prototype.
6633
6634 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6635
6636 * lisp.h (duration_to_sec_usec): Remove unused decl.
6637
6638 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
6639
6640 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
6641 to an allocated instance of NSString, not to the class itself.
6642
6643 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
6644
6645 * makefile.w32-in (C_CTYPE_H): New macro.
6646 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
6647 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
6648 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6649
6650 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
6651
6652 Use ASCII tests for character types.
6653 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
6654 * xfns.c, xterm.c:
6655 Don't include <ctype.h>; was not needed.
6656 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
6657 * sysdep.c, xfaces.c:
6658 Include <c-ctype.h> instead of <ctype.h>.
6659 * nsterm.m: Include <c-ctype.h>.
6660 * charset.c (read_hex):
6661 * doc.c (Fsnarf_documentation):
6662 * fileio.c (IS_DRIVE) [WINDOWSNT]:
6663 (DRIVE_LETTER) [DOS_NT]:
6664 (Ffile_name_directory, Fexpand_file_name)
6665 (Fsubstitute_in_file_name):
6666 * font.c (font_parse_xlfd, font_parse_fcname):
6667 * frame.c (x_set_font_backend):
6668 * gtkutil.c (xg_get_font):
6669 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
6670 * nsimage.m (hexchar):
6671 * nsterm.m (ns_xlfd_to_fontname):
6672 * sysdep.c (system_process_attributes):
6673 * xfaces.c (hash_string_case_insensitive):
6674 Use C-locale tests instead of locale-specific tests for character
6675 types, since we want the ASCII interpretation here, not the
6676 interpretation suitable for whatever happens to be the current locale.
6677
6678 2012-08-16 Martin Rudalics <rudalics@gmx.at>
6679
6680 Consistently check windows for validity/liveness
6681 (Bug#11984, Bug#12025, Bug#12026).
6682 * lisp.h (CHECK_VALID_WINDOW): New macro.
6683 * window.c (decode_window): Rename to decode_live_window.
6684 (decode_valid_window, Fwindow_valid_p): New functions.
6685 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
6686 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
6687 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
6688 (Fwindow_prev_sibling, Fwindow_combination_limit)
6689 (Fset_window_combination_limit, Fwindow_use_time)
6690 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
6691 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
6692 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
6693 (Fwindow_hscroll, Fset_window_hscroll)
6694 (Fwindow_redisplay_end_trigger)
6695 (Fset_window_redisplay_end_trigger, Fwindow_edges)
6696 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
6697 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6698 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
6699 (Fwindow_end, Fset_window_point, Fset_window_start)
6700 (Fpos_visible_in_window_p, Fwindow_line_height)
6701 (Fwindow_dedicated_p, Fset_window_dedicated_p)
6702 (Fwindow_prev_buffers, Fset_window_prev_buffers)
6703 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
6704 (Fset_window_parameter, Fwindow_display_table)
6705 (Fset_window_display_table, Fdelete_other_windows_internal)
6706 (Fset_window_buffer, Fset_window_new_total)
6707 (Fset_window_new_normal, Fdelete_window_internal)
6708 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
6709 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
6710 (Fwindow_scroll_bars): Check whether argument window is a valid or
6711 live window. Update doc-strings.
6712 (syms_of_window): New symbol Qwindow_valid_p.
6713 * keyboard.c (Fposn_at_x_y): Check whether argument
6714 frame_or_window denotes a valid window.
6715
6716 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6717
6718 Fix previous char table change.
6719 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
6720 * chartab.c (optimize_sub_char_table): Likewise.
6721
6722 2012-08-16 Chong Yidong <cyd@gnu.org>
6723
6724 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
6725
6726 * xfont.c (xfont_open):
6727 * xftfont.c (xftfont_open): Set the font's max_width field.
6728
6729 * nsfont.m (nsfont_open): Similar to the Xft backend, set
6730 min_width to space_width and average_width to the average over
6731 printable ASCII characters.
6732 (ns_char_width): Code cleanup.
6733 (ns_ascii_average_width): New utility function.
6734
6735 * font.h (struct font): Update comments.
6736
6737 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6738
6739 Simple interface to set Lisp_Object fields of character tables.
6740 * lisp.h (CSET): New macro.
6741 (char_table_set_extras, char_table_set_contents)
6742 (sub_char_table_set_contents): New function.
6743 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
6744 * syntax.c: Adjust users.
6745
6746 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
6747
6748 * eval.c (eval_sub): Bind lexical-binding.
6749 * lread.c (Qlexical_binding): Make non-static.
6750
6751 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
6752
6753 * nsmenu.m (popupSession): Remove.
6754 (pop_down_menu): Remove endModalSession.
6755 (timeout_handler:): New method.
6756 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
6757 Call runModalForWindow. Check timer_fired when it returns.
6758 If not set, cancel timer and break out of loop.
6759 Otherwise loop again, with a new timeout.
6760
6761 * nsterm.m: Include fcntl.h if present.
6762 (fd_entry, t_readfds, inNsSelect): Remove.
6763 (select_writefds, select_valid, select_timeout, selfds)
6764 (select_mutex, apploopnr): Add.
6765 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
6766 Otherwise call kbd_buffer_store_event.
6767 (ns_send_appdefined): Remove release of fd_entry.
6768 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
6769 Increment and decrement apploopnr.
6770 (ns_select): If no file descriptors, just do a NSTimer.
6771 Otherwise copy read/write masks and start select thread (fd_handler).
6772 Start main loop and wait for application defined event.
6773 Inform select thread to stop selecting after main loop is exited.
6774 (ns_term_init): Create selfds pipe and set non-blocking.
6775 Initialize select_mutex. Start the select thread (fd_handler).
6776 (fd_handler:): Loop forever, wait for info from the main thread
6777 to either start or stop selecting. When select returns, send
6778 and appdefined event.
6779 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
6780 If not call kbd_buffer_store_event.
6781
6782 * nsterm.h (EmacsApp): fd_handler takes id argument.
6783 (EmacsDialogPanel): Add timer_fired and timeout_handler.
6784
6785 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
6786
6787 2012-08-15 Eli Zaretskii <eliz@gnu.org>
6788
6789 * region-cache.c (move_cache_gap): Update gap_len using the actual
6790 growth of the boundaries array. Do not change cache_len.
6791 (Bug#12196)
6792
6793 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6794
6795 Generalize and cleanup font subsystem checks.
6796 * font.h (FONT_DEBUG, font_assert): Remove.
6797 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
6798 Change font_assert to eassert. Use eassert where appropriate.
6799
6800 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6801
6802 * gtkutil.c (xg_get_font): Use pango_units_to_double.
6803
6804 2012-08-15 Chong Yidong <cyd@gnu.org>
6805
6806 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
6807 When using the new font chooser, use gtk_font_chooser_get_font_desc to
6808 extract the font descriptor instead of just the font name.
6809 In that case, return a font spec instead of a string.
6810 (x_last_font_name): Move to this file from xfns.c.
6811
6812 * xfns.c (Fx_select_font): The return value can also be a font
6813 spec. Move x_last_font_name management to gtkutil.c.
6814
6815 * xfaces.c: Make font weight and style symbols non-static.
6816
6817 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
6818
6819 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
6820 (bug#12117).
6821
6822 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
6823
6824 * alloc.c (Fgarbage_collect): Use plural form consistently.
6825
6826 2012-08-14 Eli Zaretskii <eliz@gnu.org>
6827
6828 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
6829 iteration through the command loop. Fixes a problem whereby mouse
6830 movements are ignored until the first mouse click.
6831
6832 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6833
6834 Use bool, not int, for Lisp booleans.
6835 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
6836 makes Emacs a bit smaller and presumably a bit faster.
6837 * lisp.h: Include <stdbool.h>.
6838 (struct Lisp_Boolfwd, defvar_bool):
6839 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
6840 * regex.c [!emacs]: Include <stdbool.h>.
6841 (false, true): Remove; <stdbool.h> does this for us now.
6842
6843 2012-08-14 Chong Yidong <cyd@gnu.org>
6844
6845 * character.c (Fcharacterp): Doc fix (Bug#12076).
6846
6847 * data.c (Findirect_variable): Doc fix (Bug#11040).
6848
6849 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
6850
6851 * editfns.c (Fformat): Doc fix (Bug#12059).
6852 (Fsave_current_buffer): Doc fix (Bug#11542).
6853
6854 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6855
6856 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
6857 (bug#12022).
6858
6859 2012-08-14 Martin Rudalics <rudalics@gmx.at>
6860
6861 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
6862 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
6863 * minibuf.c (choose_minibuf_frame, read_minibuf):
6864 * w32fns.c (x_create_tip_frame):
6865 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
6866 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
6867
6868 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6869
6870 * intervals.c (offset_intervals): Remove obsolete comment.
6871
6872 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
6873
6874 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
6875
6876 2012-08-14 Gergely Risko <gergely@risko.hu>
6877
6878 * coding.c (decode_coding): Record buffer modification before
6879 disabling undo_list (Bug#11773).
6880
6881 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6882
6883 Revert and cleanup some recent overlay changes.
6884 * buffer.h (enum overlay_type): Remove.
6885 (buffer_get_overlays, buffer_set_overlays): Likewise.
6886 (buffer_set_overlays_before, buffer_set_overlays_after):
6887 New function. Adjust users.
6888 (unchain_both): Add eassert.
6889
6890 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6891
6892 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
6893
6894 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6895
6896 * gtkutil.c (xg_mark_data): Don't assume C99.
6897
6898 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
6899
6900 * gtkutil.c (xg_frame_tb_info): New struct.
6901 (TB_INFO_KEY): New define.
6902 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
6903 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
6904 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
6905 if not present.
6906 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
6907 is up to date. Otherwise store new data.
6908 (free_frame_tool_bar): Free xg_frame_tb_info if present.
6909
6910 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6911
6912 Use KSET for write access to Lisp_Object members of struct kboard.
6913 * keyboard.h (KSET): New macro.
6914 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
6915 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
6916 * xterm.c: Adjust users.
6917
6918 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6919
6920 Use BSET for write access to Lisp_Object members of struct buffer.
6921 * buffer.h (BSET): New macro.
6922 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
6923 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
6924 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
6925 * window.c, xdisp.c, xfns.c: Adjust users.
6926
6927 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
6928
6929 * lread.c (syms_of_lread): Initialize Vlexical_binding.
6930
6931 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
6932
6933 * nsterm.m (not_in_argv): New function.
6934 (application:openFile, application:openTempFile:):
6935 (application:openFileWithoutUI:, application:openFiles:): Open file
6936 if not_in_argv returns non-zero (bug#12171).
6937
6938 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
6939 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
6940 Define for Gtk+ versions less than 3.2.
6941 (xg_get_font_name): Use those functions/macros here.
6942 Reported by Frans Oilinki <moilinki@gmail.com>.
6943
6944 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6945
6946 * unexmacosx.c (copy_data_segment): Copy initialized data in
6947 statically linked libraries from input file rather than memory.
6948
6949 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
6950 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
6951 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
6952
6953 2012-08-10 Glenn Morris <rgm@gnu.org>
6954
6955 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
6956 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
6957
6958 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6959
6960 Fix last change to allow compilation with low optimization levels.
6961 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
6962 Reported by Jan Djärv <jan.h.d@swipnet.se>.
6963
6964 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6965
6966 Use common inline syntax in intervals.h.
6967 * intervals.h (INTERVALS_INLINE): New macro.
6968 Change all users from LISP_INLINE.
6969
6970 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6971
6972 Define Qnone once for all platforms.
6973 * frame.c (Qnone): Define here.
6974 (syms_of_frame): DEFSYM it.
6975 * lisp.h (Qnone): New declaration.
6976 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
6977 * xfns.c: Remove duplication. Adjust users.
6978
6979 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6980
6981 Remove unused macros from intervals.h.
6982 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
6983 * intervals.c: Adjust comment.
6984
6985 2012-08-10 Eli Zaretskii <eliz@gnu.org>
6986
6987 * w32fns.c <w32_unicode_gui>: New static variable.
6988 (globals_of_w32fns): Initialize it according to os_subtype.
6989 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
6990 testing os_subtype.
6991
6992 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
6993 Eli Zaretskii <eliz@gnu.org>
6994
6995 Fix bug #10299 with Unicode characters sent by customized
6996 keyboards created by MSKLC.
6997 * w32fns.c (INIT_WINDOW_CLASS): New macro.
6998 (w32_init_class): Use it to initialize the Emacs class with either
6999 ANSI or Unicode API calls.
7000 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7001 later.
7002 (w32_wnd_proc): If the character code sent by WM_CHAR or
7003 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7004 original message. Call DefWindowProcW on NT and later.
7005
7006 2012-08-10 Glenn Morris <rgm@gnu.org>
7007
7008 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7009
7010 * lisp.h (DIRECTORY_SEP): Let configure set it.
7011
7012 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7013
7014 Use TSET for write access to Lisp_Object slots of struct terminal.
7015 * termhooks.h (TSET): New macro.
7016 * coding.c, terminal.c, xselect.c: Adjust users.
7017
7018 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7019
7020 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7021 the failing expression, include them in the error message.
7022 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7023 * lisp.h (internal_condition_case_n): Update declaration.
7024
7025 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7026
7027 Inline functions to examine and change buffer overlays.
7028 * buffer.c (unchain_both): New function.
7029 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7030 (buffer_has_overlays): New function.
7031 (enum overlay_type): New enum.
7032 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7033 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7034
7035 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7036
7037 Inline functions to examine and change buffer intervals.
7038 * alloc.c (mark_interval_tree): Remove.
7039 (MARK_INTERVAL_TREE): Simplify.
7040 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7041 * intervals.c (buffer_balance_intervals): New function.
7042 (graft_intervals_into_buffer): Adjust indentation.
7043 (set_intervals_multibyte): Simplify.
7044 * buffer.h (BUF_INTERVALS): Remove.
7045 (buffer_get_intervals, buffer_set_intervals): New function.
7046 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7047 * intervals.c, textprop.c: Adjust users.
7048
7049 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7050
7051 Inline functions to examine and change string intervals.
7052 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7053 (string_get_intervals, string_set_intervals): New function.
7054 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7055 * lread.c, print.c, textprop.c: Adjust users.
7056
7057 2012-08-08 Glenn Morris <rgm@gnu.org>
7058
7059 * lisp.mk (lisp): Remove language/persian.elc.
7060
7061 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7062
7063 Cleanup intervals.
7064 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7065 (NULL_INTERVAL_P): Likewise. Adjust users.
7066 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7067 Adjust comment. Move under #if 0.
7068 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7069 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7070
7071 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7072
7073 Check total length of intervals with eassert.
7074 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7075 * intervals.c: Change all users to eassert.
7076
7077 2012-08-07 Eli Zaretskii <eliz@gnu.org>
7078
7079 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7080 Rename fields to match removal of FGET and WGET and disuse of
7081 INTERNAL_FIELD in Lisp_Cons.
7082
7083 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7084
7085 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7086 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7087 name since all xname users are fixed long time ago. Do not
7088 use INTERNAL_FIELD.
7089 (set_symbol_name, set_symbol_function, set_symbol_plist):
7090 (set_symbol_next, set_overlay_plist): New function.
7091 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7092 (struct Lisp_Overlay): Likewise.
7093 (CVAR, MVAR, SVAR): Remove.
7094 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7095 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7096 * xterm.c: Adjust users.
7097 * .gdbinit: Change to use name field of struct Lisp_Symbol
7098 where appropriate.
7099
7100 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7101
7102 Basic functions to set Lisp_Object and pointer slots of intervals.
7103 * intervals.h (interval_set_parent, interval_set_object):
7104 (interval_set_left, interval_set_right, interval_set_plist):
7105 (interval_copy_parent): New function.
7106 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
7107 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7108 Adjust indentation.
7109 (INTERVAL_SIZE): Remove. Adjust users.
7110 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7111
7112 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7113
7114 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7115 * process.h (PGET): Remove.
7116 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7117 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7118
7119 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7120
7121 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7122 * window.h (WGET): Remove.
7123 (struct window): Do not use INTERNAL_FIELD.
7124 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7125 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7126 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7127 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7128 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7129 Adjust users.
7130
7131 2012-08-07 Chong Yidong <cyd@gnu.org>
7132
7133 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7134 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7135 (Fdelete_window_internal): Signal an error if the window is not on
7136 a live frame (Bug#12025).
7137
7138 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7139
7140 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7141 * frame.h (FGET): Remove.
7142 (struct frame): Do not use INTERNAL_FIELD.
7143 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7144 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7145 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7146 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7147
7148 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
7149
7150 * w32.c: Silence compiler warnings.
7151 (map_w32_filename): Remove unused variable `is_fat'.
7152 (chase_symlinks): Add parentheses around expression.
7153
7154 2012-08-06 Glenn Morris <rgm@gnu.org>
7155
7156 * sysdep.c: Respect BROKEN_GETWD.
7157
7158 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7159 Let configure handle it.
7160 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7161
7162 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7163
7164 Use GCALIGNMENT where appropriate.
7165 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7166 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7167 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7168
7169 2012-08-06 Eli Zaretskii <eliz@gnu.org>
7170
7171 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7172 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
7173
7174 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7175
7176 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7177 that should be sufficient for everyone.
7178
7179 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7180
7181 * keyboard.c (timer_check_2): Add break so timer_check returns next
7182 timeout.
7183
7184 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7185
7186 Fix Windows build errors introduced after converting to WGET and WSET.
7187 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7188 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7189
7190 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7191
7192 * nsterm.m (ns_frame_rehighlight): Use FSET.
7193
7194 * nsmenu.m (ns_update_menubar): Use FSET.
7195
7196 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7197
7198 Separate read and write access to Lisp_Object slots of Lisp_Process.
7199 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7200 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7201
7202 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7203
7204 Separate read and write access to Lisp_Object slots of struct window.
7205 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7206 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7207 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7208 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7209 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7210 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7211 Adjust users.
7212
7213 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7214
7215 Fix Windows build errors introduced after converting to FGET and FSET.
7216 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7217 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7218 (w32_judge_scroll_bars): Change to use FSET.
7219 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7220
7221 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7222
7223 Fix replacement typo.
7224 * window.c (replace_window): Set root_window instead of
7225 selected_window. This fixes a total window subsystem
7226 malfunction reported by Bastien Guerry <bzg@gnu.org>.
7227
7228 2012-08-06 Glenn Morris <rgm@gnu.org>
7229
7230 * lisp.mk (lisp): Add language/persian.elc.
7231
7232 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7233
7234 Separate read and write access to Lisp_Object slots of struct frame.
7235 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
7236 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7237 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7238 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7239 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7240
7241 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
7242
7243 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
7244
7245 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
7246
7247 Generalize common compile-time constants.
7248 * lisp.h (header_size, bool_header_size, word_size): Now here.
7249 (struct Lisp_Vector): Add comment.
7250 (struct Lisp_Bool_Vector): Move up to define handy constants.
7251 (VECSIZE, PSEUDOVECSIZE): Simplify.
7252 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
7253 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
7254 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
7255 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
7256 * xfont.c, xmenu.c: Use word_size where appropriate.
7257
7258 2012-08-05 Lawrence Mitchell <wence@gmx.li>
7259
7260 * search.c (Freplace_match): Treat \? in the replacement text
7261 literally (Bug#8161).
7262
7263 2012-08-05 Chong Yidong <cyd@gnu.org>
7264
7265 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
7266 * frame.c (Vdelete_frame_functions):
7267 * emacs.c (Vkill_emacs_hook): Doc fix.
7268
7269 2012-08-04 Eli Zaretskii <eliz@gnu.org>
7270
7271 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
7272 --with-x-toolkit=no builds.
7273 Reported by Carsten Mattner <carstenmattner@gmail.com>.
7274
7275 2012-08-04 Chong Yidong <cyd@gnu.org>
7276
7277 * syntax.c (Fmodify_syntax_entry): Doc fix.
7278
7279 2012-08-04 Eli Zaretskii <eliz@gnu.org>
7280
7281 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
7282 * w32.c (init_environment): Change the default values of many
7283 environment variables in dflt_envvars[] to NULL, to avoid pushing
7284 them into environment when they were not already defined.
7285 Remove the code that deletes site-lisp subdirectories from the default
7286 value of EMACSLOADPATH, as it is no longer needed.
7287 (check_windows_init_file): Now external, not static.
7288 Use Vload_path as is, without adding anything, as this function is now
7289 called when Vload_path is already set up.
7290
7291 * w32.h (check_windows_init_file): Add prototype.
7292
7293 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
7294 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
7295 compatibility with Posix platforms.
7296 (main): Move the call to check_windows_init_file to here from
7297 w32.c.
7298 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
7299 any, in the DEFALT argument into the root of the Emacs build or
7300 installation tree, as appropriate.
7301
7302 * callproc.c (init_callproc_1): Call decode_env_path instead of
7303 doing its equivalent by hand.
7304 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
7305 the code that sets Vexec_path run on MS-Windows.
7306
7307 * lread.c (init_lread): Add comments to #ifdef's.
7308
7309 * msdos.c (dos_set_window_size, IT_update_begin)
7310 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
7311 instead of direct references.
7312
7313 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
7314
7315 Export DEFAULT_REHASH_* to GDB.
7316 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
7317 Now constants, not macros.
7318
7319 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
7320
7321 Remove unnecessary casts involving pointers.
7322 These casts are no longer needed now that we assume C89 or later,
7323 since they involve casting to or from void *.
7324 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
7325 (make_pure_float, make_pure_vector):
7326 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
7327 * macros.c (Fstart_kbd_macro):
7328 * menu.c (find_and_return_menu_selection):
7329 * minibuf.c (read_minibuf_noninteractive):
7330 * sysdep.c (closedir):
7331 * xdisp.c (x_produce_glyphs):
7332 * xfaces.c (compare_fonts_by_sort_order):
7333 * xfns.c (x_real_positions, select_visual):
7334 * xselect.c (x_stop_queuing_selection_requests)
7335 (x_get_window_property, x_get_window_property_as_lisp_data):
7336 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
7337 Remove unnecessary pointer casts.
7338 * alloc.c (record_xmalloc): New function.
7339 * lisp.h (record_xmalloc): New decl.
7340 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
7341 more like a function. This is because the pointer cast is not
7342 needed. All uses changed.
7343 * print.c (print_string, print_error_message): Avoid length recalc.
7344
7345 Improve fix for macroexp crash with debugging (Bug#12118).
7346 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
7347 ARRAY_MARK_FLAG when checking subscripts, because ASET is
7348 not supposed to be invoked from the garbage collector.
7349 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
7350 (gc_aset): New function, which is like ASET but can be
7351 used in the garbage collector.
7352 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7353 (set_hash_index): Use it instead of ASET.
7354
7355 2012-08-03 Eli Zaretskii <eliz@gnu.org>
7356
7357 Support symlinks on latest versions of MS-Windows.
7358 * w32.c: Include winioctl.h and aclapi.h.
7359 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
7360 (revert_to_self): Forward declarations of static functions.
7361 <static BOOL g_b_init_get_security_info>:
7362 <g_b_init_create_symbolic_link>: New static flags.
7363 (globals_of_w32): Initialize them to zero.
7364 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
7365 (map_w32_filename): Improve commentary. Simplify switch.
7366 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
7367 headers (most versions of MinGW w32api don't).
7368 (get_security_info, create_symbolic_link)
7369 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
7370 New functions.
7371 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
7372 in the argument file name.
7373 (sys_access): Call unc_volume_file_attributes only if
7374 GetFileAttributes fails with network-related error codes.
7375 (sys_rename): Diagnose renaming of a symlink when the user doesn't
7376 have the required privileges.
7377 (get_file_security_desc_by_name): Rename from
7378 get_file_security_desc.
7379 (stat_worker): New function, with most of the guts of 'stat', and
7380 with addition of handling of symlinks and support for 'lstat'.
7381 If possible, get file's attributes and security information by
7382 handle, not by name. Produce S_IFLNK bit for symlinks, when
7383 called from 'lstat'.
7384 (stat, lstat): New functions, call 'stat_worker'.
7385 (symlink, readlink, careadlinkat): Rewritten to create and resolve
7386 symlinks when the underlying filesystem supports them.
7387
7388 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7389
7390 Fix macroexp crash on Windows with debugging (Bug#12118).
7391 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
7392 checking subscripts; problem introduced with the recent
7393 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
7394 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
7395 since it's used in non-static inline functions now.
7396
7397 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
7398 Don't assume buffer size fits in 'int'. Remove unused local.
7399
7400 Use C99-style 'extern inline' if available.
7401 * buffer.h (BUFFER_INLINE):
7402 * category.h (CATEGORY_INLINE):
7403 * character.h (CHARACTER_INLINE):
7404 * charset.h (CHARSET_INLINE):
7405 * composite.h (COMPOSITE_INLINE):
7406 * dispextern.h (DISPEXTERN_INLINE):
7407 * lisp.h (LISP_INLINE):
7408 * systime.h (SYSTIME_INLINE):
7409 New macro, replacing 'static inline' in this header.
7410 * buffer.h, category.h, character.h, charset.h, composite.h:
7411 * dispextern.h, lisp.h, systime.h:
7412 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7413 * alloc.c (LISP_INLINE):
7414 * buffer.c (BUFFER_INLINE):
7415 * category.c (CATEGORY_INLINE):
7416 * character.c (CHARACTER_INLINE):
7417 * charset.c (CHARSET_INLINE):
7418 * composite.c (COMPOSITE_INLINE):
7419 * dispnew.c (DISPEXTERN_INLINE):
7420 * sysdep.c (SYSTIME_INLINE):
7421 Define to EXTERN_INLINE, so that the corresponding functions
7422 are compiled into code.
7423 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
7424 (INLINE_HEADER_END): New macros.
7425 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
7426 since it's used in non-static inline functions now.
7427 (VALMASK) [!USE_LSB_TAG]: Likewise.
7428
7429 2012-08-02 Glenn Morris <rgm@gnu.org>
7430
7431 * s/: Remove empty directory.
7432
7433 * s/ms-w32.h: Move to ../nt/inc.
7434 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
7435 Update for new ms-w32.h location.
7436
7437 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7438
7439 Port to Solaris 8.
7440 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
7441
7442 2012-08-02 Glenn Morris <rgm@gnu.org>
7443
7444 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
7445 hard-coding the path separator.
7446
7447 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7448
7449 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
7450 This how ASET and AREF are supposed to work, and makes
7451 it easier to think about future improvements. See
7452 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
7453 * charset.h (set_charset_attr): New function.
7454 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
7455 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
7456 (aref_addr): New function. All uses of &AREF(...) changed.
7457 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7458 (set_hash_index): New functions. All lvalue-style uses of
7459 HASH_KEY etc. changed.
7460 * keyboard.c (set_prop): New function. All lvalue-style uses
7461 of PROP changed.
7462
7463 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
7464
7465 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
7466 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
7467 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
7468 * nsfns.m (ns_set_name_as_filename): Likewise.
7469 * nsmenu.m (ns_update_menubar): Likewise.
7470 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
7471
7472 2012-08-01 Eli Zaretskii <eliz@gnu.org>
7473
7474 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
7475 Adapt to latest changes in field names of the corresponding Lisp
7476 objects.
7477
7478 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
7479
7480 2012-08-01 Glenn Morris <rgm@gnu.org>
7481
7482 * s/msdos.h: Remove file.
7483 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
7484 * Makefile.in (S_FILE): Remove.
7485 (config_h): Remove S_FILE.
7486
7487 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
7488
7489 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
7490 Remove; moved to nt/config.nt.
7491
7492 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7493
7494 Use INTERNAL_FIELD for conses and overlays.
7495 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
7496 Remove obsolete comment.
7497 (MVAR): New macro.
7498 (struct Lisp_Overlay): Use INTERNAL_FIELD.
7499 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
7500
7501 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7502
7503 Use INTERNAL_FIELD for symbols.
7504 * lisp.h (SVAR): New macro. Adjust users.
7505 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
7506 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
7507
7508 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7509
7510 Use INTERNAL_FIELD for processes.
7511 * process.h (PVAR): New macro. Adjust style.
7512 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
7513 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
7514
7515 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7516
7517 Use INTERNAL_FIELD for windows.
7518 * window.h (WVAR): New macro.
7519 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
7520 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7521 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7522 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
7523 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
7524 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7525
7526 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7527
7528 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
7529
7530 2012-08-01 Glenn Morris <rgm@gnu.org>
7531
7532 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
7533 Move to configure.ac.
7534
7535 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
7536
7537 * makefile.w32-in (CONFIG_H): Update dependencies.
7538 (CONF_POST_H): New macro.
7539
7540 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
7541
7542 2012-07-31 Glenn Morris <rgm@gnu.org>
7543
7544 * Makefile.in (S_FILE): No longer set by configure.
7545
7546 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
7547 is available.
7548 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
7549
7550 * process.h (NULL_DEVICE):
7551 * emacs.c (SEPCHAR):
7552 * editfns.c (USER_FULL_NAME): Let configure set them.
7553
7554 * s/README, s/template.h: Remove files.
7555
7556 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
7557
7558 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
7559 Move to configure.ac.
7560
7561 2012-07-31 Eli Zaretskii <eliz@gnu.org>
7562
7563 * .gdbinit (xframe): Adapt to introduction of FVAR and the
7564 resulting renaming of 'struct frame' members.
7565
7566 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
7567
7568 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
7569 after introduction of FVAR.
7570
7571 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7572
7573 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
7574
7575 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
7576 instead of compositeToPoint.
7577 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
7578
7579 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
7580
7581 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7582
7583 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
7584 * lisp.h (INTERNAL_FIELD): New macro.
7585 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
7586 (BVAR): Change to use INTERNAL_FIELD.
7587 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
7588 (KVAR): Change to use INTERNAL_FIELD.
7589 * frame.h (FVAR): New macro.
7590 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
7591 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
7592 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
7593 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7594 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7595
7596 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7597
7598 Miscellaneous fixes for non-default X toolkits.
7599 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
7600 * xterm.c (x_frame_of_widget): Remove redundant prototype.
7601 Move under #ifdef USE_LUCID.
7602 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
7603 definition and usage to avoid warnings.
7604
7605 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7606
7607 * nsterm.m (openFiles): Fix previous checkin.
7608
7609 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
7610
7611 * indent.c (compute_motion): Remove unused local.
7612
7613 2012-07-31 Glenn Morris <rgm@gnu.org>
7614
7615 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
7616
7617 * conf_post.h [USG5_4]:
7618 Move remaining contents of s/usg5-4-common.h here.
7619 * s/usg5-4-common.h: Remove file.
7620
7621 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
7622 * s/irix6-5.h: Remove file.
7623
7624 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
7625 * s/darwin.h: Remove file.
7626
7627 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
7628 * s/hpux10-20.h: Remove file, which is now empty.
7629
7630 2012-07-30 Glenn Morris <rgm@gnu.org>
7631
7632 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
7633 * Makefile.in (config_h): Add conf_post.h.
7634 * makefile.w32-in (CONFIG_H): Add conf_post.h.
7635
7636 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
7637
7638 * nsterm.m (ns_do_open_file): New variable.
7639 (ns_term_init): Set ns_do_open_file to YES after run returns.
7640 (openFile, openTempFile, openFileWithoutUI, openFiles):
7641 Open files only if ns_do_open_file.
7642
7643 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7644
7645 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
7646 This no-op macro hasn't been needed for many years.
7647 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
7648
7649 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
7650 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
7651 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
7652 gdb_make_enums_visible.
7653 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
7654 (DIRECTORY_SEP): Now a constant, not a macro.
7655
7656 2012-07-30 Eli Zaretskii <eliz@gnu.org>
7657
7658 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
7659 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
7660
7661 * w32term.c <w32_keyboard_codepage>: Renamed from
7662 keyboard_codepage and now external. All users changed.
7663
7664 * w32term.h: Add declaration of w32_keyboard_codepage.
7665
7666 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
7667 the codepage to translate keys to Unicode. If this argument is
7668 -1, use the value returned by GetConsoleCP. All callers changed.
7669
7670 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7671
7672 Update .PHONY listings in makefiles.
7673 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
7674 bootstrap-clean, distclean, maintainer-clean, versioclean,
7675 extraclean, frc.
7676
7677 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
7678 This is a bit clearer. Fix some commentary typos.
7679
7680 2012-07-30 Glenn Morris <rgm@gnu.org>
7681
7682 * s/netbsd.h: Let configure include signal.h if needed.
7683 Remove file, which is now empty.
7684
7685 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
7686 Let configure set them.
7687 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
7688 No more need to undefine.
7689
7690 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
7691
7692 * keymap.c (Fkey_description): Don't remove 0x80 bit from
7693 non-single-byte char when adding meta modifier. (Bug#12090)
7694
7695 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7696
7697 Convert safe_call to use variable number of arguments.
7698 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
7699 (safe_call2): Fix comment.
7700 * lisp.h (safe_call): Adjust prototype.
7701 * coding.c (encode_coding_object): Change to use safe_call2.
7702 * xfaces.c (merge_face_heights): Change to use safe_call1.
7703
7704 2012-07-30 Glenn Morris <rgm@gnu.org>
7705
7706 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
7707 does that unconditionally. Remove file, which is now empty.
7708
7709 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
7710 Remove empty files.
7711
7712 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7713
7714 Export to GDB most of lisp.h's remaining object-like macros.
7715 * lisp.h (min, max): Move earlier, because they're used earlier now.
7716 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
7717 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
7718 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
7719 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
7720 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
7721 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
7722 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
7723 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
7724 Now constants, for GDB. They need not be macros.
7725 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
7726 Now constants, for GDB, as well as macros, for static initializers.
7727 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
7728 Move to after the definition of struct Lisp_Char_Table,
7729 since the former now needs that type defined.
7730 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
7731 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
7732 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
7733 New enums, for gdb_make_enums_visible.
7734 (GLYPH_MODE_LINE_FACE): Remove; unused.
7735 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
7736 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
7737 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
7738 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
7739 enum maxargs, enum MAX_ALLOCA.
7740 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
7741 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
7742 no longer needed, now that they are done in lisp.h.
7743
7744 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7745
7746 Cleanup string bytes checking.
7747 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
7748 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
7749 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
7750 (check_sblock, compact_small_strings): Simplify.
7751
7752 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7753
7754 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
7755 These macros are confusing and no longer need to be defined, as
7756 the enum values now suffice. All uses replaced with definiens.
7757 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
7758
7759 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
7760
7761 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
7762 ($(BLD)/w32console.$(O)): Update dependencies.
7763
7764 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7765
7766 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
7767 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
7768 time. Adjust users.
7769 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
7770
7771 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
7772
7773 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
7774 setting sitelisp (Bug#12010).
7775
7776 2012-07-29 Eli Zaretskii <eliz@gnu.org>
7777
7778 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
7779
7780 * w32heap.c (cache_system_info):
7781 * w32.c (sys_rename):
7782 * w32proc.c (find_child_console, sys_kill): All users changed.
7783
7784 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7785
7786 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
7787
7788 2012-07-29 Eli Zaretskii <eliz@gnu.org>
7789
7790 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
7791
7792 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7793
7794 Cleanup statistics calculation in Fgarbage_collect.
7795 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
7796 Fix zombies percentage calculation. Simplify elapsed time calculation.
7797
7798 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7799
7800 Generalize marker debugging code under MARKER_DEBUG and use eassert.
7801 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
7802 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
7803 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
7804 (replace_range, replace_range_2, del_range_2): Change to eassert.
7805 * marker.c (byte_char_debug_check): Adjust style.
7806
7807 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7808
7809 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
7810 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
7811 long-ago-commented-out code that talks about "WIN32".
7812 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
7813 All uses changed.
7814
7815 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
7816
7817 Use Gnulib stdalign module (Bug#9772, Bug#9960).
7818 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
7819 Simplify by using alignof.
7820 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
7821 * lisp.h: Include <stdalign.h>.
7822 (GCALIGNMENT): New macro and constant.
7823 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
7824 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
7825 (stdalign): New macro, if not already defined.
7826
7827 2012-07-28 Eli Zaretskii <eliz@gnu.org>
7828
7829 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
7830 * w32inevt.c: Include w32inevt.h.
7831 (w32_read_console_input): New inline function, calls either
7832 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
7833 w32_console_unicode_input.
7834 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
7835 (w32_kbd_patch_key, key_event): Use the codepage returned by
7836 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
7837 (key_event): use uChar.UnicodeChar only if
7838 w32_console_unicode_input is non-zero.
7839
7840 * w32console.c: Include w32heap.h.
7841 <w32_console_unicode_input>: New global variable.
7842 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
7843 family of Windows, zero otherwise.
7844
7845 * w32inevt.h: Declare w32_console_unicode_input.
7846
7847 * xdisp.c (init_iterator): Don't reference tip_frame in a build
7848 --without-x. (Bug#11742)
7849
7850 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7851
7852 Adjust GDB to reflect pvec_type changes (Bug#12036).
7853 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
7854 2012-07-04 changes to pseudovector representation.
7855 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
7856
7857 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
7858
7859 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
7860 bus address.
7861 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
7862
7863 2012-07-27 Eli Zaretskii <eliz@gnu.org>
7864
7865 * alloc.c (listn): Fix the order the arguments are consed onto the
7866 list.
7867
7868 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
7869 enumeration constants, as PURE and HEAP are too general, and clash
7870 with other headers and sources, such as gmalloc.c and the
7871 MS-Windows system headers. All users changed.
7872
7873 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7874
7875 Revert last save_excursion_save and save_excursion_restore changes.
7876 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
7877 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
7878
7879 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7880
7881 Fix recently-introduced typos in Windows port.
7882 Reported by Martin Rudalics <rudalics@gmx.at>.
7883 * w32.c (init_environment): Replace comma with semicolon.
7884 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
7885
7886 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7887
7888 Improve GDB symbol export (Bug#12036).
7889 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
7890 arms of an 'if', not using conditional expressions; otherwise GDB
7891 complains about the types in the unevaluated arm when the argument
7892 is an integer literal.
7893 (xgetint): Simplify expression.
7894 * alloc.c (gdb_make_enums_visible): New constant. This ports to
7895 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
7896 Zaretskii in <http://bugs.gnu.org/12036#13>.
7897 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
7898 needed now that we have gdb_make_enums_visible.
7899 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
7900 (enum enum_USE_LSB_TAG):
7901 New enum types, packaging up enums that need to be exported to GDB.
7902
7903 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7904
7905 Utility function to make a list from specified amount of objects.
7906 * lisp.h (enum constype): New datatype.
7907 (listn): New prototype.
7908 * alloc.c (listn): New function.
7909 (Fmemory_use_count, syms_of_alloc): Use it.
7910 * buffer.c (syms_of_buffer): Likewise.
7911 * callint.c (syms_of_callint): Likewise.
7912 * charset.c (define_charset_internal): Likewise.
7913 * coding.c (syms_of_coding): Likewise.
7914 * keymap.c (syms_of_keymap): Likewise.
7915 * search.c (syms_of_search): Likewise.
7916 * syntax.c (syms_of_syntax): Likewise.
7917 * w32.c (init_environment): Likewise.
7918 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
7919 * xdisp.c (syms_of_xdisp): Likewise.
7920 * xfns.c (syms_of_xfns): Likewise.
7921
7922 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7923
7924 Fast save_excursion_save and save_excursion_restore.
7925 * lisp.h (struct Lisp_Excursion): New data type.
7926 (PVEC_EXCURSION): New pseudovector type.
7927 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
7928 to deal with it. Adjust comments.
7929 (init_marker, attach_marker): New prototype.
7930 (unchain_marker): Adjust prototype.
7931 * marker.c (attach_marker): Change to global.
7932 (init_marker): New function.
7933 * alloc.c (Fmake_marker, build_marker): Use it.
7934 (build_marker): More easserts.
7935 (mark_object): Handle struct Lisp_Excursion.
7936 * editfns.c (save_excursion_save, save_excursion_restore):
7937 Reimplement to use struct Lisp_Excursion. Add comments.
7938
7939 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7940
7941 Fix export of symbols to GDB (Bug#12036).
7942 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
7943 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
7944 emacs.c, as this is a more-suitable home. Had this been done earlier
7945 the fix for 12036 would have avoided some of the problems noted in
7946 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
7947 would have been more obvious.
7948 * emacs.c: Do not include <verify.h>; no longer needed.
7949 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
7950 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
7951 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7952 Remove; now done in lisp.h.
7953 * lisp.h (PUBLISH_TO_GDB): New macro.
7954 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
7955 (DATA_SEG_BITS): Use it.
7956 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
7957 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
7958 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
7959 not be usable in #if. This simplifies things.
7960
7961 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
7962
7963 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
7964
7965 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7966
7967 Simplify export of symbols to GDB (Bug#12036).
7968 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
7969 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
7970 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
7971 Adjust to changes in lisp.h and emacs.c, by using
7972 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
7973 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
7974 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
7975 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
7976 instead of gdb_valbits.
7977 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
7978 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
7979 instead of gdb_array_mark_flag.
7980 (xboolvector): Get size from $->size, not $->header.size.
7981 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
7982 (xreload, hook-run, hookpost-run): Remove.
7983 * emacs.c: Include <verify.h>.
7984 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
7985 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
7986 Remove.
7987 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
7988 (gdb_USE_LSB_TAG): New enum constants.
7989 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7990 Also define these as enum constants, so they're visible to GDB.
7991 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
7992 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
7993 as constants, so they're visible to GDB.
7994 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
7995 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
7996 Now enum constants, not macros, so they're visible to GDB.
7997 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
7998 more convenient now. All uses changed.
7999 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8000 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8001
8002 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8003
8004 Explicitly free restriction data that are not needed anymore.
8005 * editfns.c (save_restriction_restore): Free restriction data.
8006
8007 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8008
8009 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8010 add argument, tune behavior, and adjust all callers.
8011
8012 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8013
8014 Use typedef for EMACS_INT, EMACS_UINT.
8015 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8016 than macros. This simplifies debugging in the usual case, since
8017 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8018 and it allows expressions involving EMACS_INT casts.
8019 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8020
8021 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8022
8023 * nsterm.m (ns_read_socket): Return early if there is a modal
8024 window (Bug#12043).
8025
8026 2012-07-25 Martin Rudalics <rudalics@gmx.at>
8027
8028 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8029 that FOCUS-FRAME can be omitted.
8030
8031 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8032
8033 Adjust buffer text indirection counters at the end of Fkill_buffer.
8034 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8035 buffer is definitely dead. This should really fix an issue reported
8036 by Christoph Scholtes again. (Bug#12007).
8037 (init_buffer_once): Initialize indirection counters of
8038 buffer_defaults and buffer_local_symbols (for sanity and safety).
8039
8040 2012-07-24 Eli Zaretskii <eliz@gnu.org>
8041
8042 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8043 and continuation glyphs on tooltip frames, leave them at zero.
8044 Avoids continued lines in tooltips. (Bug#11832)
8045
8046 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8047
8048 Simplify copy_overlay.
8049 * buffer.c (copy_overlay): Simplify. Use build_marker.
8050 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8051
8052 2012-07-23 Eli Zaretskii <eliz@gnu.org>
8053
8054 * print.c (print_object): Don't crash when a frame's name is nil
8055 or invalid. (Bug#12025)
8056
8057 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8058 it signals an error when a tooltip frame is being created.
8059
8060 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8061
8062 Cleanup miscellaneous objects allocation and initialization.
8063 * alloc.c (allocate_misc): Change to static. Add argument to
8064 specify the subtype. Adjust comment and users.
8065 (build_overlay): New function.
8066 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8067 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8068 (allocate_misc): Remove prototype.
8069 (build_overlay): Add prototype.
8070
8071 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8072
8073 Swap buffer text indirection counters in Fbuffer_swap_text.
8074 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8075 This avoids crash reported by Christoph Scholtes at
8076 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8077
8078 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8079
8080 * nsmenu.m (Popdown_data): New struct.
8081 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8082 free Popdown_data.
8083 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8084 (initWithContentRect): Make imgView and contentView non-static
8085 and autorelease them. Also autorelease img and matrix (Bug#12005).
8086 (dealloc): Remove (Bug#12005).
8087
8088 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8089
8090 Adjust consing_since_gc when objects are explicitly freed.
8091 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8092 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8093 (free_cons, free_misc): Subtract object size from consing_since_gc.
8094
8095 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8096
8097 Simplify and cleanup markers positioning code.
8098 * marker.c (attach_marker): More useful eassert.
8099 (live_buffer, set_marker_internal): New function.
8100 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8101 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8102
8103 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8104
8105 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8106 as it's limited by the amount of memory, not by INT_MAX.
8107
8108 2012-07-21 Eli Zaretskii <eliz@gnu.org>
8109
8110 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8111 in special-event-map. See the discussion at
8112 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8113 for the reasons.
8114
8115 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
8116 info.dwItemData. Fixes crashes on 64-bit Windows.
8117 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
8118
8119 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8120
8121 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
8122 (conversationIdentifier): Return value is NSInteger.
8123 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
8124
8125 2012-07-21 Chong Yidong <cyd@gnu.org>
8126
8127 * window.c (decode_any_window): Signal an error if the window is
8128 on a dead frame (Bug#11984).
8129
8130 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8131
8132 Add indirection counting to speed up Fkill_buffer.
8133 * buffer.h (struct buffer): New member.
8134 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8135 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8136 base buffer indirection counter.
8137 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8138 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8139 through buffer list if indirection counter is 0.
8140
8141 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8142
8143 Extend the value returned by Fgarbage_collect with heap statistics.
8144 * alloc.c (Qheap): New symbol.
8145 (syms_of_alloc): DEFSYM it.
8146 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8147 (Fmemory_free): Remove.
8148 (syms_of_alloc): Don't defsubr it.
8149 * buffer.c (Fcompact_buffer): Remove.
8150 (syms_of_buffer): Don't defsubr it.
8151
8152 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8153
8154 Make maybe_gc inline.
8155 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8156 * lisp.h (consing_since_gc, gc_relative_threshold)
8157 (memory_full_cons_threshold): Revert declaration.
8158 (maybe_gc): Remove prototype, define as inline.
8159 * alloc.c: Remove old commented-out code.
8160 (consing_since_gc, gc_relative_threshold)
8161 (memory_full_cons_threshold): Revert to global.
8162 (maybe_gc): Remove.
8163
8164 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8165
8166 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8167 * lisp.h (build_unibyte_string): New function.
8168 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8169 * sysdep.c, w32fns.c, xfns.c: Use it.
8170 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8171 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8172 Adjust users accordingly.
8173 * font.h (font_open_by_name): Adjust prototype.
8174
8175 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8176
8177 Cleanup calls to Fgarbage_collect.
8178 * lisp.h (maybe_gc): New prototype.
8179 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8180 Remove declarations.
8181 * alloc.c (maybe_gc): New function.
8182 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8183 Make them static.
8184 * bytecode.c (MAYBE_GC): Use maybe_gc.
8185 * eval.c (eval_sub, Ffuncall): Likewise.
8186 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8187 to avoid dependency from auto-save feature.
8188
8189 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8190
8191 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8192 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8193 'for_each_per_buffer_object_at'.
8194 All uses changed. It's better to use upper-case for macros that
8195 cannot be implemented as functions, to give the reader a clue
8196 that they're special.
8197
8198 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8199
8200 * alloc.c (Fgarbage_collect): Tweak docstring.
8201
8202 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8203
8204 Tweak the value returned from Fgarbage_collect again.
8205 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8206 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8207 Adjust documentation.
8208 (total_vector_bytes): Rename to total_vector_slots, adjust
8209 accounting.
8210 (total_free_vector_bytes): Rename to total_free_vector_slots,
8211 adjust accounting.
8212 (Qstring_bytes, Qvector_slots): New symbols.
8213 (syms_of_alloc): DEFSYM them.
8214
8215 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8216
8217 Buffer compaction primitive which may be used from Lisp.
8218 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8219 (syms_of_buffer): Register Fcompact_buffer.
8220 * alloc.c (Fgarbage_collect): Use compact_buffer.
8221 * buffer.h (compact_buffer): New prototype.
8222 (struct buffer_text): New member.
8223
8224 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8225
8226 New macro to iterate over all buffers, miscellaneous cleanups.
8227 * lisp.h (all_buffers): Remove declaration.
8228 * buffer.h (all_buffers): Add declaration, with comment.
8229 (for_each_buffer): New macro.
8230 * alloc.c (Fgarbage_collect, mark_object): Use it.
8231 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
8232 (init_buffer): Likewise.
8233 * data.c (Fset_default): Likewise.
8234 * coding.c (code_conversion_restore): Remove redundant check
8235 for dead buffer.
8236 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
8237
8238 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8239
8240 Fix bug that created negative-length intervals.
8241 * intervals.c (merge_interval_right, merge_interval_left):
8242 Do not zero out this interval if it is absorbed by its children,
8243 as this interval's total length doesn't change in that case. See
8244 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
8245
8246 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
8247
8248 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
8249 when invoking (make-bool-vector N t) and N is a positive
8250 multiple of 8 -- the last 8 bits were mistakenly cleared.
8251
8252 Remove some struct layout assumptions in bool vectors.
8253 * alloc.c (bool_header_size): New constant.
8254 (header_size, word_size): Move earlier, as they're now used earlier.
8255 Use 'word_size' in a few more places, where it's appropriate.
8256 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
8257 padding before the data member of a bool vector.
8258 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
8259 than doing the check by hand with an abort ().
8260
8261 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8262
8263 * eval.c (Fdefvar): Don't check constants since we only set the var if
8264 it's not yet defined anyway (bug#11904).
8265
8266 * lisp.h (last_undo_boundary): Declare new var.
8267 * keyboard.c (command_loop_1): Set it.
8268 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
8269 were auto-added by the command loop (bug#11774).
8270
8271 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8272
8273 * w32font.c (Qsymbol): Remove local definition.
8274 (syms_of_w32font): Don't DEFSYM it.
8275
8276 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8277
8278 Fix sweep_vectors to handle large bool vectors correctly.
8279 * alloc.c (sweep_vectors): Account total_vector_bytes for
8280 bool vectors larger than VBLOCK_BYTES_MAX.
8281
8282 2012-07-18 Chong Yidong <cyd@gnu.org>
8283
8284 * frame.c (x_set_frame_parameters): Revert bogus change introduced
8285 in 2012-05-25 commit by Paul Eggert (Bug#11738).
8286
8287 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8288
8289 Return more descriptive data from Fgarbage_collect.
8290 Suggested by Stefan Monnier in
8291 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
8292 * alloc.c (bounded_number): New function.
8293 (total_buffers, total_vectors): New variable.
8294 (total_string_size): Rename to total_string_bytes, adjust users.
8295 (total_vector_size): Rename to total_vector_bytes, adjust users.
8296 (sweep_vectors): Account total_vectors and total_vector_bytes.
8297 (Fgarbage_collect): New return value. Adjust documentation.
8298 (gc_sweep): Account total_buffers.
8299 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
8300 (VECTOR_SIZE): Remove.
8301 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
8302 (Qinterval, Qmisc): New symbols.
8303 (syms_of_data): Initialize them.
8304 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
8305 (Qcons, Qbuffer): New declarations.
8306
8307 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8308
8309 * alloc.c (Fmemory_free): Account for memory-free's own storage.
8310 Round up, not down. Improve doc.
8311
8312 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8313
8314 Restore old code in allocate_string_data to avoid Faset breakage.
8315 Reported by Julien Danjou <julien@danjou.info> in
8316 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
8317 * alloc.c (allocate_string_data): Restore old code with minor
8318 adjustments, fix comment to explain this subtle issue.
8319
8320 2012-07-17 Eli Zaretskii <eliz@gnu.org>
8321
8322 Remove FILE_SYSTEM_CASE.
8323 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
8324
8325 * fileio.c (FILE_SYSTEM_CASE): Don't define.
8326 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
8327 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
8328 call-process-region passes it through expand-file-name.
8329
8330 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
8331
8332 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8333
8334 Fix crash when creating indirect buffer (Bug#11917)
8335 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
8336 Don't handle unbound variables specially if non-zero.
8337 (Fbuffer_local_variables): Pass zero.
8338 (clone_per_buffer_values): Pass non-zero.
8339
8340 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8341
8342 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
8343 to make the loop interruptible.
8344
8345 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8346
8347 * gnutls.c (emacs_gnutls_handshake): Only retry if
8348 GNUTLS_E_INTERRUPTED.
8349
8350 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8351
8352 Cleanup and convert miscellaneous checks to eassert.
8353 * alloc.c (mark_interval): Fix comment, partially rephrase
8354 old comment from intervals.h (see below).
8355 * intervals.c (find_interval, adjust_intervals_for_insertion)
8356 (delete_interval, adjust_intervals_for_deletion)
8357 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
8358 Convert to eassert.
8359 (adjust_intervals_for_insertion, make_new_interval):
8360 Remove obsolete and unused code.
8361 * intervals.h (struct interval): Remove obsolete comment.
8362 * textprotp.c (erase_properties): Remove unused code.
8363 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
8364 (Fremove_list_of_text_properties): Convert to eassert.
8365
8366 2012-07-17 Chong Yidong <cyd@gnu.org>
8367
8368 * editfns.c (Finsert_char): Doc fix.
8369
8370 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8371
8372 Fix previous change to make Fmemory_free always accurate.
8373 * alloc.c (make_interval): Update total_free_intervals.
8374 (make_float): Likewise for total_free_floats.
8375 (free_cons, Fcons): Likewise for total_free_conses.
8376 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
8377 Likewise for total_free_vector_bytes.
8378 (Fmake_symbol): Likewise for total_free_symbols.
8379 (bytes_free): Remove.
8380
8381 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8382
8383 Simple free memory accounting feature.
8384 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
8385 (sweep_vectors): Accumulate size of free vectors.
8386 (Fgarbage_collect): Setup bytes_free.
8387 (Fmemory_free): New function.
8388 (syms_of_alloc): Register it.
8389
8390 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8391
8392 Cleanup overlays checking.
8393 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
8394 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
8395 eassert and OVERLAYP.
8396 (sort_overlays): Change to use OVERLAYP.
8397
8398 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
8399
8400 * editfns.c (Finsert_char): Make it interactive, and make the
8401 second arg optional. Copy interactive spec and docstring from
8402 ucs-insert.
8403
8404 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8405
8406 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
8407 Unlike the other wrapped functions, fabs has an unspecified
8408 effect on errno.
8409
8410 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
8411
8412 * nsterm.m (keyDown): Interpret flags without left/right bits
8413 as the left key (Bug#11670).
8414
8415 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8416
8417 Remove empty and useless init functions.
8418 * lisp.h (init_character_once, init_fns, init_image)
8419 (init_filelock, init_sound): Remove prototype.
8420 * character.c (init_character_once): Remove.
8421 * filelock.c (init_filelock): Likewise.
8422 * fns.c (init_fns): Likewise.
8423 * image.c (init_image): Likewise.
8424 * sound.c (init_sound): Likewise.
8425 * emacs.c (main): Adjust accordingly.
8426
8427 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8428
8429 * gtkutil.h: Tiny cleanups.
8430 (use_old_gtk_file_dialog): Remove useless declaration.
8431 (xg_uses_old_file_dialog): Add suggested const attribute.
8432
8433 2012-07-15 Eli Zaretskii <eliz@gnu.org>
8434
8435 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
8436 (bidi_paragraph_init): Use it to limit search forward for a strong
8437 directional character in abnormally large paragraphs full of
8438 neutral or weak characters. (Bug#11943)
8439
8440 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
8441
8442 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
8443 the toolbar (Bug#9451).
8444 (xg_make_tool_item): Give the widget event box a transparent
8445 background.
8446
8447 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8448
8449 Cleanup basic allocation variables and functions.
8450 * alloc.c (ignore_warnings, init_intervals, init_float)
8451 (init_cons, init_symbol, init_marker): Remove.
8452 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
8453 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
8454 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
8455 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
8456 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
8457 (staticidx, init_alloc_once, init_strings, free_ablock):
8458 Remove redundant initialization.
8459 * fns.c (init_weak_hash_tables): Remove.
8460 * lisp.h (init_weak_hash_tables): Remove prototype.
8461
8462 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8463
8464 Use zero_vector where appropriate.
8465 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
8466 accordingly.
8467 * lisp.h (zero_vector): New declaration.
8468 * font.c (null_vector): Remove.
8469 (syms_of_font): Remove initialization and staticpro.
8470 (font_list_entities, font_find_for_lface): Change to use zero_vector.
8471 * keymap.c (Faccessible_keymaps): Likewise.
8472
8473 2012-07-15 Leo Liu <sdl.web@gmail.com>
8474
8475 * fringe.c: Fix typo in comments.
8476
8477 2012-07-14 Leo Liu <sdl.web@gmail.com>
8478
8479 * fringe.c: Add a new bitmap exclamation-mark.
8480
8481 2012-07-14 Eli Zaretskii <eliz@gnu.org>
8482
8483 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
8484
8485 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
8486 (HAVE_MENUS): Don't define, defined by editing config.in with
8487 msdos/sed2v2.inp.
8488 (GMALLOC_INHIBIT_VALLOC): Don't define.
8489 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
8490
8491 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
8492
8493 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
8494
8495 2012-07-14 Glenn Morris <rgm@gnu.org>
8496
8497 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
8498 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
8499 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
8500
8501 2012-07-13 Glenn Morris <rgm@gnu.org>
8502
8503 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
8504
8505 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
8506 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
8507
8508 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
8509
8510 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
8511 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
8512 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
8513 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
8514 where appropriate.
8515 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
8516 as boolean expression.
8517 (x_set_window_size): Remove unused variable toolbar.
8518 (ns_get_color_default, ns_mod_to_lisp): Remove.
8519 (ns_mouse_position): Remove unused variables xchar and ychar.
8520 (ns_compute_glyph_string_overhangs): Remove unused variable face.
8521 (ns_set_vertical_scroll_bar): Remove unused variable count.
8522 (ns_delete_terminal): Remove unused variable i.
8523 (ns_term_init): Remove unused variables r, g and b.
8524 (mouseDown): Remove unused variable window.
8525 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
8526 (initFrameFromEmacs): Remove unused variable vbextra.
8527 (mouseEntered): Remove unused variables p and dpyinfo.
8528 (mouseExited): Remove unused variables p and r.
8529 (ns_define_frame_cursor, ns_clear_frame_area)
8530 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
8531 (menuDown): Assign [sender tag] to variable and cast the variable.
8532
8533 * nsterm.h (menuDown): Add id as type to argument sender.
8534 (ns_display_info_for_name): Add Lisp_Object argument.
8535 (ns_term_init): Add Lisp_Object argument.
8536 (ns_map_event_to_object): Add void argument.
8537 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
8538 prototype with arguments and only declare if __OBJC__.
8539 (nxatoms_of_nsselect): Add void argument.
8540 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
8541 (ns_alloc_autorelease_pool): Add void argument.
8542 (ns_release_autorelease_pool): Add void* argument.
8543 (ns_get_defaults_value): Add const char* argument.
8544
8545 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
8546 (initFromContents): Use SSDATA where appropriate.
8547 (ns_update_menubar): Add braces to ambigous if-else.
8548 (initWithTitle): Put () around assignment in if statement.
8549 (ns_menu_show): Remove unused variables window and keymap.
8550 (update_frame_tool_bar): Remove unused variable selected_p.
8551 (initWithContentRect): Remove unused variable this_cmd_name.
8552
8553 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
8554 appropriate.
8555 (setXBMColor): Remove unused variable len.
8556 (setPixmapData): Put () around assignment in loop statement.
8557
8558 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
8559 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
8560 where appropriate.
8561 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
8562 around assignment in loop statement.
8563 (nsfont_open): Remove unused variable i.
8564 (nsfont_open): Remove unused variable len.
8565 (nsfont_draw): Remove unused variable cs.
8566
8567 * nsfns.m (x_set_icon_name, ns_set_name_internal)
8568 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
8569 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
8570 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
8571 (Fns_font_name, Fns_perform_service)
8572 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
8573 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
8574 (ns_set_name): Remove unused variable view.
8575 (x_set_menu_bar_lines): Remove unused variable olines.
8576 (x_set_tool_bar_lines): Remove unused variable root_window.
8577 (Fns_list_colors): Put () around assignment in while statement.
8578 (Fns_perform_service): Remove unused variable len.
8579 (Fns_display_usable_bounds): Remove unused variable top.
8580 (syms_of_nsfns): Remove unused variable i.
8581
8582 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
8583 memcpy (Bug#11907).
8584
8585 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
8586
8587 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
8588 and free it with DestroyExceptionInfo (Bug#11558).
8589
8590 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
8591
8592 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
8593 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
8594 Set here, not in nt/config.nt.
8595
8596 2012-07-13 Eli Zaretskii <eliz@gnu.org>
8597
8598 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
8599 cursor overflow into the last glyph on display line when the right
8600 fringe is off. (Bug#11832)
8601
8602 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
8603
8604 * xdisp.c (produce_special_glyphs): Now static.
8605 * dispextern.h (produce_special_glyphs): Remove decl.
8606
8607 2012-07-13 Glenn Morris <rgm@gnu.org>
8608
8609 * s/bsd-common.h, s/cygwin.h: Remove empty files.
8610 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
8611
8612 * s/usg5-4-common.h (USG, USG5):
8613 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
8614 * s/sol2-6.h (SOLARIS2):
8615 * s/irix6-5.h (IRIX6_5):
8616 * s/hpux10-20.h (USG, USG5, HPUX):
8617 * s/gnu-linux.h (USG, GNU_LINUX):
8618 * s/freebsd.h (BSD_SYSTEM):
8619 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
8620 * s/cygwin.h (CYGWIN):
8621 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
8622 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
8623
8624 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
8625
8626 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
8627
8628 2012-07-13 Glenn Morris <rgm@gnu.org>
8629
8630 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
8631
8632 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
8633
8634 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
8635 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
8636
8637 2012-07-12 Glenn Morris <rgm@gnu.org>
8638
8639 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
8640
8641 * process.c (init_process_emacs): Rename from init_process.
8642 The old name is also the name of a Mach system call.
8643 * lisp.h, emacs.c: Update for this name change.
8644 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
8645 longer needed.
8646
8647 2012-07-12 Eli Zaretskii <eliz@gnu.org>
8648
8649 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
8650 memmove call that removes glyphs covered by the left truncation
8651 glyph. Improve commentary.
8652 (display_line): Fix display of continuation glyphs on GUI frames
8653 when the right fringe is turned off and variable-size fonts are
8654 used in the window. Move the code that appends a stretch glyph to
8655 produce_special_glyphs, so that it could be used for truncation
8656 and continuation glyphs alike.
8657 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
8658 glyph of a suitably computed width, to align the special glyphs at
8659 the window margin. Code moved from display_line. (Bug#11832)
8660
8661 2012-07-12 Glenn Morris <rgm@gnu.org>
8662
8663 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
8664
8665 * s/gnu-linux.h, s/hpux10-20.h:
8666 Do not unconditionally define HAVE_XRMSETDATABASE.
8667
8668 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
8669
8670 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
8671
8672 Fix typos that broke OS X build.
8673 Reported by Randal L. Schwartz in
8674 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
8675 * nsterm.m (ns_timeout): Add missing local decl.
8676 (ns_get_color): snprintf -> sprintf, to fix typo.
8677
8678 2012-07-12 Glenn Morris <rgm@gnu.org>
8679
8680 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
8681 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
8682 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
8683 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
8684
8685 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
8686 Move PTY_OPEN to configure.
8687
8688 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8689 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
8690 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
8691
8692 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
8693
8694 Use empty_unibyte_string where applicable.
8695 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
8696 * lread.c (read1): Likewise.
8697 * xsettings.c (syms_of_xsettings): Likewise.
8698
8699 2012-07-12 Glenn Morris <rgm@gnu.org>
8700
8701 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
8702 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
8703 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
8704 * s/hpux10-20.h (RUN_TIME_REMAP):
8705 * s/bsd-common.h (TABDLY): Move to configure.
8706
8707 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
8708
8709 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
8710
8711 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8712 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
8713
8714 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
8715
8716 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
8717 * s/template.h: Move NARROWPROTO to configure.
8718
8719 2012-07-11 Glenn Morris <rgm@gnu.org>
8720
8721 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
8722 unused since 2011-01-17 change to systty.h.
8723
8724 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
8725 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8726 Move HAVE_PTYS and HAVE_SOCKETS to configure.
8727
8728 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8729
8730 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
8731
8732 2012-07-11 Glenn Morris <rgm@gnu.org>
8733
8734 * s/darwin.h, s/gnu-linux.h, s/template.h:
8735 Move INTERRUPT_INPUT to configure.
8736
8737 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8738
8739 Minor adjustments to interning code.
8740 * lisp.h (intern, intern_c_string): Redefine as static inline
8741 wrappers for intern_1 and intern_c_string_1, respectively.
8742 (intern_1, intern_c_string_1): Rename prototypes.
8743 * lread.c (intern_1, intern_c_string_1, oblookup):
8744 Simplify Vobarray checking.
8745 * font.c (font_intern_prop): Likewise. Adjust comment.
8746 * w32font.c (intern_font_name): Likewise.
8747
8748 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
8749
8750 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
8751
8752 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
8753 of Fcar/Fcdr if possible.
8754 * font.c (check_otf_features): Likewise.
8755 * fontset.c (Fnew_fontset): Likewise.
8756 * gnutls.c (Fgnutls_boot): Likewise.
8757 * minibuf.c (read_minibuf): Likewise.
8758 * msdos.c (IT_set_frame_parameters): Likewise.
8759 * xmenu.c (Fx_popup_dialog): Likewise.
8760 * w32menu.c (Fx_popup_dialog): Likewise.
8761
8762 2012-07-11 Glenn Morris <rgm@gnu.org>
8763
8764 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
8765 since nothing has defined it on these platforms.
8766
8767 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
8768 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
8769
8770 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8771 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8772 Move CLASH_DETECTION to configure.
8773
8774 * s/gnu.h: Remove file, which is now empty.
8775
8776 * s/gnu.h, s/gnu-linux.h:
8777 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
8778
8779 2012-07-11 John Wiegley <johnw@newartisans.com>
8780
8781 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
8782 function attribute, so we only use it if it exists in the
8783 compiler.
8784
8785 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8786
8787 Avoid call to strlen in fast_c_string_match_ignore_case.
8788 * search.c (fast_c_string_match_ignore_case): Change to use
8789 length argument. Adjust users accordingly.
8790 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
8791
8792 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8793
8794 Assume mkdir, rmdir.
8795 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
8796 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
8797
8798 Assume rename.
8799 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
8800
8801 Assume perror.
8802 * s/hpux10-20.h (HAVE_PERROR): Remove.
8803 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
8804 Remove dummy definition, as this problem was obsolete long ago.
8805
8806 Assume strerror.
8807 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
8808
8809 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8810
8811 Avoid calls to strlen in font processing functions.
8812 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
8813 (font_open_by_name): Change to use length argument.
8814 Adjust users accordingly.
8815 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
8816 Adjust prototypes.
8817 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
8818 Change to return ptrdiff_t.
8819 (xfont_list_pattern, xfont_match): Use length returned by
8820 xfont_decode_coding_xlfd.
8821 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
8822
8823 2012-07-11 Glenn Morris <rgm@gnu.org>
8824
8825 * s/darwin.h, s/freebsd.h, s/netbsd.h:
8826 Move DONT_REOPEN_PTY to configure.
8827
8828 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
8829 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
8830
8831 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
8832
8833 Remove "#define unix" that is no longer needed (Bug#11905).
8834 * s/aix4-2.h (unix): Remove; no longer needed.
8835
8836 EMACS_TIME simplification (Bug#11875).
8837 This replaces macros (which typically do not work in GDB)
8838 with functions, typedefs and enums, making the code easier to debug.
8839 The functional style also makes code easier to read and maintain.
8840 * systime.h: Include <sys/time.h> on all hosts, not just if
8841 WINDOWSNT, since 'struct timeval' is needed in general.
8842 (EMACS_TIME): Now a typedef, not a macro.
8843 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
8844 not macros.
8845 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
8846 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
8847 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
8848 (EMACS_TIME_LE): Now functions, not macros.
8849 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
8850 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
8851 which are not functions. All uses rewritten to use:
8852 (make_emacs_time): New function.
8853 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
8854 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
8855 not functions. All uses rewritten to use the following, respectively:
8856 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
8857 (add_emacs_time, sub_emacs_time): New functions.
8858 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
8859 * fileio.c (Fcopy_file):
8860 * xterm.c (XTflash): Get the current time closer to when it's used.
8861 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
8862
8863 * bytecode.c (targets): Suppress -Woverride-init warnings.
8864
8865 Simplify by avoiding confusing use of strncpy etc.
8866 * doc.c (Fsnarf_documentation):
8867 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
8868 * frame.c (Fmake_terminal_frame):
8869 * gtkutil.c (get_utf8_string):
8870 * lread.c (openp):
8871 * nsmenu.m (ns_update_menubar):
8872 * regex.c (regerror):
8873 Prefer memcpy to strncpy and strncat when either will do.
8874 * fileio.c (Fsubstitute_in_file_name):
8875 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
8876 (menu_separator_name_p):
8877 * nsmenu.m (ns_update_menubar):
8878 Prefer memcmp to strncmp when either will do.
8879 * nsterm.m: Include <ftoastr.h>.
8880 (ns_get_color):
8881 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
8882 Prefer snprintf to strncpy.
8883 * nsterm.m (ns_term_init):
8884 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
8885 * nsterm.m (ns_term_init):
8886 Avoid the need for strncpy, by using build_string or
8887 make_unibyte_string directly. Use dtoastr, not snprintf.
8888 * process.c (Fmake_network_process): Diagnose service names that
8889 are too long, rather than silently truncating them or creating
8890 non-null-terminated names.
8891 (Fnetwork_interface_info): Likewise, for interface names.
8892 * sysdep.c (system_process_attributes) [GNU_LINUX]:
8893 Prefer sprintf to strncat.
8894 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
8895 Prefer vsnprintf to vsprintf + strncpy.
8896
8897 2012-07-10 Glenn Morris <rgm@gnu.org>
8898
8899 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
8900 Clarify fallback case.
8901
8902 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8903
8904 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
8905 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
8906 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
8907 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
8908 where argument type is known to be a Lisp_Cons.
8909
8910 2012-07-10 Tom Tromey <tromey@redhat.com>
8911
8912 * bytecode.c (BYTE_CODE_THREADED): New macro.
8913 (BYTE_CODES): New macro. Replaces all old byte-code defines.
8914 (enum byte_code_op): New type.
8915 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
8916 (exec_byte_code): Use them. Use token threading when applicable.
8917
8918 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8919
8920 Optimize pure C strings initialization.
8921 * lisp.h (make_pure_string): Fix prototype.
8922 (build_pure_c_string): New function, defined as static inline. This
8923 provides a better opportunity to optimize away calls to strlen when
8924 the function is called with compile-time constant argument.
8925 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
8926 argument, adjust users accordingly. Use build_pure_c_string where
8927 appropriate.
8928 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
8929 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
8930 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
8931
8932 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8933
8934 Avoid calls to strlen in miscellaneous functions.
8935 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
8936 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
8937 * lread.c (openp): Likewise.
8938
8939 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8940
8941 Avoid calls to strlen in path processing functions.
8942 * fileio.c (file_name_as_directory): Add comment. Change to add
8943 srclen argument and return the length of result. Adjust users
8944 accordingly.
8945 (directory_file_name): Fix comment. Change to add srclen argument,
8946 swap 1st and 2nd arguments to obey the common convention.
8947 Adjust users accordingly.
8948 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
8949
8950 2012-07-10 Glenn Morris <rgm@gnu.org>
8951
8952 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
8953 Move PENDING_OUTPUT_COUNT definition to configure.
8954
8955 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
8956 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
8957 * s/gnu.h (DATA_START): Move definitions to configure.
8958
8959 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
8960 We include usg5-4-common.h, which defines them both.
8961
8962 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
8963 O_RDONLY already includes it).
8964
8965 Stop ns builds setting the EMACSLOADPATH environment variable.
8966 * nsterm.m (ns_load_path): Rename from ns_init_paths.
8967 Now it does not set EMACSLOADPATH, just returns the load-path string.
8968 * nsterm.h: Update accordingly.
8969 * lread.c [HAVE_NS]: Include nsterm.h.
8970 (init_lread) [HAVE_NS]: Use ns_load_path.
8971 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
8972
8973 2012-07-09 Glenn Morris <rgm@gnu.org>
8974
8975 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
8976 since the included bsd-common.h does so.
8977
8978 Stop ns builds setting the EMACSPATH environment variable.
8979 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
8980 (ns_init_paths): Do not set EMACSPATH.
8981 * nsterm.h (ns_exec_path): Add it.
8982 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
8983 Use ns_exec_path.
8984
8985 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
8986
8987 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
8988
8989 * process.c (wait_reading_process_output): 'waitchannels' was unset
8990 when read_kbd || !NILP (wait_for_cell); fix this.
8991
8992 Add GCC-style 'const' attribute to functions that can use it.
8993 * character.h (char_resolve_modifier_mask):
8994 * keyboard.h (make_ctrl_char):
8995 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
8996 (init_character_once, next_almost_prime, init_fns, init_image)
8997 (flush_pending_output, init_sound):
8998 * mem-limits.h (start_of_data):
8999 * menu.h (finish_menu_items):
9000 Add ATTRIBUTE_CONST.
9001 * emacs.c (DEFINE_DUMMY_FUNCTION):
9002 Declare the dummy function with ATTRIBUTE_CONST.
9003 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9004 Add decls with ATTRIBUTE_CONST.
9005
9006 Minor improvements to make_formatted_string.
9007 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9008 where int is good enough, as vsprintf returns an int.
9009 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9010
9011 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9012
9013 Use make_formatted_string to avoid double length calculation.
9014 * lisp.h (make_formatted_string): New prototype.
9015 * alloc.c (make_formatted_string): New function.
9016 * buffer.c (Fgenerate_new_buffer_name): Use it.
9017 * dbusbind.c (syms_of_dbusbind): Likewise.
9018 * editfns.c (Fcurrent_time_zone): Likewise.
9019 * filelock.c (get_boot_time): Likewise.
9020 * frame.c (make_terminal_frame, set_term_frame_name)
9021 (x_report_frame_params): Likewise.
9022 * image.c (gs_load): Likewise.
9023 * minibuf.c (get_minibuffer): Likewise.
9024 * msdos.c (dos_set_window_size): Likewise.
9025 * process.c (make_process): Likewise.
9026 * xdisp.c (ensure_echo_area_buffers): Likewise.
9027 * xsettings.c (apply_xft_settings): Likewise.
9028
9029 2012-07-09 Glenn Morris <rgm@gnu.org>
9030
9031 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9032 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9033 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9034 * nsterm.h (ns_etc_directory): Add it.
9035 * callproc.c [HAVE_NS]: Include nsterm.h.
9036 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9037
9038 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9039
9040 Move marker debugging code under MARKER_DEBUG.
9041 * marker.c (MARKER_DEBUG): Move marker debugging code under
9042 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9043 for bootstrap with --enable-checking (~3x slowdown reported
9044 by Juanma Barranquero <lekktu@gmail.com>).
9045 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9046
9047 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9048
9049 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9050 See <http://bugs.gnu.org/11825#29>.
9051
9052 2012-07-08 Eli Zaretskii <eliz@gnu.org>
9053
9054 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9055 has no font, use the frame's font. (Bug#11813)
9056 (display_line): Add commentary about displaying truncation glyphs
9057 on GUI frames.
9058 (produce_special_glyphs): Move here from term.c.
9059
9060 * term.c (produce_special_glyphs): Move to xdisp.c.
9061
9062 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9063 section.
9064
9065 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9066
9067 * xdisp.c (display_line): Avoid warning about implicit declaration
9068 of FRAME_FONT.
9069
9070 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9071
9072 * lisp.h: Remove empty conditional.
9073
9074 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9075
9076 * lread.c (load_path_check): Now static.
9077
9078 Fix some minor --with-ns problems found by static checking.
9079 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9080 (x_set_font) [!HAVE_X_WINDOWS]:
9081 * image.c (xpm_load_image) [HAVE_NS]:
9082 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9083 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9084 Remove unused local.
9085 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9086 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9087 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9088 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9089 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9090 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9091 Fix pointer signedness problem.
9092 * xfaces.c (FRAME_X_FONT_TABLE):
9093 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9094
9095 2012-07-07 Glenn Morris <rgm@gnu.org>
9096
9097 * lread.c (load_path_check): New function, split from init_lread.
9098 (init_lread): Reorganize. Motivation:
9099 If EMACSLOADPATH is set, check/warn about that rather than the
9100 defaults, which we are not going to use. Hence we can remove
9101 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9102 Don't warn if site-lisp directories are missing.
9103 If not installed, start from a blank load-path, since
9104 PATH_LOADSEARCH refers to the eventual installation directories.
9105
9106 2012-07-07 Eli Zaretskii <eliz@gnu.org>
9107
9108 Support truncation and continuation glyphs on GUI frames, when
9109 fringes are disabled. (Bug#11832)
9110 * xdisp.c (init_iterator): Get dimensions of truncation and
9111 continuation glyphs even if on GUI frames.
9112 Adjust it->last_visible_x on GUI frames when the left or right fringes,
9113 or both, are absent.
9114 (start_display, move_it_in_display_line_to): Handle the case of a
9115 GUI frame without a fringe to display continuation or truncation
9116 glyphs.
9117 (insert_left_trunc_glyphs): Support GUI frames: make sure
9118 truncation glyphs overwrite enough glyphs from the current line to
9119 have sufficient space in pixels.
9120 (display_line): Support truncation and continuation glyphs on GUI
9121 frames. If some spare pixels are left on the line after inserting
9122 the truncation glyphs, fill that space with a stretch glyph of a
9123 suitably computed width.
9124
9125 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9126 produce_glyphs, to support GUI sessions.
9127
9128 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9129
9130 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9131
9132 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9133
9134 Do not require float-time's arg to fit in time_t (Bug#11825).
9135 This works better on hosts where time_t is unsigned, and where
9136 float-time is applied to the (negative) difference between two times.
9137 * editfns.c (decode_time_components): Last arg is now double *,
9138 not int *, and means to store all the result as a double, without
9139 worrying about whether the seconds part fits in time_t.
9140 All callers changed.
9141 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9142 All callers changed.
9143 (Ffloat_time): Do not fail merely because the specified time falls
9144 outside of time_t range.
9145
9146 2012-07-07 Glenn Morris <rgm@gnu.org>
9147
9148 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9149 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9150 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9151
9152 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
9153
9154 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9155 Update dependencies.
9156
9157 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9158
9159 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9160
9161 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9162 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9163 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9164 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9165 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9166 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9167
9168 * xfont.c (compare_font_names): Redo to omit the need for casts.
9169
9170 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9171
9172 * xfns.c (Fx_change_window_property): Doc fix.
9173 * w32fns.c (Fx_change_window_property): Doc fix.
9174
9175 * w32fns.c (Fx_window_property): Accept the same arguments as the
9176 X Windows version. Doc fix.
9177 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9178
9179 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
9180 Eli Zaretskii <eliz@gnu.org>
9181
9182 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9183 Windows-specific code from nt/config.nt moved here.
9184 Obsolete settings removed.
9185
9186 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9187
9188 * process.c: Avoid unnecessary calls to gettime.
9189 (wait_reading_process_output): Don't get the time of day
9190 when gobbling data immediately and not waiting, as there's no need
9191 for it in that case. This removes a FIXME.
9192
9193 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9194
9195 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9196 is defined (Bug#11768).
9197
9198 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9199
9200 Fix marker debugging code.
9201 * marker.c (byte_char_debug_check): Do not perform the check
9202 if buffer is not multibyte.
9203 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9204 Call byte_char_debug_check with correct arguments.
9205
9206 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9207
9208 Compile marker debugging code only if ENABLE_CHECKING is defined.
9209 * marker.c (byte_char_debug_check, count_markers):
9210 Use only if ENABLE_CHECKING is defined.
9211 (byte_debug_flag): Remove.
9212 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9213 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9214
9215 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9216
9217 Avoid code repetition in marker-related functions.
9218 * marker.c (attach_marker): New function.
9219 (Fset_marker, set_marker_restricted, set_marker_both)
9220 (set_marker_restricted_both): Use it.
9221 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9222 Consistently rename charno to charpos.
9223 (marker_position): Add eassert.
9224 (marker_byte_position): Convert to eassert.
9225
9226 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9227
9228 Simplify list operations in unchain_overlay and unchain_marker.
9229 * buffer.c (unchain_overlay): Simplify. Add comment.
9230 * marker.c (unchain_marker): Simplify. Fix comments.
9231
9232 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9233
9234 Introduce fast path for the widely used marker operation.
9235 * alloc.c (build_marker): New function.
9236 * lisp.h (build_marker): New prototype.
9237 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
9238 * composite.c (autocmp_chars): Likewise.
9239 * editfns.c (buildmark): Remove.
9240 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
9241 (save_restriction_save): Use build_marker.
9242 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
9243 * window.c (save_window_save): Likewise.
9244
9245 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9246
9247 Do not use Fdelete_overlay in delete_all_overlays
9248 to avoid redundant calls to unchain_overlay.
9249 * buffer.c (drop_overlay): New function.
9250 (delete_all_overlays, Fdelete_overlay): Use it.
9251 * minibuf.c (get_minibuffer): Fix comment.
9252
9253 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9254
9255 Port to OpenBSD 5.1 amd64.
9256 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
9257 This is needed for OpenBSD, and should be harmless on all BSD systems.
9258 Also, include <sys/sysctl.h>, as it should be available on all
9259 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
9260 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9261 use p_pid member, not kp_proc.pid.
9262
9263 2012-07-06 Glenn Morris <rgm@gnu.org>
9264
9265 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
9266
9267 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9268
9269 More xmalloc and related cleanup.
9270 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
9271 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
9272 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
9273 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
9274 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
9275 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
9276 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
9277 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
9278 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
9279 * xterm.c:
9280 Omit needless casts involving void * pointers and allocation.
9281 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
9282 as the former is more robust if P's type is changed.
9283 Prefer xzalloc to xmalloc + memset 0.
9284 Simplify malloc-or-realloc to realloc.
9285 Don't worry about xmalloc returning a null pointer.
9286 Prefer xstrdup to xmalloc + strcpy.
9287 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
9288 growing it.
9289 * keyboard.c (apply_modifiers_uncached): Prefer local array to
9290 alloca of a constant.
9291
9292 2012-07-05 Eli Zaretskii <eliz@gnu.org>
9293
9294 * xdisp.c (display_line): Fix horizontal pixel coordinates when
9295 hscroll is larger than the line width. Fixes long and futile
9296 looping inside extend_face_to_end_of_line (on a TTY) producing
9297 glyphs that are not needed and thrown away.
9298
9299 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9300
9301 * marker.c (set_marker_restricted_both): Simplify by using
9302 clip_to_bounds.
9303
9304 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9305
9306 * editfns.c (region_limit): Simplify by using clip_to_bounds.
9307
9308 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
9309
9310 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
9311 not defined (Bug#11768).
9312 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
9313 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
9314 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
9315 followed by gtk_box_set_homogeneous (Bug#11768).
9316 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
9317 (update_theme_scrollbar_width, xg_create_scroll_bar):
9318 Use gtk_scrollbar_new (Bug#11768).
9319 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
9320 (is_box_type): New function (Bug#11768).
9321 (xg_tool_item_stale_p): Call is_box_type.
9322 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
9323 with default display (Bug#11768).
9324
9325 2012-07-05 Eli Zaretskii <eliz@gnu.org>
9326
9327 * xdisp.c (window_hscroll_limited): New function.
9328 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
9329 coordinates when window's hscroll is set to insanely large
9330 values. (Bug#11857)
9331
9332 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
9333
9334 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
9335 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
9336
9337 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9338
9339 Cleanup xmalloc.
9340 * lisp.h (xzalloc): New prototype. Omit needless casts.
9341 * alloc.c (xzalloc): New function. Omit needless casts.
9342 * charset.c: Omit needless casts. Convert all calls to
9343 xmalloc with following memset to xzalloc.
9344 * dispnew.c: Likewise.
9345 * fringe.c: Likewise.
9346 * image.c: Likewise.
9347 * sound.c: Likewise.
9348 * term.c: Likewise.
9349 * w32fns.c: Likewise.
9350 * w32font.c: Likewise.
9351 * w32term.c: Likewise.
9352 * xfaces.c: Likewise.
9353 * xfns.c: Likewise.
9354 * xterm.c: Likewise.
9355 * atimer.c: Omit needless casts.
9356 * buffer.c: Likewise.
9357 * callproc.c: Likewise.
9358 * ccl.c: Likewise.
9359 * coding.c: Likewise.
9360 * composite.c: Likewise.
9361 * doc.c: Likewise.
9362 * doprnt.c: Likewise.
9363 * editfns.c: Likewise.
9364 * emacs.c: Likewise.
9365 * eval.c: Likewise.
9366 * filelock.c: Likewise.
9367 * fns.c: Likewise.
9368 * gtkutil.c: Likewise.
9369 * keyboard.c: Likewise.
9370 * lisp.h: Likewise.
9371 * lread.c: Likewise.
9372 * minibuf.c: Likewise.
9373 * msdos.c: Likewise.
9374 * print.c: Likewise.
9375 * process.c: Likewise.
9376 * region-cache.c: Likewise.
9377 * search.c: Likewise.
9378 * sysdep.c: Likewise.
9379 * termcap.c: Likewise.
9380 * terminal.c: Likewise.
9381 * tparam.c: Likewise.
9382 * w16select.c: Likewise.
9383 * w32.c: Likewise.
9384 * w32reg.c: Likewise.
9385 * w32select.c: Likewise.
9386 * w32uniscribe.c: Likewise.
9387 * widget.c: Likewise.
9388 * xdisp.c: Likewise.
9389 * xmenu.c: Likewise.
9390 * xrdb.c: Likewise.
9391 * xselect.c: Likewise.
9392
9393 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9394
9395 * fileio.c (time_error_value): Check the right error number.
9396 Problem reported by Troels Nielsen in
9397 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
9398
9399 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9400
9401 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
9402 This should be fixed in a better way; see Eli Zaretskii in
9403 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
9404 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
9405
9406 * fileio.c (time_error_value): Rename from special_mtime.
9407 The old name's problems were noted by Eli Zaretskii in
9408 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
9409
9410 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
9411 This variable's comment says Emacs needs at least one GDB-visible
9412 symbol of type enum pvec_type, to work around GDB problems.
9413 The symbol's value doesn't matter.
9414
9415 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
9416 that causes compilation to fail on pre-C99 compilers.
9417
9418 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
9419
9420 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
9421 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
9422
9423 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9424
9425 * buffer.c (init_buffer_once): Fix initialization of
9426 headers for buffer_defaults and buffer_local_symbols.
9427 Reported by Juanma Barranquero <lekktu@gmail.com>.
9428
9429 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9430
9431 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
9432 * lisp.h (enum pvec_type): Use fewer bits.
9433 (PSEUDOVECTOR_SIZE_BITS): New constant.
9434 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
9435 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
9436 change in pvec_type.
9437 (PSEUDOVECTOR_TYPEP): New macro.
9438 (TYPED_PSEUDOVECTORP): Use it.
9439 * fns.c (internal_equal): Adapt code to extract pvectype.
9440 * emacs.c (gdb_pvec_type): Update type.
9441 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
9442 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
9443 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
9444 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
9445 (sweep_vectors): Use it. Use local var `total_bytes' instead of
9446 abusing vector->header.next.nbytes.
9447 (live_vector_p): Use PVEC_TYPE.
9448 (mark_object): Adapt code to extract pvectype. Use switch.
9449
9450 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9451
9452 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
9453 Tighten new eassert a bit.
9454
9455 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9456
9457 Fix compilation with --enable-gcc-warnings and -O1
9458 optimization level.
9459 * doprnt.c (doprnt): Change type of tem to int, initialize
9460 to avoid compiler warning. Add eassert.
9461 * search.c (simple_search): Initialize match_byte to avoid
9462 compiler warning. Add eassert.
9463
9464 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9465
9466 Avoid weird behavior with large horizontal scrolls.
9467 Without this change, for example, large hscroll values would
9468 mess up Emacs's display on Fedora 15 x86, presumably due to
9469 overflows in int calculations in the display code.
9470 Also, if buffers had long lines, Emacs would freeze.
9471 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
9472 (set_window_hscroll): New function, containing the old guts of
9473 Fset_window_hscroll. Return the clipped value.
9474 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
9475 This avoids the need to check against PTRDIFF_MAX.
9476
9477 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
9478
9479 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9480
9481 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
9482
9483 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9484
9485 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
9486 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
9487 since GCC 4.4.6 issues a bogus warning for them.
9488
9489 Fix bugs in file timestamp newness comparisons.
9490 * fileio.c (Ffile_newer_than_file_p):
9491 * lread.c (Fload): Use full timestamp resolution of files,
9492 not just the 1-second resolution, so that files that are only
9493 slightly newer still count as newer.
9494 * fileio.c (Ffile_newer_than_file_p): Don't assume file
9495 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
9496
9497 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
9498
9499 * fileio.c: Improve handling of file time marker. (Bug#11852)
9500 (special_mtime): New function.
9501 (Finsert_file_contents, Fverify_visited_file_modtime):
9502 Use it to set special mtime values consistently.
9503
9504 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
9505
9506 * fileio.c (Finsert_file_contents): Properly handle st_mtime
9507 marker for non-existing file. (Bug#11852)
9508
9509 2012-07-03 Glenn Morris <rgm@gnu.org>
9510
9511 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
9512 and did not make it into globals.h).
9513
9514 2012-07-03 Tom Tromey <tromey@redhat.com>
9515
9516 * window.c (Fset_window_margins, Fset_window_fringes)
9517 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
9518 * textprop.c (Fprevious_property_change): No longer static.
9519 * syntax.c (Fsyntax_table_p): No longer static.
9520 * process.c (Fget_process, Fprocess_datagram_address): No longer
9521 static.
9522 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
9523 * keyboard.c (Fcommand_execute): No longer static.
9524 Remove EXFUN.
9525 * insdel.c (Fcombine_after_change_execute): No longer static.
9526 * image.c (Finit_image_library): No longer static.
9527 * fileio.c (Fmake_symbolic_link): No longer static.
9528 * eval.c (Ffetch_bytecode): No longer static.
9529 * editfns.c (Fuser_full_name): No longer static.
9530 * doc.c (Fdocumentation_property, Fsnarf_documentation):
9531 No longer static.
9532 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
9533 static.
9534 * dired.c (Ffile_attributes): No longer static.
9535 * composite.c (Fcomposition_get_gstring): No longer static.
9536 * callproc.c (Fgetenv_internal): No longer static.
9537
9538 * ccl.h: Remove EXFUNs.
9539 * buffer.h: Remove EXFUNs.
9540 * dispextern.h: Remove EXFUNs.
9541 * intervals.h: Remove EXFUNs.
9542 * fontset.h: Remove EXFUN.
9543 * font.h: Remove EXFUNs.
9544 * dosfns.c (system_process_attributes): Remove EXFUN.
9545 * keymap.h: Remove EXFUNs.
9546 * lisp.h: Remove EXFUNs.
9547 * w32term.h: Remove EXFUNs.
9548 * window.h: Remove EXFUNs.
9549 * xsettings.h: Remove EXFUN.
9550 * xterm.h: Remove EXFUN.
9551
9552 2012-07-03 Glenn Morris <rgm@gnu.org>
9553
9554 * lisp.h (Frandom): Make it visible to C.
9555 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
9556 buffer for invisible buffers. (Bug#1229)
9557
9558 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9559
9560 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
9561 values which aren't power of 2.
9562 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
9563 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
9564 accordingly.
9565
9566 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
9567
9568 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
9569
9570 * alloc.c (mark_object): Revert part of last patch to use `switch'.
9571
9572 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9573
9574 * alloc.c (allocate_vector_block): Remove redundant
9575 calls to mallopt if DOUG_LEA_MALLOC is defined.
9576 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
9577 avoid calls to mallopt if zero_vector is returned.
9578
9579 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9580
9581 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
9582 is enabled, avoid dereferencing NULL current_sblock if
9583 running undumped.
9584
9585 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9586
9587 Cleanup basic buffer management.
9588 * buffer.h (struct buffer): Change layout to use generic vector
9589 marking code. Fix some comments. Change type of 'clip_changed'
9590 to bitfield. Remove unused #ifndef old.
9591 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
9592 (GET_OVERLAYS_AT): Fix indentation.
9593 (for_each_per_buffer_object_at): New macro.
9594 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
9595 (Fbuffer_local_variables): Use it.
9596 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
9597 * alloc.c (allocate_buffer): Adjust to match new layout of
9598 struct buffer. Fix comment.
9599 (mark_overlay): New function.
9600 (mark_buffer): Use it. Use mark_vectorlike to mark normal
9601 Lisp area of struct buffer.
9602 (mark_object): Use it. Adjust marking of misc objects
9603 and related comments.
9604
9605 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
9606
9607 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
9608 wrapper that is not needed because the wrapped code is a no-op (zero
9609 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
9610 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
9611
9612 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
9613
9614 * alloc.c (mark_buffer): Simplify. Remove prototype.
9615 (mark_object): Add comment. Reorganize marking of vector-like
9616 objects. Use CHECK_LIVE for all vector-like objects except buffers
9617 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
9618 Avoid redundant calls to mark_vectorlike for bool vectors.
9619
9620 2012-06-30 Glenn Morris <rgm@gnu.org>
9621
9622 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
9623
9624 * epaths.in (PATH_SITELOADSEARCH): New.
9625 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
9626 This is rather than relying on --enable-locallisppath elements
9627 having "site-lisp" in their names. (Bug#10208#25, 11658)
9628
9629 2012-06-30 Eli Zaretskii <eliz@gnu.org>
9630
9631 * w32proc.c (sys_select): Accept and ignore one more argument.
9632
9633 * w32.c (emacs_gnutls_pull): Call select with one more argument.
9634
9635 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9636 (pselect) [!MS_DOS]: Redirect to sys_select.
9637
9638 * sysdep.c: Don't include dos.h and dosfns.h.
9639
9640 * process.c (sys_select):
9641 * msdos.c (sys_select): Accept one more argument and ignore it.
9642
9643 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
9644 adapt data types and code to that.
9645
9646 * dosfns.c:
9647 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
9648 which clashes with the gnulib function of the same name.
9649
9650 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
9651
9652 * font.c (font_style_to_value, font_style_symbolic)
9653 (font_prop_validate_style): Add type checks for values in
9654 font_style_table.
9655
9656 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
9657 argument.
9658 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
9659 uses.
9660
9661 2012-06-29 Eli Zaretskii <eliz@gnu.org>
9662
9663 * xdisp.c (try_window_id): Undo last change.
9664
9665 * w32.c (getwd): Adjust commentary about startup_dir.
9666 (init_environment): Always call sys_access, even in non-MSVC
9667 builds. Don't chdir to the directory of the Emacs executable.
9668 This undoes code from 1997 which was justified by the need to
9669 "avoid conflicts when removing and renaming directories". But its
9670 downside was that every relative file name was being interpreted
9671 relative to the directory of the Emacs executable, which can never
9672 be TRT. In particular, it broke sys_access when called with
9673 relative file names.
9674 (sys_access): Map GetLastError to errno.
9675
9676 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9677
9678 * window.h (struct window): Change type of 'fringes_outside_margins'
9679 to bitfield. Fix comment. Adjust users accordingly.
9680 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
9681 Adjust comment.
9682 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
9683 to ptrdiff_t.
9684
9685 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
9686
9687 * gnutls.c (emacs_gnutls_handshake):
9688 Add QUIT to make the loop interruptible.
9689
9690 2012-06-29 Glenn Morris <rgm@gnu.org>
9691
9692 * charset.c (init_charset): Make lack of etc/charsets fatal.
9693
9694 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9695
9696 * editfns.c (region_limit): Fix type mismatch.
9697
9698 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9699
9700 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
9701 undefined. Convert from xassert to eassert.
9702 * nsmenu.m: Convert from xassert to eassert.
9703 * nsterm.m: Likewise.
9704
9705 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
9706
9707 * editfns.c (region_limit): Clip to narrowing (bug#11770).
9708
9709 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
9710
9711 Avoid integer overflow on scroll-left and scroll-right.
9712 * window.c (HSCROLL_MAX): New macro.
9713 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
9714 overflow when requested scroll falls outside ptrdiff_t range.
9715
9716 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9717
9718 * window.h (struct window): Change type of 'hscroll',
9719 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
9720 'last_modified' and 'last_overlay_modified' to EMACS_INT.
9721 Adjust users accordingly.
9722 * xdisp.c (try_cursor_movement): Replace type check with eassert.
9723 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
9724 from EMACS_INT to ptrdiff_t.
9725 (make_window): Omit redundant initialization.
9726
9727 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
9728
9729 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
9730
9731 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9732
9733 * window.h (struct window): Change type of 'use_time' and
9734 'sequence_number' from Lisp_Object to int.
9735 * frame.c (make_frame): Adjust users accordingly.
9736 * print.c (print_object): Likewise.
9737 * window.c (select_window, Fwindow_use_time, make_parent_window)
9738 (make_window): Likewise.
9739
9740 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9741
9742 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
9743 enabled with --enable-checking=[all,glyphs] configure option.
9744 Fix GLYPH_DEBUG usage assuming that it may be undefined,
9745 adjust comments accordingly.
9746 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
9747 undefined, adjust comments accordingly.
9748 * image.c: Likewise.
9749 * scroll.c: Likewise.
9750 * w32fns.c: Likewise.
9751 * w32term.c: Likewise.
9752 * xdisp.c: Likewise.
9753 * xfaces.c: Likewise.
9754 * xfns.c: Likewise.
9755 * xterm.c: Likewise.
9756
9757 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9758
9759 Generalize run-time debugging checks.
9760 * dispextern.h (XASSERTS): Remove.
9761 * fontset.c (xassert): Remove.
9762 Convert from xassert to eassert.
9763 * alloc.c: Convert from xassert to eassert.
9764 * bidi.c: Likewise.
9765 * dispnew.c: Likewise.
9766 * fns.c: Likewise.
9767 * fringe.c: Likewise.
9768 * ftfont.c: Likewise.
9769 * gtkutil.c: Likewise.
9770 * image.c: Likewise.
9771 * keyboard.c: Likewise.
9772 * menu.c: Likewise.
9773 * process.c: Likewise.
9774 * scroll.c: Likewise.
9775 * sound.c: Likewise.
9776 * term.c: Likewise.
9777 * w32console.c: Likewise.
9778 * w32fns.c: Likewise.
9779 * w32term.c: Likewise.
9780 * window.c: Likewise.
9781 * xdisp.c: Likewise.
9782 * xfaces.c: Likewise.
9783 * xfns.c: Likewise.
9784 * xselect.c: Likewise.
9785 * xterm.c: Likewise.
9786
9787 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
9788
9789 * fns.c (maybe_resize_hash_table): Output message when growing the
9790 purify-hashtable.
9791
9792 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9793
9794 * alloc.c (allocate_string_data): Remove dead code.
9795 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
9796 avoid GCC warning about unused macro.
9797
9798 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9799
9800 * alloc.c (allocate_string): Omit intervals initialization.
9801 * alloc.c (make_uninit_multibyte_string): Initialize intervals
9802 as in make_pure_string and make_pure_c_string.
9803
9804 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9805
9806 * alloc.c (allocate_string): Fix last change.
9807
9808 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9809
9810 * alloc.c (allocate_string): Remove two redundant calls
9811 to memset, add explicit initialization where appropriate.
9812
9813 2012-06-27 Glenn Morris <rgm@gnu.org>
9814
9815 * lisp.mk (lisp): Remove paths.elc.
9816
9817 2012-06-27 Chong Yidong <cyd@gnu.org>
9818
9819 * doc.c (Fsubstitute_command_keys): Fix punctuation.
9820
9821 2012-06-26 John Wiegley <johnw@newartisans.com>
9822
9823 * unexmacosx.c (copy_data_segment): Add two section names used
9824 on Mac OS X Lion: __mod_init_func and __mod_term_func.
9825
9826 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
9827 when building with Clang.
9828
9829 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
9830
9831 * eval.c (Fapply): Allow calling it with a single argument.
9832
9833 2012-06-26 Eli Zaretskii <eliz@gnu.org>
9834
9835 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
9836 _stricmp and _strnicmp.
9837 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
9838
9839 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9840
9841 * alloc.c (allocate_window): Zero out non-Lisp part of newly
9842 allocated window.
9843 (allocate_process): Likewise for new process.
9844 (allocate_terminal): Change to use offsetof.
9845 (allocate_frame): Likewise.
9846 * frame.c (make_frame): Omit redundant initialization.
9847 * window.c (make_parent_window): Use memset.
9848 (make_window): Omit redundant initialization.
9849 * process.c (make_process): Omit redundant initialization.
9850 * terminal.c (create_terminal): Likewise.
9851
9852 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9853
9854 * term.c (delete_tty): Remove redundant call to memset.
9855
9856 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9857
9858 * alloc.c: Remove build_string.
9859 * lisp.h: Define build_string as static inline. This provides
9860 a better opportunity to optimize away calls to strlen when the
9861 function is called with compile-time constant argument.
9862 * image.c (imagemagick_error): Convert to build_string.
9863 * w32proc.c (sys_spawnve): Likewise.
9864 * xterm.c (x_term_init): Likewise.
9865
9866 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
9867
9868 Use sprintf return value instead of invoking strlen on result.
9869 In the old days this wasn't portable, since some sprintf
9870 implementations returned char *. But they died out years ago and
9871 Emacs already assumes sprintf returns int.
9872 Similarly for float_to_string.
9873 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
9874 * ccl.c (ccl_driver):
9875 * character.c (string_escape_byte8):
9876 * data.c (Fnumber_to_string):
9877 * doprnt.c (doprnt):
9878 * print.c (print_object):
9879 * xdisp.c (message_dolog):
9880 * xfns.c (syms_of_xfns):
9881 Use sprintf or float_to_string result to avoid need to call strlen.
9882 * data.c (Fnumber_to_string):
9883 Use make_unibyte_string, since the string must be ASCII.
9884 * lisp.h, print.c (float_to_string): Now returns int length.
9885 * term.c (produce_glyphless_glyph):
9886 Use sprintf result rather than recomputing it.
9887
9888 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
9889 * Makefile.in (ALL_CFLAGS):
9890 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
9891 * gmalloc.c, regex.c: Include <config.h> unconditionally.
9892
9893 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9894
9895 * dispextern.h (xstrcasecmp): Define to library function
9896 strcasecmp if available.
9897 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
9898
9899 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
9900
9901 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
9902 Avoid comma operator.
9903 * menu.c (push_submenu_start, push_submenu_end)
9904 (push_left_right_boundary, push_menu_pane): Likewise.
9905 * msdos.c (dos_rawgetc): Likewise.
9906
9907 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9908
9909 * xfns.c (xic_create_fontsetname): Remove redundant calls
9910 to memset.
9911
9912 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
9913
9914 * gtkutil.c (get_utf8_string): Remove redundant assignment.
9915 sprintf already null-terminates its output.
9916
9917 * xfns.c (x_window): Remove redundant cast.
9918
9919 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9920
9921 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
9922 `const char *' to `char *' to avoid compiler warning.
9923
9924 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9925
9926 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
9927 instead of truncating it to 63 (admittedly a generous limit).
9928
9929 * process.c: Fix spelling and caps in comments.
9930
9931 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
9932
9933 * emacs.c (setpgrp): Remove definition, unused.
9934 * sysdep.c (setpgrp): Remove definition, not used in this file.
9935
9936 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
9937
9938 * makefile.w32-in: Update dependencies.
9939
9940 2012-06-24 Eli Zaretskii <eliz@gnu.org>
9941
9942 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
9943 (SYSTIME_H): Add nt/inc/sys/time.h.
9944
9945 * systime.h [WINDOWSNT]: Include sys/time.h.
9946
9947 * s/ms-w32.h (struct timespec): Definition moved from
9948 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
9949
9950 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9951
9952 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
9953 * buffer.h (buffer_slot_type_mismatch):
9954 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9955 * eval.c (unwind_to_catch):
9956 * image.c (my_png_error, my_error_exit):
9957 * keyboard.c (quit_throw_to_read_char, user_error)
9958 (Fexit_recursive_edit, Fabort_recursive_edit):
9959 * lisp.h (die, args_out_of_range, args_out_of_range_3)
9960 (wrong_type_argument, buffer_overflow, __executable_start)
9961 (memory_full, buffer_memory_full, string_overflow, Fthrow)
9962 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
9963 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
9964 (fatal):
9965 (child_setup) [!DOS_NT]:
9966 * lread.c (end_of_file_error, invalid_syntax):
9967 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9968 * puresize.h (pure_write_error):
9969 * search.c (matcher_overflow):
9970 * sound.c (sound_perror, alsa_sound_perror):
9971 * sysdep.c, syssignal.h (croak):
9972 * term.c (maybe_fatal, vfatal):
9973 * textprop.c (text_read_only):
9974 * undo.c (user_error):
9975 * unexmacosx.c (unexec_error):
9976 * xterm.c (x_ins_del_lines, x_delete_glyphs):
9977 Use _Noreturn rather than NO_RETURN.
9978 No need for separate decl merely because of _Noreturn.
9979 * sound.c (sound_warning, parse_sound):
9980 Remove unnecessary forward decls.
9981
9982 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9983
9984 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
9985 * lisp.h (WAIT_READING_MAX): New macro.
9986 * dispnew.c (Fsleep_for, sit_for):
9987 * keyboard.c (kbd_buffer_get_event):
9988 * process.c (Faccept_process_output):
9989 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
9990 This improves on the previous patch, which introduced a bug
9991 when time_t is unsigned and as wide as intmax_t.
9992 See <http://bugs.gnu.org/9000#51>.
9993
9994 2012-06-23 Eli Zaretskii <eliz@gnu.org>
9995
9996 * dispnew.c (sit_for, Fsleep_for):
9997 * keyboard.c (kbd_buffer_get_event):
9998 * process.c (Faccept_process_output): Avoid compiler warnings when
9999 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10000
10001 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
10002
10003 * makefile.w32-in: Update dependencies.
10004
10005 * w32.c (ltime): Add return type and declare static.
10006 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10007
10008 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10009
10010 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10011 Privately reported by Herbert J. Skuhra.
10012 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10013 All uses changed.
10014 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10015 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10016
10017 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10018
10019 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10020 last argument of make_unibyte_string.
10021
10022 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10023 language ID in the event parameters.
10024
10025 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10026 event.code, not the obscure "character set ID".
10027
10028 2012-06-23 Chong Yidong <cyd@gnu.org>
10029
10030 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10031
10032 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10033
10034 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10035 * w32.c (fdutimens): New function.
10036
10037 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10038
10039 * s/ms-w32.h (pselect): Redirect to sys_select.
10040
10041 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10042
10043 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10044 in the logic of incrementing and decrementing the value of
10045 use_relocatable_buffers.
10046
10047 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10048
10049 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10050 Privately reported by Herbert J. Skuhra.
10051 [__FreeBSD__]: Remove "*/" typo after "#include".
10052 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10053 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10054 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10055 Don't assume EMACS_TIME and struct timeval are the same type.
10056
10057 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10058
10059 Support higher-resolution time stamps (Bug#9000).
10060 The time stamps are only nanosecond-resolution at the C level,
10061 since that's the best that any real-world system supports now.
10062 But they are picosecond-resolution at the Lisp level, as that's
10063 easy, and leaves room for future OS improvements.
10064
10065 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10066 (LIBES): Use it.
10067
10068 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10069 Don't get current time unless it's needed.
10070
10071 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10072 now provides it if it's absent.
10073 (start_atimer): Port to higher-res time stamps.
10074 Check for time stamp overflow. Don't get current time more
10075 often than is needed.
10076
10077 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10078 Include systime.h, not time.h.
10079 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10080
10081 * dired.c: Include stat-time.h.
10082 (Ffile-attributes): File times now have higher resolution.
10083
10084 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10085 (struct image): Timestamp now has higher resolution.
10086
10087 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10088 has at least microseconds now. All uses removed.
10089 (update_frame, update_single_window, update_window, update_frame_1)
10090 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
10091 (duration_to_sec_usec): Remove; no longer needed.
10092
10093 * editfns.c (time_overflow): Now extern.
10094 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10095 (float-time, Fformat_time_string, Fcurrent_time_string)
10096 (Fcurrent_time_zone): Accept and generate higher-resolution
10097 time stamps.
10098 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10099 (decode_time_components, lisp_seconds_argument): New functions.
10100 (make_time): Now static.
10101 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10102 Report an error if the time is invalid, rather than having the caller
10103 do that.
10104
10105 * fileio.c: Include <stat-time.h>
10106 (Fcopy_file): Copy higher-resolution time stamps.
10107 Prefer to set the time stamp via a file descriptor if that works.
10108 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10109 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10110 (Fvisited_file_modtime, Fset_visited_file_modtime):
10111 Support higher-resolution time stamps.
10112
10113 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10114
10115 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10116
10117 * image.c (prepare_image_for_display, clear_image_cache)
10118 (lookup_image): Port to higer-resolution time stamps.
10119
10120 * keyboard.c (start_polling, bind_polling_period):
10121 Check for time stamp overflow.
10122 (read_char, kbd_buffer_get_event, timer_start_idle)
10123 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10124 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10125 Port to higher-resolution time stamps. Do not assume time_t is signed.
10126 (decode_timer): New function. Timers are now vectors of length 9,
10127 not 8, to accommodate the picosecond component.
10128 (timer_check_2): Use it.
10129
10130 * nsterm.m (select_timeout, timeval_subtract): Remove.
10131 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10132 as they're a bit more accurate and handle overflow better.
10133 (ns_select): Change prototype to be compatible with pselect.
10134 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10135 * nsterm.h (ns_select): Adjust prototype.
10136
10137 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10138 us-resolution time stamps.
10139 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10140
10141 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10142
10143 * lisp.h (time_overflow): New decl.
10144 (wait_reading_process_output): First arg is now intmax_t, not int,
10145 to accommodate larger waits.
10146
10147 * process.h (struct Lisp_Process.read_output_delay):
10148 Now counts nanoseconds, not microseconds.
10149 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10150 EMACS_HAS_USECS.
10151 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10152 (wait_reading_process_output):
10153 Port to ns-resolution time stamps.
10154 (Faccept_process_output, wait_reading_process_output):
10155 Check for time stamp overflow. Do not assume time_t is signed.
10156 (select_wrapper): Remove; we now use pselect.
10157 (Fprocess_attributes): Now generates ns-resolution time stamps.
10158
10159 * sysdep.c: Include utimens.h. Don't include utime.h
10160 or worry about struct utimbuf; gnulib does that for us now.
10161 (gettimeofday): Remove; gnulib provides a substitute.
10162 (make_timeval): New function.
10163 (set_file_times): Now sets ns-resolution time stamps.
10164 New arg FD; all uses changed.
10165 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10166 (system_process_attributes):
10167 Now returns ns-resolution time stamp. All uses changed.
10168 Check for time stamp overflow.
10169
10170 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10171 provides a substitute now.
10172
10173 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10174 since it guarantees struct timespec.
10175 (EMACS_TIME): Now struct timespec, so that we can support
10176 ns-resolution time stamps.
10177 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10178 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10179 (EMACS_USECS): Remove.
10180 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10181 so multiply the arg by 1000 before storing it.
10182 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10183 New macros.
10184 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10185 Port to ns-resolution time stamps.
10186 (EMACS_TIME_NEG_P): Remove; replaced by....
10187 (EMACS_TIME_SIGN): New macro.
10188 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10189 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10190 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10191 (make_timeval, make_lisp_time, decode_time_components): New decls.
10192 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10193 that it mishandled time_t overflow. You can't compare by subtracting!
10194 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10195 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10196
10197 * term.c: Include <sys/time.h>.
10198 (timeval_to_Time): New function, for proper overflow wraparound.
10199 (term_mouse_position, term_mouse_click): Use it.
10200
10201 * undo.c (record_first_change): Support higher-resolution time stamps
10202 in the undo buffer.
10203 (Fprimitive_undo): Use them when restoring time stamps.
10204
10205 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10206 (w32_get_internal_run_time):
10207 Port to higher-resolution Emacs time stamps.
10208 (ltime): Now accepts single 64-bit integer, as that's more convenient
10209 for callers.
10210
10211 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10212
10213 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10214 for compatibility with pselect. Support ns-resolution time stamps.
10215
10216 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10217
10218 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10219 Check for time stamp overflow, and support ns-resolution time stamps.
10220
10221 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10222 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
10223 (timeval_subtract): Remove; no longer needed.
10224 (XTflash, XTring_bell, x_wait_for_event):
10225 Port to ns-resolution time stamps. Don't assume time_t is signed.
10226
10227 2012-06-22 Chong Yidong <cyd@gnu.org>
10228
10229 * xdisp.c (x_consider_frame_title): Revert last change.
10230
10231 2012-06-22 Eli Zaretskii <eliz@gnu.org>
10232
10233 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
10234 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
10235 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
10236 staticidx goes up to 1597 out of 1600 = 0x640.)
10237
10238 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
10239
10240 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
10241 Otherwise, the umask might be mistakenly 0 while handling input signals.
10242
10243 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
10244
10245 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
10246
10247 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
10248
10249 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
10250 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
10251 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
10252 access to `contents' member of Lisp_Vector objects with AREF and ASET
10253 where appropriate.
10254
10255 2012-06-19 Chong Yidong <cyd@gnu.org>
10256
10257 * frame.c (delete_frame): When selecting a frame on a different
10258 text terminal, do not alter the terminal's top-frame.
10259
10260 * xdisp.c (format_mode_line_unwind_data): Record the target
10261 frame's selected window and its terminal's top-frame.
10262 (unwind_format_mode_line): Restore them.
10263 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
10264 Callers changed.
10265 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
10266 since tty frames can be explicitly named.
10267 (prepare_menu_bars): Likewise.
10268
10269 * term.c (Ftty_top_frame): New function.
10270
10271 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10272
10273 Port byte-code-meter to modern targets.
10274 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
10275 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
10276 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
10277 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
10278 (METER_1, METER_2): Simplify.
10279
10280 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
10281
10282 * data.c (Fdefalias): Return `symbol' (bug#11686).
10283
10284 2012-06-18 Martin Rudalics <rudalics@gmx.at>
10285
10286 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
10287 gets killed during executing of this function (Bug#11665).
10288 Try to always return Qt when the buffer has been actually killed.
10289 (Vkill_buffer_query_functions): In doc-string say that functions
10290 run by this hook should not change the current buffer.
10291
10292 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10293
10294 Fix recently-introduced process.c problems found by static checking.
10295 * process.c (write_queue_push, write_queue_pop, send_process):
10296 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
10297 (write_queue_pop): Fix pointer signedness problem.
10298 (send_process): Remove unused local.
10299
10300 2012-06-17 Chong Yidong <cyd@gnu.org>
10301
10302 * xdisp.c (redisplay_internal): No need to redisplay terminal
10303 frames that are not on top.
10304
10305 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
10306
10307 * process.c (make_process): Initialize write_queue.
10308 (write_queue_push, write_queue_pop): New functions.
10309 (send_process): Use them to maintain correct ordering of process
10310 writes (Bug#10815).
10311
10312 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
10313
10314 * lisp.h (eassert): Assume C89 or later.
10315 This removes the need for CHECK.
10316 (CHECK): Remove. Its comments about always evaluating its
10317 argument were confusing, as 'eassert' typically does not evaluate
10318 its argument.
10319
10320 * coding.c (produce_chars): Use ptrdiff_t, not int.
10321
10322 * xterm.c (x_draw_underwave): Check for integer overflow.
10323 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
10324
10325 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
10326
10327 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
10328 referenced (Bug#11583).
10329
10330 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
10331
10332 Implement wave-style variant of underlining.
10333 * dispextern.h (face_underline_type): New enum.
10334 (face): Add field for underline type.
10335 * nsterm.m (ns_draw_underwave): New function.
10336 (ns_draw_text_decoration): Use it.
10337 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
10338 New functions.
10339 (x_draw_glyph_string): Use them.
10340 * xfaces.c (Qline, Qwave): New Lisp objects.
10341 (check_lface_attrs, merge_face_ref)
10342 (Finternal_set_lisp_face_attribute, realize_x_face):
10343 Handle wave-style underline face attributes.
10344 * xterm.c (x_draw_underwave): New function.
10345 (x_draw_glyph_string): Use it.
10346
10347 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
10348
10349 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
10350 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
10351 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
10352 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
10353 ($(BLD)/w32select.$(O)): Update dependencies.
10354
10355 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10356
10357 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
10358 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
10359 * character.c (_fetch_multibyte_char_p): Remove.
10360 * alloc.c: Include "character.h" before "buffer.h".
10361 * bidi.c: Likewise.
10362 * buffer.c: Likewise.
10363 * bytecode.c: Likewise.
10364 * callint.c: Likewise.
10365 * callproc.c: Likewise.
10366 * casefiddle.c: Likewise.
10367 * casetab.c: Likewise.
10368 * category.c: Likewise.
10369 * cmds.c: Likewise.
10370 * coding.c: Likewise.
10371 * composite.c: Likewise.
10372 * dired.c: Likewise.
10373 * dispnew.c: Likewise.
10374 * doc.c: Likewise.
10375 * dosfns.c: Likewise.
10376 * editfns.c: Likewise.
10377 * emacs.c: Likewise.
10378 * fileio.c: Likewise.
10379 * filelock.c: Likewise.
10380 * font.c: Likewise.
10381 * fontset.c: Likewise.
10382 * fringe.c: Likewise.
10383 * indent.c: Likewise.
10384 * insdel.c: Likewise.
10385 * intervals.c: Likewise.
10386 * keyboard.c: Likewise.
10387 * keymap.c: Likewise.
10388 * lread.c: Likewise.
10389 * macros.c: Likewise.
10390 * marker.c: Likewise.
10391 * minibuf.c: Likewise.
10392 * nsfns.m: Likewise.
10393 * nsmenu.m: Likewise.
10394 * print.c: Likewise.
10395 * process.c: Likewise.
10396 * regex.c: Likewise.
10397 * region-cache.c: Likewise.
10398 * search.c: Likewise.
10399 * syntax.c: Likewise.
10400 * term.c: Likewise.
10401 * textprop.c: Likewise.
10402 * undo.c: Likewise.
10403 * unexsol.c: Likewise.
10404 * w16select.c: Likewise.
10405 * w32fns.c: Likewise.
10406 * w32menu.c: Likewise.
10407 * window.c: Likewise.
10408 * xdisp.c: Likewise.
10409 * xfns.c: Likewise.
10410 * xmenu.c: Likewise.
10411 * xml.c: Likewise.
10412 * xselect.c: Likewise.
10413
10414 2012-06-16 Eli Zaretskii <eliz@gnu.org>
10415
10416 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
10417 If all the glyphs of the glyph row came from strings, and we have no
10418 cursor positioning clues, put the cursor on the first glyph of the
10419 row.
10420 (handle_face_prop): Use chunk-relative overlay string index when
10421 indexing into it->string_overlays array. (Bug#11653)
10422 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
10423 the rightmost. (Bug#11720)
10424
10425 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10426
10427 * category.h (CHAR_HAS_CATEGORY): Define as inline.
10428 (CATEGORY_MEMBER): Enforce 1/0 value.
10429 * category.c (_temp_category_set): Remove.
10430
10431 2012-06-16 Eli Zaretskii <eliz@gnu.org>
10432
10433 * window.c (Fdelete_other_windows_internal)
10434 (Fdelete_window_internal): Don't access frame's mouse highlight
10435 info of the initial frame. (Bug#11677)
10436
10437 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
10438
10439 * .gdbinit (xgetint): Fix recently-introduced paren typo.
10440 Assume USE_2_TAGS_FOR_INTS.
10441 (xreload): Adjust $tagmask width to match recent lisp.h change.
10442
10443 Simplify lisp.h in minor ways that should not affect code.
10444 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
10445 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
10446 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
10447 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
10448 (INTTYPEBITS): New macro, for clarity.
10449 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
10450 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
10451 Simplify now that USE_LSB_TAG is always defined.
10452 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
10453 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
10454
10455 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
10456
10457 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
10458
10459 2012-06-13 Glenn Morris <rgm@gnu.org>
10460
10461 * s/bsd-common.h (BSD4_3):
10462 * s/usg5-4-common.h (USG5_4): No longer define; unused.
10463
10464 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
10465
10466 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
10467 instead of union.
10468 (XLI, XIL): Define.
10469 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
10470 Use them.
10471 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
10472 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
10473 * alloc.c (widen_to_Lisp_Object): Remove.
10474 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
10475 * frame.c (delete_frame): Remove outdated comment.
10476 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
10477 USE_LISP_UNION_TYPE.
10478 (Fw32_unregister_hot_key): Likewise.
10479 (Fw32_toggle_lock_key): Likewise.
10480 * w32menu.c (add_menu_item): Likewise.
10481 (w32_menu_display_help): Use XIL instead of checking
10482 USE_LISP_UNION_TYPE.
10483 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
10484 (init_heap): Likewise.
10485 * w32term.c (w32_read_socket): Update comment.
10486
10487 2012-06-13 Glenn Morris <rgm@gnu.org>
10488
10489 * s/usg5-4-common.h, src/s/unixware.h:
10490 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
10491
10492 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
10493
10494 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
10495
10496 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
10497 * alloc.c (make_number) [!defined make_number]:
10498 Remove, as lisp.h always defines this now.
10499 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
10500 (roundup_size): Verify that it is a power of 2.
10501 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
10502 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
10503 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
10504 -DUSE_LSB_TAG=0, to override the automatically-selected default.
10505 USE_LSB_TAG now is always defined to be either 0 or 1.
10506 All uses changed.
10507 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
10508 code works fine either way, and efficiency is not a concern here,
10509 as the union type is for debugging, not for production.
10510 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
10511 Use an inline function on all platforms when using the union type,
10512 since this is simpler and 'static inline' can be used portably
10513 within Emacs now.
10514 (LISP_INITIALLY_ZERO): New macro.
10515 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
10516 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
10517
10518 2012-06-12 Glenn Morris <rgm@gnu.org>
10519
10520 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
10521
10522 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
10523
10524 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
10525 Move BROKEN_SIGIO to configure.
10526
10527 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
10528 Move NO_TERMIO to configure.
10529
10530 2012-06-12 Chong Yidong <cyd@gnu.org>
10531
10532 * image.c (imagemagick_load_image): Use MagickFlattenImage if
10533 MagickMergeImageLayers is undefined. Use pixel pusher loop if
10534 MagickExportImagePixels is undefined.
10535
10536 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
10537
10538 * image.c (imagemagick_load_image): Remove unused label.
10539
10540 2012-06-11 Glenn Morris <rgm@gnu.org>
10541
10542 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10543 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
10544 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
10545 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
10546
10547 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
10548
10549 * alloc.c (make_byte_code): New function.
10550 (Fmake_byte_code): Use it. Don't purify here.
10551 * lread.c (read1): Use it as well to avoid extra allocation.
10552
10553 2012-06-11 Chong Yidong <cyd@gnu.org>
10554
10555 * image.c (imagemagick_load_image): Implement transparency.
10556
10557 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
10558
10559 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
10560 account for preceding backslashes. (Bug#11663)
10561
10562 2012-06-09 Chong Yidong <cyd@gnu.org>
10563
10564 * term.c: Support italics in capable terminals (Bug#9652).
10565 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
10566 (turn_on_face): Output using TS_enter_italic_mode if available.
10567 Don't handle unused blinking and alt-charset cases.
10568 (turn_off_face): Handle italic case; discard unused tty_blinking_p
10569 and tty_alt_charset_p cases.
10570 (tty_capable_p, init_tty): Support italics.
10571
10572 * termchar.h (struct tty_display_info): Add field for italics.
10573 Remove unused blink field.
10574
10575 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
10576 Handle slant.
10577
10578 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
10579 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
10580 tty_alt_charset_p. Add tty_italic_p.
10581
10582 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
10583
10584 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
10585 dbus_type_is_basic if available.
10586 (xd_extract_signed, xd_extract_unsigned): Rename from
10587 extract_signed and extract_unsigned, respectively. Adapt callers.
10588
10589 2012-06-09 Chong Yidong <cyd@gnu.org>
10590
10591 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
10592
10593 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
10594 case (Bug#9752).
10595
10596 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
10597
10598 * xdisp.c (vmessage): Treat frame message as multibyte.
10599 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
10600 would generate the diagnostic "Making \302\247 buffer-local while
10601 let-bound!".
10602
10603 2012-06-08 Eli Zaretskii <eliz@gnu.org>
10604
10605 * dispnew.c (showing_window_margins_p): Undo last change, which
10606 was done due to an inadvertent commit.
10607 (adjust_frame_glyphs_for_frame_redisplay): Do call
10608 showing_window_margins_p.
10609
10610 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10611
10612 * eval.c (Fmake_var_non_special): New primitive.
10613 (syms_of_eval): Defsubr it.
10614 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
10615
10616 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
10617
10618 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
10619 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
10620
10621 2012-06-08 Eli Zaretskii <eliz@gnu.org>
10622
10623 * alloc.c (allocate_vectorlike): Fix last change.
10624
10625 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
10626
10627 Block-based vector allocation of small vectors.
10628 * lisp.h (struct vectorlike_header): New field `nbytes',
10629 adjust comment accordingly.
10630 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
10631 to denote vector blocks. Adjust users (live_vector_p,
10632 mark_maybe_pointer, valid_lisp_object_p) accordingly.
10633 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
10634 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
10635 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
10636 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
10637 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
10638 (roundup_size): New constant.
10639 (struct vector_block): New data type.
10640 (vector_blocks, vector_free_lists, zero_vector): New variables.
10641 (all_vectors): Rename to `large_vectors'.
10642 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
10643 (sweep_vectors): New functions.
10644 (allocate_vectorlike): Return `zero_vector' as the only vector of
10645 0 items. Allocate new vector from block if vector size is less than
10646 or equal to VBLOCK_BYTES_MAX.
10647 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
10648 (init_alloc_once): Add call to init_vectors.
10649
10650 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10651
10652 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
10653
10654 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
10655
10656 * doprnt.c (doprnt): Truncate multibyte char correctly.
10657 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
10658 would mishandle a string argument "Xc" if X was a multibyte
10659 character of length 2: it would truncate after X's first byte
10660 rather than including all of X.
10661
10662 2012-06-06 Chong Yidong <cyd@gnu.org>
10663
10664 * buffer.c (word_wrap): Doc fix.
10665
10666 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
10667
10668 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
10669
10670 2012-06-03 Glenn Morris <rgm@gnu.org>
10671
10672 * xdisp.c (tool-bar-style): Doc fix.
10673
10674 2012-06-03 Ulrich Müller <ulm@gentoo.org>
10675
10676 * Makefile.in (PAXCTL): Define.
10677 (temacs$(EXEEXT)): Disable memory randomization for the temacs
10678 binary via PaX flags if the paxctl utility is available.
10679 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
10680 Restore PaX flags to their default. (Bug#11398)
10681
10682 2012-06-03 Chong Yidong <cyd@gnu.org>
10683
10684 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
10685 buffer (Bug#11226).
10686
10687 2012-06-03 Chong Yidong <cyd@gnu.org>
10688
10689 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
10690 (note_mode_line_or_margin_highlight): If there is no help echo,
10691 use mode-line-default-help-echo. Handle the case where the mouse
10692 position is past the end of the mode line string.
10693
10694 * buffer.c (buffer_local_value_1): New function, split from
10695 Fbuffer_local_value; can return Qunbound.
10696 (Fbuffer_local_value): Use it.
10697 (Vmode_line_format): Docstring tweaks.
10698
10699 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10700
10701 * sysdep.c (system_process_attributes): Improve comment.
10702
10703 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
10704
10705 * keyboard.c: Export real-this-command to Elisp.
10706 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
10707 and DEFVAR it. Update all users.
10708
10709 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10710
10711 * minibuf.c (Fassoc_string): Remove duplicate declaration.
10712
10713 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
10714 Convert pctcpu and pctmem to Lisp float properly.
10715 Let the compiler fold better, as 100.0/0x8000 is exact.
10716
10717 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
10718
10719 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
10720 cons_block.
10721
10722 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
10723
10724 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
10725
10726 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
10727
10728 For a 'struct window', replace some Lisp_Object fields to
10729 bitfields where appropriate, remove unused fields.
10730 * window.h (struct window): Remove unused 'last_mark_x' and
10731 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
10732 change its type from Lisp_Object to bitfield.
10733 Change type of 'force_start', 'optional_new_start',
10734 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
10735 fields from Lisp_Object to bitfield. Adjust users accordingly.
10736
10737 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10738
10739 Pacify gcc -Wdouble-precision when using Xaw.
10740 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
10741 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
10742 Use 'float' consistently, rather than 'float' in most places
10743 and 'double' in a couple of places.
10744
10745 2012-05-31 Eli Zaretskii <eliz@gnu.org>
10746
10747 * xdisp.c (handle_stop): Detect whether we have overlay strings
10748 loaded by testing it->current.overlay_string_index to be
10749 non-negative, instead of checking whether n_overlay_strings is
10750 positive. (Bug#11587)
10751
10752 2012-05-31 Chong Yidong <cyd@gnu.org>
10753
10754 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
10755
10756 * doc.c (Fsubstitute_command_keys): Doc fix.
10757
10758 2012-05-31 Eli Zaretskii <eliz@gnu.org>
10759
10760 * search.c (search_buffer): Remove calls to
10761 r_alloc_inhibit_buffer_relocation, as it is now called by
10762 maybe_unify_char, which was the cause of relocation of buffer text
10763 in bug#11519.
10764
10765 2012-05-31 Eli Zaretskii <eliz@gnu.org>
10766
10767 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
10768 for the duration of call to load_charset, to avoid problems with
10769 callers of maybe_unify_char that access buffer text through C
10770 pointers.
10771
10772 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
10773 decrement the inhibition flag, instead of just setting or
10774 resetting it.
10775
10776 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10777
10778 Remove obsolete '#define static' cruft.
10779 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
10780 This #undef was "temporary" in 2000; it is no longer needed
10781 now that '#define static' has gone away.
10782 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
10783 (gray_bitmap_bits): Remove; no longer needed.
10784 All uses replaced with definiens.
10785 * xterm.c: Include "bitmaps/gray.xbm".
10786
10787 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10788
10789 Clean up __executable_start, monstartup when --enable-profiling.
10790 The following changes affect the code only when profiling.
10791 * dispnew.c (__executable_start): Rename from safe_bcopy.
10792 Define only on platforms that need it.
10793 * emacs.c: Include <sys/gmon.h> when profiling.
10794 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
10795 (__executable_start): Remove decl, since lisp.h does it now.
10796 (safe_bcopy): Remove decl; no longer has that name.
10797 (main): Coalesce #if into single bit of code, for simplicity.
10798 Cast pointers to uintptr_t, since standard libraries want integers
10799 and not pointers.
10800 * lisp.h (__executable_start): New decl.
10801
10802 2012-05-31 Glenn Morris <rgm@gnu.org>
10803
10804 * image.c (Fimagemagick_types): Doc fix.
10805
10806 2012-05-30 Jim Meyering <meyering@redhat.com>
10807
10808 * callproc.c (Fcall_process_region): Include directory component
10809 in mkstemp error message (Bug#11586).
10810
10811 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10812
10813 * alloc.c, lisp.h (make_pure_vector): Now static.
10814
10815 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
10816
10817 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
10818 Move to byte-run.el.
10819 (Fautoload): Do the hash-doc more carefully.
10820 * data.c (Fdefalias): Purify definition, except for keymaps.
10821 (Qdefun): Move from eval.c.
10822 * lisp.h (Qdefun): Remove.
10823 * lread.c (read1): Tiny simplification.
10824
10825 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
10826
10827 Do not create empty overlays with the evaporate property (Bug#9642).
10828 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
10829 Bug#9642, but explicitly check that the buffer the overlay would
10830 be moved to is live and rearrange lines to make sure that errors
10831 will not put the overlay in an inconsistent state.
10832 (Fdelete_overlay): Cosmetics.
10833
10834 2012-05-28 Eli Zaretskii <eliz@gnu.org>
10835
10836 * w32term.c (my_bring_window_to_top): New function.
10837 (x_raise_frame): Use handle returned by DeferWindowPos, which
10838 could be different from the original one.
10839 Call my_bring_window_to_top instead of my_set_foreground_window.
10840 (Bug#11513)
10841
10842 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
10843 by calling BringWindowToTop.
10844
10845 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
10846 (WM_EMACS_END): Increase by one.
10847
10848 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
10849
10850 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
10851 This avoids undefined behavior that might cause the eassert
10852 to not catch an out-of-range value.
10853
10854 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
10855
10856 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
10857 Update dependencies.
10858
10859 2012-05-27 Eli Zaretskii <eliz@gnu.org>
10860
10861 * bidi.c (bidi_mirror_char): Fix last change.
10862
10863 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
10864
10865 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
10866 when referring to sectname field in printf format.
10867
10868 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
10869
10870 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
10871 Only r_alloc_inhibit_buffer_relocation needed to be added;
10872 the others were already declared.
10873
10874 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
10875 before checking whether it's out of range. Put the check inside
10876 eassert. See
10877 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
10878
10879 2012-05-27 Ken Brown <kbrown@cornell.edu>
10880
10881 * callproc.c (Fcall_process): Restore a line that was accidentally
10882 commented out in the 2011-02-13 change (bug#11547).
10883
10884 2012-05-27 Eli Zaretskii <eliz@gnu.org>
10885
10886 * lisp.h [REL_ALLOC]: Add prototypes for external functions
10887 defined on ralloc.c.
10888
10889 * buffer.c [REL_ALLOC]: Remove prototypes of
10890 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
10891 they are now on lisp.h.
10892
10893 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
10894
10895 * search.c (search_buffer): Use it to inhibit relocation of buffer
10896 text while re_search_2 is doing its job, because re_search_2 is
10897 passed C pointers to buffer text. (Bug#11519)
10898
10899 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
10900 Update value to 24.
10901
10902 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
10903 state after an additional call to move_it_in_display_line_to, keep
10904 the values of it->max_ascent and it->max_descent found for the
10905 entire line.
10906 (pos_visible_p): Revert the comparison against bottom_y to what it
10907 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
10908 (Bug#11464)
10909
10910 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10911
10912 Fix coding-related core dumps with gcc -ftrapv.
10913 The code was computing A - B, where A and B are pointers, and B is
10914 random garbage. This can lead to core dumps on platforms that
10915 have special pointer registers, and it also leads to core dumps on
10916 x86-64 when compiled with gcc -ftrapv. The fix is to compute
10917 A - B only when B is initialized properly.
10918 * coding.c (coding_set_source, coding_set_destination): Return void.
10919 (coding_change_source, coding_change_destinations): New functions,
10920 with the old behaviors of coding_set_source and coding_set_destination.
10921 All callers that need an offset changed to use these new functions.
10922
10923 2012-05-26 Glenn Morris <rgm@gnu.org>
10924
10925 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
10926
10927 2012-05-26 Eli Zaretskii <eliz@gnu.org>
10928
10929 Extend mouse support on W32 text-mode console.
10930 * xdisp.c (draw_row_with_mouse_face):
10931 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
10932
10933 * w32console.c: Include window.h.
10934 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
10935 New functions.
10936 (initialize_w32_display): Initialize mouse-highlight data.
10937
10938 * w32inevt.c: Include termchar.h and window.h.
10939 (do_mouse_event): Support mouse-autoselect-window. When the mouse
10940 moves, call note_mouse_highlight. If help_echo changed, call
10941 gen_help_event to produce help-echo message in the echo area.
10942 Call clear_mouse_face if mouse_face_hidden is set in the mouse
10943 highlight info.
10944
10945 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10946
10947 * lread.c (read1): Simplify slightly to avoid an overflow warning
10948 with GCC 4.7.0 on x86-64.
10949
10950 2012-05-26 Eli Zaretskii <eliz@gnu.org>
10951
10952 * bidi.c (bidi_mirror_char): Revert last change: an int is
10953 definitely wide enough here.
10954
10955 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
10956
10957 Fix integer width and related bugs (Bug#9874).
10958 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
10959 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
10960 (string_bytes, check_sblock, allocate_string_data):
10961 (compact_small_strings, Fmake_bool_vector, make_string)
10962 (make_unibyte_string, make_multibyte_string)
10963 (make_string_from_bytes, make_specified_string)
10964 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
10965 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
10966 (mark_vectorlike):
10967 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10968 (allocate_pseudovector):
10969 Use int, not EMACS_INT, where int is wide enough.
10970 (inhibit_garbage_collection, Fgarbage_collect):
10971 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10972 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
10973 int might not be wide enough.
10974 (bidi_cache_search, bidi_cache_find, bidi_init_it)
10975 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
10976 (bidi_at_paragraph_end, bidi_find_paragraph_start)
10977 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
10978 (bidi_level_of_next_char, bidi_move_to_visually_next):
10979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10980 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
10981 (Fkill_buffer, Fset_buffer_major_mode)
10982 (advance_to_char_boundary, Fbuffer_swap_text)
10983 (Fset_buffer_multibyte, overlays_at, overlays_in)
10984 (overlay_touches_p, struct sortvec, record_overlay_string)
10985 (overlay_strings, recenter_overlay_lists)
10986 (adjust_overlays_for_insert, adjust_overlays_for_delete)
10987 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
10988 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
10989 (Foverlay_recenter, last_overlay_modification_hooks_used)
10990 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
10991 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10992 (validate_region): Omit unnecessary test for b <= e,
10993 since that's guaranteed by the previous test.
10994 (adjust_overlays_for_delete): Avoid pos + length overflow.
10995 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
10996 (report_overlay_modification):
10997 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10998 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
10999 Omit pointer cast, which isn't needed anyway, and doesn't work
11000 after the EMACS_INT -> ptrdiff_t change.
11001 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
11002 * buffer.h: Adjust decls to match defn changes elsewhere.
11003 (struct buffer_text, struct buffer):
11004 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11005 Use EMACS_INT, not int, where int might not be wide enough.
11006 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11007 not int, to avoid needless 32-bit limit on 64-bit hosts.
11008 (exec_byte_code): Use tighter memory-full test, one that checks
11009 for alloca overflow. Don't compute the address of the object just
11010 before an array, as that's not portable. Use EMACS_INT, not
11011 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
11012 * callint.c (Fcall_interactively):
11013 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11014 * callproc.c (call_process_kill, Fcall_process):
11015 Don't assume pid_t fits into an Emacs fixnum.
11016 (call_process_cleanup, Fcall_process, child_setup):
11017 Don't assume pid_t fits into int.
11018 (call_process_cleanup, Fcall_process, delete_temp_file)
11019 (Fcall_process_region):
11020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11021 (Fcall_process): Simplify handling of volatile integers.
11022 Use int, not EMACS_INT, where int will do.
11023 * casefiddle.c (casify_object, casify_region, operate_on_word)
11024 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11025 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11026 (casify_object): Avoid integer overflow when overallocating buffer.
11027 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
11028 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
11029 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11030 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11031 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11032 integers are now checked earlier. All uses replaced with XINT.
11033 (ccl_driver):
11034 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11035 For CCL_MapSingle, check that content and value are in int range.
11036 (ccl_driver, Fregister_code_conversion_map):
11037 Check that Vcode_version_map_vector is a vector.
11038 (resolve_symbol_ccl_program): Check that vector header is in range.
11039 Always copy the vector, so that we can check its contents reliably
11040 now rather than having to recheck each instruction as it's being
11041 executed. Check that vector words fit in 'int'.
11042 (ccl_get_compiled_code, Fregister_ccl_program)
11043 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11044 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11045 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11046 contents are in range.
11047 (Fccl_execute_on_string): Check that status is in range.
11048 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11049 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11050 Accept and return EMACS_INT, not int, because callers can pass values
11051 out of 'int' range.
11052 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11053 (multibyte_chars_in_text, parse_str_as_multibyte)
11054 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11055 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11056 (string_escape_byte8, Fget_byte):
11057 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11058 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
11059 avoid mishandling large integers.
11060 * character.h: Adjust decls to match defn changes elsewhere.
11061 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11062 (Ffind_charset_region):
11063 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11064 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11065 (load_charset_map_from_vector, Fdefine_charset_internal):
11066 Don't assume fixnum fits in int.
11067 (load_charset_map_from_vector, Fmap_charset_chars):
11068 Remove now-unnecessary CHECK_NATNUMs.
11069 (Fdefine_charset_internal): Check ranges here, more carefully.
11070 Don't rely on undefined behavior with signed left shift overflow.
11071 Don't assume unsigned int fits into fixnum, or that fixnum fits
11072 into unsigned int. Don't require max_code to be a valid fixnum;
11073 that's not true for gb10830 4-byte on a 32-bit host. Allow
11074 invalid_code to be a cons, for the same reason. Require code_offset
11075 to be a character. Avoid int overflow if max_char is close
11076 to INT_MAX.
11077 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11078 this is intended anyway and avoids some undefined behavior.
11079 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11080 INDEX_TO_CODE_POINT, as that's what it expects.
11081 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
11082 * charset.h (DECODE_CHAR): Return int, not unsigned;
11083 this is what was intended anyway, and it avoids undefined behavior.
11084 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11085 integer-overflow issues.
11086 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11087 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11088 where the argument is EMACS_INT, and this behavior is not intended.
11089 * chartab.c (Fmake_char_table, Fset_char_table_range)
11090 (uniprop_get_decoder, uniprop_get_encoder):
11091 Don't assume fixnum fits in int.
11092 * cmds.c (move_point): New function, that does the gist of
11093 Fforward_char and Fbackward_char, but does so while checking
11094 for integer overflow more accurately.
11095 (Fforward_char, Fbackward_char): Use it.
11096 (Fforward_line, Fend_of_line, internal_self_insert)
11097 (internal_self_insert):
11098 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11099 Fix a FIXME, by checking for integer overflow when calculating
11100 target_clm and actual_clm.
11101 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
11102 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
11103 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11104 (coding_alloc_by_making_gap, alloc_destination)
11105 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11106 (encode_coding_utf_16, detect_coding_emacs_mule)
11107 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11108 (detect_coding_iso_2022, decode_coding_iso_2022)
11109 (encode_invocation_designation, encode_designation_at_bol)
11110 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11111 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11112 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11113 (encode_coding_ccl, encode_coding_raw_text)
11114 (detect_coding_charset, decode_coding_charset)
11115 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11116 (produce_composition, produce_charset, produce_annotation)
11117 (decode_coding, handle_composition_annotation)
11118 (handle_charset_annotation, consume_chars, decode_coding_gap)
11119 (decode_coding_object, encode_coding_object, detect_coding_system)
11120 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11121 (code_convert_region, code_convert_string)
11122 (Fdefine_coding_system_internal)
11123 (coding_set_source, coding_set_destination):
11124 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11125 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11126 (Fdefine_coding_system_internal):
11127 Don't assume fixnums fit in int.
11128 (decode_coding_gap, decode_coding_object, encode_coding_object)
11129 (Fread_coding_system, Fdetect_coding_region)
11130 (Funencodable_char_position, Fcheck_coding_systems_region)
11131 (get_translation, handle_composition_annotation, consume_chars):
11132 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11133 (consume_chars): Rewrite to not calculate an address outside buffer.
11134 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
11135 Don't access memory outside of the args array.
11136 (Fdefine_coding_system_internal): Check for charset-id overflow.
11137 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11138 result of ENCODE_CHAR.
11139 * coding.h: Adjust decls to match defn changes elsewhere.
11140 (struct coding_system):
11141 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11142 * composite.c (get_composition_id, find_composition)
11143 (run_composition_function, update_compositions)
11144 (compose_text, composition_gstring_put_cache)
11145 (composition_gstring_p, composition_gstring_width)
11146 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11147 (composition_compute_stop_pos, composition_reseat_it)
11148 (composition_update_it, struct position_record)
11149 (find_automatic_composition, composition_adjust_point)
11150 (Fcomposition_get_gstring, Ffind_composition_internal):
11151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11152 (update_compositions):
11153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11154 * composite.h: Adjust decls to match defn changes elsewhere.
11155 (struct composition):
11156 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11157 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11158 Do not attempt to compute the address of the object just before a
11159 buffer; this is not portable.
11160 (Faref, Faset):
11161 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11162 (Faset): Use int, not EMACS_INT, where int is wide enough.
11163 (Fstring_to_number): Don't assume fixnums fit in int.
11164 (Frem): Don't assume arg is nonnegative.
11165 * dbusbind.c (xd_append_arg): Check for integers out of range.
11166 (Fdbus_call_method): Don't overflow the timeout int.
11167 (extract_signed, extract_unsigned): New functions.
11168 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11169 (xd_get_connection_references): Return ptrdiff_t, not int.
11170 All uses changed.
11171 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11172 (xd_read_message_1):
11173 Use int, not unsigned, where the dbus API uses int.
11174 (Fdbus_message_internal): Don't overflow mtype.
11175 (syms_of_dbusbind): Allocate right-sized buffer for integers.
11176 * dired.c (directory_files_internal, file_name_completion, scmp)
11177 (file_name_completion_stat):
11178 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11179 (file_name_completion): Don't overflow matchcount.
11180 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11181 * dispextern.h: Adjust decls to match defn changes elsewhere.
11182 (struct text_pos, struct glyph, struct bidi_saved_info)
11183 (struct bidi_string_data, struct bidi_it, struct composition_it)
11184 (struct it):
11185 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11186 (struct display_pos, struct composition_it, struct it):
11187 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11188 * dispnew.c (increment_matrix_positions)
11189 (increment_row_positions, mode_line_string)
11190 (marginal_area_string):
11191 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11192 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
11193 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11194 (duration_to_sec_usec): New function, to check for overflow better.
11195 (Fsleep_for, sit_for): Use it.
11196 * doc.c (get_doc_string, store_function_docstring):
11197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11198 (get_doc_string, Fsnarf_documentation):
11199 Use int, not EMACS_INT, where int is wide enough.
11200 (get_doc_string):
11201 Use SAFE_ALLOCA, not alloca.
11202 Check for overflow when converting EMACS_INT to off_t.
11203 * doprnt.c (doprnt):
11204 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11205 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11206 Don't assume uid_t fits into fixnum.
11207 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11208 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11209 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11210 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
11211 (general_insert_function)
11212 (Finsert_char, make_buffer_string, make_buffer_string_both)
11213 (update_buffer_properties, Fbuffer_substring)
11214 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11215 (Fsubst_char_in_region, check_translation)
11216 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11217 (transpose_markers, Ftranspose_regions):
11218 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11219 (clip_to_bounds): Move to lisp.h as an inline function).
11220 (Fconstrain_to_field): Don't assume integers are nonnegative.
11221 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11222 (Fsubst_char_in_region, Fsave_restriction):
11223 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11224 (Femacs_pid): Don't assume pid_t fits into fixnum.
11225 (lo_time): Use int, not EMACS_INT, when int suffices.
11226 (lisp_time_argument): Check for usec out of range.
11227 (Fencode_time): Don't assume fixnum fits in int.
11228 (Fuser_login_name, Fuser_full_name): Signal an error
11229 if a uid argument is out of range, rather than relying on
11230 undefined behavior.
11231 (Fformat_time_string): Remove now-unnecessary check.
11232 lisp_time_argument checks for out-of-range usec now.
11233 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
11234 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
11235 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
11236 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
11237 (init_cmdargs, Fdump_emacs):
11238 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11239 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
11240 the bottom (typically) 32 bits of the fixnum.
11241 * eval.c (specpdl_size, call_debugger):
11242 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11243 (when_entered_debugger, Fbacktrace_debug):
11244 Don't assume fixnum can fit in int.
11245 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
11246 the object just before a buffer; this is not portable.
11247 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
11248 (grow_specpdl, unbind_to):
11249 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11250 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
11251 (grow_specpdl): Simplify allocation by using xpalloc.
11252 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
11253 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
11254 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
11255 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11256 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
11257 (a_write, e_write):
11258 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11259 (Fcopy_file, non_regular_nbytes, read_non_regular)
11260 (Finsert_file_contents):
11261 Use int, not EMACS_INT, where int is wide enough.
11262 (READ_BUF_SIZE): Verify that it fits in int.
11263 (Finsert_file_contents): Check that counts are in proper range,
11264 rather than assuming fixnums fit into ptrdiff_t etc.
11265 Don't assume fixnums fit into int.
11266 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
11267 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
11268 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
11269 (string_char_to_byte, string_byte_to_char)
11270 (string_make_multibyte, string_to_multibyte)
11271 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
11272 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
11273 (substring_both, Fdelete, internal_equal, Ffillarray)
11274 (Fclear_string, mapcar1)
11275 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
11276 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
11277 (larger_vector, make_hash_table, maybe_resize_hash_table)
11278 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
11279 (Fmaphash, secure_hash):
11280 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11281 (concat): Check for string index and length overflow.
11282 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
11283 (Frequire):
11284 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11285 (larger_vector): New API (vec, incr_min, size_max) replaces old
11286 one (vec, new_size, init). This catches size overflow.
11287 INIT was removed because it was always Qnil.
11288 All callers changed.
11289 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
11290 the upper bound on a hash table index size.
11291 (make_hash_table, maybe_resize_hash_table): Use it.
11292 (secure_hash): Computer start_byte and end_byte only after
11293 they're known to be in ptrdiff_t range.
11294 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
11295 (Ffont_get_glyphs, Ffont_at):
11296 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11297 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
11298 (Flist_fonts, Fopen_font):
11299 Don't assume fixnum can fit in int.
11300 (check_gstring): Don't assume index can fit in int.
11301 (font_match_p): Check that fixnum is a character, not a nonnegative
11302 fixnum, since the later code needs to stuff it into an int.
11303 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
11304 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
11305 conversion overflow issues.
11306 (Fopen_font): Check for integer out of range.
11307 (Ffont_get_glyphs): Don't assume index can fit in int.
11308 * font.h: Adjust decls to match defn changes elsewhere.
11309 * fontset.c (reorder_font_vector): Redo score calculation to avoid
11310 integer overflow.
11311 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
11312 printmax_t, where ptrdiff_t is wide enough.
11313 (Finternal_char_font):
11314 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11315 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
11316 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
11317 (Fset_frame_position, x_set_frame_parameters)
11318 (x_set_line_spacing, x_set_border_width)
11319 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
11320 Check that fixnums are in proper range for system types.
11321 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
11322 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11323 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
11324 Use SAFE_ALLOCA_LISP, not alloca.
11325 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
11326 intptr_t is wide enough.
11327 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
11328 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
11329 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
11330 Check for fixnum out of range.
11331 * ftfont.c (ftfont_list): Don't assume index fits in int.
11332 Check that fixnums are in proper range for system types.
11333 (ftfont_shape_by_flt):
11334 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11335 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11336 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11337 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
11338 Check that fixnums are in proper range for system types.
11339 * gnutls.h: Adjust decls to match defn changes elsewhere.
11340 * gtkutil.c (xg_dialog_run):
11341 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11342 (update_frame_tool_bar):
11343 Check that fixnums are in proper range for system types.
11344 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
11345 (lookup_image): Check that fixnums are in range for system types.
11346 * indent.c (last_known_column, last_known_column_point):
11347 (current_column_bol_cache):
11348 (skip_invisible, current_column, check_display_width):
11349 (check_display_width, scan_for_column, current_column_1)
11350 (Findent_to, Fcurrent_indentation, position_indentation)
11351 (indented_beyond_p, Fmove_to_column, compute_motion):
11352 (Fcompute_motion, Fvertical_motion):
11353 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11354 (last_known_column_modified): Use EMACS_INT, not int.
11355 (check_display_width):
11356 (Fcompute_motion):
11357 Check that fixnums and floats are in proper range for system types.
11358 (compute_motion): Don't assume index or fixnum fits in int.
11359 (compute_motion, Fcompute_motion):
11360 Use int, not EMACS_INT, when it is wide enough.
11361 (vmotion): Omit local var start_hpos that is always 0; that way
11362 we don't need to worry about overflow in expressions involving it.
11363 * indent.h: Adjust decls to match defn changes elsewhere.
11364 (struct position):
11365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11366 Use int, not EMACS_INT, where int is wide enough.
11367 Remove unused members ovstring_chars_done and tab_offset;
11368 all uses removed.
11369 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
11370 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
11371 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
11372 (make_gap, copy_text, insert, insert_and_inherit)
11373 (insert_before_markers, insert_before_markers_and_inherit)
11374 (insert_1, count_combining_before, count_combining_after)
11375 (insert_1_both, insert_from_string)
11376 (insert_from_string_before_markers, insert_from_string_1)
11377 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
11378 (adjust_after_replace, adjust_after_insert, replace_range)
11379 (replace_range_2, del_range, del_range_1, del_range_byte)
11380 (del_range_both, del_range_2, modify_region)
11381 (prepare_to_modify_buffer, signal_before_change)
11382 (signal_after_change, Fcombine_after_change_execute):
11383 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11384 * intervals.c (traverse_intervals, rotate_right, rotate_left)
11385 (balance_an_interval, split_interval_right, split_interval_left)
11386 (find_interval, next_interval, update_interval)
11387 (adjust_intervals_for_insertion, delete_node, delete_interval)
11388 (interval_deletion_adjustment, adjust_intervals_for_deletion)
11389 (static_offset_intervals, offset_intervals)
11390 (merge_interval_right, merge_interval_left, make_new_interval)
11391 (graft_intervals_into_buffer, temp_set_point_both)
11392 (temp_set_point, set_point, adjust_for_invis_intang)
11393 (set_point_both, move_if_not_intangible, get_property_and_range)
11394 (get_local_map, copy_intervals, copy_intervals_to_string)
11395 (compare_string_intervals, set_intervals_multibyte_1):
11396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11397 * intervals.h: Adjust decls to match defn changes elsewhere.
11398 (struct interval):
11399 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11400 * keyboard.c (this_command_key_count, this_single_command_key_start)
11401 (before_command_key_count, before_command_echo_length, echo_now)
11402 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
11403 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
11404 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
11405 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
11406 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11407 (last_non_minibuf_size, last_point_position, echo_truncate)
11408 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
11409 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
11410 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
11411 (stuff_buffered_input):
11412 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11413 (last_auto_save, command_loop_1, read_char):
11414 Use EMACS_INT, not int, to avoid integer overflow.
11415 (record_char): Avoid overflow in total_keys computation.
11416 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
11417 * keyboard.h: Adjust decls to match defn changes elsewhere.
11418 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
11419 (Fkey_description, Fdescribe_vector, Flookup_key):
11420 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11421 (click_position): New function, to check that positions are in range.
11422 (Fcurrent_active_maps):
11423 (describe_command):
11424 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11425 (Faccessible_keymaps, Fkey_description):
11426 (preferred_sequence_p):
11427 Don't assume fixnum can fit into int.
11428 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
11429 Check for integer overflow in size calculations.
11430 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
11431 avoid mishandling large integers.
11432 * lisp.h: Adjust decls to match defn changes elsewhere.
11433 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
11434 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
11435 (struct Lisp_Marker):
11436 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11437 (clip_to_bounds): Now an inline function, moved here from editfns.c.
11438 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
11439 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
11440 All callers changed.
11441 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
11442 Assume the arg has valid form, since it always does.
11443 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
11444 unsigned integer system type.
11445 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
11446 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
11447 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11448 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
11449 (duration_to_sec_usec): New decl.
11450 * lread.c (read_from_string_index, read_from_string_index_byte)
11451 (read_from_string_limit, readchar, unreadchar, openp)
11452 (read_internal_start, read1, oblookup):
11453 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11454 (Fload, readevalloop, Feval_buffer, Feval_region):
11455 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11456 (openp): Check for out-of-range argument to 'access'.
11457 (read1): Use int, not EMACS_INT, where int is wide enough.
11458 Don't assume fixnum fits into int.
11459 Fix off-by-one error that can read outside a buffer.
11460 (read_filtered_event): Use duration_to_sec_usec
11461 to do proper overflow checking on durations.
11462 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
11463 in size calculation.
11464 (Fexecute_kbd_macro):
11465 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11466 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
11467 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
11468 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
11469 (set_marker_both, set_marker_restricted_both, marker_position)
11470 (marker_byte_position, Fbuffer_has_markers_at):
11471 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11472 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
11473 * menu.c (ensure_menu_items): Rename from grow_menu_items.
11474 It now merely ensures that the menu is large enough, without
11475 necessarily growing it, as this avoids some integer overflow issues.
11476 All callers changed.
11477 (keymap_panes, parse_single_submenu, Fx_popup_menu):
11478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11479 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
11480 Use SAFE_ALLOCA_LISP, not alloca.
11481 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
11482 to EMACS_INT. Check that fixnums are in proper range for system types.
11483 * minibuf.c (minibuf_prompt_width, string_to_object)
11484 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
11485 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
11486 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11487 (get_minibuffer, read_minibuf_unwind):
11488 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11489 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
11490 this simplifies overflow checking. All callers changed.
11491 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
11492 (Ftest_completion):
11493 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11494 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
11495 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
11496 Check that fixnums are in proper range for system types.
11497 (Fx_create_frame, Fx_show_tip):
11498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11499 * nsfont.m (ns_findfonts, nsfont_list_family):
11500 Don't assume fixnum fits in long.
11501 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
11502 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11503 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
11504 wide enough.
11505 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
11506 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11507 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
11508 (PRINTDECLARE, PRINTPREPARE):
11509 (strout, print_string):
11510 (print, print_preprocess, print_check_string_charset_prop)
11511 (print_object):
11512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11513 (PRINTDECLARE):
11514 (temp_output_buffer_setup, Fprin1_to_string, print_object):
11515 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11516 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
11517 (printchar, strout): Use xpalloc to catch size calculation overflow.
11518 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
11519 (print_error_message): Use SAFE_ALLOCA, not alloca.
11520 (print_object): Use int, not EMACS_INT, where int is wide enough.
11521 (print_depth, new_backquote_output, print_number_index):
11522 Use ptrdiff_t, not int, where int might not be wide enough.
11523 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
11524 (Fset_process_window_size, Fformat_network_address)
11525 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
11526 (sigchld_handler):
11527 Check that fixnums are in proper range for system types.
11528 (Fsignal_process): Simplify by avoiding a goto.
11529 Check for process-ids out of pid_t range rather than relying on
11530 undefined behavior.
11531 (process_tick, update_tick): Use EMACS_INT, not int.
11532 (Fformat_network_address, read_process_output, send_process)
11533 (Fprocess_send_region, status_notify):
11534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11535 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
11536 (wait_reading_process_output, read_process_output, exec_sentinel):
11537 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11538 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
11539 (Faccept_process_output): Use duration_to_sec_usec to do proper
11540 overflow checking on durations.
11541 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
11542 Don't assume pid_t fits in int.
11543 * process.h (struct Lisp_Process): Members tick and update_tick
11544 are now of type EMACS_INT, not int.
11545 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
11546 configured --with-wide-int.
11547 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
11548 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
11549 * search.c (looking_at_1, string_match_1):
11550 (fast_string_match, fast_c_string_match_ignore_case)
11551 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
11552 (scan_newline, find_before_next_newline, search_command)
11553 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
11554 (set_search_regs, wordify):
11555 (Freplace_match):
11556 (Fmatch_data):
11557 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11558 (string_match_1, search_buffer, set_search_regs):
11559 (Fmatch_data):
11560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11561 (wordify): Check for overflow in size calculation.
11562 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
11563 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
11564 Check that fixnums are in proper range for system types.
11565 * sound.c (struct sound_device)
11566 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
11567 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11568 (Fplay_sound_internal):
11569 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11570 * syntax.c (struct lisp_parse_state, find_start_modiff)
11571 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
11572 (Fparse_partial_sexp):
11573 Don't assume fixnums can fit in int.
11574 (struct lisp_parse_state, find_start_pos, find_start_value)
11575 (find_start_value_byte, find_start_begv)
11576 (update_syntax_table, char_quoted, dec_bytepos)
11577 (find_defun_start, prev_char_comend_first, back_comment):
11578 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
11579 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
11580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11581 (Finternal_describe_syntax_value): Check that match_lisp is a
11582 character, not an integer, since the code stuffs it into int.
11583 (scan_words, scan_sexps_forward):
11584 Check that fixnums are in proper range for system types.
11585 (Fforward_word):
11586 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11587 (scan_sexps_forward):
11588 Use CHARACTERP, not INTEGERP, since the value must fit into int.
11589 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
11590 * syntax.h: Adjust decls to match defn changes elsewhere.
11591 (struct gl_state_s):
11592 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11593 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
11594 MOST_POSITIVE_FIXNUM.
11595 * sysdep.c (wait_for_termination_1, wait_for_termination)
11596 (interruptible_wait_for_termination, mkdir):
11597 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
11598 (emacs_read, emacs_write):
11599 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11600 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
11601 and double all fit in int.
11602 * term.c (set_tty_color_mode):
11603 Check that fixnums are in proper range for system types.
11604 * termhooks.h (struct input_event):
11605 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11606 * textprop.c (validate_interval_range, interval_of)
11607 (Fadd_text_properties, set_text_properties_1)
11608 (Fremove_text_properties, Fremove_list_of_text_properties)
11609 (Ftext_property_any, Ftext_property_not_all)
11610 (copy_text_properties, text_property_list, extend_property_ranges)
11611 (verify_interval_modification):
11612 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11613 (Fnext_single_char_property_change)
11614 (Fprevious_single_char_property_change):
11615 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11616 (copy_text_properties):
11617 Check for integer overflow in index calculation.
11618 * undo.c (last_boundary_position, record_point, record_insert)
11619 (record_delete, record_marker_adjustment, record_change)
11620 (record_property_change):
11621 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11622 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
11623 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11624 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11625 (Fx_hide_tip, Fx_file_dialog):
11626 * w32menu.c (set_frame_menubar):
11627 Use ptrdiff_t, not int, for consistency with rest of code.
11628 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
11629 (select_window, Fdelete_other_windows_internal)
11630 (window_scroll_pixel_based, window_scroll_line_based)
11631 (Frecenter, Fset_window_configuration):
11632 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11633 (Fset_window_hscroll, run_window_configuration_change_hook)
11634 (set_window_buffer, temp_output_buffer_show, scroll_command)
11635 (Fscroll_other_window, Frecenter):
11636 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11637 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
11638 Don't assume fixnum fits in int.
11639 (Fset_window_scroll_bars):
11640 Check that fixnums are in proper range for system types.
11641 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
11642 (string_pos, c_string_pos, number_of_chars, init_iterator)
11643 (in_ellipses_for_invisible_text_p, init_from_display_pos)
11644 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
11645 (compute_display_string_end, handle_face_prop)
11646 (face_before_or_after_it_pos, handle_invisible_prop)
11647 (handle_display_prop, handle_display_spec, handle_single_display_spec)
11648 (display_prop_intangible_p, string_buffer_position_lim)
11649 (string_buffer_position, handle_composition_prop, load_overlay_strings)
11650 (get_overlay_strings_1, get_overlay_strings)
11651 (iterate_out_of_display_property, forward_to_next_line_start)
11652 (back_to_previous_visible_line_start, reseat, reseat_to_string)
11653 (get_next_display_element, set_iterator_to_next)
11654 (get_visually_first_element, compute_stop_pos_backwards)
11655 (handle_stop_backwards, next_element_from_buffer)
11656 (move_it_in_display_line_to, move_it_in_display_line)
11657 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11658 (add_to_log, message_dolog, message_log_check_duplicate)
11659 (message2, message2_nolog, message3, message3_nolog
11660 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
11661 (current_message_1, truncate_echo_area, truncate_message_1)
11662 (set_message, set_message_1, store_mode_line_noprop)
11663 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
11664 (text_outside_line_unchanged_p, check_point_in_composition)
11665 (reconsider_clip_changes)
11666 (redisplay_internal, set_cursor_from_row, try_scrolling)
11667 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
11668 (redisplay_window, find_last_unchanged_at_beg_row)
11669 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
11670 (trailing_whitespace_p, find_row_edges, display_line)
11671 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
11672 (display_mode_element, store_mode_line_string)
11673 (pint2str, pint2hrstr, decode_mode_spec)
11674 (display_count_lines, display_string, draw_glyphs)
11675 (x_produce_glyphs, x_insert_glyphs)
11676 (rows_from_pos_range, mouse_face_from_buffer_pos)
11677 (fast_find_string_pos, mouse_face_from_string_pos)
11678 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11679 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11680 (safe_call, init_from_display_pos, handle_fontified_prop)
11681 (handle_single_display_spec, load_overlay_strings)
11682 (with_echo_area_buffer, setup_echo_area_for_printing)
11683 (display_echo_area, echo_area_display)
11684 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
11685 (update_tool_bar, hscroll_window_tree, redisplay_internal)
11686 (redisplay_window, dump_glyph_row, display_mode_line)
11687 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
11688 (handle_display_spec, display_prop_string_p):
11689 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11690 (handle_single_display_spec, build_desired_tool_bar_string)
11691 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
11692 (get_specified_cursor_type):
11693 Check that fixnums are in proper range for system types.
11694 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
11695 (Flookup_image_map):
11696 Don't assume fixnums fit in int.
11697 (compare_overlay_entries):
11698 Avoid mishandling comparisons due to subtraction overflow.
11699 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
11700 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
11701 (handle_tool_bar_click):
11702 Use int, not unsigned, since we prefer signed and the signedness
11703 doesn't matter here.
11704 (get_next_display_element, next_element_from_display_vector):
11705 Use int, not EMACS_INT, when int is wide enough.
11706 (start_hourglass): Use duration_to_sec_usec to do proper
11707 overflow checking on durations.
11708 * xfaces.c (Fbitmap_spec_p):
11709 Check that fixnums are in proper range for system types.
11710 (compare_fonts_by_sort_order):
11711 Avoid mishandling comparisons due to subtraction overflow.
11712 (Fx_family_fonts, realize_basic_faces):
11713 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11714 (Fx_family_fonts):
11715 Don't assume fixnum fits in int.
11716 Use SAFE_ALLOCA_LISP, not alloca.
11717 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
11718 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
11719 (face_at_buffer_position, face_for_overlay_string)
11720 (face_at_string_position):
11721 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11722 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
11723 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
11724 (Fx_show_tip):
11725 Check that fixnums are in proper range for system types.
11726 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11727 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
11728 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11729 (Fx_change_window_property): Don't assume fixnums fit in int.
11730 * xfont.c (xfont_chars_supported):
11731 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11732 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
11733 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
11734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11735 * xml.c (parse_region):
11736 * xrdb.c (magic_file_p):
11737 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11738 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
11739 (x_get_local_selection, x_reply_selection_request)
11740 (x_handle_selection_request, wait_for_property_change):
11741 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11742 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
11743 short is wide enough.
11744 (x_send_client_event): Don't assume fixnum fits in int.
11745 * xterm.c (x_x_to_emacs_modifiers):
11746 Don't assume EMACS_INT overflows nicely into int.
11747 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
11748 may come from Lisp.
11749 (handle_one_xevent): NATNUMP can eval its arg twice.
11750 (x_connection_closed):
11751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11752 * xterm.h: Adjust decls to match defn changes elsewhere.
11753 (struct scroll_bar): Use struct vectorlike_header
11754 rather than rolling our own approximation.
11755 (SCROLL_BAR_VEC_SIZE): Remove; not used.
11756
11757 2012-05-25 Glenn Morris <rgm@gnu.org>
11758
11759 * lisp.mk (lisp): Update for more files being compiled now.
11760
11761 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
11762
11763 * lread.c: Remove `read_pure' which makes no difference.
11764 (read_pure): Remove var.
11765 (unreadpure): Remove function.
11766 (readevalloop): Don't call read_list with -1 flag.
11767 (read1, read_vector): Don't test read_pure any more.
11768 (read_list): Simplify.
11769
11770 * fileio.c, character.h: Minor style tweaks.
11771
11772 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
11773
11774 * window.h (clip_changed): Remove useless declaration.
11775
11776 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
11777
11778 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
11779 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
11780
11781 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
11782
11783 Remove src/m/*.
11784 This directory predates autoconf and is no longer needed nowadays.
11785 Move its few remaining bits of functionality to where they're needed.
11786 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
11787 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
11788 * m/template.h: Remove.
11789 * Makefile.in (M_FILE): Remove. All uses removed.
11790 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
11791 * lisp.h (USE_LSB_TAG):
11792 * mem-limits.h (EXCEEDS_LISP_PTR):
11793 Use VAL_MAX, not VALBITS, in #if.
11794 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
11795 (EMACS_UINT): Define unconditionally now.
11796 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
11797 (BITS_PER_EMACS_INT): New constants, replacing
11798 what used to be in config.h, but not useful in #if.
11799 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
11800 define them any more.
11801 (VAL_MAX): New macro.
11802 (VALMASK): Use it.
11803 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
11804 BITS_PER_EMACS_INT, in #if.
11805 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11806 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
11807 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
11808 * s/ms-w32.h (DATA_START):
11809 Move here from removed file m/intel386.h.
11810 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
11811 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
11812
11813 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
11814
11815 Assume C89 or later.
11816 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
11817 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
11818 (xrealloc):
11819 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
11820 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
11821 * textprop.c, tparam.c (NULL): Remove.
11822 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
11823 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
11824 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
11825 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
11826 * xterm.c (input_signal_count): Assume volatile works.
11827
11828 2012-05-21 Ken Brown <kbrown@cornell.edu>
11829
11830 * xgselect.c (xg_select): Fix first argument in call to 'select'
11831 (bug#11508).
11832
11833 2012-05-20 Ken Brown <kbrown@cornell.edu>
11834
11835 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
11836 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
11837
11838 2012-05-19 Ken Brown <kbrown@cornell.edu>
11839
11840 * xfns.c (x_in_use): Remove `static' qualifier.
11841 * xterm.h (x_in_use): Declare.
11842 * xgselect.c: Include xterm.h.
11843 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
11844 and `display_arg' (bug#9754).
11845
11846 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
11847
11848 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
11849
11850 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
11851 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
11852
11853 2012-05-18 Eli Zaretskii <eliz@gnu.org>
11854
11855 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
11856
11857 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
11858 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
11859
11860 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
11861 reference to image_cache->refcount.
11862 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
11863
11864 2012-05-17 Juri Linkov <juri@jurta.org>
11865
11866 * search.c (Fword_search_regexp, Fword_search_backward)
11867 (Fword_search_forward, Fword_search_backward_lax)
11868 (Fword_search_forward_lax): Move functions to isearch.el
11869 (bug#10145, bug#11381).
11870
11871 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
11872
11873 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
11874
11875 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
11876
11877 * lread.c (init_obarray): Declare Qt and Qnil as special.
11878
11879 2012-05-14 Glenn Morris <rgm@gnu.org>
11880
11881 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
11882 Put "libexec" before "bin", for the sake of init_callproc_1.
11883
11884 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
11885
11886 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
11887
11888 * unexaix.c: Port to more-recent AIX compilers.
11889 (report_error, report_error_1, make_hdr, copy_sym)
11890 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
11891 Make arguments const char *, not char *, to avoid violations of C
11892 standard and to fix some AIX warnings reported by Gilles Pion.
11893
11894 2012-05-14 Eli Zaretskii <eliz@gnu.org>
11895
11896 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
11897 already have overlays loaded.
11898 (handle_single_display_spec): Before returning without displaying
11899 fringe bitmap, synchronize the bidi iterator with the main display
11900 iterator, by calling iterate_out_of_display_property.
11901 (iterate_out_of_display_property): Detect buffer iteration by
11902 testing that it->string is a Lisp string.
11903 (get_next_display_element): When the current object is exhausted,
11904 and there's something on it->stack, call set_iterator_to_next to
11905 proceed with what's on the stack, instead of returning zero.
11906 (set_iterator_to_next): If called at the end of a Lisp string,
11907 proceed to consider_string_end without incrementing string
11908 position. Don't increment display vector index past the end of
11909 the display vector. (Bug#11417)
11910 (pos_visible_p): Don't report a position visible when move_it_to
11911 stopped at the last line of window, which happens to be scanned
11912 backwards by the bidi iteration. (Bug#11464)
11913
11914 2012-05-14 Eli Zaretskii <eliz@gnu.org>
11915
11916 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
11917 and right-margin display specs even if the spec is invalid or we
11918 are on a TTY, and thus unable to display on the fringes.
11919 That's because the text with the property will not be displayed anyway,
11920 so we need to signal to the caller that this is a "replacing"
11921 display spec. This fixes display when the spec is invalid or we
11922 are on a TTY.
11923
11924 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
11925
11926 * unexaix.c (make_hdr): Fix typo in prototype.
11927 This bug broke the build on AIX. Problem reported by Gilles Pion.
11928
11929 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
11930
11931 * keyboard.c (kbd_buffer_get_event): Read special events also in
11932 batch mode. (Bug#11415)
11933
11934 2012-05-12 Glenn Morris <rgm@gnu.org>
11935
11936 * ns.mk: Update for ns_appbindir no longer having trailing "/".
11937
11938 2012-05-12 Eli Zaretskii <eliz@gnu.org>
11939
11940 * lisp.mk (lisp): Add newcomment.elc.
11941
11942 2012-05-12 Glenn Morris <rgm@gnu.org>
11943
11944 * Makefile.in (MKDIR_P): New, set by configure.
11945 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
11946
11947 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
11948
11949 Remove unused function hourglass_started.
11950 * dispextern.h (hourglass_started):
11951 * w32fns.c (hourglass_started):
11952 * xdisp.c (hourglass_started): Remove.
11953
11954 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
11955
11956 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
11957 Update dependencies.
11958
11959 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
11960
11961 * xgselect.c (xg_select): Put maxfds+1 into a var.
11962 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
11963
11964 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
11965
11966 2012-05-10 Dave Abrahams <dave@boostpro.com>
11967
11968 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
11969 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
11970
11971 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
11972
11973 * dbusbind.c (xd_registered_buses): New internal Lisp object.
11974 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
11975 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
11976 Initialize xd_registered_buses.
11977
11978 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
11979
11980 Untag more efficiently if USE_LSB_TAG.
11981 This is based on a proposal by YAMAMOTO Mitsuharu in
11982 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
11983 For an admittedly artificial (nth 8000 longlist) benchmark on
11984 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
11985 Emacs's overall text size by 1%.
11986 * lisp.h (XUNTAG): New macro.
11987 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
11988 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
11989 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
11990 * eval.c (Fautoload):
11991 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
11992 * frame.h (XFRAME): Use XUNTAG.
11993
11994 Port recent dbusbind.c changes to 32-bit --with-wide-int.
11995 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
11996 Remove unportable assumptions about print widths of types like
11997 dbus_uint32_t.
11998 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
11999 intptr_t when converting between pointer and integer, to avoid GCC
12000 warnings about wrong width.
12001
12002 2012-05-09 Eli Zaretskii <eliz@gnu.org>
12003
12004 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12005 stack for each reader_thread, instead of defaulting to 8MB
12006 determined by the linker. This avoids failures in creating
12007 subprocesses on Windows 7, see the discussion in this thread:
12008 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12009
12010 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12011
12012 Fix up display of the *Minibuf-0* buffer in the mini window.
12013 * keyboard.c (read_char): Don't clear the echo area if there's no
12014 message to clear.
12015 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
12016 contents of *Minibuf-0*) if there's no message displayed in its stead.
12017
12018 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
12019
12020 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12021 batch mode.
12022
12023 2012-05-06 Chong Yidong <cyd@gnu.org>
12024
12025 * lisp.mk (lisp): Update.
12026
12027 2012-05-05 Jim Meyering <meyering@redhat.com>
12028
12029 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12030
12031 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12032
12033 * data.c (PUT_ERROR): New macro.
12034 (syms_of_data): Use it. Add new error type `user-error'.
12035 * undo.c (user_error): New function.
12036 (Fprimitive_undo): Use it.
12037 * print.c (print_error_message): Adjust print style for `user-error'.
12038 * keyboard.c (user_error): New function.
12039 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12040
12041 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12042
12043 Do not limit current-time-string to years 1000..9999.
12044 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12045 (Fcurrent_time_string): Support any year that is supported by the
12046 underlying localtime representation. Don't use asctime, as it
12047 has undefined behavior for years outside the range -999..9999.
12048
12049 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12050
12051 Fix race conditions involving setenv, gmtime, localtime, asctime.
12052 Without this fix, interrupts could mess up code that uses these
12053 nonreentrant functions, since setting TZ invalidates existing
12054 tm_zone or tzname values, and since most of these functions return
12055 pointers to static storage.
12056 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12057 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12058 Grow the critical sections to include not just invoking
12059 localtime/gmtime, but also accessing these functions' results
12060 including their tm_zone values if any, and any related TZ setting.
12061 (format_time_string): Last arg is now struct tm *, not struct tm **,
12062 so that the struct tm is saved in the critical section.
12063 All callers changed. Simplify allocation of initial buffer, partly
12064 motivated by the fact that memory allocation needs to be outside
12065 the critical section.
12066
12067 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12068
12069 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12070 with RESET_INTERVAL.
12071
12072 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12073 Remove duplicated buffer name initialization.
12074
12075 2012-05-02 Jim Meyering <jim@meyering.net>
12076
12077 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12078
12079 * xfns.c (x_window): Use xstrdup (Bug#11375).
12080
12081 2012-05-02 Eli Zaretskii <eliz@gnu.org>
12082
12083 * xdisp.c (pos_visible_p): If already at a newline from the
12084 display string before the 'while' loop, don't walk back the glyphs
12085 from it3.glyph_row. Solves assertion violation when the display
12086 string begins with a newline (egg.el). (Bug#11367)
12087
12088 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12089
12090 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12091 Move to simple.el.
12092
12093 2012-05-01 Glenn Morris <rgm@gnu.org>
12094
12095 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12096 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12097 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12098 All were removed before 23.1.
12099
12100 * dispnew.c: Remove HAVE_LIBNCURSES test;
12101 it is always true on relevant platforms.
12102
12103 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12104 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12105
12106 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12107
12108 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12109
12110 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12111 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12112 Remove.
12113
12114 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12115
12116 Do not avoid creating empty evaporating overlays (Bug#9642).
12117 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12118 That is, do not delete an evaporating overlay if it becomes
12119 empty after its bounds are adjusted to fit within its buffer.
12120 This fix caused other problems, and I'm reverting it until we get
12121 to the bottom of them.
12122
12123 2012-04-27 Chong Yidong <cyd@gnu.org>
12124
12125 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12126
12127 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12128
12129 * xdisp.c (pos_visible_p): If the window start position is beyond
12130 ZV, start the display from buffer beginning. Prevents assertion
12131 violation in init_iterator when the minibuffer window is scrolled
12132 via the scroll bar.
12133
12134 * window.c (window_scroll_pixel_based): Likewise.
12135
12136 2012-04-27 Chong Yidong <cyd@gnu.org>
12137
12138 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12139
12140 2012-04-27 Glenn Morris <rgm@gnu.org>
12141
12142 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12143 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12144
12145 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12146
12147 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12148 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
12149
12150 2012-04-26 Eli Zaretskii <eliz@gnu.org>
12151
12152 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12153 display element, check also the underlying string or buffer
12154 character. (Bug#11341)
12155
12156 * w32menu.c: Include w32heap.h.
12157 (add_menu_item): If the call to AppendMenuW (via
12158 unicode_append_menu) fails, disable Unicode menus only if we are
12159 running on Windows 9X/Me.
12160
12161 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12162
12163 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12164 (xgetint): Add missing shift for LSB tags.
12165
12166 2012-04-24 Martin Rudalics <rudalics@gmx.at>
12167
12168 * keyboard.c (read_char): Don't wipe echo area for select window
12169 events: These might get delayed via `mouse-autoselect-window'
12170 (Bug#11304).
12171
12172 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
12173
12174 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12175 manipulation of :loaded-from data.
12176
12177 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
12178
12179 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12180 now a cons (bug#11311).
12181
12182 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12183
12184 Do not create empty overlays with the evaporate property (Bug#9642).
12185 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12186 if it becomes empty after its bounds are adjusted to fit within
12187 its buffer. Without this fix, in a nonempty buffer (let ((o
12188 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12189 yields an empty overlay that has the evaporate property, which is
12190 not supposed to happen.
12191
12192 Fix minor GTK3 problems found by static checking.
12193 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12194 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12195 (struct _EmacsFixedClass, emacs_fixed_get_type):
12196 Move decls here from emacsgtkfixed.h, since they needn't be public.
12197 (emacs_fixed_get_type): Now static.
12198 (emacs_fixed_class_init): Omit unused local.
12199 (emacs_fixed_child_type): Remove; unused.
12200 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12201 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12202 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12203 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12204 (EMACS_FIXED_GET_CLASS): Remove; unused.
12205 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12206
12207 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12208 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12209
12210 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12211
12212 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
12213 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
12214 (__malloc_size_t, __malloc_ptrdiff_t):
12215 Remove. All uses removed, replaced by the definiens if needed,
12216 since we can assume C89 or better now.
12217 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12218 (protect_malloc_state, align, get_contiguous_space)
12219 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12220 (malloc_atfork_handler_child, malloc_enable_thread)
12221 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12222 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
12223 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
12224 (special_realloc, _realloc_internal_nolock, _realloc_internal)
12225 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
12226 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
12227 Define using prototypes, not old style.
12228 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
12229 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
12230 (align): Don't assume that signed integer overflow wraps around.
12231 Omit unused local var.
12232 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
12233 (_free_internal_nolock, memalign, mallochook, reallochook):
12234 Omit no-longer-needed casts.
12235 (valloc): Use getpagesize, not __getpagesize.
12236 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
12237 (struct hdr): The 'magic' member is now size_t, not unsigned long.
12238
12239 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
12240
12241 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
12242
12243 Move functions from C to Lisp. Make non-blocking method calls
12244 the default. Implement further D-Bus standard interfaces.
12245
12246 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
12247 (QCdbus_request_name_allow_replacement)
12248 (QCdbus_request_name_replace_existing)
12249 (QCdbus_request_name_do_not_queue)
12250 (QCdbus_request_name_reply_primary_owner)
12251 (QCdbus_request_name_reply_in_queue)
12252 (QCdbus_request_name_reply_exists)
12253 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
12254 (QCdbus_registered_serial, QCdbus_registered_method)
12255 (QCdbus_registered_signal): New Lisp objects.
12256 (XD_DEBUG_MESSAGE): Use sizeof.
12257 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
12258 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
12259 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
12260 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
12261 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
12262 (xd_signature, xd_append_arg): Allow float for integer types.
12263 (xd_get_connection_references): New function.
12264 (xd_get_connection_address): Rename from xd_initialize.
12265 Return cached address.
12266 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
12267 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
12268 level.
12269 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
12270 Return number of refcounts.
12271 (Fdbus_get_unique_name): Make stronger parameter check.
12272 (Fdbus_message_internal): New defun.
12273 (Fdbus_call_method, Fdbus_call_method_asynchronously)
12274 (Fdbus_method_return_internal, Fdbus_method_error_internal)
12275 (Fdbus_send_signal, Fdbus_register_service)
12276 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
12277 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
12278 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
12279 (Vdbus_compiled_version, Vdbus_runtime_version)
12280 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
12281 (Vdbus_message_type_method_return, Vdbus_message_type_error)
12282 (Vdbus_message_type_signal): New defvars.
12283 (Vdbus_registered_buses, Vdbus_registered_objects_table):
12284 Adapt docstring.
12285
12286 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12287
12288 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
12289 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
12290 Do not assume ptrdiff_t is the same width as 'int'.
12291
12292 * alloc.c: Handle unusual debugging option combinations.
12293 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
12294 since the two debugging options are incompatible.
12295 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
12296 is defined.
12297 (mem_init, mem_insert, mem_insert_fixup):
12298 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
12299 (NEED_MEM_INSERT): Remove; no longer needed.
12300
12301 2012-04-22 Leo Liu <sdl.web@gmail.com>
12302
12303 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
12304
12305 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12306
12307 * sysdep.c [__FreeBSD__]: Minor cleanups.
12308 (list_system_processes, system_process_attributes) [__FreeBSD__]:
12309 Use Emacs indenting style more consistently. Avoid some casts.
12310 Use 'double' consistently rather than mixing 'float' and 'double'.
12311
12312 2012-04-21 Eduard Wiebe <usenet@pusto.de>
12313
12314 * sysdep.c (list_system_processes, system_process_attributes):
12315 Add implementation for FreeBSD (Bug#5243).
12316
12317 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
12318
12319 * lisp.mk (lisp): Update.
12320
12321 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
12322
12323 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
12324 It is never used otherwise.
12325
12326 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
12327
12328 * print.c (print_preprocess): Only check print_depth if print-circle
12329 is nil.
12330 (print_object): Check for cycles even when print-circle is nil and
12331 print-gensym is t, but only check print_depth if print-circle is nil.
12332
12333 2012-04-20 Chong Yidong <cyd@gnu.org>
12334
12335 * process.c (wait_reading_process_output): If EIO occurs on a pty,
12336 set the status to "failed" and ensure that sentinel is run.
12337
12338 2012-04-20 Glenn Morris <rgm@gnu.org>
12339
12340 * process.c (Fset_process_inherit_coding_system_flag)
12341 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
12342 (Fmake_network_process, Fmake_serial_process): Doc fix.
12343
12344 2012-04-20 Eli Zaretskii <eliz@gnu.org>
12345
12346 * xdisp.c (string_buffer_position_lim): Limit starting position to
12347 BEGV.
12348 (set_cursor_from_row): If called for a mode-line or header-line
12349 row, return zero immediately.
12350 (try_cursor_movement): If inside continuation line, don't back up
12351 farther than the first row after the header line, if any.
12352 Don't consider the header-line row as "partially visible", even if
12353 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
12354
12355 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
12356
12357 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
12358 (bug#11238).
12359
12360 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
12361 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
12362
12363 configure: new option --enable-gcc-warnings (Bug#11207)
12364 * Makefile.in (C_WARNINGS_SWITCH): Remove.
12365 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
12366 (ALL_CFLAGS): Use new macros rather than old.
12367 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
12368 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
12369 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
12370 -Wunused-result, -Wunused-variable. This should go away once
12371 the Emacs and Gnulib regex code is merged.
12372 (xmalloc, xrealloc): Now static.
12373
12374 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
12375
12376 * dired.c (Fsystem_groups): Remove unused local.
12377
12378 2012-04-17 Glenn Morris <rgm@gnu.org>
12379
12380 * dired.c (Fsystem_users): Doc fix.
12381
12382 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
12383
12384 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
12385 (syms_of_dired): Add them.
12386
12387 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
12388
12389 Fix minor alloc.c problems found by static checking.
12390 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
12391 New extern decls, to avoid calling undeclared functions.
12392 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
12393 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
12394 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
12395 (NEED_MEM_INSERT): New macro.
12396 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
12397 Remove one incorrect comment and fix another.
12398
12399 Fix minor ralloc.c problems found by static checking.
12400 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12401 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
12402 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
12403 (r_alloc_sbrk): Now static.
12404
12405 Improve ralloc.c interface checking.
12406 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12407 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
12408 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
12409 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
12410 [REL_ALLOC]: ... to here, to check interface.
12411 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
12412 Remove decls. This fixes an "It stinks!".
12413
12414 * alloc.c (which_symbols): Fix alignment issue / type clash.
12415
12416 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
12417
12418 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
12419 (struct Lisp_Misc_Any): Likewise.
12420 (struct Lisp_Free): Likewise.
12421 * alloc.c (union aligned_Lisp_Symbol): Define.
12422 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
12423 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
12424 (union aligned_Lisp_Misc): Define.
12425 (MARKER_BLOCK_SIZE, struct marker_block): Use union
12426 aligned_Lisp_Misc instead of union Lisp_Misc.
12427 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
12428
12429 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
12430
12431 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
12432 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
12433 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
12434 * s/netbsd.h, s/sol2-6.h:
12435 Remove definition of GC_MARK_STACK, since the default now works.
12436 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
12437 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
12438 no longer the default.
12439 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
12440
12441 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
12442
12443 * lread.c (lisp_file_lexically_bound_p):
12444 Fix hang at ";-*-\n" (bug#11238).
12445
12446 2012-04-14 Eli Zaretskii <eliz@gnu.org>
12447
12448 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
12449 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
12450
12451 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
12452
12453 * nsterm.m (constrainFrameRect): Always constrain when there is only
12454 one screen (Bug#10962).
12455
12456 2012-04-13 Ken Brown <kbrown@cornell.edu>
12457
12458 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
12459
12460 2012-04-13 Reuben Thomas <rrt@sc3d.org>
12461
12462 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
12463
12464 2012-04-11 Daniel Colascione <dancol@dancol.org>
12465
12466 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
12467 against is gone. It's better to use vfork now so that when Cygwin
12468 gains a new, working vfork, we use it automatically (bug#10398).
12469
12470 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12471
12472 * window.c (save_window_save): Obey window-point-insertion-type.
12473
12474 2012-04-11 Glenn Morris <rgm@gnu.org>
12475
12476 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
12477
12478 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12479
12480 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
12481
12482 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
12483
12484 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
12485 (force_quit_count): New var.
12486 (handle_interrupt): Use it.
12487
12488 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
12489
12490 * w32.c (w32_delayed_load): Record the full path of the library
12491 being loaded (bug#10424).
12492
12493 2012-04-09 Glenn Morris <rgm@gnu.org>
12494
12495 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
12496 not just in the obarray, before snarfing them. (Bug#11036)
12497
12498 * Makefile.in ($(leimdir)/leim-list.el):
12499 Pass EMACS rather than BUILT_EMACS.
12500
12501 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
12502
12503 * process.c (make_process):
12504 * process.h: Add integer `gnutls_handshakes_tried' member to
12505 process struct.
12506
12507 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
12508 Add convenience `GNUTLS_LOG2i' macro.
12509
12510 * gnutls.c (gnutls_log_function2i): Convenience log function.
12511 (emacs_gnutls_read): Use new log functions,
12512 `gnutls_handshakes_tried' process member, and
12513 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
12514 attempts per process (connection).
12515
12516 2012-04-09 Chong Yidong <cyd@gnu.org>
12517
12518 * eval.c (Fuser_variable_p, user_variable_p_eh)
12519 (lisp_indirect_variable): Functions deleted.
12520 (Fdefvar): Caller changed.
12521
12522 * callint.c (Finteractive, Fcall_interactively):
12523 * minibuf.c (Fread_variable): Callers changed.
12524
12525 2012-04-09 Eli Zaretskii <eliz@gnu.org>
12526
12527 * xdisp.c (set_cursor_from_row): If the display string appears in
12528 the buffer at position that is closer to point than the position
12529 after the display string, display the cursor on the first glyph of
12530 the display string. Fixes cursor display when a 'display' text
12531 property immediately follows invisible text. (Bug#11094)
12532
12533 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
12534
12535 composite.c: use 'double' consistently
12536 * composite.c (get_composition_id): Use 'double' consistently
12537 instead of converting 'float' to 'double' and vice versa; this is
12538 easier to understand and avoids a GCC warning.
12539
12540 2012-04-09 Glenn Morris <rgm@gnu.org>
12541
12542 * Makefile.in: Generate leim-list with bootstrap-emacs, in
12543 preparation for dumping it with emacs. (Bug#4789)
12544 (leimdir): New variable.
12545 ($(leimdir)/leim-list.el): New rule.
12546 (emacs$(EXEEXT)): Depend on leim-list.el.
12547
12548 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
12549 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
12550 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
12551
12552 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
12553
12554 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
12555 proper alignment.
12556
12557 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
12558
12559 * xml.c (init_libxml2_functions) [WINDOWSNT]:
12560 Remove unused local variable.
12561
12562 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12563
12564 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
12565 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
12566 (mark_memory): Mark Lisp_Objects only if pointers might hide in
12567 objects, as mark_maybe_pointer will catch them otherwise.
12568 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
12569 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
12570
12571 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12572
12573 Fix typo that broke non-Windows builds.
12574 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
12575
12576 2012-04-07 Eli Zaretskii <eliz@gnu.org>
12577
12578 Support building on MS-Windows with libxml2.
12579
12580 * makefile.w32-in (OBJ2): Add xml.$(O).
12581 (GLOBAL_SOURCES): Add xml.c.
12582 ($(BLD)/xml.$(O)): New dependency list.
12583
12584 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
12585 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
12586 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
12587 [!WINDOWSNT]: New macros.
12588 (init_libxml2_functions, libxml2_loaded_p): New functions.
12589 (parse_region): Call fn_xmlCheckVersion instead of using the macro
12590 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
12591 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
12592 Calls xmlCleanupParser only if libxml2 was loaded (or statically
12593 linked in).
12594 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
12595 Call init_libxml2_functions before calling libxml2 functions.
12596 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
12597
12598 * emacs.c: Don't include libxml/parser.h.
12599 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
12600 xmlCleanupParser directly.
12601
12602 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
12603
12604 2012-04-07 Eli Zaretskii <eliz@gnu.org>
12605
12606 * indent.c (Fvertical_motion): If there is a display string at
12607 point, use it.vpos to compute how many lines to backtrack after
12608 move_it_to point. (Bug#11133)
12609
12610 2012-04-06 Eli Zaretskii <eliz@gnu.org>
12611
12612 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
12613 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
12614 about subtle differences between FETCH_CHAR* and STRING_CHAR*
12615 macros related to unification of CJK characters. For the details,
12616 see the discussion following the message here:
12617 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
12618
12619 2012-04-04 Chong Yidong <cyd@gnu.org>
12620
12621 * keyboard.c (Vdelayed_warnings_list): Doc fix.
12622
12623 2012-04-01 Eli Zaretskii <eliz@gnu.org>
12624
12625 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
12626 instead of alloca. (Bug#11138)
12627
12628 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
12629
12630 * w32menu.c (is_simple_dialog): Properly check lisp types.
12631 (Bug#11141)
12632
12633 2012-03-31 Eli Zaretskii <eliz@gnu.org>
12634
12635 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
12636 position we get to after a call to move_it_to fails the
12637 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
12638 only if we wind up in a string from display property. (Bug#11063)
12639
12640 * window.c (Fdelete_other_windows_internal): Invalidate the row
12641 and column information about mouse highlight, so that redisplay
12642 restores it after reallocating the glyph matrices. (Bug#7464)
12643
12644 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
12645 string comes from a `display' text property, use the buffer
12646 position of that property as if we actually saw that position in
12647 the row's glyphs.
12648 (move_it_by_lines): Remove the assertion that
12649 "it->current_x == 0 && it->hpos == 0" which can be legitimately
12650 violated when there's a before-string at the beginning of a line.
12651 (Bug#11063)
12652
12653 2012-03-30 Eli Zaretskii <eliz@gnu.org>
12654
12655 * xdisp.c (append_space_for_newline): If the default face was
12656 remapped, use the remapped face for the appended newline.
12657 (extend_face_to_end_of_line): Use the remapped default face for
12658 extending the face to the end of the line.
12659 (display_line): Call extend_face_to_end_of_line when the default
12660 face was remapped. (Bug#11068)
12661
12662 2012-03-29 Eli Zaretskii <eliz@gnu.org>
12663
12664 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
12665
12666 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12667
12668 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
12669
12670 2012-03-27 Glenn Morris <rgm@gnu.org>
12671
12672 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
12673 Doc fixes.
12674
12675 2012-03-26 Kenichi Handa <handa@m17n.org>
12676
12677 * dispextern.h (struct glyph): Fix previous change. Change the
12678 bit length of glyphless.ch to 25 (Bug#11082).
12679
12680 2012-03-26 Chong Yidong <cyd@gnu.org>
12681
12682 * keyboard.c (Vselection_inhibit_update_commands): New variable.
12683 (command_loop_1): Use it; inhibit selection update for
12684 handle-select-window too (Bug#8996).
12685
12686 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
12687
12688 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
12689
12690 2012-03-25 Kenichi Handa <handa@m17n.org>
12691
12692 * dispextern.h (struct glyph): Change the bit length of
12693 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
12694
12695 2012-03-24 Eli Zaretskii <eliz@gnu.org>
12696
12697 * s/ms-w32.h (tzname): Include time.h before redirecting to
12698 _tzname. Fixes the MSVC build. (Bug#9960)
12699
12700 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
12701
12702 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
12703 characters.
12704
12705 * xterm.c (XTread_socket): Only modify handling_signal if
12706 !SYNC_INPUT. (Bug#11080)
12707
12708 2012-03-23 Eli Zaretskii <eliz@gnu.org>
12709
12710 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
12711 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
12712 when fetching a multibyte character consumes more bytes than
12713 CHAR_BYTES returns, due to unification of CJK characters in
12714 string_char. (Bug#11073)
12715
12716 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
12717
12718 * process.c (wait_reading_process_output): Handle pty disconnect
12719 by refraining from sending oneself a SIGCHLD (bug#10933).
12720
12721 2012-03-22 Chong Yidong <cyd@gnu.org>
12722
12723 * dispextern.h (struct it): New member string_from_prefix_prop_p.
12724
12725 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
12726 Mark string as coming from a prefix property.
12727 (handle_face_prop): Use default face for prefix strings (Bug#4281).
12728 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
12729
12730 2012-03-21 Chong Yidong <cyd@gnu.org>
12731
12732 * xfaces.c (Vface_remapping_alist): Doc fix.
12733
12734 2012-03-20 Eli Zaretskii <eliz@gnu.org>
12735
12736 * w32proc.c (Fw32_set_console_codepage)
12737 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
12738 Doc fixes.
12739
12740 2012-03-20 Chong Yidong <cyd@gnu.org>
12741
12742 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
12743 to reflect default non-nil value of redisplay-dont-pause.
12744
12745 2012-03-19 Kenichi Handa <handa@m17n.org>
12746
12747 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
12748 it fit in a valid range (Bug#11003).
12749
12750 2012-03-18 Eli Zaretskii <eliz@gnu.org>
12751
12752 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
12753 that is not from display property, accept the row as a "cursor
12754 row" if one of the string's character has a non-nil `cursor'
12755 property. Fixes cursor positioning when there are newlines in
12756 overlay strings, e.g. in icomplete.el. (Bug#11035)
12757
12758 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
12759
12760 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
12761
12762 2012-03-12 Chong Yidong <cyd@gnu.org>
12763
12764 * eval.c (inhibit_lisp_code): Rename from
12765 inhibit_window_configuration_change_hook; move from window.c.
12766
12767 * xfns.c (unwind_create_frame_1, Fx_create_frame):
12768 * window.c (run_window_configuration_change_hook)
12769 (syms_of_window): Callers changed.
12770
12771 2012-03-11 Chong Yidong <cyd@gnu.org>
12772
12773 * keymap.c (Fkey_description): Doc fix (Bug#9700).
12774
12775 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
12776
12777 2012-03-10 Chong Yidong <cyd@gnu.org>
12778
12779 * frame.c (other_visible_frames): Don't assume the selected frame
12780 is visible (Bug#10955).
12781
12782 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
12783
12784 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
12785
12786 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
12787
12788 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
12789 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
12790 zero (Bug#10954).
12791
12792 2012-03-03 Glenn Morris <rgm@gnu.org>
12793
12794 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
12795
12796 2012-03-02 Eli Zaretskii <eliz@gnu.org>
12797
12798 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
12799 position past the first glyph_row that ends at ZV. (Bug#10902)
12800 (redisplay_window, next_element_from_string): Fix typos in
12801 comments.
12802 (redisplay_window): Pass to move_it_vertically the margin in
12803 pixels, not in screen lines.
12804
12805 2012-03-02 Glenn Morris <rgm@gnu.org>
12806
12807 * buffer.c (buffer-list-update-hook): Doc fix.
12808
12809 2012-02-29 Eli Zaretskii <eliz@gnu.org>
12810
12811 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
12812 push_it before setting up the iterator for the first overlay
12813 string, even if we have an empty string loaded.
12814 (next_overlay_string): If there's an empty string on the iterator
12815 stack, pop the stack. (Bug#10903)
12816
12817 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
12818
12819 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
12820 Suggested by Stefan Monnier in
12821 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
12822 * alloc.c (widen_to_Lisp_Object): New static function.
12823 (mark_memory): Also mark Lisp_Objects by fetching pointer words
12824 and widening them to Lisp_Objects. This would work even if
12825 USE_LSB_TAG is defined and wide integers are used, which might
12826 happen in a future version of Emacs.
12827
12828 2012-02-25 Chong Yidong <cyd@gnu.org>
12829
12830 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
12831 Doc fix.
12832
12833 * xselect.c (Fx_selection_exists_p): Doc fix.
12834 (x_clipboard_manager_save_all): Print an informative message
12835 before saving to clipboard manager.
12836
12837 2012-02-24 Chong Yidong <cyd@gnu.org>
12838
12839 * keyboard.c (process_special_events): Handle all X selection
12840 requests in kbd_buffer, not just the next one (Bug#8869).
12841
12842 2012-02-23 Chong Yidong <cyd@gnu.org>
12843
12844 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
12845 call when setting menu-bar-lines and tool-bar-lines parameters.
12846 (unwind_create_frame_1): New helper function.
12847
12848 * window.c (inhibit_window_configuration_change_hook): New var.
12849 (run_window_configuration_change_hook): Obey it.
12850 (syms_of_window): Initialize it.
12851
12852 2012-02-22 Chong Yidong <cyd@gnu.org>
12853
12854 * xterm.c (x_draw_image_relief): Add missing type check for
12855 Vtool_bar_button_margin (Bug#10743).
12856
12857 2012-02-21 Chong Yidong <cyd@gnu.org>
12858
12859 * fileio.c (Vfile_name_handler_alist): Doc fix.
12860
12861 * buffer.c (Fget_file_buffer): Protect against invalid file
12862 handler return value.
12863
12864 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
12865
12866 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
12867 when computing $valmask.
12868
12869 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
12870 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
12871 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
12872 It's useless in that case, and it can cause problems on hosts
12873 that allocate halves of EMACS_INT values separately.
12874 Reported by Dan Horák. Diagnosed by Andreas Schwab in
12875 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
12876 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
12877 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
12878 it avoids undefined behavior on hosts where shifting right by more
12879 than the word width has undefined behavior.
12880
12881 2012-02-19 Chong Yidong <cyd@gnu.org>
12882
12883 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
12884 (Funhandled_file_name_directory, Ffile_name_as_directory)
12885 (Fdirectory_file_name, Fexpand_file_name)
12886 (Fsubstitute_in_file_name): Protect against invalid file handler
12887 return values (Bug#10845).
12888
12889 2012-02-18 Eli Zaretskii <eliz@gnu.org>
12890
12891 * .gdbinit (pitx): Fix incorrect references to fields of the
12892 iterator stack.
12893
12894 2012-02-17 Chong Yidong <cyd@gnu.org>
12895
12896 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
12897
12898 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
12899
12900 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
12901 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
12902
12903 2012-02-15 Chong Yidong <cyd@gnu.org>
12904
12905 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
12906 marked as special. Also, starting docstrings with * is obsolete.
12907
12908 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
12909
12910 * gnutls.c (emacs_gnutls_write): Fix last change.
12911
12912 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
12913
12914 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
12915 send_process.
12916
12917 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
12918
12919 * keymap.c (Fsingle_key_description): Handle char ranges.
12920
12921 2012-02-12 Chong Yidong <cyd@gnu.org>
12922
12923 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
12924 as that creates a dangerous corner case.
12925
12926 * window.c (Fdelete_window_internal): Invalidate the mouse
12927 highlight (Bug#9904).
12928
12929 2012-02-12 Glenn Morris <rgm@gnu.org>
12930
12931 * xselect.c (Fx_own_selection_internal)
12932 (Fx_get_selection_internal, Fx_disown_selection_internal)
12933 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
12934 * nsselect.m (Fx_own_selection_internal)
12935 (Fx_disown_selection_internal, Fx_selection_exists_p)
12936 (Fx_selection_owner_p, Fx_get_selection_internal):
12937 Sync docs and argument specs with the xselect.c versions.
12938
12939 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
12940
12941 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
12942
12943 2012-02-11 Eli Zaretskii <eliz@gnu.org>
12944
12945 * w32select.c (Fx_selection_exists_p): Sync doc string and
12946 argument list with xselect.c. (Bug#10783)
12947
12948 * w16select.c (Fx_selection_exists_p): Sync doc string and
12949 argument list with xselect.c. (Bug#10783)
12950
12951 2012-02-10 Glenn Morris <rgm@gnu.org>
12952
12953 * fns.c (Fsecure_hash): Doc fix.
12954
12955 2012-02-09 Kenichi Handa <handa@m17n.org>
12956
12957 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
12958
12959 2012-02-07 Chong Yidong <cyd@gnu.org>
12960
12961 * buffer.c (Fbuffer_local_variables)
12962 (buffer_lisp_local_variables): Handle unbound vars correctly;
12963 don't let Qunbound leak into Lisp.
12964
12965 2012-02-07 Glenn Morris <rgm@gnu.org>
12966
12967 * image.c (Fimagemagick_types): Doc fix.
12968
12969 * image.c (imagemagick-render-type): Change it from a lisp object
12970 to an integer. Move the doc here from the lisp manual.
12971 Treat all values not equal to 0 the same.
12972
12973 2012-02-06 Chong Yidong <cyd@gnu.org>
12974
12975 * doc.c (store_function_docstring): Avoid applying docstring of
12976 alias to base function (Bug#2603).
12977
12978 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
12979
12980 * .gdbinit (pp1, pv1): Remove redundant defines.
12981 (pr): Use pp.
12982
12983 2012-02-04 Chong Yidong <cyd@gnu.org>
12984
12985 * nsterm.m: Declare a global (Bug#10694).
12986
12987 2012-02-04 Eli Zaretskii <eliz@gnu.org>
12988
12989 * w32.c (get_emacs_configuration_options):
12990 Include --enable-checking, if specified, in the return value.
12991
12992 2012-02-04 Martin Rudalics <rudalics@gmx.at>
12993
12994 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
12995 after rounding frame sizes. (Bug#9723)
12996
12997 2012-02-04 Eli Zaretskii <eliz@gnu.org>
12998
12999 * keyboard.c (adjust_point_for_property): Don't position point
13000 before BEGV. (Bug#10696)
13001
13002 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13003
13004 Handle overflow when computing char display width (Bug#9496).
13005 * character.c (char_width): Return EMACS_INT, not int.
13006 (char_width, c_string_width): Check for overflow when
13007 computing the width; this is possible now that individual
13008 characters can have unbounded width. Problem introduced
13009 by merge from Emacs 23 on 2012-01-19.
13010
13011 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
13012
13013 * dbusbind.c (Fdbus_register_method): Mention the return value
13014 :ignore in the docstring.
13015
13016 2012-02-02 Glenn Morris <rgm@gnu.org>
13017
13018 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13019
13020 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13021 Unconditionally set to t. (Bug#10673)
13022 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13023 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13024 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13025
13026 2012-02-02 Kenichi Handa <handa@m17n.org>
13027
13028 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13029 0, do not call append_composite_glyph.
13030
13031 2012-02-02 Kenichi Handa <handa@m17n.org>
13032
13033 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13034 NULL (Bug#6988).
13035 (x_produce_glyphs): If the component of a composition is a null
13036 string, set it->pixel_width to 1 to avoid zero-width glyph.
13037
13038 2012-02-01 Eli Zaretskii <eliz@gnu.org>
13039
13040 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13041 first 2 arguments are identical. This makes inserting large
13042 output from a subprocess an order of magnitude faster on
13043 MS-Windows, where all sbrk'ed memory is always contiguous.
13044
13045 2012-01-31 Glenn Morris <rgm@gnu.org>
13046
13047 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13048 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13049 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13050
13051 2012-01-29 Glenn Morris <rgm@gnu.org>
13052
13053 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13054
13055 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13056
13057 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13058
13059 2012-01-28 Chong Yidong <cyd@gnu.org>
13060
13061 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13062
13063 2012-01-26 Chong Yidong <cyd@gnu.org>
13064
13065 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13066
13067 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13068 repeat counts (Bug#10507).
13069
13070 2012-01-26 Glenn Morris <rgm@gnu.org>
13071
13072 * lread.c (syms_of_lread): Doc fix.
13073
13074 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13075
13076 * coding.c (encode_designation_at_bol): Change return value to
13077 EMACS_INT.
13078
13079 2012-01-25 Chong Yidong <cyd@gnu.org>
13080
13081 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13082
13083 2012-01-21 Chong Yidong <cyd@gnu.org>
13084
13085 * floatfns.c (Fcopysign): Make the second argument non-optional,
13086 since nil is not allowed anyway.
13087
13088 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13089
13090 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13091 (send_process): Likewise.
13092
13093 2012-01-19 Martin Rudalics <rudalics@gmx.at>
13094
13095 * window.c (save_window_save, Fcurrent_window_configuration)
13096 (Vwindow_persistent_parameters): Do not use Qstate.
13097 Rewrite doc-strings.
13098
13099 2012-01-19 Kenichi Handa <handa@m17n.org>
13100
13101 * character.c (char_width): New function.
13102 (Fchar_width, c_string_width, lisp_string_width):
13103 Use char_width (Bug#9496).
13104
13105 2012-01-16 Martin Rudalics <rudalics@gmx.at>
13106
13107 * window.c (Vwindow_persistent_parameters): New variable.
13108 (Fset_window_configuration, save_window_save): Handle persistent
13109 window parameters.
13110
13111 2012-01-14 Eli Zaretskii <eliz@gnu.org>
13112
13113 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13114 thrashing the stack of the thread. (Bug#9087)
13115
13116 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13117
13118 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13119
13120 2012-01-11 Eli Zaretskii <eliz@gnu.org>
13121
13122 * xdisp.c (rows_from_pos_range): Handle the case where the
13123 highlight ends on a newline. (Bug#10464)
13124 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13125 he end column for display of highlight that ends on a newline
13126 before a R2L line.
13127
13128 2012-01-11 Glenn Morris <rgm@gnu.org>
13129
13130 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13131 from load-path also when installation-directory is nil. (Bug#10208)
13132
13133 2012-01-10 Glenn Morris <rgm@gnu.org>
13134
13135 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13136
13137 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13138 Update template values to be closer to their typical values these days.
13139
13140 2012-01-09 Eli Zaretskii <eliz@gnu.org>
13141
13142 * xdisp.c (rows_from_pos_range): Accept additional argument
13143 DISP_STRING, and accept any glyph in a row whose object is that
13144 string as eligible for mouse highlight. Fixes mouse highlight of
13145 display strings from overlays. (Bug#10464)
13146
13147 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
13148
13149 emacs: fix an auto-save permissions race condition (Bug#10400)
13150 * fileio.c (auto_saving_dir_umask): New static var.
13151 (Fmake_directory_internal): Use it.
13152 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13153 creating the directory. The old code temporarily assigns
13154 too-generous permissions to the directory.
13155 (do_auto_save_eh): Clear it.
13156 (Fdo_auto_save): Catch all errors, not just file errors, so
13157 that the var is always cleared.
13158
13159 2012-01-07 Eli Zaretskii <eliz@gnu.org>
13160
13161 * search.c (scan_buffer): Pass character positions to
13162 know_region_cache, not byte positions. (Bug#6540)
13163
13164 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
13165
13166 * w32.c (sys_rename): Report EXDEV when rename of a directory
13167 fails because the target is on another logical disk. (Bug#10284)
13168
13169 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13170
13171 * xterm.c (x_embed_request_focus): New function.
13172
13173 * xterm.h: Add prototype.
13174
13175 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13176
13177 2012-01-05 Glenn Morris <rgm@gnu.org>
13178
13179 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13180
13181 2012-01-01 Eli Zaretskii <eliz@gnu.org>
13182
13183 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13184 Load gnutls_transport_set_lowat only if GnuTLS version is below
13185 2.11.1.
13186 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13187 GnuTLS versions below 2.11.1.
13188
13189 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13190
13191 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13192 to the doc string advising against its use for altering the way
13193 windows are scrolled.
13194
13195 2011-12-28 Kenichi Handa <handa@m17n.org>
13196
13197 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13198 coding-system ASCII compatible only when it does not produce BOM
13199 on encoding (Bug#10383).
13200
13201 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13202
13203 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13204 can scroll.
13205 (create_and_show_popup_menu): Always use menu_position_func for
13206 Gtk3 (Bug#10361).
13207
13208 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13209
13210 * callint.c (Fcall_interactively): Don't truncate prompt string.
13211
13212 2011-12-23 Eli Zaretskii <eliz@gnu.org>
13213
13214 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13215 property that ends at ZV, so that the bidi iteration could be
13216 resumed from there (after widening). (Bug#10360)
13217
13218 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13219
13220 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13221
13222 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
13223
13224 * nsterm.m (x_free_frame_resources):
13225 Release f->output_data.ns->miniimage.
13226 (ns_index_color): Fix indentation. Do not retain
13227 color_table->colors[i].
13228
13229 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
13230 before returning.
13231
13232 * nsfns.m (x_set_background_color): Assign return value from
13233 ns_index_color to face-background instead of NSColor*.
13234 (ns_implicitly_set_icon_type): Fix indentation.
13235 Change assignment in for loop to comparison.
13236
13237 * emacs.c (ns_pool): New variable.
13238 (main): Assign ns_pool.
13239 (Fkill_emacs): Call ns_release_autorelease_pool.
13240
13241 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
13242 autorelease fdesc, release fdAttrs and tdict.
13243 (ns_get_covering_families): Release charset.
13244 (ns_findfonts): Release NSFontDescriptor created with new.
13245 (ns_uni_to_glyphs): Fix indentation.
13246 (setString): Release attrStr before assigning new value.
13247
13248 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13249
13250 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
13251 and NS_IMPL_COCOA.
13252 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
13253 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
13254
13255 2011-12-18 David Reitter <reitter@cmu.edu>
13256
13257 * nsterm.m (ns_term_init): Subscribe for notifications
13258 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
13259 to method trackingNotification in EmacsMenu.
13260
13261 * nsmenu.m (trackingMenu): New variable.
13262 (trackingNotification): New method (from Aquamacs).
13263 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
13264 from Aquamacs (Bug#7030).
13265
13266 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13267
13268 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
13269 (symbol_to_nsstring): Fix indentation.
13270 (ns_symbol_to_pb): New function.
13271 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
13272 (Fns_rotate_cut_buffers_internal): Remove.
13273 (Fns_store_selection_internal): Rename from
13274 Fns_store_cut_buffer_internal.
13275 (ns_get_foreign_selection, Fx_own_selection_internal)
13276 (Fx_disown_selection_internal, Fx_selection_exists_p)
13277 (Fns_get_selection_internal, Fns_store_selection_internal):
13278 Use ns_symbol_to_pb and check if return value is nil.
13279 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
13280 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
13281 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
13282 renamed to Sns_store_selection_internal.
13283 (ns_handle_selection_request): Move code to Fx_own_selection_internal
13284 and remove this function.
13285 (ns_handle_selection_clear): Remove, never used.
13286 (Fx_own_selection_internal): Move code from ns_handle_selection_request
13287 here.
13288
13289 2011-12-17 Ken Brown <kbrown@cornell.edu>
13290
13291 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
13292 GID is unknown (Bug#10257).
13293
13294 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
13295
13296 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
13297 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
13298 which caused a build failure on GNU/Linux IA-64. This problem was
13299 introduced by my 2011-10-07 patch.
13300
13301 2011-12-15 Juri Linkov <juri@jurta.org>
13302
13303 * image.c (imagemagick_error): New function. (Bug#10112)
13304 (imagemagick_load_image): Comment out `MagickSetResolution' call.
13305 Use `imagemagick_error' where ImageMagick functions return
13306 `MagickFalse'.
13307 (Fimagemagick_types): Add `Fnreverse' to return the list in the
13308 proper order.
13309
13310 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13311
13312 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
13313 fill background (Bug#8992).
13314
13315 2011-12-13 Martin Rudalics <rudalics@gmx.at>
13316
13317 * window.c (Vwindow_combination_resize)
13318 (Vwindow_combination_limit): Use t instead of non-nil in
13319 doc-strings.
13320 (Vrecenter_redisplay): Add first sentence of doc-string on
13321 separate line.
13322 (Frecenter): Fix doc-string typo.
13323
13324 2011-12-11 Kenichi Handa <handa@m17n.org>
13325
13326 * coding.c (Funencodable_char_position): Pay attention to the
13327 buffer text relocation (Bug#9389).
13328
13329 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13330
13331 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
13332 gtk_init (Bug#10100).
13333
13334 2011-12-10 Eli Zaretskii <eliz@gnu.org>
13335
13336 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
13337 IT->string is nil. (Bug#10263)
13338
13339 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13340
13341 * nsterm.h (x_free_frame_resources): Declare.
13342
13343 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
13344 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
13345
13346 * nsterm.h (ns_get_defaults_value): Declare.
13347
13348 * nsterm.m (ns_default): Call ns_get_defaults_value.
13349
13350 2011-12-09 Eli Zaretskii <eliz@gnu.org>
13351
13352 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
13353 (Bug#10170)
13354
13355 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13356
13357 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
13358 that where the value of an _OBJC_* symbol points to is in the .bss
13359 section (Bug#10240).
13360
13361 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13362
13363 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
13364 after the loop to call ccl_driver at least once (Bug#8619).
13365
13366 2011-12-08 Kenichi Handa <handa@m17n.org>
13367
13368 * ftfont.c (get_adstyle_property): Fix previous change
13369 (Bug#10233).
13370
13371 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
13372
13373 * w32.c (init_environment): If no_site_lisp, remove site-lisp
13374 dirs from the default value of EMACSLOADPATH (bug#10208).
13375
13376 2011-12-07 Glenn Morris <rgm@gnu.org>
13377
13378 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
13379 installation and source directories as well. (Bug#10208)
13380
13381 2011-12-06 Chong Yidong <cyd@gnu.org>
13382
13383 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
13384
13385 2011-12-06 Glenn Morris <rgm@gnu.org>
13386
13387 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
13388 as an error, not just -1. (Bug#10217)
13389
13390 2011-12-05 Chong Yidong <cyd@gnu.org>
13391
13392 * keyboard.c (process_special_events): New function.
13393 (swallow_events, Finput_pending_p): Use it (Bug#10195).
13394
13395 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
13396
13397 * coding.c (encode_designation_at_bol): Don't use uninitialized
13398 local variable (Bug#9318).
13399
13400 2011-12-05 Kenichi Handa <handa@m17n.org>
13401
13402 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
13403 return Qnil (Bug#8046, Bug#10193).
13404
13405 2011-12-05 Kenichi Handa <handa@m17n.org>
13406
13407 * coding.c (encode_designation_at_bol): New args charbuf_end and
13408 dst. Return the number of produced bytes. Callers changed.
13409 (coding_set_source): Return how many bytes coding->source was
13410 relocated.
13411 (coding_set_destination): Return how many bytes
13412 coding->destination was relocated.
13413 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
13414 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
13415
13416 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13417
13418 * coding.c (CODING_CHAR_CHARSET_P): New macro.
13419 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
13420 macro (Bug#9318).
13421
13422 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
13423
13424 The following changes are to fix Bug#9318.
13425
13426 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
13427 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
13428 (encode_coding_iso_2022, encode_coding_sjis)
13429 (encode_coding_big5, encode_coding_charset): Use the above macros.
13430
13431 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
13432
13433 * lisp.h (process_quit_flag): Fix external declaration.
13434
13435 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
13436
13437 Don't macro-inline non-performance-critical code.
13438 * eval.c (process_quit_flag): New function.
13439 * lisp.h (QUIT): Use it.
13440
13441 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
13442
13443 * nsfns.m (get_geometry_from_preferences): New function.
13444 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
13445
13446 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
13447
13448 * emacs.c (Qkill_emacs): Define.
13449 (syms_of_emacs): Initialize it.
13450 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
13451 Qquit_flag to `kill-emacs' instead.
13452 (quit_throw_to_read_char): Add parameter `from_signal'.
13453 All callers changed. Call Fkill_emacs if requested and safe.
13454 * lisp.h (QUIT): Call Fkill_emacs if requested.
13455
13456 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
13457
13458 * widget.c (update_wm_hints): Return if wmshell is null.
13459 (widget_update_wm_size_hints): New function.
13460
13461 * widget.h (widget_update_wm_size_hints): Declare.
13462
13463 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
13464 widget_update_wm_size_hints (Bug#10104).
13465
13466 2011-12-03 Eli Zaretskii <eliz@gnu.org>
13467
13468 * xdisp.c (handle_invisible_prop): If the invisible text ends just
13469 before a newline, prepare the bidi iterator for consuming the
13470 newline, and keep the current paragraph direction. (Bug#10183)
13471 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
13472
13473 2011-12-02 Juri Linkov <juri@jurta.org>
13474
13475 * search.c (Fword_search_regexp): New Lisp function created from
13476 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
13477 (Fword_search_backward, Fword_search_forward)
13478 (Fword_search_backward_lax, Fword_search_forward_lax):
13479 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
13480 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
13481
13482 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
13483
13484 * fileio.c (Finsert_file_contents): Move after-change-function call
13485 to before the "handled:" label, since all "goto handled" appear in
13486 cases where the *-change-functions have already been properly called
13487 (bug#10117).
13488
13489 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
13490
13491 * keyboard.c (interrupt_signal): Don't call kill-emacs when
13492 waiting for input. (Bug#10169)
13493
13494 2011-11-30 Eli Zaretskii <eliz@gnu.org>
13495
13496 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
13497 verifies glyph row's hash code--we have just reallocated the
13498 glyphs, so their contents can be complete garbage. (Bug#10164)
13499
13500 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
13501
13502 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
13503
13504 2011-11-30 Eli Zaretskii <eliz@gnu.org>
13505
13506 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
13507 attributes are tested _before_ calling verify_row_hash, to protect
13508 against GCC re-ordering of the tests. (Bug#10164)
13509
13510 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
13511
13512 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
13513
13514 * xterm.c (handle_one_xevent): Only set async_visible and friends
13515 if net_wm_state_hidden_seen is non-zero (Bug#10002)
13516 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
13517 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
13518
13519 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
13520
13521 Remove GCPRO-related macros that exist only to avoid shadowing locals.
13522 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
13523 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
13524 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13525 All uses changed to use GCPRO1 etc.
13526 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
13527 Revert to old implementation (i.e., before 2011-03-11).
13528
13529 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13530
13531 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
13532 of scroll runs so as to avoid assigning disabled bogus rows and
13533 unnecessary graphics copy operations.
13534
13535 2011-11-27 Eli Zaretskii <eliz@gnu.org>
13536
13537 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
13538 (snprintf) [_MSC_VER]: Redirect to _snprintf.
13539 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
13540 (malloc, free, realloc, calloc): Redirect to e_* only when
13541 compiling Emacs.
13542
13543 * lisp.h (GCTYPEBITS): Move before first use.
13544 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
13545 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
13546 this macro definition.
13547
13548 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
13549 _MSC_VER.
13550
13551 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
13552
13553 * gtkutil.c (xg_create_frame_widgets):
13554 Call gtk_window_set_has_resize_grip (FALSE) if that function is
13555 present with Gtk+ 2.0.
13556
13557 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13558
13559 * fileio.c (Finsert_file_contents): Undo previous change; see
13560 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13561
13562 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13563
13564 Rename locals to avoid shadowing.
13565 * fileio.c (Finsert_file_contents):
13566 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
13567 * process.c (wait_reading_process_output):
13568 Rename inner 'proc' to 'p' to avoid shadowing.
13569 Indent for consistency with usual Emacs style.
13570
13571 2011-11-25 Eli Zaretskii <eliz@gnu.org>
13572
13573 * xdisp.c (redisplay_window): If cursor row is not fully visible
13574 after recentering, and scroll-conservatively is set to a large
13575 number, scroll window by a few more lines to make the cursor fully
13576 visible and out of scroll-margin. (Bug#10105)
13577 (start_display): Don't move to the next line if the display should
13578 start at a newline that is part of a display vector or an overlay
13579 string. (Bug#10119)
13580
13581 2011-11-24 Juri Linkov <juri@jurta.org>
13582
13583 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
13584 after the `MagickPingImage' call. (Bug#10112)
13585
13586 2011-11-23 Chong Yidong <cyd@gnu.org>
13587
13588 * window.c (Fcoordinates_in_window_p): Accept only live windows.
13589
13590 2011-11-23 Martin Rudalics <rudalics@gmx.at>
13591
13592 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
13593 making another buffer current. (Bug#10114)
13594
13595 2011-11-23 Glenn Morris <rgm@gnu.org>
13596
13597 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
13598
13599 2011-11-23 Chong Yidong <cyd@gnu.org>
13600
13601 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
13602 using it (Bug#5984).
13603
13604 2011-11-22 Eli Zaretskii <eliz@gnu.org>
13605
13606 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
13607 and header-lines, as they don't have one computed for them.
13608 (Bug#10098)
13609
13610 * .gdbinit (prow): Make displayed values more self-explaining.
13611 Add row's hash code.
13612
13613 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
13614
13615 * process.c (wait_reading_process_output): Fix asynchrounous
13616 GnuTLS socket handling on some versions of the GnuTLS library.
13617 (wait_reading_process_output): Add comment and URL.
13618
13619 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
13620
13621 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
13622
13623 2011-11-21 Chong Yidong <cyd@gnu.org>
13624
13625 * window.c (Fnext_window, Fprevious_window): Doc fix.
13626
13627 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13628
13629 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
13630
13631 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
13632
13633 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
13634
13635 2011-11-20 Martin Rudalics <rudalics@gmx.at>
13636
13637 * window.c (Fset_window_combination_limit): Rename argument
13638 STATUS to LIMIT.
13639 (Vwindow_combination_limit): Remove "status" from doc-string.
13640
13641 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
13642
13643 * m/ibms390.h: Remove.
13644 * m/ibms390x.h: Don't include "ibms390.h".
13645
13646 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13647
13648 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
13649 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
13650
13651 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
13652
13653 * casetab.c (Fset_case_table):
13654 * charset.c (Fcharset_after): Fix typos.
13655
13656 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
13657
13658 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
13659 Otherwise, valgrind does not work on some platforms.
13660 Problem reported by Andreas Schwab in
13661 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
13662 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
13663 is set, removing the need for VIRT_ADDRESS_VARIES.
13664 (PURE_P): Use a more-efficient implementation that needs just one
13665 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
13666 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
13667 to 4 (xorl, subq, cmpq, setbe).
13668 * alloc.c (pure): Always extern now, since that's the
13669 VIRT_ADDR_VARIES behavior.
13670 (PURE_POINTER_P): Use a single comparison, not two, for
13671 consistency with the new puresize.h.
13672 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
13673 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
13674 Remove VIRT_ADDR_VARIES no longer needed.
13675
13676 2011-11-19 Eli Zaretskii <eliz@gnu.org>
13677
13678 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
13679 (erase_phys_cursor, update_window_cursor, show_mouse_face)
13680 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
13681 behave as if the cursor position were at the window margin.
13682
13683 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
13684 and the cursor position is out of bounds, behave as if the cursor
13685 position were at the window margin. (Bug#10075)
13686
13687 2011-11-18 Chong Yidong <cyd@gnu.org>
13688
13689 * window.c (Fwindow_combination_limit): Make first argument
13690 non-optional, since it is meaningless for live windows like the
13691 selected window.
13692
13693 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
13694
13695 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
13696
13697 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
13698
13699 * intervals.c: Fix grafting over the whole buffer (bug#10071).
13700 (graft_intervals_into_buffer): Simplify.
13701
13702 2011-11-18 Eli Zaretskii <eliz@gnu.org>
13703
13704 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
13705 hash values of the two rows.
13706 (copy_row_except_pointers): Preserve the used[] arrays and the
13707 hash values of the two rows. (Bug#10035)
13708 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
13709
13710 * xdisp.c (row_hash): New function, body extracted from
13711 compute_line_metrics.
13712 (compute_line_metrics): Call row_hash, instead of computing the
13713 hash code inline.
13714
13715 * dispnew.c (verify_row_hash): Call row_hash for computing the
13716 hash code of a row, instead of duplicating code from xdisp.c.
13717
13718 * dispextern.h (row_hash): Add prototype.
13719
13720 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
13721
13722 * frame.c (delete_frame): Don't delete the terminal when the last
13723 X frame is closed if emacs is built with GTK toolkit.
13724
13725 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
13726
13727 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
13728
13729 2011-11-17 Martin Rudalics <rudalics@gmx.at>
13730
13731 * window.c (Vwindow_splits): Rename to
13732 Vwindow_combination_resize. Suggested by Juri Linkov.
13733 (Fsplit_window_internal): Use Vwindow_combination_resize instead
13734 of Vwindow_splits.
13735
13736 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
13737
13738 * nsfns.m (Fns_font_name):
13739 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
13740
13741 2011-11-16 Martin Rudalics <rudalics@gmx.at>
13742
13743 * window.h (window): Rename slot "nest" to "combination_limit".
13744 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
13745 (Fset_window_nest): Rename to Fset_window_combination_limit.
13746 (Vwindow_nest): Rename to Vwindow_combination_limit.
13747 (recombine_windows, make_parent_window, make_window)
13748 (Fsplit_window_internal, saved_window)
13749 (Fset_window_configuration, save_window_save): Rename all
13750 occurrences of window_nest to window_combination_limit.
13751
13752 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
13753
13754 * image.c (imagemagick_load_image): Fix typo.
13755
13756 2011-11-14 Eli Zaretskii <eliz@gnu.org>
13757
13758 * xdisp.c (display_line): Move the call to
13759 highlight_trailing_whitespace before the call to
13760 compute_line_metrics, since the latter needs to see the final
13761 faces of all the glyphs to compute ROW's hash value.
13762 Fixes assertion violations in row_equal_p. (Bug#10035)
13763
13764 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
13765
13766 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
13767 just return (bug#10044).
13768
13769 2011-11-12 Eli Zaretskii <eliz@gnu.org>
13770
13771 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
13772 with user-defined heap size. Bump the default size of the temacs
13773 heap to 27MB, to avoid memory warning when running temacs.
13774 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
13775
13776 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
13777 current_matrix and desired_matrix. (Bug#9990)
13778 (verify_row_hash) [XASSERTS]: New function.
13779 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
13780 that the hash value of glyph rows is correct.
13781
13782 2011-11-12 Martin Rudalics <rudalics@gmx.at>
13783
13784 * window.h (window): Remove splits slot.
13785 * window.c (Fwindow_splits, Fset_window_splits): Remove.
13786 (Fdelete_other_windows_internal, make_parent_window)
13787 (make_window, Fsplit_window_internal, Fdelete_window_internal)
13788 (Fset_window_configuration, save_window_save): Don't deal with
13789 split status of windows.
13790 (saved_window): Remove splits slot.
13791 (Vwindow_splits): Rewrite doc-string.
13792
13793 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
13794
13795 * xfns.c (unwind_create_frame):
13796 * nsfns.m (unwind_create_frame):
13797 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
13798 Vframe_list (Bug#9999).
13799
13800 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
13801
13802 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
13803
13804 2011-11-11 Kenichi Handa <handa@m17n.org>
13805
13806 * callproc.c (Fcall_process): Set the member dst_multibyte of
13807 process_coding.
13808
13809 2011-11-11 Johan Bockgård <bojohan@gnu.org>
13810
13811 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
13812 avoid a crash (bug#9496).
13813
13814 2011-11-09 Chong Yidong <cyd@gnu.org>
13815
13816 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
13817 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
13818
13819 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13820
13821 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
13822
13823 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13824
13825 Avoid some portability problems by eschewing 'extern inline' functions.
13826 The trivial performance wins aren't worth the portability hassles; see
13827 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
13828 et seq.
13829 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13830 (window_box_width, window_box_left, window_box_left_offset)
13831 (window_box_right, window_box_right_offset): Undo previous change,
13832 by removing the "extern"s.
13833 * intervals.c (adjust_intervals_for_insertion)
13834 (adjust_intervals_for_deletion): Undo previous change,
13835 making these static again.
13836 (offset_intervals, temp_set_point_both, temp_set_point)
13837 (copy_intervals_to_string): No longer inline.
13838 * xdisp.c (window_text_bottom_y, window_box_width)
13839 (window_box_height, window_box_left_offset)
13840 (window_box_right_offset, window_box_left, window_box_right)
13841 (window_box): No longer inline.
13842
13843 2011-11-08 Chong Yidong <cyd@gnu.org>
13844
13845 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
13846 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
13847 Signal an error if not a live window.
13848 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
13849 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
13850
13851 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
13852
13853 * lisp.h (syms_of_abbrev): Remove declaration.
13854 Reported by CHENG Gao <chenggao@royau.me>.
13855
13856 2011-11-07 Eli Zaretskii <eliz@gnu.org>
13857
13858 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
13859 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
13860 of temacs in GUI mode.
13861
13862 2011-11-07 Martin Rudalics <rudalics@gmx.at>
13863
13864 * window.h: Declare delete_all_child_windows instead of
13865 delete_all_subwindows.
13866 * window.c (Fwindow_nest, Fset_window_nest)
13867 (Fset_window_new_total, Fset_window_new_normal)
13868 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
13869 (delete_all_subwindows): Rename to delete_all_child_windows.
13870 (Fdelete_other_windows_internal, Fset_window_configuration):
13871 Call delete_all_child_windows instead of delete_all_subwindows.
13872 * frame.c (delete_frame): Call delete_all_child_windows instead
13873 of delete_all_subwindows.
13874
13875 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
13876
13877 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
13878 This is also needed for porting to any host where GC_MARK_STACK is
13879 not GC_MAKE_GCPROS_NOOPS.
13880 (which_symbols): Use it.
13881
13882 2011-11-07 Kenichi Handa <handa@m17n.org>
13883
13884 * coding.c (coding_set_destination): Check coding->src_pos only
13885 when coding->src_object is a buffer (bug#9910).
13886
13887 * process.c (send_process): Set the member src_multibyte of coding
13888 to 0 (bug#9911) when sending a unibyte text.
13889
13890 * callproc.c (Fcall_process): Set the member src_multibyte of
13891 process_coding to 0 (bug#9912).
13892
13893 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13894
13895 * xmenu.c (cleanup_widget_value_tree): New function.
13896 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
13897 calling free_menubar_widget_value_tree directly (Bug#9830).
13898
13899 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
13900
13901 Fix some portability problems with 'inline'.
13902 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13903 (window_box_width, window_box_left, window_box_left_offset)
13904 (window_box_right, window_box_right_offset): Declare extern.
13905 Otherwise, these inline functions do not conform to C99 and
13906 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
13907 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
13908 * intervals.c (adjust_intervals_for_insertion)
13909 (adjust_intervals_for_deletion): Now extern, because otherwise the
13910 extern inline functions 'offset_intervals' couldn't refer to it.
13911 (static_offset_intervals): Remove.
13912 (offset_intervals): Rewrite using the old contents of
13913 static_offset_intervals. The old version didn't conform to C99
13914 because an extern inline function contained a reference to an
13915 identifier with static linkage.
13916
13917 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
13918
13919 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
13920 GC.
13921
13922 2011-11-06 Eli Zaretskii <eliz@gnu.org>
13923
13924 * xdisp.c (init_iterator, reseat_to_string): Don't set the
13925 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
13926 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
13927 return Qleft_to_right.
13928
13929 2011-11-06 Chong Yidong <cyd@gnu.org>
13930
13931 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
13932 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
13933 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
13934 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
13935 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
13936 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
13937 (Fwindow_vscroll): Doc fix.
13938 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
13939 argument, since it makes no sense to pass a live window and for
13940 consistency with window-child.
13941
13942 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
13943
13944 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
13945 support MSVC.
13946
13947 2011-11-05 Jason Rumney <jasonr@gnu.org>
13948
13949 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
13950 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
13951 fonts (Bug#6029).
13952 (add_font_entity_to_list): Fix logic errors in mixed boolean and
13953 bitwise arithmetic preventing use of unicode-sip and non-truetype
13954 opentype fonts.
13955
13956 2011-11-05 Eli Zaretskii <eliz@gnu.org>
13957
13958 * s/ms-w32.h (fstat, stat, utime): Move redirections to
13959 "emacs"-only part.
13960
13961 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
13962 initialization code to keep similarity to xfns.c after changes
13963 from 2011-11-05.
13964
13965 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
13966
13967 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
13968 (unwind_create_frame): New function (Bug#9943).
13969 (Fx_create_frame): Restructure code to be more similar to the one in
13970 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
13971 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
13972 Move terminal->reference_count++ just before making the frame official
13973 (Bug#9943).
13974
13975 * nsterm.m (x_free_frame_resources): New function.
13976 (x_destroy_window): Move code to x_free_frame_resources.
13977
13978 * xfns.c (unwind_create_frame): Fix comment.
13979 (Fx_create_frame, x_create_tip_frame):
13980 Move terminal->reference_count++ just before making the frame
13981 official. Move initialization of image_cache_refcount and
13982 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
13983
13984 2011-11-05 Eli Zaretskii <eliz@gnu.org>
13985
13986 Support MSVC build with newer versions of Visual Studio.
13987 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
13988 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
13989 nt/gmake.defs.
13990
13991 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
13992 which are not supported by MSVC.
13993 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
13994 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
13995 bitfields.
13996 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
13997 types in bitfields.
13998 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
13999
14000 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14001
14002 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
14003
14004 Support MSVC build with newer versions of Visual Studio.
14005 * w32.c: Don't include w32api.h for MSVC.
14006 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14007
14008 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14009 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14010 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14011 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14012 e_* cousins.
14013 (alloca) [_MSC_VER]: Define to _alloca.
14014
14015 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14016
14017 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14018
14019 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14020
14021 * xdisp.c (note_mouse_highlight): If either of
14022 previous/next-single-property-change returns nil, treat that as
14023 the beginning or the end of the buffer. (Bug#9955)
14024
14025 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14026
14027 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
14028 label is not null (Bug#9951).
14029 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14030 may be NULL.
14031
14032 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14033
14034 * window.c (Fwindow_body_size): Mention in the doc string that the
14035 return value is in frame's canonical units. (Bug#9949)
14036
14037 2011-11-03 Eli Zaretskii <eliz@gnu.org>
14038
14039 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14040
14041 * w32fns.c (unwind_create_frame): If needed, free the glyph
14042 matrices of the partially constructed frame. (Bug#9943)
14043 * xfns.c (unwind_create_frame): Likewise.
14044
14045 2011-11-01 Eli Zaretskii <eliz@gnu.org>
14046
14047 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14048 Don't stop backward scan on the continuation glyph, even though
14049 its CHARPOS is positive.
14050 (mouse_face_from_buffer_pos, note_mouse_highlight):
14051 Rename cover_string to disp_string.
14052
14053 2011-11-01 Martin Rudalics <rudalics@gmx.at>
14054
14055 * window.c (temp_output_buffer_show): Don't use
14056 Vtemp_buffer_show_specifiers.
14057 (Vtemp_buffer_show_specifiers): Remove unused variable.
14058
14059 2011-10-30 Eli Zaretskii <eliz@gnu.org>
14060
14061 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14062 past the beginning of the current glyph matrix.
14063
14064 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
14065
14066 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14067 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14068 HAVE_GTK3 (Bug#9869).
14069
14070 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14071 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14072
14073 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14074
14075 * xterm.c: Declare x_handle_net_wm_state to return int.
14076 (handle_one_xevent): Check if we are iconified but don't have
14077 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14078 (get_current_wm_state): Return non-zero if not hidden,
14079 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14080 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14081 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14082 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14083
14084 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14085
14086 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14087 so that this new function doesn't get optimized away by a
14088 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14089
14090 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14091
14092 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14093
14094 2011-10-29 Eli Zaretskii <eliz@gnu.org>
14095
14096 Fix the `xbytecode' command.
14097 * .gdbinit (xprintbytestr): New command.
14098 (xwhichsymbols): Rename from `which'; all callers changed.
14099 (xbytecode): Print the byte-code string as well.
14100
14101 2011-10-29 Kim Storm <storm@cua.dk>
14102
14103 * alloc.c (which_symbols): New function.
14104
14105 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14106
14107 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14108 line. (Bug#9903)
14109
14110 2011-10-29 Glenn Morris <rgm@gnu.org>
14111
14112 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14113 Not clear what it was for, and it causes various bugs. (Bug#9839)
14114
14115 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14116
14117 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14118 possible random value that matches one of those tested as
14119 condition to clear the mouse face.
14120
14121 2011-10-28 Chong Yidong <cyd@gnu.org>
14122
14123 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14124
14125 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14126
14127 * window.c (make_window): Initialize phys_cursor_on_p.
14128
14129 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14130
14131 * lisp.h (struct Lisp_Symbol): Update comments.
14132
14133 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
14134
14135 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14136
14137 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14138
14139 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14140 <oslsachem@gmail.com> for helping to debug this.
14141
14142 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14143 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14144 (g_b_init_get_glyph_outline_w): New static variables.
14145 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14146 (GetGlyphOutlineW_Proc): New typedefs.
14147 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
14148 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14149 New functions.
14150 (w32font_open_internal, compute_metrics):
14151 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
14152 instead of calling the "wide" APIs directly.
14153
14154 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14155
14156 * w32.h (syms_of_w32font): Add prototype.
14157
14158 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14159
14160 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14161 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14162 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14163 (Fmove_to_window_line): Doc fix.
14164
14165 2011-10-27 Chong Yidong <cyd@gnu.org>
14166
14167 * process.c (make_process): Set gnutls_state to NULL.
14168
14169 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14170 non-NULL, regardless of GNUTLS_INITSTAGE.
14171 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14172 an error. Set process slots as soon as we allocate them.
14173
14174 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14175
14176 2011-10-27 Chong Yidong <cyd@gnu.org>
14177
14178 * gnutls.c (emacs_gnutls_deinit): New function.
14179 Deallocate credentials structures as well as calling gnutls_deinit.
14180 (Fgnutls_deinit, Fgnutls_boot): Use it.
14181
14182 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14183 (deactivate_process): Call emacs_gnutls_deinit.
14184
14185 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14186
14187 * image.c (x_create_x_image_and_pixmap):
14188 * w32.c (sys_rename, w32_delayed_load):
14189 * w32font.c (fill_in_logfont):
14190 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14191
14192 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
14193
14194 * w32fns.c (w32_default_color_map): New function,
14195 extracted from Fw32_default_color_map.
14196 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
14197
14198 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14199
14200 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14201
14202 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14203
14204 * keyboard.c (test_undefined): New function (bug#9751).
14205 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14206
14207 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14208
14209 * sysdep.c (init_sys_modes): Fix the check for the controlling
14210 terminal (Bug#6649).
14211
14212 2011-10-20 Eli Zaretskii <eliz@gnu.org>
14213
14214 * dispextern.h (struct bidi_it): New member next_en_type.
14215
14216 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14217 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14218 current character, check also for next_en_type being WEAK_EN.
14219 (bidi_resolve_weak): Don't enter the expensive loop if the current
14220 position is before next_en_pos. Record the bidi type of the first
14221 non-ET, non-BN character we find, in addition to its position.
14222 (bidi_level_of_next_char): Invalidate next_en_type when
14223 next_en_pos is over-stepped.
14224
14225 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
14226
14227 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
14228 * editfns.c: Rewrite current-time-zone so that it invokes
14229 the equivalent of (format-time-string "%Z") to get the time zone name.
14230 This fixes a bug when the time zone name contains characters that
14231 need converting from the system time locale to Emacs internal format.
14232 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
14233 that patch fixed format-time-string to do the conversion, but
14234 I forgot to fix current-time-zone.
14235 (format_time_string): New function, containing most of
14236 what Fformat_time_string used to contain.
14237 (Fformat_time_string): Rewrite in terms of format_time_string.
14238 This doesn't change this function's behavior.
14239 (current-time-zone): Rewrite to use format_time_string.
14240 This fixes the bug reported by Michael Schierl in
14241 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
14242 Jason Rumney's 2007-06-07 change worked around this bug, but
14243 didn't fix it.
14244 * systime.h (tzname, timezone): Remove no-longer-used declarations.
14245
14246 2011-10-19 Eli Zaretskii <eliz@gnu.org>
14247
14248 * xdisp.c (start_display): If the character at POS is displayed
14249 via a display vector, reset IT->current.dpvec_index to zero.
14250 (try_window_reusing_current_matrix): If a line ends in a display
14251 vector or the next line starts in a display vector, continue
14252 redrawing the window even though the character position of
14253 start_row was reached.
14254 (Bug#9771, part 2)
14255
14256 2011-10-18 Chong Yidong <cyd@gnu.org>
14257
14258 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
14259 with nobreak-char-display too.
14260
14261 2011-10-18 Eli Zaretskii <eliz@gnu.org>
14262
14263 Fix part 3 of bug#9771.
14264 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
14265 (bidi_resolve_neutral): Don't enter the expensive loop looking for
14266 non-neutral characters if the current character is a paragraph
14267 separator (a.k.a. Newline). This avoids running the same
14268 expensive loop twice, once when we consume the preceding newline
14269 and the other time when the line actually needs to be displayed.
14270 Avoid the loop when we see neutrals on the base embedding level
14271 following a character whose directionality is the same as the
14272 paragraph's. This avoids running the expensive loop when a line
14273 ends in a long sequence of neutrals, like control characters.
14274 Add assertion against STRONG_AL type. Slightly rearrange code
14275 that determines the type of a neutral given the first non-neutral
14276 that follows it.
14277 (bidi_level_of_next_char): Set next_en_pos to zero when
14278 invalidating its info.
14279
14280 2011-10-17 Eli Zaretskii <eliz@gnu.org>
14281
14282 * xdisp.c (push_display_prop): Determine whether to record string
14283 or buffer position by IT->string, not by IT->method. Allow
14284 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
14285 (move_it_vertically_backward): Don't look for character position
14286 immediately after the newline when in a continuation line.
14287 (Bug#9771, part 1)
14288
14289 2011-10-15 Martin Rudalics <rudalics@gmx.at>
14290
14291 * window.c (coordinates_in_window): Rewrite and delabelize
14292 vertical border check. (Bug#5357) (Bug#9618)
14293
14294 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
14295
14296 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
14297 errors in XSetWindowBorder (bug#9310).
14298
14299 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
14300
14301 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
14302 avoid crash when xmalloc overrun checking is enabled.
14303
14304 2011-10-13 Eli Zaretskii <eliz@gnu.org>
14305
14306 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
14307 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
14308 cursor motion with <left> and <right> arrow keys.
14309
14310 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
14311 some callers set that themselves.
14312
14313 2011-10-12 Eli Zaretskii <eliz@gnu.org>
14314
14315 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
14316 display string and the previous row comes from the same string and
14317 is empty. (Bug#9739) (Bug#9738)
14318
14319 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
14320
14321 * doc.c (get_doc_string): Encode file name (bug#9735).
14322
14323 2011-10-12 Eli Zaretskii <eliz@gnu.org>
14324
14325 * bidi.c (bidi_level_of_next_char):
14326 * xdisp.c (get_visually_first_element): Remove old incorrect
14327 comments regarding the Unicode Line Separator character.
14328
14329 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
14330
14331 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
14332
14333 * alloc.c (Fgc_status): Do not access beyond zombies array
14334 boundary if nzombies > MAX_ZOMBIES.
14335 * alloc.c (dump_zombies): Add missing format specifier.
14336
14337 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
14338
14339 * xdisp.c (set_cursor_from_row): Simplify conditionals,
14340 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
14341
14342 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
14343 Some packages use them to denote characters with modifiers.
14344
14345 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
14346
14347 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
14348 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
14349 matching a pp-number. Rename parameter var to var1.
14350
14351 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
14352
14353 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
14354
14355 2011-10-08 Glenn Morris <rgm@gnu.org>
14356
14357 * callint.c (Fcall_interactively): Give a more explicit error for the
14358 'c' case with a non-character input. (Bug#8479)
14359
14360 2011-10-08 Eli Zaretskii <eliz@gnu.org>
14361
14362 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
14363 lines.
14364 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
14365 lines that are hscrolled on the left.
14366
14367 * dispnew.c (buffer_posn_from_coords): Account for a possible
14368 presence of header-line. (Bug#4426)
14369
14370 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
14371
14372 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
14373 Don't advertise functionality which we discourage or doesn't work.
14374
14375 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
14376
14377 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
14378 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
14379 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
14380 this makes Emacs dump core during garbage collection on rare
14381 occasions. sizeof is obviously inferior to offsetof here, so
14382 stick with offsetof.
14383 (GC_POINTER_ALIGNMENT): New macro.
14384 (mark_memory): Omit 3rd (offset) arg; caller changed.
14385 Don't assume EMACS_INT alignment is the same as pointer alignment.
14386
14387 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
14388
14389 * keyboard.c (read_key_sequence_remapped): New var.
14390 (read_key_sequence): Compute remapping in the right buffer.
14391 (command_loop_1): Use read_key_sequence's remapping directly.
14392
14393 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
14394
14395 * dired.c (file_name_completion): Don't expand file name.
14396 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
14397 before checking file name handler.
14398
14399 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
14400 they've been requested explicitly (bug#9591).
14401
14402 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
14403
14404 * keymap.c (Fsingle_key_description): Use make_specified_string
14405 instead of build_string to build string from push_key_description.
14406 (Bug#5193)
14407
14408 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14409
14410 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
14411 This fixes a Y2038 bug on 64-bit hosts.
14412 * buffer.c (reset_buffer):
14413 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
14414 (Fclear_buffer_auto_save_failure):
14415 Use 0, not -1, to represent an unset failure time, since time_t
14416 might not be signed.
14417
14418 Remove dependency on glibc malloc internals.
14419 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14420 Move back here from lisp.h, but with their new implementations.
14421 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14422 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
14423 * charset.c (charset_table_init): New static var.
14424 (syms_of_charset): Use it instead of xmalloc. This removes a
14425 dependency on glibc malloc internals. See Eli Zaretskii's comment in
14426 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
14427 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14428 Move back to alloc.c.
14429 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14430 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
14431
14432 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
14433
14434 * nsterm.m (windowDidResize): Call x_set_window_size only when
14435 ns_in_resize is true. Otherwise set pixelwidth/height and
14436 call change_frame_size (Bug#9628).
14437
14438 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14439
14440 Port --enable-checking=all to Fedora 14 x86-64.
14441 * charset.c (syms_of_charset): Also account for glibc malloc's
14442 internal overhead when calculating the initial malloc maximum.
14443
14444 Port --enable-checking=all to Fedora 14 x86.
14445 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14446 Move to lisp.h.
14447 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
14448 (overrun_check_realloc, overrun_check_free):
14449 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
14450 That way, xmalloc returns a properly-aligned pointer even if
14451 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
14452 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
14453 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
14454 into account when calculating the initial malloc maximum.
14455 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14456 Move here from alloc.c, so that charset.c can use it too.
14457 Properly align; the old code wasn't right for common 32-bit hosts
14458 when configured with --enable-checking=all.
14459 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14460 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
14461
14462 2011-09-29 Eli Zaretskii <eliz@gnu.org>
14463
14464 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
14465 use EDOM.
14466
14467 2011-09-28 Eli Zaretskii <eliz@gnu.org>
14468
14469 * xdisp.c (compute_display_string_end): If there's no display
14470 string at CHARPOS, return -1.
14471
14472 * bidi.c (bidi_fetch_char): When compute_display_string_end
14473 returns a negative value, treat the character as a normal
14474 character not covered by a display string. (Bug#9624)
14475
14476 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
14477
14478 * lread.c (Fread_from_string): Fix typo in docstring.
14479
14480 2011-09-27 Eli Zaretskii <eliz@gnu.org>
14481
14482 * xdisp.c (handle_invisible_prop): If invisible text ends on a
14483 newline, reseat the iterator instead of bidi-iterating there one
14484 character at a time. (Bug#9610)
14485 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
14486 TO_CHARPOS if the bidi iterator is at base embedding level.
14487
14488 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
14489
14490 * lread.c (readevalloop): Use correct code for NBSP.
14491 (read1): Likewise. (Bug#9608)
14492
14493 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
14494
14495 * dbusbind.c (Fdbus_register_signal): When service is not
14496 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
14497
14498 2011-09-25 Glenn Morris <rgm@gnu.org>
14499
14500 * buffer.c (truncate-lines): Doc fix.
14501
14502 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
14503
14504 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
14505 (Fset_window_next_buffers): Doc fix.
14506
14507 2011-09-24 Glenn Morris <rgm@gnu.org>
14508
14509 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
14510
14511 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
14512
14513 Fix minor problems found by static checking.
14514 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
14515 * indent.c (Fvertical_motion): Fix == vs = typo.
14516
14517 2011-09-24 Eli Zaretskii <eliz@gnu.org>
14518
14519 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
14520 Default value is now t. Doc fix.
14521
14522 * indent.c (Fvertical_motion): Compute and apply the overshoot
14523 logic when moving up, not only when moving down. Fix the
14524 confusing name and values of the it_overshoot_expected variable;
14525 logic changes accordingly. (Bug#9254) (Bug#9549)
14526
14527 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
14528 CHARPOS is covered by a display string which includes newlines.
14529 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
14530 is covered by a display string with embedded newlines.
14531
14532 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
14533
14534 * dbusbind.c (Fdbus_register_signal): Add match rule to
14535 Vdbus_registered_objects_table. (Bug#9581)
14536 (Fdbus_register_method, Vdbus_registered_objects_table):
14537 Fix docstring.
14538
14539 2011-09-24 Jim Meyering <meyering@redhat.com>
14540
14541 do not ignore write error for any output size
14542 The previous change was incomplete.
14543 While it makes emacs --batch detect the vast majority of stdout
14544 write failures, errors were still ignored whenever the output size is
14545 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
14546 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
14547 && echo FAIL: ignored write error
14548 FAIL: ignored write error
14549 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
14550 && echo FAIL: ignored write error
14551 FAIL: ignored write error
14552 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
14553
14554 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
14555
14556 * emacs.c (Fkill_emacs): In noninteractive mode exit
14557 non-successfully if a write error occurred on stdout. (Bug#9574)
14558
14559 2011-09-21 Eli Zaretskii <eliz@gnu.org>
14560
14561 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
14562 the xassert test.
14563
14564 * dispextern.h (struct it): Update the comment documenting what
14565 can it->OBJECT be.
14566
14567 2011-09-20 Eli Zaretskii <eliz@gnu.org>
14568
14569 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
14570 a display string, extend search for cursor position to end of row.
14571 (find_row_edges): If the row ends in a newline from a display
14572 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
14573 Handle the case of a display string with multiple newlines.
14574 (Fcurrent_bidi_paragraph_direction): Fix search for previous
14575 non-empty line. Fixes confusing cursor motion with arrow keys at
14576 the beginning of a line that starts with whitespace.
14577
14578 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14579
14580 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
14581 (bug#9493).
14582
14583 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
14584
14585 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
14586 boolean (Bug#9154).
14587
14588 2011-09-18 Eli Zaretskii <eliz@gnu.org>
14589
14590 * xdisp.c (display_line): Record maximum and minimum buffer
14591 positions even if no glyphs were produced (e.g., by a zero-width
14592 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
14593 buffer positions that will be removed from the glyph row because
14594 they don't fit.
14595 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
14596 column is beyond frame width: don't subtract 1 "pixel" when
14597 computing width of the stretch.
14598 (reseat_at_next_visible_line_start): Undo the change made on
14599 2011-09-17 that saved paragraph information and restored it after
14600 the call to `reseat'. (Bug#9545)
14601
14602 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14603
14604 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
14605 and turn window cursor on if cleared (Bug#9415).
14606
14607 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
14608
14609 * search.c (boyer_moore): Take unibyte characters from pattern
14610 literally. (Bug#9458)
14611
14612 2011-09-18 Eli Zaretskii <eliz@gnu.org>
14613
14614 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
14615
14616 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
14617
14618 Fix minor problem found by static checking.
14619 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
14620 initialized, to pacify gcc -Wuninitialized.
14621
14622 * fileio.c: Report proper errno when syscall falls.
14623 (Finsert_file_contents): Save and restore errno,
14624 so that report_file_error outputs the correct diagnostic.
14625 (Fwrite_region) [CLASH_DETECTION]: Likewise.
14626
14627 2011-09-18 Eli Zaretskii <eliz@gnu.org>
14628
14629 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
14630
14631 2011-09-17 Eli Zaretskii <eliz@gnu.org>
14632
14633 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
14634 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
14635
14636 2011-09-17 Eli Zaretskii <eliz@gnu.org>
14637
14638 * xdisp.c (reseat_at_next_visible_line_start): Keep information
14639 about the current paragraph and restore it after the call to reseat.
14640
14641 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
14642 (bidi_find_paragraph_start): Search back for paragraph beginning
14643 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
14644 (bidi_move_to_visually_next): Only trigger paragraph-related
14645 computations when the last character is a newline or at EOB, not
14646 just any NEUTRAL_B. (Bug#9470)
14647
14648 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
14649 truncated lines if point is covered by a display string. (Bug#9524)
14650
14651 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
14652
14653 * xselect.c: Relax test for outgoing X longs (Bug#9498).
14654 (cons_to_x_long): New function.
14655 (lisp_data_to_selection_data): Use it. Correct the test for
14656 short-versus-long data; it was negated. Break out of vector
14657 loop, for efficiency, when a long datum is discovered.
14658
14659 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
14660
14661 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
14662
14663 2011-09-16 Eli Zaretskii <eliz@gnu.org>
14664
14665 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
14666 GCC PR/17406) by declaring this function with external scope.
14667
14668 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14669
14670 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
14671 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
14672
14673 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
14674
14675 * editfns.c (Fformat): Correctly handle text properties on "%%".
14676
14677 2011-09-15 Eli Zaretskii <eliz@gnu.org>
14678
14679 * xterm.c (x_draw_composite_glyph_string_foreground):
14680 * w32term.c (x_draw_composite_glyph_string_foreground):
14681 * term.c (encode_terminal_code):
14682 * composite.c (composition_update_it, get_composition_id):
14683 * xdisp.c (get_next_display_element)
14684 (fill_composite_glyph_string): Add comments about special meaning
14685 of TAB characters in a composition.
14686
14687 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14688
14689 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
14690 This occurs when processing a multibyte format.
14691 Problem reported by Wolfgang Jenker.
14692
14693 2011-09-15 Johan Bockgård <bojohan@gnu.org>
14694
14695 * xdisp.c (try_cursor_movement): Only check for exact match if
14696 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
14697
14698 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14699
14700 Remove unused external symbols.
14701 * dispextern.h (calc_pixel_width_or_height): Remove decl.
14702 * xdisp.c (calc_pixel_width_or_height): Now static.
14703 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
14704 * indent.c (check_display_width):
14705 * w32term.c: Fix comment to match code.
14706 * xterm.c, xterm.h (x_catching_errors): Remove.
14707
14708 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14709
14710 * xselect.c: Use signed conversions more consistently (Bug#9498).
14711 (selection_data_to_lisp_data): Assume incoming selection data are
14712 signed integers, not unsigned. This is to be consistent with
14713 outgoing selection data, which was modified to use signed integers
14714 in as part of the fix to Bug#9196 in response to Jan D.'s comment
14715 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
14716 expects long, not unsigned long.
14717
14718 2011-09-14 Eli Zaretskii <eliz@gnu.org>
14719
14720 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
14721 computation of loop end. Reported by Johan Bockgård
14722 <bojohan@gnu.org>.
14723
14724 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
14725
14726 * frame.c (Fother_visible_frames_p): Function deleted.
14727
14728 2011-09-12 Eli Zaretskii <eliz@gnu.org>
14729
14730 * indent.c (compute_motion): Process display vector front to back
14731 rather than the other way around. (Bug#2496)
14732
14733 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
14734
14735 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
14736
14737 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
14738
14739 * minibuf.c (Fread_from_minibuffer): Doc fix.
14740
14741 2011-09-11 Eli Zaretskii <eliz@gnu.org>
14742
14743 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
14744 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
14745
14746 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14747
14748 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
14749 value for non-existent files.
14750
14751 2011-09-11 Eli Zaretskii <eliz@gnu.org>
14752
14753 * fileio.c (Finsert_file_contents): If the file cannot be opened,
14754 set its "size" to -1. This will set the modtime_size field of
14755 the corresponding buffer to -1, which is what
14756 verify-visited-file-modtime expects for files that do not exist.
14757 (Bug#9139)
14758
14759 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
14760
14761 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
14762 here ...
14763 * lisp.h: ... from here. push_key_description is no longer
14764 defined in keyboard.c, so its declaration should not be in
14765 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
14766 logically belongs with push_key_description.
14767
14768 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
14769
14770 * buffer.h: Include <sys/types.h> instead of <time.h>.
14771 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
14772 Problem reported by Herbert J. Skuhra.
14773
14774 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
14775
14776 * xml.c (parse_region): Make the parsing work for
14777 non-comment-starting XML files again (bug#9144).
14778
14779 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
14780
14781 * image.c (gif_load): Fix calculation of bottom and right corner.
14782 (Bug#9468)
14783
14784 2011-09-10 Eli Zaretskii <eliz@gnu.org>
14785
14786 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
14787 redisplay in small windows.
14788
14789 2011-09-09 Eli Zaretskii <eliz@gnu.org>
14790
14791 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
14792
14793 2011-09-08 Martin Rudalics <rudalics@gmx.at>
14794
14795 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
14796 Operate on live windows only.
14797
14798 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
14799
14800 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
14801
14802 2011-09-07 Eli Zaretskii <eliz@gnu.org>
14803
14804 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
14805 only under bidi iteration.
14806
14807 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
14808
14809 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
14810
14811 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14812
14813 isnan: Fix porting problem to Solaris 10 with bundled gcc.
14814 Without this fix, the command to link temacs failed due to an
14815 undefined symbol __builtin_isnan. This is because
14816 /usr/include/iso/math_c99.h #defines isnan(x) to
14817 __builtin_isnan(x), but the bundled gcc, which identifies itself
14818 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
14819 a __builtin_isnan.
14820 * floatfns.c (isnan): #undef, and then #define to a clone of
14821 what's in data.c.
14822 (Fisnan): Always define, since it's always available now.
14823 (syms_of_floatfns): Always define isnan at the Lisp level.
14824
14825 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14826
14827 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
14828
14829 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14830
14831 * fileio.c: Fix bugs with large file offsets (Bug#9428).
14832 The previous code assumed that file offsets (off_t values) fit in
14833 EMACS_INT variables, which is not true on typical 32-bit hosts.
14834 The code messed up by falsely reporting buffer overflow in cases
14835 such as (insert-file-contents "big" nil 1 2) into an empty buffer
14836 when "big" contains more than 2**29 bytes, even though this
14837 inserts just one byte and does not overflow the buffer.
14838 (Finsert_file_contents): Store file offsets as off_t
14839 values, not as EMACS_INT values. Check for overflow when
14840 converting between EMACS_INT and off_t. When checking for
14841 buffer overflow or for overlap, take the offsets into account.
14842 Don't use EMACS_INT for small values where int suffices.
14843 When checking for overlap, fix a typo: ZV was used where
14844 ZV_BYTE was intended.
14845 (Fwrite_region): Don't assume off_t fits into 'long'.
14846 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
14847
14848 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
14849
14850 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
14851
14852 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
14853
14854 sprintf-related integer and memory overflow issues (Bug#9412).
14855
14856 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
14857 (esprintf, exprintf, evxprintf): New functions.
14858 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
14859 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
14860 (modify_event_symbol): Do not assume that the length of
14861 name_alist_or_stem is safe to alloca and fits in int.
14862 (Fexecute_extended_command): Likewise for function name and binding.
14863 (Frecursion_depth): Wrap around reliably on integer overflow.
14864 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
14865 since some callers pass EMACS_INT values.
14866 (Fsingle_key_description): Don't crash if symbol name contains more
14867 than MAX_ALLOCA bytes.
14868 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
14869 (get_minibuffer): Arg is now EMACS_INT, not int.
14870 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
14871 (esprintf, exprintf, evxprintf): New decls.
14872 * window.h (command_loop_level, minibuf_level): Reflect API changes.
14873
14874 * dbusbind.c (signature_cat): New function.
14875 (xd_signature, Fdbus_register_signal):
14876 Do not overrun buffer; instead, report string overflow.
14877
14878 * dispnew.c (add_window_display_history): Don't overrun buffer.
14879 Truncate instead; this is OK since it's just a log.
14880
14881 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
14882 even if the time zone offset is outlandishly large.
14883 Don't mishandle offset == INT_MIN.
14884
14885 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
14886 when creating daemon; the previous buffer-overflow check was incorrect.
14887
14888 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
14889 which has the guts of the old verror function.
14890
14891 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
14892 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
14893
14894 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
14895 (font_unparse_xlfd): Don't blindly alloca long strings.
14896 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
14897 fits in int, when using sprintf. Use single snprintf to count
14898 length of string rather than counting it via multiple sprintfs;
14899 that's simpler and more reliable.
14900 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
14901 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
14902 sprintf, in case result does not fit in int.
14903
14904 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
14905 (fontset_from_font): Print it.
14906
14907 * frame.c (tty_frame_count): Now printmax_t, not int.
14908 (make_terminal_frame, set_term_frame_name): Print it.
14909 (x_report_frame_params): In X, window IDs are unsigned long,
14910 not signed long, so print them as unsigned.
14911 (validate_x_resource_name): Check for implausibly long names,
14912 and don't assume name length fits in 'int'.
14913 (x_get_resource_string): Don't blindly alloca invocation name;
14914 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
14915 not fit in int.
14916
14917 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
14918 (xg_check_special_colors, xg_set_geometry):
14919 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
14920
14921 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
14922 Use esprintf, not sprintf, in case result does not fit in int.
14923
14924 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14925 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
14926 it as a large positive number.
14927 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
14928 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14929
14930 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
14931 in case result does not fit in int.
14932
14933 * print.c (float_to_string): Detect width overflow more reliably.
14934 (print_object): Make sprintf buffer a bit bigger, to avoid potential
14935 buffer overrun. Don't assume list length fits in 'int'. Treat
14936 print length of 0 as 0, not as infinity; to be consistent with other
14937 uses of print length in this function. Don't overflow print length
14938 index. Don't assume hash table size fits in 'long', or that
14939 vectorlike size fits in 'unsigned long'.
14940
14941 * process.c (make_process): Use printmax_t, not int, to format
14942 process-name gensyms.
14943
14944 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
14945
14946 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
14947 to avoid potential buffer overrun.
14948
14949 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
14950 if X resource line is longer than 512 bytes.
14951
14952 * xfns.c (x_window): Make sprintf buffer a bit bigger
14953 to avoid potential buffer overrun.
14954
14955 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
14956
14957 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
14958
14959 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
14960
14961 Integer overflow fixes for scrolling, etc.
14962 Without these, Emacs silently mishandles large integers sometimes.
14963 For example, "C-u 4294967297 M-x recenter" was treated as if
14964 it were "C-u 1 M-x recenter" on a typical 64-bit host.
14965
14966 * xdisp.c (try_window_id): Check Emacs fixnum range before
14967 converting to 'int'.
14968
14969 * window.c (window_scroll_line_based, Frecenter):
14970 Check that an Emacs fixnum is in range before assigning it to 'int'.
14971 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
14972 values converted from Emacs fixnums.
14973 (Frecenter): Don't wrap around a line count if it is out of 'int'
14974 range; instead, treat it as an extreme value.
14975 (Fset_window_configuration, compare_window_configurations):
14976 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
14977
14978 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
14979 that can exceed INT_MAX. Check that EMACS_INT value is in range
14980 before assigning it to the (possibly-narrower) index.
14981 (match_limit): Don't assume that a fixnum can fit in 'int'.
14982
14983 * print.c (print_object): Use ptrdiff_t, not int, for index that can
14984 exceed INT_MAX.
14985
14986 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
14987 (Fvertical_motion): Don't wrap around LINES values that don't fit
14988 in 'int'. Instead, treat them as extreme values. This is good
14989 enough for windows, which can't have more than INT_MAX lines anyway.
14990
14991 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14992
14993 * Require libxml/parser.h to avoid compilation warning.
14994
14995 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
14996
14997 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
14998 since this reportedly can destroy thread storage.
14999
15000 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
15001
15002 * syntax.c (find_defun_start): Update all cache variables if
15003 exiting early (Bug#9401).
15004
15005 2011-08-30 Eli Zaretskii <eliz@gnu.org>
15006
15007 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15008
15009 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15010 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15011 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15012
15013 * term.c (tty_append_glyph): New function.
15014 (produce_stretch_glyph): Static function and its prototype deleted.
15015
15016 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15017 Add prototypes.
15018
15019 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15020
15021 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15022 when checking :margin (Bug#9390).
15023 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
15024 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
15025 so that the name doesn't mislead. All uses changed.
15026
15027 2011-08-28 Johan Bockgård <bojohan@gnu.org>
15028
15029 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15030 set_tty_hooks.
15031
15032 2011-08-27 Eli Zaretskii <eliz@gnu.org>
15033
15034 * xdisp.c (move_it_to): Don't bail out early when reaching
15035 position beyond to_charpos, if we are scanning backwards.
15036 (move_it_vertically_backward): When DY == 0, make sure we get to
15037 the first character in the line after the newline.
15038
15039 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15040
15041 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15042 (ccl_driver): Do not generate an out-of-range pointer.
15043 (Fccl_execute_on_string): Remove unnecessary check for
15044 integer overflow, noted by Stefan Monnier in
15045 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15046 Remove a FIXME that didn't need fixing.
15047 Simplify the newly-introduced buffer reallocation code.
15048
15049 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
15050
15051 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15052
15053 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
15054
15055 Integer and memory overflow issues (Bug#9196).
15056
15057 * doc.c (get_doc_string): Rework so that
15058 get_doc_string_buffer_size is the actual buffer size, rather than
15059 being 1 less than the actual buffer size; this makes xpalloc more
15060 convenient.
15061
15062 * image.c (x_allocate_bitmap_record, cache_image):
15063 * xselect.c (Fx_register_dnd_atom):
15064 Simplify previous changes by using xpalloc.
15065
15066 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15067 since either will do and ptrdiff_t is convenient with xpalloc.
15068
15069 * charset.c (charset_table_size)
15070 (struct charset_sort_data.priority): Now ptrdiff_t.
15071 (charset_compare): Don't overflow if priorities differ greatly.
15072 (Fsort_charsets): Don't assume list length fits in int.
15073 Check for size-calculation overflow when allocating sort data.
15074 (syms_of_charset): Allocate an initial charset table that is
15075 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15076
15077 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15078
15079 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15080 The actual value is always <= INT_MAX, and leaving it unsigned made
15081 overflow checking harder.
15082
15083 * dispextern.h (struct glyph_matrix.rows_allocated)
15084 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15085 with xpalloc. The values are still always <= INT_MAX.
15086
15087 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15088
15089 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15090 (SAFE_NALLOCA): New macro.
15091
15092 * region-cache.c (struct boundary.pos, find_cache_boundary)
15093 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15094 (set_cache_region, invalidate_region_cache)
15095 (revalidate_region_cache, know_region_cache, region_cache_forward)
15096 (region_cache_backward, pp_cache):
15097 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15098 so that ptrdiff_t * can be passed to xpalloc.
15099 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15100 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15101 (pp_cache): Don't assume cache_len fits in int.
15102 * region-cache.h: Adjust extern decls to match.
15103
15104 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15105 EMACS_INT, since either will do, for xpalloc.
15106
15107 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15108 (xnmalloc, xnrealloc, xpalloc): New functions.
15109
15110 * bidi.c (bidi_shelve_header_size): New constant.
15111 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15112 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15113
15114 * bidi.c (bidi_cache_shrink):
15115 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15116 (overlay_strings):
15117 Don't update size of array until after memory allocation succeeds,
15118 because xmalloc/xrealloc may not return.
15119 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15120 now that we have proper integer overflow checking.
15121 (record_overlay_string, overlay_strings): Catch overflows when
15122 calculating size of overlay_str_buf.
15123
15124 * callproc.c (Fcall_process): Check for size overflow when
15125 calculating size of args2.
15126 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15127 Normally we prefer signed values, but sticking with ptrdiff_t would
15128 require adding more-complicated checks.
15129
15130 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15131 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15132 Redo buffer-overflow calculations to avoid integer overflow.
15133 Add a FIXME comment where memory seems to be over-allocated.
15134
15135 * character.c (Fstring): Check for size-calculation overflow.
15136
15137 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15138 unnecessary integer overflow. Check for size overflow.
15139 (encode_coding_object): Don't update size until xmalloc succeeds.
15140
15141 * composite.c (get_composition_id): Check for overflow in glyph
15142 length calculations.
15143
15144 Integer and memory overflow fixes for display code.
15145 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15146 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15147 (scrolling_window): Check for overflow in size calculations.
15148 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15149 Don't assume glyph table len fits in int.
15150 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15151 (row_table_size): Now ptrdiff_t, not int.
15152 (scrolling_window): Avoid overflow in size calculations.
15153 Don't update size until allocation succeeds.
15154 * fns.c (concat): Check for overflow in size calculations.
15155 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15156 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15157 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15158
15159 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15160 (get_doc_string): Check for size calculation overflow.
15161 Don't update size until allocation succeeds.
15162 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15163 EMACS_INT, where ptrdiff_t will do.
15164 (Fsubstitute_command_keys): Check for string overflow.
15165
15166 * editfns.c (set_time_zone_rule): Don't assume environment length
15167 fits in int.
15168 (message_length): Now ptrdiff_t, not int.
15169 (Fmessage_box): Don't update size until allocation succeeds.
15170 Don't assume message length fits in int.
15171 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15172
15173 * emacs.c (main): Do not reallocate argv, since there is a null at
15174 the end that can be overwritten, and this way there's no need to
15175 worry about size-calculation overflow.
15176 (sort_args): Check for size-calculation overflow.
15177
15178 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15179 alloc succeeds.
15180 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15181
15182 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15183 (x_set_scroll_bar_width, x_figure_window_size):
15184 Check for integer overflow.
15185 (x_set_alpha): Do not assume XINT fits in int.
15186
15187 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15188 This is for the members text_lines, text_cols, total_lines, total_cols,
15189 where the system imposes an 'int' limit.
15190
15191 * fringe.c (Fdefine_fringe_bitmap):
15192 Don't update size until alloc works.
15193
15194 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15195 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15196
15197 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15198 Check for size-calculation overflow.
15199 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15200 do, as we prefer signed integers.
15201 (id_to_widget.max_size, id_to_widget.used)
15202 (xg_store_widget_in_map, xg_remove_widget_from_map)
15203 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15204 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15205 Use and return ptrdiff_t, not int.
15206 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15207 * gtkutil.h: Change prototypes to match the above.
15208
15209 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15210 are duplicate now that they've been promoted to lisp.h.
15211 (x_allocate_bitmap_record, x_alloc_image_color)
15212 (make_image_cache, cache_image, xpm_load):
15213 Don't update size until alloc is done.
15214 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15215 (x_detect_edges):
15216 Check for size calculation overflow.
15217 (ct_colors_allocated_max): New constant.
15218 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15219 overflow.
15220
15221 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15222 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
15223 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
15224 Use ptrdiff_t, not int, to count maps.
15225 (read_char_minibuf_menu_prompt): Check for overflow in size
15226 calculations. Don't update size until allocation succeeds.
15227 Redo calculations to avoid overflow.
15228 * keyboard.h: Change prototypes to match the above.
15229
15230 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
15231 to count maps.
15232 (current_minor_maps): Check for size calculation overflow.
15233 * keymap.h: Change prototypes to match the above.
15234
15235 * lread.c (read1, init_obarray): Don't update size until alloc done.
15236
15237 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
15238 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
15239
15240 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
15241 Now ptrdiff_t, not int.
15242 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
15243 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
15244
15245 * process.c (Fnetwork_interface_list): Check for overflow
15246 in size calculation.
15247
15248 * region-cache.c (move_cache_gap): Check for size calculation overflow.
15249
15250 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
15251 overflow. Don't bother calling xmalloc when xrealloc will do.
15252
15253 * search.c (Freplace_match): Check for size calculation overflow.
15254 (Fset_match_data): Don't assume list lengths fit in 'int'.
15255
15256 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
15257 for command line length. Do not attempt to address one before the
15258 beginning of an array, as that's not portable.
15259
15260 * term.c (max_frame_lines): Remove; unused.
15261 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
15262 not int.
15263 (encode_terminal_code, calculate_costs): Check for size
15264 calculation overflow.
15265 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
15266 table lengths and related sizes. Don't update size until alloc
15267 done. Redo calculations to avoid overflow.
15268 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
15269
15270 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
15271 subtracting pointers.
15272 (gobble_line): Check for overflow more carefully. Don't update size
15273 until alloc done.
15274
15275 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
15276 Don't update size until alloc done.
15277 Redo size calculations to avoid overflow.
15278 Check for size calculation overflow.
15279 (main) [DEBUG]: Fix typo in invoking tparam1.
15280
15281 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
15282 Use ptrdiff_t, not int, for sizes.
15283 (store_mode_line_noprop_char): Don't update size until alloc done.
15284
15285 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
15286 Use ptrdiff_t, not int, for sizes.
15287 (Finternal_make_lisp_face, cache_face):
15288 Check for size calculation overflow.
15289 (cache_face): Treat size calculation overflows as if they were
15290 memory exhaustion (the usual treatment), rather than aborting.
15291
15292 * xfns.c (x_encode_text, x_set_name_internal)
15293 (Fx_change_window_property): Use ptrdiff_t, not int, to count
15294 sizes, since they can exceed INT_MAX in size. Check for size
15295 calculation overflow.
15296
15297 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
15298 (xg_select): Check for size calculation overflow.
15299 Don't update size until alloc done.
15300
15301 * xrdb.c (get_environ_db): Don't assume path length fits in int,
15302 as sprintf is limited to int lengths.
15303
15304 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
15305 (X_LONG_MIN): New macros.
15306 Use them to make the following changes clearer.
15307 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
15308 This change doesn't affect the value now, but it may help remind
15309 future maintainers not to raise the value too much later.
15310 (SELECTION_QUANTUM): Remove, replacing with ...
15311 (selection_quantum): ... new function, which avoids overflow.
15312 All uses changed.
15313 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
15314 assumption that selection length fits in 'int'.
15315 (x_reply_selection_request, x_handle_selection_request)
15316 (x_get_window_property, receive_incremental_selection)
15317 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
15318 (lisp_data_to_selection_data, clean_local_selection_data):
15319 Use ptrdiff_t, not int, to record length of selection.
15320 (x_reply_selection_request, x_get_window_property)
15321 (receive_incremental_selection, x_property_data_to_lisp):
15322 Redo calculations to avoid overflow.
15323 (x_reply_selection_request): When sending hint, ceiling it at
15324 X_LONG_MAX rather than relying on wraparound overflow to send
15325 something.
15326 (x_get_window_property, receive_incremental_selection)
15327 (lisp_data_to_selection_data, x_property_data_to_lisp):
15328 Check for size-calculation overflow.
15329 (x_get_window_property, receive_incremental_selection)
15330 (lisp_data_to_selection_data, Fx_register_dnd_atom):
15331 Don't store size until memory allocation succeeds.
15332 (x_get_window_property): Plug memory leak on memory exhaustion.
15333 Don't double-block input; malloc is safe here. Don't assume 2**34
15334 - 4 fits in unsigned long. Add an xassert to check
15335 XGetWindowProperty overflow. Be more careful about overflow
15336 calculations, and distinguish size from memory overflow better.
15337 (receive_incremental_selection): When tracing, don't assume
15338 unsigned int is less than INT_MAX.
15339 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
15340 harmful) conversions of unsigned short to int.
15341 (lisp_data_to_selection_data): Don't assume that integers
15342 in the range -65535 through -1 fit in an X unsigned short.
15343 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
15344 result parameters unless successful. Rely on cons_to_unsigned
15345 to report problems with elements; the old code wasn't right anyway.
15346 (x_check_property_data): Check for int overflow; we cannot use
15347 a wider type due to X limits.
15348 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
15349
15350 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
15351
15352 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
15353 (x_term_init): Check for size calculation overflow.
15354 (x_color_cells): Don't store size until memory allocation succeeds.
15355 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
15356 Don't assume alloca size is less than MAX_ALLOCA.
15357 (x_term_init): Don't assume length fits in int (sprintf is limited
15358 to int size).
15359
15360 Use ptrdiff_t for composition IDs.
15361 * character.c (lisp_string_width):
15362 * composite.c (composition_table_size, n_compositions)
15363 (get_composition_id, composition_gstring_from_id):
15364 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
15365 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
15366 * window.c (Frecenter):
15367 Use ptrdiff_t, not int, for composition IDs.
15368 * composite.c (get_composition_id): Check for integer overflow.
15369 * composite.h: Adjust prototypes to match the above changes.
15370
15371 Use ptrdiff_t for hash table indexes.
15372 * category.c (hash_get_category_set):
15373 * ccl.c (ccl_driver):
15374 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
15375 * coding.c (coding_system_charset_list, detect_coding_system):
15376 * coding.h (struct coding_system.id):
15377 * composite.c (get_composition_id, gstring_lookup_cache):
15378 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
15379 * image.c (xpm_get_color_table_h):
15380 * lisp.h (hash_lookup, hash_put):
15381 * minibuf.c (Ftest_completion):
15382 Use ptrdiff_t for hash table indexes, not int (which is too
15383 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
15384 32-bit --with-wide-int hosts).
15385
15386 * charset.c (Fdefine_charset_internal): Check for integer overflow.
15387 Add a FIXME comment about memory leaks.
15388 (syms_of_charset): Don't assume xmalloc returns.
15389
15390 Don't assume that stated character widths fit in int.
15391 * character.c (Fchar_width, c_string_width, lisp_string_width):
15392 * character.h (CHAR_WIDTH):
15393 * indent.c (MULTIBYTE_BYTES_WIDTH):
15394 Use sanitize_char_width to avoid undefined and/or bad behavior
15395 with outlandish widths.
15396 * character.h (sanitize_tab_width): Rename from sanitize_width,
15397 now that we have two such functions. All uses changed.
15398 (sanitize_char_width): New inline function.
15399
15400 Don't assume that tab-width fits in int.
15401 * character.h (sanitize_width): New inline function.
15402 (SANE_TAB_WIDTH): New macro.
15403 (ASCII_CHAR_WIDTH): Use it.
15404 * indent.c (sane_tab_width): Remove. All uses replaced by
15405 SANE_TAB_WIDTH (current_buffer).
15406 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
15407
15408 * fileio.c: Integer overflow issues with file modes.
15409 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
15410
15411 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
15412 Remove unreachable code.
15413 (read_hex, load_charset_map_from_file): Check for integer overflow.
15414
15415 * xterm.c: Don't go over XClientMessageEvent limit.
15416 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
15417 (x_send_scroll_bar_event): Likewise. Check that the size does not
15418 exceed limits imposed by XClientMessageEvent, as well as the usual
15419 ptrdiff_t and size_t limits.
15420
15421 * keyboard.c: Overflow, signedness and related fixes.
15422 (make_lispy_movement): Use same integer type in forward decl
15423 that is used in the definition.
15424 (read_key_sequence, keyremap_step):
15425 Change bufsize argument back to int, undoing my 2011-03-30 change.
15426 We prefer signed types, and int is wide enough here.
15427 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
15428 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
15429 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
15430 length, not size_t. Use ptrdiff_t for index, not int.
15431 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
15432 possibility of integer overflow.
15433
15434 Overflow, signedness and related fixes for images.
15435
15436 * dispextern.h (struct it.stack[0].u.image.image_id)
15437 (struct_it.image_id, struct image.id, struct image_cache.size)
15438 (struct image_cache.used, struct image_cache.ref_count):
15439 * gtkutil.c (update_frame_tool_bar):
15440 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
15441 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
15442 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
15443 * nsmenu.m (update_frame_tool_bar):
15444 * xdisp.c (calc_pixel_width_or_height):
15445 * xfns.c (image_cache_refcount):
15446 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
15447 on typical 64-bit hosts.
15448
15449 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15450 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
15451 Omit unnecessary casts to int.
15452 (parse_image_spec): Check that integers fall into 'int' range
15453 when the callers expect that.
15454 (image_ascent): Redo ascent calculation to avoid int overflow.
15455 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
15456 (lookup_image): Remove unnecessary tests.
15457 (xbm_image_p): Locals are now of int, not EMACS_INT,
15458 since parse_image_check makes sure they fit into int.
15459 (png_load, gif_load, svg_load_image):
15460 Prefer int to unsigned where either will do.
15461 (tiff_handler): New function, combining the cores of the
15462 old tiff_error_handler and tiff_warning_handler.
15463 This function is rewritten to use vsnprintf and thereby avoid
15464 stack buffer overflows. It uses only the features of vsnprintf
15465 that are common to both POSIX and native Microsoft.
15466 (tiff_error_handler, tiff_warning_handler): Use it.
15467 (tiff_load, gif_load, imagemagick_load_image):
15468 Don't assume :index value fits in 'int'.
15469 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
15470 (imagemagick_load_image): Check that crop parameters fit into
15471 the integer types that MagickCropImage accepts. Don't assume
15472 Vimagemagick_render_type has a nonnegative value. Don't assume
15473 size_t fits in 'long'.
15474 (gs_load): Use printmax_t to print the widest integers possible.
15475 Check for integer overflow when computing image height and width.
15476
15477 2011-08-26 Eli Zaretskii <eliz@gnu.org>
15478
15479 * xdisp.c (redisplay_window): Don't force window start if point
15480 will be invisible in the resulting window. (Bug#9324)
15481
15482 2011-08-25 Eli Zaretskii <eliz@gnu.org>
15483
15484 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
15485 the display spec is of the form `(space ...)'.
15486 (handle_display_spec): Return the value returned by
15487 handle_single_display_spec, not just 1 or zero.
15488 (handle_single_display_spec): If the display spec is of the form
15489 `(space ...)', and specifies display in the text area, return 2
15490 rather than 1.
15491 (try_cursor_movement): Check for the need to scroll more
15492 accurately, and prefer exact match for point under bidi.
15493 Don't advance `row' beyond the last row of the window.
15494
15495 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
15496 into disp_prop; all users changed.
15497
15498 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
15499 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
15500 for the text covered by the display property.
15501
15502 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
15503
15504 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
15505 Change return value to nil.
15506 (Frecord_buffer): Delete unused function.
15507
15508 2011-08-24 Eli Zaretskii <eliz@gnu.org>
15509
15510 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
15511 buffers, return left-to-right.
15512 (set_cursor_from_row): Consider candidate row a win if its glyph
15513 represents a newline and point is on that newline. Fixes cursor
15514 positioning on the newline at EOL of R2L text within L2R
15515 paragraph, and vice versa.
15516 (try_cursor_movement): Check continued rows, in addition to
15517 continuation rows. Fixes unwarranted scroll when point enters a
15518 continued line of R2L text within an L2R paragraph, or vice versa.
15519 (cursor_row_p): Consider the case of point being equal to
15520 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
15521 from the end of a short line to the beginning of a continued line
15522 of R2L text within L2R paragraph.
15523 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
15524 composed characters.
15525
15526 * bidi.c (bidi_check_type): Use xassert.
15527 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
15528 members.
15529
15530 2011-08-23 Eli Zaretskii <eliz@gnu.org>
15531
15532 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
15533 a character.
15534
15535 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
15536
15537 * nsfont.m (ns_otf_to_script): Fix typo.
15538
15539 2011-08-22 Kenichi Handa <handa@m17n.org>
15540
15541 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
15542 extra slot even if the purpose is char-code-property-table.
15543
15544 2011-08-23 Eli Zaretskii <eliz@gnu.org>
15545
15546 * xdisp.c (redisplay_window): When computing centering_position,
15547 account for the height of the header line. (Bug#8874)
15548
15549 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
15550 instead of CHAR_TO_BYTE. Fixes a crash when a completion
15551 candidate is selected by the mouse, and that candidate has a
15552 composed character under the mouse.
15553
15554 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
15555 coordinates reported by pos-visible-in-window-p for a composed
15556 character in column zero.
15557
15558 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
15559
15560 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
15561
15562 2011-08-22 Eli Zaretskii <eliz@gnu.org>
15563
15564 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
15565 consider it a hit if to_charpos is anywhere in the range of the
15566 composed buffer positions.
15567
15568 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
15569
15570 * image.c (gif_load): Don't assume that each subimage has the same
15571 dimensions as the base image. Handle disposal method that is
15572 "undefined" by the gif spec (Bug#9335).
15573
15574 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
15575
15576 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
15577 (Fcondition_case): Document `debug' symbol in error handler.
15578
15579 2011-08-19 Eli Zaretskii <eliz@gnu.org>
15580
15581 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
15582 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
15583 from an Org mode buffer to a Speedbar frame.
15584
15585 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
15586 a composition, take its buffer position from IT->cmp_it.charpos.
15587 Fixes cursor positioning at the beginning of a line that begins
15588 with a composed character.
15589
15590 2011-08-18 Eli Zaretskii <eliz@gnu.org>
15591
15592 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
15593 character bidirectional type, use STRONG_L instead. Fixes crashes
15594 in a buffer produced by `describe-categories'.
15595
15596 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
15597 members before the level stack, so they would be saved and
15598 restored when copying iterator state. Fixes incorrect reordering
15599 around TABs covered by display properties.
15600
15601 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
15602
15603 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
15604
15605 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
15606
15607 * eval.c (internal_condition_case, internal_condition_case_1)
15608 (internal_condition_case_2, internal_condition_case_n):
15609 Remove unnecessary aborts (Bug#9081).
15610
15611 2011-08-17 Eli Zaretskii <eliz@gnu.org>
15612
15613 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
15614 has no `load' handler, try opening the file locally. (Bug#9311)
15615
15616 2011-08-16 Ken Brown <kbrown@cornell.edu>
15617
15618 * gmalloc.c: Expand comment.
15619
15620 2011-08-16 Eli Zaretskii <eliz@gnu.org>
15621
15622 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
15623 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
15624
15625 2011-08-16 Ken Brown <kbrown@cornell.edu>
15626
15627 Fix memory allocation problems in Cygwin build (Bug#9273).
15628
15629 * unexcw.c ( __malloc_initialized): Declare external variable.
15630 (fixup_executable): Force the dumped emacs to reinitialize malloc.
15631
15632 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
15633 New variables.
15634 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
15635 dumped emacs.
15636 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
15637 in the static heap.
15638 [CYGWIN] (special_realloc): New function.
15639 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
15640 requests to realloc storage in the static heap.
15641
15642 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
15643
15644 * bidi.c (bidi_initialize): Remove unused local.
15645
15646 2011-08-15 Eli Zaretskii <eliz@gnu.org>
15647
15648 * bidimirror.h:
15649 * biditype.h: Remove file.
15650 * makefile.w32-in ($(BLD)/bidi.$(O)):
15651 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
15652
15653 * dispextern.h: Fix a typo in the comment to bidi_type_t.
15654
15655 * chartab.c: Improve commentary for the uniprop_table API.
15656
15657 * bidi.c (bidi_paragraph_init): Support zero value of
15658 bidi_ignore_explicit_marks_for_paragraph_level.
15659 (bidi_initialize): Use uniprop_table instead of including
15660 biditype.h and bidimirror.h.
15661
15662 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
15663 coordinates of the iterator when restoring from ppos_it.
15664 (Bug#9296)
15665
15666 2011-08-14 Kenichi Handa <handa@m17n.org>
15667
15668 * process.c (create_process): Call setup_process_coding_systems
15669 after the pid of the process is set to -1 (Bug#8162).
15670
15671 2011-08-14 Eli Zaretskii <eliz@gnu.org>
15672
15673 * xdisp.c (move_it_in_display_line_to): Don't invoke
15674 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
15675 ppos_it. Fixes vertical cursor motion when line beginning is
15676 covered by an image. (Bug#9296)
15677
15678 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
15679
15680 * nsterm.h (ns_run_ascript): Declare.
15681 (NSAPP_DATA2_RUNASSCRIPT): Define.
15682
15683 * nsfns.m (as_script, as_result, as_status): New static variables.
15684 (ns_run_ascript): New function.
15685 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
15686 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
15687 the event loop. Get status from as_status (Bug#7276).
15688
15689 * nsterm.m (sendEvent): If event is NSApplicationDefined and
15690 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
15691 the event loop (Bug#7276).
15692
15693 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
15694
15695 * gnutls.c (QCgnutls_bootprop_priority)
15696 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
15697 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
15698 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
15699 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
15700 (QCgnutls_bootprop_verify_hostname_error)
15701 (QCgnutls_bootprop_callbacks_verify): Rename from
15702 Qgnutls_bootprop_..., all uses changed.
15703
15704 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
15705 uses changed.
15706
15707 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
15708
15709 * xfaces.c (Qframe_set_background_mode): Now static.
15710 * dispextern.h (Qframe_set_background_mode): Remove decl.
15711
15712 * process.c (Fnetwork_interface_info): Declare local only if needed.
15713
15714 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
15715
15716 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
15717 (Fnetwork_interface_list): Allocate in increments of bytes instead
15718 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
15719 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
15720 sockaddr.
15721 (struct ifflag_def): notrailers is smart on OSX.
15722 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
15723 Get hardware address with getifaddrs if available.
15724
15725 2011-08-12 Eli Zaretskii <eliz@gnu.org>
15726
15727 * xdisp.c (iterate_out_of_display_property): xassert that
15728 IT->position is set to within IT->object's boundaries. Break from
15729 the loop as soon as EOB is reached; avoids infloops in redisplay
15730 when IT->position is set up wrongly due to some bug.
15731 Set IT->current to match the bidi iterator unconditionally.
15732 (push_display_prop): Allow GET_FROM_STRING as IT->method on
15733 entry. Force push_it to save on the stack the current
15734 buffer/string position, to be restored by pop_it. Fix flags in
15735 the iterator structure wrt the object coming from a display
15736 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
15737 properties. (Bug#9284)
15738
15739 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
15740
15741 * fontset.c (fontset_get_font_group): Add proper type checks.
15742 (Bug#9172)
15743
15744 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15745
15746 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
15747 and LC_VERSION_MIN_MACOSX.
15748 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
15749 (dump_it) [LC_FUNCTION_STARTS]: Use it.
15750
15751 2011-08-08 Eli Zaretskii <eliz@gnu.org>
15752
15753 * xdisp.c (forward_to_next_line_start): Allow to use the
15754 no-display-properties-and-no-overlays under bidi display.
15755 Set disp_pos in the bidi iterator to avoid searches for display
15756 properties and overlays.
15757
15758 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
15759
15760 * editfns.c (Fset_time_zone_rule): Document relationship with the
15761 setenv function.
15762
15763 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
15764 the font entity extracted from the cache (Bug#8109).
15765
15766 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
15767
15768 * composite.c (autocmp_chars): Don't reset point. That is done by
15769 restore_point_unwind (Bug#5984).
15770
15771 2011-08-07 Juri Linkov <juri@jurta.org>
15772
15773 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
15774 to show the arg `TIME' instead of `TIMEVAL'.
15775
15776 2011-08-06 Eli Zaretskii <eliz@gnu.org>
15777
15778 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
15779 display property strides EOL and includes a newline, as in
15780 longlines-mode. (Bug#9254)
15781 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
15782 word-wrap under bidirectional display. (Bug#9224)
15783
15784 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
15785 is non-zero, even if the data buffer is NULL. Fixes a crash in
15786 vertical-motion with longlines-mode. (Bug#9254)
15787
15788 2011-08-05 Eli Zaretskii <eliz@gnu.org>
15789
15790 * bidi.c <bidi_cache_total_alloc>: Now static.
15791 (bidi_initialize): Initialize bidi_cache_total_alloc.
15792
15793 * xdisp.c (display_line): Release buffer allocated for shelved bidi
15794 cache. (Bug#9221)
15795
15796 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
15797 amount allocated this far in `bidi_cache_total_alloc'.
15798 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
15799 non-zero, only free the data buffer without restoring the cache
15800 contents. All callers changed.
15801
15802 * dispextern.h (bidi_unshelve_cache): Update prototype.
15803
15804 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
15805 (move_it_in_display_line, move_it_to)
15806 (move_it_vertically_backward, move_it_by_lines): Replace the call
15807 to xfree to an equivalent call to bidi_unshelve_cache.
15808 (move_it_in_display_line_to): Fix logic of returning
15809 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
15810
15811 2011-08-05 Eli Zaretskii <eliz@gnu.org>
15812
15813 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
15814 came from a string character with a `cursor' property. (Bug#9229)
15815
15816 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15817
15818 * Makefile.in (LIB_PTHREAD): New variable.
15819 (LIBES): Add LIB_PTHREAD (Bug#9216).
15820
15821 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
15822 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
15823
15824 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
15825
15826 * regex.c (re_iswctype): Remove some redundant boolean conversions.
15827
15828 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15829
15830 * xterm.c (x_find_topmost_parent): New function.
15831 (x_set_frame_alpha): Find topmost parent window with
15832 x_find_topmost_parent and set the property there also (bug#9181).
15833 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
15834
15835 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
15836
15837 * callproc.c (Fcall_process): Avoid vfork clobbering
15838 the local vars buffer, coding_systems, current_dir.
15839
15840 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
15841
15842 * keymap.c (Fmake_composed_keymap): Move to subr.el.
15843
15844 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
15845
15846 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
15847 so that it is not optimized away.
15848
15849 * xdisp.c (compute_display_string_pos): Remove unused local.
15850
15851 2011-08-02 Eli Zaretskii <eliz@gnu.org>
15852
15853 Fix slow cursor motion and scrolling in large buffers with
15854 selective display, like Org Mode buffers. (Bug#9218)
15855
15856 * dispextern.h (struct bidi_it): New member disp_prop_p.
15857
15858 * xdisp.c: Remove one-slot cache of display string positions.
15859 (compute_display_string_pos): Accept an additional argument
15860 DISP_PROP_P; callers changed. Scan at most 5K characters forward
15861 for a display string or property. If found, set DISP_PROP_P
15862 non-zero.
15863
15864 * bidi.c (bidi_fetch_char): Accept an additional argument
15865 DISP_PROP_P, and pass it to compute_display_string_pos.
15866 Only handle text covered by a display string if DISP_PROP_P is returned
15867 non-zero. All callers of bidi_fetch_char changed.
15868
15869 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
15870
15871 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
15872
15873 2010-12-03 Don March <don@ohspite.net>
15874
15875 * keymap.c (Fdefine_key): Fix non-prefix key error message when
15876 last character M-[char] is translated to ESC [char] (bug#7541).
15877
15878 2011-08-02 Kenichi Handa <handa@m17n.org>
15879
15880 * lisp.h (uniprop_table): Extern it.
15881
15882 * chartab.c (uniprop_table): Make it non-static.
15883
15884 2011-08-01 Eli Zaretskii <eliz@gnu.org>
15885
15886 * xdisp.c (forward_to_next_line_start): Accept additional argument
15887 BIDI_IT_PREV, and store into it the state of the bidi iterator had
15888 on the newline.
15889 (reseat_at_next_visible_line_start): Use the bidi iterator state
15890 returned by forward_to_next_line_start to restore the state of
15891 it->bidi_it after backing up to previous newline. (Bug#9212)
15892
15893 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
15894
15895 * regex.c (re_comp): Protoize.
15896 (re_exec): Fix return type.
15897 (regexec): Fix type of `ret'. (Bug#9203)
15898
15899 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15900
15901 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
15902 This is needed if max-image-size is a floating-point number.
15903
15904 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15905
15906 * print.c (print_object): Print empty symbol as ##.
15907
15908 * lread.c (read1): Read ## as empty symbol.
15909
15910 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
15911
15912 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
15913 setting frame foreground color (Bug#9175).
15914 (x_set_background_color): Likewise.
15915
15916 * nsmenu.m (-setText): Size tooltip dimensions precisely to
15917 contents (Bug#9176).
15918 (EmacsTooltip -init): Remove bezels and add shadows to
15919 tooltip windows.
15920
15921 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
15922 or scroll bar (Bug#8470).
15923
15924 * nsfont.m (nsfont_open): Remove assignment to voffset and
15925 unnecessary vars hshink, expand, hd, full_height, min_height.
15926 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
15927
15928 * nsterm.h (nsfont_info): Remove voffset field.
15929
15930 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
15931
15932 Implement strike-through and overline on NextStep (Bug#8863).
15933
15934 * nsfont.m (nsfont_open): Use underline position provided by font,
15935 instead of hard-coded value of 2.
15936 (nsfont_draw): Call ns_draw_text_decoration instead.
15937
15938 * nsterm.h: Add declaration for ns_draw_text_decoration.
15939
15940 * nsterm.m (ns_draw_text_decoration): New function for drawing
15941 underline, overline, and strike-through.
15942 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
15943 ns_draw_text_decoration. Change treatment of cursor drawing to
15944 accommodate underlining, etc.
15945
15946 2011-07-28 Eli Zaretskii <eliz@gnu.org>
15947
15948 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
15949 default.
15950
15951 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15952
15953 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
15954 Without this fix, if a signal arrives just after memory fills up,
15955 'malloc' might be invoked reentrantly.
15956
15957 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
15958 In other words, assume that every image size is allowed, on non-X
15959 hosts. This assumption is probably wrong, but it lets Emacs compile.
15960
15961 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15962
15963 * regex.c (re_iswctype): Convert return values to boolean.
15964
15965 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
15966
15967 * xdisp.c (compute_display_string_pos): Don't use cached display
15968 string position if the buffer had its restriction changed.
15969 (Bug#9184)
15970
15971 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15972
15973 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15974
15975 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15976
15977 Integer signedness and overflow and related fixes. (Bug#9079)
15978
15979 * bidi.c: Integer size and overflow fixes.
15980 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
15981 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
15982 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15983 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
15984 (bidi_find_other_level_edge):
15985 Use ptrdiff_t instead of EMACS_INT where either will do.
15986 This works better on 32-bit hosts configured --with-wide-int.
15987 (bidi_cache_ensure_space): Check for size-calculation overflow.
15988 Use % rather than repeated addition, for better worst-case speed.
15989 Don't set bidi_cache_size until after xrealloc returns, because it
15990 might not return.
15991 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
15992 (bidi_cache_ensure_space): Also check that the bidi cache size
15993 does not exceed that of the largest Lisp string or buffer. See Eli
15994 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
15995
15996 * alloc.c (__malloc_size_t): Remove.
15997 All uses replaced by size_t. See Andreas Schwab's note
15998 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
15999
16000 * image.c: Improve checking for integer overflow.
16001 (check_image_size): Assume that f is nonnull, since
16002 it is always nonnull in practice. This is one less thing to
16003 worry about when checking for integer overflow later.
16004 (x_check_image_size): New function, which checks for integer
16005 overflow issues inside X.
16006 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16007 This removes the need for a memory_full check.
16008 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16009 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16010 (xbm_read_bitmap_data): Change locals back to 'int', since
16011 their values must fit in 'int'.
16012 (xpm_load_image, png_load, tiff_load):
16013 Invoke x_create_x_image_and_pixmap earlier,
16014 to avoid much needless work if the image is too large.
16015 (tiff_load): Treat overly large images as if
16016 x_create_x_image_and_pixmap failed, not as malloc failures.
16017 (gs_load): Use x_check_image_size.
16018
16019 * gtkutil.c: Omit integer casts.
16020 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16021 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16022
16023 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16024
16025 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16026 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16027 would wrongly return t on a 64-bit host.
16028
16029 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16030 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16031 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16032 and therefore cause GCC to emit a bogus diagnostic in some cases.
16033
16034 * image.c: Integer signedness and overflow and related fixes.
16035 This is not an exhaustive set of fixes, but it's time to
16036 record what I've got.
16037 (lookup_pixel_color, check_image_size): Remove redundant decls.
16038 (check_image_size): Don't assume that arbitrary EMACS_INT values
16039 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16040 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16041 (tiff_load, imagemagick_load_image):
16042 Check for overflow in size calculations.
16043 (x_create_x_image_and_pixmap): Remove unnecessary test for
16044 xmalloc returning NULL; that can't happen.
16045 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16046 (xpm_color_bucket): Use better integer hashing function.
16047 (xpm_cache_color): Don't possibly over-allocate memory.
16048 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16049 (gif_memory_source):
16050 Use ptrdiff_t, not int or size_t, to record sizes.
16051 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16052 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16053 either works, as we prefer signed integers.
16054 (tiff_read_from_memory, tiff_write_from_memory):
16055 Return tsize_t, not size_t, since that's what the TIFF API wants.
16056 (tiff_read_from_memory): Don't fail simply because the read would
16057 go past EOF; instead, return a short read.
16058 (tiff_load): Omit no-longer-needed casts.
16059 (Fimagemagick_types): Don't assume size fits into 'int'.
16060
16061 Improve hashing quality when configured --with-wide-int.
16062 * fns.c (hash_string): New function, taken from sxhash_string.
16063 Do not discard information about ASCII character case; this
16064 discarding is no longer needed.
16065 (sxhash-string): Use it. Change sig to match it. Caller changed.
16066 * lisp.h: Declare it.
16067 * lread.c (hash_string): Remove, since we now use fns.c's version.
16068 The fns.c version returns a wider integer if --with-wide-int is
16069 specified, so this should help the quality of the hashing a bit.
16070
16071 * emacs.c: Integer overflow minor fix.
16072 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16073 Define only if GNU_LINUX.
16074 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16075
16076 * dispnew.c: Integer signedness and overflow fixes.
16077 Remove unnecessary forward decls, that were a maintenance hassle.
16078 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16079 All uses changed.
16080 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16081 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16082 (prepare_desired_row, line_draw_cost):
16083 Use int, not unsigned, where either works.
16084 (save_current_matrix, restore_current_matrix):
16085 Use ptrdiff_t, not size_t, where either works.
16086 (init_display): Check for overflow more accurately, and without
16087 relying on undefined behavior.
16088
16089 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16090 Remove, replacing with the new symbols in lisp.h. All uses changed.
16091 * fileio.c (make_temp_name):
16092 * filelock.c (lock_file_1, lock_file):
16093 * xdisp.c (message_dolog):
16094 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16095 Use pMd etc. instead.
16096 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16097 replacing the pWIDE etc. symbols removed from editfns.c.
16098
16099 * keyboard.h (num_input_events): Now uintmax_t.
16100 This is (very slightly) less likely to mess up due to wraparound.
16101 All uses changed.
16102
16103 * buffer.c: Integer signedness fixes.
16104 (alloc_buffer_text, enlarge_buffer_text):
16105 Use ptrdiff_t rather than size_t when either will do, as we prefer
16106 signed integers.
16107
16108 * alloc.c: Integer signedness and overflow fixes.
16109 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16110 (__malloc_size_t): Default to size_t, not to int.
16111 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16112 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16113 Prefer ptrdiff_t to size_t when either would do, as we prefer
16114 signed integers.
16115 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16116 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16117 Now const. Initialize with values that are in range even if char
16118 is signed.
16119 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16120 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16121 These functions do the right thing with sizes > 2**32.
16122 (check_depth): Now ptrdiff_t, not int.
16123 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16124 Adjust to new way of storing sizes. Check for size overflow bugs
16125 in rest of code.
16126 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16127 slightly wrong anyway, as it missed one instance of
16128 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16129 (refill_memory_reserve): Omit needless cast to size_t.
16130 (mark_object_loop_halt): Mark as externally visible.
16131
16132 * xselect.c: Integer signedness and overflow fixes.
16133 (Fx_register_dnd_atom, x_handle_dnd_message):
16134 Use ptrdiff_t, not size_t, since we prefer signed.
16135 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16136 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16137 x_dnd_atoms_size and x_dnd_atoms_length.
16138
16139 * doprnt.c: Prefer signed to unsigned when either works.
16140 * eval.c (verror):
16141 * doprnt.c (doprnt):
16142 * lisp.h (doprnt):
16143 * xdisp.c (vmessage):
16144 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16145 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16146 prefer signed arithmetic to avoid comparison confusion.
16147 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16148 but is a bit tricky.
16149
16150 Assume freestanding C89 headers, string.h, stdlib.h.
16151 * data.c, doprnt.c, floatfns.c, print.c:
16152 Include float.h unconditionally.
16153 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16154 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16155 * regex.c: Likewise for stddef.h, string.h.
16156 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16157 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16158 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16159 (STDC_HEADERS): Remove obsolete defines.
16160 * sysdep.c: Include limits.h unconditionally.
16161
16162 Assume support for memcmp, memcpy, memmove, memset.
16163 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16164 * regex.c (memcmp, memcpy):
16165 Remove; we assume C89 now.
16166
16167 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16168 (__malloc_safe_bcopy): Remove; no longer needed.
16169
16170 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
16171 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16172 well either way, and we prefer signed to unsigned.
16173
16174 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16175
16176 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16177 closes the connection while we're reading (bug#9182).
16178
16179 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
16180
16181 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16182 are specified (Bug#9168).
16183
16184 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16185
16186 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16187 Found by GCC static checking and --with-wide-int on a 32-bit host.
16188
16189 2011-07-25 Eli Zaretskii <eliz@gnu.org>
16190
16191 * xdisp.c (compute_display_string_pos): Fix logic of caching
16192 previous display string position. Initialize cached_prev_pos to
16193 -1. Fixes slow-down at the beginning of a buffer.
16194
16195 2011-07-24 Eli Zaretskii <eliz@gnu.org>
16196
16197 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16198 for attrs[LFACE_FONTSET_INDEX].
16199
16200 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16201
16202 * xml.c (parse_region): Remove unused local
16203 that was recently introduced.
16204
16205 2011-07-23 Eli Zaretskii <eliz@gnu.org>
16206
16207 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16208 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16209
16210 * xdisp.c (move_it_in_display_line_to): Record the best matching
16211 position for TO_CHARPOS while scanning the line, and restore it on
16212 exit if none of the characters scanned was an exact match.
16213 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
16214 when exact match is impossible due to invisible text, and the
16215 lines are truncated.
16216
16217 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16218
16219 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16220 for OSX >= 10.7.
16221
16222 2011-07-22 Eli Zaretskii <eliz@gnu.org>
16223
16224 Fix a significant slow-down of cursor motion with C-n, C-p,
16225 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
16226 auto-repeat under bidi redisplay in fontified buffers.
16227 * xdisp.c (compute_stop_pos_backwards): New function.
16228 (next_element_from_buffer): Call compute_stop_pos_backwards to
16229 find a suitable prev_stop when we find ourselves before
16230 base_level_stop.
16231 (reseat): Don't look for prev_stop, as that could mean a very long
16232 run.
16233 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
16234 <cached_disp_overlay_modiff>: Cache for last found display string
16235 position.
16236 (compute_display_string_pos): Return the cached position if asked
16237 about the same buffer in the same area of character positions, and
16238 the buffer wasn't changed since the time the display string
16239 position was cached.
16240
16241 2011-07-22 Eli Zaretskii <eliz@gnu.org>
16242
16243 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
16244 is an integer, which is important for empty lines. (Bug#9149)
16245
16246 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
16247
16248 * frame.c (Fmodify_frame_parameters): In tty case, update the
16249 default face if necessary (Bug#4238).
16250
16251 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
16252
16253 * editfns.c (Fstring_to_char): No need to explain what a character
16254 is in the docstring (Bug#6576).
16255
16256 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16257
16258 * xml.c (parse_region): Make sure we always return a tree.
16259
16260 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
16261
16262 * xml.c (parse_region): If a document contains only comments,
16263 return that, too.
16264
16265 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16266
16267 * xml.c (make_dom): Return comments, too.
16268
16269 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
16270
16271 Port to OpenBSD.
16272 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
16273 and the surrounding thread.
16274 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
16275 rather than fgets, and retry after EINTR. Otherwise, 'emacs
16276 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
16277 timer goes off.
16278 * s/openbsd.h (BROKEN_SIGIO): Define.
16279 * unexelf.c (unexec) [__OpenBSD__]:
16280 Don't update the .mdebug section of the Alpha COFF symbol table.
16281
16282 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16283
16284 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
16285 (bug#8460).
16286
16287 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
16288
16289 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
16290 This fixes some race conditions on the permissions of any newly
16291 created file.
16292
16293 * alloc.c (valid_pointer_p): Use pipe, not open.
16294 This fixes some permissions issues when debugging.
16295
16296 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
16297 If fchown fails to set both uid and gid, try to set just gid,
16298 as that is sometimes allowed. Adjust the file's mode to eliminate
16299 setuid or setgid bits that are inappropriate if fchown fails.
16300
16301 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
16302
16303 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
16304 to compare Lisp_Objects.
16305 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
16306 global_gnutls_log_level, don't mistake it for a Lisp_Object.
16307 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
16308
16309 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
16310
16311 * lread.c (read_integer): Unread even EOF character.
16312 (read1): Likewise. Properly record start position of symbol.
16313
16314 * lread.c (read1): Read `#:' as empty uninterned symbol if no
16315 symbol character follows.
16316
16317 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
16318
16319 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
16320 This works around a problem with the previous change to Fcopy_file.
16321 Recent glibc declares fchown with __attribute__((warn_unused_result)),
16322 and without this change, GCC might complain about discarding
16323 fchown's return value.
16324
16325 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
16326
16327 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
16328
16329 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
16330
16331 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
16332
16333 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
16334
16335 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
16336 it's used from the C level.
16337
16338 * process.c: Use the same condition for POLL_FOR_INPUT in both
16339 keyboard.c and process.c (bug#1858).
16340
16341 2011-07-09 Lawrence Mitchell <wence@gmx.li>
16342
16343 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
16344 (Fgnutls_boot): Use it.
16345
16346 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
16347
16348 * doc.c (Fsubstitute_command_keys): Revert last change.
16349
16350 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
16351
16352 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
16353 quotes the next character, and doesn't affect other longer
16354 sequences (bug#8935).
16355
16356 * lread.c (syms_of_lread): Clarify that is isn't only
16357 `eval-buffer' and `eval-defun' that's affected by
16358 `lexical-binding' (bug#8460).
16359
16360 2011-07-15 Eli Zaretskii <eliz@gnu.org>
16361
16362 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
16363 bidi redisplay when a line includes both an image and is truncated.
16364
16365 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
16366
16367 Fix minor problems found by static checking.
16368 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
16369 (elsz): Now a signed constant, not a size_t var. We prefer signed
16370 types to unsigned, to avoid integer comparison confusion. Without
16371 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
16372 "cannot optimize loop, the loop counter may overflow", a symptom
16373 of the confusion.
16374 * indent.c (Fvertical_motion): Mark locals as initialized.
16375 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
16376
16377 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16378
16379 * search.c (Fre_search_backward): Mention `case-fold-search' in
16380 all the re_search_* functions (bug#8138).
16381
16382 * keyboard.c (Fopen_dribble_file): Document when the file is
16383 closed (bug#8056).
16384
16385 2011-07-14 Eli Zaretskii <eliz@gnu.org>
16386
16387 * bidi.c (bidi_dump_cached_states): Fix format of displaying
16388 bidi_cache_idx.
16389
16390 Support bidi reordering of display and overlay strings.
16391 * xdisp.c (compute_display_string_pos)
16392 (compute_display_string_end): Accept additional argument STRING.
16393 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
16394 (reseat_to_string): Initialize bidi_it->string.s and
16395 bidi_it->string.schars.
16396 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
16397 NULL (avoids a crash in bidi_paragraph_init).
16398 Initialize itb.string.lstring.
16399 (init_iterator): Call bidi_init_it only of a valid
16400 buffer position was specified. Initialize paragraph_embedding to
16401 L2R.
16402 (reseat_to_string): Initialize the bidi iterator.
16403 (display_string): If we need to ignore text properties of
16404 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
16405 original value of -1 will not work with bidi.)
16406 (compute_display_string_pos): First arg is now struct
16407 `text_pos *'; all callers changed. Support display properties on
16408 Lisp strings.
16409 (compute_display_string_end): Support display properties on Lisp
16410 strings.
16411 (init_iterator, reseat_1, reseat_to_string): Initialize the
16412 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
16413 when iterating on a string not from display properties).
16414 (compute_display_string_pos, compute_display_string_end):
16415 Fix calculation of the object to scan. Fixes an error when using
16416 arrow keys.
16417 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
16418 base_level_stop; instead, set base_level_stop to BEGV.
16419 Fixes crashes in vertical-motion.
16420 (next_element_from_buffer): Improve commentary for when
16421 the iterator is before prev_stop.
16422 (init_iterator): Initialize bidi_p from the default value of
16423 bidi-display-reordering, not from buffer-local value. Use the
16424 buffer-local value only if initializing for buffer iteration.
16425 (handle_invisible_prop): Support invisible properties on strings
16426 that are being bidi-reordered.
16427 (set_iterator_to_next): Support bidi reordering of C strings and
16428 Lisp strings.
16429 (next_element_from_string): Support bidi reordering of Lisp
16430 strings.
16431 (handle_stop_backwards): Support Lisp strings as well.
16432 (display_string): Support display of R2L glyph rows.
16433 Use IT_STRING_CHARPOS when displaying from a Lisp string.
16434 (init_iterator): Don't initialize it->bidi_p for strings
16435 here.
16436 (reseat_to_string): Initialize it->bidi_p for strings here.
16437 (next_element_from_string, next_element_from_c_string)
16438 (next_element_from_buffer): Add xassert's for correspondence
16439 between IT's object being iterated and it->bidi_it.string
16440 structure.
16441 (face_before_or_after_it_pos): Support bidi iteration.
16442 (next_element_from_c_string): Handle the case of the first string
16443 character that is not the first one in the visual order.
16444 (get_visually_first_element): New function, refactored from common
16445 parts of next_element_from_buffer, next_element_from_string, and
16446 next_element_from_c_string.
16447 (tool_bar_lines_needed, redisplay_tool_bar)
16448 (display_menu_bar): Force left-to-right direction. Add a FIXME
16449 comment for making that be controlled by a user option.
16450 (push_it, pop_it): Save and restore the state of the
16451 bidi iterator. Save and restore the bidi_p flag.
16452 (pop_it): Iterate out of display property for string iteration as
16453 well.
16454 (iterate_out_of_display_property): Support iteration over strings.
16455 (handle_single_display_spec): Set up it->bidi_it for iteration
16456 over a display string, and call bidi_init_it.
16457 (handle_single_display_spec, next_overlay_string)
16458 (get_overlay_strings_1, push_display_prop): Set up the bidi
16459 iterator for displaying display or overlay strings.
16460 (forward_to_next_line_start): Don't use the shortcut if
16461 bidi-iterating.
16462 (back_to_previous_visible_line_start): If handle_display_prop
16463 pushed the iterator stack, restore the internal state of the bidi
16464 iterator by calling bidi_pop_it same number of times.
16465 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
16466 and we are bidi-iterating, don't decrement the iterator position;
16467 instead, set the first_elt flag in the bidi iterator, to produce
16468 the same effect.
16469 (reseat_1): Remove redundant setting of string_from_display_prop_p.
16470 (push_display_prop): xassert that we are iterating a buffer.
16471 (push_it, pop_it): Save and restore paragraph_embedding member.
16472 (handle_single_display_spec, next_overlay_string)
16473 (get_overlay_strings_1, reseat_1, reseat_to_string)
16474 (push_display_prop): Set up the `unibyte' member of bidi_it.string
16475 correctly. Don't assume unibyte strings are not bidi-reordered.
16476 (compute_display_string_pos)
16477 (compute_display_string_end): Fix handling the case of C string.
16478 (push_it, pop_it): Save and restore from_disp_prop_p.
16479 (handle_single_display_spec, push_display_prop): Set the
16480 from_disp_prop_p flag.
16481 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
16482 (pop_it): Call iterate_out_of_display_property only if we are
16483 popping after iteration over a string that came from a display
16484 property. Fix a typo in popping stretch info. Add an assertion
16485 for verifying that the iterator position is in sync with the bidi
16486 iterator.
16487 (handle_single_display_spec, get_overlay_strings_1)
16488 (push_display_prop): Fix initialization of paragraph direction for
16489 string when that of the parent object is not yet determined.
16490 (reseat_1): Call bidi_init_it to resync the bidi
16491 iterator with IT's position. (Bug#7616)
16492 (find_row_edges): If ROW->start.pos gives position
16493 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
16494 (handle_stop, back_to_previous_visible_line_start, reseat_1):
16495 Reset the from_disp_prop_p flag.
16496 (SAVE_IT, RESTORE_IT): New macros.
16497 (pos_visible_p, face_before_or_after_it_pos)
16498 (back_to_previous_visible_line_start)
16499 (move_it_in_display_line_to, move_it_in_display_line)
16500 (move_it_to, move_it_vertically_backward, move_it_by_lines)
16501 (try_scrolling, redisplay_window, display_line): Use them when
16502 saving a temporary copy of the iterator and restoring it back.
16503 (back_to_previous_visible_line_start, reseat_1)
16504 (init_iterator): Empty the bidi cache "stack".
16505 (move_it_in_display_line_to): If iterator ended up at
16506 EOL, but we never saw any buffer positions smaller than
16507 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
16508 motion in bidi-reordered lines.
16509 (move_it_in_display_line_to): Record prev_method and prev_pos
16510 immediately before the call to set_iterator_to_next. Fixes cursor
16511 motion in bidi-reordered lines with stretch glyphs and strings
16512 displayed in margins. (Bug#8133) (Bug#8867)
16513 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
16514 TO_CHARPOS.
16515 (pos_visible_p): Support positions in bidi-reordered lines.
16516 Save and restore bidi cache.
16517
16518 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
16519 (bidi_paragraph_info): Delete unused struct.
16520 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
16521 (bidi_cache_start): New variable.
16522 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
16523 to zero.
16524 (bidi_cache_fetch_state, bidi_cache_search)
16525 (bidi_cache_find_level_change, bidi_cache_iterator_state)
16526 (bidi_cache_find, bidi_peek_at_next_level)
16527 (bidi_level_of_next_char, bidi_find_other_level_edge)
16528 (bidi_move_to_visually_next): Compare cache index with
16529 bidi_cache_start rather than with zero.
16530 (bidi_fetch_char): Accept new argument STRING; all callers
16531 changed. Support iteration over a string. Support strings with
16532 display properties. Support unibyte strings. Fix the type of
16533 `len' according to what STRING_CHAR_AND_LENGTH expects.
16534 (bidi_paragraph_init, bidi_resolve_explicit_1)
16535 (bidi_resolve_explicit, bidi_resolve_weak)
16536 (bidi_level_of_next_char, bidi_move_to_visually_next):
16537 Support iteration over a string.
16538 (bidi_set_sor_type, bidi_resolve_explicit_1)
16539 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
16540 can now be zero (for strings); special values 0 and -1 were
16541 changed to -1 and -2, respectively.
16542 (bidi_char_at_pos): New function.
16543 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
16544 Call it instead of FETCH_MULTIBYTE_CHAR.
16545 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
16546 initialized to valid values.
16547 (bidi_init_it): Don't initialize charpos and bytepos with invalid
16548 values.
16549 (bidi_level_of_next_char): Allow the sentinel "position" to pass
16550 the test for valid cached positions. Fix the logic for looking up
16551 the sentinel state in the cache. GCPRO the Lisp string we are
16552 iterating.
16553 (bidi_push_it, bidi_pop_it): New functions.
16554 (bidi_initialize): Initialize the bidi cache start stack pointer.
16555 (bidi_cache_ensure_space): New function, refactored from part of
16556 bidi_cache_iterator_state. Don't assume the required size is just
16557 one BIDI_CACHE_CHUNK away.
16558 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
16559 (bidi_count_bytes, bidi_char_at_pos): New functions.
16560 (bidi_cache_search): Don't assume bidi_cache_last_idx is
16561 always valid if bidi_cache_idx is valid.
16562 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
16563 is valid if it's going to be used.
16564 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
16565 (bidi_cache_fetch_state, bidi_cache_search)
16566 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16567 (bidi_cache_iterator_state, bidi_cache_find)
16568 (bidi_find_other_level_edge, bidi_cache_start_stack):
16569 All variables related to cache indices are now EMACS_INT.
16570
16571 * dispextern.h (struct bidi_string_data): New structure.
16572 (struct bidi_it): New member `string'. Make flag members be 1-bit
16573 fields, and put them last in the struct.
16574 (compute_display_string_pos, compute_display_string_end):
16575 Update prototypes.
16576 (bidi_push_it, bidi_pop_it): Add prototypes.
16577 (struct iterator_stack_entry): New members bidi_p,
16578 paragraph_embedding, and from_disp_prop_p.
16579 (struct it): Member bidi_p is now a bit field 1 bit wide.
16580 (bidi_shelve_cache, bidi_unshelve_cache):
16581 Declare prototypes.
16582
16583 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
16584 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
16585 and vector-like objects.
16586
16587 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
16588 cache around display iteration.
16589
16590 * window.c (Fwindow_end, window_scroll_pixel_based)
16591 (displayed_window_lines, Frecenter): Save and restore the bidi
16592 cache around display iteration.
16593
16594 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16595
16596 * editfns.c (Fdelete_region): Clarify the use of the named
16597 parameters (bug#6788).
16598
16599 2011-07-14 Martin Rudalics <rudalics@gmx.at>
16600
16601 * indent.c (Fvertical_motion): Set and restore w->pointm when
16602 saving and restoring the window's buffer (Bug#9006).
16603
16604 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
16605
16606 * editfns.c (Fstring_to_char): Clarify just what is returned
16607 (bug#6576). Text by Eli Zaretskii.
16608
16609 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
16610
16611 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
16612
16613 2011-07-13 Eli Zaretskii <eliz@gnu.org>
16614
16615 * buffer.c (mmap_find): Fix a typo.
16616
16617 2011-07-13 Johan Bockgård <bojohan@gnu.org>
16618
16619 Fix execution of x selection hooks.
16620 * xselect.c (Qx_lost_selection_functions)
16621 (Qx_sent_selection_functions): New vars.
16622 (syms_of_xselect): DEFSYM them.
16623 (x_handle_selection_request): Pass Qx_sent_selection_functions
16624 rather than Vx_sent_selection_functions to Frun_hook_with_args.
16625 (x_handle_selection_clear,x_clear_frame_selections):
16626 Pass Qx_lost_selection_functions rather than
16627 Vx_lost_selection_functions to Frun_hook_with_args.
16628
16629 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
16630
16631 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
16632 The old code sometimes used this field without initializing it.
16633
16634 * alloc.c (gc_sweep): Don't read past end of array.
16635 In theory, the old code could also have corrupted Emacs internals,
16636 though it'd be very unlikely.
16637
16638 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
16639
16640 * character.c (Fcharacterp): Don't advertise optional ignored
16641 argument. (Bug#4026)
16642
16643 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
16644
16645 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
16646 key" (bug#4257).
16647
16648 * window.c (Fset_window_start): Doc fix (bug#4199).
16649 (Fset_window_hscroll): Ditto.
16650
16651 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
16652
16653 Fix minor new problems caught by GCC 4.6.1.
16654 * term.c (init_tty): Remove unused local.
16655 * xsettings.c (store_monospaced_changed): Define this function only
16656 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
16657 not used otherwise.
16658
16659 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
16660
16661 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
16662
16663 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16664
16665 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
16666 are the mini-buffer and the echo area (bug#3320).
16667
16668 * term.c (init_tty): Remove support for supdup, c10 and perq
16669 terminals, which are no longer supported (bug#1482).
16670
16671 2011-07-10 Johan Bockgård <bojohan@gnu.org>
16672
16673 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
16674
16675 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
16676
16677 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
16678 for non-popups (Bug#3642).
16679
16680 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
16681
16682 * alloc.c (reset_malloc_hooks): Protoize.
16683 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
16684 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
16685 * cm.c (losecursor): Likewise.
16686 * data.c (fmod): Likewise.
16687 * dispnew.c (swap_glyphs_in_rows): Likewise.
16688 * emacs.c (memory_warning_signal): Likewise.
16689 * floatfns.c (float_error): Likewise.
16690 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
16691 (otf_open, font_otf_capability, generate_otf_features)
16692 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
16693 Likewise.
16694 * image.c (pbm_read_file): Likewise.
16695 * indent.c (string_display_width): Likewise.
16696 * intervals.c (check_for_interval, search_for_interval)
16697 (inc_interval_count, count_intervals, root_interval)
16698 (adjust_intervals_for_insertion, make_new_interval): Likewise.
16699 * lread.c (defalias): Likewise.
16700 * ralloc.c (r_alloc_check): Likewise.
16701 * regex.c (set_image_of_range_1, set_image_of_range)
16702 (regex_grow_registers): Likewise.
16703 * sysdep.c (strerror): Likewise.
16704 * termcap.c (valid_filename_p, tprint, main): Likewise.
16705 * tparam.c (main): Likewise.
16706 * unexhp9k800.c (run_time_remap, save_data_space)
16707 (update_file_ptrs, read_header, write_header, calculate_checksum)
16708 (copy_file, copy_rest, display_header): Likewise.
16709 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
16710 Likewise.
16711 * xdisp.c (check_it): Likewise.
16712 * xfaces.c (register_color, unregister_color, unregister_colors):
16713 Likewise.
16714 * xfns.c (print_fontset_result): Likewise.
16715 * xrdb.c (member, fatal, main): Likewise.
16716
16717 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
16718
16719 Fix minor problems found by static checking (Bug#9031).
16720 * chartab.c (char_table_set_range, map_sub_char_table):
16721 Remove unused locals.
16722 (uniprop_table): Now static.
16723 * composite.c (_work_char): Remove unused static var.
16724
16725 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
16726
16727 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
16728
16729 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
16730
16731 * gtkutil.c (qttip_cb): Remove code without function.
16732
16733 2011-07-09 Eli Zaretskii <eliz@gnu.org>
16734
16735 * w32.c (pthread_sigmask): New stub.
16736
16737 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
16738
16739 Use pthread_sigmask, not sigprocmask (Bug#9010).
16740 sigprocmask is portable only for single-threaded applications, and
16741 Emacs can be multi-threaded when it uses GTK.
16742 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
16743 (LIBES): Use it.
16744 * callproc.c (Fcall_process):
16745 * process.c (create_process):
16746 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
16747 Use pthread_sigmask, not sigprocmask.
16748
16749 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16750
16751 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
16752 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
16753 wrong (Bug#8591).
16754
16755 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16756
16757 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
16758 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
16759 (xg_hide_tooltip): Fix comment.
16760
16761 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
16762 in registerServicesMenuSendTypes.
16763 (validRequestorForSendType): Don't check ns_return_types.
16764
16765 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
16766 ns_return_type.
16767
16768 2011-07-08 Jason Rumney <jasonr@gnu.org>
16769
16770 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
16771 SH_SHOW for hidden windows (Bug#5482).
16772
16773 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
16774 frame struct members of non-existent frames (Bug#6284).
16775
16776 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16777
16778 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
16779 variable firstTime not needed on OSX >= 10.6.
16780 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
16781 >= 10.5. Use setKnobProportion, setDoubleValue.
16782
16783 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
16784 (MAC_OS_X_VERSION_10_5): Define if not defined.
16785 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
16786 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
16787 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
16788
16789 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
16790 cString and lossyCString on OSX >= 10.4.
16791
16792 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
16793 sizeToFit on OSX >= 10.2.
16794
16795 * nsimage.m (allocInitFromFile): Don't use deprecated method
16796 bestRepresentationForDevice on OSX >= 10.6.
16797
16798 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
16799 to avoid warning.
16800
16801 * emacs.c: Declare unexec_init_emacs_zone.
16802
16803 * nsgui.h: Fix compiler warning about gnulib redefining verify.
16804
16805 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
16806
16807 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
16808 on svcsMenu (Bug#8842).
16809
16810 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
16811 ns_return_types.
16812 (Fns_list_services): Just return Qnil on 10.6, code not working there.
16813
16814 * nsterm.m (QUTF8_STRING): Declare.
16815 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
16816 (validRequestorForSendType): Return type is (id).
16817 Change indexOfObjectIdenticalTo to indexOfObject.
16818 Check if we have local selection before returning self (Bug#8842).
16819 (writeSelectionToPasteboard): Put local selection into paste board
16820 if we have a local selection (Bug#8842).
16821 (syms_of_nsterm): DEFSYM QUTF8_STRING.
16822
16823 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
16824 (ns_get_local_selection): Declare.
16825
16826 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
16827
16828 * keymap.c (describe_map_tree): Don't insert a double newline at
16829 the end of the buffer (bug#1169) and return whether we inserted
16830 something.
16831
16832 * callint.c (Fcall_interactively): Change "reading args" to
16833 "providing args" to try to clarify what it does (bug#1010).
16834
16835 2011-07-07 Kenichi Handa <handa@m17n.org>
16836
16837 * composite.c (composition_compute_stop_pos): Ignore a static
16838 composition starting before CHARPOS (Bug#8915).
16839
16840 * xdisp.c (handle_composition_prop): Likewise.
16841
16842 2011-07-07 Eli Zaretskii <eliz@gnu.org>
16843
16844 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
16845 (Bug#9015)
16846
16847 2011-07-07 Kenichi Handa <handa@m17n.org>
16848
16849 * character.h (unicode_category_t): New enum type.
16850
16851 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
16852 (Qchar_code_property_table): New variable.
16853 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
16854 (UNIPROP_COMPRESSED_FORM_P): New macros.
16855 (char_table_ascii): Uncompress the compressed values.
16856 (sub_char_table_ref): New arg is_uniprop. Callers changed.
16857 Uncompress the compressed values.
16858 (sub_char_table_ref_and_range): Likewise.
16859 (char_table_ref_and_range): Uncompress the compressed values.
16860 (sub_char_table_set): New arg is_uniprop. Callers changed.
16861 Uncompress the compressed values.
16862 (sub_char_table_set_range): Args changed. Callers changed.
16863 (char_table_set_range): Adjuted for the above change.
16864 (map_sub_char_table): Delete args default_val and parent. Add arg
16865 top. Give decoded values to a Lisp function.
16866 (map_char_table): Adjust for the above change. Give decoded
16867 values to a Lisp function. Gcpro more variables.
16868 (uniprop_table_uncompress)
16869 (uniprop_decode_value_run_length): New functions.
16870 (uniprop_decoder, uniprop_decoder_count): New variables.
16871 (uniprop_get_decoder, uniprop_encode_value_character)
16872 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
16873 New functions.
16874 (uniprop_encoder, uniprop_encoder_count): New variables.
16875 (uniprop_get_encoder, uniprop_table)
16876 (Funicode_property_table_internal, Fget_unicode_property_internal)
16877 (Fput_unicode_property_internal): New functions.
16878 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
16879 Sunicode_property_table_internal, Sget_unicode_property_internal,
16880 and Sput_unicode_property_internal. Defvar_lisp
16881 char-code-property-alist.
16882
16883 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
16884 Vunicode_category_table.
16885
16886 * font.c (font_range): Adjust for the change of
16887 Vunicode_category_table.
16888
16889 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
16890
16891 * m/iris4d.h: Remove file, move contents ...
16892 * s/irix6-5.h: ... here.
16893
16894 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
16895
16896 Remove unportable assumption about struct layout (Bug#8884).
16897 * alloc.c (mark_buffer):
16898 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
16899 (clone_per_buffer_values): Don't assume that
16900 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
16901 This isn't true in general, and it's particularly not true
16902 if Emacs is configured with --with-wide-int.
16903 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
16904 New macros, used in the buffer.c change.
16905
16906 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
16907
16908 * xsettings.c: Use both GConf and GSettings if both are available.
16909 (store_config_changed_event): Add comment.
16910 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
16911 (store_tool_bar_style_changed): New functions.
16912 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
16913 (struct xsettings): Move font inside HAVE_XFT.
16914 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
16915 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
16916 Move inside HAVE_XFT.
16917 (something_changed_gsettingsCB): Rename from something_changedCB.
16918 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
16919 also.
16920 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
16921 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
16922 (something_changed_gconfCB): Rename from something_changedCB.
16923 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
16924 (parse_settings): Move check for font inside HAVE_XFT.
16925 (read_settings, apply_xft_settings): Add comment.
16926 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
16927 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
16928 call store_font_name_changed.
16929 (xft_settings_event): Add comment.
16930 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
16931 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
16932 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
16933 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
16934 (xsettings_initialize): Call init_gsettings last.
16935 (xsettings_get_system_font, xsettings_get_system_normal_font):
16936 Add comment.
16937
16938 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
16939
16940 Random fixes. E.g., (random) never returned negative values.
16941 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
16942 subseconds part to the entropy, as that's a bit more random.
16943 Prefer signed to unsigned, since the signedness doesn't matter and
16944 in general we prefer signed. When given a limit, use a
16945 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
16946 latter isn't right if USE_2_TAGS_FOR_INTS.
16947 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
16948 not 0..VALMASK. Don't discard "excess" bits that random () returns.
16949
16950 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
16951
16952 * textprop.c (text_property_stickiness):
16953 Obey Vtext_property_default_nonsticky.
16954 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
16955 * w32fns.c (syms_of_w32fns):
16956 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
16957
16958 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16959
16960 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
16961 This is more efficient than Ffile_directory_p and avoids a minor race.
16962
16963 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
16964
16965 * buffer.c (Foverlay_put): Say what the return value is
16966 (bug#7835).
16967
16968 * fileio.c (barf_or_query_if_file_exists): Check first if the file
16969 is a directory before asking whether to use the file name
16970 (bug#7564).
16971 (barf_or_query_if_file_exists): Make the "File is a directory"
16972 error be more correct.
16973
16974 * fns.c (Frequire): Remove the mention of the .gz files, since
16975 that's installation-specific, but keep the mention of
16976 `get-load-suffixes'.
16977
16978 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16979
16980 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
16981 Report string overflow if the output is too long.
16982
16983 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
16984
16985 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
16986 (syms_of_gnutls): Remove duplicate DEFSYM for
16987 Qgnutls_bootprop_verify_hostname_error, an error for
16988 Qgnutls_bootprop_verify_error (which is no longer used).
16989
16990 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
16991 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
16992 Also (re)move comments that are misplaced or no longer relevant.
16993
16994 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16995
16996 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
16997
16998 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
16999
17000 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17001 and background color parameters if they have been changed.
17002
17003 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17004
17005 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17006
17007 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17008
17009 * xsettings.c (SYSTEM_FONT): Define only when used.
17010 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17011
17012 * keymap.c (access_keymap_1): Now static.
17013
17014 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
17015
17016 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17017 leave any prefix arg for the up event (Bug#1586).
17018
17019 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17020
17021 * lread.c (syms_of_lread): Mention single symbols defined by
17022 `defvar' or `defconst' (bug#7154).
17023
17024 * fns.c (Frequire): Mention .el.gz files (bug#7314).
17025 (Frequire): Mention get-load-suffixes.
17026
17027 2011-07-02 Martin Rudalics <rudalics@gmx.at>
17028
17029 * window.h (window): Remove clone_number slot.
17030 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17031 Remove.
17032 (make_parent_window, make_window, saved_window)
17033 (Fset_window_configuration, save_window_save): Don't deal with
17034 clone numbers.
17035 * buffer.c (Qclone_number): Remove declaration.
17036 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17037
17038 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17039
17040 Add multiple inheritance to keymaps.
17041 * keymap.c (Fmake_composed_keymap): New function.
17042 (Fset_keymap_parent): Simplify.
17043 (fix_submap_inheritance): Remove.
17044 (access_keymap_1): New function extracted from access_keymap to handle
17045 embedded parents and handle lists of maps.
17046 (access_keymap): Use it.
17047 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17048 (Fcopy_keymap): Handle embedded parents.
17049 (Fcommand_remapping, define_as_prefix): Simplify.
17050 (Fkey_binding): Simplify.
17051 (syms_of_keymap): Move minibuffer-local-completion-map,
17052 minibuffer-local-filename-completion-map,
17053 minibuffer-local-must-match-map, and
17054 minibuffer-local-filename-must-match-map to Elisp.
17055 (syms_of_keymap): Defsubr make-composed-keymap.
17056 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17057 (parse_menu_item): Trivial simplification.
17058
17059 2011-07-01 Glenn Morris <rgm@gnu.org>
17060
17061 * Makefile.in (SETTINGS_LIBS): Fix typo.
17062
17063 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
17064
17065 * coding.c (Fencode_coding_string): Record the last coding system
17066 used, as the function doc string says (bug#8738).
17067
17068 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17069
17070 * xsettings.c (store_monospaced_changed): Take new font as arg and
17071 check for change against current_mono_font.
17072 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17073 (emacs_settings_constructor, emacs_settings_get_property)
17074 (emacs_settings_set_property, emacs_settings_class_init)
17075 (emacs_settings_init, gsettings_obj): Remove.
17076 (something_changedCB): New function for HAVE_GSETTINGS.
17077 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17078 with value as argument.
17079 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17080 g_settings_new (Bug#8967). Do not create gsettings_obj.
17081 Remove calls to g_settings_bind. Connect something_changedCB to
17082 "changed".
17083
17084 * xgselect.c: Add defined (HAVE_GSETTINGS).
17085 (xgselect_initialize): Ditto.
17086
17087 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17088 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17089 xg_select.
17090
17091 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17092
17093 * eval.c (struct backtrace): Simplify and port the data structure.
17094 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17095 signed bit field, as this assumption is not portable and it makes
17096 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17097 "char debug_on_exit : 1" as this is not portable either; instead,
17098 use the portable "unsigned int debug_on_exit : 1". Remove unused
17099 member evalargs. Remove obsolete comments about cc bombing out.
17100
17101 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17102
17103 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
17104 Let HAVE_GSETTINGS override HAVE_GCONF.
17105 (store_monospaced_changed): New function.
17106 (EMACS_SETTINGS): A new type derived from GObject to handle
17107 GSettings notifications.
17108 (emacs_settings_constructor, emacs_settings_get_property)
17109 (emacs_settings_set_property, emacs_settings_class_init):
17110 New functions.
17111 (gsettings_client, gsettings_obj): New variables.
17112 (GSETTINGS_SCHEMA): New define.
17113 (something_changedCB): Call store_monospaced_changed.
17114 (init_gsettings): New function.
17115 (xsettings_initialize): Call init_gsettings.
17116 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17117 to NULL.
17118
17119 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
17120 GCONF_CFLAGS/LIBS.
17121
17122 2011-06-29 Martin Rudalics <rudalics@gmx.at>
17123
17124 * window.c (resize_root_window, grow_mini_window)
17125 (shrink_mini_window): Rename Qresize_root_window to
17126 Qwindow_resize_root_window and Qresize_root_window_vertically to
17127 Qwindow_resize_root_window_vertically.
17128
17129 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17130
17131 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17132
17133 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
17134
17135 * makefile.w32-in: Redesign dependencies so they reflect more
17136 clearly which files are directly included by each source file,
17137 and not through other includes.
17138
17139 2011-06-27 Martin Rudalics <rudalics@gmx.at>
17140
17141 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17142 (sort_overlays, overlay_strings): When an overlay's clone number
17143 matches the window's clone number process the overlay even if
17144 the overlay's window property doesn't match the current window.
17145
17146 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17147 (Fwindow_hchild): Rename to Fwindow_left_child.
17148 (Fwindow_next): Rename to Fwindow_next_sibling.
17149 (Fwindow_prev): Rename to Fwindow_prev_sibling.
17150 (resize_window_check): Rename to window_resize_check.
17151 (resize_window_apply): Rename to window_resize_apply.
17152 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17153 (Fdelete_other_windows_internal, resize_frame_windows)
17154 (Fsplit_window_internal, Fdelete_window_internal)
17155 (grow_mini_window, shrink_mini_window)
17156 (Fresize_mini_window_internal): Fix callers accordingly.
17157
17158 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17159
17160 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17161 (emacs_fixed_set_min_size): Remove.
17162 (emacs_fixed_new): Take frame as argument.
17163
17164 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17165 (_EmacsFixedPrivate): Remove minwidth/height.
17166 Add struct frame *f.
17167 (emacs_fixed_init): Initialize priv->f.
17168 (get_parent_class, emacs_fixed_set_min_size): Remove.
17169 (emacs_fixed_new): Set priv->f to argument.
17170 (emacs_fixed_get_preferred_width)
17171 (emacs_fixed_get_preferred_height): Use min_width/height from
17172 frames size_hint to set minimum and natural (Bug#8919).
17173 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17174 and use min_width/height from frames size_hint to set
17175 min_width/height (Bug#8919).
17176
17177 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
17178 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17179 Fix indentation.
17180
17181 2011-06-26 Eli Zaretskii <eliz@gnu.org>
17182
17183 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17184 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17185 called at ZV.
17186
17187 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
17188
17189 * process.c (wait_reading_process_output): Bypass select if
17190 waiting for a cell while ignoring keyboard input, and input is
17191 pending. Suggested by Jan Djärv (Bug#8869).
17192
17193 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17194
17195 Use gnulib's dup2 module instead of rolling our own.
17196 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17197
17198 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17199
17200 * dispnew.c (scrolling_window): Before scrolling, turn off a
17201 mouse-highlight in the window being scrolled.
17202
17203 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
17204
17205 Move DEFSYM to lisp.h and use everywhere.
17206
17207 * character.h (DEFSYM): Move declaration...
17208 * lisp.h (DEFSYM): ...here.
17209
17210 * gnutls.c:
17211 * minibuf.c:
17212 * w32menu.c:
17213 * w32proc.c:
17214 * w32select.c: Don't include character.h.
17215
17216 * alloc.c (syms_of_alloc):
17217 * buffer.c (syms_of_buffer):
17218 * bytecode.c (syms_of_bytecode):
17219 * callint.c (syms_of_callint):
17220 * casefiddle.c (syms_of_casefiddle):
17221 * casetab.c (init_casetab_once):
17222 * category.c (init_category_once, syms_of_category):
17223 * ccl.c (syms_of_ccl):
17224 * cmds.c (syms_of_cmds):
17225 * composite.c (syms_of_composite):
17226 * dbusbind.c (syms_of_dbusbind):
17227 * dired.c (syms_of_dired):
17228 * dispnew.c (syms_of_display):
17229 * doc.c (syms_of_doc):
17230 * editfns.c (syms_of_editfns):
17231 * emacs.c (syms_of_emacs):
17232 * eval.c (syms_of_eval):
17233 * fileio.c (syms_of_fileio):
17234 * fns.c (syms_of_fns):
17235 * frame.c (syms_of_frame):
17236 * fringe.c (syms_of_fringe):
17237 * insdel.c (syms_of_insdel):
17238 * keymap.c (syms_of_keymap):
17239 * lread.c (init_obarray, syms_of_lread):
17240 * macros.c (syms_of_macros):
17241 * msdos.c (syms_of_msdos):
17242 * print.c (syms_of_print):
17243 * process.c (syms_of_process):
17244 * search.c (syms_of_search):
17245 * sound.c (syms_of_sound):
17246 * syntax.c (init_syntax_once, syms_of_syntax):
17247 * terminal.c (syms_of_terminal):
17248 * textprop.c (syms_of_textprop):
17249 * undo.c (syms_of_undo):
17250 * w32.c (globals_of_w32):
17251 * window.c (syms_of_window):
17252 * xdisp.c (syms_of_xdisp):
17253 * xfaces.c (syms_of_xfaces):
17254 * xfns.c (syms_of_xfns):
17255 * xmenu.c (syms_of_xmenu):
17256 * xsettings.c (syms_of_xsettings):
17257 * xterm.c (syms_of_xterm): Use DEFSYM.
17258
17259 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
17260
17261 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
17262
17263 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
17264
17265 Integer and buffer overflow fixes (Bug#8873).
17266
17267 * print.c (printchar, strout): Check for string overflow.
17268 (PRINTPREPARE, printchar, strout):
17269 Don't set size unless allocation succeeds.
17270
17271 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
17272 for sizes. Check for string overflow more accurately.
17273 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
17274
17275 * macros.c: Integer and buffer overflow fixes.
17276 * keyboard.h (struct keyboard.kbd_macro_bufsize):
17277 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
17278 Use ptrdiff_t, not int, for sizes.
17279 Don't increment bufsize until after realloc succeeds.
17280 Check for size-calculation overflow.
17281 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
17282
17283 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
17284
17285 * lread.c: Integer overflow fixes.
17286 (read_integer): Radix is now EMACS_INT, not int,
17287 to improve quality of diagnostics for out-of-range radices.
17288 Calculate buffer size correctly for out-of-range radices.
17289 (read1): Check for integer overflow in radices, and in
17290 read-circle numbers.
17291 (read_escape): Avoid int overflow.
17292 (Fload, openp, read_buffer_size, read1)
17293 (substitute_object_recurse, read_vector, read_list, map_obarray):
17294 Use ptrdiff_t, not int, for sizes.
17295 (read1): Use EMACS_INT, not int, for sizes.
17296 Check for size overflow.
17297
17298 * image.c (cache_image): Check for size arithmetic overflow.
17299
17300 * lread.c: Integer overflow issues.
17301 (saved_doc_string_size, saved_doc_string_length)
17302 (prev_saved_doc_string_size, prev_saved_doc_string_length):
17303 Now ptrdiff_t, not int.
17304 (read1): Don't assume doc string length fits in int. Check for
17305 out-of-range doc string lengths.
17306 (read_list): Don't assume file position fits in int.
17307 (read_escape): Check for hex character overflow.
17308
17309 2011-06-22 Leo Liu <sdl.web@gmail.com>
17310
17311 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
17312 Move to minibuffer.el.
17313
17314 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17315
17316 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
17317 The following patches are for when GLYPH_DEBUG && !XASSERT.
17318 * dispextern.h (trace_redisplay_p, dump_glyph_string):
17319 * dispnew.c (flush_stdout):
17320 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
17321 Mark as externally visible.
17322 * dispnew.c (check_window_matrix_pointers): Now static.
17323 * dispnew.c (window_to_frame_vpos):
17324 * xfns.c (unwind_create_frame):
17325 * xterm.c (x_check_font): Remove unused local.
17326 * scroll.c (CHECK_BOUNDS):
17327 * xfaces.c (cache_fache): Rename local to avoid shadowing.
17328 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
17329 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
17330 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
17331 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
17332 Now static.
17333 (debug_method_add): Use va_list and vsprintf rather than relying
17334 on undefined behavior with wrong number of arguments.
17335 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
17336 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
17337 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
17338 since we're not interested in debugging glyphs with old libraries.
17339 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
17340 GCC 4.6.0's static checking.
17341
17342 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17343
17344 Integer overflow and signedness fixes (Bug#8873).
17345 A few related buffer overrun fixes, too.
17346
17347 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
17348
17349 * dispextern.h (struct face.stipple):
17350 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
17351 (x_bitmap_mask, x_allocate_bitmap_record)
17352 (x_create_bitmap_from_data, x_create_bitmap_from_file)
17353 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
17354 (x_create_bitmap_from_xpm_data):
17355 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
17356 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
17357 (.bitmaps_last):
17358 * xfaces.c (load_pixmap):
17359 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
17360 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
17361 (.bitmaps_last, struct x_output.icon_bitmap):
17362 Use ptrdiff_t, not int, for bitmap indexes.
17363 (x_allocate_bitmap_record): Check for size overflow.
17364 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
17365
17366 Use ptrdiff_t, not int, for overlay counts.
17367 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
17368 * editfns.c (overlays_around, get_pos_property):
17369 * textprop.c (get_char_property_and_overlay):
17370 * xdisp.c (next_overlay_change, note_mouse_highlight):
17371 * xfaces.c (face_at_buffer_position):
17372 * buffer.c (OVERLAY_COUNT_MAX): New macro.
17373 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
17374 (Fnext_overlay_change, Fprevious_overlay_change)
17375 (mouse_face_overlay_overlaps, Foverlays_in):
17376 Use ptrdiff_t, not int, for sizes.
17377 (overlays_at, overlays_in): Check for size-calculation overflow.
17378
17379 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
17380
17381 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
17382 (x_session_initialize): Do not assume string length fits in int.
17383
17384 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
17385 This is unlikely, but can occur if DPI is outlandish.
17386
17387 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
17388 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
17389
17390 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
17391 * xrdb.c (magic_file_p, search_magic_path):
17392 Omit last arg SUFFIX; it was always 0. All callers changed.
17393 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
17394
17395 * xfont.c (xfont_match): Avoid need for strlen.
17396
17397 * xfns.c: Don't assume strlen fits in int.
17398 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
17399
17400 * xdisp.c (message_log_check_duplicate): Return intmax_t,
17401 not unsigned long, as we prefer signed integers. All callers changed.
17402 Detect integer overflow in repeat count.
17403 (message_dolog): Don't assume print length fits in 39 bytes.
17404 (display_mode_element): Don't assume strlen fits in int.
17405
17406 * termcap.c: Don't assume sizes fit in int and never overflow.
17407 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
17408 (gobble_line): Check for size-calculation overflow.
17409
17410 * minibuf.c (Fread_buffer):
17411 * lread.c (intern, intern_c_string):
17412 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
17413 Don't assume string length fits in int.
17414
17415 * keyboard.c (parse_tool_bar_item):
17416 * gtkutil.c (style_changed_cb): Avoid need for strlen.
17417
17418 * font.c: Don't assume string length fits in int.
17419 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
17420 Use ptrdiff_t, not int.
17421 (font_intern_prop): Don't assume string length fits in int.
17422 Don't assume integer property fits in fixnum.
17423 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
17424
17425 * filelock.c: Fix some buffer overrun and integer overflow issues.
17426 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
17427 Reformulate so as not to need the command string.
17428 Invoke gzip -cd rather than gunzip, as it's more portable.
17429 (lock_info_type, lock_file_1, lock_file):
17430 Don't assume pid_t and time_t fit in unsigned long.
17431 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
17432 (current_lock_owner): Prefer signed type for sizes.
17433 Use memcpy, not strncpy, where memcpy is what is really wanted.
17434 Don't assume (via atoi) that time_t and pid_t fit in int.
17435 Check for time_t and/or pid_t out of range, e.g., via a network share.
17436 Don't alloca where an auto var works fine.
17437
17438 * fileio.c: Fix some integer overflow issues.
17439 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
17440 Don't assume string length fits in int.
17441 (directory_file_name): Don't assume string length fits in long.
17442 (make_temp_name): Don't assume pid fits in int, or that its print
17443 length is less than 20.
17444
17445 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
17446
17447 * coding.c (make_subsidiaries): Don't assume string length fits in int.
17448
17449 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
17450
17451 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
17452 We prefer signed integers, even for size calculations.
17453
17454 * emacs.c: Don't assume string length fits in 'int'.
17455 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
17456 (main): Don't invoke strlen when not needed.
17457
17458 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
17459 (XD_DEBUG_MESSAGE): Don't waste a byte.
17460
17461 * callproc.c (getenv_internal_1, getenv_internal)
17462 (Fgetenv_internal):
17463 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
17464
17465 * lread.c (invalid_syntax): Omit length argument.
17466 All uses changed. This doesn't fix a bug, but it simplifies the
17467 code away from its former Hollerith-constant appearance, and it's
17468 one less 'int' to worry about when looking at integer-overflow issues.
17469 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
17470
17471 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
17472 This didn't break anything, but it didn't help either.
17473 It's confusing to put a bogus integer in a place where the actual
17474 value does not matter.
17475 (LIST_END_P): Remove unused macro and its bogus comment.
17476 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
17477
17478 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
17479 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
17480 implementation.
17481 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
17482 We prefer signed types, and the value cannot exceed the EMACS_INT
17483 range anyway (because otherwise the length would not be representable).
17484 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
17485 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
17486 This avoids a GCC warning when WIDE_EMACS_INT.
17487
17488 * indent.c (sane_tab_width): New function.
17489 (current_column, scan_for_column, Findent_to, position_indentation)
17490 (compute_motion): Use it. This is just for clarity.
17491 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
17492
17493 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
17494
17495 * lisp.h (lint_assume): New macro.
17496 * composite.c (composition_gstring_put_cache):
17497 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
17498
17499 * editfns.c, insdel.c:
17500 Omit unnecessary forward decls, to simplify future changes.
17501
17502 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
17503
17504 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
17505
17506 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
17507 Use much-faster test for byte-length change.
17508 Don't assume string byte-length fits in 'int'.
17509 Check that character arg fits in 'int'.
17510 (mapcar1): Declare byte as byte, for clarity.
17511
17512 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
17513
17514 * fns.c (concat): Catch string overflow earlier.
17515 Do not rely on integer wraparound.
17516
17517 * dispextern.h (struct it.overlay_strings_charpos)
17518 (struct it.selective): Now EMACS_INT, not int.
17519 * xdisp.c (forward_to_next_line_start)
17520 (back_to_previous_visible_line_start)
17521 (reseat_at_next_visible_line_start, next_element_from_buffer):
17522 Don't arbitrarily truncate the value of 'selective' to int.
17523
17524 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
17525
17526 * composite.c: Don't truncate sizes to 'int'.
17527 (composition_gstring_p, composition_reseat_it)
17528 (composition_adjust_point): Use EMACS_INT, not int.
17529 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
17530 not EMACS_UINT, for indexes.
17531
17532 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
17533
17534 * buffer.c: Include <verify.h>.
17535 (struct sortvec.priority, struct sortstr.priority):
17536 Now EMACS_INT, not int.
17537 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
17538 (struct sortstr.size, record_overlay_string)
17539 (struct sortstrlist.size, struct sortlist.used):
17540 Don't truncate size to int.
17541 (record_overlay_string): Check for size-calculation overflow.
17542 (init_buffer_once): Check at compile-time, not run-time.
17543
17544 2011-06-22 Jim Meyering <meyering@redhat.com>
17545
17546 Don't leak an XBM-image-sized buffer
17547 * image.c (xbm_load): Free the image buffer after using it.
17548
17549 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
17550
17551 Port to Sun C.
17552 * composite.c (find_automatic_composition): Omit needless 'return 0;'
17553 that Sun C diagnosed.
17554 * fns.c (secure_hash): Fix pointer signedness issue.
17555 * intervals.c (static_offset_intervals): New function.
17556 (offset_intervals): Use it.
17557
17558 2011-06-21 Leo Liu <sdl.web@gmail.com>
17559
17560 * deps.mk (fns.o):
17561 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
17562 sha512.h.
17563
17564 * fns.c (secure_hash): Rename from crypto_hash_function and change
17565 the first arg to accept symbols.
17566 (Fsecure_hash): New primitive.
17567 (syms_of_fns): New symbols.
17568
17569 2011-06-20 Deniz Dogan <deniz@dogan.se>
17570
17571 * process.c (Fset_process_buffer): Clarify return value in
17572 docstring.
17573
17574 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
17575
17576 * dispnew.c (add_window_display_history): Use BVAR.
17577
17578 * xdisp.c (debug_method_add): Use BVAR.
17579 (check_window_end, dump_glyph_matrix, dump_glyph)
17580 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
17581
17582 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
17583 Likewise.
17584
17585 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
17586 check till after the cache is created in init_frame_faces.
17587
17588 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
17589
17590 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
17591
17592 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
17593
17594 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
17595 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
17596 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
17597
17598 Improve buffer-overflow checking (Bug#8873).
17599 * fileio.c (Finsert_file_contents):
17600 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
17601 Remove the old (too-loose) buffer overflow checks.
17602 They weren't needed, since make_gap checks for buffer overflow.
17603 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
17604 The old code merely checked for Emacs fixnum overflow, and relied
17605 on undefined (wraparound) behavior. The new code avoids undefined
17606 behavior, and also checks for ptrdiff_t and/or size_t overflow.
17607
17608 * editfns.c (Finsert_char): Don't dump core with very negative counts.
17609 Tune. Don't use wider integers than needed. Don't use alloca.
17610 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
17611
17612 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
17613
17614 * insdel.c, lisp.h (buffer_overflow): New function.
17615 (insert_from_buffer_1, replace_range, replace_range_2):
17616 * insdel.c (make_gap_larger):
17617 * editfns.c (Finsert_char):
17618 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
17619
17620 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
17621
17622 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
17623
17624 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
17625
17626 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
17627 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
17628
17629 * fileio.c: Don't assume EMACS_INT fits in off_t.
17630 (emacs_lseek): New static function.
17631 (Finsert_file_contents, Fwrite_region): Use it.
17632 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
17633
17634 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
17635
17636 * fns.c: Don't overflow int when computing a list length.
17637 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
17638 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
17639 truncation on 64-bit hosts. Check for QUIT every
17640 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
17641 faster and is responsive enough.
17642 (Flength): Report an error instead of overflowing an integer.
17643 (Fsafe_length): Return a float if the value is not representable
17644 as a fixnum. This shouldn't happen except in contrived situations.
17645 (Fnthcdr, Fsort): Don't assume list length fits in int.
17646 (Fcopy_sequence): Don't assume vector length fits in int.
17647
17648 * alloc.c: Check that resized vectors' lengths fit in fixnums.
17649 (header_size, word_size): New constants.
17650 (allocate_vectorlike): Don't check size overflow here.
17651 (allocate_vector): Check it here instead, since this is the only
17652 caller of allocate_vectorlike that could cause overflow.
17653 Check that the new vector's length is representable as a fixnum.
17654
17655 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
17656 The previous code was bogus. For example, next_almost_prime (32)
17657 returned 39, which is undesirable as it is a multiple of 3; and
17658 next_almost_prime (24) returned 25, which is a multiple of 5 so
17659 why was the code bothering to check for multiples of 7?
17660
17661 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
17662
17663 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
17664
17665 Variadic C functions now count arguments with ptrdiff_t.
17666 This partly undoes my 2011-03-30 change, which replaced int with size_t.
17667 Back then I didn't know that the Emacs coding style prefers signed int.
17668 Also, in the meantime I found a few more instances where arguments
17669 were being counted with int, which may truncate counts on 64-bit
17670 machines, or EMACS_INT, which may be unnecessarily wide.
17671 * lisp.h (struct Lisp_Subr.function.aMANY)
17672 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
17673 Arg counts are now ptrdiff_t, not size_t.
17674 All variadic functions and their callers changed accordingly.
17675 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
17676 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
17677 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
17678 * callint.c (Fcall_interactively): Check arg count for overflow,
17679 to avoid potential buffer overrun. Use signed char, not 'int',
17680 for 'varies' array, so that we needn't bother to check its size
17681 calculation for overflow.
17682 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
17683 * eval.c (apply_lambda):
17684 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
17685 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
17686 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
17687
17688 * callint.c (Fcall_interactively): Don't use index var as event count.
17689
17690 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
17691 * mem-limits.h (SIZE): Remove; no longer used.
17692
17693 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
17694
17695 Remove unnecessary casts.
17696 * xterm.c (x_term_init):
17697 * xfns.c (x_set_border_pixel):
17698 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
17699 These aren't needed now that we assume ANSI C.
17700
17701 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
17702 It's more likely to cause problems (due to unsigned overflow)
17703 than to cure them.
17704
17705 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
17706
17707 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
17708
17709 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
17710
17711 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
17712
17713 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
17714
17715 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
17716
17717 GLYPH_CODE_FACE returns EMACS_INT, not int.
17718 * dispextern.h (merge_faces):
17719 * xfaces.c (merge_faces):
17720 * xdisp.c (get_next_display_element, next_element_from_display_vector):
17721 Don't assume EMACS_INT fits in int.
17722
17723 * character.h (CHAR_VALID_P): Remove unused parameter.
17724 * fontset.c, lisp.h, xdisp.c: All uses changed.
17725
17726 * editfns.c (Ftranslate_region_internal): Omit redundant test.
17727
17728 * fns.c (concat): Minor tuning based on overflow analysis.
17729 This doesn't fix any bugs. Use int to hold character, instead
17730 of constantly refetching from Emacs object. Use XFASTINT, not
17731 XINT, for value known to be a character. Don't bother comparing
17732 a single byte to 0400, as it's always less.
17733
17734 * floatfns.c (Fexpt):
17735 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
17736
17737 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
17738 for characters.
17739
17740 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
17741
17742 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
17743 Without this fix, on a 64-bit host (aset S 0 4294967386) would
17744 incorrectly succeed when S was a string, because 4294967386 was
17745 truncated before it was used.
17746
17747 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
17748 Otherwise, an out-of-range integer could cause undefined behavior
17749 on a 64-bit host.
17750
17751 * composite.c: Use int, not EMACS_INT, for characters.
17752 (fill_gstring_body, composition_compute_stop_pos): Use int, not
17753 EMACS_INT, for values that are known to be in character range.
17754 This doesn't fix any bugs but is the usual style inside Emacs and
17755 may generate better code on 32-bit machines.
17756
17757 Make sure a 64-bit char is never passed to ENCODE_CHAR.
17758 This is for reasons similar to the recent CHAR_STRING fix.
17759 * charset.c (Fencode_char): Check that character arg is actually
17760 a character. Pass an int to ENCODE_CHAR.
17761 * charset.h (ENCODE_CHAR): Verify that the character argument is no
17762 wider than 'int', as a compile-time check to prevent future regressions
17763 in this area.
17764
17765 * character.c (char_string): Remove unnecessary casts.
17766
17767 Make sure a 64-bit char is never passed to CHAR_STRING.
17768 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
17769 by silently ignoring the top 32 bits, allowing some values
17770 that were far too large to be valid characters.
17771 * character.h: Include <verify.h>.
17772 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
17773 arguments are no wider than unsigned, as a compile-time check
17774 to prevent future regressions in this area.
17775 * data.c (Faset):
17776 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
17777 (Fsubst_char_in_region):
17778 * fns.c (concat):
17779 * xdisp.c (decode_mode_spec_coding):
17780 Adjust to CHAR_STRING's new requirement.
17781 * editfns.c (Finsert_char, Fsubst_char_in_region):
17782 * fns.c (concat): Check that character args are actually
17783 characters. Without this test, these functions did the wrong
17784 thing with wildly out-of-range values on 64-bit hosts.
17785
17786 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
17787 These casts should not be needed on 32-bit hosts, either.
17788 * keyboard.c (read_char):
17789 * lread.c (Fload): Remove casts to unsigned.
17790
17791 * lisp.h (UNSIGNED_CMP): New macro.
17792 This fixes comparison bugs on 64-bit hosts.
17793 (ASCII_CHAR_P): Use it.
17794 * casefiddle.c (casify_object):
17795 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
17796 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
17797 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
17798 * dispextern.h (FACE_FROM_ID):
17799 * keyboard.c (read_char): Use UNSIGNED_CMP.
17800
17801 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
17802 not to EMACS_INT, to avoid GCC warning.
17803
17804 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
17805
17806 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
17807 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
17808 isn't needed on 32-bit machines.
17809
17810 * buffer.c (Fgenerate_new_buffer_name):
17811 Use EMACS_INT for count, not int.
17812 (advance_to_char_boundary): Return EMACS_INT, not int.
17813
17814 * data.c (Qcompiled_function): Now static.
17815
17816 * window.c (window_body_lines): Now static.
17817
17818 * image.c (gif_load): Rename local to avoid shadowing.
17819
17820 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
17821 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
17822 * alloc.c (make_save_value): Integer argument is now of type
17823 ptrdiff_t, not int.
17824 (mark_object): Use ptrdiff_t, not int.
17825 * lisp.h (pD): New macro.
17826 * print.c (print_object): Use it.
17827
17828 * alloc.c: Use EMACS_INT, not int, to count objects.
17829 (total_conses, total_markers, total_symbols, total_vector_size)
17830 (total_free_conses, total_free_markers, total_free_symbols)
17831 (total_free_floats, total_floats, total_free_intervals)
17832 (total_intervals, total_strings, total_free_strings):
17833 Now EMACS_INT, not int. All uses changed.
17834 (Fgarbage_collect): Compute overall total using a double, so that
17835 integer overflow is less likely to be a problem. Check for overflow
17836 when converting back to an integer.
17837 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
17838 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
17839 These were 'int' variables that could overflow on 64-bit hosts;
17840 they were never used, so remove them instead of repairing them.
17841 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
17842 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
17843 Previously, this ceilinged at INT_MAX, but that doesn't work on
17844 64-bit machines.
17845 (allocate_pseudovector): Don't use EMACS_INT when int would do.
17846
17847 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
17848 (allocate_vectorlike): Check for ptrdiff_t overflow.
17849 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
17850 when a (possibly-narrower) signed value would do just as well.
17851 We prefer using signed arithmetic, to avoid comparison confusion.
17852
17853 * alloc.c: Catch some string size overflows that we were missing.
17854 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
17855 for convenience in STRING_BYTES_MAX.
17856 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
17857 The definition here is exact; the one in lisp.h was approximate.
17858 (allocate_string_data): Check for string overflow. This catches
17859 some instances we weren't catching before. Also, it catches
17860 size_t overflow on (unusual) hosts where SIZE_MAX <= min
17861 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
17862 and ptrdiff_t and EMACS_INT are both 64 bits.
17863
17864 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
17865 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
17866 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
17867
17868 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
17869
17870 * alloc.c (Fmake_string): Check for out-of-range init.
17871
17872 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
17873
17874 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
17875
17876 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
17877
17878 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
17879 xg_get_default_scrollbar_width.
17880
17881 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
17882 (int_gtk_range_get_value): Move to the scroll bar part of the file.
17883 (style_changed_cb): Call update_theme_scrollbar_width and call
17884 x_set_scroll_bar_default_width and xg_frame_set_char_size for
17885 all frames (Bug#8505).
17886 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
17887 Call gtk_window_set_resizable if HAVE_GTK3.
17888 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
17889 and height if HAVE_GTK3 (Bug#8505).
17890 (scroll_bar_width_for_theme): New variable.
17891 (update_theme_scrollbar_width): New function.
17892 (xg_get_default_scrollbar_width): Move code to
17893 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
17894 (xg_initialize): Call update_theme_scrollbar_width.
17895
17896 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
17897
17898 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
17899
17900 2011-06-12 Martin Rudalics <rudalics@gmx.at>
17901
17902 * frame.c (make_frame): Call other_buffer_safely instead of
17903 other_buffer.
17904
17905 * window.c (temp_output_buffer_show): Call display_buffer with
17906 second argument Vtemp_buffer_show_specifiers and reset latter
17907 immediately after the call.
17908 (Vtemp_buffer_show_specifiers): New variable.
17909 (auto_window_vscroll_p, next_screen_context_lines)
17910 (Vscroll_preserve_screen_position): Remove leading asterisks from
17911 doc-strings.
17912
17913 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
17914
17915 Fix minor problems found by GCC 4.6.0 static checking.
17916 * buffer.c (Qclone_number): Remove for now, as it's unused.
17917 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
17918 (record_buffer): Remove unused local.
17919 * frame.c (other_visible_frames, frame_buffer_list): Now static.
17920 (set_frame_buffer_list): Remove; unused.
17921 * frame.h (other_visible_frames): Remove decl.
17922 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
17923 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
17924 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
17925 if HAVE_GPM.
17926 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
17927 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
17928 Define only if HAVE_GPM.
17929 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
17930 (update_hints_inhibit): Remove; never set. All uses removed.
17931 * widgetprv.h (emacsFrameClassRec): Remove decl.
17932 * window.c (delete_deletable_window): Now returns void, since it
17933 wasn't returning anything.
17934 (compare_window_configurations): Remove unused locals.
17935 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
17936 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
17937 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
17938 the same widths as pointers. This follows up on the 2011-05-06 patch.
17939 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
17940 * xterm.h: Likewise.
17941 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
17942
17943 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
17944
17945 * makefile.w32-in: Update dependencies.
17946 (LISP_H): Add lib/intprops.h.
17947
17948 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
17949
17950 * image.c (gif_load): Add animation frame delay to the metadata.
17951 (syms_of_image): Use DEFSYM. New symbol `delay'.
17952
17953 2011-06-11 Martin Rudalics <rudalics@gmx.at>
17954
17955 * window.c (delete_deletable_window): Re-add.
17956 (Fset_window_configuration): Rewrite to handle dead buffers and
17957 consequently deletable windows.
17958 (window_tree, Fwindow_tree): Remove. Supply functionality in
17959 window.el.
17960 (compare_window_configurations): Simplify code.
17961
17962 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
17963
17964 * image.c (imagemagick_load_image): Fix type mismatch.
17965 (Fimagemagick_types): Likewise.
17966
17967 * window.h (replace_buffer_in_windows): Declare.
17968
17969 2011-06-11 Martin Rudalics <rudalics@gmx.at>
17970
17971 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
17972 Qclone_number. Remove external declaration of Qdelete_window.
17973 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
17974 code.
17975 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
17976 Run Qbuffer_list_update_hook if allowed.
17977 (Fother_buffer): Rewrite doc-string. Major rewrite for new
17978 buffer list implementation.
17979 (other_buffer_safely): New function.
17980 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
17981 calls to replace_buffer_in_windows and
17982 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
17983 if allowed.
17984 (record_buffer): Inhibit quitting and rewrite using quittable
17985 functions. Run Qbuffer_list_update_hook if allowed.
17986 (Frecord_buffer, Funrecord_buffer): New functions.
17987 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
17988 Move switch-to-buffer to window.el.
17989 (bury-buffer): Move to window.el.
17990 (Vbuffer_list_update_hook): New variable.
17991
17992 * lisp.h (other_buffer_safely): Add prototype in buffer.c
17993 section.
17994
17995 * window.h (resize_frame_windows): Move up in code.
17996 (Fwindow_frame): Remove EXFUN.
17997 (replace_buffer_in_all_windows): Remove prototype.
17998 (replace_buffer_in_windows_safely): Add prototype.
17999
18000 * window.c: Declare Qdelete_window static again. Move down
18001 declaration of select_count.
18002 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18003 (Fother_window): Move to window.el.
18004 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18005 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18006 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18007 window.el.
18008 (replace_buffer_in_windows): Implement by calling
18009 Qreplace_buffer_in_windows.
18010 (replace_buffer_in_all_windows): Remove with some functionality
18011 moved into replace_buffer_in_windows_safely.
18012 (replace_buffer_in_windows_safely): New function.
18013 (select_window_norecord, select_frame_norecord): Move in front
18014 of run_window_configuration_change_hook. Remove now obsolete
18015 declarations.
18016 (Fset_window_buffer): Rewrite doc-string.
18017 Call Qrecord_window_buffer.
18018 (keys_of_window): Move binding for other-window to window.el.
18019
18020 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
18021
18022 * dispextern.h (struct image): Replace data member, whose int_val
18023 and ptr_val fields were not used by anything, with a single
18024 lisp_val object.
18025
18026 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18027 (gif_clear_image, gif_load, imagemagick_load_image)
18028 (gs_clear_image, gs_load): Callers changed.
18029
18030 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18031
18032 * buffer.h: Include <time.h>, for time_t.
18033 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18034
18035 Fix minor problems found by static checking.
18036
18037 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18038
18039 Make identifiers static if they are not used in other modules.
18040 * data.c (Qcompiled_function, Qframe, Qvector):
18041 * image.c (QimageMagick, Qsvg):
18042 * minibuf.c (Qmetadata):
18043 * window.c (resize_window_check, resize_root_window): Now static.
18044 * window.h (resize_window_check, resize_root_window): Remove decls.
18045
18046 * window.c (window_deletion_count, delete_deletable_window):
18047 Remove; unused.
18048 (window_body_lines): Now static.
18049 (Fdelete_other_windows_internal): Mark vars as initialized.
18050 Make sure 'resize_failed' is initialized.
18051 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18052 (resize_window_apply): Remove unused local.
18053 * window.h (delete_deletable_window): Remove decl.
18054
18055 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
18056 (imagemagick_load_image): Fix pointer signedness problem by changing
18057 last arg from unsigned char * to char *. All uses changed.
18058 Also, fix a local for similar reasons.
18059 Remove unused locals. Remove locals to avoid shadowing.
18060 (fn_rsvg_handle_free): Remove; unused.
18061 (svg_load, svg_load_image): Fix pointer signedness problem.
18062 (imagemagick_load_image): Don't use garbage pointer image_wand.
18063
18064 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18065
18066 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
18067
18068 * image.c (gif_load): Fix omitted cast error introduced by
18069 2011-06-06 change.
18070
18071 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18072
18073 * window.h (resize_proportionally, orig_total_lines)
18074 (orig_top_line): Remove from window structure.
18075 (set_window_height, set_window_width, change_window_heights)
18076 (Fdelete_window): Remove prototypes.
18077 (resize_frame_windows): Remove duplicate declaration.
18078
18079 2011-06-10 Eli Zaretskii <eliz@gnu.org>
18080
18081 * window.h (resize_frame_windows, resize_window_check)
18082 (delete_deletable_window, resize_root_window)
18083 (resize_frame_windows): Declare prototypes.
18084
18085 * window.c (resize_window_apply): Make definition be "static" to
18086 match the prototype.
18087
18088 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18089
18090 * window.c: Remove declarations of Qwindow_size_fixed,
18091 window_min_size_1, window_min_size_2, window_min_size,
18092 size_window, window_fixed_size_p, enlarge_window, delete_window.
18093 Remove static from declaration of Qdelete_window, it's
18094 temporarily needed by Fbury_buffer.
18095 (replace_window): Don't assign orig_top_line and
18096 orig_total_lines.
18097 (Fdelete_window, delete_window): Remove. Window deletion is
18098 handled by window.el.
18099 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18100 Replace Fdelete_window calls with calls to Qdelete_window.
18101 (Fdelete_other_windows): Remove. Deleting other windows is
18102 handled by window.el.
18103 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18104 handled in window.el.
18105 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18106 Window minimum sizes are handled in window.el.
18107 (shrink_windows, size_window, set_window_height)
18108 (set_window_width, change_window_heights, window_height)
18109 (window_width, CURBEG, CURSIZE, enlarge_window)
18110 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18111 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18112 handled in window.el.
18113 (make_dummy_parent): Rename to make_parent_window and give it a
18114 second argument horflag.
18115 (make_window): Don't set resize_proportionally any more.
18116 (Fsplit_window): Remove. Windows are split in window.el.
18117 (save_restore_action, save_restore_orig_size)
18118 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18119 Resize mini windows in window.el.
18120 (grow_mini_window, shrink_mini_window): Implement by calling
18121 Qresize_root_window_vertically, resize_window_check and
18122 resize_window_apply.
18123 (saved_window, Fset_window_configuration, save_window_save):
18124 Do not handle orig_top_line, orig_total_lines, and
18125 resize_proportionally.
18126 (window_min_height, window_min_width): Move to window.el.
18127 (keys_of_window): Move bindings for delete-other-windows,
18128 split-window, delete-window and enlarge-window to window.el.
18129
18130 * buffer.c: Temporarily extern Qdelete_window.
18131 (Fbury_buffer): Temporarily call Qdelete_window instead of
18132 Fdelete_window (Fbury_buffer will move to window.el soon).
18133
18134 * frame.c (set_menu_bar_lines_1): Remove code handling
18135 orig_top_line and orig_total_lines.
18136
18137 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18138 set_window_height but set heights directly.
18139 (change_frame_size_1): Use resize_frame_windows.
18140
18141 * xdisp.c (init_xdisp): Don't use set_window_height but set
18142 heights directly.
18143
18144 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18145 Use resize_frame_windows instead of change_window_heights and run
18146 run_window_configuration_change_hook.
18147
18148 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18149 instead of change_window_heights and run
18150 run_window_configuration_change_hook.
18151
18152 2011-06-09 Martin Rudalics <rudalics@gmx.at>
18153
18154 * window.c (replace_window): Rename second argument REPLACEMENT to
18155 NEW. New third argument SETFLAG. Rewrite.
18156 (delete_window, make_dummy_parent): Call replace_window with
18157 third argument 1.
18158 (window_list_1): Move down in code.
18159 (run_window_configuration_change_hook): Move set_buffer part
18160 before select_frame_norecord part in order to unwind correctly.
18161 Rename count1 to count.
18162 (recombine_windows, delete_deletable_window, resize_root_window)
18163 (Fdelete_other_windows_internal)
18164 (Frun_window_configuration_change_hook, make_parent_window)
18165 (resize_window_check, resize_window_apply, Fresize_window_apply)
18166 (resize_frame_windows, Fsplit_window_internal)
18167 (Fdelete_window_internal, Fresize_mini_window_internal):
18168 New functions.
18169 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18170
18171 2011-06-08 Martin Rudalics <rudalics@gmx.at>
18172
18173 * window.h (window): Add some new members to window structure -
18174 normal_lines, normal_cols, new_total, new_normal, clone_number,
18175 splits, nest, prev_buffers, next_buffers.
18176 (WINDOW_TOTAL_SIZE): Move here from window.c.
18177 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
18178
18179 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18180 Remove.
18181 (make_dummy_parent): Set new members of windows structure.
18182 (make_window): Move down in code. Handle new members of window
18183 structure.
18184 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18185 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18186 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18187 (Fset_window_prev_buffers, Fwindow_next_buffers)
18188 (Fset_window_next_buffers, Fset_window_clone_number):
18189 New functions.
18190 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18191 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18192 Doc-string fixes.
18193 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18194 Argument WINDOW can be now internal window too.
18195 (Fwindow_use_time): Move up in code.
18196 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18197 Rewrite doc-string.
18198 (Fset_window_configuration, saved_window)
18199 (Fcurrent_window_configuration, save_window_save): Handle new
18200 members of window structure.
18201 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18202 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18203 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18204 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18205 Qget_mru_window, Qresize_root_window,
18206 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18207 Qauto_buffer_name; staticpro them.
18208
18209 2011-06-07 Martin Rudalics <rudalics@gmx.at>
18210
18211 * window.c (Fwindow_total_size, Fwindow_left_column)
18212 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18213 (Fwindow_list_1): New functions.
18214 (window_box_text_cols): Replace with window_body_cols.
18215 (Fwindow_width, Fscroll_left, Fscroll_right):
18216 Use window_body_cols instead of window_box_text_cols.
18217 (delete_window, Fset_window_configuration):
18218 Call delete_all_subwindows with window as argument.
18219 (delete_all_subwindows): Take a window as argument and not a
18220 structure. Rewrite.
18221 (window_loop): Remove handling of GET_LRU_WINDOW and
18222 GET_LARGEST_WINDOW.
18223 (Fget_lru_window, Fget_largest_window): Move to window.el.
18224
18225 * window.h: Extern window_body_cols instead of
18226 window_box_text_cols. delete_all_subwindows now takes a
18227 Lisp_Object as argument.
18228
18229 * indent.c (compute_motion, Fcompute_motion):
18230 Use window_body_cols instead of window_box_text_cols.
18231
18232 * frame.c (delete_frame): Call delete_all_subwindows with root
18233 window as argument.
18234
18235 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
18236
18237 * fns.c (Fputhash): Document return value.
18238
18239 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
18240
18241 * image.c (gif_load): Implement gif89a spec "no disposal" method.
18242
18243 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18244
18245 Cons<->int and similar integer overflow fixes (Bug#8794).
18246
18247 Check for overflow when converting integer to cons and back.
18248 * charset.c (Fdefine_charset_internal, Fdecode_char):
18249 Use cons_to_unsigned to catch overflow.
18250 (Fencode_char): Use INTEGER_TO_CONS.
18251 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
18252 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
18253 * data.c (long_to_cons, cons_to_long): Remove.
18254 (cons_to_unsigned, cons_to_signed): New functions.
18255 These signal an error for invalid or out-of-range values.
18256 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
18257 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
18258 * font.c (Ffont_variation_glyphs):
18259 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
18260 * lisp.h: Include <intprops.h>.
18261 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
18262 (cons_to_signed, cons_to_unsigned): New decls.
18263 (long_to_cons, cons_to_long): Remove decls.
18264 * undo.c (record_first_change): Use INTEGER_TO_CONS.
18265 (Fprimitive_undo): Use CONS_TO_INTEGER.
18266 * xfns.c (Fx_window_property): Likewise.
18267 * xselect.c: Include <limits.h>.
18268 (x_own_selection, selection_data_to_lisp_data):
18269 Use INTEGER_TO_CONS.
18270 (x_handle_selection_request, x_handle_selection_clear)
18271 (x_get_foreign_selection, Fx_disown_selection_internal)
18272 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
18273 (lisp_data_to_selection_data): Use cons_to_unsigned.
18274 (x_fill_property_data): Use cons_to_signed.
18275 Report values out of range.
18276
18277 Check for buffer and string overflow more precisely.
18278 * buffer.h (BUF_BYTES_MAX): New macro.
18279 * lisp.h (STRING_BYTES_MAX): New macro.
18280 * alloc.c (Fmake_string):
18281 * character.c (string_escape_byte8):
18282 * coding.c (coding_alloc_by_realloc):
18283 * doprnt.c (doprnt):
18284 * editfns.c (Fformat):
18285 * eval.c (verror):
18286 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
18287 since they may not be the same number.
18288 * editfns.c (Finsert_char):
18289 * fileio.c (Finsert_file_contents):
18290 Likewise for BUF_BYTES_MAX.
18291
18292 * image.c: Use ptrdiff_t, not int, for sizes.
18293 (slurp_file): Switch from int to ptrdiff_t.
18294 All uses changed.
18295 (slurp_file): Check that file size fits in both size_t (for
18296 malloc) and ptrdiff_t (for sanity and safety).
18297
18298 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
18299 if b->modtime has its maximal value.
18300
18301 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
18302
18303 Don't assume time_t can fit into int.
18304 * buffer.h (struct buffer.modtime): Now time_t, not int.
18305 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
18306 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
18307
18308 Minor fixes for signed vs unsigned integers.
18309 * character.h (MAYBE_UNIFY_CHAR):
18310 * charset.c (maybe_unify_char):
18311 * keyboard.c (read_char, reorder_modifiers):
18312 XINT -> XFASTINT, since the integer must be nonnegative.
18313 * ftfont.c (ftfont_spec_pattern):
18314 * keymap.c (access_keymap, silly_event_symbol_error):
18315 XUINT -> XFASTINT, since the integer must be nonnegative.
18316 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
18317 since it makes no difference and we prefer signed.
18318 * keyboard.c (record_char): Use XUINT when all the neighbors do.
18319 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
18320 nonnegative.
18321
18322 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
18323
18324 * window.h (Fwindow_frame): Declare.
18325
18326 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18327
18328 * alloc.c: Simplify handling of large-request failures (Bug#8800).
18329 (SPARE_MEMORY): Always define.
18330 (LARGE_REQUEST): Remove.
18331 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
18332
18333 2011-06-06 Martin Rudalics <rudalics@gmx.at>
18334
18335 * lisp.h: Move EXFUNS for Fframe_root_window,
18336 Fframe_first_window and Fset_frame_selected_window to window.h.
18337
18338 * window.h: Move EXFUNS for Fframe_root_window,
18339 Fframe_first_window and Fset_frame_selected_window here from
18340 lisp.h.
18341
18342 * frame.c (Fwindow_frame, Fframe_first_window)
18343 (Fframe_root_window, Fframe_selected_window)
18344 (Fset_frame_selected_window): Move to window.c.
18345 (Factive_minibuffer_window): Move to minibuf.c.
18346 (Fother_visible_frames_p): New function.
18347
18348 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
18349
18350 * window.c (decode_window, decode_any_window): Move up in code.
18351 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
18352 (inhibit_frame_unsplittable): Remove unused variable.
18353 (Fwindow_buffer): Move up and rewrite doc-string.
18354 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
18355 (Fwindow_prev): New functions.
18356 (Fwindow_frame): Move here from frame.c. Accept any window as
18357 argument.
18358 (Fframe_root_window, Fframe_first_window)
18359 (Fframe_selected_window): Move here from frame.c. Accept frame
18360 or arbitrary window as argument. Update doc-strings.
18361 (Fminibuffer_window): Move up in code.
18362 (Fwindow_minibuffer_p): Move up in code and simplify.
18363 (Fset_frame_selected_window): Move here from frame.c.
18364 Marginal rewrite.
18365 (Fselected_window, select_window, Fselect_window): Move up in
18366 code. Minor doc-string fixes.
18367
18368 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18369
18370 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
18371 Do not assume that spare memory exists; that assumption is valid
18372 only if SYSTEM_MALLOC.
18373 (LARGE_REQUEST): New macro, so that the issue of large requests
18374 is separated from the issue of spare memory.
18375
18376 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
18377
18378 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
18379 format. (Bug#8806)
18380
18381 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
18382
18383 * xfns.c (x_set_scroll_bar_default_width): Move declarations
18384 before statements.
18385
18386 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
18387
18388 * gtkutil.c (xg_get_default_scrollbar_width): New function.
18389
18390 * gtkutil.h: Declare xg_get_default_scrollbar_width.
18391
18392 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
18393 min width by calling x_set_scroll_bar_default_width (Bug#8505).
18394
18395 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
18396
18397 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
18398
18399 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
18400
18401 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
18402 (x_clipboard_manager_save): Add return value.
18403 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
18404 New error handlers.
18405 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
18406 Obey Vx_select_enable_clipboard_manager. Catch errors in
18407 x_clipboard_manager_save (Bug#8779).
18408 (Vx_select_enable_clipboard_manager): New variable.
18409 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
18410
18411 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
18412
18413 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
18414
18415 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18416
18417 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
18418 in the current matrix if keep_current_p is non-zero.
18419
18420 2011-06-04 Eli Zaretskii <eliz@gnu.org>
18421
18422 * bidi.c (bidi_level_of_next_char): Fix last change.
18423
18424 2011-06-03 Eli Zaretskii <eliz@gnu.org>
18425
18426 Support bidi reordering of text covered by display properties.
18427
18428 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
18429 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
18430 (bidi_cache_search, bidi_cache_iterator_state)
18431 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
18432 (bidi_level_of_next_char, bidi_move_to_visually_next):
18433 Support character positions inside a run of characters covered by a
18434 display string.
18435 (bidi_paragraph_init, bidi_resolve_explicit_1)
18436 (bidi_level_of_next_char): Call bidi_fetch_char and
18437 bidi_fetch_char_advance instead of FETCH_CHAR and
18438 FETCH_CHAR_ADVANCE.
18439 (bidi_init_it): Initialize new members.
18440 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
18441 definitions.
18442 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
18443 instead of using explicit *_CHAR codes.
18444 (bidi_resolve_explicit, bidi_resolve_weak):
18445 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
18446 bidirectional text is supported only in multibyte buffers.
18447 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
18448 it to initialize the frame_window_p member of struct bidi_it.
18449 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
18450 (bidi_resolve_explicit, bidi_resolve_weak)
18451 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
18452 bidi_it->nchars is non-positive.
18453 (bidi_level_of_next_char): Don't try to lookup the cache for the
18454 next/previous character if nothing is cached there yet, or if we
18455 were just reseat()'ed to a new position.
18456
18457 * xdisp.c (set_cursor_from_row): Set start and stop points
18458 according to the row's direction when priming the loop that looks
18459 for the glyph on which to display cursor.
18460 (single_display_spec_intangible_p): Function deleted.
18461 (display_prop_intangible_p): Reimplement to call
18462 handle_display_spec instead of single_display_spec_intangible_p.
18463 Accept 3 additional arguments needed by handle_display_spec.
18464 This fixes incorrect cursor motion across display property with complex
18465 values: lists, `(when COND...)' forms, etc.
18466 (single_display_spec_string_p): Support property values that are
18467 lists with the argument STRING its top-level element.
18468 (display_prop_string_p): Fix the condition for processing a
18469 property that is a list to be consistent with handle_display_spec.
18470 (handle_display_spec): New function, refactored from the
18471 last portion of handle_display_prop.
18472 (compute_display_string_pos): Accept additional argument
18473 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
18474 value of a `display' property is a "replacing spec".
18475 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
18476 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
18477 the display property, but just return a value indicating whether
18478 the display property will replace the characters it covers.
18479 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
18480 frame_window_p members of struct bidi_it.
18481 (compute_display_string_pos, compute_display_string_end):
18482 New functions.
18483 (push_it): Accept second argument POSITION, where pop_it should
18484 jump to continue iteration.
18485 (reseat_1): Initialize bidi_it.disp_pos.
18486
18487 * keyboard.c (adjust_point_for_property): Adjust the call to
18488 display_prop_intangible_p to its new signature.
18489
18490 * dispextern.h (struct bidi_it): New member frame_window_p.
18491 (bidi_init_it): Update prototypes.
18492 (display_prop_intangible_p): Update prototype.
18493 (compute_display_string_pos, compute_display_string_end):
18494 Declare prototypes.
18495 (struct bidi_it): New members nchars and disp_pos. ch_len is now
18496 EMACS_INT.
18497
18498 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
18499
18500 Malloc failure behavior now depends on size of allocation.
18501 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
18502 * lisp.h: Change signatures accordingly.
18503 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
18504 All callers changed. (Bug#8762)
18505
18506 * gnutls.c: Use Emacs's memory allocators.
18507 Without this change, the gnutls library would invoke malloc etc.
18508 directly, which causes problems on non-SYNC_INPUT hosts, and which
18509 runs afoul of improving memory_full behavior. (Bug#8761)
18510 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
18511 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
18512 xfree instead of the default malloc, realloc, free.
18513 (Fgnutls_boot): No need to check for memory allocation failure,
18514 since xmalloc does that for us.
18515
18516 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
18517 * category.c (hash_get_category_set):
18518 * ccl.c (ccl_driver):
18519 * charset.c (Fdefine_charset_internal):
18520 * charset.h (struct charset.hash_index):
18521 * composite.c (get_composition_id, gstring_lookup_cache)
18522 (composition_gstring_put_cache):
18523 * composite.h (struct composition.hash_index):
18524 * dispextern.h (struct image.hash):
18525 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
18526 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
18527 (hashfn_equal, hashfn_user_defined, make_hash_table)
18528 (maybe_resize_hash_table, hash_lookup, hash_put)
18529 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
18530 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
18531 (Fsxhash, Fgethash, Fputhash, Fmaphash):
18532 * image.c (make_image, search_image_cache, lookup_image)
18533 (xpm_put_color_table_h):
18534 * lisp.h (struct Lisp_Hash_Table):
18535 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
18536 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
18537 for hashes and hash indexes, instead of 'unsigned' and 'int'.
18538 * alloc.c (allocate_vectorlike):
18539 Check for overflow in vector size calculations.
18540 * ccl.c (ccl_driver):
18541 Check for overflow when converting EMACS_INT to int.
18542 * fns.c, image.c: Remove unnecessary static decls that would otherwise
18543 need to be updated by these changes.
18544 * fns.c (make_hash_table, maybe_resize_hash_table):
18545 Check for integer overflow with large hash tables.
18546 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
18547 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
18548 (SXHASH_REDUCE): New macro.
18549 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
18550 Use it instead of discarding useful hash info with large hash values.
18551 (sxhash_float): New function.
18552 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
18553 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
18554 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
18555 Rewrite to use FIXNUM_BITS, as this simplifies things.
18556 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
18557 Adjust signatures to match updated version of code.
18558 (consing_since_gc): Now EMACS_INT, since a single hash table can
18559 use more than INT_MAX bytes.
18560
18561 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
18562
18563 Make it possible to build with GCC-4.6+ -O2 -flto.
18564
18565 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
18566
18567 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
18568
18569 * minibuf.c (get_minibuffer, read_minibuf_unwind):
18570 Call minibuffer-inactive-mode.
18571
18572 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
18573
18574 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
18575 Update dependencies.
18576
18577 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18578
18579 * data.c (init_data): Remove code for UTS, this system is not
18580 supported anymore.
18581
18582 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18583
18584 Don't force ./temacs to start in terminal mode.
18585
18586 * frame.c (make_initial_frame): Initialize faces in all cases, not
18587 only when CANNOT_DUMP is defined.
18588 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
18589
18590 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18591
18592 * dispnew.c (add_window_display_history): Use const for the string
18593 pointer. Remove declaration, not needed.
18594
18595 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
18596
18597 Use 'inline', not 'INLINE'.
18598 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
18599 * alloc.c, fontset.c (INLINE): Remove.
18600 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
18601 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
18602 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
18603 * gmalloc.c (register_heapinfo): Use inline unconditionally.
18604 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
18605
18606 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18607
18608 Make it possible to run ./temacs.
18609
18610 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
18611 syms_of_callproc does the same thing. Remove test for
18612 "initialized", do it in the caller.
18613 * emacs.c (main): Avoid calling set_initial_environment when dumping.
18614
18615 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
18616
18617 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
18618 (read_minibuf): Use get_minibuffer.
18619 (syms_of_minibuf): Use DEFSYM.
18620 (Qmetadata): New var.
18621 * data.c (Qbuffer): Don't make it static.
18622 (syms_of_data): Use DEFSYM.
18623
18624 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
18625
18626 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
18627 (CCL_CODE_MIN): New macro.
18628
18629 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
18630
18631 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
18632
18633 * eval.c (Qdebug): Now static.
18634 * lisp.h (Qdebug): Remove decl. This reverts a part of the
18635 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
18636 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
18637
18638 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
18639
18640 * image.c: Various fixes to ImageMagick code comments.
18641 (Fimagemagick_types): Doc fix.
18642
18643 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
18644
18645 Minor fixes prompted by GCC 4.6.0 warnings.
18646
18647 * xselect.c (converted_selections, conversion_fail_tag): Now static.
18648
18649 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
18650 (x_clipboard_manager_save_all): Move extern decl to ...
18651 * xterm.h: ... here, so that it can be checked for consistency.
18652
18653 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
18654
18655 * xselect.c (x_clipboard_manager_save_frame)
18656 (x_clipboard_manager_save_all): New functions.
18657 (Fx_clipboard_manager_save): Lisp function deleted.
18658
18659 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
18660 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
18661
18662 * xterm.h: Update prototype.
18663
18664 2011-05-28 William Xu <william.xwl@gmail.com>
18665
18666 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
18667 exiting (Bug#8239).
18668
18669 2011-05-28 Jim Meyering <meyering@redhat.com>
18670
18671 Avoid a sign-extension bug in crypto_hash_function.
18672 * fns.c (to_uchar): Define.
18673 (crypto_hash_function): Use it to convert some newly-signed
18674 variables to unsigned, to avoid sign-extension bugs. For example,
18675 without this change, (md5 "truc") would evaluate to
18676 45723a2aff78ff4fff7fff1114760e62 rather than the expected
18677 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
18678 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
18679
18680 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18681
18682 Integer overflow fixes.
18683
18684 * dbusbind.c: Serial number integer overflow fixes.
18685 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
18686 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
18687 to hold a serial number that is too large for a fixnum.
18688 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18689 Check for serial numbers out of range. Decode any serial number
18690 that was so large that it became a float. (Bug#8722)
18691
18692 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
18693 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18694 Use XFASTINT rather than XUINT when numbers are nonnegative.
18695 (xd_append_arg, Fdbus_method_return_internal):
18696 (Fdbus_method_error_internal): Likewise. Also, for unsigned
18697 arguments, check that Lisp number is nonnegative, rather than
18698 silently wrapping negative numbers around. (Bug#8722)
18699 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
18700 (Bug#8722)
18701
18702 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
18703
18704 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
18705
18706 ccl: Add integer overflow checks.
18707 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
18708 (IN_INT_RANGE): New macros.
18709 (ccl_driver): Use them to check for integer overflow when
18710 decoding a CCL program. Many of the new checks are whether XINT (x)
18711 fits in int; it doesn't always, on 64-bit hosts. The new version
18712 doesn't catch all possible integer overflows, but it's an
18713 improvement. (Bug#8719)
18714
18715 * alloc.c (make_event_array): Use XINT, not XUINT.
18716 There's no need for unsigned here.
18717
18718 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
18719 This follows up to the 2011-05-06 change that substituted uintptr_t
18720 for EMACS_INT. This case wasn't caught back then.
18721
18722 Rework Fformat to avoid integer overflow issues.
18723 * editfns.c: Include <float.h> unconditionally, as it's everywhere
18724 now (part of C89). Include <verify.h>.
18725 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
18726 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
18727 (Fformat): Avoid the prepass trying to compute sizes; it was only
18728 approximate and thus did not catch overflow reliably. Instead, walk
18729 through the format just once, formatting and computing sizes as we go,
18730 checking for integer overflow at every step, and allocating a larger
18731 buffer as needed. Keep track separately whether the format is
18732 multibyte. Keep only the most-recently calculated precision, rather
18733 than them all. Record whether each argument has been converted to
18734 string. Use EMACS_INT, not int, for byte and char and arg counts.
18735 Support field widths and precisions larger than INT_MAX. Avoid
18736 sprintf's undefined behavior with conversion specifications such as %#d
18737 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
18738 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
18739 formatting out-of-range floating point numbers with int
18740 formats. (Bug#8668)
18741
18742 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
18743
18744 * data.c: Avoid integer truncation in expressions involving floats.
18745 * data.c: Include <intprops.h>.
18746 (arith_driver): When there's an integer overflow in an expression
18747 involving floating point, convert the integers to floating point
18748 so that the resulting value does not suffer from catastrophic
18749 integer truncation. For example, on a 64-bit host (* 4
18750 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
18751 Do not rely on undefined behavior after integer overflow.
18752
18753 merge count_size_as_multibyte, parse_str_to_multibyte
18754 * character.c, character.h (count_size_as_multibyte):
18755 Rename from parse_str_to_multibyte; all uses changed.
18756 Check for integer overflow.
18757 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
18758 since it's now a duplicate of the other. This is more of
18759 a character than a buffer op, so better that it's in character.c.
18760 * fns.c, print.c: Adjust to above changes.
18761
18762 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
18763
18764 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
18765
18766 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18767
18768 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18769 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
18770 (x_clipboard_manager_save): Now static.
18771 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
18772
18773 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18774 (crypto_hash_function): Now static.
18775 Fix pointer signedness problems. Avoid unnecessary initializations.
18776
18777 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
18778
18779 * termhooks.h (Vselection_alist): Make it terminal-local.
18780
18781 * terminal.c (create_terminal): Initialize it.
18782
18783 * xselect.c: Support for clipboard managers.
18784 (Vselection_alist): Move to termhooks.h as terminal-local var.
18785 (LOCAL_SELECTION): New macro.
18786 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
18787 (symbol_to_x_atom): Remove gratuitous arg.
18788 (x_handle_selection_request, lisp_data_to_selection_data)
18789 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
18790 (x_own_selection, x_get_local_selection, x_convert_selection):
18791 New arg, specifying work frame. Use terminal-local Vselection_alist.
18792 (some_frame_on_display): Delete unused function.
18793 (Fx_own_selection_internal, Fx_get_selection_internal)
18794 (Fx_disown_selection_internal, Fx_selection_owner_p)
18795 (Fx_selection_exists_p): New optional frame arg.
18796 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
18797 (x_handle_selection_clear): Don't treat other terminals with the
18798 same keyboard specially. Use the terminal-local Vselection_alist.
18799 (x_clear_frame_selections): Use Frun_hook_with_args.
18800
18801 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
18802
18803 * xterm.h: Add support for those atoms.
18804
18805 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
18806
18807 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
18808 (converted_selections, conversion_fail_tag): New global variables.
18809 (x_selection_request_lisp_error): Free the above.
18810 (x_get_local_selection): Remove unnecessary code.
18811 (x_reply_selection_request): Args changed; handle arbitrary array
18812 of converted selections stored in converted_selections.
18813 Separate the XChangeProperty and SelectionNotify steps.
18814 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
18815 (x_convert_selection): New function.
18816 (x_handle_selection_event): Simplify.
18817 (x_get_foreign_selection): Don't ignore incoming requests while
18818 waiting for an answer; this will fail when we implement
18819 SAVE_TARGETS, and seems unnecessary anyway.
18820 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
18821 (Vx_sent_selection_functions): Doc fix.
18822
18823 2011-05-26 Leo Liu <sdl.web@gmail.com>
18824
18825 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
18826
18827 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18828
18829 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
18830
18831 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
18832 for fringe update if it has periodic bitmap.
18833 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
18834 and fringe_bitmap_periodic_p.
18835
18836 * fringe.c (get_fringe_bitmap_data): New function.
18837 (draw_fringe_bitmap_1, update_window_fringes): Use it.
18838 (update_window_fringes): Record periodicity of fringe bitmap in glyph
18839 row. Mark glyph row for fringe update if periodicity changed.
18840
18841 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
18842 for fringe update unless it has periodic bitmap.
18843
18844 2011-05-25 Kenichi Handa <handa@m17n.org>
18845
18846 * xdisp.c (get_next_display_element): Set correct it->face_id for
18847 a static composition.
18848
18849 2011-05-24 Leo Liu <sdl.web@gmail.com>
18850
18851 * deps.mk (fns.o):
18852 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
18853
18854 * fns.c (crypto_hash_function, Fsha1): New function.
18855 (Fmd5): Use crypto_hash_function.
18856 (syms_of_fns): Add Ssha1.
18857
18858 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18859
18860 * gnutls.c: Remove unused macros.
18861 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
18862 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
18863 Remove macros that are defined and never used.
18864 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
18865
18866 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
18867
18868 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
18869 (Fx_get_selection_internal): Minor cleanup.
18870 (Fx_own_selection_internal): Rename arguments for consistency with
18871 select.el.
18872
18873 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18874
18875 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
18876
18877 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
18878
18879 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
18880
18881 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18882
18883 * dispnew.c (scrolling_window): Don't exclude the case that the
18884 last enabled row in the desired matrix touches the bottom boundary.
18885
18886 2011-05-21 Glenn Morris <rgm@gnu.org>
18887
18888 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
18889 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
18890 and add some more files.
18891
18892 2011-05-20 Eli Zaretskii <eliz@gnu.org>
18893
18894 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
18895 report_file_error introduced by the change from 2011-05-07.
18896
18897 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
18898
18899 * systime.h (Time): Define only if emacs is defined.
18900 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
18901 where the include path doesn't have X11/X.h by default. See
18902 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
18903
18904 2011-05-20 Kenichi Handa <handa@m17n.org>
18905
18906 * composite.c (find_automatic_composition): Fix previous change.
18907
18908 2011-05-20 Glenn Morris <rgm@gnu.org>
18909
18910 * lisp.mk: New file, split from Makefile.in.
18911 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
18912 (shortlisp): Remove.
18913 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
18914
18915 2011-05-19 Glenn Morris <rgm@gnu.org>
18916
18917 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
18918 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
18919 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
18920 (lisp): Set the order to that of loadup.el.
18921 (shortlisp): Make it a copy of $lisp.
18922 (SOME_MACHINE_LISP): Remove.
18923 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
18924 Use just $shortlisp, not $SOME_MACHINE_LISP too.
18925
18926 2011-05-18 Kenichi Handa <handa@m17n.org>
18927
18928 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
18929 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
18930 (find_automatic_composition): Mostly rewrite for efficiency.
18931
18932 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
18933
18934 * makefile.w32-in: Update dependencies.
18935
18936 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
18937
18938 * menu.c: Include limits.h (fixes the MS-Windows build broken by
18939 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
18940
18941 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
18942
18943 Fix some integer overflow issues, such as string length overflow.
18944
18945 * insdel.c (count_size_as_multibyte): Check for string overflow.
18946
18947 * character.c (lisp_string_width): Check for string overflow.
18948 Use EMACS_INT, not int, for string indexes and lengths; in
18949 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
18950 the resulting string length overflows an EMACS_INT; instead,
18951 report a string overflow if no precision given. When checking for
18952 precision exhaustion, use a check that cannot possibly have
18953 integer overflow. (Bug#8675)
18954 * character.h (lisp_string_width): Adjust to new signature.
18955
18956 * alloc.c (string_overflow): New function.
18957 (Fmake_string): Use it. This doesn't change behavior, but saves
18958 a few bytes and will simplify future changes.
18959 * character.c (string_escape_byte8): Likewise.
18960 * lisp.h (string_overflow): New decl.
18961
18962 Fixups, following up to the user-interface timestamp change.
18963 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
18964 for UI timestamps, instead of unsigned long.
18965 * msdos.c (mouse_get_pos): Likewise.
18966 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
18967 * w32gui.h (Time): Define by including "systime.h" rather than by
18968 declaring it ourselves. (Bug#8664)
18969
18970 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
18971 * image.c (clear_image_cache): Likewise.
18972
18973 * term.c (term_mouse_position): Don't assume time_t wraparound.
18974
18975 Be more systematic about user-interface timestamps.
18976 Before, the code sometimes used 'Time', sometimes 'unsigned long',
18977 and sometimes 'EMACS_UINT', to represent these timestamps.
18978 This change causes it to use 'Time' uniformly, as that's what X uses.
18979 This makes the code easier to follow, and makes it easier to catch
18980 integer overflow bugs such as Bug#8664.
18981 * frame.c (Fmouse_position, Fmouse_pixel_position):
18982 Use Time, not unsigned long, for user-interface timestamps.
18983 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
18984 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
18985 * keyboard.h (last_event_timestamp): Likewise.
18986 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
18987 * menu.h (xmenu_show): Likewise.
18988 * term.c (term_mouse_position): Likewise.
18989 * termhooks.h (struct input_event.timestamp): Likewise.
18990 (struct terminal.mouse_position_hook): Likewise.
18991 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
18992 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
18993 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
18994 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
18995 what it was before.
18996 * menu.h, termhooks.h: Include "systime.h", for Time.
18997
18998 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
18999 Don't assume that the difference between two unsigned long values
19000 can fit into an integer. At this point, we know button_down_time
19001 <= event->timestamp, so the difference must be nonnegative, so
19002 there's no need to cast the result if double-click-time is
19003 nonnegative, as it should be; check that it's nonnegative, just in
19004 case. This bug is triggered when events are more than 2**31 ms
19005 apart (about 25 days). (Bug#8664)
19006
19007 * xselect.c (last_event_timestamp): Remove duplicate decl.
19008 (x_own_selection): Remove needless cast to unsigned long.
19009
19010 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19011 that always fit in int. Use a sentinel instead of a counter, to
19012 avoid a temp and to allay GCC's concerns about possible int overflow.
19013 * frame.h (struct frame): Use int for menu_bar_items_used
19014 instead of EMACS_INT, since it always fits in int.
19015
19016 * menu.c (grow_menu_items): Check for int overflow.
19017
19018 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19019
19020 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19021 Before, the code was not consistent. These values cannot exceed
19022 2**31 - 1 so there's no need to make them unsigned.
19023 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19024 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19025 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19026 as modifiers.
19027 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19028
19029 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19030 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19031 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19032 presumably because the widths might not match.
19033
19034 * window.c (size_window): Avoid needless test at loop start.
19035
19036 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19037
19038 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19039
19040 2011-05-12 Drew Adams <drew.adams@oracle.com>
19041
19042 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19043
19044 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19045
19046 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19047 `width' to `bar_area_x' and `bar_area_width', respectively.
19048 (x_scroll_run): Take account of fringe background extension.
19049
19050 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19051 Rename local vars `left' and `width' to `bar_area_x' and
19052 `bar_area_width', respectively.
19053 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19054 background extension.
19055
19056 2011-05-10 Jim Meyering <meyering@redhat.com>
19057
19058 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19059
19060 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
19061
19062 * image.c (Finit_image_library): Return t for built-in image types,
19063 like pbm and xbm. (Bug#8640)
19064
19065 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19066
19067 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19068
19069 2011-05-07 Eli Zaretskii <eliz@gnu.org>
19070
19071 * w32console.c (Fset_screen_color): Doc fix.
19072 (Fget_screen_color): New function.
19073 (syms_of_ntterm): Defsubr it.
19074
19075 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19076 unlink the temporary file if Fcall_process didn't create it in the
19077 first place.
19078 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19079 child process will be redirected to a file specified with `:file'.
19080 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19081 cue to call_process_cleanup not to close that handle.
19082
19083 2011-05-07 Ben Key <bkey76@gmail.com>
19084
19085 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19086 one of two shell specific rules, either bootstrap-temacs-CMD or
19087 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19088 to the previous implementation of the bootstrap-temacs rule.
19089 The bootstrap-temacs-CMD rule is similar to the previous
19090 implementation of the bootstrap-temacs rule except that it
19091 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19092 variable.
19093
19094 These changes, along with some changes to nt/configure.bat,
19095 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19096 earlier fix to add support for --cflags and --ldflags options
19097 that include quotes so that it works whether make uses cmd or
19098 sh as the shell.
19099
19100 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
19101
19102 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19103 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19104 is a constant.
19105 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19106 a string. Handle both cases.
19107 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19108 (Fdbus_register_method): Use Qinvalid_function.
19109
19110 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
19111
19112 * makefile.w32-in: Update dependencies.
19113 (LISP_H): Add inttypes.h and stdin.h.
19114 (PROCESS_H): Add unistd.h.
19115
19116 2011-05-06 Eli Zaretskii <eliz@gnu.org>
19117
19118 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19119 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19120
19121 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
19122
19123 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19124
19125 * term.c (vfatal): Remove stray call to va_end.
19126 It's not needed and the C Standard doesn't allow it here anyway.
19127
19128 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19129 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19130
19131 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19132 bytes.
19133
19134 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19135
19136 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19137
19138 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19139
19140 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19141
19142 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19143
19144 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19145 * charset.c (Fdefine_charset_internal): Don't initialize
19146 charset.code_space[15]. The value was garbage, on hosts with
19147 32-bit int (Bug#8600).
19148
19149 * lread.c (read_integer): Be more consistent with string-to-number.
19150 Use string_to_number to do the actual conversion; this avoids
19151 rounding errors and fixes some other screwups. Without this fix,
19152 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19153 (digit_to_number): Move earlier, for benefit of read_integer.
19154 Return -1 if the digit is out of range for the base, -2 if it is
19155 not a digit in any supported base. (Bug#8602)
19156
19157 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19158
19159 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19160 to match comment at start of function. This also removes a
19161 GCC warning about overflow in a 32+64-bit port.
19162
19163 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19164
19165 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19166 Reported by Stefan Monnier in
19167 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
19168 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19169 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
19170
19171 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19172 (EMACS_UINTPTR): Likewise, with uintptr_t.
19173
19174 * lisp.h: Prefer 64-bit EMACS_INT if available.
19175 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19176 on 32-bit hosts that have 64-bit int, so that they can access
19177 large files.
19178 However, temporarily disable this change unless the temporary
19179 symbol WIDE_EMACS_INT is defined.
19180
19181 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19182
19183 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19184 This removes an assumption that EMACS_INT and long are the same
19185 width as pointers. The assumption is true for Emacs porting targets
19186 now, but we want to make other targets possible.
19187 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19188 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19189 In the rest of the code, change types of integers that hold casted
19190 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19191 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19192 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19193 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19194 No need to cast type when ORing.
19195 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19196 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19197 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19198 assume EMACS_INT is the same width as char *.
19199 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19200 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19201 Remove no-longer-needed casts.
19202 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19203 (xg_tool_bar_help_callback, xg_make_tool_item):
19204 Use EMACS_INTPTR to hold an integer
19205 that will be cast to void *; this can avoid a GCC warning
19206 if EMACS_INT is not the same width as void *.
19207 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19208 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19209 (current_message_1, set_message_1):
19210 Use a local to convert to proper width without a cast.
19211 * xmenu.c (dialog_selection_callback): Likewise.
19212
19213 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19214 Also, don't assume VALBITS / RAND_BITS is less than 5,
19215 and don't rely on undefined behavior when shifting a 1 left into
19216 the sign bit.
19217 * lisp.h (get_random): Change signature to match.
19218
19219 * lread.c (hash_string): Use size_t, not int, for hash computation.
19220 Normally we prefer signed values; but hashing is special, because
19221 it's better to use unsigned division on hash table sizes so that
19222 the remainder is nonnegative. Also, size_t is the natural width
19223 for hashing into memory. The previous code used 'int', which doesn't
19224 retain enough info to hash well into very large tables.
19225 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
19226
19227 * dbusbind.c: Don't possibly lose pointer info when converting.
19228 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19229 Use XPNTR rather than XHASH, so that the high-order bits of
19230 the pointer aren't lost when converting through void *.
19231
19232 * eval.c (Fautoload): Don't double-shift a pointer.
19233
19234 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
19235
19236 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
19237
19238 * gnutls.c (DEF_GNUTLS_FN):
19239 * image.c (DEF_IMGLIB_FN): Make function pointers static.
19240
19241 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
19242
19243 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
19244 marker. (Bug#8610)
19245
19246 2011-05-05 Eli Zaretskii <eliz@gnu.org>
19247
19248 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
19249 New version that can reserve upto 2GB of heap space.
19250
19251 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
19252
19253 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
19254
19255 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
19256
19257 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
19258 `gnutls_certificate_set_x509_key_file'.
19259
19260 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
19261
19262 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
19263 Update dependencies.
19264
19265 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19266
19267 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
19268 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
19269 Remove unused parameter `fildes'.
19270 * process.c (read_process_output, send_process): Don't pass it.
19271
19272 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19273
19274 Fix previous change: the library cache is defined in w32.c.
19275 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
19276 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
19277
19278 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19279
19280 Implement dynamic loading of GnuTLS on Windows.
19281
19282 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
19283 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
19284 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19285 Declare.
19286
19287 * gnutls.c (Qgnutls_dll): Define.
19288 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
19289 (gnutls_*): Declare function pointers.
19290 (init_gnutls_functions): New function to initialize function pointers.
19291 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
19292 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
19293 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19294 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
19295 (emacs_gnutls_write, emacs_gnutls_read)
19296 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
19297 (Fgnutls_available_p): New function.
19298 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
19299 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
19300 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
19301
19302 * image.c: Include w32.h.
19303 (Vimage_type_cache): Delete.
19304 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
19305 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
19306 (w32_delayed_load): Move to w32.c.
19307
19308 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
19309
19310 * w32.c (QCloaded_from, Vlibrary_cache): Define.
19311 (w32_delayed_load): Move from image.c. When loading a library, record
19312 its filename in the :loaded-from property of the library id.
19313 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
19314 Initialize and staticpro them.
19315 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
19316
19317 * process.c: Include lisp.h before w32.h, not after.
19318 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
19319 instead of gnutls_record_check_pending.
19320
19321 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
19322
19323 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
19324
19325 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
19326 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
19327 as passed in.
19328
19329 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
19330
19331 * xterm.c (x_set_frame_alpha): Do not set property on anything
19332 else than FRAME_X_OUTER_WINDOW (Bug#8608).
19333
19334 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
19335
19336 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
19337
19338 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
19339
19340 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
19341 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
19342 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
19343 (gnutls_global_initialized, Qgnutls_bootprop_priority)
19344 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
19345 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
19346 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
19347 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
19348 (Qgnutls_bootprop_callbacks_verify): Make static.
19349
19350 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
19351
19352 * callproc.c: Indentation fixup.
19353
19354 * sysdep.c (wait_for_termination_1): Make static.
19355 (wait_for_termination, interruptible_wait_for_termination):
19356 Move after wait_for_termination_1.
19357
19358 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
19359
19360 * sysdep.c (interruptible_wait_for_termination): New function
19361 which is like wait_for_termination, but allows keyboard
19362 interruptions.
19363
19364 * callproc.c (Fcall_process): Add (:file "file") as an option for
19365 the STDOUT buffer.
19366 (Fcall_process_region): Ditto.
19367
19368 2011-04-30 Eli Zaretskii <eliz@gnu.org>
19369
19370 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
19371 rather than `XVECTOR (FOO)->size'.
19372
19373 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
19374 inttypes.h, as a gnulib replacement is used if it not available in
19375 system headers.
19376
19377 2011-04-21 Eli Zaretskii <eliz@gnu.org>
19378
19379 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
19380 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
19381 of MOST_POSITIVE_FIXNUM. (Bug#8528)
19382
19383 * coding.c (coding_alloc_by_realloc): Error out if destination
19384 will grow beyond MOST_POSITIVE_FIXNUM.
19385 (decode_coding_emacs_mule): Abort if there isn't enough place in
19386 charbuf for the composition carryover bytes. Reserve an extra
19387 space for up to 2 characters produced in a loop.
19388 (decode_coding_iso_2022): Abort if there isn't enough place in
19389 charbuf for the composition carryover bytes.
19390
19391 2011-04-21 Eli Zaretskii <eliz@gnu.org>
19392
19393 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
19394 aborting when %lld or %lll format is passed.
19395 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
19396 %llo or %llx format is passed. (Bug#8545)
19397
19398 * window.c (window_scroll_line_based): Use a marker instead of
19399 simple variables to record original value of point. (Bug#7952)
19400
19401 * doprnt.c (doprnt): Fix the case where a multibyte sequence
19402 produced by %s or %c overflows available buffer space. (Bug#8545)
19403
19404 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
19405
19406 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
19407 (SIZE_MAX): Move defn after all includes, as they might #define it.
19408
19409 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19410
19411 * w32.c (init_environment): Warn about defaulting HOME to C:\.
19412
19413 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19414
19415 * keyboard.c (Qdelayed_warnings_hook): Define.
19416 (command_loop_1): Run `delayed-warnings-hook'
19417 if Vdelayed_warnings_list is non-nil.
19418 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
19419 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
19420
19421 2011-04-28 Eli Zaretskii <eliz@gnu.org>
19422
19423 * doprnt.c (doprnt): Don't return value smaller than the buffer
19424 size if the message was truncated. (Bug#8545).
19425
19426 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19427
19428 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
19429 (Fx_window_property): #if-0 the whole functions, not just the bodies.
19430
19431 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19432
19433 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
19434
19435 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
19436
19437 * makefile.w32-in: Update dependencies.
19438
19439 2011-04-27 Eli Zaretskii <eliz@gnu.org>
19440
19441 Improve `doprnt' and its usage. (Bug#8545)
19442 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
19443 `format_end'. Remove support for %l as a conversion specifier.
19444 Don't use xrealloc. Improve diagnostics when the %l size modifier
19445 is used. Update the commentary.
19446
19447 * eval.c (verror): Simplify calculation of size_t.
19448
19449 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
19450 messages.
19451
19452 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
19453
19454 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
19455 change.
19456
19457 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19458
19459 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
19460 This makes this file independent of the recent pseudovector change.
19461
19462 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
19463
19464 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
19465
19466 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
19467 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
19468 Remove unused local.
19469 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
19470
19471 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
19472 GCC 4.6.0 optimizes based on type-based alias analysis.
19473 For example, if b is of type struct buffer * and v of type struct
19474 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
19475 != &v->size, and therefore "v->size = 1; b->size = 2; return
19476 v->size;" must therefore return 1. This assumption is incorrect
19477 for Emacs, since it type-puns struct Lisp_Vector * with many other
19478 types. To fix this problem, this patch adds a new type struct
19479 vectorlike_header that documents the constraints on layout of vectors
19480 and pseudovectors, and helps optimizing compilers not get fooled
19481 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
19482 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
19483 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
19484 the size member.
19485 (XSETPVECTYPE): Rewrite in terms of new macro.
19486 (XSETPVECTYPESIZE): New macro, specifying both type and size.
19487 This is a bit clearer, and further avoids the possibility of
19488 undesirable aliasing.
19489 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
19490 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
19491 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
19492 since Lisp_Subr is a special case (no "next" field).
19493 (ASIZE): Now uses header.size rather than size.
19494 All previous uses of XVECTOR (foo)->size replaced to use this macro,
19495 to avoid the hassle of writing XVECTOR (foo)->header.size.
19496 (struct vectorlike_header): New type.
19497 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
19498 object, to help avoid aliasing.
19499 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
19500 (SUBRP): Likewise, since Lisp_Subr is a special case.
19501 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
19502 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
19503 (struct Lisp_Hash_Table): Combine first two members into a single
19504 struct vectorlike_header member. All uses of "size" and "next" members
19505 changed to be "header.size" and "header.next".
19506 * buffer.h (struct buffer): Likewise.
19507 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
19508 * frame.h (struct frame): Likewise.
19509 * process.h (struct Lisp_Process): Likewise.
19510 * termhooks.h (struct terminal): Likewise.
19511 * window.c (struct save_window_data, struct saved_window): Likewise.
19512 * window.h (struct window): Likewise.
19513 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
19514 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
19515 * buffer.c (init_buffer_once): Likewise.
19516 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
19517 special case.
19518 * process.c (Fformat_network_address): Use local var for size,
19519 for brevity.
19520
19521 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
19522
19523 Make the Lisp reader and string-to-float more consistent (Bug#8525)
19524 * data.c (atof): Remove decl; no longer used or needed.
19525 (digit_to_number): Move to lread.c.
19526 (Fstring_to_number): Use new string_to_number function, to be
19527 consistent with how the Lisp reader treats infinities and NaNs.
19528 Do not assume that floating-point numbers represent EMACS_INT
19529 without losing information; this is not true on most 64-bit hosts.
19530 Avoid double-rounding errors, by insisting on integers when
19531 parsing non-base-10 numbers, as the documentation specifies.
19532 * lisp.h (string_to_number): New decl, replacing ...
19533 (isfloat_string): Remove.
19534 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
19535 (read1): Do not accept +. and -. as integers; this
19536 appears to have been a coding error. Similarly, do not accept
19537 strings like +-1e0 as floating point numbers. Do not report
19538 overflow for integer overflows unless the base is not 10 which
19539 means we have no simple and reliable way to continue.
19540 Break out the floating-point parsing into a new
19541 function string_to_number, so that Fstring_to_number parses
19542 floating point numbers consistently with the Lisp reader.
19543 (digit_to_number): Move here from data.c. Make it static inline.
19544 (E_CHAR, EXP_INT): Remove, replacing with ...
19545 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
19546 (string_to_number): New function, replacing isfloat_string.
19547 This function checks for valid syntax and produces the resulting
19548 Lisp float number too. Rework it so that string-to-number
19549 no longer mishandles examples like "1.0e+". Use strtoumax,
19550 so that overflow for non-base-10 numbers is reported only when
19551 there's no portable and simple way to convert to floating point.
19552
19553 * textprop.c (set_text_properties_1): Rewrite for clarity,
19554 and to avoid GCC warning about integer overflow.
19555
19556 * intervals.h (struct interval): Use EMACS_INT for members
19557 where EMACS_UINT might cause problems. See
19558 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
19559 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
19560 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
19561 All uses changed.
19562 (offset_intervals): Tell GCC not to worry about length overflow
19563 when negating a negative length.
19564
19565 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
19566 (overrun_check_free): Likewise.
19567
19568 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
19569 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
19570 word size.
19571
19572 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19573 (gnutls_make_error): Rename local to avoid shadowing.
19574 (gnutls_emacs_global_deinit): ifdef out; not used.
19575 (Fgnutls_boot): Use const for pointer to readonly storage.
19576 Comment out unused local. Fix pointer signedness problems.
19577
19578 * lread.c (openp): Don't stuff size_t into an 'int'.
19579 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
19580 about possible signed overflow.
19581
19582 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19583 (GDK_KEY_g): Don't define if already defined.
19584 (xg_prepare_tooltip): Avoid pointer signedness problem.
19585 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
19586
19587 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
19588 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
19589
19590 * xfns.c (Fx_window_property): Simplify a bit,
19591 to make a bit faster and to avoid GCC 4.6.0 warning.
19592 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
19593
19594 * fns.c (internal_equal): Don't assume size_t fits in int.
19595
19596 * alloc.c (compact_small_strings): Tighten assertion a little.
19597
19598 Replace pEd with more-general pI, and fix some printf arg casts.
19599 * lisp.h (pI): New macro, generalizing old pEd macro to other
19600 conversion specifiers. For example, use "...%"pI"d..." rather
19601 than "...%"pEd"...".
19602 (pEd): Remove. All uses replaced with similar uses of pI.
19603 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
19604 * alloc.c (check_pure_size): Don't overflow by converting size to int.
19605 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
19606 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
19607 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
19608 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
19609 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
19610 64-bit hosts.
19611 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
19612 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
19613 * print.c (safe_debug_print, print_object): Likewise.
19614 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
19615 to int.
19616 Use pI instead of if-then-else-abort. Use %p to avoid casts,
19617 avoiding the 0 flag, which is not portable.
19618 * process.c (Fmake_network_process): Use pI to avoid cast.
19619 * region-cache.c (pp_cache): Likewise.
19620 * xdisp.c (decode_mode_spec): Likewise.
19621 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
19622 behavior on 64-bit hosts with printf arg.
19623 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
19624 (x_stop_queuing_selection_requests): Likewise.
19625 (x_get_window_property): Don't truncate byte count to an 'int'
19626 when tracing.
19627
19628 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
19629 here, since it parses constructs like leading '-' and spaces,
19630 which are not wanted; and it overflows with large numbers.
19631 Instead, simply match F[0-9]+, which is what is wanted anyway.
19632
19633 * alloc.c: Remove unportable assumptions about struct layout.
19634 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
19635 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
19636 (allocate_vectorlike, make_pure_vector): Use the new macros,
19637 plus offsetof, to remove unportable assumptions about struct layout.
19638 These assumptions hold on all porting targets that I know of, but
19639 they are not guaranteed, they're easy to remove, and removing them
19640 makes further changes easier.
19641
19642 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
19643 This doesn't fix a bug but makes the code clearer.
19644 (string_overrun_cookie): Now const. Use initializers that
19645 don't formally overflow signed char, to avoid warnings.
19646 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
19647 can cause Emacs to crash when string overrun checking is enabled.
19648 (allocate_buffer): Don't assume sizeof (struct buffer) is a
19649 multiple of sizeof (EMACS_INT); it need not be, if
19650 alignof(EMACS_INT) < sizeof (EMACS_INT).
19651 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
19652
19653 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
19654
19655 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
19656
19657 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
19658
19659 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
19660 supposed to be handshaking. (Bug#8556)
19661 Reported by Paul Eggert <eggert@cs.ucla.edu>.
19662
19663 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
19664
19665 * lisp.h (Qdebug): List symbol.
19666 * eval.c (Qdebug): Restore global linkage.
19667 * keyboard.c (debug-on-event): New variable.
19668 (handle_user_signal): Break into debugger when debug-on-event
19669 matches the current signal symbol.
19670
19671 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
19672
19673 * alloc.c (check_sblock, check_string_bytes)
19674 (check_string_free_list): Convert to standard C.
19675
19676 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
19677
19678 * w32.c (emacs_gnutls_push): Fix typo.
19679
19680 2011-04-25 Eli Zaretskii <eliz@gnu.org>
19681
19682 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
19683 "cast to pointer from integer of different size".
19684
19685 Improve doprnt and its use in verror. (Bug#8545)
19686 * doprnt.c (doprnt): Document the set of format control sequences
19687 supported by the function. Use SAFE_ALLOCA instead of always
19688 using `alloca'.
19689
19690 * eval.c (verror): Don't limit the buffer size at size_max-1, that
19691 is one byte too soon. Don't use xrealloc; instead xfree and
19692 xmalloc anew.
19693
19694 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
19695
19696 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
19697 callbacks stage.
19698
19699 * gnutls.c: Renamed global_initialized to
19700 gnutls_global_initialized. Added internals for the
19701 :verify-hostname-error, :verify-error, and :verify-flags
19702 parameters of `gnutls-boot' and documented those parameters in the
19703 docstring. Start callback support.
19704 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
19705 unless a fatal error occurred. Call gnutls_alert_send_appropriate
19706 on error. Return error code.
19707 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
19708 (emacs_gnutls_read): Likewise.
19709 (Fgnutls_boot): Return handshake error code.
19710 (emacs_gnutls_handle_error): New function.
19711 (wsaerror_to_errno): Likewise.
19712
19713 * w32.h (emacs_gnutls_pull): Add prototype.
19714 (emacs_gnutls_push): Likewise.
19715
19716 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
19717 (emacs_gnutls_push): Likewise.
19718
19719 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
19720
19721 * process.c (wait_reading_process_output): Check if GnuTLS
19722 buffered some data internally if no FDs are set for TLS
19723 connections.
19724
19725 * makefile.w32-in (OBJ2): Add gnutls.$(O).
19726 (LIBS): Link to USER_LIBS.
19727 ($(BLD)/gnutls.$(0)): New target.
19728
19729 2011-04-24 Eli Zaretskii <eliz@gnu.org>
19730
19731 * xdisp.c (handle_single_display_spec): Rename the
19732 display_replaced_before_p argument into display_replaced_p, to
19733 make it consistent with the commentary. Fix typos in the
19734 commentary.
19735
19736 * textprop.c (syms_of_textprop): Remove dead code.
19737 (copy_text_properties): Delete obsolete commentary about an
19738 interface that was deleted long ago. Fix typos in the description
19739 of arguments.
19740
19741 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
19742 to changes in oldXMenu/XMenu.h from 2011-04-16.
19743 <menu_help_message, prev_menu_help_message>: Constify.
19744 (IT_menu_make_room): menu->help_text is now `const char **';
19745 adjust.
19746
19747 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
19748 to changes in oldXMenu/XMenu.h from 2011-04-16.
19749 (struct XMenu): Declare `help_text' `const char **'.
19750
19751 * xfaces.c <Qunspecified>: Make extern again.
19752
19753 * syntax.c: Include sys/types.h before including regex.h, as
19754 required by POSIX.
19755
19756 * doc.c (get_doc_string): Improve the format passed to `error'.
19757
19758 * doprnt.c (doprnt): Improve commentary.
19759
19760 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
19761
19762 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
19763 them with etags.
19764
19765 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
19766 changes in globals.h immediately force recompilation.
19767 (TAGS): Depend on $(CURDIR)/m/intel386.h and
19768 $(CURDIR)/s/ms-w32.h.
19769 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
19770
19771 * character.c (Fchar_direction): Function deleted.
19772 (syms_of_character): Don't defsubr it.
19773 <char-direction-table>: Deleted.
19774
19775 2011-04-23 Eli Zaretskii <eliz@gnu.org>
19776
19777 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
19778 * doprnt.c: Include limits.h.
19779 (SIZE_MAX): New macro.
19780 (doprnt): Return a size_t value. 2nd arg is now size_t.
19781 Many local variables are now size_t instead of int or unsigned.
19782 Improve overflow protection. Support `l' modifier for integer
19783 conversions. Support %l conversion. Don't assume an EMACS_INT
19784 argument for integer conversions and for %c.
19785
19786 * lisp.h (doprnt): Restore prototype.
19787
19788 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
19789 $(SRC)/character.h.
19790
19791 * Makefile.in (base_obj): Add back doprnt.o.
19792
19793 * deps.mk (doprnt.o): Add back prerequisites.
19794 (callint.o): Depend on character.h.
19795
19796 * eval.c (internal_lisp_condition_case): Include the handler
19797 representation in the error message.
19798 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
19799 when breaking from the loop.
19800
19801 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
19802
19803 * callint.c (Fcall_interactively): When displaying error message
19804 about invalid control letter, pass the character's codepoint, not
19805 a pointer to its multibyte form. Improve display of the character
19806 in octal and display also its hex code.
19807
19808 * character.c (char_string): Use %x to display the (unsigned)
19809 codepoint of an invalid character, to avoid displaying a bogus
19810 negative value.
19811
19812 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
19813 `error', not SYMBOL_NAME itself.
19814
19815 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
19816 character arguments to `error'.
19817
19818 * charset.c (check_iso_charset_parameter): Fix incorrect argument
19819 to `error' in error message about FINAL_CHAR argument. Make sure
19820 FINAL_CHAR is a character, and use %c when it is passed as
19821 argument to `error'.
19822
19823 2011-04-23 Eli Zaretskii <eliz@gnu.org>
19824
19825 * s/ms-w32.h (localtime): Redirect to sys_localtime.
19826
19827 * w32.c: Include <time.h>.
19828 (sys_localtime): New function.
19829
19830 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
19831
19832 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
19833
19834 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
19835
19836 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
19837
19838 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
19839 zombies (Bug#8467).
19840
19841 2011-04-19 Eli Zaretskii <eliz@gnu.org>
19842
19843 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
19844 gl_state.e_property when gl_state.object is Qt.
19845
19846 * insdel.c (make_gap_larger): Remove limitation of buffer size
19847 to <= INT_MAX.
19848
19849 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
19850
19851 * xdisp.c (lookup_glyphless_char_display)
19852 (produce_glyphless_glyph): Handle cons cell entry in
19853 glyphless-char-display.
19854 (Vglyphless_char_display): Document it.
19855
19856 * term.c (produce_glyphless_glyph): Handle cons cell entry in
19857 glyphless-char-display.
19858
19859 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
19860
19861 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
19862
19863 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
19864
19865 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
19866 definition for no-X builds.
19867
19868 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
19869
19870 Static checks with GCC 4.6.0 and non-default toolkits.
19871
19872 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
19873
19874 * process.c (keyboard_bit_set): Define only if SIGIO.
19875 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
19876 (send_process): Repair possible setjmp clobbering.
19877
19878 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
19879
19880 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
19881
19882 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
19883
19884 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
19885 Define only if needed.
19886
19887 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
19888 by pacifying GCC about it. Maybe it's time to retire it?
19889 * xfaces.c (USG, __TIMEVAL__): Likewise.
19890
19891 * dispextern.h (struct redisplay_interface): Rename param
19892 to avoid shadowing.
19893 * termhooks.h (struct terminal): Likewise.
19894 * xterm.c (xembed_send_message): Likewise.
19895
19896 * insdel.c (make_gap_smaller): Define only if
19897 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
19898
19899 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
19900 it.
19901
19902 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
19903 so that we aren't warned about unused symbols.
19904
19905 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
19906
19907 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
19908
19909 * xfns.c (x_real_positions): Mark locals as initialized.
19910
19911 * xmenu.c (xmenu_show): Don't use uninitialized vars.
19912
19913 * xterm.c: Fix problems found by static analysis with other toolkits.
19914 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
19915 (x_dispatch_event): Declare static if USE_GTK, and
19916 define if USE_GTK || USE_X_TOOLKIT.
19917 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
19918 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
19919 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
19920 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
19921
19922 * xmenu.c (menu_help_callback): Pointer type fixes.
19923 Use const pointers when pointing at readonly data. Avoid pointer
19924 signedness clashes.
19925 (FALSE): Remove unused macro.
19926 (update_frame_menubar): Remove unused decl.
19927
19928 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
19929
19930 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
19931 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
19932 (single_menu_item): Rename local to avoid shadowing.
19933
19934 * keyboard.c (make_lispy_event): Remove unused local var.
19935
19936 * frame.c, frame.h (x_get_resource_string): Bring this back, but
19937 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
19938
19939 * bitmaps: Change bitmaps from unsigned char back to the X11
19940 compatible char. Avoid the old compiler warnings about
19941 out-of-range initializers by using, for example, '\xab' rather
19942 than 0xab.
19943
19944 * xgselect.c (xgselect_initialize): Check vs interface
19945 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
19946
19947 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
19948
19949 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
19950 to read-only memory.
19951
19952 * fns.c (vector): Remove; this old hack is no longer needed.
19953
19954 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
19955 Remove unused var.
19956 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
19957
19958 * xrdb.c (x_load_resources): Omit unused local.
19959
19960 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
19961 (x_window): Rename locals to avoid shadowing.
19962 (USG): Use the kludged USG macro, to pacify gcc.
19963
19964 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
19965 (x_term_init): Remove local to avoid shadowing.
19966
19967 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
19968
19969 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
19970 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
19971
19972 2011-04-16 Eli Zaretskii <eliz@gnu.org>
19973
19974 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
19975
19976 Fix regex.c, syntax.c and friends for buffers > 2GB.
19977 * syntax.h (struct gl_state_s): Declare character position members
19978 EMACS_INT.
19979
19980 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
19981
19982 * textprop.c (verify_interval_modification, interval_of):
19983 Declare arguments EMACS_INT.
19984
19985 * intervals.c (adjust_intervals_for_insertion): Declare arguments
19986 EMACS_INT.
19987
19988 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
19989
19990 * indent.c (Fvertical_motion): Local variable it_start is now
19991 EMACS_INT.
19992
19993 * regex.c (re_match, re_match_2, re_match_2_internal)
19994 (bcmp_translate, regcomp, regexec, print_double_string)
19995 (group_in_compile_stack, re_search, re_search_2, regex_compile)
19996 (re_compile_pattern, re_exec): Declare arguments and local
19997 variables `size_t' and `ssize_t' and return values `regoff_t', as
19998 appropriate.
19999 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20000 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20001 <compile_stack_type>: `size' and `avail' are now `size_t'.
20002
20003 * regex.h <regoff_t>: Use ssize_t, not int.
20004 (re_search, re_search_2, re_match, re_match_2): Arguments that
20005 specify buffer/string position and length are now ssize_t and
20006 size_t. Return type is regoff_t.
20007
20008 2011-04-16 Ben Key <bkey76@gmail.com>
20009
20010 * nsfont.m: Fixed bugs in ns_get_family and
20011 ns_descriptor_to_entity that were caused by using free to
20012 deallocate memory blocks that were allocated by xmalloc (via
20013 xstrdup). This caused Emacs to crash when compiled with
20014 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20015 --enable-checking=xmallocoverrun). xfree is now used to
20016 deallocate these memory blocks.
20017
20018 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
20019
20020 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20021
20022 emacs_write: Accept and return EMACS_INT for sizes.
20023 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20024 et seq.
20025 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20026 Accept and return EMACS_INT.
20027 (emacs_gnutls_write): Return the number of bytes written on
20028 partial writes.
20029 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
20030 (emacs_read, emacs_write): Remove check for negative size, as the
20031 Emacs source code has been audited now.
20032 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20033 (emacs_read, emacs_write): Use it.
20034 * process.c (send_process): Adjust to the new signatures of
20035 emacs_write and emacs_gnutls_write. Do not attempt to store
20036 a byte offset into an 'int'; it might overflow.
20037 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
20038
20039 * sound.c: Don't assume sizes fit in 'int'.
20040 (struct sound_device.period_size, alsa_period_size):
20041 Return EMACS_INT, not int.
20042 (struct sound_device.write, vox_write, alsa_write):
20043 Accept EMACS_INT, not int.
20044 (wav_play, au_play): Use EMACS_INT to store sizes and to
20045 record read return values.
20046
20047 2011-04-15 Ben Key <bkey76@gmail.com>
20048
20049 * keyboard.c (Qundefined): Don't declare static since it is used
20050 in nsfns.m.
20051 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20052 static since they are used in nsfont.m.
20053
20054 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20055
20056 * process.c (Qprocessp): Don't declare static.
20057 * lisp.h (Qprocessp): Declare again.
20058
20059 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
20060
20061 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20062
20063 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20064
20065 Improve C-level modularity by making more things 'static'.
20066
20067 Don't publish debugger-only interfaces to other modules.
20068 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20069 (verify_bytepos, count_markers): Move decls to the only modules
20070 that need them.
20071 * region-cache.h (pp_cache): Likewise.
20072 * window.h (check_all_windows): Likewise.
20073 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20074
20075 * sysdep.c (croak): Now static, if
20076 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20077 * syssignal.h (croak): Declare only if not static.
20078
20079 * alloc.c (refill_memory_reserve): Now static if
20080 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20081 * lisp.h (refill_memory_reserve): Declare only if not static.
20082
20083 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20084 Define only if USE_LUCID.
20085
20086 * xrdb.c (x_customization_string, x_rm_string): Now static.
20087
20088 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20089 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20090
20091 * xdisp.c (draw_row_with_mouse_face): Now static.
20092 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20093
20094 * window.h (check_all_windows): Mark externally visible.
20095
20096 * window.c (window_deletion_count): Now static.
20097
20098 * undo.c: Make symbols static if they're not exported.
20099 (last_undo_buffer, last_boundary_position, pending_boundary):
20100 Now static.
20101
20102 * textprop.c (interval_insert_behind_hooks): Now static.
20103 (interval_insert_in_front_hooks): Likewise.
20104
20105 * term.c: Make symbols static if they're not exported.
20106 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20107 (max_frame_lines, tty_set_terminal_modes):
20108 (tty_reset_terminal_modes, tty_turn_off_highlight):
20109 (get_tty_terminal): Now static.
20110 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20111 * termhooks.h (term_mouse_moveto): Do not declare if
20112 HAVE_WINDOW_SYSTEM.
20113 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20114 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20115
20116 * sysdep.c: Make symbols static if they're not exported.
20117 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20118 Now static.
20119 (sigprocmask_set, full_mask): Remove; unused.
20120 (wait_debugging): Mark as visible.
20121 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20122 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20123
20124 * syntax.c (syntax_temp): Define only if !__GNUC__.
20125
20126 * sound.c (current_sound_device, current_sound): Now static.
20127
20128 * search.c (searchbufs, searchbuf_head): Now static.
20129
20130 * scroll.c (scroll_cost): Remove; unused.
20131 * dispextern.h (scroll_cost): Remove decl.
20132
20133 * region-cache.h (pp_cache): Mark as externally visible.
20134
20135 * process.c: Make symbols static if they're not exported.
20136 (process_tick, update_tick, create_process, chan_process):
20137 (Vprocess_alist, proc_buffered_char, datagram_access):
20138 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20139 (deactivate_process): Mark defn as static, as well as decl.
20140 * lisp.h (create_process): Remove decl.
20141 * process.h (chan_process, Vprocess_alist): Remove decls.
20142
20143 * print.c: Make symbols static if they're not exported.
20144 (print_depth, new_backquote_output, being_printed, print_buffer):
20145 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20146 (print_interval, print_number_index, initial_stderr_stream):
20147 Now static.
20148 * lisp.h (Fprinc): Remove decl.
20149 (debug_output_compilation_hack): Mark as externally visible.
20150
20151 * sysdep.c (croak): Move decl from here to syssignal.h.
20152 * syssignal.h (croak): Put it here, so the API can be checked when
20153 'croak' is called from dissociate_if_controlling_tty.
20154
20155 * minibuf.c: Make symbols static if they're not exported.
20156 (minibuf_save_list, choose_minibuf_frame): Now static.
20157 * lisp.h (choose_minibuf_frame): Remove decl.
20158
20159 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20160
20161 * lread.c: Make symbols static if they're not exported.
20162 (read_objects, initial_obarray, oblookup_last_bucket_number):
20163 Now static.
20164 (make_symbol): Remove; unused.
20165 * lisp.h (initial_obarray, make_symbol): Remove decls.
20166
20167 * keyboard.c: Make symbols static if they're not exported.
20168 (single_kboard, recent_keys_index, total_keys, recent_keys):
20169 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20170 (this_single_command_key_start, echoing, last_auto_save):
20171 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20172 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20173 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20174 (Vlispy_mouse_stem, double_click_count):
20175 Now static.
20176 (force_auto_save_soon): Define only if SIGDANGER.
20177 (ignore_mouse_drag_p): Now static if
20178 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20179 (print_help): Remove; unused.
20180 (stop_character, last_timer_event): Mark as externally visible.
20181 * keyboard.h (ignore_mouse_drag_p): Declare only if
20182 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20183 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20184 * lisp.h (echoing): Remove decl.
20185 (force_auto_save_soon): Declare only if SIGDANGER.
20186 * xdisp.c (redisplay_window): Simplify code, to make it more
20187 obvious that ignore_mouse_drag_p is not accessed if !defined
20188 USE_GTK && !defined HAVE_NS.
20189
20190 * intervals.c: Make symbols static if they're not exported.
20191 (merge_properties_sticky, merge_interval_right, delete_interval):
20192 Now static.
20193 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20194
20195 * insdel.c: Make symbols static if they're not exported.
20196 However, leave prepare_to_modify_buffer alone. It's never
20197 called from outside this function, but that appears to be a bug.
20198 (combine_after_change_list, combine_after_change_buffer):
20199 (adjust_after_replace, signal_before_change): Now static.
20200 (adjust_after_replace_noundo): Remove; unused.
20201 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
20202 (signal_before_change): Remove decls.
20203
20204 * indent.c (val_compute_motion, val_vmotion): Now static.
20205
20206 * image.c: Make symbols static if they're not exported.
20207 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20208 if USE_GTK.
20209 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20210 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
20211
20212 * fringe.c (standard_bitmaps): Now static.
20213 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20214
20215 * frame.c: Make symbols static if they're not exported.
20216 (x_report_frame_params, make_terminal_frame): Now static.
20217 (get_frame_param): Now static, unless HAVE_NS.
20218 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20219 (x_get_resource_string): Remove; not used.
20220 * frame.h (make_terminal_frame, x_report_frame_params):
20221 (x_get_resource_string); Remove decls.
20222 (x_fullscreen_adjust): Declare only if WINDOWSNT.
20223 * lisp.h (get_frame_param): Declare only if HAVE_NS.
20224
20225 * font.c, fontset.c: Make symbols static if they're not exported.
20226 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
20227 (FACE_SUITABLE_FOR_CHAR_P): Use it.
20228 * font.c (font_close_object): Now static.
20229 * font.h (font_close_object): Remove.
20230 * fontset.c (FONTSET_OBJLIST): Remove.
20231 (free_realized_fontset) #if-0 the body, which does nothing.
20232 (face_suitable_for_char_p): #if-0, as it's never called.
20233 * fontset.h (face_suitable_for_char_p): Remove decl.
20234 * xfaces.c (face_at_string_position):
20235 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
20236 since 0 is always ASCII.
20237
20238 * fns.c (weak_hash_tables): Now static.
20239
20240 * fileio.c: Make symbols static if they're not exported.
20241 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
20242 (Vwrite_region_annotation_buffers): Now static.
20243
20244 * eval.c: Make symbols static if they're not exported.
20245 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
20246 * lisp.h (backtrace_list): Remove decl.
20247
20248 * emacs.c: Make symbols static if they're not exported.
20249 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
20250 (fatal_error_code, fatal_error_signal_hook, standard_args):
20251 Now static.
20252 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
20253 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
20254 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
20255 * lisp.h (fatal_error_signal_hook): Remove decl.
20256 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
20257
20258 * editfns.c: Move a (normally-unused) function to its only use.
20259 * editfns.c, lisp.h (get_operating_system_release): Remove.
20260 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
20261 worth the hassle of breaking this out.
20262
20263 * xterm.c: Make symbols static if they're not exported.
20264 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
20265 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
20266 (x_destroy_window, x_delete_display):
20267 Now static.
20268 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
20269 (x_mouse_leave): Remove; unused.
20270 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
20271 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
20272 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
20273 Remove decls.
20274 (x_mouse_leave): Declare only if WINDOWSNT.
20275 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
20276 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
20277 USE_X_TOOLKIT.
20278
20279 * ftxfont.c: Make symbols static if they're not exported.
20280 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
20281 HAVE_FREETYPE.
20282 * font.h (ftxfont_driver): Likewise.
20283
20284 * xfns.c: Make symbols static if they're not exported.
20285 (x_last_font_name, x_display_info_for_name):
20286 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
20287 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
20288 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
20289 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
20290 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
20291 (last_show_tip_args): Now static.
20292 (xic_defaut_fontset, xic_create_fontsetname): Define only if
20293 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
20294 (x_screen_planes): Remove; unused.
20295 * dispextern.h (x_screen_planes): Remove decl.
20296
20297 * dispnew.c: Make symbols static if they're not exported.
20298 * dispextern.h (redraw_garbaged_frames, scrolling):
20299 (increment_row_positions): Remove.
20300 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
20301 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
20302 Now static.
20303 (redraw_garbaged_frames): Remove; unused.
20304
20305 * xfaces.c: Make symbols static if they're not exported.
20306 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
20307 Remove decls.
20308 * xterm.h (defined_color): Remove decls.
20309 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
20310 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
20311 (menu_face_changed_default, defined_color, free_realized_face):
20312 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
20313 (ascii_face_of_lisp_face): Remove; unused.
20314
20315 * xdisp.c: Make symbols static if they're not exported.
20316 * dispextern.h (scratch_glyph_row, window_box_edges):
20317 (glyph_to_pixel_coords, set_cursor_from_row):
20318 (get_next_display_element, set_iterator_to_next):
20319 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
20320 (show_mouse_face): Remove decls
20321 * frame.h (message_buf_print): Likewise.
20322 * lisp.h (pop_message, set_message, check_point_in_composition):
20323 Likewise.
20324 * xterm.h (set_vertical_scroll_bar): Likewise.
20325 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
20326 (message_buf_print, scratch_glyph_row, displayed_buffer):
20327 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
20328 (get_next_display_element, show_mouse_face, window_box_edges):
20329 (frame_to_window_pixel_xy, check_point_in_composition):
20330 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
20331 (glyph_to_pixel_coords): Remove; unused.
20332
20333 * dired.c (file_name_completion): Now static.
20334
20335 * dbusbind.c (xd_in_read_queued_messages): Now static.
20336
20337 * lisp.h (circular_list_error, FOREACH): Remove; unused.
20338 * data.c (circular_list_error): Remove.
20339
20340 * commands.h (last_point_position, last_point_position_buffer):
20341 (last_point_position_window): Remove decls.
20342 * keyboard.c: Make these variables static.
20343
20344 * coding.h (coding, code_convert_region, encode_coding_gap):
20345 Remove decls.
20346 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
20347 (iso_code_class, detect_coding, code_convert_region): Now static.
20348 (encode_coding_gap): Remove; unused.
20349
20350 * chartab.c (chartab_chars, chartab_bits): Now static.
20351
20352 * charset.h (charset_iso_8859_1): Remove decl.
20353 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
20354 Now static.
20355
20356 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
20357 * ccl.c (Vccl_program_table): Now static.
20358 (check_ccl_update): Remove; unused.
20359
20360 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
20361 * category.h: ... from here.
20362 * category.c (check_category_table, set_category_set): Now static.
20363
20364 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
20365 * lisp.h: Remove these decls.
20366
20367 * buffer.c (buffer_count): Remove unused var.
20368
20369 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
20370 so that it's not optimized away.
20371 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
20372 * dispextern.h (bidi_dump_cached_states): Remove, since it's
20373 exported only to the debugger.
20374
20375 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
20376 * atimer.h (run_all_atimers): Remove; not exported.
20377
20378 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
20379 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
20380 was inaccessible from Lisp.
20381 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
20382 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
20383
20384 alloc.c: Import and export fewer symbols, and remove unused items.
20385 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
20386 is defined.
20387 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
20388 it's not optimized away by whole-program optimization.
20389 (message_enable_multibyte, free_misc): Remove.
20390 (catchlist, handlerlist, mark_backtrace):
20391 Declare only if BYTE_MARK_STACK.
20392 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
20393 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
20394 (message_enable_multibyte): Remove decl.
20395 (free_misc, interval_free_list, float_block, float_block_index):
20396 (n_float_blocks, float_free_list, cons_block, cons_block_index):
20397 (cons_free_list, last_marked_index):
20398 Now static.
20399 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
20400 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20401 (mark_backtrace): Define only if BYTE_MARK_STACK.
20402 * xdisp.c (message_enable_multibyte): Now static.
20403
20404 Declare Lisp_Object Q* variables to be 'static' if not exported.
20405 This makes it easier for human readers (and static analyzers)
20406 to see whether these variables are used from other modules.
20407 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
20408 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
20409 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
20410 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
20411 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
20412 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
20413 * xmenu.c, xselect.c:
20414 Declare Q* vars static if they are not used in other modules.
20415 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
20416 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
20417 Remove decls of unexported vars.
20418 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
20419
20420 * lisp.h (DEFINE_FUNC): Make sname 'static'.
20421
20422 Make Emacs functions such as Fatom 'static' by default.
20423 This makes it easier for human readers (and static analyzers)
20424 to see whether these functions can be called from other modules.
20425 DEFUN now defines a static function. To make the function external
20426 so that it can be used in other C modules, use the new macro DEFUE.
20427 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
20428 (Finit_image_library):
20429 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
20430 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
20431 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
20432 Remove decls, since these functions are now static.
20433 (Funintern, Fget_internal_run_time): New decls, since these functions
20434 were already external.
20435
20436 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
20437 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
20438 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
20439 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
20440 * keyboard.c, keymap.c, lread.c:
20441 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
20442 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
20443 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
20444 Mark functions with DEFUE instead of DEFUN,
20445 if they are used in other modules.
20446 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
20447 decls for now-static functions.
20448 * buffer.h (Fdelete_overlay): Remove decl.
20449 * callproc.c (Fgetenv_internal): Mark as internal.
20450 * composite.c (Fremove_list_of_text_properties): Remove decl.
20451 (Fcomposition_get_gstring): New forward static decl.
20452 * composite.h (Fcomposite_get_gstring): Remove decl.
20453 * dired.c (Ffile_attributes): New forward static decl.
20454 * doc.c (Fdocumntation_property): New forward static decl.
20455 * eval.c (Ffetch_bytecode): New forward static decl.
20456 (Funintern): Remove extern decl; now in .h file where it belongs.
20457 * fileio.c (Fmake_symbolic_link): New forward static decl.
20458 * image.c (Finit_image_library): New forward static decl.
20459 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
20460 * intervals.h (Fprevious_property_change):
20461 (Fremove_list_of_text_properties): Remove decls.
20462 * keyboard.c (Fthis_command_keys): Remove decl.
20463 (Fcommand_execute): New forward static decl.
20464 * keymap.c (Flookup_key): New forward static decl.
20465 (Fcopy_keymap): Now static.
20466 * keymap.h (Flookup_key): Remove decl.
20467 * process.c (Fget_process): New forward static decl.
20468 (Fprocess_datagram_address): Mark as internal.
20469 * syntax.c (Fsyntax_table_p): New forward static decl.
20470 (skip_chars): Remove duplicate decl.
20471 * textprop.c (Fprevious_property_change): New forward static decl.
20472 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
20473 Now internal.
20474 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
20475 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
20476
20477 * editfns.c (Fformat): Remove unreachable code.
20478
20479 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
20480
20481 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
20482 change. (Bug#8496)
20483
20484 2011-04-13 Eli Zaretskii <eliz@gnu.org>
20485
20486 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
20487 when at ZV. (Bug#8487)
20488
20489 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
20490
20491 * charset.c (Fclear_charset_maps): Use xfree instead of free.
20492 (Bug#8437)
20493 * keyboard.c (parse_tool_bar_item): Likewise.
20494 * sound.c (sound_cleanup, alsa_close): Likewise.
20495 * termcap.c (tgetent): Likewise.
20496 * xfns.c (x_default_font_parameter): Likewise.
20497 * xsettings.c (read_and_apply_settings): Likewise.
20498
20499 * alloc.c (overrun_check_malloc, overrun_check_realloc)
20500 (overrun_check_free): Protoize.
20501
20502 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
20503
20504 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
20505 since callers should never pass a negative size.
20506 Change the signature to match that of plain 'read' and 'write'; see
20507 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
20508 * lisp.h: Update prototypes of emacs_write and emacs_read.
20509
20510 2011-04-11 Eli Zaretskii <eliz@gnu.org>
20511
20512 * xdisp.c (redisplay_window): Don't try to determine the character
20513 position of the scroll margin if the window start point w->startp
20514 is outside the buffer's accessible region. (Bug#8468)
20515
20516 2011-04-10 Eli Zaretskii <eliz@gnu.org>
20517
20518 Fix write-region and its subroutines for buffers > 2GB.
20519 * fileio.c (a_write, e_write): Modify declaration of arguments and
20520 local variables to support buffers larger than 2GB.
20521 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
20522
20523 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
20524 argument, local variables, and return value.
20525
20526 * lisp.h: Update prototypes of emacs_write and emacs_read.
20527
20528 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
20529
20530 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
20531
20532 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
20533
20534 Fix more problems found by GCC 4.6.0's static checks.
20535
20536 * xdisp.c (vmessage): Use a better test for character truncation.
20537
20538 * charset.c (load_charset_map): <, not <=, for optimization,
20539 and to avoid potential problems with integer overflow.
20540 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
20541 * casetab.c (set_identity, shuffle): Likewise.
20542 * editfns.c (Fformat): Likewise.
20543 * syntax.c (skip_chars): Likewise.
20544
20545 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
20546 This also lets GCC 4.6.0 generate slightly better loop code.
20547
20548 * callint.c (Fcall_interactively): <, not <=, for optimization.
20549 (Fcall_interactively): Count the number of arguments produced,
20550 not the number of arguments given. This is simpler and lets GCC
20551 4.6.0 generate slightly better code.
20552
20553 * ftfont.c: Distingish more carefully between FcChar8 and char.
20554 The previous code passed unsigned char * to a functions like
20555 strlen and xstrcasecmp that expect char *, which does not
20556 conform to the C standard.
20557 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
20558 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
20559 char * when the C standard requires it.
20560
20561 * keyboard.c (read_char): Remove unused var.
20562
20563 * eval.c: Port to Windows vsnprintf (Bug#8435).
20564 Include <limits.h>.
20565 (SIZE_MAX): Define if the headers do not.
20566 (verror): Do not give up if vsnprintf returns a negative count.
20567 Instead, grow the buffer. This ports to Windows vsnprintf, which
20568 does not conform to C99. Problem reported by Eli Zaretskii.
20569 Also, simplify the allocation scheme, by avoiding the need for
20570 calling realloc, and removing the ALLOCATED variable.
20571
20572 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
20573
20574 Remove invocations of doprnt, as Emacs now uses vsnprintf.
20575 But keep the doprint source code for now, as we might revamp it
20576 and use it again (Bug#8435).
20577 * lisp.h (doprnt): Remove.
20578 * Makefile.in (base_obj): Remove doprnt.o.
20579 * deps.mk (doprnt.o): Remove.
20580
20581 error: Print 32- and 64-bit integers portably (Bug#8435).
20582 Without this change, on typical 64-bit hosts error ("...%d...", N)
20583 was used to print both 32- and 64-bit integers N, which relied on
20584 undefined behavior.
20585 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
20586 * lisp.h (error, verror): Mark as printf-like functions.
20587 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
20588 Report overflow in size calculations when allocating printf buffer.
20589 Do not truncate output string at its first null byte.
20590 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
20591 Truncate the output at a character boundary, since vsnprintf does not
20592 do that.
20593 * charset.c (check_iso_charset_parameter): Convert internal
20594 character to string before calling 'error', since %c now has the
20595 printf meaning.
20596 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
20597 overflow when computing char to be passed to 'error'. Do not
20598 pass Lisp_Object to 'error'; pass the integer instead.
20599 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
20600 formatted with plain %d.
20601
20602 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
20603
20604 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
20605
20606 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
20607
20608 * xterm.c (x_catch_errors): Remove duplicate declaration.
20609
20610 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
20611
20612 * xdisp.c, lisp.h (message_nolog): Remove; unused.
20613
20614 2011-04-10 Jim Meyering <meyering@redhat.com>
20615
20616 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
20617 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
20618 return ssize_t not "int", and use size_t as the buffer length.
20619 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
20620 * gnutls.h: Update declarations.
20621 * process.c (read_process_output): Use ssize_t, to match.
20622 (send_process): Likewise.
20623
20624 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
20625
20626 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
20627
20628 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
20629
20630 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
20631 Use unsigned char, to match FcChar8 type definition.
20632
20633 * xterm.c (handle_one_xevent):
20634 * xmenu.c (create_and_show_popup_menu):
20635 * xselect.c (x_decline_selection_request)
20636 (x_reply_selection_request): Avoid type-punned deref of X events.
20637
20638 2011-04-09 Eli Zaretskii <eliz@gnu.org>
20639
20640 Fix some uses of `int' instead of EMACS_INT.
20641 * search.c (string_match_1, fast_string_match)
20642 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
20643 (scan_buffer, find_next_newline_no_quit)
20644 (find_before_next_newline, search_command, Freplace_match)
20645 (Fmatch_data): Make some `int' variables be EMACS_INT.
20646
20647 * xdisp.c (display_count_lines): 3rd argument and return value now
20648 EMACS_INT. All callers changed.
20649 (pint2hrstr): Last argument is now EMACS_INT.
20650
20651 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
20652 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
20653 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
20654 (decode_coding_utf_16, decode_coding_emacs_mule)
20655 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
20656 (decode_coding_ccl, decode_coding_charset)
20657 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
20658 (decode_coding_iso_2022, decode_coding_emacs_mule)
20659 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
20660 <char_offset, last_offset>: Declare EMACS_INT.
20661 (encode_coding_utf_8, encode_coding_utf_16)
20662 (encode_coding_emacs_mule, encode_invocation_designation)
20663 (encode_designation_at_bol, encode_coding_iso_2022)
20664 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
20665 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
20666 Declare EMACS_INT.
20667 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
20668 (encode_invocation_designation): Last argument P_NCHARS is now
20669 EMACS_INT.
20670 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
20671 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
20672
20673 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
20674 All users changed.
20675
20676 * ccl.c (Fccl_execute_on_string): Declare some variables
20677 EMACS_INT.
20678
20679 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
20680
20681 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
20682
20683 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
20684
20685 * process.c (Fformat_network_address): Doc fix.
20686
20687 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
20688
20689 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
20690
20691 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
20692
20693 * keyboard.c (read_char): Call Lisp function help-form-show,
20694 instead of using internal_with_output_to_temp_buffer.
20695 (Qhelp_form_show): New var.
20696 (syms_of_keyboard): Use DEFSYM macro.
20697
20698 * print.c (internal_with_output_to_temp_buffer): Function deleted.
20699
20700 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
20701
20702 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
20703
20704 * process.c (Flist_processes): Remove to Lisp.
20705 (list_processes_1): Delete.
20706
20707 2011-04-06 Eli Zaretskii <eliz@gnu.org>
20708
20709 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
20710
20711 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
20712
20713 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
20714
20715 Fix more problems found by GCC 4.6.0's static checks.
20716
20717 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
20718
20719 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
20720
20721 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
20722
20723 * xdisp.c (vmessage): Mark as a printf-like function.
20724
20725 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
20726
20727 * sound.c (sound_warning): Don't crash if arg contains a printf format.
20728
20729 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
20730 printf-like functions.
20731 (tiff_load): Add casts to remove these marks before passing them
20732 to system-supplied API.
20733
20734 * eval.c (Fsignal): Remove excess argument to 'fatal'.
20735
20736 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
20737 This avoids several warnings with gcc -Wstrict-overflow.
20738 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
20739 directly, rather than having caller test rule sign. This avoids
20740 some unnecessary tests.
20741 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
20742 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
20743 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
20744
20745 * xfont.c (xfont_text_extents): Remove var that was set but not used.
20746 (xfont_open): Avoid unnecessary tests.
20747
20748 * composite.c (composition_gstring_put_cache): Use unsigned integer.
20749
20750 * composite.h, composite.c (composition_gstring_put_cache):
20751 Use EMACS_INT, not int, for length.
20752
20753 * composite.h (COMPOSITION_DECODE_REFS): New macro,
20754 breaking out part of COMPOSITION_DECODE_RULE.
20755 (COMPOSITION_DECODE_RULE): Use it.
20756 * composite.c (get_composition_id): Remove unused local vars,
20757 by using the new macro.
20758
20759 * textprop.c (set_text_properties_1): Change while to do-while,
20760 since the condition is always true at first.
20761
20762 * intervals.c (graft_intervals_into_buffer): Mark var as used.
20763 (interval_deletion_adjustment): Return unsigned value.
20764 All uses changed.
20765
20766 * process.c (list_processes_1, create_pty, read_process_output):
20767 (exec_sentinel): Remove vars that were set but not used.
20768 (create_pty): Remove unnecessary "volatile"s.
20769 (Fnetwork_interface_info): Avoid possibility of int overflow.
20770 (read_process_output): Do adaptive read buffering even if carryover.
20771 (read_process_output): Simplify nbytes computation if buffered.
20772
20773 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
20774
20775 * syntax.c (scan_words): Remove var that was set but not used.
20776 (update_syntax_table): Use unsigned instead of int.
20777
20778 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
20779 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
20780 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
20781
20782 * print.c (print_error_message): Avoid int overflow.
20783
20784 * font.c (font_list_entities): Redo for clarity,
20785 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
20786
20787 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
20788 (font_score): Avoid potential overflow in diff calculation.
20789
20790 * fns.c (substring_both): Remove var that is set but not used.
20791 (sxhash): Redo loop for clarity and to avoid wraparound warning.
20792
20793 * eval.c (funcall_lambda): Rename local to avoid shadowing.
20794
20795 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
20796 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
20797 can always succeed if overflow has undefined behavior.
20798
20799 * search.c (boyer_moore, wordify): Remove vars set but not used.
20800 (wordify): Omit three unnecessary tests.
20801
20802 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
20803 All callers changed. This avoids the need for an unused var.
20804
20805 * casefiddle.c (casify_region): Remove var that is set but not used.
20806
20807 * dired.c (file_name_completion): Remove var that is set but not used.
20808
20809 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
20810
20811 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
20812 (Finsert_file_contents): Remove unnecessary code checking fd.
20813
20814 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
20815 Check for integer overflow on size calculations.
20816
20817 * buffer.c (Fprevious_overlay_change): Remove var that is set
20818 but not used.
20819
20820 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
20821 Remove vars that are set but not used.
20822 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
20823 (timer_check_2): Mark vars as initialized.
20824
20825 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
20826
20827 * image.c (lookup_image): Remove var that is set but not used.
20828 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
20829
20830 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
20831 that are set but not used.
20832
20833 * xfns.c (make_invisible_cursor): Don't return garbage
20834 if XCreateBitmapFromData fails (Bug#8410).
20835
20836 * xselect.c (x_get_local_selection, x_handle_property_notify):
20837 Remove vars that are set but not used.
20838
20839 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
20840 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
20841
20842 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
20843 Remove var that is set but not used.
20844 (scroll_bar_windows_size): Now size_t, not int.
20845 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
20846 Check for overflow.
20847
20848 * xfaces.c (realize_named_face): Remove vars that are set but not used.
20849 (map_tty_color) [!defined MSDOS]: Likewise.
20850
20851 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
20852
20853 * coding.c: Remove vars that are set but not used.
20854 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
20855 All callers changed.
20856 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
20857 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
20858 (decode_coding_charset): Remove vars that are set but not used.
20859
20860 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
20861 that is set but not used.
20862
20863 * print.c (print_object): Remove var that is set but not used.
20864
20865 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
20866 The gnulib version avoids calling malloc in the usual case,
20867 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
20868 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
20869 * filelock.c (current_lock_owner): Likewise.
20870 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
20871 * sysdep.c: Include allocator.h, careadlinkat.h.
20872 (emacs_no_realloc_allocator): New static constant.
20873 (emacs_readlink): New function.
20874 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
20875 ../lib/careadlinkat.h.
20876
20877 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
20878
20879 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
20880 first non-nil return value).
20881
20882 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
20883
20884 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
20885 if not defined (Bug#8403).
20886
20887 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
20888
20889 * xdisp.c (display_count_lines): Remove parameter `start',
20890 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20891 (get_char_face_and_encoding): Remove parameter `multibyte_p',
20892 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20893 (fill_stretch_glyph_string): Remove parameters `row' and `area',
20894 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
20895 and thereabouts. All callers changed.
20896 (get_per_char_metric): Remove parameter `f', unused since
20897 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20898
20899 2011-04-02 Jim Meyering <meyering@redhat.com>
20900
20901 do not dereference NULL upon failed strdup
20902 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
20903 (ns_get_family): Likewise.
20904
20905 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
20906
20907 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
20908
20909 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
20910
20911 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
20912 later (Bug#8403).
20913
20914 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
20915
20916 Add lexical binding.
20917
20918 * window.c (Ftemp_output_buffer_show): New fun.
20919 (Fsave_window_excursion):
20920 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
20921
20922 * lread.c (lisp_file_lexically_bound_p): New function.
20923 (Fload): Bind Qlexical_binding.
20924 (readevalloop): Remove `evalfun' arg.
20925 Bind Qinternal_interpreter_environment.
20926 (Feval_buffer): Bind Qlexical_binding.
20927 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
20928 Mark as dynamic.
20929 (syms_of_lread): Declare `lexical-binding'.
20930
20931 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
20932
20933 * keyboard.c (eval_dyn): New fun.
20934 (menu_item_eval_property): Use it.
20935
20936 * image.c (parse_image_spec): Use Ffunctionp.
20937
20938 * fns.c (concat, mapcar1): Accept byte-code-functions.
20939
20940 * eval.c (Fsetq): Handle lexical vars.
20941 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
20942 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
20943 (FletX, Flet): Obey lexical binding.
20944 (Fcommandp): Handle closures.
20945 (Feval): New `lexical' arg.
20946 (eval_sub): New function extracted from Feval. Use it almost
20947 everywhere where Feval was used. Look up vars in lexical env.
20948 Handle closures.
20949 (Ffunctionp): Move from subr.el.
20950 (Ffuncall): Handle closures.
20951 (apply_lambda): Remove `eval_flags'.
20952 (funcall_lambda): Handle closures and new byte-code-functions.
20953 (Fspecial_variable_p): New function.
20954 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
20955 but without exporting it to Lisp.
20956
20957 * doc.c (Fdocumentation, store_function_docstring):
20958 * data.c (Finteractive_form): Handle closures.
20959
20960 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
20961 interactive spec.
20962
20963 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
20964 New byte-codes.
20965 (exec_byte_code): New function extracted from Fbyte_code to handle new
20966 calling convention for byte-code-functions. Add new byte-codes.
20967
20968 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
20969
20970 * alloc.c (Fmake_symbol): Init new `declared_special' field.
20971
20972 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
20973
20974 * xdisp.c (redisplay_internal): Fix prototype.
20975
20976 2011-03-31 Eli Zaretskii <eliz@gnu.org>
20977
20978 * xdisp.c (SCROLL_LIMIT): New macro.
20979 (try_scrolling): Use it when setting scroll_limit.
20980 Limit scrolling to 100 screen lines.
20981 (redisplay_window): Even when falling back on "recentering",
20982 position point in the window according to scroll-conservatively,
20983 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
20984
20985 (try_scrolling): When point is above the window, allow searching
20986 as far as scroll_max, or one screenful, to compute vertical
20987 distance from PT to the scroll margin position. This prevents
20988 try_scrolling from unnecessarily failing when
20989 scroll-conservatively is set to a value slightly larger than the
20990 window height. Clean up the case of PT below the margin at bottom
20991 of window: scroll_max can no longer be INT_MAX. When aggressive
20992 scrolling is in use, don't let point enter the opposite scroll
20993 margin as result of the scroll.
20994 (syms_of_xdisp) <scroll-conservatively>: Document the
20995 threshold of 100 lines for never-recentering scrolling.
20996
20997 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
20998
20999 * dispextern.h (move_it_by_lines):
21000 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21001 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21002 (message_log_check_duplicate): Remove parameters `prev_bol' and
21003 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21004 (redisplay_internal): Remove parameter `preserve_echo_area',
21005 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21006
21007 * indent.c (Fvertical_motion):
21008 * window.c (window_scroll_pixel_based, Frecenter):
21009 Don't pass `need_y_p' to `move_it_by_lines'.
21010
21011 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21012
21013 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21014 steal a few bits to be more compact.
21015 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21016 Remove unneeded casts.
21017
21018 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21019
21020 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21021
21022 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21023 binding" message (bug#7967).
21024
21025 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21026
21027 Fix more problems found by GCC 4.6.0's static checks.
21028
21029 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21030 Remove unused local var.
21031
21032 * editfns.c (Fmessage_box): Remove unused local var.
21033
21034 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21035 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21036 Omit unused local vars.
21037 * window.c (shrink_windows): Omit unused local var.
21038 * menu.c (digest_single_submenu): Omit unused local var.
21039 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21040 Omit unused local var.
21041
21042 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21043 Don't assume string length fits in int.
21044 (keyremap_step, read_key_sequence): Use size_t for sizes.
21045 (read_key_sequence): Don't check last_real_key_start redundantly.
21046
21047 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21048 instead of alloca (Bug#8344).
21049
21050 * eval.c (Fbacktrace): Don't assume nargs fits in int.
21051 (Fbacktrace_frame): Don't assume nframes fits in int.
21052
21053 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21054
21055 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21056 concerns.
21057
21058 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21059
21060 * cm.c (calccost): Turn while-do into do-while, for clarity.
21061
21062 * keyboard.c (syms_of_keyboard): Use the same style as later
21063 in this function when indexing through an array. This also
21064 works around GCC bug 48267.
21065
21066 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21067
21068 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21069
21070 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21071 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21072
21073 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21074 This avoids undefined behavior on integer overflow, and is a bit
21075 more convenient anyway since it is compared to a size_t variable.
21076
21077 Variadic C functions now count arguments with size_t, not int.
21078 This avoids an unnecessary limitation on 64-bit machines, which
21079 caused (substring ...) to crash on large vectors (Bug#8344).
21080 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21081 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
21082 All variadic functions and their callers changed accordingly.
21083 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21084 * data.c (arith_driver, float_arith_driver): Likewise.
21085 * editfns.c (general_insert_function): Likewise.
21086 * eval.c (struct backtrace.nargs, interactive_p)
21087 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21088 (funcall_lambda, mark_backtrace): Likewise.
21089 * fns.c (concat): Likewise.
21090 * frame.c (x_set_frame_parameters): Likewise.
21091 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21092 0 if not found, not -1. All callers changed.
21093
21094 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21095 (stack_copy_size): Now size_t, not int.
21096 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21097
21098 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21099
21100 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21101 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21102 All callers changed.
21103
21104 * lisp.h (multibyte_char_to_unibyte):
21105 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21106 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21107 * character.h (CHAR_TO_BYTE8):
21108 * cmds.c (internal_self_insert):
21109 * editfns.c (general_insert_function):
21110 * keymap.c (push_key_description):
21111 * search.c (Freplace_match):
21112 * xdisp.c (message_dolog, set_message_1): All callers changed.
21113
21114 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21115
21116 * keyboard.c (safe_run_hook_funcall): New function.
21117 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21118 don't set the hook to nil, but remove the offending function instead.
21119 (Qcommand_hook_internal): Remove, unused.
21120 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21121 Vcommand_hook_internal.
21122
21123 * eval.c (enum run_hooks_condition): Remove.
21124 (funcall_nil, funcall_not): New functions.
21125 (run_hook_with_args): Call each function through a `funcall' argument.
21126 Remove `cond' argument, now redundant.
21127 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21128 (Frun_hook_with_args_until_failure): Adjust accordingly.
21129 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21130
21131 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21132
21133 * dispextern.h (string_buffer_position): Remove declaration.
21134
21135 * print.c (strout): Remove parameter `multibyte', unused since
21136 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21137
21138 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21139 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21140 All callers changed.
21141
21142 * w32.c (_wsa_errlist): Use braces for struct initializers.
21143
21144 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21145 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21146 All callers changed.
21147 (string_buffer_position): Likewise. Also, make static (it's never
21148 used outside xdisp.c).
21149 (cursor_row_p): Remove parameter `w', unused since
21150 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21151 (decode_mode_spec): Remove parameter `precision', introduced during
21152 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21153 All callers changed.
21154
21155 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21156
21157 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21158
21159 2011-03-27 Anders Lindgren <andlind@gmail.com>
21160
21161 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21162 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21163 (ns_update_auto_hide_menu_bar): New functions.
21164 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21165 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21166 ns_constrain_all_frames.
21167 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21168 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21169
21170 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21171
21172 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21173
21174 2011-03-27 Glenn Morris <rgm@gnu.org>
21175
21176 * syssignal.h: Replace RETSIGTYPE with void.
21177 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21178 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21179 Replace SIGTYPE with void everywhere.
21180 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21181 * s/template.h (SIGTYPE): Remove commented out definition.
21182
21183 2011-03-26 Eli Zaretskii <eliz@gnu.org>
21184
21185 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21186 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21187
21188 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
21189
21190 * w32.c (read_unc_volume): Use parameter `henum', instead of
21191 global variable `wget_enum_handle'.
21192
21193 * keymap.c (describe_vector): Remove parameters `indices' and
21194 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21195 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21196
21197 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21198
21199 * keyboard.c (timer_check): Remove parameter `do_it_now',
21200 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21201 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21202 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21203
21204 * keyboard.c (read_char):
21205 * w32menu.c (w32_menu_display_help):
21206 * xmenu.c (show_help_event, menu_help_callback):
21207 Adjust calls to `show_help_echo'.
21208
21209 * gtkutil.c (xg_maybe_add_timer):
21210 * keyboard.c (readable_events):
21211 * process.c (wait_reading_process_output):
21212 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21213
21214 * insdel.c (adjust_markers_gap_motion):
21215 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21216 (gap_left, gap_right): Don't call it.
21217
21218 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
21219
21220 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21221 incurred during fontification.
21222
21223 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
21224
21225 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
21226 (DEFVAR_PER_BUFFER): Don't pass it.
21227
21228 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
21229 (scrolling_window): Don't pass it.
21230
21231 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
21232
21233 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
21234
21235 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
21236 and `suffix'.
21237 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
21238 of variables specific to SELinux and computation of `encoded_absname'.
21239
21240 * image.c (XPutPixel): Remove unused variable `height'.
21241
21242 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
21243
21244 * unexw32.c (get_section_info): Remove unused variable `section'.
21245
21246 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
21247 (system_process_attributes): Remove unused variable `sess'.
21248 (sys_read): Remove unused variable `err'.
21249
21250 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
21251 (w32_wnd_proc): Remove unused variable `isdead'.
21252 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
21253 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
21254 (x_create_tip_frame): Remove unused variable `tem'.
21255
21256 * w32inevt.c (w32_console_read_socket):
21257 Remove unused variable `no_events'.
21258
21259 * w32term.c (x_draw_composite_glyph_string_foreground):
21260 Remove unused variable `width'.
21261
21262 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
21263
21264 * w32term.c (x_set_glyph_string_clipping):
21265 Don't pass uninitialized region to CombineRgn.
21266
21267 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
21268
21269 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
21270 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
21271 (Fx_close_connection): Remove unused variable `i'.
21272
21273 * w32font.c (w32font_draw): Return number of glyphs.
21274 (w32font_open_internal): Remove unused variable `i'.
21275 (w32font_driver): Add missing initializer.
21276
21277 * w32menu.c (utf8to16): Remove unused variable `utf16'.
21278 (fill_in_menu): Remove unused variable `items_added'.
21279
21280 * w32term.c (last_mouse_press_frame): Remove static global variable.
21281 (w32_clip_to_row): Remove unused variable `f'.
21282 (x_delete_terminal): Remove unused variable `i'.
21283
21284 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
21285 (NOTHING): Remove unused static global variable.
21286 (uniscribe_check_otf): Remove unused variable `table'.
21287 (uniscribe_font_driver): Add missing initializers.
21288
21289 2011-03-23 Julien Danjou <julien@danjou.info>
21290
21291 * term.c (Fsuspend_tty, Fresume_tty):
21292 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
21293 * window.c (temp_output_buffer_show):
21294 * insdel.c (signal_before_change):
21295 * frame.c (Fhandle_switch_frame):
21296 * fileio.c (Fdo_auto_save):
21297 * emacs.c (Fkill_emacs):
21298 * editfns.c (save_excursion_restore):
21299 * cmds.c (internal_self_insert):
21300 * callint.c (Fcall_interactively):
21301 * buffer.c (Fkill_all_local_variables):
21302 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
21303 Use Frun_hooks.
21304 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
21305 unconditionally since it does the check itself.
21306
21307 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
21308
21309 Fix more problems found by GCC 4.5.2's static checks.
21310
21311 * coding.c (encode_coding_raw_text): Avoid unnecessary test
21312 the first time through the loop, since we know p0 < p1 then.
21313 This also avoids a gcc -Wstrict-overflow warning.
21314
21315 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
21316 leading to a memory leak, possible in functions like
21317 load_charset_map_from_file that can allocate an unbounded number
21318 of objects (Bug#8318).
21319
21320 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
21321 that could (at least in theory) be that large.
21322
21323 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
21324 This is less likely to overflow, and avoids undefined behavior if
21325 overflow does occur. All callers changed. Use strtoul to scan
21326 for the unsigned long integer.
21327 (pint2hrstr): Simplify and tune code slightly.
21328 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
21329
21330 * scroll.c (do_scrolling): Work around GCC bug 48228.
21331 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
21332
21333 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
21334 This also avoids a warning with gcc -Wstrict-overflow.
21335 (validate_x_resource_name): Simplify count usage.
21336 This also avoids a warning with gcc -Wstrict-overflow.
21337
21338 * fileio.c (Fcopy_file): Report error if fchown or fchmod
21339 fail (Bug#8306).
21340
21341 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
21342
21343 * process.c (Fmake_network_process): Use socklen_t, not int,
21344 where POSIX says socklen_t is required in portable programs.
21345 This fixes a porting bug on hosts like 64-bit HP-UX, where
21346 socklen_t is wider than int (Bug#8277).
21347 (Fmake_network_process, server_accept_connection):
21348 (wait_reading_process_output, read_process_output):
21349 Likewise.
21350
21351 * process.c: Rename or move locals to avoid shadowing.
21352 (list_processes_1, Fmake_network_process):
21353 (read_process_output_error_handler, exec_sentinel_error_handler):
21354 Rename or move locals.
21355 (Fmake_network_process): Define label "retry_connect" only if needed.
21356 (Fnetwork_interface_info): Fix pointer signedness.
21357 (process_send_signal): Add cast to avoid pointer signedness problem.
21358 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
21359 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
21360
21361 Make tparam.h and terminfo.c consistent.
21362 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
21363 Include tparam.h instead, since it declares them.
21364 * cm.h (PC): Remove extern decl; tparam.h now does this.
21365 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
21366 * terminfo.c: Include tparam.h, to check interfaces.
21367 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
21368 (tparam): Adjust signature to match interface in tparam.h;
21369 this removes some undefined behavior. Check that outstring and len
21370 are zero, which they always are with Emacs.
21371 * tparam.h (PC, BC, UP): New extern decls.
21372
21373 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
21374 (xftfont_open): Rename locals to avoid shadowing.
21375
21376 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
21377 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
21378 (OTF_TAG_SYM): Omit macro if not needed.
21379 (ftfont_list): Remove unused local.
21380 (get_adstyle_property, ftfont_pattern_entity):
21381 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
21382 Rename locals to avoid shadowing.
21383
21384 * xfont.c (xfont_list_family): Mark var as initialized.
21385
21386 * xml.c (make_dom): Now static.
21387
21388 * composite.c (composition_compute_stop_pos): Rename local to
21389 avoid shadowing.
21390 (composition_reseat_it): Remove unused locals.
21391 (find_automatic_composition, composition_adjust_point): Likewise.
21392 (composition_update_it): Mark var as initialized.
21393 (find_automatic_composition): Mark vars as initialized,
21394 with a FIXME (Bug#8290).
21395
21396 character.h: Rename locals to avoid shadowing.
21397 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
21398 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
21399 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
21400 (BUF_DEC_POS): Be more systematic about renaming local temporaries
21401 to avoid shadowing.
21402
21403 * textprop.c (property_change_between_p): Remove; unused.
21404
21405 * intervals.c (interval_start_pos): Now static.
21406
21407 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
21408
21409 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
21410 Rename locals to avoid shadowing.
21411
21412 * sound.c (wav_play, au_play, Fplay_sound_internal):
21413 Fix pointer signedness.
21414 (alsa_choose_format): Remove unused local var.
21415 (wav_play): Initialize a variable to 0, to prevent undefined
21416 behavior (Bug#8278).
21417
21418 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
21419
21420 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
21421
21422 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
21423 clobbering (Bug#8298).
21424 * sysdep.c (sys_subshell): Likewise.
21425 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
21426
21427 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
21428 This should get cleaned up, so that child_setup has the
21429 same signature on all platforms.
21430
21431 * callproc.c (call_process_cleanup): Now static.
21432 (relocate_fd): Rename locals to avoid shadowing.
21433
21434 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
21435
21436 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
21437 not to be necessary, and produces flickering.
21438
21439 2011-03-20 Glenn Morris <rgm@gnu.org>
21440
21441 * config.in: Remove file.
21442
21443 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
21444
21445 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
21446 are now in src/globals.h.
21447 (syms_of_minibuf): Remove spurious & from previous change.
21448
21449 2011-03-20 Leo Liu <sdl.web@gmail.com>
21450
21451 * minibuf.c (completing-read-function): New variable.
21452 (completing-read-default): Rename from completing-read.
21453 (completing-read): Call completing-read-function.
21454
21455 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
21456
21457 * xfaces.c (Fx_load_color_file):
21458 Read color file from absolute filename (bug#8250).
21459
21460 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
21461
21462 * makefile.w32-in: Update dependencies.
21463
21464 2011-03-17 Eli Zaretskii <eliz@gnu.org>
21465
21466 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
21467
21468 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
21469
21470 Fix more problems found by GCC 4.5.2's static checks.
21471
21472 * process.c (make_serial_process_unwind, send_process_trap):
21473 (sigchld_handler): Now static.
21474
21475 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
21476 That way, the code declares only the vars that it needs.
21477 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
21478 * s/cygwin.h (PTY_ITERATION): Likewise.
21479 * s/darwin.h (PTY_ITERATION): Likewise.
21480 * s/gnu-linux.h (PTY_ITERATION): Likewise.
21481
21482 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
21483 * process.c (allocate_pty): Don't declare stb unless it's needed.
21484
21485 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
21486 (CONSTANTLIM): Remove; unused.
21487 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
21488 Define only if needed.
21489
21490 * unexelf.c (unexec): Name an expression,
21491 to avoid gcc -Wbad-function-cast warning.
21492 Use a different way to cause a compilation error if anyone uses
21493 n rather than nn, a way that does not involve shadowing.
21494 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
21495
21496 * deps.mk (unexalpha.o): Remove; unused.
21497
21498 New file unexec.h, the (simple) interface for unexec (Bug#8267).
21499 * unexec.h: New file.
21500 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
21501 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
21502 Depend on unexec.h.
21503 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
21504 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
21505 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
21506 Change as necessary to match prototype in unexec.h.
21507
21508 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
21509 shadowing.
21510 (back_comment, skip_chars): Mark vars as initialized.
21511
21512 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
21513 Rename locals to avoid shadowing.
21514
21515 * lread.c (read1): Rewrite so as not to use empty "else".
21516 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
21517
21518 * print.c (Fredirect_debugging_output): Fix pointer signedess.
21519
21520 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
21521 warning when compiling print.c.
21522
21523 * font.c (font_unparse_fcname): Abort in an "impossible" situation
21524 instead of using an uninitialized var.
21525 (font_sort_entities): Mark var as initialized.
21526
21527 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
21528
21529 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
21530 pointers to constants.
21531 (font_parse_fcname): Remove unused vars.
21532 (font_delete_unmatched): Now static.
21533 (font_get_spec): Remove; unused.
21534 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
21535 (font_update_drivers, Ffont_get_glyphs, font_add_log):
21536 Rename or move locals to avoid shadowing.
21537
21538 * fns.c (require_nesting_list, require_unwind): Now static.
21539 (Ffillarray): Rename locals to avoid shadowing.
21540
21541 * floatfns.c (domain_error2): Define only if needed.
21542 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
21543
21544 * alloc.c (mark_backtrace): Move decl from here ...
21545 * lisp.h: ... to here, so that it can be checked.
21546
21547 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
21548 (Fdefvar): Rewrite so as not to use empty "else".
21549 (lisp_indirect_variable): Name an expression,
21550 to avoid gcc -Wbad-function-cast warning.
21551 (Fdefvar): Rename locals to avoid shadowing.
21552
21553 * callint.c (quotify_arg, quotify_args): Now static.
21554 (Fcall_interactively): Rename locals to avoid shadowing.
21555 Use const pointer when appropriate.
21556
21557 * lisp.h (get_system_name, get_operating_system_release):
21558 Move decls here, to check interfaces.
21559 * process.c (get_operating_system_release): Move decl to lisp.h.
21560 * xrdb.c (get_system_name): Likewise.
21561 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
21562 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
21563 some of which prompt warnings from gcc -Wbad-function-cast.
21564 (Fformat_time_string, Fencode_time, Finsert_char):
21565 (Ftranslate_region_internal, Fformat):
21566 Rename or remove local vars to avoid shadowing.
21567 (Ftranslate_region_internal): Mark var as initialized.
21568
21569 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
21570 avoid shadowing.
21571
21572 * lisp.h (eassert): Check that the argument compiles, even if
21573 ENABLE_CHECKING is not defined.
21574
21575 * data.c (Findirect_variable): Name an expression, to avoid
21576 gcc -Wbad-function-cast warning.
21577 (default_value, arithcompare, arith_driver, arith_error): Now static.
21578 (store_symval_forwarding): Rename local to avoid shadowing.
21579 (Fmake_variable_buffer_local, Fmake_local_variable):
21580 Mark variables as initialized.
21581 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
21582
21583 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
21584 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
21585 Rename locals to avoid shadowing.
21586 (mark_stack): Move local variables into the #ifdef region where
21587 they're used.
21588 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
21589 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
21590 needed otherwise.
21591 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
21592 (GC_STRING_CHARS): Remove; not used.
21593 (Fmemory_limit): Cast sbrk's returned value to char *.
21594
21595 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
21596 avoids undefined behavior in theory.
21597
21598 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
21599
21600 Use functions, not macros, for up- and down-casing (Bug#8254).
21601 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21602 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
21603 to use the following functions instead of these macros.
21604 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
21605 EMACS_INT, since callers assume the returned value fits in int.
21606 (upcase1): Likewise, for UPCASE_TABLE.
21607 (uppercasep, lowercasep, upcase): New static inline functions.
21608 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
21609 the race-condition problem in the old DOWNCASE.
21610
21611 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
21612 Rename locals to avoid shadowing.
21613 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
21614 (regex_compile, re_search_2, re_match_2_internal):
21615 Remove unused local vars.
21616 (FREE_VAR): Rewrite so as not to use empty "else",
21617 which gcc can warn about.
21618 (regex_compile, re_match_2_internal): Mark locals as initialized.
21619 (RETALLOC_IF): Define only if needed.
21620 (WORDCHAR_P): Likewise. This one is never needed, but is used
21621 only in a comment talking about a compiler bug, so put inside
21622 the #if 0 of that comment.
21623 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
21624 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
21625 Remove; unused.
21626
21627 * search.c (boyer_moore): Rename locals to avoid shadowing.
21628 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
21629 (PREV_CHAR_BOUNDARY): Likewise.
21630
21631 * search.c (simple_search): Remove unused var.
21632
21633 * dired.c (compile_pattern): Move decl from here ...
21634 * lisp.h: ... to here, so that it can be checked.
21635 (struct re_registers): New forward decl.
21636
21637 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
21638
21639 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
21640 All uses changed.
21641 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
21642 Rename locals to avoid shadowing.
21643 (Fvertical_motion): Mark locals as initialized.
21644
21645 * casefiddle.c (casify_object, casify_region): Now static.
21646 (casify_region): Mark local as initialized.
21647
21648 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
21649
21650 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
21651 New macros, so that the caller can use some names other than
21652 gcpro1, gcpro2, etc.
21653 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
21654 of the new macros.
21655 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
21656 argument, for consistency with GCPRO2_VAR, etc: it is now the
21657 prefix of the variable, not the variable itself. All uses
21658 changed.
21659 * dired.c (directory_files_internal, file_name_completion):
21660 Rename locals to avoid shadowing.
21661
21662 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
21663 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
21664 dired.c's scmp function, had undefined behavior.
21665 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21666 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
21667 * buffer.h: ... to here, because these macros use current_buffer,
21668 and the new implementation with inline functions needs to have
21669 current_buffer in scope now, rather than later when the macros
21670 are used.
21671 (downcase, upcase1): New static inline functions.
21672 (DOWNCASE, UPCASE1): Reimplement using these functions.
21673 This avoids undefined behavior in expressions like
21674 DOWNCASE (x) == DOWNCASE (y), which previously suffered
21675 from race conditions in accessing the global variables
21676 case_temp1 and case_temp2.
21677 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
21678 * lisp.h (case_temp1, case_temp2): Remove their decls.
21679 * character.h (ASCII_CHAR_P): Move from here ...
21680 * lisp.h: ... to here, so that the inline functions mentioned
21681 above can use them.
21682
21683 * dired.c (directory_files_internal_unwind): Now static.
21684
21685 * fileio.c (file_name_as_directory, directory_file_name):
21686 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
21687 Now static.
21688 (file_name_as_directory): Use const pointers when appropriate.
21689 (Fexpand_file_name): Likewise. In particular, newdir might
21690 point at constant storage, so make it a const pointer.
21691 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
21692 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
21693 signedness issues.
21694 (Fset_file_times, Finsert_file_contents, auto_save_error):
21695 Rename locals to avoid shadowing.
21696
21697 * minibuf.c (choose_minibuf_frame_1): Now static.
21698 (Ftry_completion, Fall_completions): Rename or remove locals
21699 to avoid shadowing.
21700
21701 * marker.c (bytepos_to_charpos): Remove; unused.
21702
21703 * lisp.h (verify_bytepos, count_markers): New decls,
21704 so that gcc does not warn that these functions aren't declared.
21705
21706 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
21707 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
21708 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
21709 (copy_text): Remove unused local var.
21710
21711 * filelock.c (within_one_second): Now static.
21712 (lock_file_1): Rename local to avoid shadowing.
21713
21714 * buffer.c (fix_overlays_before): Mark locals as initialized.
21715 (fix_start_end_in_overlays): Likewise. This function should be
21716 simplified by using pointers-to-pointers, but that's a different
21717 matter.
21718 (switch_to_buffer_1): Now static.
21719 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
21720 (report_overlay_modification): Rename locals to avoid shadowing.
21721
21722 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
21723 Fix pointer signedness issue.
21724 (sys_subshell): Mark local as volatile if checking for lint,
21725 to suppress a gcc -Wclobbered warning that does not seem to be right.
21726 (MAXPATHLEN): Define only if needed.
21727
21728 * process.c (serial_open, serial_configure): Move decls from here ...
21729 * systty.h: ... to here, so that they can be checked.
21730
21731 * fns.c (get_random, seed_random): Move extern decls from here ...
21732 * lisp.h: ... to here, so that they can be checked.
21733
21734 * sysdep.c (reset_io): Now static.
21735 (wait_for_termination_signal): Remove; unused.
21736
21737 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
21738 (copy_keymap_item, append_key, push_text_char_description):
21739 Now static.
21740 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
21741 (DENSE_TABLE_SIZE): Remove; unused.
21742 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
21743 (describe_map_tree):
21744 Rename locals to avoid shadowing.
21745
21746 * keyboard.c: Declare functions static if they are not used elsewhere.
21747 (echo_char, echo_dash, cmd_error, top_level_2):
21748 (poll_for_input, handle_async_input): Now static.
21749 (read_char, kbd_buffer_get_event, make_lispy_position):
21750 (make_lispy_event, make_lispy_movement, apply_modifiers):
21751 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
21752 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
21753 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
21754 (read_key_sequence, read_char): Mark locals as initialized.
21755 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
21756
21757 * keyboard.h (make_ctrl_char): New decl.
21758 (mark_kboards): Move decl here ...
21759 * alloc.c (mark_kboards): ... from here.
21760
21761 * lisp.h (force_auto_save_soon): New decl.
21762
21763 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
21764 (DEFINE_DUMMY_FUNCTION): New macro.
21765 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
21766 Use it.
21767 (main): Add casts to avoid warnings
21768 if GCC considers string literals to be constants.
21769
21770 * lisp.h (fatal_error_signal): Add decl, since it's exported.
21771
21772 * dbusbind.c: Pointer signedness fixes.
21773 (xd_signature, xd_append_arg, xd_initialize):
21774 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21775 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21776 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
21777 (Fdbus_register_signal): Use SSDATA when the context wants char *.
21778
21779 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
21780 if GCC considers string literals to be constants.
21781 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
21782
21783 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
21784
21785 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
21786 (print_preprocess, print_object): New macro to fix last change.
21787
21788 * print.c (print_preprocess): Don't forget font objects.
21789
21790 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
21791
21792 * emacs.c (USAGE3): Doc fixes.
21793
21794 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
21795
21796 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
21797 structure.
21798
21799 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
21800
21801 * lisp.h (VWindow_system, Qfile_name_history):
21802 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
21803 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
21804 (w32_system_caret_x, w32_system_caret_y): Declare extern.
21805
21806 * w32select.c: Don't #include "keyboard.h".
21807 (run_protected): Add extern declaration for waiting_for_input.
21808
21809 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
21810 * w32console.c (detect_input_pending, read_input_pending)
21811 (encode_terminal_code):
21812 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
21813 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
21814 (w32_system_caret_y, Qfile_name_history):
21815 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
21816 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
21817 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
21818 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
21819 * w32proc.c (Qlocal, report_file_error):
21820 * w32term.c (Vwindow_system, updating_frame):
21821 * w32uniscribe.c (initialized, uniscribe_font_driver):
21822 Remove unneeded extern declarations.
21823
21824 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
21825
21826 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
21827
21828 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
21829
21830 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
21831 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
21832 These macros can no longer be used for assignment.
21833
21834 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
21835 Assign struct members directly, instead of using BUF_BEGV etc.
21836 (record_buffer_markers, fetch_buffer_markers): New functions for
21837 recording and fetching special buffer markers.
21838 (set_buffer_internal_1, set_buffer_temp): Use them.
21839
21840 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
21841
21842 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
21843
21844 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
21845 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
21846
21847 * xdisp.c (hscroll_window_tree):
21848 (reconsider_clip_changes): Use PT instead of BUF_PT.
21849
21850 2011-03-13 Eli Zaretskii <eliz@gnu.org>
21851
21852 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
21853 $(EMACS_ROOT)/lib/intprops.h.
21854
21855 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
21856
21857 Fix more problems found by GCC 4.5.2's static checks.
21858
21859 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
21860 to unsigned char * to avoid compiler diagnostic.
21861 (xg_free_frame_widgets): Make it clear that a local variable is
21862 needed only if USE_GTK_TOOLTIP.
21863 (gdk_window_get_screen): Make it clear that this macro is needed
21864 only if USE_GTK_TOOLTIP.
21865 (int_gtk_range_get_value): New function, which avoids a diagnostic
21866 from gcc -Wbad-function-cast.
21867 (xg_set_toolkit_scroll_bar_thumb): Use it.
21868 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
21869 diagnostic from gcc -Wbad-function-cast.
21870 (get_utf8_string, xg_get_file_with_chooser):
21871 Rename locals to avoid shadowing.
21872 (create_dialog): Move locals to avoid shadowing.
21873
21874 * xgselect.c (xg_select): Remove unused var.
21875
21876 * image.c (four_corners_best): Mark locals as initialized.
21877 (gif_load): Initialize transparent_p to zero (Bug#8238).
21878 Mark another local as initialized.
21879 (my_png_error, my_error_exit): Mark with NO_RETURN.
21880
21881 * image.c (clear_image_cache): Now static.
21882 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
21883 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
21884 (x_edge_detection): Remove unnecessary cast that
21885 gcc -Wbad-function-cast diagnoses.
21886 (gif_load): Fix pointer signedness.
21887 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
21888 (jpeg_load, gif_load): Rename locals to avoid shadowing.
21889
21890 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
21891
21892 Improve quality of tests for time stamp overflow.
21893 For example, without this patch (encode-time 0 0 0 1 1
21894 1152921504606846976) returns the obviously-bogus value (-948597
21895 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
21896 reports time overflow. See
21897 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
21898 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
21899 * editfns.c: Include limits.h and intprops.h.
21900 (TIME_T_MIN, TIME_T_MAX): New macros.
21901 (time_overflow): Move earlier, to before first use.
21902 (hi_time, lo_time): New functions, for an accurate test for
21903 out-of-range times.
21904 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
21905 (Fget_internal_run_time): Don't assume time_t fits in int.
21906 (make_time): Use list2 instead of Fcons twice.
21907 (Fdecode_time): More accurate test for out-of-range times.
21908 (check_tm_member): New function.
21909 (Fencode_time): Use it, to test for out-of-range times.
21910 (lisp_time_argument): Don't rely on undefined left-shift and
21911 right-shift behavior when checking for time stamp overflow.
21912
21913 * editfns.c (time_overflow): New function, refactoring common code.
21914 (Fformat_time_string, Fdecode_time, Fencode_time):
21915 (Fcurrent_time_string): Use it.
21916
21917 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
21918 * dired.c (make_time): Move to ...
21919 * editfns.c (make_time): ... here.
21920 * systime.h: Note the move.
21921
21922 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21923
21924 * fringe.c (update_window_fringes): Remove unused variables.
21925
21926 * unexmacosx.c (copy_data_segment): Also copy __got section.
21927 (Bug#8223)
21928
21929 2011-03-12 Eli Zaretskii <eliz@gnu.org>
21930
21931 * termcap.c [MSDOS]: Include "msdos.h".
21932 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
21933 Constify `char *' arguments and their references according to
21934 prototypes in tparam.h.
21935
21936 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
21937
21938 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
21939 Adapt all references accordingly.
21940
21941 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
21942
21943 2011-03-11 Tom Tromey <tromey@redhat.com>
21944
21945 * buffer.c (syms_of_buffer): Remove obsolete comment.
21946
21947 2011-03-11 Eli Zaretskii <eliz@gnu.org>
21948
21949 * termhooks.h (encode_terminal_code): Declare prototype.
21950
21951 * msdos.c (encode_terminal_code): Don't declare prototype.
21952
21953 * term.c (encode_terminal_code): Now external again, used by
21954 w32console.c and msdos.c.
21955
21956 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
21957 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
21958
21959 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
21960
21961 Fix some minor problems found by GCC 4.5.2's static checks.
21962
21963 * fringe.c (update_window_fringes): Mark locals as initialized
21964 (Bug#8227).
21965 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
21966
21967 * alloc.c (mark_fringe_data): Move decl from here ...
21968 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
21969 to check its interface.
21970 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
21971
21972 * fontset.c (free_realized_fontset): Now static.
21973 (Fset_fontset_font): Rename local to avoid shadowing.
21974 (fontset_font): Mark local as initialized.
21975 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
21976
21977 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
21978
21979 * xselect.c (x_disown_buffer_selections): Remove; not used.
21980 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
21981 (x_own_selection, Fx_disown_selection_internal): Rename locals
21982 to avoid shadowing.
21983 (x_handle_dnd_message): Remove local to avoid shadowing.
21984
21985 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
21986 so that the caller can use some name other than gcpro1.
21987 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
21988 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21989 (Fx_backspace_delete_keys_p):
21990 Use them to avoid shadowing, and rename vars to avoid shadowing.
21991 (x_decode_color, x_set_name, x_window): Now static.
21992 (Fx_create_frame): Add braces to silence GCC warning.
21993 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
21994 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
21995 Remove unused locals.
21996 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21997 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
21998 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
21999 macros.
22000
22001 * xterm.h (x_mouse_leave): New decl.
22002
22003 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22004 Remove unused functions.
22005 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22006 (x_calc_absolute_position): Now static.
22007 (XTread_socket): Don't define label "out" unless it's used.
22008 Don't declare local "event" unless it's used.
22009 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22010 unless they are used.
22011 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22012 (x_fatal_error_signal): Remove; not used.
22013 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22014 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22015 (x_error_catcher, x_connection_closed, x_error_handler):
22016 (x_error_quitter, xembed_send_message, x_iconify_frame):
22017 (my_log_handler): Rename locals to avoid shadowing.
22018 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
22019 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
22020
22021 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22022 Rename or move locals to avoid shadowing.
22023 (tty_defined_color, merge_face_heights): Now static.
22024 (free_realized_faces_for_fontset): Remove; not used.
22025 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22026 does not deduce is never used uninitialized.
22027 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22028 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
22029
22030 * terminal.c (store_terminal_param): Now static.
22031
22032 * xmenu.c (menu_highlight_callback): Now static.
22033 (set_frame_menubar): Remove unused local.
22034 (xmenu_show): Rename parameter to avoid shadowing.
22035 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22036 since they might point to immutable storage.
22037 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22038 since it's unused otherwise.
22039
22040 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
22041 Add a FIXME, since the code still doesn't look right. (Bug#8215)
22042 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22043 avoids a gcc -Wuninitialized diagnostic.
22044 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
22045 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22046 does not deduce are never used uninitialized.
22047
22048 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22049
22050 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
22051 * window.c (window_loop, size_window):
22052 (run_window_configuration_change_hook, enlarge_window): Likewise.
22053
22054 * window.c (display_buffer): Now static.
22055 (size_window): Mark variables that gcc -Wuninitialized
22056 does not deduce are never used uninitialized.
22057 * window.h (check_all_windows): New decl, to forestall
22058 gcc -Wmissing-prototypes diagnostic.
22059 * dispextern.h (bidi_dump_cached_states): Likewise.
22060
22061 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22062 shadowing.
22063 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
22064 Include <limits.h>.
22065 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22066 and to avoid gcc -Wuninitialized warning.
22067 (load_charset_map): Mark variables that gcc -Wuninitialized
22068 does not deduce are never used uninitialized.
22069 (load_charset): Abort instead of using uninitialized var (Bug#8229).
22070
22071 * coding.c (coding_set_source, coding_set_destination):
22072 Use "else { /* comment */ }" rather than "else /* comment */;"
22073 for clarity, and to avoid gcc -Wempty-body warning.
22074 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22075 a block, when the outer 'i' will do.
22076 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22077 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22078 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22079 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22080 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22081 Rename locals to avoid shadowing.
22082 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
22083 * coding.c (emacs_mule_char, encode_invocation_designation):
22084 Now static, since they're not used elsewhere.
22085 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
22086 (decode_coding_object, encode_coding_object, detect_coding_system):
22087 (decode_coding_emacs_mule): Mark variables that gcc
22088 -Wuninitialized does not deduce are never used uninitialized.
22089 (detect_coding_iso_2022): Initialize a local variable that might
22090 be used uninitialized. Leave a FIXME because it's not clear that
22091 this initialization is needed. (Bug#8211)
22092 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22093 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22094 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22095 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22096 Remove unused macros.
22097
22098 * category.c (hash_get_category_set): Remove unused local var.
22099 (copy_category_table): Now static, since it's not used elsewhere.
22100 * character.c (string_count_byte8): Likewise.
22101
22102 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22103 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22104
22105 * chartab.c (copy_sub_char_table): Now static, since it's not used
22106 elsewhere.
22107 (sub_char_table_ref_and_range, char_table_ref_and_range):
22108 Rename locals to avoid shadowing.
22109 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
22110
22111 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
22112 (BIDI_BOB): Remove unused macro.
22113
22114 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22115 deduce are never used uninitialized.
22116 * term.c (encode_terminal_code): Likewise.
22117
22118 * term.c (encode_terminal_code): Now static. Remove unused local.
22119
22120 * tparam.h: New file.
22121 * term.c, tparam.h: Include it.
22122 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22123 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22124 Move these decls to tparam.h, and make them agree with what
22125 is actually in tparam.c. The previous trick of using incompatible
22126 decls in different modules does not conform to the C standard.
22127 All callers of tparam changed to use tparam's actual API.
22128 * tparam.c (tparam1, tparam, tgoto):
22129 Use const pointers where appropriate.
22130
22131 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22132 * cm.h (struct cm): Likewise.
22133 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22134 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22135 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22136 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22137 (turn_on_face, init_tty): Likewise.
22138 * termchar.h (struct tty_display_info): Likewise.
22139
22140 * term.c (term_mouse_position): Rename local to avoid shadowing.
22141
22142 * alloc.c (mark_ttys): Move decl from here ...
22143 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22144
22145 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22146
22147 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22148
22149 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
22150
22151 * search.c (compile_pattern_1): Remove argument regp, unused since
22152 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22153 (compile_pattern): Don't pass it.
22154
22155 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22156
22157 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22158 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22159 for ! HAVE_GTK3.
22160 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22161
22162 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22163
22164 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22165 gdk_window_get_screen, gdk_window_get_geometry,
22166 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22167 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22168 (xg_get_pixbuf_from_pixmap): New function.
22169 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22170 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22171 Call xg_get_pixbuf_from_pixmap instead of
22172 gdk_pixbuf_get_from_drawable.
22173 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22174 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22175 (xg_check_special_colors): Use GtkStyleContext and its functions
22176 for HAVE_GTK3.
22177 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22178 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22179 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
22180 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22181 Call gtk_widget_get_preferred_size.
22182 (xg_frame_resized): gdk_window_get_geometry only takes 5
22183 parameters.
22184 (xg_win_to_widget, xg_event_is_for_menubar):
22185 Call gdk_x11_window_lookup_for_display.
22186 (xg_set_widget_bg): New function.
22187 (delete_cb): New function.
22188 (xg_create_frame_widgets): Connect delete-event to delete_cb.
22189 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
22190 (xg_set_background_color): Call xg_set_widget_bg.
22191 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22192 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22193 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22194 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22195 if ! HAVE_GTK3.
22196 (update_frame_tool_bar): Call gtk_widget_hide.
22197 (xg_initialize): Use GDK_KEY_g.
22198
22199 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22200 if ! HAVE_GTK3
22201 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22202
22203 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22204 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22205 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22206
22207 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
22208
22209 * w32xfns.c (select_palette): Check success of RealizePalette against
22210 GDI_ERROR, not zero.
22211
22212 See ChangeLog.11 for earlier changes.
22213
22214 ;; Local Variables:
22215 ;; coding: utf-8
22216 ;; End:
22217
22218 Copyright (C) 2011-2013 Free Software Foundation, Inc.
22219
22220 This file is part of GNU Emacs.
22221
22222 GNU Emacs is free software: you can redistribute it and/or modify
22223 it under the terms of the GNU General Public License as published by
22224 the Free Software Foundation, either version 3 of the License, or
22225 (at your option) any later version.
22226
22227 GNU Emacs is distributed in the hope that it will be useful,
22228 but WITHOUT ANY WARRANTY; without even the implied warranty of
22229 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22230 GNU General Public License for more details.
22231
22232 You should have received a copy of the GNU General Public License
22233 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.